Skip to content
/ linux Public

Commit 6eb9fc7

Browse files
fenugrecSasha Levin
authored andcommitted
ALSA: usb-audio: presonus s18xx uses little-endian
[ Upstream commit 3ce0329 ] Use __le32 types for USB control transfers Signed-off-by: fenugrec <fenugrec@mail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260111-preso_clean1-v2-1-44b4e5129a75@mail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9745c25 commit 6eb9fc7

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

sound/usb/mixer_s1810c.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@
8282
* mixer and output but a different set for device.
8383
*/
8484
struct s1810c_ctl_packet {
85-
u32 a;
86-
u32 b;
87-
u32 fixed1;
88-
u32 fixed2;
89-
u32 c;
90-
u32 d;
91-
u32 e;
85+
__le32 a;
86+
__le32 b;
87+
__le32 fixed1;
88+
__le32 fixed2;
89+
__le32 c;
90+
__le32 d;
91+
__le32 e;
9292
};
9393

9494
#define SC1810C_CTL_LINE_SW 0
@@ -118,7 +118,7 @@ struct s1810c_ctl_packet {
118118
* being zero and different f1/f2.
119119
*/
120120
struct s1810c_state_packet {
121-
u32 fields[63];
121+
__le32 fields[63];
122122
};
123123

124124
#define SC1810C_STATE_48V_SW 58
@@ -140,14 +140,14 @@ snd_s1810c_send_ctl_packet(struct usb_device *dev, u32 a,
140140
struct s1810c_ctl_packet pkt = { 0 };
141141
int ret = 0;
142142

143-
pkt.fixed1 = SC1810C_CMD_F1;
144-
pkt.fixed2 = SC1810C_CMD_F2;
143+
pkt.fixed1 = __cpu_to_le32(SC1810C_CMD_F1);
144+
pkt.fixed2 = __cpu_to_le32(SC1810C_CMD_F2);
145145

146-
pkt.a = a;
147-
pkt.b = b;
148-
pkt.c = c;
149-
pkt.d = d;
150-
pkt.e = e;
146+
pkt.a = __cpu_to_le32(a);
147+
pkt.b = __cpu_to_le32(b);
148+
pkt.c = __cpu_to_le32(c);
149+
pkt.d = __cpu_to_le32(d);
150+
pkt.e = __cpu_to_le32(e);
151151

152152
ret = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
153153
SC1810C_CMD_REQ,
@@ -176,8 +176,8 @@ snd_sc1810c_get_status_field(struct usb_device *dev,
176176
struct s1810c_state_packet pkt_in = { { 0 } };
177177
int ret = 0;
178178

179-
pkt_out.fields[SC1810C_STATE_F1_IDX] = SC1810C_SET_STATE_F1;
180-
pkt_out.fields[SC1810C_STATE_F2_IDX] = SC1810C_SET_STATE_F2;
179+
pkt_out.fields[SC1810C_STATE_F1_IDX] = __cpu_to_le32(SC1810C_SET_STATE_F1);
180+
pkt_out.fields[SC1810C_STATE_F2_IDX] = __cpu_to_le32(SC1810C_SET_STATE_F2);
181181
ret = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0),
182182
SC1810C_SET_STATE_REQ,
183183
SC1810C_SET_STATE_REQTYPE,
@@ -197,7 +197,7 @@ snd_sc1810c_get_status_field(struct usb_device *dev,
197197
return ret;
198198
}
199199

200-
(*field) = pkt_in.fields[field_idx];
200+
(*field) = __le32_to_cpu(pkt_in.fields[field_idx]);
201201
(*seqnum)++;
202202
return 0;
203203
}

0 commit comments

Comments
 (0)