ASoC: cs53l30: Add codec driver support for Cirrus CS53L30
Subsystems (4)
PATCH v7 1/1 ASoC: cs53l30: Add codec driver support for Cirrus CS53L30
CS53L30 is a Quad-Channel ADC from Cirrus Logic with an I2S/TDM DAI. So this patch adds a codec driver for CS53L30 that includes 4-channel 24-bit recording and TDM mode supports.
---
Changelog:v6->v7
* Added vendor prefixes to properties in DT binding doc
* Updated the property names in the driver accordingly
* Added two required power supplies in the example
* Refined two dev_err messages
* Re-ordered the header files
* Revised the commit logv5->v6
* Added clock controls
* Reconstructed bitfield macros and improved coding style
* Fixed some misuses of regmap_update_bits()
* Added TLV volume controls to replace enums for preamplifier
* Added micbias level in DT instead of exposing to user-space
* Simplified SDOUTx controls by removing cs53l30_asp_sdout_event() (Still be able to use set_tristate() instead)
* Removed useless header files and sort the rest alphabetically
* Registered runtime pm functions to the driver
* Added regulator controls (VA and VP)
* Added writeable register function for regmap
* Merged two ASP dais
* Added TDM support
* Added a simple introduction in commit log
.../devicetree/bindings/sound/cs53l30.txt | 40 + sound/soc/codecs/Kconfig | 6 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/cs53l30.c | 1097 ++++++++++++++++++++ sound/soc/codecs/cs53l30.h | 458 ++++++++ 5 files changed, 1603 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/cs53l30.txt create mode 100644 sound/soc/codecs/cs53l30.c create mode 100644 sound/soc/codecs/cs53l30.h
Documentation/devicetree/bindings/sound/cs53l30.txt new file +40 -0
@@ -0,0 +1,40 @@ +CS53L30 audio CODEC + +Required properties: + + - compatible : "cirrus,cs53l30" + + - reg : the I2C address of the device + + - VA-supply, VP-supply : power supplies for the device, + as covered in Documentation/devicetree/bindings/regulator/regulator.txt. + +Optional properties: + + - reset-gpios : a GPIO spec for the reset pin. + + - cirrus,micbias-lvl : Set the output voltage level on the MICBIAS Pin. + 0 = Hi-Z + 1 = 1.80 V + 2 = 2.75 V + + - cirrus,use-sdout2 : This is a boolean property. If present, it indicates + the hardware design connects both SDOUT1 and SDOUT2 + pins to output data. Otherwise, it indicates that + only SDOUT1 is connected for data output. + * CS53l30 supports 4-channel data output in the same + * frame using two different ways: + * 1) Normal I2S mode on two data pins -- each SDOUT + * carries 2-channel data in the same time. + * 2) TDM mode on one signle data pin -- SDOUT1 carries + * 4-channel data per frame. + +Example: + +codec: cs53l30@48 { + compatible = "cirrus,cs53l30"; + reg = <0x48>; + reset-gpios = <&gpio 54 0>; + VA-supply = <&cs53l30_va>; + VP-supply = <&cs53l30_vp>; +};
sound/soc/codecs/Kconfig +6 -0
@@ -56,6 +56,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_CS42XX8_I2C if I2C select SND_SOC_CS4349 if I2C select SND_SOC_CS47L24 if MFD_CS47L24 + select SND_SOC_CS53L30 if I2C select SND_SOC_CX20442 if TTY select SND_SOC_DA7210 if SND_SOC_I2C_AND_SPI select SND_SOC_DA7213 if I2C
@@ -444,6 +445,11 @@ config SND_SOC_CS4349 config SND_SOC_CS47L24 tristate +# Cirrus Logic Quad-Channel ADC +config SND_SOC_CS53L30 + tristate "Cirrus Logic CS53L30 CODEC" + depends on I2C + config SND_SOC_CX20442 tristate depends on TTY
sound/soc/codecs/Makefile +2 -0
@@ -48,6 +48,7 @@ snd-soc-cs42xx8-objs := cs42xx8.o snd-soc-cs42xx8-i2c-objs := cs42xx8-i2c.o snd-soc-cs4349-objs := cs4349.o snd-soc-cs47l24-objs := cs47l24.o +snd-soc-cs53l30-objs := cs53l30.o snd-soc-cx20442-objs := cx20442.o snd-soc-da7210-objs := da7210.o snd-soc-da7213-objs := da7213.o
@@ -259,6 +260,7 @@ 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_CS47L24) += snd-soc-cs47l24.o +obj-$(CONFIG_SND_SOC_CS53L30) += snd-soc-cs53l30.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/cs53l30.c new file +1097 -0
1,097 lines not on this page · raw message
sound/soc/codecs/cs53l30.h new file +458 -0
458 lines not on this page · raw message
Signature · 1 line
2.1.4
Mark Brown
maintainerOn Wed, May 25, 2016 at 12:38:34PM -0700, Nicolin Chen wrote:
A few minor issues but this is mostly OK so I'll apply - please send followup patches.
sound/soc/codecs/cs53l30.c line 339
Quoted 6 lines
sound/soc/codecs/cs53l30.c new file +6
-0+SOC_DOUBLE_R_TLV ("ADC1 Pre Amp Gain" ,CS53L30_ADC1A_AFE_CTL , +CS53L30_ADC1B_AFE_CTL , CS53L30_ADCxy_PREAMP_SHIFT, +2 ,0 , pga_preamp_tlv), +SOC_DOUBLE_R_TLV ("ADC2 Pre Amp Gain" ,CS53L30_ADC2A_AFE_CTL , +CS53L30_ADC2B_AFE_CTL , CS53L30_ADCxy_PREAMP_SHIFT, + 2, 0, pga_preamp_tlv),
Volume controls should end Volume.
sound/soc/codecs/cs53l30.c line 1058
Quoted 2 lines
sound/soc/codecs/cs53l30.c new file +2
-0+regcache_cache_only (cs53l30->regmap, false); +regcache_sync (cs53l30->regmap);
Should really check the return value here.
Quoted 1 line
+MODULE_AUTHOR("Paul Handrigan, Cirrus Logic Inc, <[email protected]>");
I'd have much preferred to have seen Paul's signoff on the patch.
Quoted 30 lines · Nicolin Chen
CS53L30 is a Quad-Channel ADC from Cirrus Logic with an I2S/TDM DAI. So this patch adds a codec driver for CS53L30 that includes 4-channel 24-bit recording and TDM mode supports.
Signed-off-by Nicolin Chen <[email protected]>---
Changelog:v6->v7
* Added vendor prefixes to properties in DT binding doc
* Updated the property names in the driver accordingly
* Added two required power supplies in the example
* Refined twodev_errmessages
* Re-ordered the header files
* Revised the commit logv5->v6
* Added clock controls
* Reconstructed bitfield macros and improved coding style
* Fixed some misuses ofregmap_update_bits()
* Added TLV volume controls to replace enums for preamplifier
* Added micbias level in DT instead of exposing to user-space
* Simplified SDOUTx controls by removingcs53l30_asp_sdout_event()(Still be able to useset_tristate()instead)
* Removed useless header files and sort the rest alphabetically
* Registered runtime pm functions to the driver
* Added regulator controls (VA and VP)
* Added writeable register function for regmap
* Merged two ASP dais
* Added TDM support
* Added a simple introduction in commit log
Quoted 1 line
.../devicetree/bindings/sound/cs53l30.txt | 40 +
Quoted 8 lines
sound/soc/codecs/Kconfig | 6 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/cs53l30.c | 1097 ++++++++++++++++++++ sound/soc/codecs/cs53l30.h | 458 ++++++++ 5 files changed, 1603 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/cs53l30.txt create mode 100644 sound/soc/codecs/cs53l30.c create mode 100644 sound/soc/codecs/cs53l30.h