diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-11-28 09:44:19 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-29 12:01:20 +0000 |
commit | a4c1d7e66719b326431c6e617da07cab0caedbca (patch) | |
tree | 453e958bdb52c05d33687980285da908b75b1da9 /sound/soc/codecs/sigmadsp.c | |
parent | 48afc5272eec2e1a7cf17aee0d2949810a45994a (diff) |
ASoC: SigmaDSP: Move private structs and functions to C file
Move the structs and functions only used by SigmaDSP firmware loader itself
from the header to the C file.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/sigmadsp.c')
-rw-r--r-- | sound/soc/codecs/sigmadsp.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sound/soc/codecs/sigmadsp.c b/sound/soc/codecs/sigmadsp.c index c0ad88516f3..aa223c56b2b 100644 --- a/sound/soc/codecs/sigmadsp.c +++ b/sound/soc/codecs/sigmadsp.c @@ -15,6 +15,42 @@ #include "sigmadsp.h" +#define SIGMA_MAGIC "ADISIGM" + +struct sigma_firmware_header { + unsigned char magic[7]; + u8 version; + __le32 crc; +} __packed; + +enum { + SIGMA_ACTION_WRITEXBYTES = 0, + SIGMA_ACTION_WRITESINGLE, + SIGMA_ACTION_WRITESAFELOAD, + SIGMA_ACTION_DELAY, + SIGMA_ACTION_PLLWAIT, + SIGMA_ACTION_NOOP, + SIGMA_ACTION_END, +}; + +struct sigma_action { + u8 instr; + u8 len_hi; + __le16 len; + __be16 addr; + unsigned char payload[]; +} __packed; + +struct sigma_firmware { + const struct firmware *fw; + size_t pos; +}; + +static inline u32 sigma_action_len(struct sigma_action *sa) +{ + return (sa->len_hi << 16) | le16_to_cpu(sa->len); +} + static size_t sigma_action_size(struct sigma_action *sa) { size_t payload = 0; |