0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/regmap.h>
0009 #include <linux/export.h>
0010 #include <linux/module.h>
0011
0012 #include "sigmadsp.h"
0013
0014 static int sigmadsp_write_regmap(void *control_data,
0015 unsigned int addr, const uint8_t data[], size_t len)
0016 {
0017 return regmap_raw_write(control_data, addr,
0018 data, len);
0019 }
0020
0021 static int sigmadsp_read_regmap(void *control_data,
0022 unsigned int addr, uint8_t data[], size_t len)
0023 {
0024 return regmap_raw_read(control_data, addr,
0025 data, len);
0026 }
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 struct sigmadsp *devm_sigmadsp_init_regmap(struct device *dev,
0040 struct regmap *regmap, const struct sigmadsp_ops *ops,
0041 const char *firmware_name)
0042 {
0043 struct sigmadsp *sigmadsp;
0044
0045 sigmadsp = devm_sigmadsp_init(dev, ops, firmware_name);
0046 if (IS_ERR(sigmadsp))
0047 return sigmadsp;
0048
0049 sigmadsp->control_data = regmap;
0050 sigmadsp->write = sigmadsp_write_regmap;
0051 sigmadsp->read = sigmadsp_read_regmap;
0052
0053 return sigmadsp;
0054 }
0055 EXPORT_SYMBOL_GPL(devm_sigmadsp_init_regmap);
0056
0057 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
0058 MODULE_DESCRIPTION("SigmaDSP regmap firmware loader");
0059 MODULE_LICENSE("GPL");