ASoC: Add max98371 codec driver
Subsystems (3)
PATCH 1/1 ASoC: Add max98371 codec driver
--- .../devicetree/bindings/sound/max98371.txt | 17 + sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 1 + sound/soc/codecs/max98371.c | 419 +++++++++++++++++++++ sound/soc/codecs/max98371.h | 64 ++++ 5 files changed, 505 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/max98371.txt create mode 100644 sound/soc/codecs/max98371.c create mode 100644 sound/soc/codecs/max98371.h
Documentation/devicetree/bindings/sound/max98371.txt new file +17 -0
@@ -0,0 +1,17 @@ +max98371 codec + +This device supports I2C mode only. + +Required properties: + +- compatible : "maxim,max98371" +- reg : The chip select number on the I2C bus + +Example: + +&i2c { + max98371: max98371@0x31 { + compatible = "maxim,max98371"; + reg = <0x31>; + }; +};
sound/soc/codecs/Kconfig +4 -0
@@ -75,6 +75,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_MAX98090 if I2C select SND_SOC_MAX98095 if I2C select SND_SOC_MAX98357A if GPIOLIB + select SND_SOC_MAX98371 if I2C select SND_SOC_MAX9867 if I2C select SND_SOC_MAX98925 if I2C select SND_SOC_MAX98926 if I2C
@@ -491,6 +492,9 @@ config SND_SOC_MAX98095 config SND_SOC_MAX98357A tristate +config SND_SOC_MAX98371 + tristate + config SND_SOC_MAX9867 tristate
sound/soc/codecs/Makefile +1 -0
@@ -70,6 +70,7 @@ snd-soc-max98088-objs := max98088.o snd-soc-max98090-objs := max98090.o snd-soc-max98095-objs := max98095.o snd-soc-max98357a-objs := max98357a.o +snd-soc-max98371-objs := max98371.o snd-soc-max9867-objs := max9867.o snd-soc-max98925-objs := max98925.o snd-soc-max98926-objs := max98926.o
sound/soc/codecs/max98371.c new file +419 -0
419 lines not on this page · raw message
sound/soc/codecs/max98371.h new file +64 -0
64 lines not on this page · raw message
Signature · 1 line
1.9.3
Mark Brown
maintainersound/soc/codecs/max98371.c line 29
Quoted 5 lines · anish kumar
sound/soc/codecs/max98371.c new file +5
-0+static const char *const voltage_level_text[] = { +"9.5dB" ,"10.5dB" ,"11.5dB" ,"11.5dB" ,"12.5dB" , +"13.5dB" ,"14.5dB" ,"15.5dB" ,"16.5dB" ,"17.5dB" , +"18.5dB" ,"19.5dB" ,"20.5dB" +};
As I said last time I would expect this to be a TLV control. As far as I can tell this is basically functioning as a maximum volume. Otherwise this looks good.
Quoted 11 lines · Mark Brown
sound/soc/codecs/max98371.c line 29
Quoted 5 lines · anish kumar
sound/soc/codecs/max98371.c new file +5
-0+static const char *const voltage_level_text[] = { +"9.5dB" ,"10.5dB" ,"11.5dB" ,"11.5dB" ,"12.5dB" , +"13.5dB" ,"14.5dB" ,"15.5dB" ,"16.5dB" ,"17.5dB" , +"18.5dB" ,"19.5dB" ,"20.5dB" +};As I said last time I would expect this to be a TLV control. As far as I can tell this is basically functioning as a maximum volume. Otherwise this looks good.
I responded to your comment earlier but there was no reply so I thought it is accepted this way. Excuse my understanding. It is not actually a volume but described as such.
It is "Speaker No-Load Output Voltage Maximum". It is described here on page 50.
https://datasheets.maximintegrated.com/en/ds/MAX98371.pdf
Mark Brown
maintainerQuoted 9 lines · anish kumar
Quoted 3 lines · Mark Brown
As I said last time I would expect this to be a TLV control. As far as I can tell this is basically functioning as a maximum volume. Otherwise this looks good.
I responded to your comment earlier but there was no reply so I thought it is accepted this way. Excuse my understanding. It is not actually a volume but described as such.
If it's measured in dB I'd still expect a TLV control.
Quoted 3 lines
It is "Speaker No-Load Output Voltage Maximum". It is described here on page 50.
https://datasheets.maximintegrated.com/en/ds/MAX98371.pdf
Hrm, that looks like the driver may be able to set it automatically using the regulator API and just have a switch for the guaranteed.
Quoted 11 lines · Mark Brown
Quoted 9 lines · anish kumar
Quoted 3 lines · Mark Brown
As I said last time I would expect this to be a TLV control. As far as I can tell this is basically functioning as a maximum volume. Otherwise this looks good.
I responded to your comment earlier but there was no reply so I thought it is accepted this way. Excuse my understanding. It is not actually a volume but described as such.
Quoted 8 lines
If it's measured in dB I'd still expect a TLV control.
Quoted 3 lines
It is "Speaker No-Load Output Voltage Maximum". It is described here on page 50.
https://datasheets.maximintegrated.com/en/ds/MAX98371.pdfHrm, that looks like the driver may be able to set it automatically using the regulator API and just have a switch for the guaranteed.
Should i pass it via device tree then? I didn't get your statement about "switch".
Mark Brown
maintainerQuoted 6 lines · anish kumar
Quoted 2 lines · Mark Brown
Hrm, that looks like the driver may be able to set it automatically using the regulator API and just have a switch for the guaranteed.
Should i pass it via device tree then? I didn't get your statement about
I'd expect to look up the value by looking at the supply voltage if we were going to go that way.
Quoted 1 line
"switch".
A switch is an on/off control.
Quoted 10 lines · Mark Brown
Quoted 6 lines · anish kumar
Quoted 2 lines · Mark Brown
Hrm, that looks like the driver may be able to set it automatically using the regulator API and just have a switch for the guaranteed.
Should i pass it via device tree then? I didn't get your statement about
I'd expect to look up the value by looking at the supply voltage if we were going to go that way.
Discussion of this with hardware team revealed that dynamic headroom tracking is the feature which will be controlled with this gain.
I am also adding two new controls for this: speaker gain min and DHT rotation point.
I will be adding all of this as TLV as this should be configurable.
Quoted 4 lines
Quoted 2 lines
"switch".
A switch is an on/off control.
Mark Brown
maintainerQuoted 7 lines · anish kumar
Discussion of this with hardware team revealed that dynamic headroom tracking is the feature which will be controlled with this gain.
I am also adding two new controls for this: speaker gain min and DHT rotation point.
I will be adding all of this as TLV as this should be configurable.
Sounds good.