提交 c2f2e2c3 编写于 作者: C ChiaEn Wu 提交者: Sebastian Reichel

lib: add linear range index macro

Add linear_range_idx macro for declaring the linear_range struct simply.
Reviewed-by: NMatti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: NChiaEn Wu <chiaen_wu@richtek.com>
Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
上级 568035b0
无相关合并请求
......@@ -26,6 +26,17 @@ struct linear_range {
unsigned int step;
};
#define LINEAR_RANGE(_min, _min_sel, _max_sel, _step) \
{ \
.min = _min, \
.min_sel = _min_sel, \
.max_sel = _max_sel, \
.step = _step, \
}
#define LINEAR_RANGE_IDX(_idx, _min, _min_sel, _max_sel, _step) \
[_idx] = LINEAR_RANGE(_min, _min_sel, _max_sel, _step)
unsigned int linear_range_values_in_range(const struct linear_range *r);
unsigned int linear_range_values_in_range_array(const struct linear_range *r,
int ranges);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部