From 6b10998d74398ec8745d54dfdcbcc1eb445a2f9f Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 6 Jun 2014 14:09:17 +0200 Subject: ASoC: sigmadsp: Split regmap and I2C support into separate modules When the SigmaDSP module is built-in, but the I2C core is build as a module we'll get a undefined reference: sound/built-in.o: In function `sigma_action_write_i2c': :(.text+0x5d8d4): undefined reference to `i2c_master_send' This can happen if a audio driver that is using the regmap SigmaDSP interface is built into the kernel, but core I2C support is build as a module. To fix this split the SigmaDSP module into three modules, one module providing the core infrastructure and two small modules implementing the regmap and I2C interfaces. This allows e.g. the core infrastructure and regmap support to be built into the kernel while I2C support can still be build as a module. Fixes: dab464b60 ("ASoC: Add ADAU1361/ADAU1761 audio CODEC support") Reported-by: Arnd Bergmann Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/codecs/sigmadsp-i2c.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sound/soc/codecs/sigmadsp-i2c.c (limited to 'sound/soc/codecs/sigmadsp-i2c.c') diff --git a/sound/soc/codecs/sigmadsp-i2c.c b/sound/soc/codecs/sigmadsp-i2c.c new file mode 100644 index 000000000000..246081aae8ca --- /dev/null +++ b/sound/soc/codecs/sigmadsp-i2c.c @@ -0,0 +1,35 @@ +/* + * Load Analog Devices SigmaStudio firmware files + * + * Copyright 2009-2011 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#include +#include +#include + +#include "sigmadsp.h" + +static int sigma_action_write_i2c(void *control_data, + const struct sigma_action *sa, size_t len) +{ + return i2c_master_send(control_data, (const unsigned char *)&sa->addr, + len); +} + +int process_sigma_firmware(struct i2c_client *client, const char *name) +{ + struct sigma_firmware ssfw; + + ssfw.control_data = client; + ssfw.write = sigma_action_write_i2c; + + return _process_sigma_firmware(&client->dev, &ssfw, name); +} +EXPORT_SYMBOL(process_sigma_firmware); + +MODULE_AUTHOR("Lars-Peter Clausen "); +MODULE_DESCRIPTION("SigmaDSP I2C firmware loader"); +MODULE_LICENSE("GPL"); -- cgit