Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280546
b: refs/heads/master
c: 7e5ec63
h: refs/heads/master
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Nov 16, 2011
1 parent 296a1de commit ae5071f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 19254411db4e69d90958244c5017e7e4a38547b0
refs/heads/master: 7e5ec63ef574775900c82bd98f95bf039f513de3
20 changes: 20 additions & 0 deletions trunk/drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ static void regmap_format_7_9_write(struct regmap *map,
*out = cpu_to_be16((reg << 9) | val);
}

static void regmap_format_10_14_write(struct regmap *map,
unsigned int reg, unsigned int val)
{
u8 *out = map->work_buf;

out[2] = val;
out[1] = (val >> 8) | (reg << 6);
out[0] = reg >> 2;
}

static void regmap_format_8(void *buf, unsigned int val)
{
u8 *b = buf;
Expand Down Expand Up @@ -188,6 +198,16 @@ struct regmap *regmap_init(struct device *dev,
}
break;

case 10:
switch (config->val_bits) {
case 14:
map->format.format_write = regmap_format_10_14_write;
break;
default:
goto err_map;
}
break;

case 8:
map->format.format_reg = regmap_format_8;
break;
Expand Down

0 comments on commit ae5071f

Please sign in to comment.