diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 21:32:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 21:32:12 -0500 |
commit | 9e9bc9736756f25d6c47b4eba0ebf25b20a6f153 (patch) | |
tree | 647240f479c5f23910c3e6194d1c35b6ba54d75e /drivers/media/video/em28xx | |
parent | 3c0cb7c31c206aaedb967e44b98442bbeb17a6c4 (diff) | |
parent | e3c92215198cb6aa00ad38db2780faa6b72e0a3f (diff) |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (255 commits)
[media] radio-aimslab.c: Fix gcc 4.5+ bug
[media] cx25821: Fix compilation breakage due to BKL dependency
[media] v4l2-compat-ioctl32: fix compile warning
[media] zoran: fix compiler warning
[media] tda18218: fix compile warning
[media] ngene: fix compile warning
[media] DVB: IR support for TechnoTrend CT-3650
[media] cx23885, cimax2.c: Fix case of two CAM insertion irq
[media] ir-nec-decoder: fix repeat key issue
[media] staging: se401 depends on USB
[media] staging: usbvideo/vicam depends on USB
[media] soc_camera: Add the ability to bind regulators to soc_camedra devices
[media] V4L2: Add a v4l2-subdev (soc-camera) driver for OmniVision OV2640 sensor
[media] v4l: soc-camera: switch to .unlocked_ioctl
[media] v4l: ov772x: simplify pointer dereference
[media] ov9640: fix OmniVision OV9640 sensor driver's priv data retrieving
[media] ov9640: use macro to request OmniVision OV9640 sensor private data
[media] ivtv-i2c: Fix two warnings
[media] staging/lirc: Update lirc TODO files
[media] cx88: Remove the obsolete i2c_adapter.id field
...
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r-- | drivers/media/video/em28xx/Kconfig | 5 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 76 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-dvb.c | 16 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-input.c | 78 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-vbi.c | 1 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 30 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 4 |
7 files changed, 135 insertions, 75 deletions
diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig index 66aefd6eef55..985100ea17a4 100644 --- a/drivers/media/video/em28xx/Kconfig +++ b/drivers/media/video/em28xx/Kconfig | |||
@@ -1,9 +1,9 @@ | |||
1 | config VIDEO_EM28XX | 1 | config VIDEO_EM28XX |
2 | tristate "Empia EM28xx USB video capture support" | 2 | tristate "Empia EM28xx USB video capture support" |
3 | depends on VIDEO_DEV && I2C && INPUT | 3 | depends on VIDEO_DEV && I2C |
4 | select VIDEO_TUNER | 4 | select VIDEO_TUNER |
5 | select VIDEO_TVEEPROM | 5 | select VIDEO_TVEEPROM |
6 | depends on VIDEO_IR | 6 | depends on RC_CORE |
7 | select VIDEOBUF_VMALLOC | 7 | select VIDEOBUF_VMALLOC |
8 | select VIDEO_SAA711X if VIDEO_HELPER_CHIPS_AUTO | 8 | select VIDEO_SAA711X if VIDEO_HELPER_CHIPS_AUTO |
9 | select VIDEO_TVP5150 if VIDEO_HELPER_CHIPS_AUTO | 9 | select VIDEO_TVP5150 if VIDEO_HELPER_CHIPS_AUTO |
@@ -37,6 +37,7 @@ config VIDEO_EM28XX_DVB | |||
37 | select DVB_LGDT330X if !DVB_FE_CUSTOMISE | 37 | select DVB_LGDT330X if !DVB_FE_CUSTOMISE |
38 | select DVB_ZL10353 if !DVB_FE_CUSTOMISE | 38 | select DVB_ZL10353 if !DVB_FE_CUSTOMISE |
39 | select DVB_TDA10023 if !DVB_FE_CUSTOMISE | 39 | select DVB_TDA10023 if !DVB_FE_CUSTOMISE |
40 | select DVB_S921 if !DVB_FE_CUSTOMISE | ||
40 | select VIDEOBUF_DVB | 41 | select VIDEOBUF_DVB |
41 | ---help--- | 42 | ---help--- |
42 | This adds support for DVB cards based on the | 43 | This adds support for DVB cards based on the |
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index f7e9168157a5..8af302b425b3 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -268,6 +268,20 @@ static struct em28xx_reg_seq dikom_dk300_digital[] = { | |||
268 | }; | 268 | }; |
269 | 269 | ||
270 | 270 | ||
271 | /* Reset for the most [digital] boards */ | ||
272 | static struct em28xx_reg_seq leadership_digital[] = { | ||
273 | {EM2874_R80_GPIO, 0x70, 0xff, 10}, | ||
274 | { -1, -1, -1, -1}, | ||
275 | }; | ||
276 | |||
277 | static struct em28xx_reg_seq leadership_reset[] = { | ||
278 | {EM2874_R80_GPIO, 0xf0, 0xff, 10}, | ||
279 | {EM2874_R80_GPIO, 0xb0, 0xff, 10}, | ||
280 | {EM2874_R80_GPIO, 0xf0, 0xff, 10}, | ||
281 | { -1, -1, -1, -1}, | ||
282 | }; | ||
283 | |||
284 | |||
271 | /* | 285 | /* |
272 | * Board definitions | 286 | * Board definitions |
273 | */ | 287 | */ |
@@ -1224,6 +1238,19 @@ struct em28xx_board em28xx_boards[] = { | |||
1224 | .vmux = SAA7115_COMPOSITE0, | 1238 | .vmux = SAA7115_COMPOSITE0, |
1225 | } }, | 1239 | } }, |
1226 | }, | 1240 | }, |
1241 | |||
1242 | [EM2874_LEADERSHIP_ISDBT] = { | ||
1243 | .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT | | ||
1244 | EM28XX_I2C_CLK_WAIT_ENABLE | | ||
1245 | EM28XX_I2C_FREQ_100_KHZ, | ||
1246 | .xclk = EM28XX_XCLK_FREQUENCY_10MHZ, | ||
1247 | .name = "EM2874 Leadership ISDBT", | ||
1248 | .tuner_type = TUNER_ABSENT, | ||
1249 | .tuner_gpio = leadership_reset, | ||
1250 | .dvb_gpio = leadership_digital, | ||
1251 | .has_dvb = 1, | ||
1252 | }, | ||
1253 | |||
1227 | [EM2880_BOARD_MSI_DIGIVOX_AD] = { | 1254 | [EM2880_BOARD_MSI_DIGIVOX_AD] = { |
1228 | .name = "MSI DigiVox A/D", | 1255 | .name = "MSI DigiVox A/D", |
1229 | .valid = EM28XX_BOARD_NOT_VALIDATED, | 1256 | .valid = EM28XX_BOARD_NOT_VALIDATED, |
@@ -1469,7 +1496,7 @@ struct em28xx_board em28xx_boards[] = { | |||
1469 | } }, | 1496 | } }, |
1470 | }, | 1497 | }, |
1471 | [EM2882_BOARD_TERRATEC_HYBRID_XS] = { | 1498 | [EM2882_BOARD_TERRATEC_HYBRID_XS] = { |
1472 | .name = "Terratec Hybrid XS (em2882)", | 1499 | .name = "Terratec Cinnergy Hybrid T USB XS (em2882)", |
1473 | .tuner_type = TUNER_XC2028, | 1500 | .tuner_type = TUNER_XC2028, |
1474 | .tuner_gpio = default_tuner_gpio, | 1501 | .tuner_gpio = default_tuner_gpio, |
1475 | .mts_firmware = 1, | 1502 | .mts_firmware = 1, |
@@ -1633,11 +1660,11 @@ struct em28xx_board em28xx_boards[] = { | |||
1633 | .input = { { | 1660 | .input = { { |
1634 | .type = EM28XX_VMUX_COMPOSITE1, | 1661 | .type = EM28XX_VMUX_COMPOSITE1, |
1635 | .vmux = SAA7115_COMPOSITE0, | 1662 | .vmux = SAA7115_COMPOSITE0, |
1636 | .amux = EM28XX_AMUX_VIDEO2, | 1663 | .amux = EM28XX_AMUX_LINE_IN, |
1637 | }, { | 1664 | }, { |
1638 | .type = EM28XX_VMUX_SVIDEO, | 1665 | .type = EM28XX_VMUX_SVIDEO, |
1639 | .vmux = SAA7115_SVIDEO3, | 1666 | .vmux = SAA7115_SVIDEO3, |
1640 | .amux = EM28XX_AMUX_VIDEO2, | 1667 | .amux = EM28XX_AMUX_LINE_IN, |
1641 | } }, | 1668 | } }, |
1642 | }, | 1669 | }, |
1643 | [EM2860_BOARD_TERRATEC_AV350] = { | 1670 | [EM2860_BOARD_TERRATEC_AV350] = { |
@@ -1754,6 +1781,8 @@ struct usb_device_id em28xx_id_table[] = { | |||
1754 | .driver_info = EM2820_BOARD_UNKNOWN }, | 1781 | .driver_info = EM2820_BOARD_UNKNOWN }, |
1755 | { USB_DEVICE(0xeb1a, 0x2868), | 1782 | { USB_DEVICE(0xeb1a, 0x2868), |
1756 | .driver_info = EM2820_BOARD_UNKNOWN }, | 1783 | .driver_info = EM2820_BOARD_UNKNOWN }, |
1784 | { USB_DEVICE(0xeb1a, 0x2875), | ||
1785 | .driver_info = EM2820_BOARD_UNKNOWN }, | ||
1757 | { USB_DEVICE(0xeb1a, 0xe300), | 1786 | { USB_DEVICE(0xeb1a, 0xe300), |
1758 | .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U }, | 1787 | .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U }, |
1759 | { USB_DEVICE(0xeb1a, 0xe303), | 1788 | { USB_DEVICE(0xeb1a, 0xe303), |
@@ -1791,7 +1820,7 @@ struct usb_device_id em28xx_id_table[] = { | |||
1791 | { USB_DEVICE(0x0ccd, 0x005e), | 1820 | { USB_DEVICE(0x0ccd, 0x005e), |
1792 | .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS }, | 1821 | .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS }, |
1793 | { USB_DEVICE(0x0ccd, 0x0042), | 1822 | { USB_DEVICE(0x0ccd, 0x0042), |
1794 | .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS }, | 1823 | .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS }, |
1795 | { USB_DEVICE(0x0ccd, 0x0043), | 1824 | { USB_DEVICE(0x0ccd, 0x0043), |
1796 | .driver_info = EM2870_BOARD_TERRATEC_XS }, | 1825 | .driver_info = EM2870_BOARD_TERRATEC_XS }, |
1797 | { USB_DEVICE(0x0ccd, 0x0047), | 1826 | { USB_DEVICE(0x0ccd, 0x0047), |
@@ -1873,6 +1902,7 @@ static struct em28xx_hash_table em28xx_i2c_hash[] = { | |||
1873 | {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT}, | 1902 | {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT}, |
1874 | {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC}, | 1903 | {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC}, |
1875 | {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF}, | 1904 | {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF}, |
1905 | {0x6b800080, EM2874_LEADERSHIP_ISDBT, TUNER_ABSENT}, | ||
1876 | }; | 1906 | }; |
1877 | 1907 | ||
1878 | /* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */ | 1908 | /* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */ |
@@ -2408,7 +2438,7 @@ void em28xx_register_i2c_ir(struct em28xx *dev) | |||
2408 | dev->init_data.get_key = em28xx_get_key_em_haup; | 2438 | dev->init_data.get_key = em28xx_get_key_em_haup; |
2409 | dev->init_data.name = "i2c IR (EM2840 Hauppauge)"; | 2439 | dev->init_data.name = "i2c IR (EM2840 Hauppauge)"; |
2410 | case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE: | 2440 | case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE: |
2411 | dev->init_data.ir_codes = RC_MAP_WINFAST_USBII_DELUXE;; | 2441 | dev->init_data.ir_codes = RC_MAP_WINFAST_USBII_DELUXE; |
2412 | dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe; | 2442 | dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe; |
2413 | dev->init_data.name = "i2c IR (EM2820 Winfast TV USBII Deluxe)"; | 2443 | dev->init_data.name = "i2c IR (EM2820 Winfast TV USBII Deluxe)"; |
2414 | break; | 2444 | break; |
@@ -2430,8 +2460,36 @@ void em28xx_card_setup(struct em28xx *dev) | |||
2430 | dev->board.is_webcam = 0; | 2460 | dev->board.is_webcam = 0; |
2431 | else | 2461 | else |
2432 | dev->progressive = 1; | 2462 | dev->progressive = 1; |
2433 | } else | 2463 | } |
2434 | em28xx_set_model(dev); | 2464 | |
2465 | if (!dev->board.is_webcam) { | ||
2466 | switch (dev->model) { | ||
2467 | case EM2820_BOARD_UNKNOWN: | ||
2468 | case EM2800_BOARD_UNKNOWN: | ||
2469 | /* | ||
2470 | * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD. | ||
2471 | * | ||
2472 | * This occurs because they share identical USB vendor and | ||
2473 | * product IDs. | ||
2474 | * | ||
2475 | * What we do here is look up the EEPROM hash of the K-WORLD | ||
2476 | * and if it is found then we decide that we do not have | ||
2477 | * a DIGIVOX and reset the device to the K-WORLD instead. | ||
2478 | * | ||
2479 | * This solution is only valid if they do not share eeprom | ||
2480 | * hash identities which has not been determined as yet. | ||
2481 | */ | ||
2482 | if (em28xx_hint_board(dev) < 0) | ||
2483 | em28xx_errdev("Board not discovered\n"); | ||
2484 | else { | ||
2485 | em28xx_set_model(dev); | ||
2486 | em28xx_pre_card_setup(dev); | ||
2487 | } | ||
2488 | break; | ||
2489 | default: | ||
2490 | em28xx_set_model(dev); | ||
2491 | } | ||
2492 | } | ||
2435 | 2493 | ||
2436 | em28xx_info("Identified as %s (card=%d)\n", | 2494 | em28xx_info("Identified as %s (card=%d)\n", |
2437 | dev->board.name, dev->model); | 2495 | dev->board.name, dev->model); |
@@ -2749,8 +2807,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
2749 | em28xx_pre_card_setup(dev); | 2807 | em28xx_pre_card_setup(dev); |
2750 | 2808 | ||
2751 | if (!dev->board.is_em2800) { | 2809 | if (!dev->board.is_em2800) { |
2752 | /* Sets I2C speed to 100 KHz */ | 2810 | /* Resets I2C speed */ |
2753 | retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x40); | 2811 | em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); |
2754 | if (retval < 0) { | 2812 | if (retval < 0) { |
2755 | em28xx_errdev("%s: em28xx_write_regs_req failed!" | 2813 | em28xx_errdev("%s: em28xx_write_regs_req failed!" |
2756 | " retval [%d]\n", | 2814 | " retval [%d]\n", |
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c index 3ac8d3025fea..c7c04bf712aa 100644 --- a/drivers/media/video/em28xx/em28xx-dvb.c +++ b/drivers/media/video/em28xx/em28xx-dvb.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "mt352_priv.h" /* FIXME */ | 37 | #include "mt352_priv.h" /* FIXME */ |
38 | #include "tda1002x.h" | 38 | #include "tda1002x.h" |
39 | #include "tda18271.h" | 39 | #include "tda18271.h" |
40 | #include "s921.h" | ||
40 | 41 | ||
41 | MODULE_DESCRIPTION("driver for em28xx based DVB cards"); | 42 | MODULE_DESCRIPTION("driver for em28xx based DVB cards"); |
42 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 43 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); |
@@ -245,6 +246,10 @@ static struct lgdt3305_config em2870_lgdt3304_dev = { | |||
245 | .qam_if_khz = 4000, | 246 | .qam_if_khz = 4000, |
246 | }; | 247 | }; |
247 | 248 | ||
249 | static struct s921_config sharp_isdbt = { | ||
250 | .demod_address = 0x30 >> 1 | ||
251 | }; | ||
252 | |||
248 | static struct zl10353_config em28xx_zl10353_with_xc3028 = { | 253 | static struct zl10353_config em28xx_zl10353_with_xc3028 = { |
249 | .demod_address = (0x1e >> 1), | 254 | .demod_address = (0x1e >> 1), |
250 | .no_tuner = 1, | 255 | .no_tuner = 1, |
@@ -481,6 +486,7 @@ static int dvb_init(struct em28xx *dev) | |||
481 | 486 | ||
482 | if (!dev->board.has_dvb) { | 487 | if (!dev->board.has_dvb) { |
483 | /* This device does not support the extension */ | 488 | /* This device does not support the extension */ |
489 | printk(KERN_INFO "em28xx_dvb: This device does not support the extension\n"); | ||
484 | return 0; | 490 | return 0; |
485 | } | 491 | } |
486 | 492 | ||
@@ -496,6 +502,16 @@ static int dvb_init(struct em28xx *dev) | |||
496 | em28xx_set_mode(dev, EM28XX_DIGITAL_MODE); | 502 | em28xx_set_mode(dev, EM28XX_DIGITAL_MODE); |
497 | /* init frontend */ | 503 | /* init frontend */ |
498 | switch (dev->model) { | 504 | switch (dev->model) { |
505 | case EM2874_LEADERSHIP_ISDBT: | ||
506 | dvb->frontend = dvb_attach(s921_attach, | ||
507 | &sharp_isdbt, &dev->i2c_adap); | ||
508 | |||
509 | if (!dvb->frontend) { | ||
510 | result = -EINVAL; | ||
511 | goto out_free; | ||
512 | } | ||
513 | |||
514 | break; | ||
499 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850: | 515 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850: |
500 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: | 516 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: |
501 | case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: | 517 | case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: |
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c index 6759cd5570dd..29cc74441a7d 100644 --- a/drivers/media/video/em28xx/em28xx-input.c +++ b/drivers/media/video/em28xx/em28xx-input.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <linux/input.h> | ||
29 | #include <linux/usb.h> | 28 | #include <linux/usb.h> |
30 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
31 | 30 | ||
@@ -64,7 +63,7 @@ struct em28xx_ir_poll_result { | |||
64 | 63 | ||
65 | struct em28xx_IR { | 64 | struct em28xx_IR { |
66 | struct em28xx *dev; | 65 | struct em28xx *dev; |
67 | struct input_dev *input; | 66 | struct rc_dev *rc; |
68 | char name[32]; | 67 | char name[32]; |
69 | char phys[32]; | 68 | char phys[32]; |
70 | 69 | ||
@@ -75,10 +74,6 @@ struct em28xx_IR { | |||
75 | unsigned int last_readcount; | 74 | unsigned int last_readcount; |
76 | 75 | ||
77 | int (*get_key)(struct em28xx_IR *, struct em28xx_ir_poll_result *); | 76 | int (*get_key)(struct em28xx_IR *, struct em28xx_ir_poll_result *); |
78 | |||
79 | /* IR device properties */ | ||
80 | |||
81 | struct ir_dev_props props; | ||
82 | }; | 77 | }; |
83 | 78 | ||
84 | /********************************************************** | 79 | /********************************************************** |
@@ -302,12 +297,12 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir) | |||
302 | poll_result.toggle_bit, poll_result.read_count, | 297 | poll_result.toggle_bit, poll_result.read_count, |
303 | poll_result.rc_address, poll_result.rc_data[0]); | 298 | poll_result.rc_address, poll_result.rc_data[0]); |
304 | if (ir->full_code) | 299 | if (ir->full_code) |
305 | ir_keydown(ir->input, | 300 | rc_keydown(ir->rc, |
306 | poll_result.rc_address << 8 | | 301 | poll_result.rc_address << 8 | |
307 | poll_result.rc_data[0], | 302 | poll_result.rc_data[0], |
308 | poll_result.toggle_bit); | 303 | poll_result.toggle_bit); |
309 | else | 304 | else |
310 | ir_keydown(ir->input, | 305 | rc_keydown(ir->rc, |
311 | poll_result.rc_data[0], | 306 | poll_result.rc_data[0], |
312 | poll_result.toggle_bit); | 307 | poll_result.toggle_bit); |
313 | 308 | ||
@@ -331,9 +326,9 @@ static void em28xx_ir_work(struct work_struct *work) | |||
331 | schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling)); | 326 | schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling)); |
332 | } | 327 | } |
333 | 328 | ||
334 | static int em28xx_ir_start(void *priv) | 329 | static int em28xx_ir_start(struct rc_dev *rc) |
335 | { | 330 | { |
336 | struct em28xx_IR *ir = priv; | 331 | struct em28xx_IR *ir = rc->priv; |
337 | 332 | ||
338 | INIT_DELAYED_WORK(&ir->work, em28xx_ir_work); | 333 | INIT_DELAYED_WORK(&ir->work, em28xx_ir_work); |
339 | schedule_delayed_work(&ir->work, 0); | 334 | schedule_delayed_work(&ir->work, 0); |
@@ -341,30 +336,30 @@ static int em28xx_ir_start(void *priv) | |||
341 | return 0; | 336 | return 0; |
342 | } | 337 | } |
343 | 338 | ||
344 | static void em28xx_ir_stop(void *priv) | 339 | static void em28xx_ir_stop(struct rc_dev *rc) |
345 | { | 340 | { |
346 | struct em28xx_IR *ir = priv; | 341 | struct em28xx_IR *ir = rc->priv; |
347 | 342 | ||
348 | cancel_delayed_work_sync(&ir->work); | 343 | cancel_delayed_work_sync(&ir->work); |
349 | } | 344 | } |
350 | 345 | ||
351 | int em28xx_ir_change_protocol(void *priv, u64 ir_type) | 346 | int em28xx_ir_change_protocol(struct rc_dev *rc_dev, u64 rc_type) |
352 | { | 347 | { |
353 | int rc = 0; | 348 | int rc = 0; |
354 | struct em28xx_IR *ir = priv; | 349 | struct em28xx_IR *ir = rc_dev->priv; |
355 | struct em28xx *dev = ir->dev; | 350 | struct em28xx *dev = ir->dev; |
356 | u8 ir_config = EM2874_IR_RC5; | 351 | u8 ir_config = EM2874_IR_RC5; |
357 | 352 | ||
358 | /* Adjust xclk based o IR table for RC5/NEC tables */ | 353 | /* Adjust xclk based o IR table for RC5/NEC tables */ |
359 | 354 | ||
360 | if (ir_type == IR_TYPE_RC5) { | 355 | if (rc_type == RC_TYPE_RC5) { |
361 | dev->board.xclk |= EM28XX_XCLK_IR_RC5_MODE; | 356 | dev->board.xclk |= EM28XX_XCLK_IR_RC5_MODE; |
362 | ir->full_code = 1; | 357 | ir->full_code = 1; |
363 | } else if (ir_type == IR_TYPE_NEC) { | 358 | } else if (rc_type == RC_TYPE_NEC) { |
364 | dev->board.xclk &= ~EM28XX_XCLK_IR_RC5_MODE; | 359 | dev->board.xclk &= ~EM28XX_XCLK_IR_RC5_MODE; |
365 | ir_config = EM2874_IR_NEC; | 360 | ir_config = EM2874_IR_NEC; |
366 | ir->full_code = 1; | 361 | ir->full_code = 1; |
367 | } else if (ir_type != IR_TYPE_UNKNOWN) | 362 | } else if (rc_type != RC_TYPE_UNKNOWN) |
368 | rc = -EINVAL; | 363 | rc = -EINVAL; |
369 | 364 | ||
370 | em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk, | 365 | em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk, |
@@ -391,7 +386,7 @@ int em28xx_ir_change_protocol(void *priv, u64 ir_type) | |||
391 | int em28xx_ir_init(struct em28xx *dev) | 386 | int em28xx_ir_init(struct em28xx *dev) |
392 | { | 387 | { |
393 | struct em28xx_IR *ir; | 388 | struct em28xx_IR *ir; |
394 | struct input_dev *input_dev; | 389 | struct rc_dev *rc; |
395 | int err = -ENOMEM; | 390 | int err = -ENOMEM; |
396 | 391 | ||
397 | if (dev->board.ir_codes == NULL) { | 392 | if (dev->board.ir_codes == NULL) { |
@@ -400,28 +395,27 @@ int em28xx_ir_init(struct em28xx *dev) | |||
400 | } | 395 | } |
401 | 396 | ||
402 | ir = kzalloc(sizeof(*ir), GFP_KERNEL); | 397 | ir = kzalloc(sizeof(*ir), GFP_KERNEL); |
403 | input_dev = input_allocate_device(); | 398 | rc = rc_allocate_device(); |
404 | if (!ir || !input_dev) | 399 | if (!ir || !rc) |
405 | goto err_out_free; | 400 | goto err_out_free; |
406 | 401 | ||
407 | /* record handles to ourself */ | 402 | /* record handles to ourself */ |
408 | ir->dev = dev; | 403 | ir->dev = dev; |
409 | dev->ir = ir; | 404 | dev->ir = ir; |
410 | 405 | ir->rc = rc; | |
411 | ir->input = input_dev; | ||
412 | 406 | ||
413 | /* | 407 | /* |
414 | * em2874 supports more protocols. For now, let's just announce | 408 | * em2874 supports more protocols. For now, let's just announce |
415 | * the two protocols that were already tested | 409 | * the two protocols that were already tested |
416 | */ | 410 | */ |
417 | ir->props.allowed_protos = IR_TYPE_RC5 | IR_TYPE_NEC; | 411 | rc->allowed_protos = RC_TYPE_RC5 | RC_TYPE_NEC; |
418 | ir->props.priv = ir; | 412 | rc->priv = ir; |
419 | ir->props.change_protocol = em28xx_ir_change_protocol; | 413 | rc->change_protocol = em28xx_ir_change_protocol; |
420 | ir->props.open = em28xx_ir_start; | 414 | rc->open = em28xx_ir_start; |
421 | ir->props.close = em28xx_ir_stop; | 415 | rc->close = em28xx_ir_stop; |
422 | 416 | ||
423 | /* By default, keep protocol field untouched */ | 417 | /* By default, keep protocol field untouched */ |
424 | err = em28xx_ir_change_protocol(ir, IR_TYPE_UNKNOWN); | 418 | err = em28xx_ir_change_protocol(rc, RC_TYPE_UNKNOWN); |
425 | if (err) | 419 | if (err) |
426 | goto err_out_free; | 420 | goto err_out_free; |
427 | 421 | ||
@@ -435,27 +429,27 @@ int em28xx_ir_init(struct em28xx *dev) | |||
435 | usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); | 429 | usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); |
436 | strlcat(ir->phys, "/input0", sizeof(ir->phys)); | 430 | strlcat(ir->phys, "/input0", sizeof(ir->phys)); |
437 | 431 | ||
438 | input_dev->name = ir->name; | 432 | rc->input_name = ir->name; |
439 | input_dev->phys = ir->phys; | 433 | rc->input_phys = ir->phys; |
440 | input_dev->id.bustype = BUS_USB; | 434 | rc->input_id.bustype = BUS_USB; |
441 | input_dev->id.version = 1; | 435 | rc->input_id.version = 1; |
442 | input_dev->id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); | 436 | rc->input_id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); |
443 | input_dev->id.product = le16_to_cpu(dev->udev->descriptor.idProduct); | 437 | rc->input_id.product = le16_to_cpu(dev->udev->descriptor.idProduct); |
444 | 438 | rc->dev.parent = &dev->udev->dev; | |
445 | input_dev->dev.parent = &dev->udev->dev; | 439 | rc->map_name = dev->board.ir_codes; |
446 | 440 | rc->driver_name = MODULE_NAME; | |
447 | |||
448 | 441 | ||
449 | /* all done */ | 442 | /* all done */ |
450 | err = ir_input_register(ir->input, dev->board.ir_codes, | 443 | err = rc_register_device(rc); |
451 | &ir->props, MODULE_NAME); | ||
452 | if (err) | 444 | if (err) |
453 | goto err_out_stop; | 445 | goto err_out_stop; |
454 | 446 | ||
455 | return 0; | 447 | return 0; |
448 | |||
456 | err_out_stop: | 449 | err_out_stop: |
457 | dev->ir = NULL; | 450 | dev->ir = NULL; |
458 | err_out_free: | 451 | err_out_free: |
452 | rc_free_device(rc); | ||
459 | kfree(ir); | 453 | kfree(ir); |
460 | return err; | 454 | return err; |
461 | } | 455 | } |
@@ -468,8 +462,8 @@ int em28xx_ir_fini(struct em28xx *dev) | |||
468 | if (!ir) | 462 | if (!ir) |
469 | return 0; | 463 | return 0; |
470 | 464 | ||
471 | em28xx_ir_stop(ir); | 465 | em28xx_ir_stop(ir->rc); |
472 | ir_input_unregister(ir->input); | 466 | rc_unregister_device(ir->rc); |
473 | kfree(ir); | 467 | kfree(ir); |
474 | 468 | ||
475 | /* done */ | 469 | /* done */ |
diff --git a/drivers/media/video/em28xx/em28xx-vbi.c b/drivers/media/video/em28xx/em28xx-vbi.c index 7f1c4a2173b6..2b4c9cba2d67 100644 --- a/drivers/media/video/em28xx/em28xx-vbi.c +++ b/drivers/media/video/em28xx/em28xx-vbi.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/hardirq.h> | ||
26 | #include <linux/init.h> | 27 | #include <linux/init.h> |
27 | 28 | ||
28 | #include "em28xx.h" | 29 | #include "em28xx.h" |
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 2c3007280032..f34d524ccb09 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1434,7 +1434,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, | |||
1434 | 1434 | ||
1435 | /* It isn't an AC97 control. Sends it to the v4l2 dev interface */ | 1435 | /* It isn't an AC97 control. Sends it to the v4l2 dev interface */ |
1436 | if (rc == 1) { | 1436 | if (rc == 1) { |
1437 | v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_ctrl, ctrl); | 1437 | rc = v4l2_device_call_until_err(&dev->v4l2_dev, 0, core, s_ctrl, ctrl); |
1438 | 1438 | ||
1439 | /* | 1439 | /* |
1440 | * In the case of non-AC97 volume controls, we still need | 1440 | * In the case of non-AC97 volume controls, we still need |
@@ -1708,11 +1708,15 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
1708 | fh, type, fh->resources, dev->resources); | 1708 | fh, type, fh->resources, dev->resources); |
1709 | 1709 | ||
1710 | if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { | 1710 | if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { |
1711 | videobuf_streamoff(&fh->vb_vidq); | 1711 | if (res_check(fh, EM28XX_RESOURCE_VIDEO)) { |
1712 | res_free(fh, EM28XX_RESOURCE_VIDEO); | 1712 | videobuf_streamoff(&fh->vb_vidq); |
1713 | res_free(fh, EM28XX_RESOURCE_VIDEO); | ||
1714 | } | ||
1713 | } else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { | 1715 | } else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { |
1714 | videobuf_streamoff(&fh->vb_vbiq); | 1716 | if (res_check(fh, EM28XX_RESOURCE_VBI)) { |
1715 | res_free(fh, EM28XX_RESOURCE_VBI); | 1717 | videobuf_streamoff(&fh->vb_vbiq); |
1718 | res_free(fh, EM28XX_RESOURCE_VBI); | ||
1719 | } | ||
1716 | } | 1720 | } |
1717 | 1721 | ||
1718 | return 0; | 1722 | return 0; |
@@ -1934,19 +1938,6 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) | |||
1934 | O_NONBLOCK); | 1938 | O_NONBLOCK); |
1935 | } | 1939 | } |
1936 | 1940 | ||
1937 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
1938 | static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf) | ||
1939 | { | ||
1940 | struct em28xx_fh *fh = priv; | ||
1941 | |||
1942 | if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) | ||
1943 | return videobuf_cgmbuf(&fh->vb_vidq, mbuf, 8); | ||
1944 | else | ||
1945 | return videobuf_cgmbuf(&fh->vb_vbiq, mbuf, 8); | ||
1946 | } | ||
1947 | #endif | ||
1948 | |||
1949 | |||
1950 | /* ----------------------------------------------------------- */ | 1941 | /* ----------------------------------------------------------- */ |
1951 | /* RADIO ESPECIFIC IOCTLS */ | 1942 | /* RADIO ESPECIFIC IOCTLS */ |
1952 | /* ----------------------------------------------------------- */ | 1943 | /* ----------------------------------------------------------- */ |
@@ -2359,9 +2350,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { | |||
2359 | .vidioc_s_register = vidioc_s_register, | 2350 | .vidioc_s_register = vidioc_s_register, |
2360 | .vidioc_g_chip_ident = vidioc_g_chip_ident, | 2351 | .vidioc_g_chip_ident = vidioc_g_chip_ident, |
2361 | #endif | 2352 | #endif |
2362 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
2363 | .vidiocgmbuf = vidiocgmbuf, | ||
2364 | #endif | ||
2365 | }; | 2353 | }; |
2366 | 2354 | ||
2367 | static const struct video_device em28xx_video_template = { | 2355 | static const struct video_device em28xx_video_template = { |
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 6a75e6a4fc21..6f2795a3d4b7 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <media/videobuf-vmalloc.h> | 33 | #include <media/videobuf-vmalloc.h> |
34 | #include <media/v4l2-device.h> | 34 | #include <media/v4l2-device.h> |
35 | #include <media/ir-kbd-i2c.h> | 35 | #include <media/ir-kbd-i2c.h> |
36 | #include <media/ir-core.h> | 36 | #include <media/rc-core.h> |
37 | #if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE) | 37 | #if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE) |
38 | #include <media/videobuf-dvb.h> | 38 | #include <media/videobuf-dvb.h> |
39 | #endif | 39 | #endif |
@@ -117,6 +117,8 @@ | |||
117 | #define EM2800_BOARD_VC211A 74 | 117 | #define EM2800_BOARD_VC211A 74 |
118 | #define EM2882_BOARD_DIKOM_DK300 75 | 118 | #define EM2882_BOARD_DIKOM_DK300 75 |
119 | #define EM2870_BOARD_KWORLD_A340 76 | 119 | #define EM2870_BOARD_KWORLD_A340 76 |
120 | #define EM2874_LEADERSHIP_ISDBT 77 | ||
121 | |||
120 | 122 | ||
121 | /* Limits minimum and default number of buffers */ | 123 | /* Limits minimum and default number of buffers */ |
122 | #define EM28XX_MIN_BUF 4 | 124 | #define EM28XX_MIN_BUF 4 |