提交 9aa50750 编写于 作者: W Wolfram Sang 提交者: Mark Brown

regmap: Add support for 2/6 register formating

Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 a24f64a6
......@@ -76,6 +76,14 @@ static bool regmap_volatile_range(struct regmap *map, unsigned int reg,
return true;
}
static void regmap_format_2_6_write(struct regmap *map,
unsigned int reg, unsigned int val)
{
u8 *out = map->work_buf;
*out = (reg << 6) | val;
}
static void regmap_format_4_12_write(struct regmap *map,
unsigned int reg, unsigned int val)
{
......@@ -180,6 +188,16 @@ struct regmap *regmap_init(struct device *dev,
}
switch (config->reg_bits) {
case 2:
switch (config->val_bits) {
case 6:
map->format.format_write = regmap_format_2_6_write;
break;
default:
goto err_map;
}
break;
case 4:
switch (config->val_bits) {
case 12:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册