aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-02-26 12:14:19 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-05 13:42:30 -0500
commit0b84caab364f40fdbf85828c9309f0c1c4dc0014 (patch)
treea9c090522f3948877e0c901804ead45607e837d7
parent5c632b223a31fa6dd63598e2a250ccc193a8bb4e (diff)
[media] s2255: fix big-endian support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/usb/s2255/s2255drv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index cd06f3cc4f98..2bd86132d3e3 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -522,7 +522,7 @@ static void s2255_timer(unsigned long user_data)
522 522
523 523
524/* this loads the firmware asynchronously. 524/* this loads the firmware asynchronously.
525 Originally this was done synchroously in probe. 525 Originally this was done synchronously in probe.
526 But it is better to load it asynchronously here than block 526 But it is better to load it asynchronously here than block
527 inside the probe function. Blocking inside probe affects boot time. 527 inside the probe function. Blocking inside probe affects boot time.
528 FW loading is triggered by the timer in the probe function 528 FW loading is triggered by the timer in the probe function
@@ -1157,6 +1157,8 @@ static int s2255_set_mode(struct s2255_channel *channel,
1157 __le32 *buffer; 1157 __le32 *buffer;
1158 unsigned long chn_rev; 1158 unsigned long chn_rev;
1159 struct s2255_dev *dev = to_s2255_dev(channel->vdev.v4l2_dev); 1159 struct s2255_dev *dev = to_s2255_dev(channel->vdev.v4l2_dev);
1160 int i;
1161
1160 chn_rev = G_chnmap[channel->idx]; 1162 chn_rev = G_chnmap[channel->idx];
1161 dprintk(3, "%s channel: %d\n", __func__, channel->idx); 1163 dprintk(3, "%s channel: %d\n", __func__, channel->idx);
1162 /* if JPEG, set the quality */ 1164 /* if JPEG, set the quality */
@@ -1179,7 +1181,8 @@ static int s2255_set_mode(struct s2255_channel *channel,
1179 buffer[0] = IN_DATA_TOKEN; 1181 buffer[0] = IN_DATA_TOKEN;
1180 buffer[1] = (__le32) cpu_to_le32(chn_rev); 1182 buffer[1] = (__le32) cpu_to_le32(chn_rev);
1181 buffer[2] = CMD_SET_MODE; 1183 buffer[2] = CMD_SET_MODE;
1182 memcpy(&buffer[3], &channel->mode, sizeof(struct s2255_mode)); 1184 for (i = 0; i < sizeof(struct s2255_mode) / sizeof(u32); i++)
1185 buffer[3 + i] = cpu_to_le32(((u32 *)&channel->mode)[i]);
1183 channel->setmode_ready = 0; 1186 channel->setmode_ready = 0;
1184 res = s2255_write_config(dev->udev, (unsigned char *)buffer, 512); 1187 res = s2255_write_config(dev->udev, (unsigned char *)buffer, 512);
1185 if (debug) 1188 if (debug)
@@ -2511,7 +2514,7 @@ static int s2255_probe(struct usb_interface *interface,
2511 return -ENOMEM; 2514 return -ENOMEM;
2512 } 2515 }
2513 atomic_set(&dev->num_channels, 0); 2516 atomic_set(&dev->num_channels, 0);
2514 dev->pid = id->idProduct; 2517 dev->pid = le16_to_cpu(id->idProduct);
2515 dev->fw_data = kzalloc(sizeof(struct s2255_fw), GFP_KERNEL); 2518 dev->fw_data = kzalloc(sizeof(struct s2255_fw), GFP_KERNEL);
2516 if (!dev->fw_data) 2519 if (!dev->fw_data)
2517 goto errorFWDATA1; 2520 goto errorFWDATA1;
@@ -2581,7 +2584,7 @@ static int s2255_probe(struct usb_interface *interface,
2581 /* make sure firmware is the latest */ 2584 /* make sure firmware is the latest */
2582 __le32 *pRel; 2585 __le32 *pRel;
2583 pRel = (__le32 *) &dev->fw_data->fw->data[fw_size - 4]; 2586 pRel = (__le32 *) &dev->fw_data->fw->data[fw_size - 4];
2584 printk(KERN_INFO "s2255 dsp fw version %x\n", *pRel); 2587 printk(KERN_INFO "s2255 dsp fw version %x\n", le32_to_cpu(*pRel));
2585 dev->dsp_fw_ver = le32_to_cpu(*pRel); 2588 dev->dsp_fw_ver = le32_to_cpu(*pRel);
2586 if (dev->dsp_fw_ver < S2255_CUR_DSP_FWVER) 2589 if (dev->dsp_fw_ver < S2255_CUR_DSP_FWVER)
2587 printk(KERN_INFO "s2255: f2255usb.bin out of date.\n"); 2590 printk(KERN_INFO "s2255: f2255usb.bin out of date.\n");