aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMassimo Del Fedele <max@veneto.com>2009-10-24 12:12:37 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:51 -0500
commit3d36f5c652d9d1b4406b0f8f32d9452eaad8e33a (patch)
tree5872e19d3a8352faeb5ab73b8661211dfc7885a9 /drivers/media
parent0faf6f6b892aeb25934c9adc7fe328350d2d25cc (diff)
V4L/DVB: m920x: Add support for Pinnacle PCTV310e card
Adds support to Pinnacle PCTV310e hybrid tuner card, for DVB-T and remote control, still no analog video. [mchehab@redhat.com: fix CodingStyle issues] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-ids.h1
-rw-r--r--drivers/media/dvb/dvb-usb/m920x.c141
-rw-r--r--drivers/media/dvb/dvb-usb/m920x.h2
3 files changed, 143 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index bc3581d58ced..90cdac7ccd87 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -209,6 +209,7 @@
209#define USB_PID_PINNACLE_PCTV71E 0x022b 209#define USB_PID_PINNACLE_PCTV71E 0x022b
210#define USB_PID_PINNACLE_PCTV72E 0x0236 210#define USB_PID_PINNACLE_PCTV72E 0x0236
211#define USB_PID_PINNACLE_PCTV73E 0x0237 211#define USB_PID_PINNACLE_PCTV73E 0x0237
212#define USB_PID_PINNACLE_PCTV310E 0x3211
212#define USB_PID_PINNACLE_PCTV801E 0x023a 213#define USB_PID_PINNACLE_PCTV801E 0x023a
213#define USB_PID_PINNACLE_PCTV801E_SE 0x023b 214#define USB_PID_PINNACLE_PCTV801E_SE 0x023b
214#define USB_PID_PINNACLE_PCTV73A 0x0243 215#define USB_PID_PINNACLE_PCTV73A 0x0243
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c
index ef9b7bed13ff..737ffa36ac9c 100644
--- a/drivers/media/dvb/dvb-usb/m920x.c
+++ b/drivers/media/dvb/dvb-usb/m920x.c
@@ -16,6 +16,9 @@
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
20#include <media/tuner.h>
21#include "tuner-simple.h"
19#include <asm/unaligned.h> 22#include <asm/unaligned.h>
20 23
21/* debug */ 24/* debug */
@@ -158,11 +161,14 @@ static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
158 161
159 case 0x93: 162 case 0x93:
160 case 0x92: 163 case 0x92:
164 case 0x83: /* pinnacle PCTV310e */
165 case 0x82:
161 m->rep_count = 0; 166 m->rep_count = 0;
162 *state = REMOTE_KEY_PRESSED; 167 *state = REMOTE_KEY_PRESSED;
163 goto unlock; 168 goto unlock;
164 169
165 case 0x91: 170 case 0x91:
171 case 0x81: /* pinnacle PCTV310e */
166 /* prevent immediate auto-repeat */ 172 /* prevent immediate auto-repeat */
167 if (++m->rep_count > 2) 173 if (++m->rep_count > 2)
168 *state = REMOTE_KEY_REPEAT; 174 *state = REMOTE_KEY_REPEAT;
@@ -546,6 +552,14 @@ static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap)
546 return 0; 552 return 0;
547} 553}
548 554
555static int m920x_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
556{
557 dvb_attach(simple_tuner_attach, adap->fe,
558 &adap->dev->i2c_adap, 0x61,
559 TUNER_PHILIPS_FMD1216ME_MK3);
560 return 0;
561}
562
549/* device-specific initialization */ 563/* device-specific initialization */
550static struct m920x_inits megasky_rc_init [] = { 564static struct m920x_inits megasky_rc_init [] = {
551 { M9206_RC_INIT2, 0xa8 }, 565 { M9206_RC_INIT2, 0xa8 },
@@ -562,6 +576,18 @@ static struct m920x_inits tvwalkertwin_rc_init [] = {
562 { } /* terminating entry */ 576 { } /* terminating entry */
563}; 577};
564 578
579static struct m920x_inits pinnacle310e_init[] = {
580 /* without these the tuner don't work */
581 { 0xff20, 0x9b },
582 { 0xff22, 0x70 },
583
584 /* rc settings */
585 { 0xff50, 0x80 },
586 { M9206_RC_INIT1, 0x00 },
587 { M9206_RC_INIT2, 0xff },
588 { } /* terminating entry */
589};
590
565/* ir keymaps */ 591/* ir keymaps */
566static struct dvb_usb_rc_key megasky_rc_keys [] = { 592static struct dvb_usb_rc_key megasky_rc_keys [] = {
567 { 0x0012, KEY_POWER }, 593 { 0x0012, KEY_POWER },
@@ -602,11 +628,68 @@ static struct dvb_usb_rc_key tvwalkertwin_rc_keys [] = {
602 { 0x001e, KEY_VOLUMEUP }, 628 { 0x001e, KEY_VOLUMEUP },
603}; 629};
604 630
631static struct dvb_usb_rc_key pinnacle310e_rc_keys[] = {
632 { 0x16, KEY_POWER },
633 { 0x17, KEY_FAVORITES },
634 { 0x0f, KEY_TEXT },
635 { 0x48, KEY_MEDIA }, /* preview */
636 { 0x1c, KEY_EPG },
637 { 0x04, KEY_LIST }, /* record list */
638 { 0x03, KEY_1 },
639 { 0x01, KEY_2 },
640 { 0x06, KEY_3 },
641 { 0x09, KEY_4 },
642 { 0x1d, KEY_5 },
643 { 0x1f, KEY_6 },
644 { 0x0d, KEY_7 },
645 { 0x19, KEY_8 },
646 { 0x1b, KEY_9 },
647 { 0x15, KEY_0 },
648 { 0x0c, KEY_CANCEL },
649 { 0x4a, KEY_CLEAR },
650 { 0x13, KEY_BACK },
651 { 0x00, KEY_TAB },
652 { 0x4b, KEY_UP },
653 { 0x4e, KEY_LEFT },
654 { 0x52, KEY_RIGHT },
655 { 0x51, KEY_DOWN },
656 { 0x4f, KEY_ENTER }, /* could also be KEY_OK */
657 { 0x1e, KEY_VOLUMEUP },
658 { 0x0a, KEY_VOLUMEDOWN },
659 { 0x05, KEY_CHANNELUP },
660 { 0x02, KEY_CHANNELDOWN },
661 { 0x11, KEY_RECORD },
662 { 0x14, KEY_PLAY },
663 { 0x4c, KEY_PAUSE },
664 { 0x1a, KEY_STOP },
665 { 0x40, KEY_REWIND },
666 { 0x12, KEY_FASTFORWARD },
667 { 0x41, KEY_PREVIOUSSONG }, /* Replay */
668 { 0x42, KEY_NEXTSONG }, /* Skip */
669 { 0x54, KEY_CAMERA }, /* Capture */
670/* { 0x50, KEY_SAP }, */ /* Sap */
671 { 0x47, KEY_CYCLEWINDOWS }, /* Pip */
672 { 0x4d, KEY_SCREEN }, /* FullScreen */
673 { 0x08, KEY_SUBTITLE },
674 { 0x0e, KEY_MUTE },
675/* { 0x49, KEY_LR }, */ /* L/R */
676 { 0x07, KEY_SLEEP }, /* Hibernate */
677 { 0x08, KEY_MEDIA }, /* A/V */
678 { 0x0e, KEY_MENU }, /* Recall */
679 { 0x45, KEY_ZOOMIN },
680 { 0x46, KEY_ZOOMOUT },
681 { 0x18, KEY_TV }, /* Red */
682 { 0x53, KEY_VCR }, /* Green */
683 { 0x5e, KEY_SAT }, /* Yellow */
684 { 0x5f, KEY_PLAYER }, /* Blue */
685};
686
605/* DVB USB Driver stuff */ 687/* DVB USB Driver stuff */
606static struct dvb_usb_device_properties megasky_properties; 688static struct dvb_usb_device_properties megasky_properties;
607static struct dvb_usb_device_properties digivox_mini_ii_properties; 689static struct dvb_usb_device_properties digivox_mini_ii_properties;
608static struct dvb_usb_device_properties tvwalkertwin_properties; 690static struct dvb_usb_device_properties tvwalkertwin_properties;
609static struct dvb_usb_device_properties dposh_properties; 691static struct dvb_usb_device_properties dposh_properties;
692static struct dvb_usb_device_properties pinnacle_pctv310e_properties;
610 693
611static int m920x_probe(struct usb_interface *intf, 694static int m920x_probe(struct usb_interface *intf,
612 const struct usb_device_id *id) 695 const struct usb_device_id *id)
@@ -652,6 +735,13 @@ static int m920x_probe(struct usb_interface *intf,
652 goto found; 735 goto found;
653 } 736 }
654 737
738 ret = dvb_usb_device_init(intf, &pinnacle_pctv310e_properties,
739 THIS_MODULE, &d, adapter_nr);
740 if (ret == 0) {
741 rc_init_seq = pinnacle310e_init;
742 goto found;
743 }
744
655 return ret; 745 return ret;
656 } else { 746 } else {
657 /* Another interface on a multi-tuner device */ 747 /* Another interface on a multi-tuner device */
@@ -682,6 +772,7 @@ static struct usb_device_id m920x_table [] = {
682 USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM) }, 772 USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM) },
683 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) }, 773 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) },
684 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) }, 774 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) },
775 { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_PINNACLE_PCTV310E) },
685 { } /* Terminating entry */ 776 { } /* Terminating entry */
686}; 777};
687MODULE_DEVICE_TABLE (usb, m920x_table); 778MODULE_DEVICE_TABLE (usb, m920x_table);
@@ -895,6 +986,56 @@ static struct dvb_usb_device_properties dposh_properties = {
895 } 986 }
896}; 987};
897 988
989static struct dvb_usb_device_properties pinnacle_pctv310e_properties = {
990 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
991
992 .usb_ctrl = DEVICE_SPECIFIC,
993 .download_firmware = NULL,
994
995 .rc_interval = 100,
996 .rc_key_map = pinnacle310e_rc_keys,
997 .rc_key_map_size = ARRAY_SIZE(pinnacle310e_rc_keys),
998 .rc_query = m920x_rc_query,
999
1000 .size_of_priv = sizeof(struct m920x_state),
1001
1002 .identify_state = m920x_identify_state,
1003 .num_adapters = 1,
1004 .adapter = {{
1005 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
1006 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
1007
1008 .pid_filter_count = 8,
1009 .pid_filter = m920x_pid_filter,
1010 .pid_filter_ctrl = m920x_pid_filter_ctrl,
1011
1012 .frontend_attach = m920x_mt352_frontend_attach,
1013 .tuner_attach = m920x_fmd1216me_tuner_attach,
1014
1015 .stream = {
1016 .type = USB_ISOC,
1017 .count = 5,
1018 .endpoint = 0x84,
1019 .u = {
1020 .isoc = {
1021 .framesperurb = 128,
1022 .framesize = 564,
1023 .interval = 1,
1024 }
1025 }
1026 },
1027 } },
1028 .i2c_algo = &m920x_i2c_algo,
1029
1030 .num_device_descs = 1,
1031 .devices = {
1032 { "Pinnacle PCTV 310e",
1033 { &m920x_table[6], NULL },
1034 { NULL },
1035 }
1036 }
1037};
1038
898static struct usb_driver m920x_driver = { 1039static struct usb_driver m920x_driver = {
899 .name = "dvb_usb_m920x", 1040 .name = "dvb_usb_m920x",
900 .probe = m920x_probe, 1041 .probe = m920x_probe,
diff --git a/drivers/media/dvb/dvb-usb/m920x.h b/drivers/media/dvb/dvb-usb/m920x.h
index 37532890accd..3c061518ffc1 100644
--- a/drivers/media/dvb/dvb-usb/m920x.h
+++ b/drivers/media/dvb/dvb-usb/m920x.h
@@ -18,7 +18,7 @@
18#define M9206_FW 0x30 18#define M9206_FW 0x30
19 19
20#define M9206_MAX_FILTERS 8 20#define M9206_MAX_FILTERS 8
21#define M9206_MAX_ADAPTERS 2 21#define M9206_MAX_ADAPTERS 4
22 22
23/* 23/*
24sequences found in logs: 24sequences found in logs: