diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-02-07 13:28:53 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-05 12:26:07 -0500 |
commit | 69a11a32643bda3e7f76af397cb6cd7b32c640f9 (patch) | |
tree | 96d8de1b309441da9ef5510cc6a174e2442223ab /drivers/media/usb/cx231xx | |
parent | fff9e818fb523804084cf8456f48ffbc56b70fbe (diff) |
[media] cx231xx: fix big-endian problems
Tested on my big-endian ppc-based test machine.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/cx231xx')
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-audio.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-avcore.c | 8 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-cards.c | 16 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-core.c | 2 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c | 2 |
5 files changed, 16 insertions, 16 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-audio.c b/drivers/media/usb/cx231xx/cx231xx-audio.c index b40360b8e89e..81a1d971d797 100644 --- a/drivers/media/usb/cx231xx/cx231xx-audio.c +++ b/drivers/media/usb/cx231xx/cx231xx-audio.c | |||
@@ -704,8 +704,8 @@ static int cx231xx_audio_init(struct cx231xx *dev) | |||
704 | audio_index + 1]; | 704 | audio_index + 1]; |
705 | 705 | ||
706 | adev->end_point_addr = | 706 | adev->end_point_addr = |
707 | le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe].desc. | 707 | uif->altsetting[0].endpoint[isoc_pipe].desc. |
708 | bEndpointAddress); | 708 | bEndpointAddress; |
709 | 709 | ||
710 | adev->num_alt = uif->num_altsetting; | 710 | adev->num_alt = uif->num_altsetting; |
711 | cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", | 711 | cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", |
diff --git a/drivers/media/usb/cx231xx/cx231xx-avcore.c b/drivers/media/usb/cx231xx/cx231xx-avcore.c index 4706ed350293..3f26f64d7bf4 100644 --- a/drivers/media/usb/cx231xx/cx231xx-avcore.c +++ b/drivers/media/usb/cx231xx/cx231xx-avcore.c | |||
@@ -2221,7 +2221,7 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum AV_MODE mode) | |||
2221 | if (status < 0) | 2221 | if (status < 0) |
2222 | return status; | 2222 | return status; |
2223 | 2223 | ||
2224 | tmp = *((u32 *) value); | 2224 | tmp = le32_to_cpu(*((u32 *) value)); |
2225 | 2225 | ||
2226 | switch (mode) { | 2226 | switch (mode) { |
2227 | case POLARIS_AVMODE_ENXTERNAL_AV: | 2227 | case POLARIS_AVMODE_ENXTERNAL_AV: |
@@ -2442,7 +2442,7 @@ int cx231xx_power_suspend(struct cx231xx *dev) | |||
2442 | if (status > 0) | 2442 | if (status > 0) |
2443 | return status; | 2443 | return status; |
2444 | 2444 | ||
2445 | tmp = *((u32 *) value); | 2445 | tmp = le32_to_cpu(*((u32 *) value)); |
2446 | tmp &= (~PWR_MODE_MASK); | 2446 | tmp &= (~PWR_MODE_MASK); |
2447 | 2447 | ||
2448 | value[0] = (u8) tmp; | 2448 | value[0] = (u8) tmp; |
@@ -2470,7 +2470,7 @@ int cx231xx_start_stream(struct cx231xx *dev, u32 ep_mask) | |||
2470 | if (status < 0) | 2470 | if (status < 0) |
2471 | return status; | 2471 | return status; |
2472 | 2472 | ||
2473 | tmp = *((u32 *) value); | 2473 | tmp = le32_to_cpu(*((u32 *) value)); |
2474 | tmp |= ep_mask; | 2474 | tmp |= ep_mask; |
2475 | value[0] = (u8) tmp; | 2475 | value[0] = (u8) tmp; |
2476 | value[1] = (u8) (tmp >> 8); | 2476 | value[1] = (u8) (tmp >> 8); |
@@ -2495,7 +2495,7 @@ int cx231xx_stop_stream(struct cx231xx *dev, u32 ep_mask) | |||
2495 | if (status < 0) | 2495 | if (status < 0) |
2496 | return status; | 2496 | return status; |
2497 | 2497 | ||
2498 | tmp = *((u32 *) value); | 2498 | tmp = le32_to_cpu(*((u32 *) value)); |
2499 | tmp &= (~ep_mask); | 2499 | tmp &= (~ep_mask); |
2500 | value[0] = (u8) tmp; | 2500 | value[0] = (u8) tmp; |
2501 | value[1] = (u8) (tmp >> 8); | 2501 | value[1] = (u8) (tmp >> 8); |
diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c index 62d104b98390..b7b1acd7e7b0 100644 --- a/drivers/media/usb/cx231xx/cx231xx-cards.c +++ b/drivers/media/usb/cx231xx/cx231xx-cards.c | |||
@@ -1189,8 +1189,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface, | |||
1189 | uif = udev->actconfig->interface[dev->current_pcb_config. | 1189 | uif = udev->actconfig->interface[dev->current_pcb_config. |
1190 | hs_config_info[0].interface_info.video_index + 1]; | 1190 | hs_config_info[0].interface_info.video_index + 1]; |
1191 | 1191 | ||
1192 | dev->video_mode.end_point_addr = le16_to_cpu(uif->altsetting[0]. | 1192 | dev->video_mode.end_point_addr = uif->altsetting[0]. |
1193 | endpoint[isoc_pipe].desc.bEndpointAddress); | 1193 | endpoint[isoc_pipe].desc.bEndpointAddress; |
1194 | 1194 | ||
1195 | dev->video_mode.num_alt = uif->num_altsetting; | 1195 | dev->video_mode.num_alt = uif->num_altsetting; |
1196 | cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", | 1196 | cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", |
@@ -1223,8 +1223,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface, | |||
1223 | vanc_index + 1]; | 1223 | vanc_index + 1]; |
1224 | 1224 | ||
1225 | dev->vbi_mode.end_point_addr = | 1225 | dev->vbi_mode.end_point_addr = |
1226 | le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe].desc. | 1226 | uif->altsetting[0].endpoint[isoc_pipe].desc. |
1227 | bEndpointAddress); | 1227 | bEndpointAddress; |
1228 | 1228 | ||
1229 | dev->vbi_mode.num_alt = uif->num_altsetting; | 1229 | dev->vbi_mode.num_alt = uif->num_altsetting; |
1230 | cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", | 1230 | cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", |
@@ -1258,8 +1258,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface, | |||
1258 | hanc_index + 1]; | 1258 | hanc_index + 1]; |
1259 | 1259 | ||
1260 | dev->sliced_cc_mode.end_point_addr = | 1260 | dev->sliced_cc_mode.end_point_addr = |
1261 | le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe].desc. | 1261 | uif->altsetting[0].endpoint[isoc_pipe].desc. |
1262 | bEndpointAddress); | 1262 | bEndpointAddress; |
1263 | 1263 | ||
1264 | dev->sliced_cc_mode.num_alt = uif->num_altsetting; | 1264 | dev->sliced_cc_mode.num_alt = uif->num_altsetting; |
1265 | cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", | 1265 | cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", |
@@ -1294,8 +1294,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface, | |||
1294 | ts1_index + 1]; | 1294 | ts1_index + 1]; |
1295 | 1295 | ||
1296 | dev->ts1_mode.end_point_addr = | 1296 | dev->ts1_mode.end_point_addr = |
1297 | le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe]. | 1297 | uif->altsetting[0].endpoint[isoc_pipe]. |
1298 | desc.bEndpointAddress); | 1298 | desc.bEndpointAddress; |
1299 | 1299 | ||
1300 | dev->ts1_mode.num_alt = uif->num_altsetting; | 1300 | dev->ts1_mode.num_alt = uif->num_altsetting; |
1301 | cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", | 1301 | cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n", |
diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c index 05358d486135..4ba3ce09b713 100644 --- a/drivers/media/usb/cx231xx/cx231xx-core.c +++ b/drivers/media/usb/cx231xx/cx231xx-core.c | |||
@@ -1488,7 +1488,7 @@ int cx231xx_mode_register(struct cx231xx *dev, u16 address, u32 mode) | |||
1488 | if (status < 0) | 1488 | if (status < 0) |
1489 | return status; | 1489 | return status; |
1490 | 1490 | ||
1491 | tmp = *((u32 *) value); | 1491 | tmp = le32_to_cpu(*((u32 *) value)); |
1492 | tmp |= mode; | 1492 | tmp |= mode; |
1493 | 1493 | ||
1494 | value[0] = (u8) tmp; | 1494 | value[0] = (u8) tmp; |
diff --git a/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c b/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c index 7473c33e823e..d7308ab7a90f 100644 --- a/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c +++ b/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c | |||
@@ -672,7 +672,7 @@ u32 initialize_cx231xx(struct cx231xx *dev) | |||
672 | pcb config it is related to */ | 672 | pcb config it is related to */ |
673 | cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT, data, 4); | 673 | cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT, data, 4); |
674 | 674 | ||
675 | config_info = *((u32 *) data); | 675 | config_info = le32_to_cpu(*((u32 *) data)); |
676 | usb_speed = (u8) (config_info & 0x1); | 676 | usb_speed = (u8) (config_info & 0x1); |
677 | 677 | ||
678 | /* Verify this device belongs to Bus power or Self power device */ | 678 | /* Verify this device belongs to Bus power or Self power device */ |