diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-30 12:39:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-30 12:39:15 -0400 |
commit | 5ffd1a6aaacc25be8cd0770a51ec6d46add3a276 (patch) | |
tree | 5b076c44f8b7ff88dba9a554d7748c6f083c9071 /drivers/media/dvb/dvb-usb/digitv.c | |
parent | 0cd43f83d381c4246a08cd775834833d6fd64805 (diff) | |
parent | 8dd86eebc5315910ebfd9f30f1674254308be4b3 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (180 commits)
V4L/DVB (4641): Trivial: use lowercase letters in hex subsystem ids
V4L/DVB (4639): Cx88: add autodetection for alternate revision of Leadtek PVR
V4L/DVB (4638): Basic DVB-T and analog TV support for the HVR1300.
V4L/DVB (4637): Add a default method for VIDIOC_G_PARM
V4L/DVB (4635): Extend bttv and saa7134 to check for both AGP and PCI PCI failure case
V4L/DVB (4634): Zr36120: implement pcipci checks
V4L/DVB (4632): Zoran: Implement pcipci failure check
V4L/DVB (4631): Av7110: remove V4L2_CAP_VBI_CAPTURE flag
V4L/DVB (4630): Av7110: FW_LOADER depemdency fixed
V4L/DVB (4629): Saa7134: add card support for Proteus Pro 2309
V4L/DVB (4628): Fix VIDIOC_ENUMSTD ioctl in videodev.c
V4L/DVB (4627): Vivi crashes with mplayer
V4L/DVB (4626): On saa7111/7113, LUMA_CTRL need a different value
V4L/DVB (4624): Tvaudio: Replaced kernel_thread() with kthread_run()
V4L/DVB (4622): Copy-paste bug in videodev.c
V4L/DVB (4620): Fix AGC configuration for MOD3000P-based boards
V4L/DVB (4619): Fixes some I2C dependencies on V4L devices
V4L/DVB (4617): Problem with dibusb-mb.c USB IDs
V4L/DVB (4616): [PATCH] Nebula DigiTV USB RC support
V4L/DVB (4614): Export symbol saa7134_tvaudio_setmute from saa7134 for saa7134-alsa
...
Diffstat (limited to 'drivers/media/dvb/dvb-usb/digitv.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/digitv.c | 86 |
1 files changed, 78 insertions, 8 deletions
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index c14d9efb48fd..015854487308 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -128,11 +128,11 @@ static struct nxt6000_config digitv_nxt6000_config = { | |||
128 | 128 | ||
129 | static int digitv_frontend_attach(struct dvb_usb_device *d) | 129 | static int digitv_frontend_attach(struct dvb_usb_device *d) |
130 | { | 130 | { |
131 | if ((d->fe = mt352_attach(&digitv_mt352_config, &d->i2c_adap)) != NULL) { | 131 | if ((d->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &d->i2c_adap)) != NULL) { |
132 | d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; | 132 | d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; |
133 | return 0; | 133 | return 0; |
134 | } | 134 | } |
135 | if ((d->fe = nxt6000_attach(&digitv_nxt6000_config, &d->i2c_adap)) != NULL) { | 135 | if ((d->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &d->i2c_adap)) != NULL) { |
136 | d->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; | 136 | d->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; |
137 | return 0; | 137 | return 0; |
138 | } | 138 | } |
@@ -147,21 +147,91 @@ static int digitv_tuner_attach(struct dvb_usb_device *d) | |||
147 | } | 147 | } |
148 | 148 | ||
149 | static struct dvb_usb_rc_key digitv_rc_keys[] = { | 149 | static struct dvb_usb_rc_key digitv_rc_keys[] = { |
150 | { 0x00, 0x16, KEY_POWER }, /* dummy key */ | 150 | { 0x5f, 0x55, KEY_0 }, |
151 | { 0x6f, 0x55, KEY_1 }, | ||
152 | { 0x9f, 0x55, KEY_2 }, | ||
153 | { 0xaf, 0x55, KEY_3 }, | ||
154 | { 0x5f, 0x56, KEY_4 }, | ||
155 | { 0x6f, 0x56, KEY_5 }, | ||
156 | { 0x9f, 0x56, KEY_6 }, | ||
157 | { 0xaf, 0x56, KEY_7 }, | ||
158 | { 0x5f, 0x59, KEY_8 }, | ||
159 | { 0x6f, 0x59, KEY_9 }, | ||
160 | { 0x9f, 0x59, KEY_TV }, | ||
161 | { 0xaf, 0x59, KEY_AUX }, | ||
162 | { 0x5f, 0x5a, KEY_DVD }, | ||
163 | { 0x6f, 0x5a, KEY_POWER }, | ||
164 | { 0x9f, 0x5a, KEY_MHP }, /* labelled 'Picture' */ | ||
165 | { 0xaf, 0x5a, KEY_AUDIO }, | ||
166 | { 0x5f, 0x65, KEY_INFO }, | ||
167 | { 0x6f, 0x65, KEY_F13 }, /* 16:9 */ | ||
168 | { 0x9f, 0x65, KEY_F14 }, /* 14:9 */ | ||
169 | { 0xaf, 0x65, KEY_EPG }, | ||
170 | { 0x5f, 0x66, KEY_EXIT }, | ||
171 | { 0x6f, 0x66, KEY_MENU }, | ||
172 | { 0x9f, 0x66, KEY_UP }, | ||
173 | { 0xaf, 0x66, KEY_DOWN }, | ||
174 | { 0x5f, 0x69, KEY_LEFT }, | ||
175 | { 0x6f, 0x69, KEY_RIGHT }, | ||
176 | { 0x9f, 0x69, KEY_ENTER }, | ||
177 | { 0xaf, 0x69, KEY_CHANNELUP }, | ||
178 | { 0x5f, 0x6a, KEY_CHANNELDOWN }, | ||
179 | { 0x6f, 0x6a, KEY_VOLUMEUP }, | ||
180 | { 0x9f, 0x6a, KEY_VOLUMEDOWN }, | ||
181 | { 0xaf, 0x6a, KEY_RED }, | ||
182 | { 0x5f, 0x95, KEY_GREEN }, | ||
183 | { 0x6f, 0x95, KEY_YELLOW }, | ||
184 | { 0x9f, 0x95, KEY_BLUE }, | ||
185 | { 0xaf, 0x95, KEY_SUBTITLE }, | ||
186 | { 0x5f, 0x96, KEY_F15 }, /* AD */ | ||
187 | { 0x6f, 0x96, KEY_TEXT }, | ||
188 | { 0x9f, 0x96, KEY_MUTE }, | ||
189 | { 0xaf, 0x96, KEY_REWIND }, | ||
190 | { 0x5f, 0x99, KEY_STOP }, | ||
191 | { 0x6f, 0x99, KEY_PLAY }, | ||
192 | { 0x9f, 0x99, KEY_FASTFORWARD }, | ||
193 | { 0xaf, 0x99, KEY_F16 }, /* chapter */ | ||
194 | { 0x5f, 0x9a, KEY_PAUSE }, | ||
195 | { 0x6f, 0x9a, KEY_PLAY }, | ||
196 | { 0x9f, 0x9a, KEY_RECORD }, | ||
197 | { 0xaf, 0x9a, KEY_F17 }, /* picture in picture */ | ||
198 | { 0x5f, 0xa5, KEY_KPPLUS }, /* zoom in */ | ||
199 | { 0x6f, 0xa5, KEY_KPMINUS }, /* zoom out */ | ||
200 | { 0x9f, 0xa5, KEY_F18 }, /* capture */ | ||
201 | { 0xaf, 0xa5, KEY_F19 }, /* web */ | ||
202 | { 0x5f, 0xa6, KEY_EMAIL }, | ||
203 | { 0x6f, 0xa6, KEY_PHONE }, | ||
204 | { 0x9f, 0xa6, KEY_PC }, | ||
151 | }; | 205 | }; |
152 | 206 | ||
153 | /* TODO is it really the NEC protocol ? */ | ||
154 | static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 207 | static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
155 | { | 208 | { |
209 | int i; | ||
156 | u8 key[5]; | 210 | u8 key[5]; |
211 | u8 b[4] = { 0 }; | ||
212 | |||
213 | *event = 0; | ||
214 | *state = REMOTE_NO_KEY_PRESSED; | ||
157 | 215 | ||
158 | digitv_ctrl_msg(d,USB_READ_REMOTE,0,NULL,0,&key[1],4); | 216 | digitv_ctrl_msg(d,USB_READ_REMOTE,0,NULL,0,&key[1],4); |
159 | /* TODO state, maybe it is VV ? */ | 217 | |
218 | /* Tell the device we've read the remote. Not sure how necessary | ||
219 | this is, but the Nebula SDK does it. */ | ||
220 | digitv_ctrl_msg(d,USB_WRITE_REMOTE,0,b,4,NULL,0); | ||
221 | |||
222 | /* if something is inside the buffer, simulate key press */ | ||
160 | if (key[1] != 0) | 223 | if (key[1] != 0) |
161 | key[0] = 0x01; /* if something is inside the buffer, simulate key press */ | 224 | { |
225 | for (i = 0; i < d->props.rc_key_map_size; i++) { | ||
226 | if (d->props.rc_key_map[i].custom == key[1] && | ||
227 | d->props.rc_key_map[i].data == key[2]) { | ||
228 | *event = d->props.rc_key_map[i].event; | ||
229 | *state = REMOTE_KEY_PRESSED; | ||
230 | return 0; | ||
231 | } | ||
232 | } | ||
233 | } | ||
162 | 234 | ||
163 | /* call the universal NEC remote processor, to find out the key's state and event */ | ||
164 | dvb_usb_nec_rc_key_to_event(d,key,event,state); | ||
165 | if (key[0] != 0) | 235 | if (key[0] != 0) |
166 | deb_rc("key: %x %x %x %x %x\n",key[0],key[1],key[2],key[3],key[4]); | 236 | deb_rc("key: %x %x %x %x %x\n",key[0],key[1],key[2],key[3],key[4]); |
167 | return 0; | 237 | return 0; |