diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dib0700_devices.c | 21 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-firmware.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/gp8psk.c | 10 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/m920x.c | 7 |
5 files changed, 22 insertions, 20 deletions
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index cf4584e48b6d..f00a0eb40420 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config DVB_USB | 1 | config DVB_USB |
2 | tristate "Support for various USB DVB devices" | 2 | tristate "Support for various USB DVB devices" |
3 | depends on DVB_CORE && USB && I2C | 3 | depends on DVB_CORE && USB && I2C && INPUT |
4 | depends on HOTPLUG # due to FW_LOADER | 4 | depends on HOTPLUG # due to FW_LOADER |
5 | select FW_LOADER | 5 | select FW_LOADER |
6 | help | 6 | help |
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index 346223856f59..c4d40fe01d57 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c | |||
@@ -111,8 +111,8 @@ static int bristol_tuner_attach(struct dvb_usb_adapter *adap) | |||
111 | struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); | 111 | struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); |
112 | s8 a; | 112 | s8 a; |
113 | int if1=1220; | 113 | int if1=1220; |
114 | if (adap->dev->udev->descriptor.idVendor == USB_VID_HAUPPAUGE && | 114 | if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) && |
115 | adap->dev->udev->descriptor.idProduct == USB_PID_HAUPPAUGE_NOVA_T_500_2) { | 115 | adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_500_2)) { |
116 | if (!eeprom_read(prim_i2c,0x59 + adap->id,&a)) if1=1220+a; | 116 | if (!eeprom_read(prim_i2c,0x59 + adap->id,&a)) if1=1220+a; |
117 | } | 117 | } |
118 | return dvb_attach(mt2060_attach,adap->fe, tun_i2c,&bristol_mt2060_config[adap->id], | 118 | return dvb_attach(mt2060_attach,adap->fe, tun_i2c,&bristol_mt2060_config[adap->id], |
@@ -402,8 +402,8 @@ static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap) | |||
402 | { | 402 | { |
403 | struct usb_device_descriptor *desc = &adap->dev->udev->descriptor; | 403 | struct usb_device_descriptor *desc = &adap->dev->udev->descriptor; |
404 | 404 | ||
405 | if (desc->idVendor == USB_VID_PINNACLE && | 405 | if (desc->idVendor == cpu_to_le16(USB_VID_PINNACLE) && |
406 | desc->idProduct == USB_PID_PINNACLE_EXPRESSCARD_320CX) | 406 | desc->idProduct == cpu_to_le16(USB_PID_PINNACLE_EXPRESSCARD_320CX)) |
407 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); | 407 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
408 | else | 408 | else |
409 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); | 409 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
@@ -845,8 +845,8 @@ static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap) | |||
845 | struct i2c_adapter *tun_i2c; | 845 | struct i2c_adapter *tun_i2c; |
846 | s8 a; | 846 | s8 a; |
847 | int if1=1220; | 847 | int if1=1220; |
848 | if (adap->dev->udev->descriptor.idVendor == USB_VID_HAUPPAUGE && | 848 | if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) && |
849 | adap->dev->udev->descriptor.idProduct == USB_PID_HAUPPAUGE_NOVA_T_STICK) { | 849 | adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_STICK)) { |
850 | if (!eeprom_read(prim_i2c,0x58,&a)) if1=1220+a; | 850 | if (!eeprom_read(prim_i2c,0x58,&a)) if1=1220+a; |
851 | } | 851 | } |
852 | if (st->is_dib7000pc) | 852 | if (st->is_dib7000pc) |
@@ -990,11 +990,12 @@ static struct dib7000p_config dib7070p_dib7000p_config = { | |||
990 | /* STK7070P */ | 990 | /* STK7070P */ |
991 | static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) | 991 | static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) |
992 | { | 992 | { |
993 | if (adap->dev->udev->descriptor.idVendor == USB_VID_PINNACLE && | 993 | struct usb_device_descriptor *p = &adap->dev->udev->descriptor; |
994 | adap->dev->udev->descriptor.idProduct == USB_PID_PINNACLE_PCTV72E) | 994 | if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) && |
995 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); | 995 | p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E)) |
996 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); | ||
996 | else | 997 | else |
997 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); | 998 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
998 | msleep(10); | 999 | msleep(10); |
999 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); | 1000 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
1000 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); | 1001 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c index e1112e39fb63..733a7ff7b207 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c | |||
@@ -127,7 +127,7 @@ int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx, | |||
127 | if ((*pos + hx->len + 4) >= fw->size) | 127 | if ((*pos + hx->len + 4) >= fw->size) |
128 | return -EINVAL; | 128 | return -EINVAL; |
129 | 129 | ||
130 | hx->addr = le16_to_cpu( *((u16 *) &b[1]) ); | 130 | hx->addr = b[1] | (b[2] << 8); |
131 | hx->type = b[3]; | 131 | hx->type = b[3]; |
132 | 132 | ||
133 | if (hx->type == 0x04) { | 133 | if (hx->type == 0x04) { |
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c index 9a942afaf0af..2653120673b7 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk.c +++ b/drivers/media/dvb/dvb-usb/gp8psk.c | |||
@@ -146,24 +146,24 @@ static int gp8psk_power_ctrl(struct dvb_usb_device *d, int onoff) | |||
146 | if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) | 146 | if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) |
147 | if (! (status & bm8pskFW_Loaded)) /* BCM4500 firmware loaded */ | 147 | if (! (status & bm8pskFW_Loaded)) /* BCM4500 firmware loaded */ |
148 | if(gp8psk_load_bcm4500fw(d)) | 148 | if(gp8psk_load_bcm4500fw(d)) |
149 | return EINVAL; | 149 | return -EINVAL; |
150 | 150 | ||
151 | if (! (status & bmIntersilOn)) /* LNB Power */ | 151 | if (! (status & bmIntersilOn)) /* LNB Power */ |
152 | if (gp8psk_usb_in_op(d, START_INTERSIL, 1, 0, | 152 | if (gp8psk_usb_in_op(d, START_INTERSIL, 1, 0, |
153 | &buf, 1)) | 153 | &buf, 1)) |
154 | return EINVAL; | 154 | return -EINVAL; |
155 | 155 | ||
156 | /* Set DVB mode to 1 */ | 156 | /* Set DVB mode to 1 */ |
157 | if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) | 157 | if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) |
158 | if (gp8psk_usb_out_op(d, SET_DVB_MODE, 1, 0, NULL, 0)) | 158 | if (gp8psk_usb_out_op(d, SET_DVB_MODE, 1, 0, NULL, 0)) |
159 | return EINVAL; | 159 | return -EINVAL; |
160 | /* Abort possible TS (if previous tune crashed) */ | 160 | /* Abort possible TS (if previous tune crashed) */ |
161 | if (gp8psk_usb_out_op(d, ARM_TRANSFER, 0, 0, NULL, 0)) | 161 | if (gp8psk_usb_out_op(d, ARM_TRANSFER, 0, 0, NULL, 0)) |
162 | return EINVAL; | 162 | return -EINVAL; |
163 | } else { | 163 | } else { |
164 | /* Turn off LNB power */ | 164 | /* Turn off LNB power */ |
165 | if (gp8psk_usb_in_op(d, START_INTERSIL, 0, 0, &buf, 1)) | 165 | if (gp8psk_usb_in_op(d, START_INTERSIL, 0, 0, &buf, 1)) |
166 | return EINVAL; | 166 | return -EINVAL; |
167 | /* Turn off 8psk power */ | 167 | /* Turn off 8psk power */ |
168 | if (gp8psk_usb_in_op(d, BOOT_8PSK, 0, 0, &buf, 1)) | 168 | if (gp8psk_usb_in_op(d, BOOT_8PSK, 0, 0, &buf, 1)) |
169 | return -EINVAL; | 169 | return -EINVAL; |
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c index a12e6f784fda..54626a0dbf68 100644 --- a/drivers/media/dvb/dvb-usb/m920x.c +++ b/drivers/media/dvb/dvb-usb/m920x.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include "qt1010.h" | 16 | #include "qt1010.h" |
17 | #include "tda1004x.h" | 17 | #include "tda1004x.h" |
18 | #include "tda827x.h" | 18 | #include "tda827x.h" |
19 | #include <asm/unaligned.h> | ||
19 | 20 | ||
20 | /* debug */ | 21 | /* debug */ |
21 | static int dvb_usb_m920x_debug; | 22 | static int dvb_usb_m920x_debug; |
@@ -347,13 +348,13 @@ static int m920x_firmware_download(struct usb_device *udev, const struct firmwar | |||
347 | 348 | ||
348 | for (pass = 0; pass < 2; pass++) { | 349 | for (pass = 0; pass < 2; pass++) { |
349 | for (i = 0; i + (sizeof(u16) * 3) < fw->size;) { | 350 | for (i = 0; i + (sizeof(u16) * 3) < fw->size;) { |
350 | value = le16_to_cpu(*(u16 *)(fw->data + i)); | 351 | value = get_unaligned_le16(fw->data + i); |
351 | i += sizeof(u16); | 352 | i += sizeof(u16); |
352 | 353 | ||
353 | index = le16_to_cpu(*(u16 *)(fw->data + i)); | 354 | index = get_unaligned_le16(fw->data + i); |
354 | i += sizeof(u16); | 355 | i += sizeof(u16); |
355 | 356 | ||
356 | size = le16_to_cpu(*(u16 *)(fw->data + i)); | 357 | size = get_unaligned_le16(fw->data + i); |
357 | i += sizeof(u16); | 358 | i += sizeof(u16); |
358 | 359 | ||
359 | if (pass == 1) { | 360 | if (pass == 1) { |