diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-02-17 13:16:53 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-18 10:07:33 +0900 |
commit | c924dc68f7371582cb420c003faadb700cd4f76c (patch) | |
tree | b7dd0e7f19bb4dcbebecd93a0273b31234ee26dd /sound/soc/codecs/Kconfig | |
parent | f75ac2d9bd8211c1890ad591046aef0783ad6416 (diff) | |
download | lwn-c924dc68f7371582cb420c003faadb700cd4f76c.tar.gz lwn-c924dc68f7371582cb420c003faadb700cd4f76c.zip |
ASoC: ssm2602: Split SPI and I2C code into different modules
There are a few known (minor) problems with having the support code for both I2C
and SPI in the same module:
* We need to be extra careful to make sure to not build the driver into the
kernel if one of the subsystems is build as a module (Currently only I2C
can be build as a module).
* The module init path error handling is rather ugly. E.g. what should be
done if either the SPI or the I2C driver fails to register? Most drivers
that implement SPI and I2C in the same module currently fallback to
undefined behavior in that case. Splitting the the driver into two
modules, one for each bus allows the registration of the other bus driver
to continue without problems if one of them fails.
This patch splits the ssm2602 driver into 3 modules. One core module that
implements the device logic, but is independent of the bus method used. And one
module for SPI and I2C each that registers the drivers and sets up the regmap
struct for the bus.
While we are at it also cleanup the include section of the ssm2602 driver and
remove unneeded includes.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/Kconfig')
-rw-r--r-- | sound/soc/codecs/Kconfig | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 983d087aa92a..f17e6da53ce7 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -66,7 +66,8 @@ config SND_SOC_ALL_CODECS 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_SSM2602_SPI if SPI_MASTER + select SND_SOC_SSM2602_I2C if I2C select SND_SOC_STA32X if I2C select SND_SOC_STA529 if I2C select SND_SOC_STAC9766 if SND_SOC_AC97_BUS @@ -342,6 +343,14 @@ config SND_SOC_SSM2518 config SND_SOC_SSM2602 tristate +config SND_SOC_SSM2602_SPI + select SND_SOC_SSM2602 + tristate + +config SND_SOC_SSM2602_I2C + select SND_SOC_SSM2602 + tristate + config SND_SOC_STA32X tristate |