diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-18 14:25:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-18 14:25:58 -0400 |
commit | a267c0a887064720dfab5775a4f09b20b4f8ec37 (patch) | |
tree | 25de1f109ff6ef7f0967c22755604cc667944afd /drivers/media/video/cx88/cx88-input.c | |
parent | d756d10e246a01515d07f8161181b8a14afba7cc (diff) | |
parent | 97989ada7628da262eafb4bebce0a319c7cb0f5f (diff) |
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (126 commits)
V4L/DVB (5847): Clean up schedule_timeout calls in cpia2 and ivtv code
V4L/DVB (5846): Clean up setting state and scheduling timeouts
V4L/DVB (5844): ivtv: add high volume debugging flag
V4L/DVB (5843): ivtv: fix missing signal_pending check.
V4L/DVB (5842): ivtv: Add locking to ensure stream setup is atomic.
V4L/DVB (5841): tveeprom: add support for Philips FQ1216LME MK3 tuner.
V4L/DVB (5840): fix dst and cx24123: tune() callback changed signess for delay
V4L/DVB (5838): dvb-core: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22)
V4L/DVB (5837): stv0299: Fix signedness warning (gcc 4.1.1, kernel 2.6.22)
V4L/DVB (5836): dvb-ttpci: re-initialize aspect ratio and pan scan after arm crash
V4L/DVB (5835): saa7146/dvb-ttpci: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22)
V4L/DVB (5834): dvb-core: fix signedness warnings and const stripping
V4L/DVB (5832): ir-common: optimize bit extract function
V4L/DVB (5831): stradis: use ARRAY_SIZE
V4L/DVB (5829): Firmware extract and loading for opera dvb-usb update
V4L/DVB (5828): Kconfig: Added GemTek USB radio and removed experimental dependency.
V4L/DVB (5826): Usbvision: video mux cleanup
V4L/DVB (5825): Alter the tuner type for the WinTV USB UK PAL model.
V4L/DVB (5824): Usbvision: Hauppauge WinTV USB SECAM_L fix
V4L/DVB (5821): Saa7134: add remote control support for LifeView FlyDVB-S LR300
...
Diffstat (limited to 'drivers/media/video/cx88/cx88-input.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index 8136673fe9e8..f5d4a565346e 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
@@ -74,7 +74,8 @@ static void cx88_ir_handle_key(struct cx88_IR *ir) | |||
74 | 74 | ||
75 | /* read gpio value */ | 75 | /* read gpio value */ |
76 | gpio = cx_read(ir->gpio_addr); | 76 | gpio = cx_read(ir->gpio_addr); |
77 | if (core->board == CX88_BOARD_NPGTECH_REALTV_TOP10FM) { | 77 | switch (core->board) { |
78 | case CX88_BOARD_NPGTECH_REALTV_TOP10FM: | ||
78 | /* This board apparently uses a combination of 2 GPIO | 79 | /* This board apparently uses a combination of 2 GPIO |
79 | to represent the keys. Additionally, the second GPIO | 80 | to represent the keys. Additionally, the second GPIO |
80 | can be used for parity. | 81 | can be used for parity. |
@@ -90,9 +91,14 @@ static void cx88_ir_handle_key(struct cx88_IR *ir) | |||
90 | auxgpio = cx_read(MO_GP1_IO); | 91 | auxgpio = cx_read(MO_GP1_IO); |
91 | /* Take out the parity part */ | 92 | /* Take out the parity part */ |
92 | gpio=(gpio & 0x7fd) + (auxgpio & 0xef); | 93 | gpio=(gpio & 0x7fd) + (auxgpio & 0xef); |
93 | } else | 94 | break; |
95 | case CX88_BOARD_WINFAST_DTV1000: | ||
96 | gpio = (gpio & 0x6ff) | ((cx_read(MO_GP1_IO) << 8) & 0x900); | ||
94 | auxgpio = gpio; | 97 | auxgpio = gpio; |
95 | 98 | break; | |
99 | default: | ||
100 | auxgpio = gpio; | ||
101 | } | ||
96 | if (ir->polling) { | 102 | if (ir->polling) { |
97 | if (ir->last_gpio == auxgpio) | 103 | if (ir->last_gpio == auxgpio) |
98 | return; | 104 | return; |
@@ -148,20 +154,16 @@ static void ir_timer(unsigned long data) | |||
148 | static void cx88_ir_work(struct work_struct *work) | 154 | static void cx88_ir_work(struct work_struct *work) |
149 | { | 155 | { |
150 | struct cx88_IR *ir = container_of(work, struct cx88_IR, work); | 156 | struct cx88_IR *ir = container_of(work, struct cx88_IR, work); |
151 | unsigned long timeout; | ||
152 | 157 | ||
153 | cx88_ir_handle_key(ir); | 158 | cx88_ir_handle_key(ir); |
154 | timeout = jiffies + (ir->polling * HZ / 1000); | 159 | mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling)); |
155 | mod_timer(&ir->timer, timeout); | ||
156 | } | 160 | } |
157 | 161 | ||
158 | static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir) | 162 | static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir) |
159 | { | 163 | { |
160 | if (ir->polling) { | 164 | if (ir->polling) { |
165 | setup_timer(&ir->timer, ir_timer, (unsigned long)ir); | ||
161 | INIT_WORK(&ir->work, cx88_ir_work); | 166 | INIT_WORK(&ir->work, cx88_ir_work); |
162 | init_timer(&ir->timer); | ||
163 | ir->timer.function = ir_timer; | ||
164 | ir->timer.data = (unsigned long)ir; | ||
165 | schedule_work(&ir->work); | 167 | schedule_work(&ir->work); |
166 | } | 168 | } |
167 | if (ir->sampling) { | 169 | if (ir->sampling) { |
@@ -222,7 +224,6 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
222 | case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: | 224 | case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: |
223 | case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: | 225 | case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: |
224 | case CX88_BOARD_HAUPPAUGE_HVR1100: | 226 | case CX88_BOARD_HAUPPAUGE_HVR1100: |
225 | case CX88_BOARD_HAUPPAUGE_HVR1300: | ||
226 | case CX88_BOARD_HAUPPAUGE_HVR3000: | 227 | case CX88_BOARD_HAUPPAUGE_HVR3000: |
227 | ir_codes = ir_codes_hauppauge_new; | 228 | ir_codes = ir_codes_hauppauge_new; |
228 | ir_type = IR_TYPE_RC5; | 229 | ir_type = IR_TYPE_RC5; |
@@ -236,6 +237,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
236 | ir->polling = 50; /* ms */ | 237 | ir->polling = 50; /* ms */ |
237 | break; | 238 | break; |
238 | case CX88_BOARD_WINFAST2000XP_EXPERT: | 239 | case CX88_BOARD_WINFAST2000XP_EXPERT: |
240 | case CX88_BOARD_WINFAST_DTV1000: | ||
239 | ir_codes = ir_codes_winfast; | 241 | ir_codes = ir_codes_winfast; |
240 | ir->gpio_addr = MO_GP0_IO; | 242 | ir->gpio_addr = MO_GP0_IO; |
241 | ir->mask_keycode = 0x8f8; | 243 | ir->mask_keycode = 0x8f8; |
@@ -328,7 +330,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
328 | input_dev->id.vendor = pci->vendor; | 330 | input_dev->id.vendor = pci->vendor; |
329 | input_dev->id.product = pci->device; | 331 | input_dev->id.product = pci->device; |
330 | } | 332 | } |
331 | input_dev->cdev.dev = &pci->dev; | 333 | input_dev->dev.parent = &pci->dev; |
332 | /* record handles to ourself */ | 334 | /* record handles to ourself */ |
333 | ir->core = core; | 335 | ir->core = core; |
334 | core->ir = ir; | 336 | core->ir = ir; |
@@ -442,7 +444,6 @@ void cx88_ir_irq(struct cx88_core *core) | |||
442 | case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: | 444 | case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: |
443 | case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: | 445 | case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: |
444 | case CX88_BOARD_HAUPPAUGE_HVR1100: | 446 | case CX88_BOARD_HAUPPAUGE_HVR1100: |
445 | case CX88_BOARD_HAUPPAUGE_HVR1300: | ||
446 | case CX88_BOARD_HAUPPAUGE_HVR3000: | 447 | case CX88_BOARD_HAUPPAUGE_HVR3000: |
447 | ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); | 448 | ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); |
448 | ir_dprintk("biphase decoded: %x\n", ircode); | 449 | ir_dprintk("biphase decoded: %x\n", ircode); |