Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266951
b: refs/heads/master
c: dd898b2
h: refs/heads/master
i:
  266949: 51b797e
  266947: 65a536d
  266943: d3e17b2
v: v3
  • Loading branch information
Mark Brown committed Aug 8, 2011
1 parent f36ef45 commit 8ed69e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2547e201b3693f91d643fc0d21ef86171894b59b
refs/heads/master: dd898b209577b83283bb62400c96426d7582e5a2
12 changes: 3 additions & 9 deletions trunk/drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,13 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg,

map->format.format_reg(map->work_buf, reg);

/* If we're doing a single register write we can probably just
* send the work_buf directly, otherwise try to do a gather
* write.
*/
if (val == map->work_buf + map->format.reg_bytes)
ret = map->bus->write(map->dev, map->work_buf,
map->format.reg_bytes + val_len);
else if (map->bus->gather_write)
/* Try to do a gather write if we can */
if (map->bus->gather_write)
ret = map->bus->gather_write(map->dev, map->work_buf,
map->format.reg_bytes,
val, val_len);

/* If that didn't work fall back on linearising by hand. */
/* Otherwise fall back on linearising by hand. */
if (ret == -ENOTSUPP) {
len = map->format.reg_bytes + val_len;
buf = kmalloc(len, GFP_KERNEL);
Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/regmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
struct i2c_client;
struct spi_device;

/**
* Configuration for the register map of a device.
*
* @reg_bits: Number of bits in a register address, mandatory.
* @val_bits: Number of bits in a register value, mandatory.
*/
struct regmap_config {
int reg_bits;
int val_bits;
Expand Down

0 comments on commit 8ed69e4

Please sign in to comment.