Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294138
b: refs/heads/master
c: 9aa5075
h: refs/heads/master
v: v3
  • Loading branch information
Wolfram Sang authored and Mark Brown committed Jan 27, 2012
1 parent bacdeb3 commit aff57a2
Show file tree
Hide file tree
Showing 2 changed files with 19 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: a24f64a648376766497fddd8bc24b1ca5b906431
refs/heads/master: 9aa507505cdcd10b7390398790f013374ee74a26
18 changes: 18 additions & 0 deletions trunk/drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit aff57a2

Please sign in to comment.