diff options
Diffstat (limited to 'sound/soc/codecs/sigmadsp-regmap.c')
-rw-r--r-- | sound/soc/codecs/sigmadsp-regmap.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sound/soc/codecs/sigmadsp-regmap.c b/sound/soc/codecs/sigmadsp-regmap.c new file mode 100644 index 000000000000..f78ed8d2cfb2 --- /dev/null +++ b/sound/soc/codecs/sigmadsp-regmap.c | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * Load Analog Devices SigmaStudio firmware files | ||
3 | * | ||
4 | * Copyright 2009-2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #include <linux/regmap.h> | ||
10 | #include <linux/export.h> | ||
11 | #include <linux/module.h> | ||
12 | |||
13 | #include "sigmadsp.h" | ||
14 | |||
15 | static int sigma_action_write_regmap(void *control_data, | ||
16 | const struct sigma_action *sa, size_t len) | ||
17 | { | ||
18 | return regmap_raw_write(control_data, be16_to_cpu(sa->addr), | ||
19 | sa->payload, len - 2); | ||
20 | } | ||
21 | |||
22 | int process_sigma_firmware_regmap(struct device *dev, struct regmap *regmap, | ||
23 | const char *name) | ||
24 | { | ||
25 | struct sigma_firmware ssfw; | ||
26 | |||
27 | ssfw.control_data = regmap; | ||
28 | ssfw.write = sigma_action_write_regmap; | ||
29 | |||
30 | return _process_sigma_firmware(dev, &ssfw, name); | ||
31 | } | ||
32 | EXPORT_SYMBOL(process_sigma_firmware_regmap); | ||
33 | |||
34 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); | ||
35 | MODULE_DESCRIPTION("SigmaDSP regmap firmware loader"); | ||
36 | MODULE_LICENSE("GPL"); | ||