Hi,
On 8/17/2016 5:42 PM, Mark Brown wrote:
On Wed, Aug 17, 2016 at 08:34:15AM +0800, John Hsu wrote:
On 8/16/2016 6:38 PM, Mark Brown wrote:
You're not open coding this, this is using regmap!
Yes, the regmap raw read will use regmap finally. But it needs format_val to make the value and it is not registered because no such value width, 9 bits. The system will crash if the driver uses regmap_raw_read with 9 bits value.
The whole point with raw read is that it isn't reformatting the value.
I post the partial function. The format_val is not valid for our codec driver and we can't use the regmap_raw_read(). It's the reason that we need to make the function like regmap_raw_read().
int regmap_raw_read(struct regmap *map, unsigned int reg, ... ) { ... if (regmap_volatile_range(map, reg, val_count) ... ) { ... } else { /* Otherwise go word by word for the cache; should be low * cost as we expect to hit the cache. */ for (i = 0; i < val_count; i++) { ret = _regmap_read(map, reg + regmap_get_offset(map, i), &v); if (ret != 0) goto out;
map->format.format_val(val + (i * val_bytes), v, 0); } }