ASoC: cs4349: Add support for Cirrus Logic CS4349
Subsystems (4)
PATCH v3 1/1 ASoC: cs4349: Add support for Cirrus Logic CS4349
From: Tim Howe <[email protected]>
Signed-off-by Tim Howe <[email protected]>
--- Documentation/devicetree/bindings/sound/cs4349.txt | 19 + sound/soc/codecs/Kconfig | 6 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/cs4349.c | 401 +++++++++++++++++++++ sound/soc/codecs/cs4349.h | 146 ++++++++ 5 files changed, 574 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/cs4349.txt create mode 100644 sound/soc/codecs/cs4349.c create mode 100644 sound/soc/codecs/cs4349.h
Documentation/devicetree/bindings/sound/cs4349.txt new file +19 -0
@@ -0,0 +1,19 @@ +CS4349 audio CODEC + +Required properties: + + - compatible : "cirrus,cs4349" + + - reg : the I2C address of the device for I2C + +Optional properties: + + - reset-gpios : a GPIO spec for the reset pin. + +Example: + +codec: cs4349@48 { + compatible = "cirrus,cs4349"; + reg = <0x48>; + reset-gpios = <&gpio 54 0>; +};
sound/soc/codecs/Kconfig +6 -0
@@ -54,6 +54,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_CS4271_I2C if I2C select SND_SOC_CS4271_SPI if SPI_MASTER select SND_SOC_CS42XX8_I2C if I2C + select SND_SOC_CS4349 if I2C select SND_SOC_CX20442 if TTY select SND_SOC_DA7210 if SND_SOC_I2C_AND_SPI select SND_SOC_DA7213 if I2C
@@ -413,6 +414,11 @@ config SND_SOC_CS42XX8_I2C select SND_SOC_CS42XX8 select REGMAP_I2C +# Cirrus Logic CS4349 HiFi DAC +config SND_SOC_CS4349 + tristate "Cirrus Logic CS4349 CODEC" + depends on I2C + config SND_SOC_CX20442 tristate depends on TTY
sound/soc/codecs/Makefile +2 -0
@@ -46,6 +46,7 @@ snd-soc-cs4271-i2c-objs := cs4271-i2c.o snd-soc-cs4271-spi-objs := cs4271-spi.o snd-soc-cs42xx8-objs := cs42xx8.o snd-soc-cs42xx8-i2c-objs := cs42xx8-i2c.o +snd-soc-cs4349-objs := cs4349.o snd-soc-cx20442-objs := cx20442.o snd-soc-da7210-objs := da7210.o snd-soc-da7213-objs := da7213.o
@@ -237,6 +238,7 @@ obj-$(CONFIG_SND_SOC_CS4271_I2C) += snd-soc-cs4271-i2c.o obj-$(CONFIG_SND_SOC_CS4271_SPI) += snd-soc-cs4271-spi.o obj-$(CONFIG_SND_SOC_CS42XX8) += snd-soc-cs42xx8.o obj-$(CONFIG_SND_SOC_CS42XX8_I2C) += snd-soc-cs42xx8-i2c.o +obj-$(CONFIG_SND_SOC_CS4349) += snd-soc-cs4349.o obj-$(CONFIG_SND_SOC_CX20442) += snd-soc-cx20442.o obj-$(CONFIG_SND_SOC_DA7210) += snd-soc-da7210.o obj-$(CONFIG_SND_SOC_DA7213) += snd-soc-da7213.o
sound/soc/codecs/cs4349.c new file +401 -0
401 lines not on this page · raw message
sound/soc/codecs/cs4349.h new file +146 -0
146 lines not on this page · raw message
Signature · 1 line
2.4.5
Mark Brown
maintainerQuoted 4 lines · On Wed, Jul 15, 2015 at 11:31:49AM -0500, [email protected] wrote:
sound/soc/codecs/cs4349.c new file +4
-0+static int cs4349_runtime_suspend (struct device *dev) +{ +struct cs4349_private *cs4349 =dev_get_drvdata (dev); +struct snd_soc_pcm_runtime *rtd =dev_get_drvdata (dev);
sound/soc/codecs/cs4349.c line 340
Quoted 10 lines
sound/soc/codecs/cs4349.c new file +10
-0+int ret; + + ret =snd_soc_update_bits (rtd->codec,CS4349_MISC ,PWR_DWN ,1 ); +if (ret <0 ) +return ret; + +regcache_sync (cs4349->regmap); +regcache_cache_only (cs4349->regmap, true); + +/* Hold down reset */
So, you've inverted the sync and the cache only here which means we're not going to try to do a sync while cached but we're still doing this immediately before we put the device in reset. Why are we syncing at all? Why would the device be out of sync with the cache and what is the expected result of syncing at this point? We're going to do a sync when we put the device back into write mode...