lkml.org 
[lkml]   [2011]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/8] regmap: Add generic non-memory mapped register access API
On 06/22/2011 08:45 PM, Mark Brown wrote:
> [...]
> +
> +static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
> + unsigned int val_len)
> +{
> + u8 *u8 = map->work_buf;
> + int ret;
> +
> + map->format.format_reg(map->work_buf, reg);
> +
> + /*
> + * Some buses flag reads by setting the high bits in the
> + * register addresss; since it's always the high bits for all
> + * current formats we can do this here rather than in
> + * formatting. This may break if we get interesting formats.
> + */
> + if (map->bus->read_flag_bit)
> + u8[0] |= 1 << map->bus->read_flag_bit;

Should be 1 << (map->bus->read_flag_bit - 1)


\
 
 \ /
  Last update: 2011-06-22 21:07    [from the cache]
©2003-2011 Jasper Spaans