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 | |
| 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>
| -rw-r--r-- | Documentation/video4linux/CARDLIST.bttv | 1 | ||||
| -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 | ||||
| -rw-r--r-- | include/media/ir-common.h | 1 |
6 files changed, 140 insertions, 8 deletions
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv index f32efb6fb12c..60ba66836038 100644 --- a/Documentation/video4linux/CARDLIST.bttv +++ b/Documentation/video4linux/CARDLIST.bttv | |||
| @@ -150,3 +150,4 @@ | |||
| 150 | 149 -> Typhoon TV-Tuner PCI (50684) | 150 | 149 -> Typhoon TV-Tuner PCI (50684) |
| 151 | 150 -> Geovision GV-600 [008a:763c] | 151 | 150 -> Geovision GV-600 [008a:763c] |
| 152 | 151 -> Kozumi KTV-01C | 152 | 151 -> Kozumi KTV-01C |
| 153 | 152 -> Encore ENL TV-FM-2 [1000:1801] | ||
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 | ||
