diff options
author | Antti Palosaari <crope@iki.fi> | 2014-04-10 21:11:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-04-23 08:51:31 -0400 |
commit | 192292403147877c7d5f737a3cc751ded397aef7 (patch) | |
tree | 1cf3fd02944d0a5a174b27e2293a21b697ac058c | |
parent | 845f35052ea94661dd32d80fc95a93d0502345e2 (diff) |
[media] em28xx: add [2013:025f] PCTV tripleStick (292e)
Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/usb/em28xx/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-cards.c | 25 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-dvb.c | 73 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx.h | 1 |
4 files changed, 101 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/Kconfig b/drivers/media/usb/em28xx/Kconfig index d23a912096f7..f5d7198753c7 100644 --- a/drivers/media/usb/em28xx/Kconfig +++ b/drivers/media/usb/em28xx/Kconfig | |||
@@ -57,6 +57,8 @@ config VIDEO_EM28XX_DVB | |||
57 | select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT | 57 | select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT |
58 | select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT | 58 | select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT |
59 | select DVB_DRX39XYJ if MEDIA_SUBDRV_AUTOSELECT | 59 | select DVB_DRX39XYJ if MEDIA_SUBDRV_AUTOSELECT |
60 | select DVB_SI2168 if MEDIA_SUBDRV_AUTOSELECT | ||
61 | select MEDIA_TUNER_SI2157 if MEDIA_SUBDRV_AUTOSELECT | ||
60 | ---help--- | 62 | ---help--- |
61 | This adds support for DVB cards based on the | 63 | This adds support for DVB cards based on the |
62 | Empiatech em28xx chips. | 64 | Empiatech em28xx chips. |
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 50aa5a5317f2..437f73fbee4a 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c | |||
@@ -467,6 +467,18 @@ static struct em28xx_reg_seq speedlink_vad_laplace_reg_seq[] = { | |||
467 | { -1, -1, -1, -1}, | 467 | { -1, -1, -1, -1}, |
468 | }; | 468 | }; |
469 | 469 | ||
470 | static struct em28xx_reg_seq pctv_292e[] = { | ||
471 | {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0}, | ||
472 | {0x0d, 0xff, 0xff, 950}, | ||
473 | {EM2874_R80_GPIO_P0_CTRL, 0xbd, 0xff, 100}, | ||
474 | {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 410}, | ||
475 | {EM2874_R80_GPIO_P0_CTRL, 0x7d, 0xff, 300}, | ||
476 | {EM2874_R80_GPIO_P0_CTRL, 0x7c, 0xff, 60}, | ||
477 | {0x0d, 0x42, 0xff, 50}, | ||
478 | {EM2874_R5F_TS_ENABLE, 0x85, 0xff, 0}, | ||
479 | {-1, -1, -1, -1}, | ||
480 | }; | ||
481 | |||
470 | /* | 482 | /* |
471 | * Button definitions | 483 | * Button definitions |
472 | */ | 484 | */ |
@@ -2220,6 +2232,17 @@ struct em28xx_board em28xx_boards[] = { | |||
2220 | .has_dvb = 1, | 2232 | .has_dvb = 1, |
2221 | .ir_codes = RC_MAP_PINNACLE_PCTV_HD, | 2233 | .ir_codes = RC_MAP_PINNACLE_PCTV_HD, |
2222 | }, | 2234 | }, |
2235 | /* 2013:025f PCTV tripleStick (292e). | ||
2236 | * Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157 */ | ||
2237 | [EM28178_BOARD_PCTV_292E] = { | ||
2238 | .name = "PCTV tripleStick (292e)", | ||
2239 | .def_i2c_bus = 1, | ||
2240 | .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ, | ||
2241 | .tuner_type = TUNER_ABSENT, | ||
2242 | .tuner_gpio = pctv_292e, | ||
2243 | .has_dvb = 1, | ||
2244 | .ir_codes = RC_MAP_PINNACLE_PCTV_HD, | ||
2245 | }, | ||
2223 | }; | 2246 | }; |
2224 | EXPORT_SYMBOL_GPL(em28xx_boards); | 2247 | EXPORT_SYMBOL_GPL(em28xx_boards); |
2225 | 2248 | ||
@@ -2397,6 +2420,8 @@ struct usb_device_id em28xx_id_table[] = { | |||
2397 | .driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE }, | 2420 | .driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE }, |
2398 | { USB_DEVICE(0x2013, 0x0258), | 2421 | { USB_DEVICE(0x2013, 0x0258), |
2399 | .driver_info = EM28178_BOARD_PCTV_461E }, | 2422 | .driver_info = EM28178_BOARD_PCTV_461E }, |
2423 | { USB_DEVICE(0x2013, 0x025f), | ||
2424 | .driver_info = EM28178_BOARD_PCTV_292E }, | ||
2400 | { }, | 2425 | { }, |
2401 | }; | 2426 | }; |
2402 | MODULE_DEVICE_TABLE(usb, em28xx_id_table); | 2427 | MODULE_DEVICE_TABLE(usb, em28xx_id_table); |
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index f599b18ef7ca..b79e08bb3aad 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c | |||
@@ -55,6 +55,8 @@ | |||
55 | #include "mb86a20s.h" | 55 | #include "mb86a20s.h" |
56 | #include "m88ds3103.h" | 56 | #include "m88ds3103.h" |
57 | #include "m88ts2022.h" | 57 | #include "m88ts2022.h" |
58 | #include "si2168.h" | ||
59 | #include "si2157.h" | ||
58 | 60 | ||
59 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 61 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); |
60 | MODULE_LICENSE("GPL"); | 62 | MODULE_LICENSE("GPL"); |
@@ -93,6 +95,7 @@ struct em28xx_dvb { | |||
93 | struct semaphore pll_mutex; | 95 | struct semaphore pll_mutex; |
94 | bool dont_attach_fe1; | 96 | bool dont_attach_fe1; |
95 | int lna_gpio; | 97 | int lna_gpio; |
98 | struct i2c_client *i2c_client_demod; | ||
96 | struct i2c_client *i2c_client_tuner; | 99 | struct i2c_client *i2c_client_tuner; |
97 | }; | 100 | }; |
98 | 101 | ||
@@ -1496,6 +1499,62 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1496 | dvb->i2c_client_tuner = client; | 1499 | dvb->i2c_client_tuner = client; |
1497 | } | 1500 | } |
1498 | break; | 1501 | break; |
1502 | case EM28178_BOARD_PCTV_292E: | ||
1503 | { | ||
1504 | struct i2c_adapter *adapter; | ||
1505 | struct i2c_client *client; | ||
1506 | struct i2c_board_info info; | ||
1507 | struct si2168_config si2168_config; | ||
1508 | struct si2157_config si2157_config; | ||
1509 | |||
1510 | /* attach demod */ | ||
1511 | si2168_config.i2c_adapter = &adapter; | ||
1512 | si2168_config.fe = &dvb->fe[0]; | ||
1513 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
1514 | strlcpy(info.type, "si2168", I2C_NAME_SIZE); | ||
1515 | info.addr = 0x64; | ||
1516 | info.platform_data = &si2168_config; | ||
1517 | request_module(info.type); | ||
1518 | client = i2c_new_device(&dev->i2c_adap[dev->def_i2c_bus], &info); | ||
1519 | if (client == NULL || client->dev.driver == NULL) { | ||
1520 | result = -ENODEV; | ||
1521 | goto out_free; | ||
1522 | } | ||
1523 | |||
1524 | if (!try_module_get(client->dev.driver->owner)) { | ||
1525 | i2c_unregister_device(client); | ||
1526 | result = -ENODEV; | ||
1527 | goto out_free; | ||
1528 | } | ||
1529 | |||
1530 | dvb->i2c_client_demod = client; | ||
1531 | |||
1532 | /* attach tuner */ | ||
1533 | si2157_config.fe = dvb->fe[0]; | ||
1534 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
1535 | strlcpy(info.type, "si2157", I2C_NAME_SIZE); | ||
1536 | info.addr = 0x60; | ||
1537 | info.platform_data = &si2157_config; | ||
1538 | request_module(info.type); | ||
1539 | client = i2c_new_device(adapter, &info); | ||
1540 | if (client == NULL || client->dev.driver == NULL) { | ||
1541 | module_put(dvb->i2c_client_demod->dev.driver->owner); | ||
1542 | i2c_unregister_device(dvb->i2c_client_demod); | ||
1543 | result = -ENODEV; | ||
1544 | goto out_free; | ||
1545 | } | ||
1546 | |||
1547 | if (!try_module_get(client->dev.driver->owner)) { | ||
1548 | i2c_unregister_device(client); | ||
1549 | module_put(dvb->i2c_client_demod->dev.driver->owner); | ||
1550 | i2c_unregister_device(dvb->i2c_client_demod); | ||
1551 | result = -ENODEV; | ||
1552 | goto out_free; | ||
1553 | } | ||
1554 | |||
1555 | dvb->i2c_client_tuner = client; | ||
1556 | } | ||
1557 | break; | ||
1499 | default: | 1558 | default: |
1500 | em28xx_errdev("/2: The frontend of your DVB/ATSC card" | 1559 | em28xx_errdev("/2: The frontend of your DVB/ATSC card" |
1501 | " isn't supported yet\n"); | 1560 | " isn't supported yet\n"); |
@@ -1582,6 +1641,13 @@ static int em28xx_dvb_fini(struct em28xx *dev) | |||
1582 | i2c_unregister_device(client); | 1641 | i2c_unregister_device(client); |
1583 | } | 1642 | } |
1584 | 1643 | ||
1644 | /* remove I2C demod */ | ||
1645 | client = dvb->i2c_client_demod; | ||
1646 | if (client) { | ||
1647 | module_put(client->dev.driver->owner); | ||
1648 | i2c_unregister_device(client); | ||
1649 | } | ||
1650 | |||
1585 | em28xx_unregister_dvb(dvb); | 1651 | em28xx_unregister_dvb(dvb); |
1586 | kfree(dvb); | 1652 | kfree(dvb); |
1587 | dev->dvb = NULL; | 1653 | dev->dvb = NULL; |
@@ -1647,6 +1713,13 @@ static int em28xx_dvb_resume(struct em28xx *dev) | |||
1647 | i2c_unregister_device(client); | 1713 | i2c_unregister_device(client); |
1648 | } | 1714 | } |
1649 | 1715 | ||
1716 | /* remove I2C demod */ | ||
1717 | client = dvb->i2c_client_demod; | ||
1718 | if (client) { | ||
1719 | module_put(client->dev.driver->owner); | ||
1720 | i2c_unregister_device(client); | ||
1721 | } | ||
1722 | |||
1650 | em28xx_unregister_dvb(dvb); | 1723 | em28xx_unregister_dvb(dvb); |
1651 | kfree(dvb); | 1724 | kfree(dvb); |
1652 | dev->dvb = NULL; | 1725 | dev->dvb = NULL; |
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 2051fc9fb932..231343388d4a 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h | |||
@@ -140,6 +140,7 @@ | |||
140 | #define EM2765_BOARD_SPEEDLINK_VAD_LAPLACE 91 | 140 | #define EM2765_BOARD_SPEEDLINK_VAD_LAPLACE 91 |
141 | #define EM28178_BOARD_PCTV_461E 92 | 141 | #define EM28178_BOARD_PCTV_461E 92 |
142 | #define EM2874_BOARD_KWORLD_UB435Q_V3 93 | 142 | #define EM2874_BOARD_KWORLD_UB435Q_V3 93 |
143 | #define EM28178_BOARD_PCTV_292E 94 | ||
143 | 144 | ||
144 | /* Limits minimum and default number of buffers */ | 145 | /* Limits minimum and default number of buffers */ |
145 | #define EM28XX_MIN_BUF 4 | 146 | #define EM28XX_MIN_BUF 4 |