firmware: Sigma: Fix endianess issues
Currently the SigmaDSP firmware loader only works correctly on little-endian systems. Fix this by using the proper endianess conversion functions. 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> Cc: stable@kernel.org
This commit is contained in:
parent
c56935bdc0
commit
bda63586bc
2 changed files with 5 additions and 5 deletions
|
|
@ -24,7 +24,7 @@ struct sigma_firmware {
|
|||
struct sigma_firmware_header {
|
||||
unsigned char magic[7];
|
||||
u8 version;
|
||||
u32 crc;
|
||||
__le32 crc;
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
@ -40,14 +40,14 @@ enum {
|
|||
struct sigma_action {
|
||||
u8 instr;
|
||||
u8 len_hi;
|
||||
u16 len;
|
||||
u16 addr;
|
||||
__le16 len;
|
||||
__be16 addr;
|
||||
unsigned char payload[];
|
||||
};
|
||||
|
||||
static inline u32 sigma_action_len(struct sigma_action *sa)
|
||||
{
|
||||
return (sa->len_hi << 16) | sa->len;
|
||||
return (sa->len_hi << 16) | le16_to_cpu(sa->len);
|
||||
}
|
||||
|
||||
extern int process_sigma_firmware(struct i2c_client *client, const char *name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue