diff options
Diffstat (limited to 'sound/soc/codecs/sigmadsp.h')
-rw-r--r-- | sound/soc/codecs/sigmadsp.h | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/sound/soc/codecs/sigmadsp.h b/sound/soc/codecs/sigmadsp.h index c47cd23e9827..a6be91a4c2dc 100644 --- a/sound/soc/codecs/sigmadsp.h +++ b/sound/soc/codecs/sigmadsp.h | |||
@@ -11,31 +11,50 @@ | |||
11 | 11 | ||
12 | #include <linux/device.h> | 12 | #include <linux/device.h> |
13 | #include <linux/regmap.h> | 13 | #include <linux/regmap.h> |
14 | #include <linux/list.h> | ||
14 | 15 | ||
15 | struct sigma_action { | 16 | #include <sound/pcm.h> |
16 | u8 instr; | ||
17 | u8 len_hi; | ||
18 | __le16 len; | ||
19 | __be16 addr; | ||
20 | unsigned char payload[]; | ||
21 | } __packed; | ||
22 | 17 | ||
23 | struct sigma_firmware { | 18 | struct sigmadsp; |
24 | const struct firmware *fw; | 19 | struct snd_soc_component; |
25 | size_t pos; | 20 | struct snd_pcm_substream; |
21 | |||
22 | struct sigmadsp_ops { | ||
23 | int (*safeload)(struct sigmadsp *sigmadsp, unsigned int addr, | ||
24 | const uint8_t *data, size_t len); | ||
25 | }; | ||
26 | |||
27 | struct sigmadsp { | ||
28 | const struct sigmadsp_ops *ops; | ||
29 | |||
30 | struct list_head data_list; | ||
31 | |||
32 | unsigned int current_samplerate; | ||
33 | struct snd_soc_component *component; | ||
34 | struct device *dev; | ||
26 | 35 | ||
27 | void *control_data; | 36 | void *control_data; |
28 | int (*write)(void *control_data, const struct sigma_action *sa, | 37 | int (*write)(void *, unsigned int, const uint8_t *, size_t); |
29 | size_t len); | ||
30 | }; | 38 | }; |
31 | 39 | ||
32 | int _process_sigma_firmware(struct device *dev, | 40 | struct sigmadsp *devm_sigmadsp_init(struct device *dev, |
33 | struct sigma_firmware *ssfw, const char *name); | 41 | const struct sigmadsp_ops *ops, const char *firmware_name); |
42 | void sigmadsp_reset(struct sigmadsp *sigmadsp); | ||
43 | |||
44 | int sigmadsp_restrict_params(struct sigmadsp *sigmadsp, | ||
45 | struct snd_pcm_substream *substream); | ||
34 | 46 | ||
35 | struct i2c_client; | 47 | struct i2c_client; |
36 | 48 | ||
37 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); | 49 | struct sigmadsp *devm_sigmadsp_init_regmap(struct device *dev, |
38 | extern int process_sigma_firmware_regmap(struct device *dev, | 50 | struct regmap *regmap, const struct sigmadsp_ops *ops, |
39 | struct regmap *regmap, const char *name); | 51 | const char *firmware_name); |
52 | struct sigmadsp *devm_sigmadsp_init_i2c(struct i2c_client *client, | ||
53 | const struct sigmadsp_ops *ops, const char *firmware_name); | ||
54 | |||
55 | int sigmadsp_attach(struct sigmadsp *sigmadsp, | ||
56 | struct snd_soc_component *component); | ||
57 | int sigmadsp_setup(struct sigmadsp *sigmadsp, unsigned int rate); | ||
58 | void sigmadsp_reset(struct sigmadsp *sigmadsp); | ||
40 | 59 | ||
41 | #endif | 60 | #endif |