diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-08-05 09:14:13 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:47 -0400 |
commit | 7d341a6a52f115512d60b2de89b2ebde54da8eff (patch) | |
tree | 27cb6a10688e0d11cc379f1c7178b6384a9c6b05 /drivers | |
parent | 08b1438cc2d50f559cc33ca4d9251636cec11647 (diff) |
V4L/DVB (8628): bttv: Add support for Encore ENLTV2-FM
Thanks to Sistema Fenix (http://www.sistemafenix.com.br/) and CDI Brasil
(www.cdibrasil.com.br/) for sponsoring this development.
Signed-off-by: Gilberto <gilberto@sistemafenix.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/common/ir-keymaps.c | 55 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-cards.c | 27 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-input.c | 62 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv.h | 2 |
4 files changed, 138 insertions, 8 deletions
diff --git a/drivers/media/common/ir-keymaps.c b/drivers/media/common/ir-keymaps.c index 8fa91f846d59..aedfabd57388 100644 --- a/drivers/media/common/ir-keymaps.c +++ b/drivers/media/common/ir-keymaps.c | |||
@@ -1792,12 +1792,61 @@ IR_KEYTAB_TYPE ir_codes_encore_enltv[IR_KEYTAB_SIZE] = { | |||
1792 | [ 0x41 ] = KEY_GREEN, /* AP2 */ | 1792 | [ 0x41 ] = KEY_GREEN, /* AP2 */ |
1793 | [ 0x47 ] = KEY_YELLOW, /* AP3 */ | 1793 | [ 0x47 ] = KEY_YELLOW, /* AP3 */ |
1794 | [ 0x57 ] = KEY_BLUE, /* AP4 */ | 1794 | [ 0x57 ] = KEY_BLUE, /* AP4 */ |
1795 | |||
1796 | |||
1797 | }; | 1795 | }; |
1798 | |||
1799 | EXPORT_SYMBOL_GPL(ir_codes_encore_enltv); | 1796 | EXPORT_SYMBOL_GPL(ir_codes_encore_enltv); |
1800 | 1797 | ||
1798 | /* Encore ENLTV2-FM - silver plastic - "Wand Media" written at the botton | ||
1799 | Mauro Carvalho Chehab <mchehab@infradead.org> */ | ||
1800 | IR_KEYTAB_TYPE ir_codes_encore_enltv2[IR_KEYTAB_SIZE] = { | ||
1801 | [0x4c] = KEY_POWER2, | ||
1802 | [0x4a] = KEY_TUNER, | ||
1803 | [0x40] = KEY_1, | ||
1804 | [0x60] = KEY_2, | ||
1805 | [0x50] = KEY_3, | ||
1806 | [0x70] = KEY_4, | ||
1807 | [0x48] = KEY_5, | ||
1808 | [0x68] = KEY_6, | ||
1809 | [0x58] = KEY_7, | ||
1810 | [0x78] = KEY_8, | ||
1811 | [0x44] = KEY_9, | ||
1812 | [0x54] = KEY_0, | ||
1813 | |||
1814 | [0x64] = KEY_LAST, /* +100 */ | ||
1815 | [0x4e] = KEY_AGAIN, /* Recall */ | ||
1816 | |||
1817 | [0x6c] = KEY_SWITCHVIDEOMODE, /* Video Source */ | ||
1818 | [0x5e] = KEY_MENU, | ||
1819 | [0x56] = KEY_SCREEN, | ||
1820 | [0x7a] = KEY_SETUP, | ||
1821 | |||
1822 | [0x46] = KEY_MUTE, | ||
1823 | [0x5c] = KEY_MODE, /* Stereo */ | ||
1824 | [0x74] = KEY_INFO, | ||
1825 | [0x7c] = KEY_CLEAR, | ||
1826 | |||
1827 | [0x55] = KEY_UP, | ||
1828 | [0x49] = KEY_DOWN, | ||
1829 | [0x7e] = KEY_LEFT, | ||
1830 | [0x59] = KEY_RIGHT, | ||
1831 | [0x6a] = KEY_ENTER, | ||
1832 | |||
1833 | [0x42] = KEY_VOLUMEUP, | ||
1834 | [0x62] = KEY_VOLUMEDOWN, | ||
1835 | [0x52] = KEY_CHANNELUP, | ||
1836 | [0x72] = KEY_CHANNELDOWN, | ||
1837 | |||
1838 | [0x41] = KEY_RECORD, | ||
1839 | [0x51] = KEY_SHUFFLE, /* Snapshot */ | ||
1840 | [0x75] = KEY_TIME, /* Timeshift */ | ||
1841 | [0x71] = KEY_TV2, /* PIP */ | ||
1842 | |||
1843 | [0x45] = KEY_REWIND, | ||
1844 | [0x6f] = KEY_PAUSE, | ||
1845 | [0x7d] = KEY_FORWARD, | ||
1846 | [0x79] = KEY_STOP, | ||
1847 | }; | ||
1848 | EXPORT_SYMBOL_GPL(ir_codes_encore_enltv2); | ||
1849 | |||
1801 | /* for the Technotrend 1500 bundled remotes (grey and black): */ | 1850 | /* for the Technotrend 1500 bundled remotes (grey and black): */ |
1802 | IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE] = { | 1851 | IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE] = { |
1803 | [ 0x01 ] = KEY_POWER, | 1852 | [ 0x01 ] = KEY_POWER, |
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index 6081edc362df..13742b0bbe3e 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c | |||
@@ -305,7 +305,7 @@ static struct CARD { | |||
305 | { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "}, | 305 | { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "}, |
306 | { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" }, | 306 | { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" }, |
307 | { 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" }, | 307 | { 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" }, |
308 | 308 | { 0x18011000, BTTV_BOARD_ENLTV_FM_2, "Encore ENL TV-FM-2" }, | |
309 | { 0, -1, NULL } | 309 | { 0, -1, NULL } |
310 | }; | 310 | }; |
311 | 311 | ||
@@ -3037,6 +3037,31 @@ struct tvcard bttv_tvcards[] = { | |||
3037 | .has_radio = 1, | 3037 | .has_radio = 1, |
3038 | .has_remote = 1, | 3038 | .has_remote = 1, |
3039 | }, | 3039 | }, |
3040 | [BTTV_BOARD_ENLTV_FM_2] = { | ||
3041 | /* Encore TV Tuner Pro ENL TV-FM-2 | ||
3042 | Mauro Carvalho Chehab <mchehab@infradead.org */ | ||
3043 | .name = "Encore ENL TV-FM-2", | ||
3044 | .video_inputs = 3, | ||
3045 | .audio_inputs = 1, | ||
3046 | .tuner = 0, | ||
3047 | .svhs = 2, | ||
3048 | /* bit 6 -> IR disabled | ||
3049 | bit 18/17 = 00 -> mute | ||
3050 | 01 -> enable external audio input | ||
3051 | 10 -> internal audio input (mono?) | ||
3052 | 11 -> internal audio input | ||
3053 | */ | ||
3054 | .gpiomask = 0x060040, | ||
3055 | .muxsel = { 2, 3, 3 }, | ||
3056 | .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 }, | ||
3057 | .gpiomute = 0, | ||
3058 | .tuner_type = TUNER_TCL_MF02GIP_5N, | ||
3059 | .tuner_addr = ADDR_UNSET, | ||
3060 | .radio_addr = ADDR_UNSET, | ||
3061 | .pll = PLL_28, | ||
3062 | .has_radio = 1, | ||
3063 | .has_remote = 1, | ||
3064 | } | ||
3040 | }; | 3065 | }; |
3041 | 3066 | ||
3042 | static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards); | 3067 | static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards); |
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c index a38af98f4cae..2f289d981fe6 100644 --- a/drivers/media/video/bt8xx/bttv-input.c +++ b/drivers/media/video/bt8xx/bttv-input.c | |||
@@ -28,8 +28,8 @@ | |||
28 | #include "bttvp.h" | 28 | #include "bttvp.h" |
29 | 29 | ||
30 | 30 | ||
31 | static int debug; | 31 | static int ir_debug; |
32 | module_param(debug, int, 0644); /* debug level (0,1,2) */ | 32 | module_param(ir_debug, int, 0644); |
33 | static int repeat_delay = 500; | 33 | static int repeat_delay = 500; |
34 | module_param(repeat_delay, int, 0644); | 34 | module_param(repeat_delay, int, 0644); |
35 | static int repeat_period = 33; | 35 | static int repeat_period = 33; |
@@ -40,6 +40,12 @@ module_param(ir_rc5_remote_gap, int, 0644); | |||
40 | static int ir_rc5_key_timeout = 200; | 40 | static int ir_rc5_key_timeout = 200; |
41 | module_param(ir_rc5_key_timeout, int, 0644); | 41 | module_param(ir_rc5_key_timeout, int, 0644); |
42 | 42 | ||
43 | #undef dprintk | ||
44 | #define dprintk(arg...) do { \ | ||
45 | if (ir_debug >= 1) \ | ||
46 | printk(arg); \ | ||
47 | } while (0) | ||
48 | |||
43 | #define DEVNAME "bttv-input" | 49 | #define DEVNAME "bttv-input" |
44 | 50 | ||
45 | /* ---------------------------------------------------------------------- */ | 51 | /* ---------------------------------------------------------------------- */ |
@@ -79,6 +85,45 @@ static void ir_handle_key(struct bttv *btv) | |||
79 | 85 | ||
80 | } | 86 | } |
81 | 87 | ||
88 | static void ir_enltv_handle_key(struct bttv *btv) | ||
89 | { | ||
90 | struct card_ir *ir = btv->remote; | ||
91 | u32 gpio, data, keyup; | ||
92 | |||
93 | /* read gpio value */ | ||
94 | gpio = bttv_gpio_read(&btv->c); | ||
95 | |||
96 | /* extract data */ | ||
97 | data = ir_extract_bits(gpio, ir->mask_keycode); | ||
98 | |||
99 | /* Check if it is keyup */ | ||
100 | keyup = (gpio & ir->mask_keyup) ? 1 << 31 : 0; | ||
101 | |||
102 | if ((ir->last_gpio & 0x7f) != data) { | ||
103 | dprintk(KERN_INFO DEVNAME ": gpio=0x%x code=%d | %s\n", | ||
104 | gpio, data, | ||
105 | (gpio & ir->mask_keyup) ? " up" : "up/down"); | ||
106 | |||
107 | ir_input_keydown(ir->dev, &ir->ir, data, data); | ||
108 | if (keyup) | ||
109 | ir_input_nokey(ir->dev, &ir->ir); | ||
110 | } else { | ||
111 | if ((ir->last_gpio & 1 << 31) == keyup) | ||
112 | return; | ||
113 | |||
114 | dprintk(KERN_INFO DEVNAME ":(cnt) gpio=0x%x code=%d | %s\n", | ||
115 | gpio, data, | ||
116 | (gpio & ir->mask_keyup) ? " up" : "down"); | ||
117 | |||
118 | if (keyup) | ||
119 | ir_input_nokey(ir->dev, &ir->ir); | ||
120 | else | ||
121 | ir_input_keydown(ir->dev, &ir->ir, data, data); | ||
122 | } | ||
123 | |||
124 | ir->last_gpio = data | keyup; | ||
125 | } | ||
126 | |||
82 | void bttv_input_irq(struct bttv *btv) | 127 | void bttv_input_irq(struct bttv *btv) |
83 | { | 128 | { |
84 | struct card_ir *ir = btv->remote; | 129 | struct card_ir *ir = btv->remote; |
@@ -92,7 +137,10 @@ static void bttv_input_timer(unsigned long data) | |||
92 | struct bttv *btv = (struct bttv*)data; | 137 | struct bttv *btv = (struct bttv*)data; |
93 | struct card_ir *ir = btv->remote; | 138 | struct card_ir *ir = btv->remote; |
94 | 139 | ||
95 | ir_handle_key(btv); | 140 | if (btv->c.type == BTTV_BOARD_ENLTV_FM_2) |
141 | ir_enltv_handle_key(btv); | ||
142 | else | ||
143 | ir_handle_key(btv); | ||
96 | mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling)); | 144 | mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling)); |
97 | } | 145 | } |
98 | 146 | ||
@@ -284,6 +332,14 @@ int bttv_input_init(struct bttv *btv) | |||
284 | ir->mask_keyup = 0x006000; | 332 | ir->mask_keyup = 0x006000; |
285 | ir->polling = 50; /* ms */ | 333 | ir->polling = 50; /* ms */ |
286 | break; | 334 | break; |
335 | case BTTV_BOARD_ENLTV_FM_2: | ||
336 | ir_codes = ir_codes_encore_enltv2; | ||
337 | ir->mask_keycode = 0x00fd00; | ||
338 | ir->mask_keyup = 0x000080; | ||
339 | ir->polling = 1; /* ms */ | ||
340 | ir->last_gpio = ir_extract_bits(bttv_gpio_read(&btv->c), | ||
341 | ir->mask_keycode); | ||
342 | break; | ||
287 | } | 343 | } |
288 | if (NULL == ir_codes) { | 344 | if (NULL == ir_codes) { |
289 | dprintk(KERN_INFO "Ooops: IR config error [card=%d]\n", btv->c.type); | 345 | dprintk(KERN_INFO "Ooops: IR config error [card=%d]\n", btv->c.type); |
diff --git a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h index 6d93d16c96e4..46cb90e0985b 100644 --- a/drivers/media/video/bt8xx/bttv.h +++ b/drivers/media/video/bt8xx/bttv.h | |||
@@ -176,7 +176,7 @@ | |||
176 | #define BTTV_BOARD_TYPHOON_TVTUNERPCI 0x95 | 176 | #define BTTV_BOARD_TYPHOON_TVTUNERPCI 0x95 |
177 | #define BTTV_BOARD_GEOVISION_GV600 0x96 | 177 | #define BTTV_BOARD_GEOVISION_GV600 0x96 |
178 | #define BTTV_BOARD_KOZUMI_KTV_01C 0x97 | 178 | #define BTTV_BOARD_KOZUMI_KTV_01C 0x97 |
179 | 179 | #define BTTV_BOARD_ENLTV_FM_2 0x98 | |
180 | 180 | ||
181 | /* more card-specific defines */ | 181 | /* more card-specific defines */ |
182 | #define PT2254_L_CHANNEL 0x10 | 182 | #define PT2254_L_CHANNEL 0x10 |