mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 05:41:55 +00:00
2488708f5c
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 <arnd@arndb.de>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
37 lines
872 B
C
37 lines
872 B
C
/*
|
|
* Load Analog Devices SigmaStudio firmware files
|
|
*
|
|
* Copyright 2009-2011 Analog Devices Inc.
|
|
*
|
|
* Licensed under the GPL-2 or later.
|
|
*/
|
|
|
|
#include <linux/regmap.h>
|
|
#include <linux/export.h>
|
|
#include <linux/module.h>
|
|
|
|
#include "sigmadsp.h"
|
|
|
|
static int sigma_action_write_regmap(void *control_data,
|
|
const struct sigma_action *sa, size_t len)
|
|
{
|
|
return regmap_raw_write(control_data, be16_to_cpu(sa->addr),
|
|
sa->payload, len - 2);
|
|
}
|
|
|
|
int process_sigma_firmware_regmap(struct device *dev, struct regmap *regmap,
|
|
const char *name)
|
|
{
|
|
struct sigma_firmware ssfw;
|
|
|
|
ssfw.control_data = regmap;
|
|
ssfw.write = sigma_action_write_regmap;
|
|
|
|
return _process_sigma_firmware(dev, &ssfw, name);
|
|
}
|
|
EXPORT_SYMBOL(process_sigma_firmware_regmap);
|
|
|
|
MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
|
|
MODULE_DESCRIPTION("SigmaDSP regmap firmware loader");
|
|
MODULE_LICENSE("GPL");
|