3.16.7-ckt4 -stable review patch.  If anyone has any objections, please let me 
know.

------------------

From: Peter Rosin <p...@axentia.se>

commit 681a19560378213a193c424881b2180a783b81ae upstream.

When the codec is connected using i2c, it will only auto-increment
register addresses if msb (0x80) of the register address byte is set.

[Fixes cache sync if multiple adjacent registers are updated -- broonie]

Signed-off-by: Peter Rosin <p...@axentia.se>
Signed-off-by: Mark Brown <broo...@kernel.org>
Signed-off-by: Luis Henriques <luis.henriq...@canonical.com>
---
 sound/soc/codecs/pcm512x-i2c.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/pcm512x-i2c.c b/sound/soc/codecs/pcm512x-i2c.c
index 4d62230bd378..d0547fa275fc 100644
--- a/sound/soc/codecs/pcm512x-i2c.c
+++ b/sound/soc/codecs/pcm512x-i2c.c
@@ -24,8 +24,13 @@ static int pcm512x_i2c_probe(struct i2c_client *i2c,
                             const struct i2c_device_id *id)
 {
        struct regmap *regmap;
+       struct regmap_config config = pcm512x_regmap;
 
-       regmap = devm_regmap_init_i2c(i2c, &pcm512x_regmap);
+       /* msb needs to be set to enable auto-increment of addresses */
+       config.read_flag_mask = 0x80;
+       config.write_flag_mask = 0x80;
+
+       regmap = devm_regmap_init_i2c(i2c, &config);
        if (IS_ERR(regmap))
                return PTR_ERR(regmap);
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to