[alsa-devel] [PATCH] ASoC: ssm4567: Add driver for Analog Devices SSM4567 amplifier

Anatol Pomozov anatol.pomozov at gmail.com
Fri Sep 26 22:38:47 CEST 2014


Hi

On Fri, Sep 26, 2014 at 10:13 AM, Lars-Peter Clausen <lars at metafoo.de> wrote:
> On 09/26/2014 06:08 PM, Anatol Pomozov wrote:
>>
>> Analog Devices SSM4567 is a boost class-D audio amplifier.
>>
>> Signed-off-by: Anatol Pomozov <anatol.pomozov at gmail.com>
>
>
> Looks mostly okay. I also have a driver for this chip which is getting ready
> for upstream. It is a bit more complete feature wise,

D'oh I wish I knew it before start working on the driver.

> but I can rebase it  ontop of your driver.

Thanks!

>
> https://github.com/analogdevicesinc/linux/blob/asoc-ssm4329/sound/soc/codecs/ssm4567.c
>
> [...]
>>
>> diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
>> index 8ab1547..da45b5a 100644
>> --- a/sound/soc/codecs/Kconfig
>> +++ b/sound/soc/codecs/Kconfig
>> @@ -94,6 +94,7 @@ config SND_SOC_ALL_CODECS
>
> [...]
>>
>> +config SND_SOC_SSM4567
>> +       tristate "Analog Devices ssm4567 amplifier driver support"
>
>
>         depends on I2C
>
>> +
>>   config SND_SOC_STA32X
>>         tristate
>>
>> diff --git a/sound/soc/codecs/ssm4567.c b/sound/soc/codecs/ssm4567.c
>> new file mode 100644
>> index 0000000..fb92248
>> --- /dev/null
>> +++ b/sound/soc/codecs/ssm4567.c
>
> [...]
>>
>> +#include <linux/gpio.h>
>> +#include <linux/of_gpio.h>
>
>
> No gpios in this driver
>
> [...]
>>
>> +
>> +static const struct snd_kcontrol_new ssm4567_snd_controls[] = {
>
> [...]
>>
>> +       SOC_SINGLE("Master Playback Switch", SSM4567_REG_DAC_CTRL, 6, 1,
>> 1),
>
>
> This one and ...
>
> [...]
>>
>> +};
>> +
>
> [...]
>>
>> +static int ssm4567_mute(struct snd_soc_dai *dai, int mute)
>> +{
>> +       struct ssm4567 *ssm4567 = snd_soc_codec_get_drvdata(dai->codec);
>> +       unsigned int val;
>> +
>> +       val = mute ? SSM4567_DAC_MUTE : 0;
>> +       return regmap_update_bits(ssm4567->regmap, SSM4567_REG_DAC_CTRL,
>> +                       SSM4567_DAC_MUTE, val);
>
>
>
> ... this one control the same bit, so there will be conflicts.
>
>> +}
>> +

I've fixed the items you mentioned.

One difference I spotted between your and mine patches is that you
don't call regcache_cache_only(regmap) before powering down the
device. Is it because I2C alive in power down mode? I guess I need to
remove regcache_cache_only() then.


More information about the Alsa-devel mailing list