2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Device driver for GPIO attached remote control interfaces
|
|
|
|
* on Conexant 2388x based TV/DVB cards.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2003 Pavel Machek
|
|
|
|
* Copyright (c) 2004 Gerd Knorr
|
2006-01-09 17:25:35 +00:00
|
|
|
* Copyright (c) 2004, 2005 Chris Pascoe
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/init.h>
|
2009-07-02 14:50:35 +00:00
|
|
|
#include <linux/hrtimer.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <linux/input.h>
|
|
|
|
#include <linux/pci.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
|
|
|
|
#include "cx88.h"
|
2006-01-09 17:25:21 +00:00
|
|
|
#include <media/ir-common.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
struct cx88_IR {
|
2005-07-12 20:58:44 +00:00
|
|
|
struct cx88_core *core;
|
2005-09-15 07:01:53 +00:00
|
|
|
struct input_dev *input;
|
2005-07-12 20:58:44 +00:00
|
|
|
struct ir_input_state ir;
|
|
|
|
char name[32];
|
|
|
|
char phys[32];
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* sample from gpio pin 16 */
|
2006-01-09 17:25:35 +00:00
|
|
|
u32 sampling;
|
2005-07-12 20:58:44 +00:00
|
|
|
u32 samples[16];
|
|
|
|
int scount;
|
|
|
|
unsigned long release;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* poll external decoder */
|
2005-07-12 20:58:44 +00:00
|
|
|
int polling;
|
2009-07-02 14:50:35 +00:00
|
|
|
struct hrtimer timer;
|
2005-07-12 20:58:44 +00:00
|
|
|
u32 gpio_addr;
|
|
|
|
u32 last_gpio;
|
|
|
|
u32 mask_keycode;
|
|
|
|
u32 mask_keydown;
|
|
|
|
u32 mask_keyup;
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|
|
|
|
|
2008-04-22 17:41:48 +00:00
|
|
|
static int ir_debug;
|
2005-07-12 20:58:44 +00:00
|
|
|
module_param(ir_debug, int, 0644); /* debug level [IR] */
|
2005-04-16 22:20:36 +00:00
|
|
|
MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
|
|
|
|
|
|
|
|
#define ir_dprintk(fmt, arg...) if (ir_debug) \
|
2005-09-09 20:03:41 +00:00
|
|
|
printk(KERN_DEBUG "%s IR: " fmt , ir->core->name , ##arg)
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
static void cx88_ir_handle_key(struct cx88_IR *ir)
|
|
|
|
{
|
|
|
|
struct cx88_core *core = ir->core;
|
2006-05-22 10:44:02 +00:00
|
|
|
u32 gpio, data, auxgpio;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* read gpio value */
|
|
|
|
gpio = cx_read(ir->gpio_addr);
|
2007-08-15 17:41:57 +00:00
|
|
|
switch (core->boardnr) {
|
2007-06-25 17:54:09 +00:00
|
|
|
case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
|
2006-05-22 10:44:02 +00:00
|
|
|
/* This board apparently uses a combination of 2 GPIO
|
|
|
|
to represent the keys. Additionally, the second GPIO
|
|
|
|
can be used for parity.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
for key "5"
|
|
|
|
gpio = 0x758, auxgpio = 0xe5 or 0xf5
|
|
|
|
for key "Power"
|
|
|
|
gpio = 0x758, auxgpio = 0xed or 0xfd
|
|
|
|
*/
|
|
|
|
|
|
|
|
auxgpio = cx_read(MO_GP1_IO);
|
|
|
|
/* Take out the parity part */
|
2006-07-17 19:34:27 +00:00
|
|
|
gpio=(gpio & 0x7fd) + (auxgpio & 0xef);
|
2007-06-25 17:54:09 +00:00
|
|
|
break;
|
|
|
|
case CX88_BOARD_WINFAST_DTV1000:
|
2009-05-31 19:47:28 +00:00
|
|
|
case CX88_BOARD_WINFAST_DTV1800H:
|
2009-04-29 06:55:31 +00:00
|
|
|
case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
|
2007-06-25 17:46:05 +00:00
|
|
|
gpio = (gpio & 0x6ff) | ((cx_read(MO_GP1_IO) << 8) & 0x900);
|
|
|
|
auxgpio = gpio;
|
2007-06-25 17:54:09 +00:00
|
|
|
break;
|
|
|
|
default:
|
2006-05-22 10:44:02 +00:00
|
|
|
auxgpio = gpio;
|
2007-06-25 17:54:09 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
if (ir->polling) {
|
2006-05-22 10:44:02 +00:00
|
|
|
if (ir->last_gpio == auxgpio)
|
2005-04-16 22:20:36 +00:00
|
|
|
return;
|
2006-05-22 10:44:02 +00:00
|
|
|
ir->last_gpio = auxgpio;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* extract data */
|
|
|
|
data = ir_extract_bits(gpio, ir->mask_keycode);
|
|
|
|
ir_dprintk("irq gpio=0x%x code=%d | %s%s%s\n",
|
2005-07-12 20:58:44 +00:00
|
|
|
gpio, data,
|
|
|
|
ir->polling ? "poll" : "irq",
|
|
|
|
(gpio & ir->mask_keydown) ? " down" : "",
|
|
|
|
(gpio & ir->mask_keyup) ? " up" : "");
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-08-15 17:41:57 +00:00
|
|
|
if (ir->core->boardnr == CX88_BOARD_NORWOOD_MICRO) {
|
2006-08-08 12:10:05 +00:00
|
|
|
u32 gpio_key = cx_read(MO_GP0_IO);
|
|
|
|
|
|
|
|
data = (data << 4) | ((gpio_key & 0xf0) >> 4);
|
|
|
|
|
|
|
|
ir_input_keydown(ir->input, &ir->ir, data, data);
|
|
|
|
ir_input_nokey(ir->input, &ir->ir);
|
|
|
|
|
|
|
|
} else if (ir->mask_keydown) {
|
2005-04-16 22:20:36 +00:00
|
|
|
/* bit set on keydown */
|
|
|
|
if (gpio & ir->mask_keydown) {
|
2005-09-15 07:01:53 +00:00
|
|
|
ir_input_keydown(ir->input, &ir->ir, data, data);
|
2005-04-16 22:20:36 +00:00
|
|
|
} else {
|
2005-09-15 07:01:53 +00:00
|
|
|
ir_input_nokey(ir->input, &ir->ir);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} else if (ir->mask_keyup) {
|
|
|
|
/* bit cleared on keydown */
|
|
|
|
if (0 == (gpio & ir->mask_keyup)) {
|
2005-09-15 07:01:53 +00:00
|
|
|
ir_input_keydown(ir->input, &ir->ir, data, data);
|
2005-04-16 22:20:36 +00:00
|
|
|
} else {
|
2005-09-15 07:01:53 +00:00
|
|
|
ir_input_nokey(ir->input, &ir->ir);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
/* can't distinguish keydown/up :-/ */
|
2005-09-15 07:01:53 +00:00
|
|
|
ir_input_keydown(ir->input, &ir->ir, data, data);
|
|
|
|
ir_input_nokey(ir->input, &ir->ir);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-02 14:50:35 +00:00
|
|
|
static enum hrtimer_restart cx88_ir_work(struct hrtimer *timer)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2009-07-02 14:50:35 +00:00
|
|
|
unsigned long missed;
|
|
|
|
struct cx88_IR *ir = container_of(timer, struct cx88_IR, timer);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
cx88_ir_handle_key(ir);
|
2009-07-02 14:50:35 +00:00
|
|
|
missed = hrtimer_forward_now(&ir->timer,
|
|
|
|
ktime_set(0, ir->polling * 1000000));
|
|
|
|
if (missed > 1)
|
|
|
|
ir_dprintk("Missed ticks %ld\n", missed - 1);
|
|
|
|
|
|
|
|
return HRTIMER_RESTART;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2007-10-01 11:51:39 +00:00
|
|
|
void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir)
|
2006-11-20 13:23:04 +00:00
|
|
|
{
|
|
|
|
if (ir->polling) {
|
2009-07-02 14:50:35 +00:00
|
|
|
hrtimer_init(&ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
|
|
|
|
ir->timer.function = cx88_ir_work;
|
|
|
|
hrtimer_start(&ir->timer,
|
|
|
|
ktime_set(0, ir->polling * 1000000),
|
|
|
|
HRTIMER_MODE_REL);
|
2006-11-20 13:23:04 +00:00
|
|
|
}
|
|
|
|
if (ir->sampling) {
|
2007-08-18 09:57:55 +00:00
|
|
|
core->pci_irqmask |= PCI_INT_IR_SMPINT;
|
2006-11-20 13:23:04 +00:00
|
|
|
cx_write(MO_DDS_IO, 0xa80a80); /* 4 kHz sample rate */
|
|
|
|
cx_write(MO_DDSCFG_IO, 0x5); /* enable */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-10-01 11:51:39 +00:00
|
|
|
void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir)
|
2006-11-20 13:23:04 +00:00
|
|
|
{
|
|
|
|
if (ir->sampling) {
|
|
|
|
cx_write(MO_DDSCFG_IO, 0x0);
|
2007-08-18 09:57:55 +00:00
|
|
|
core->pci_irqmask &= ~PCI_INT_IR_SMPINT;
|
2006-11-20 13:23:04 +00:00
|
|
|
}
|
|
|
|
|
2009-03-07 10:42:12 +00:00
|
|
|
if (ir->polling)
|
2009-07-02 14:50:35 +00:00
|
|
|
hrtimer_cancel(&ir->timer);
|
2006-11-20 13:23:04 +00:00
|
|
|
}
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
|
|
|
|
{
|
|
|
|
struct cx88_IR *ir;
|
2005-09-15 07:01:53 +00:00
|
|
|
struct input_dev *input_dev;
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
struct ir_scancode_table *ir_codes = NULL;
|
2005-04-16 22:20:36 +00:00
|
|
|
int ir_type = IR_TYPE_OTHER;
|
2006-11-20 13:23:04 +00:00
|
|
|
int err = -ENOMEM;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-09-15 07:01:53 +00:00
|
|
|
ir = kzalloc(sizeof(*ir), GFP_KERNEL);
|
|
|
|
input_dev = input_allocate_device();
|
2006-11-20 13:23:04 +00:00
|
|
|
if (!ir || !input_dev)
|
|
|
|
goto err_out_free;
|
2005-09-15 07:01:53 +00:00
|
|
|
|
|
|
|
ir->input = input_dev;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* detect & configure */
|
2007-08-15 17:41:57 +00:00
|
|
|
switch (core->boardnr) {
|
2005-04-16 22:20:36 +00:00
|
|
|
case CX88_BOARD_DNTV_LIVE_DVB_T:
|
2005-06-24 05:05:03 +00:00
|
|
|
case CX88_BOARD_KWORLD_DVB_T:
|
2006-02-07 08:45:33 +00:00
|
|
|
case CX88_BOARD_KWORLD_DVB_T_CX22702:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_dntv_live_dvb_t_table;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->gpio_addr = MO_GP1_IO;
|
2005-04-16 22:20:36 +00:00
|
|
|
ir->mask_keycode = 0x1f;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->mask_keyup = 0x60;
|
|
|
|
ir->polling = 50; /* ms */
|
2005-04-16 22:20:36 +00:00
|
|
|
break;
|
2005-09-09 20:03:41 +00:00
|
|
|
case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_cinergy_1400_table;
|
2005-09-09 20:03:41 +00:00
|
|
|
ir_type = IR_TYPE_PD;
|
2006-01-09 17:25:35 +00:00
|
|
|
ir->sampling = 0xeb04; /* address */
|
2005-09-09 20:03:41 +00:00
|
|
|
break;
|
2005-04-16 22:20:36 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE:
|
|
|
|
case CX88_BOARD_HAUPPAUGE_DVB_T1:
|
2006-01-09 17:25:02 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
|
|
|
|
case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
|
2006-01-09 17:25:12 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE_HVR1100:
|
2006-09-30 03:43:58 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE_HVR3000:
|
2008-09-04 04:17:33 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE_HVR4000:
|
|
|
|
case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
|
2009-03-01 01:29:20 +00:00
|
|
|
case CX88_BOARD_PCHDTV_HD3000:
|
|
|
|
case CX88_BOARD_PCHDTV_HD5500:
|
2009-03-28 17:22:21 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE_IRONLY:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_hauppauge_new_table;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir_type = IR_TYPE_RC5;
|
|
|
|
ir->sampling = 1;
|
2005-04-16 22:20:36 +00:00
|
|
|
break;
|
2006-05-29 16:56:24 +00:00
|
|
|
case CX88_BOARD_WINFAST_DTV2000H:
|
2009-08-11 01:15:54 +00:00
|
|
|
case CX88_BOARD_WINFAST_DTV2000H_J:
|
2009-05-31 19:47:28 +00:00
|
|
|
case CX88_BOARD_WINFAST_DTV1800H:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_winfast_table;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->gpio_addr = MO_GP0_IO;
|
2005-04-16 22:20:36 +00:00
|
|
|
ir->mask_keycode = 0x8f8;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->mask_keyup = 0x100;
|
2006-05-29 16:56:24 +00:00
|
|
|
ir->polling = 50; /* ms */
|
2005-04-16 22:20:36 +00:00
|
|
|
break;
|
2006-11-03 13:45:52 +00:00
|
|
|
case CX88_BOARD_WINFAST2000XP_EXPERT:
|
2007-06-25 17:46:05 +00:00
|
|
|
case CX88_BOARD_WINFAST_DTV1000:
|
2009-04-29 06:55:31 +00:00
|
|
|
case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_winfast_table;
|
2006-11-03 13:45:52 +00:00
|
|
|
ir->gpio_addr = MO_GP0_IO;
|
|
|
|
ir->mask_keycode = 0x8f8;
|
|
|
|
ir->mask_keyup = 0x100;
|
|
|
|
ir->polling = 1; /* ms */
|
|
|
|
break;
|
2005-04-16 22:20:36 +00:00
|
|
|
case CX88_BOARD_IODATA_GVBCTV7E:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_iodata_bctv7e_table;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->gpio_addr = MO_GP0_IO;
|
2005-04-16 22:20:36 +00:00
|
|
|
ir->mask_keycode = 0xfd;
|
|
|
|
ir->mask_keydown = 0x02;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->polling = 5; /* ms */
|
2005-04-16 22:20:36 +00:00
|
|
|
break;
|
2006-11-03 13:45:52 +00:00
|
|
|
case CX88_BOARD_PROLINK_PLAYTVPVR:
|
2005-06-24 05:04:53 +00:00
|
|
|
case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_pixelview_table;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->gpio_addr = MO_GP1_IO;
|
2005-06-24 05:04:53 +00:00
|
|
|
ir->mask_keycode = 0x1f;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->mask_keyup = 0x80;
|
|
|
|
ir->polling = 1; /* ms */
|
2005-06-24 05:04:53 +00:00
|
|
|
break;
|
2008-04-22 17:46:01 +00:00
|
|
|
case CX88_BOARD_PROLINK_PV_8000GT:
|
2008-09-29 15:08:29 +00:00
|
|
|
case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_pixelview_new_table;
|
2008-04-22 17:46:01 +00:00
|
|
|
ir->gpio_addr = MO_GP1_IO;
|
|
|
|
ir->mask_keycode = 0x3f;
|
|
|
|
ir->mask_keyup = 0x80;
|
|
|
|
ir->polling = 1; /* ms */
|
|
|
|
break;
|
2006-01-23 11:44:10 +00:00
|
|
|
case CX88_BOARD_KWORLD_LTV883:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_pixelview_table;
|
2006-01-23 11:44:10 +00:00
|
|
|
ir->gpio_addr = MO_GP1_IO;
|
|
|
|
ir->mask_keycode = 0x1f;
|
|
|
|
ir->mask_keyup = 0x60;
|
|
|
|
ir->polling = 1; /* ms */
|
|
|
|
break;
|
2005-07-08 00:58:36 +00:00
|
|
|
case CX88_BOARD_ADSTECH_DVB_T_PCI:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_adstech_dvb_t_pci_table;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->gpio_addr = MO_GP1_IO;
|
2005-07-08 00:58:36 +00:00
|
|
|
ir->mask_keycode = 0xbf;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->mask_keyup = 0x40;
|
|
|
|
ir->polling = 50; /* ms */
|
|
|
|
break;
|
|
|
|
case CX88_BOARD_MSI_TVANYWHERE_MASTER:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_msi_tvanywhere_table;
|
2005-07-12 20:58:44 +00:00
|
|
|
ir->gpio_addr = MO_GP1_IO;
|
|
|
|
ir->mask_keycode = 0x1f;
|
|
|
|
ir->mask_keyup = 0x40;
|
|
|
|
ir->polling = 1; /* ms */
|
2005-07-08 00:58:36 +00:00
|
|
|
break;
|
2006-01-09 17:25:19 +00:00
|
|
|
case CX88_BOARD_AVERTV_303:
|
2006-01-09 17:32:46 +00:00
|
|
|
case CX88_BOARD_AVERTV_STUDIO_303:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_avertv_303_table;
|
2006-01-09 17:25:19 +00:00
|
|
|
ir->gpio_addr = MO_GP2_IO;
|
|
|
|
ir->mask_keycode = 0xfb;
|
|
|
|
ir->mask_keydown = 0x02;
|
|
|
|
ir->polling = 50; /* ms */
|
|
|
|
break;
|
2009-09-19 12:51:12 +00:00
|
|
|
case CX88_BOARD_OMICOM_SS4_PCI:
|
|
|
|
case CX88_BOARD_SATTRADE_ST4200:
|
|
|
|
case CX88_BOARD_TBS_8920:
|
|
|
|
case CX88_BOARD_TBS_8910:
|
|
|
|
case CX88_BOARD_PROF_7300:
|
2009-11-17 01:22:32 +00:00
|
|
|
case CX88_BOARD_PROF_7301:
|
2009-09-19 12:51:12 +00:00
|
|
|
case CX88_BOARD_PROF_6200:
|
|
|
|
ir_codes = &ir_codes_tbs_nec_table;
|
|
|
|
ir_type = IR_TYPE_PD;
|
|
|
|
ir->sampling = 0xff00; /* address */
|
|
|
|
break;
|
|
|
|
case CX88_BOARD_TEVII_S460:
|
|
|
|
case CX88_BOARD_TEVII_S420:
|
2009-09-23 17:44:12 +00:00
|
|
|
ir_codes = &ir_codes_tevii_nec_table;
|
2009-09-19 12:51:12 +00:00
|
|
|
ir_type = IR_TYPE_PD;
|
|
|
|
ir->sampling = 0xff00; /* address */
|
|
|
|
break;
|
2006-01-09 17:25:35 +00:00
|
|
|
case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_dntv_live_dvbt_pro_table;
|
|
|
|
ir_type = IR_TYPE_PD;
|
|
|
|
ir->sampling = 0xff00; /* address */
|
2006-01-09 17:25:35 +00:00
|
|
|
break;
|
2006-08-08 12:10:05 +00:00
|
|
|
case CX88_BOARD_NORWOOD_MICRO:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_norwood_table;
|
2006-08-08 12:10:05 +00:00
|
|
|
ir->gpio_addr = MO_GP1_IO;
|
|
|
|
ir->mask_keycode = 0x0e;
|
|
|
|
ir->mask_keyup = 0x80;
|
|
|
|
ir->polling = 50; /* ms */
|
|
|
|
break;
|
2006-06-08 20:36:17 +00:00
|
|
|
case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_npgtech_table;
|
|
|
|
ir->gpio_addr = MO_GP0_IO;
|
2006-05-22 10:44:02 +00:00
|
|
|
ir->mask_keycode = 0xfa;
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir->polling = 50; /* ms */
|
2006-05-22 10:44:02 +00:00
|
|
|
break;
|
2008-01-22 04:00:33 +00:00
|
|
|
case CX88_BOARD_PINNACLE_PCTV_HD_800i:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_pinnacle_pctv_hd_table;
|
|
|
|
ir_type = IR_TYPE_RC5;
|
|
|
|
ir->sampling = 1;
|
2008-01-22 04:00:33 +00:00
|
|
|
break;
|
2008-04-08 22:56:44 +00:00
|
|
|
case CX88_BOARD_POWERCOLOR_REAL_ANGEL:
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir_codes = &ir_codes_powercolor_real_angel_table;
|
|
|
|
ir->gpio_addr = MO_GP2_IO;
|
2008-04-08 22:56:44 +00:00
|
|
|
ir->mask_keycode = 0x7e;
|
V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:
1) It requires that the scancode to be at the range 00-7f;
2) keycodes should be masked on 7 bits in order for it to work;
3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;
4) it is different than what is done with dvb-usb approach;
5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.
This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};
This is very close to what dvb does. So, a further integration with DVB
code will be easy.
While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.
The only notable effect is the redution of about 35% of the ir-common
module size:
text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko
In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.
This patch itself shouldn't be doing any functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-29 17:15:55 +00:00
|
|
|
ir->polling = 100; /* ms */
|
2008-04-08 22:56:44 +00:00
|
|
|
break;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2005-06-24 05:05:03 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
if (NULL == ir_codes) {
|
2006-11-20 13:23:04 +00:00
|
|
|
err = -ENODEV;
|
|
|
|
goto err_out_free;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* init input device */
|
2007-08-15 17:41:57 +00:00
|
|
|
snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name);
|
2005-07-12 20:58:44 +00:00
|
|
|
snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-09-15 07:01:53 +00:00
|
|
|
ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
|
|
|
|
input_dev->name = ir->name;
|
|
|
|
input_dev->phys = ir->phys;
|
|
|
|
input_dev->id.bustype = BUS_PCI;
|
|
|
|
input_dev->id.version = 1;
|
2005-04-16 22:20:36 +00:00
|
|
|
if (pci->subsystem_vendor) {
|
2005-09-15 07:01:53 +00:00
|
|
|
input_dev->id.vendor = pci->subsystem_vendor;
|
|
|
|
input_dev->id.product = pci->subsystem_device;
|
2005-04-16 22:20:36 +00:00
|
|
|
} else {
|
2005-09-15 07:01:53 +00:00
|
|
|
input_dev->id.vendor = pci->vendor;
|
|
|
|
input_dev->id.product = pci->device;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2007-07-16 12:28:15 +00:00
|
|
|
input_dev->dev.parent = &pci->dev;
|
2005-04-16 22:20:36 +00:00
|
|
|
/* record handles to ourself */
|
|
|
|
ir->core = core;
|
|
|
|
core->ir = ir;
|
|
|
|
|
2006-11-20 13:23:04 +00:00
|
|
|
cx88_ir_start(core, ir);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* all done */
|
2006-11-20 13:23:04 +00:00
|
|
|
err = input_register_device(ir->input);
|
|
|
|
if (err)
|
|
|
|
goto err_out_stop;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
return 0;
|
2006-11-20 13:23:04 +00:00
|
|
|
|
|
|
|
err_out_stop:
|
|
|
|
cx88_ir_stop(core, ir);
|
|
|
|
core->ir = NULL;
|
|
|
|
err_out_free:
|
|
|
|
input_free_device(input_dev);
|
|
|
|
kfree(ir);
|
|
|
|
return err;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int cx88_ir_fini(struct cx88_core *core)
|
|
|
|
{
|
|
|
|
struct cx88_IR *ir = core->ir;
|
|
|
|
|
|
|
|
/* skip detach on non attached boards */
|
|
|
|
if (NULL == ir)
|
|
|
|
return 0;
|
|
|
|
|
2006-11-20 13:23:04 +00:00
|
|
|
cx88_ir_stop(core, ir);
|
2005-09-15 07:01:53 +00:00
|
|
|
input_unregister_device(ir->input);
|
2005-04-16 22:20:36 +00:00
|
|
|
kfree(ir);
|
|
|
|
|
|
|
|
/* done */
|
|
|
|
core->ir = NULL;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
void cx88_ir_irq(struct cx88_core *core)
|
|
|
|
{
|
|
|
|
struct cx88_IR *ir = core->ir;
|
2005-09-09 20:03:41 +00:00
|
|
|
u32 samples, ircode;
|
2008-09-22 03:54:59 +00:00
|
|
|
int i, start, range, toggle, dev, code;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (NULL == ir)
|
|
|
|
return;
|
|
|
|
if (!ir->sampling)
|
|
|
|
return;
|
|
|
|
|
|
|
|
samples = cx_read(MO_SAMPLE_IO);
|
2005-07-12 20:58:44 +00:00
|
|
|
if (0 != samples && 0xffffffff != samples) {
|
2005-04-16 22:20:36 +00:00
|
|
|
/* record sample data */
|
|
|
|
if (ir->scount < ARRAY_SIZE(ir->samples))
|
|
|
|
ir->samples[ir->scount++] = samples;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!ir->scount) {
|
|
|
|
/* nothing to sample */
|
2005-07-12 20:58:44 +00:00
|
|
|
if (ir->ir.keypressed && time_after(jiffies, ir->release))
|
2005-09-15 07:01:53 +00:00
|
|
|
ir_input_nokey(ir->input, &ir->ir);
|
2005-04-16 22:20:36 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* have a complete sample */
|
|
|
|
if (ir->scount < ARRAY_SIZE(ir->samples))
|
|
|
|
ir->samples[ir->scount++] = samples;
|
|
|
|
for (i = 0; i < ir->scount; i++)
|
|
|
|
ir->samples[i] = ~ir->samples[i];
|
|
|
|
if (ir_debug)
|
2005-07-12 20:58:44 +00:00
|
|
|
ir_dump_samples(ir->samples, ir->scount);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* decode it */
|
2007-08-15 17:41:57 +00:00
|
|
|
switch (core->boardnr) {
|
2009-09-19 12:51:12 +00:00
|
|
|
case CX88_BOARD_TEVII_S460:
|
|
|
|
case CX88_BOARD_TEVII_S420:
|
2005-09-09 20:03:41 +00:00
|
|
|
case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:
|
2006-01-09 17:25:35 +00:00
|
|
|
case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
|
2009-09-19 12:51:12 +00:00
|
|
|
case CX88_BOARD_OMICOM_SS4_PCI:
|
|
|
|
case CX88_BOARD_SATTRADE_ST4200:
|
|
|
|
case CX88_BOARD_TBS_8920:
|
|
|
|
case CX88_BOARD_TBS_8910:
|
|
|
|
case CX88_BOARD_PROF_7300:
|
2009-11-17 01:22:32 +00:00
|
|
|
case CX88_BOARD_PROF_7301:
|
2009-09-19 12:51:12 +00:00
|
|
|
case CX88_BOARD_PROF_6200:
|
2005-09-09 20:03:41 +00:00
|
|
|
ircode = ir_decode_pulsedistance(ir->samples, ir->scount, 1, 4);
|
|
|
|
|
|
|
|
if (ircode == 0xffffffff) { /* decoding error */
|
|
|
|
ir_dprintk("pulse distance decoding error\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ir_dprintk("pulse distance decoded: %x\n", ircode);
|
|
|
|
|
|
|
|
if (ircode == 0) { /* key still pressed */
|
|
|
|
ir_dprintk("pulse distance decoded repeat code\n");
|
|
|
|
ir->release = jiffies + msecs_to_jiffies(120);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2006-01-09 17:25:35 +00:00
|
|
|
if ((ircode & 0xffff) != (ir->sampling & 0xffff)) { /* wrong address */
|
2005-09-09 20:03:41 +00:00
|
|
|
ir_dprintk("pulse distance decoded wrong address\n");
|
2005-11-09 05:37:43 +00:00
|
|
|
break;
|
2005-09-09 20:03:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (((~ircode >> 24) & 0xff) != ((ircode >> 16) & 0xff)) { /* wrong checksum */
|
|
|
|
ir_dprintk("pulse distance decoded wrong check sum\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ir_dprintk("Key Code: %x\n", (ircode >> 16) & 0x7f);
|
|
|
|
|
2005-09-15 07:01:53 +00:00
|
|
|
ir_input_keydown(ir->input, &ir->ir, (ircode >> 16) & 0x7f, (ircode >> 16) & 0xff);
|
2005-09-09 20:03:41 +00:00
|
|
|
ir->release = jiffies + msecs_to_jiffies(120);
|
|
|
|
break;
|
2005-04-16 22:20:36 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE:
|
|
|
|
case CX88_BOARD_HAUPPAUGE_DVB_T1:
|
2006-01-09 17:25:02 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
|
|
|
|
case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
|
2006-01-11 21:40:01 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE_HVR1100:
|
2006-09-30 03:43:58 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE_HVR3000:
|
2008-09-04 04:17:33 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE_HVR4000:
|
|
|
|
case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
|
2009-03-01 01:29:20 +00:00
|
|
|
case CX88_BOARD_PCHDTV_HD3000:
|
|
|
|
case CX88_BOARD_PCHDTV_HD5500:
|
2009-03-28 17:22:21 +00:00
|
|
|
case CX88_BOARD_HAUPPAUGE_IRONLY:
|
2008-09-22 03:54:59 +00:00
|
|
|
ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
|
|
|
|
ir_dprintk("biphase decoded: %x\n", ircode);
|
|
|
|
/*
|
|
|
|
* RC5 has an extension bit which adds a new range
|
|
|
|
* of available codes, this is detected here. Also
|
|
|
|
* hauppauge remotes (black/silver) always use
|
|
|
|
* specific device ids. If we do not filter the
|
|
|
|
* device ids then messages destined for devices
|
|
|
|
* such as TVs (id=0) will get through to the
|
|
|
|
* device causing mis-fired events.
|
|
|
|
*/
|
|
|
|
/* split rc5 data block ... */
|
|
|
|
start = (ircode & 0x2000) >> 13;
|
|
|
|
range = (ircode & 0x1000) >> 12;
|
|
|
|
toggle= (ircode & 0x0800) >> 11;
|
|
|
|
dev = (ircode & 0x07c0) >> 6;
|
|
|
|
code = (ircode & 0x003f) | ((range << 6) ^ 0x0040);
|
|
|
|
if( start != 1)
|
|
|
|
/* no key pressed */
|
|
|
|
break;
|
|
|
|
if ( dev != 0x1e && dev != 0x1f )
|
|
|
|
/* not a hauppauge remote */
|
|
|
|
break;
|
|
|
|
ir_input_keydown(ir->input, &ir->ir, code, ircode);
|
|
|
|
ir->release = jiffies + msecs_to_jiffies(120);
|
|
|
|
break;
|
|
|
|
case CX88_BOARD_PINNACLE_PCTV_HD_800i:
|
2005-09-09 20:03:41 +00:00
|
|
|
ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
|
|
|
|
ir_dprintk("biphase decoded: %x\n", ircode);
|
|
|
|
if ((ircode & 0xfffff000) != 0x3000)
|
2005-04-16 22:20:36 +00:00
|
|
|
break;
|
2005-09-15 07:01:53 +00:00
|
|
|
ir_input_keydown(ir->input, &ir->ir, ircode & 0x3f, ircode);
|
2005-04-16 22:20:36 +00:00
|
|
|
ir->release = jiffies + msecs_to_jiffies(120);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ir->scount = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Gerd Knorr, Pavel Machek, Chris Pascoe");
|
|
|
|
MODULE_DESCRIPTION("input driver for cx88 GPIO-based IR remote controls");
|
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 8
|
|
|
|
* End:
|
|
|
|
*/
|