ASoC: dt-bindings: cirrus,cs530x: Add initial DT binding
Subsystems (4)
PATCH v3 1/2 ASoC: dt-bindings: cirrus,cs530x: Add initial DT binding
Add the YAML DT bindings for the cs530x high performance audio ADCs.
--- .../bindings/sound/cirrus,cs530x.yaml | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs530x.yaml
Documentation/devicetree/bindings/sound/cirrus,cs530x.yaml new file +85 -0
@@ -0,0 +1,85 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/cirrus,cs530x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Cirrus Logic cs530x family of audio ADCs + +maintainers: + - Paul Handrigan <[email protected]> + - [email protected] + +description: + The CS530X devices are a family of high performance audio ADCs. + +allOf: + - $ref: dai-common.yaml# + +properties: + compatible: + enum: + - cirrus,cs5302 + - cirrus,cs5304 + - cirrus,cs5308 + + reg: + maxItems: 1 + + '#sound-dai-cells': + const: 1 + + reset-gpios: + maxItems: 1 + + vdd-a-supply: + description: Analog power supply + + vdd-io-supply: + description: Digital IO power supply + + cirrus,in-hiz-pin12: + description: + Sets input channels one and two to high impedance. + type: boolean + + cirrus,in-hiz-pin34: + description: + Sets input channels three and four to high impedance. + type: boolean + + cirrus,in-hiz-pin56: + description: + Sets input channels five and six to high impedance. + type: boolean + + cirrus,in-hiz-pin78: + description: + Sets input channels seven and eight to high impedance. + type: boolean + +required: + - compatible + - reg + - "#sound-dai-cells" + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + cs5304: adc@48 { + compatible = "cirrus,cs5304"; + reg = <0x48>; + #sound-dai-cells = <1>; + reset-gpios = <&gpio 110 GPIO_ACTIVE_LOW>; + vdd-a-supply = <&vreg>; + vdd-io-supply = <&vreg>; + cirrus,in-hiz-pin34; + }; + };
Signature · 1 line
2.34.1
PATCH v3 2/2 ASoC: cs530x: Support for cs530x ADCs
Add support for the cs530x family of high performance ADCs.
--- sound/soc/codecs/Kconfig | 14 + sound/soc/codecs/Makefile | 4 + sound/soc/codecs/cs530x-i2c.c | 71 +++ sound/soc/codecs/cs530x.c | 978 ++++++++++++++++++++++++++++++++++ sound/soc/codecs/cs530x.h | 223 ++++++++ 5 files changed, 1290 insertions(+) create mode 100644 sound/soc/codecs/cs530x-i2c.c create mode 100644 sound/soc/codecs/cs530x.c create mode 100644 sound/soc/codecs/cs530x.h
sound/soc/codecs/Kconfig +14 -0
@@ -99,6 +99,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_CS47L90 imply SND_SOC_CS47L92 imply SND_SOC_CS53L30 + imply SND_SOC_CS530X_I2C imply SND_SOC_CX20442 imply SND_SOC_CX2072X imply SND_SOC_DA7210
@@ -999,6 +1000,19 @@ config SND_SOC_CS53L30 tristate "Cirrus Logic CS53L30 CODEC" depends on I2C +config SND_SOC_CS530X + tristate + +config SND_SOC_CS530X_I2C + tristate "Cirrus Logic CS530x ADCs (I2C)" + depends on I2C + select REGMAP + select REGMAP_I2C + select SND_SOC_CS530X + help + Enable support for Cirrus Logic CS530X ADCs + with I2C control. + config SND_SOC_CX20442 tristate depends on TTY
sound/soc/codecs/Makefile +4 -0
@@ -107,6 +107,8 @@ snd-soc-cs47l85-y := cs47l85.o snd-soc-cs47l90-y := cs47l90.o snd-soc-cs47l92-y := cs47l92.o snd-soc-cs53l30-y := cs53l30.o +snd-soc-cs530x-y := cs530x.o +snd-soc-cs530x-i2c-y := cs530x-i2c.o snd-soc-cx20442-y := cx20442.o snd-soc-cx2072x-y := cx2072x.o snd-soc-da7210-y := da7210.o
@@ -508,6 +510,8 @@ obj-$(CONFIG_SND_SOC_CS47L85) += snd-soc-cs47l85.o obj-$(CONFIG_SND_SOC_CS47L90) += snd-soc-cs47l90.o obj-$(CONFIG_SND_SOC_CS47L92) += snd-soc-cs47l92.o obj-$(CONFIG_SND_SOC_CS53L30) += snd-soc-cs53l30.o +obj-$(CONFIG_SND_SOC_CS530X) += snd-soc-cs530x.o +obj-$(CONFIG_SND_SOC_CS530X_I2C) += snd-soc-cs530x-i2c.o obj-$(CONFIG_SND_SOC_CX20442) += snd-soc-cx20442.o obj-$(CONFIG_SND_SOC_CX2072X) += snd-soc-cx2072x.o obj-$(CONFIG_SND_SOC_DA7210) += snd-soc-da7210.o
sound/soc/codecs/cs530x-i2c.c new file +71 -0
71 lines not on this page · raw message
sound/soc/codecs/cs530x.c new file +978 -0
978 lines not on this page · raw message
sound/soc/codecs/cs530x.h new file +223 -0
223 lines not on this page · raw message
Signature · 1 line
2.34.1
Mark Brown
maintainerRe: [PATCH v3 2/2] ASoC: cs530x: Support for cs530x ADCs
sound/soc/codecs/cs530x.c line 93
Quoted 10 lines · Paul Handrigan
sound/soc/codecs/cs530x.c new file +10
-0+static bool cs530x_volatile_register (struct device *dev,unsigned int reg) +{ +switch (reg) { +case CS530X_DEVID : +case CS530X_REVID : +return true; +default : +return false; + } +}
Are these really volatile? I would expect them to have no defaults so they must be read from the device, but once read I'd expect we could cache the values.
Otherwise this looks good.
Richard Fitzgerald
maintainerRe: [PATCH v3 2/2] ASoC: cs530x: Support for cs530x ADCs
Quoted 17 lines · Mark Brown
sound/soc/codecs/cs530x.c line 93
Quoted 10 lines · Paul Handrigan
sound/soc/codecs/cs530x.c new file +10
-0+static bool cs530x_volatile_register (struct device *dev,unsigned int reg) +{ +switch (reg) { +case CS530X_DEVID : +case CS530X_REVID : +return true; +default : +return false; + } +}Are these really volatile? I would expect them to have no defaults so they must be read from the device, but once read I'd expect we could cache the values.
Quoted 1 line
Otherwise this looks good.
If you mark a register non-volatile but without default, a regcache_sync() will write it back out to the device. While that doesn't necessarily do any harm, that depends on what these registers do on write. Generally it makes me nervous to have cache syncs writing to registers we don't want to write to.
Mark Brown
maintainerRe: [PATCH v3 2/2] ASoC: cs530x: Support for cs530x ADCs
Quoted 10 lines · Richard Fitzgerald
Quoted 8 lines · Mark Brown
Review
Quoted 2 lines · Paul Handrigan
(quoted diff) +2
-0+ case CS530X_DEVID: + case CS530X_REVID:Are these really volatile? I would expect them to have no defaults so they must be read from the device, but once read I'd expect we could cache the values.
Quoted 5 lines
If you mark a register non-volatile but without default, a
regcache_sync()will write it back out to the device. While that doesn't necessarily do any harm, that depends on what these registers do on write. Generally it makes me nervous to have cache syncs writing to registers we don't want to write to.
Marking the register as read only should DTRT there, if not then that's a regmap bug which should be fixed.
Richard Fitzgerald
maintainerRe: [PATCH v3 2/2] ASoC: cs530x: Support for cs530x ADCs
Quoted 11 lines · Mark Brown
Quoted 9 lines · Richard Fitzgerald
Quoted 8 lines · Mark Brown
Review
Quoted 2 lines · Paul Handrigan
(quoted diff) +2
-0+ case CS530X_DEVID: + case CS530X_REVID:Are these really volatile? I would expect them to have no defaults so they must be read from the device, but once read I'd expect we could cache the values.
Quoted 8 lines
Quoted 5 lines
If you mark a register non-volatile but without default, a
regcache_sync()will write it back out to the device. While that doesn't necessarily do any harm, that depends on what these registers do on write. Generally it makes me nervous to have cache syncs writing to registers we don't want to write to.Marking the register as read only should DTRT there, if not then that's a regmap bug which should be fixed.
True but now we're adding extra callbacks and complexity just to avoid marking a register volatile for some reason. The driver doesn't need it to be cached, so why bother?
Mark Brown
maintainerRe: [PATCH v3 2/2] ASoC: cs530x: Support for cs530x ADCs
Quoted 8 lines · Richard Fitzgerald
Quoted 2 lines · Mark Brown
Marking the register as read only should DTRT there, if not then that's a regmap bug which should be fixed.
True but now we're adding extra callbacks and complexity just to avoid marking a register volatile for some reason. The driver doesn't need it to be cached, so why bother?
Well, moving the volatile callback to be a readable callback. If nothing else it avoids anyone reading the code and having to wonder why the ID registers are volatile.
Quoted 5 lines · Paul Handrigan
Add the YAML DT bindings for the cs530x high performance audio ADCs.
Signed-off-by Paul Handrigan <[email protected]>---
Where is the changelog? It's v3 but what happened here? No explanation here, no cover letter.
If you are going to send any new version, provide detailed changelog (see Submitting patches).
---
<form letter>
This is an automated instruction, just in case, because many review tags are being ignored. If you know the process, you can skip it (please do not feel offended by me posting it here - no bad intentions intended). If you do not know the process, here is a short explanation:
Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions, under or above your Signed-off-by tag. Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply.
https://elixir.bootlin.com/linux/v6.5-rc3/source/Documentation/process/submitting-patches.rst#L577
</form letter>
Best regards,
Krzysztof
Quoted 5 lines · Krzysztof Kozlowski
On 17/06/2024 21:01, Paul Handrigan wrote:
Where is the changelog? It's v3 but what happened here? No explanation here, no cover letter.
Apologies. I made a mistake with the naming as you pointed out. I will add the changelog moving forward.
Regards,
Paul