ASoC: Add ssm2518 support
Subsystems (4)
Lars-Peter Clausen
maintainerPATCH v2 1/1 ASoC: Add ssm2518 support
This patch adds a ASoC CODEC driver for the SSM2516. The SSM2516 is a stereo Class-D audio amplifier with an I2S interface for audio in and a built-in dynamic range control processor.
---
Changes since v1:
* Power off the codec in the I2C probe function
* Allow a sysclk of 0 which won't but any constraints on the supported sample rates. This can be used by systems which are able to change the sysclk on demand.
* Remove {} around multi-line single statements
--- .../devicetree/bindings/sound/ssm2518.txt | 20 + include/linux/platform_data/ssm2518.h | 22 + sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/ssm2518.c | 856 +++++++++++++++++++++ sound/soc/codecs/ssm2518.h | 20 + 6 files changed, 924 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/ssm2518.txt create mode 100644 include/linux/platform_data/ssm2518.h create mode 100644 sound/soc/codecs/ssm2518.c create mode 100644 sound/soc/codecs/ssm2518.h
Documentation/devicetree/bindings/sound/ssm2518.txt new file +20 -0
@@ -0,0 +1,20 @@ +SSM2518 audio amplifier + +This device supports I2C only. + +Required properties: + - compatible : Must be "adi,ssm2518" + - reg : the I2C address of the device. This will either be 0x34 (ADDR pin low) + or 0x35 (ADDR pin high) + +Optional properties: + - gpios : GPIO connected to the nSD pin. If the property is not present it is + assumed that the nSD pin is hardwired to always on. + +Example: + + ssm2518: ssm2518@34 { + compatible = "adi,ssm2518"; + reg = <0x34>; + gpios = <&gpio 5 0>; + };
include/linux/platform_data/ssm2518.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* SSM2518 amplifier audio driver +* +* Copyright 2013 Analog Devices Inc. +* Author: Lars-Peter Clausen <[email protected]> +* +* Licensed under the GPL-2. +*/ + +#ifndef __LINUX_PLATFORM_DATA_SSM2518_H__ +#define __LINUX_PLATFORM_DATA_SSM2518_H__ + +/** +* struct ssm2518_platform_data - Platform data for the ssm2518 driver +* @enable_gpio: GPIO connected to the nSD pin. Set to -1 if the nSD pin is +* hardwired. +*/ +struct ssm2518_platform_data { +int enable_gpio; +}; + +#endif
sound/soc/codecs/Kconfig +4 -0
@@ -60,6 +60,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_SI476X if MFD_SI476X_CORE select SND_SOC_SN95031 if INTEL_SCU_IPC select SND_SOC_SPDIF + select SND_SOC_SSM2518 if I2C select SND_SOC_SSM2602 if SND_SOC_I2C_AND_SPI select SND_SOC_STA32X if I2C select SND_SOC_STA529 if I2C
@@ -313,6 +314,9 @@ config SND_SOC_SN95031 config SND_SOC_SPDIF tristate +config SND_SOC_SSM2518 + tristate + config SND_SOC_SSM2602 tristate
sound/soc/codecs/Makefile +2 -0
@@ -52,6 +52,7 @@ snd-soc-si476x-objs := si476x.o snd-soc-sn95031-objs := sn95031.o snd-soc-spdif-tx-objs := spdif_transmitter.o snd-soc-spdif-rx-objs := spdif_receiver.o +snd-soc-ssm2518-objs := ssm2518.o snd-soc-ssm2602-objs := ssm2602.o snd-soc-sta32x-objs := sta32x.o snd-soc-sta529-objs := sta529.o
@@ -176,6 +177,7 @@ obj-$(CONFIG_SND_SOC_SIGMADSP) += snd-soc-sigmadsp.o obj-$(CONFIG_SND_SOC_SI476X) += snd-soc-si476x.o obj-$(CONFIG_SND_SOC_SN95031) +=snd-soc-sn95031.o obj-$(CONFIG_SND_SOC_SPDIF) += snd-soc-spdif-rx.o snd-soc-spdif-tx.o +obj-$(CONFIG_SND_SOC_SSM2518) += snd-soc-ssm2518.o obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o obj-$(CONFIG_SND_SOC_STA32X) += snd-soc-sta32x.o obj-$(CONFIG_SND_SOC_STA529) += snd-soc-sta529.o
sound/soc/codecs/ssm2518.c new file +856 -0
856 lines not on this page · raw message
sound/soc/codecs/ssm2518.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* SSM2518 amplifier audio driver +* +* Copyright 2013 Analog Devices Inc. +* Author: Lars-Peter Clausen <[email protected]> +* +* Licensed under the GPL-2. +*/ + +#ifndef __SND_SOC_CODECS_SSM2518_H__ +#define __SND_SOC_CODECS_SSM2518_H__ + +#define SSM2518_SYSCLK 0 + +enum ssm2518_sysclk_src { +SSM2518_SYSCLK_SRC_MCLK =0 , +SSM2518_SYSCLK_SRC_BCLK =1 , +}; + +#endif
Signature · 1 line
1.8.0
Quoted 3 lines · Lars-Peter Clausen
This patch adds a ASoC CODEC driver for the SSM2516. The SSM2516 is a stereo Class-D audio amplifier with an I2S interface for audio in and a built-in dynamic range control processor.
Applied, thanks. Always generate patches against the tree you're submitting for - this has context differences with -next.