Commit 69a11a32 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] cx231xx: fix big-endian problems

Tested on my big-endian ppc-based test machine.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent fff9e818
...@@ -704,8 +704,8 @@ static int cx231xx_audio_init(struct cx231xx *dev) ...@@ -704,8 +704,8 @@ static int cx231xx_audio_init(struct cx231xx *dev)
audio_index + 1]; audio_index + 1];
adev->end_point_addr = adev->end_point_addr =
le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe].desc. uif->altsetting[0].endpoint[isoc_pipe].desc.
bEndpointAddress); bEndpointAddress;
adev->num_alt = uif->num_altsetting; adev->num_alt = uif->num_altsetting;
cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
......
...@@ -2221,7 +2221,7 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum AV_MODE mode) ...@@ -2221,7 +2221,7 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum AV_MODE mode)
if (status < 0) if (status < 0)
return status; return status;
tmp = *((u32 *) value); tmp = le32_to_cpu(*((u32 *) value));
switch (mode) { switch (mode) {
case POLARIS_AVMODE_ENXTERNAL_AV: case POLARIS_AVMODE_ENXTERNAL_AV:
...@@ -2442,7 +2442,7 @@ int cx231xx_power_suspend(struct cx231xx *dev) ...@@ -2442,7 +2442,7 @@ int cx231xx_power_suspend(struct cx231xx *dev)
if (status > 0) if (status > 0)
return status; return status;
tmp = *((u32 *) value); tmp = le32_to_cpu(*((u32 *) value));
tmp &= (~PWR_MODE_MASK); tmp &= (~PWR_MODE_MASK);
value[0] = (u8) tmp; value[0] = (u8) tmp;
...@@ -2470,7 +2470,7 @@ int cx231xx_start_stream(struct cx231xx *dev, u32 ep_mask) ...@@ -2470,7 +2470,7 @@ int cx231xx_start_stream(struct cx231xx *dev, u32 ep_mask)
if (status < 0) if (status < 0)
return status; return status;
tmp = *((u32 *) value); tmp = le32_to_cpu(*((u32 *) value));
tmp |= ep_mask; tmp |= ep_mask;
value[0] = (u8) tmp; value[0] = (u8) tmp;
value[1] = (u8) (tmp >> 8); value[1] = (u8) (tmp >> 8);
...@@ -2495,7 +2495,7 @@ int cx231xx_stop_stream(struct cx231xx *dev, u32 ep_mask) ...@@ -2495,7 +2495,7 @@ int cx231xx_stop_stream(struct cx231xx *dev, u32 ep_mask)
if (status < 0) if (status < 0)
return status; return status;
tmp = *((u32 *) value); tmp = le32_to_cpu(*((u32 *) value));
tmp &= (~ep_mask); tmp &= (~ep_mask);
value[0] = (u8) tmp; value[0] = (u8) tmp;
value[1] = (u8) (tmp >> 8); value[1] = (u8) (tmp >> 8);
......
...@@ -1189,8 +1189,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface, ...@@ -1189,8 +1189,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
uif = udev->actconfig->interface[dev->current_pcb_config. uif = udev->actconfig->interface[dev->current_pcb_config.
hs_config_info[0].interface_info.video_index + 1]; hs_config_info[0].interface_info.video_index + 1];
dev->video_mode.end_point_addr = le16_to_cpu(uif->altsetting[0]. dev->video_mode.end_point_addr = uif->altsetting[0].
endpoint[isoc_pipe].desc.bEndpointAddress); endpoint[isoc_pipe].desc.bEndpointAddress;
dev->video_mode.num_alt = uif->num_altsetting; dev->video_mode.num_alt = uif->num_altsetting;
cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
...@@ -1223,8 +1223,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface, ...@@ -1223,8 +1223,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
vanc_index + 1]; vanc_index + 1];
dev->vbi_mode.end_point_addr = dev->vbi_mode.end_point_addr =
le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe].desc. uif->altsetting[0].endpoint[isoc_pipe].desc.
bEndpointAddress); bEndpointAddress;
dev->vbi_mode.num_alt = uif->num_altsetting; dev->vbi_mode.num_alt = uif->num_altsetting;
cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
...@@ -1258,8 +1258,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface, ...@@ -1258,8 +1258,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
hanc_index + 1]; hanc_index + 1];
dev->sliced_cc_mode.end_point_addr = dev->sliced_cc_mode.end_point_addr =
le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe].desc. uif->altsetting[0].endpoint[isoc_pipe].desc.
bEndpointAddress); bEndpointAddress;
dev->sliced_cc_mode.num_alt = uif->num_altsetting; dev->sliced_cc_mode.num_alt = uif->num_altsetting;
cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
...@@ -1294,8 +1294,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface, ...@@ -1294,8 +1294,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
ts1_index + 1]; ts1_index + 1];
dev->ts1_mode.end_point_addr = dev->ts1_mode.end_point_addr =
le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe]. uif->altsetting[0].endpoint[isoc_pipe].
desc.bEndpointAddress); desc.bEndpointAddress;
dev->ts1_mode.num_alt = uif->num_altsetting; dev->ts1_mode.num_alt = uif->num_altsetting;
cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
......
...@@ -1488,7 +1488,7 @@ int cx231xx_mode_register(struct cx231xx *dev, u16 address, u32 mode) ...@@ -1488,7 +1488,7 @@ int cx231xx_mode_register(struct cx231xx *dev, u16 address, u32 mode)
if (status < 0) if (status < 0)
return status; return status;
tmp = *((u32 *) value); tmp = le32_to_cpu(*((u32 *) value));
tmp |= mode; tmp |= mode;
value[0] = (u8) tmp; value[0] = (u8) tmp;
......
...@@ -672,7 +672,7 @@ u32 initialize_cx231xx(struct cx231xx *dev) ...@@ -672,7 +672,7 @@ u32 initialize_cx231xx(struct cx231xx *dev)
pcb config it is related to */ pcb config it is related to */
cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT, data, 4); cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT, data, 4);
config_info = *((u32 *) data); config_info = le32_to_cpu(*((u32 *) data));
usb_speed = (u8) (config_info & 0x1); usb_speed = (u8) (config_info & 0x1);
/* Verify this device belongs to Bus power or Self power device */ /* Verify this device belongs to Bus power or Self power device */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment