diff options
-rw-r--r-- | sound/soc/codecs/sigmadsp.c | 36 | ||||
-rw-r--r-- | sound/soc/codecs/sigmadsp.h | 39 |
2 files changed, 36 insertions, 39 deletions
diff --git a/sound/soc/codecs/sigmadsp.c b/sound/soc/codecs/sigmadsp.c index c0ad88516f30..aa223c56b2b6 100644 --- a/sound/soc/codecs/sigmadsp.c +++ b/sound/soc/codecs/sigmadsp.c | |||
@@ -15,6 +15,42 @@ | |||
15 | 15 | ||
16 | #include "sigmadsp.h" | 16 | #include "sigmadsp.h" |
17 | 17 | ||
18 | #define SIGMA_MAGIC "ADISIGM" | ||
19 | |||
20 | struct sigma_firmware_header { | ||
21 | unsigned char magic[7]; | ||
22 | u8 version; | ||
23 | __le32 crc; | ||
24 | } __packed; | ||
25 | |||
26 | enum { | ||
27 | SIGMA_ACTION_WRITEXBYTES = 0, | ||
28 | SIGMA_ACTION_WRITESINGLE, | ||
29 | SIGMA_ACTION_WRITESAFELOAD, | ||
30 | SIGMA_ACTION_DELAY, | ||
31 | SIGMA_ACTION_PLLWAIT, | ||
32 | SIGMA_ACTION_NOOP, | ||
33 | SIGMA_ACTION_END, | ||
34 | }; | ||
35 | |||
36 | struct sigma_action { | ||
37 | u8 instr; | ||
38 | u8 len_hi; | ||
39 | __le16 len; | ||
40 | __be16 addr; | ||
41 | unsigned char payload[]; | ||
42 | } __packed; | ||
43 | |||
44 | struct sigma_firmware { | ||
45 | const struct firmware *fw; | ||
46 | size_t pos; | ||
47 | }; | ||
48 | |||
49 | static inline u32 sigma_action_len(struct sigma_action *sa) | ||
50 | { | ||
51 | return (sa->len_hi << 16) | le16_to_cpu(sa->len); | ||
52 | } | ||
53 | |||
18 | static size_t sigma_action_size(struct sigma_action *sa) | 54 | static size_t sigma_action_size(struct sigma_action *sa) |
19 | { | 55 | { |
20 | size_t payload = 0; | 56 | size_t payload = 0; |
diff --git a/sound/soc/codecs/sigmadsp.h b/sound/soc/codecs/sigmadsp.h index d0de882c0d96..99a609157b2e 100644 --- a/sound/soc/codecs/sigmadsp.h +++ b/sound/soc/codecs/sigmadsp.h | |||
@@ -9,47 +9,8 @@ | |||
9 | #ifndef __SIGMA_FIRMWARE_H__ | 9 | #ifndef __SIGMA_FIRMWARE_H__ |
10 | #define __SIGMA_FIRMWARE_H__ | 10 | #define __SIGMA_FIRMWARE_H__ |
11 | 11 | ||
12 | #include <linux/firmware.h> | ||
13 | #include <linux/types.h> | ||
14 | |||
15 | struct i2c_client; | 12 | struct i2c_client; |
16 | 13 | ||
17 | #define SIGMA_MAGIC "ADISIGM" | ||
18 | |||
19 | struct sigma_firmware { | ||
20 | const struct firmware *fw; | ||
21 | size_t pos; | ||
22 | }; | ||
23 | |||
24 | struct sigma_firmware_header { | ||
25 | unsigned char magic[7]; | ||
26 | u8 version; | ||
27 | __le32 crc; | ||
28 | }; | ||
29 | |||
30 | enum { | ||
31 | SIGMA_ACTION_WRITEXBYTES = 0, | ||
32 | SIGMA_ACTION_WRITESINGLE, | ||
33 | SIGMA_ACTION_WRITESAFELOAD, | ||
34 | SIGMA_ACTION_DELAY, | ||
35 | SIGMA_ACTION_PLLWAIT, | ||
36 | SIGMA_ACTION_NOOP, | ||
37 | SIGMA_ACTION_END, | ||
38 | }; | ||
39 | |||
40 | struct sigma_action { | ||
41 | u8 instr; | ||
42 | u8 len_hi; | ||
43 | __le16 len; | ||
44 | __be16 addr; | ||
45 | unsigned char payload[]; | ||
46 | }; | ||
47 | |||
48 | static inline u32 sigma_action_len(struct sigma_action *sa) | ||
49 | { | ||
50 | return (sa->len_hi << 16) | le16_to_cpu(sa->len); | ||
51 | } | ||
52 | |||
53 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); | 14 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); |
54 | 15 | ||
55 | #endif | 16 | #endif |