From 681a19560378213a193c424881b2180a783b81ae Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Mon, 8 Dec 2014 16:33:11 +0100 Subject: ASoC: pcm512x: Trigger auto-increment of register addresses on i2c 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 Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/codecs/pcm512x-i2c.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sound/soc/codecs') 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); -- cgit v1.2.3 From 75945896a2f4a7ebfc3402443f99ac32f629ee96 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Tue, 9 Dec 2014 10:14:45 +0800 Subject: ASoC: rt5645: Fix potential crash in jd function If no one defined the rt5645->pdata.hp_det_gpio in coreboot/bios. It will cause kernel to reboot because rt5645->pdata.hp_det_gpio is 0. So it is worth to add a check in rt5645_jack_detect. Signed-off-by: Bard Liao Signed-off-by: Fang, Yang A Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sound/soc/codecs') diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index d16331e0b64d..c901ef6ba69b 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -2113,6 +2113,10 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int gpio_state, jack_type = 0; unsigned int val; + if (!gpio_is_valid(rt5645->pdata.hp_det_gpio)) { + dev_err(codec->dev, "invalid gpio\n"); + return -EINVAL; + } gpio_state = gpio_get_value(rt5645->pdata.hp_det_gpio); dev_dbg(codec->dev, "gpio = %d(%d)\n", rt5645->pdata.hp_det_gpio, -- cgit v1.2.3 From 359ff7ffafa78dd401a1ca0019ba2fe35ff377cc Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Wed, 10 Dec 2014 20:15:25 -0800 Subject: ASoC: rt5677: add REGMAP_I2C and REGMAP_IRQ dependency The codec driver uses regmap to do i2c read/write. The codec driver started to use REGMAP_IRQ since: 5e3363ad1b7b2e1f197a3f56b01e21cb155ad454 ASoC: rt5677: add GPIO IRQ support Signed-off-by: Ben Zhang Signed-off-by: Mark Brown --- sound/soc/codecs/Kconfig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/soc/codecs') diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 883c5778b309..8349f982a586 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -520,6 +520,8 @@ config SND_SOC_RT5670 config SND_SOC_RT5677 tristate + select REGMAP_I2C + select REGMAP_IRQ config SND_SOC_RT5677_SPI tristate -- cgit v1.2.3