diff options
Diffstat (limited to 'sound/soc/codecs/sigmadsp.h')
-rw-r--r-- | sound/soc/codecs/sigmadsp.h | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/sound/soc/codecs/sigmadsp.h b/sound/soc/codecs/sigmadsp.h index c47cd23e9827..614475cbb823 100644 --- a/sound/soc/codecs/sigmadsp.h +++ b/sound/soc/codecs/sigmadsp.h | |||
@@ -11,31 +11,56 @@ | |||
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 ctrl_list; | ||
31 | struct list_head data_list; | ||
32 | |||
33 | struct snd_pcm_hw_constraint_list rate_constraints; | ||
34 | |||
35 | unsigned int current_samplerate; | ||
36 | struct snd_soc_component *component; | ||
37 | struct device *dev; | ||
38 | |||
39 | struct mutex lock; | ||
26 | 40 | ||
27 | void *control_data; | 41 | void *control_data; |
28 | int (*write)(void *control_data, const struct sigma_action *sa, | 42 | int (*write)(void *, unsigned int, const uint8_t *, size_t); |
29 | size_t len); | 43 | int (*read)(void *, unsigned int, uint8_t *, size_t); |
30 | }; | 44 | }; |
31 | 45 | ||
32 | int _process_sigma_firmware(struct device *dev, | 46 | struct sigmadsp *devm_sigmadsp_init(struct device *dev, |
33 | struct sigma_firmware *ssfw, const char *name); | 47 | const struct sigmadsp_ops *ops, const char *firmware_name); |
48 | void sigmadsp_reset(struct sigmadsp *sigmadsp); | ||
49 | |||
50 | int sigmadsp_restrict_params(struct sigmadsp *sigmadsp, | ||
51 | struct snd_pcm_substream *substream); | ||
34 | 52 | ||
35 | struct i2c_client; | 53 | struct i2c_client; |
36 | 54 | ||
37 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); | 55 | struct sigmadsp *devm_sigmadsp_init_regmap(struct device *dev, |
38 | extern int process_sigma_firmware_regmap(struct device *dev, | 56 | struct regmap *regmap, const struct sigmadsp_ops *ops, |
39 | struct regmap *regmap, const char *name); | 57 | const char *firmware_name); |
58 | struct sigmadsp *devm_sigmadsp_init_i2c(struct i2c_client *client, | ||
59 | const struct sigmadsp_ops *ops, const char *firmware_name); | ||
60 | |||
61 | int sigmadsp_attach(struct sigmadsp *sigmadsp, | ||
62 | struct snd_soc_component *component); | ||
63 | int sigmadsp_setup(struct sigmadsp *sigmadsp, unsigned int rate); | ||
64 | void sigmadsp_reset(struct sigmadsp *sigmadsp); | ||
40 | 65 | ||
41 | #endif | 66 | #endif |