aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerton Ronaldo Krzesinski <herton@mandriva.com.br>2010-05-08 01:23:37 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-06-01 00:21:52 -0400
commit9e1d9e7bac5c2bafc3c0c51db88c15f3fbcec83f (patch)
tree319a40ec1ff75b4a607f52812b7f9e295c1fae85
parente65f8c4e3eef3a0946f8e8fba1fb6aabde734f50 (diff)
V4L/DVB: saa7134: add support for Avermedia M733A
This change adds support for Avermedia M733A. The original version for linux 2.6.31 was sent to me from Avermedia, original author is unknown. I ported it to current kernels, expanded and fixed key code handling for RM-K6 remote control, and added an additional pci id also supported. [mchehab@redhat.com: make checkpatch.pl happier] Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--Documentation/video4linux/CARDLIST.saa71345
-rw-r--r--drivers/media/IR/keymaps/Makefile1
-rw-r--r--drivers/media/IR/keymaps/rc-avermedia-m733a-rm-k6.c95
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c55
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c7
-rw-r--r--drivers/media/video/saa7134/saa7134.h1
-rw-r--r--include/media/rc-map.h1
7 files changed, 163 insertions, 2 deletions
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index 070f2576707e..1387a69ae3aa 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -176,5 +176,6 @@
176175 -> Leadtek Winfast DTV1000S [107d:6655] 176175 -> Leadtek Winfast DTV1000S [107d:6655]
177176 -> Beholder BeholdTV 505 RDS [0000:5051] 177176 -> Beholder BeholdTV 505 RDS [0000:5051]
178177 -> Hawell HW-404M7 178177 -> Hawell HW-404M7
179179 -> Beholder BeholdTV H7 [5ace:7190] 179178 -> Beholder BeholdTV H7 [5ace:7190]
180180 -> Beholder BeholdTV A7 [5ace:7090] 180179 -> Beholder BeholdTV A7 [5ace:7090]
181180 -> Avermedia M733A [1461:4155,1461:4255]
diff --git a/drivers/media/IR/keymaps/Makefile b/drivers/media/IR/keymaps/Makefile
index ec25258a955f..585f75c3f376 100644
--- a/drivers/media/IR/keymaps/Makefile
+++ b/drivers/media/IR/keymaps/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
7 rc-avermedia-cardbus.o \ 7 rc-avermedia-cardbus.o \
8 rc-avermedia-dvbt.o \ 8 rc-avermedia-dvbt.o \
9 rc-avermedia-m135a-rm-jx.o \ 9 rc-avermedia-m135a-rm-jx.o \
10 rc-avermedia-m733a-rm-k6.o \
10 rc-avertv-303.o \ 11 rc-avertv-303.o \
11 rc-behold.o \ 12 rc-behold.o \
12 rc-behold-columbus.o \ 13 rc-behold-columbus.o \
diff --git a/drivers/media/IR/keymaps/rc-avermedia-m733a-rm-k6.c b/drivers/media/IR/keymaps/rc-avermedia-m733a-rm-k6.c
new file mode 100644
index 000000000000..cf8d45717cb3
--- /dev/null
+++ b/drivers/media/IR/keymaps/rc-avermedia-m733a-rm-k6.c
@@ -0,0 +1,95 @@
1/* avermedia-m733a-rm-k6.h - Keytable for avermedia_m733a_rm_k6 Remote Controller
2 *
3 * Copyright (c) 2010 by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#include <media/rc-map.h>
12
13/*
14 * Avermedia M733A with IR model RM-K6
15 * This is the stock remote controller used with Positivo machines with M733A
16 * Herton Ronaldo Krzesinski <herton@mandriva.com.br>
17 */
18
19static struct ir_scancode avermedia_m733a_rm_k6[] = {
20 { 0x0401, KEY_POWER2 },
21 { 0x0406, KEY_MUTE },
22 { 0x0408, KEY_MODE }, /* TV/FM */
23
24 { 0x0409, KEY_1 },
25 { 0x040a, KEY_2 },
26 { 0x040b, KEY_3 },
27 { 0x040c, KEY_4 },
28 { 0x040d, KEY_5 },
29 { 0x040e, KEY_6 },
30 { 0x040f, KEY_7 },
31 { 0x0410, KEY_8 },
32 { 0x0411, KEY_9 },
33 { 0x044c, KEY_DOT }, /* '.' */
34 { 0x0412, KEY_0 },
35 { 0x0407, KEY_REFRESH }, /* Refresh/Reload */
36
37 { 0x0413, KEY_AUDIO },
38 { 0x0440, KEY_SCREEN }, /* Full Screen toggle */
39 { 0x0441, KEY_HOME },
40 { 0x0442, KEY_BACK },
41 { 0x0447, KEY_UP },
42 { 0x0448, KEY_DOWN },
43 { 0x0449, KEY_LEFT },
44 { 0x044a, KEY_RIGHT },
45 { 0x044b, KEY_OK },
46 { 0x0404, KEY_VOLUMEUP },
47 { 0x0405, KEY_VOLUMEDOWN },
48 { 0x0402, KEY_CHANNELUP },
49 { 0x0403, KEY_CHANNELDOWN },
50
51 { 0x0443, KEY_RED },
52 { 0x0444, KEY_GREEN },
53 { 0x0445, KEY_YELLOW },
54 { 0x0446, KEY_BLUE },
55
56 { 0x0414, KEY_TEXT },
57 { 0x0415, KEY_EPG },
58 { 0x041a, KEY_TV2 }, /* PIP */
59 { 0x041b, KEY_MHP }, /* Snapshot */
60
61 { 0x0417, KEY_RECORD },
62 { 0x0416, KEY_PLAYPAUSE },
63 { 0x0418, KEY_STOP },
64 { 0x0419, KEY_PAUSE },
65
66 { 0x041f, KEY_PREVIOUS },
67 { 0x041c, KEY_REWIND },
68 { 0x041d, KEY_FORWARD },
69 { 0x041e, KEY_NEXT },
70};
71
72static struct rc_keymap avermedia_m733a_rm_k6_map = {
73 .map = {
74 .scan = avermedia_m733a_rm_k6,
75 .size = ARRAY_SIZE(avermedia_m733a_rm_k6),
76 .ir_type = IR_TYPE_NEC,
77 .name = RC_MAP_AVERMEDIA_M733A_RM_K6,
78 }
79};
80
81static int __init init_rc_map_avermedia_m733a_rm_k6(void)
82{
83 return ir_register_map(&avermedia_m733a_rm_k6_map);
84}
85
86static void __exit exit_rc_map_avermedia_m733a_rm_k6(void)
87{
88 ir_unregister_map(&avermedia_m733a_rm_k6_map);
89}
90
91module_init(init_rc_map_avermedia_m733a_rm_k6)
92module_exit(exit_rc_map_avermedia_m733a_rm_k6)
93
94MODULE_LICENSE("GPL");
95MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 72700d4e3941..07f6bb8ef9d9 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -3897,6 +3897,40 @@ struct saa7134_board saa7134_boards[] = {
3897 .gpio = 0x01, 3897 .gpio = 0x01,
3898 }, 3898 },
3899 }, 3899 },
3900 [SAA7134_BOARD_AVERMEDIA_M733A] = {
3901 .name = "Avermedia PCI M733A",
3902 .audio_clock = 0x00187de7,
3903 .tuner_type = TUNER_PHILIPS_TDA8290,
3904 .radio_type = UNSET,
3905 .tuner_addr = ADDR_UNSET,
3906 .radio_addr = ADDR_UNSET,
3907 .tuner_config = 0,
3908 .gpiomask = 0x020200000,
3909 .inputs = {{
3910 .name = name_tv,
3911 .vmux = 1,
3912 .amux = TV,
3913 .tv = 1,
3914 }, {
3915 .name = name_comp1,
3916 .vmux = 3,
3917 .amux = LINE1,
3918 }, {
3919 .name = name_svideo,
3920 .vmux = 8,
3921 .amux = LINE1,
3922 } },
3923 .radio = {
3924 .name = name_radio,
3925 .amux = TV,
3926 .gpio = 0x00200000,
3927 },
3928 .mute = {
3929 .name = name_mute,
3930 .amux = TV,
3931 .gpio = 0x01,
3932 },
3933 },
3900 [SAA7134_BOARD_BEHOLD_401] = { 3934 [SAA7134_BOARD_BEHOLD_401] = {
3901 /* Beholder Intl. Ltd. 2008 */ 3935 /* Beholder Intl. Ltd. 2008 */
3902 /*Dmitry Belimov <d.belimov@gmail.com> */ 3936 /*Dmitry Belimov <d.belimov@gmail.com> */
@@ -5822,6 +5856,18 @@ struct pci_device_id saa7134_pci_tbl[] = {
5822 .driver_data = SAA7134_BOARD_AVERMEDIA_M135A, 5856 .driver_data = SAA7134_BOARD_AVERMEDIA_M135A,
5823 }, { 5857 }, {
5824 .vendor = PCI_VENDOR_ID_PHILIPS, 5858 .vendor = PCI_VENDOR_ID_PHILIPS,
5859 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
5860 .subvendor = 0x1461, /* Avermedia Technologies Inc */
5861 .subdevice = 0x4155,
5862 .driver_data = SAA7134_BOARD_AVERMEDIA_M733A,
5863 }, {
5864 .vendor = PCI_VENDOR_ID_PHILIPS,
5865 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
5866 .subvendor = 0x1461, /* Avermedia Technologies Inc */
5867 .subdevice = 0x4255,
5868 .driver_data = SAA7134_BOARD_AVERMEDIA_M733A,
5869 }, {
5870 .vendor = PCI_VENDOR_ID_PHILIPS,
5825 .device = PCI_DEVICE_ID_PHILIPS_SAA7130, 5871 .device = PCI_DEVICE_ID_PHILIPS_SAA7130,
5826 .subvendor = PCI_VENDOR_ID_PHILIPS, 5872 .subvendor = PCI_VENDOR_ID_PHILIPS,
5827 .subdevice = 0x2004, 5873 .subdevice = 0x2004,
@@ -6786,6 +6832,7 @@ static int saa7134_tda8290_callback(struct saa7134_dev *dev,
6786 switch (dev->board) { 6832 switch (dev->board) {
6787 case SAA7134_BOARD_HAUPPAUGE_HVR1150: 6833 case SAA7134_BOARD_HAUPPAUGE_HVR1150:
6788 case SAA7134_BOARD_HAUPPAUGE_HVR1120: 6834 case SAA7134_BOARD_HAUPPAUGE_HVR1120:
6835 case SAA7134_BOARD_AVERMEDIA_M733A:
6789 /* tda8290 + tda18271 */ 6836 /* tda8290 + tda18271 */
6790 ret = saa7134_tda8290_18271_callback(dev, command, arg); 6837 ret = saa7134_tda8290_18271_callback(dev, command, arg);
6791 break; 6838 break;
@@ -7087,6 +7134,14 @@ int saa7134_board_init1(struct saa7134_dev *dev)
7087 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x0000C000, 0x0000C000); 7134 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x0000C000, 0x0000C000);
7088 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0000C000, 0x0000C000); 7135 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0000C000, 0x0000C000);
7089 break; 7136 break;
7137 case SAA7134_BOARD_AVERMEDIA_M733A:
7138 saa7134_set_gpio(dev, 1, 1);
7139 msleep(10);
7140 saa7134_set_gpio(dev, 1, 0);
7141 msleep(10);
7142 saa7134_set_gpio(dev, 1, 1);
7143 dev->has_remote = SAA7134_REMOTE_GPIO;
7144 break;
7090 } 7145 }
7091 return 0; 7146 return 0;
7092} 7147}
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index e5565e2fd426..f9ed8048894d 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -663,6 +663,13 @@ int saa7134_input_init1(struct saa7134_dev *dev)
663 mask_keycode = 0xffff; 663 mask_keycode = 0xffff;
664 raw_decode = 1; 664 raw_decode = 1;
665 break; 665 break;
666 case SAA7134_BOARD_AVERMEDIA_M733A:
667 ir_codes = RC_MAP_AVERMEDIA_M733A_RM_K6;
668 mask_keydown = 0x0040000;
669 mask_keyup = 0x0040000;
670 mask_keycode = 0xffff;
671 raw_decode = 1;
672 break;
666 case SAA7134_BOARD_AVERMEDIA_777: 673 case SAA7134_BOARD_AVERMEDIA_777:
667 case SAA7134_BOARD_AVERMEDIA_A16AR: 674 case SAA7134_BOARD_AVERMEDIA_A16AR:
668 ir_codes = RC_MAP_AVERMEDIA; 675 ir_codes = RC_MAP_AVERMEDIA;
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 3962534267be..756a1ca8833d 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -303,6 +303,7 @@ struct saa7134_format {
303#define SAA7134_BOARD_HAWELL_HW_404M7 177 303#define SAA7134_BOARD_HAWELL_HW_404M7 177
304#define SAA7134_BOARD_BEHOLD_H7 178 304#define SAA7134_BOARD_BEHOLD_H7 178
305#define SAA7134_BOARD_BEHOLD_A7 179 305#define SAA7134_BOARD_BEHOLD_A7 179
306#define SAA7134_BOARD_AVERMEDIA_M733A 180
306 307
307#define SAA7134_MAXBOARDS 32 308#define SAA7134_MAXBOARDS 32
308#define SAA7134_INPUT_MAX 8 309#define SAA7134_INPUT_MAX 8
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 5833966a7100..6f1f9f76674e 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -56,6 +56,7 @@ void rc_map_init(void);
56#define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus" 56#define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus"
57#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" 57#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt"
58#define RC_MAP_AVERMEDIA_M135A_RM_JX "rc-avermedia-m135a-rm-jx" 58#define RC_MAP_AVERMEDIA_M135A_RM_JX "rc-avermedia-m135a-rm-jx"
59#define RC_MAP_AVERMEDIA_M733A_RM_K6 "rc-avermedia-m733a-rm-k6"
59#define RC_MAP_AVERMEDIA "rc-avermedia" 60#define RC_MAP_AVERMEDIA "rc-avermedia"
60#define RC_MAP_AVERTV_303 "rc-avertv-303" 61#define RC_MAP_AVERTV_303 "rc-avertv-303"
61#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus" 62#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus"