diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-29 07:00:17 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-29 07:00:17 -0500 |
commit | 1db7c89c62b3c0a0ebf8c07975ae907fa404116a (patch) | |
tree | 578e8aa4069367f70897c41f6e56b5b9912bdfac /include | |
parent | 7b282cbbf3c7bbad20505761a9eadd6d9a7280c7 (diff) | |
parent | bda63586bc5929e97288cdb371bb6456504867ed (diff) |
Merge branch 'for-3.2' into for-3.3
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sigma.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/include/linux/sigma.h b/include/linux/sigma.h index e2accb3164d8..d0de882c0d96 100644 --- a/include/linux/sigma.h +++ b/include/linux/sigma.h | |||
@@ -24,7 +24,7 @@ struct sigma_firmware { | |||
24 | struct sigma_firmware_header { | 24 | struct sigma_firmware_header { |
25 | unsigned char magic[7]; | 25 | unsigned char magic[7]; |
26 | u8 version; | 26 | u8 version; |
27 | u32 crc; | 27 | __le32 crc; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | enum { | 30 | enum { |
@@ -40,19 +40,14 @@ enum { | |||
40 | struct sigma_action { | 40 | struct sigma_action { |
41 | u8 instr; | 41 | u8 instr; |
42 | u8 len_hi; | 42 | u8 len_hi; |
43 | u16 len; | 43 | __le16 len; |
44 | u16 addr; | 44 | __be16 addr; |
45 | unsigned char payload[]; | 45 | unsigned char payload[]; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | static inline u32 sigma_action_len(struct sigma_action *sa) | 48 | static inline u32 sigma_action_len(struct sigma_action *sa) |
49 | { | 49 | { |
50 | return (sa->len_hi << 16) | sa->len; | 50 | return (sa->len_hi << 16) | le16_to_cpu(sa->len); |
51 | } | ||
52 | |||
53 | static inline size_t sigma_action_size(struct sigma_action *sa, u32 payload_len) | ||
54 | { | ||
55 | return sizeof(*sa) + payload_len + (payload_len % 2); | ||
56 | } | 51 | } |
57 | 52 | ||
58 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); | 53 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); |