diff options
author | Gerd Knorr <devnull@localhost> | 2005-01-07 13:58:49 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2005-01-07 13:58:49 +0000 |
commit | efce3c0310a899d62906b8d0b9aec584d69ba0c3 (patch) | |
tree | cf41db785f62732bebd44531642347fc53569fbe /linux | |
parent | bd43dd87f5e1b86295caf0c65eec8cdcdf566171 (diff) | |
download | mediapointer-dvb-s2-efce3c0310a899d62906b8d0b9aec584d69ba0c3.tar.gz mediapointer-dvb-s2-efce3c0310a899d62906b8d0b9aec584d69ba0c3.tar.bz2 |
- tveeprom tweaks.
- keytable for the new hauppauge remotes.
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/bttv-cards.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-input.c | 42 | ||||
-rw-r--r-- | linux/drivers/media/video/tveeprom.c | 108 |
3 files changed, 151 insertions, 3 deletions
diff --git a/linux/drivers/media/video/bttv-cards.c b/linux/drivers/media/video/bttv-cards.c index a074422df..5308b81e0 100644 --- a/linux/drivers/media/video/bttv-cards.c +++ b/linux/drivers/media/video/bttv-cards.c @@ -1,5 +1,5 @@ /* - $Id: bttv-cards.c,v 1.40 2005/01/07 13:11:19 kraxel Exp $ + $Id: bttv-cards.c,v 1.41 2005/01/07 13:58:49 kraxel Exp $ bttv-cards.c @@ -2584,6 +2584,8 @@ void __devinit bttv_init_card1(struct bttv *btv) btv->use_i2c_hw = 1; break; } + if (!bttv_tvcards[btv->c.type].has_dvb) + bttv_reset_audio(btv); } /* initialization part two -- after registering i2c bus */ diff --git a/linux/drivers/media/video/cx88/cx88-input.c b/linux/drivers/media/video/cx88/cx88-input.c index 3a7179961..3b02065d7 100644 --- a/linux/drivers/media/video/cx88/cx88-input.c +++ b/linux/drivers/media/video/cx88/cx88-input.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-input.c,v 1.3 2004/12/10 12:33:39 kraxel Exp $ + * $Id: cx88-input.c,v 1.4 2005/01/07 13:58:49 kraxel Exp $ * * Device driver for GPIO attached remote control interfaces * on Conexant 2388x based TV/DVB cards. @@ -73,6 +73,44 @@ static IR_KEYTAB_TYPE ir_codes_dntv_live_dvb_t[IR_KEYTAB_SIZE] = { [ 0x1f ] = KEY_VOLUMEDOWN, // 'volume -' }; +/* Happauge: the newer, gray remote */ +static IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE] = { + [ 0x00 ] = KEY_KP0, // 0 + [ 0x01 ] = KEY_KP1, // 1 + [ 0x02 ] = KEY_KP2, // 2 + [ 0x03 ] = KEY_KP3, // 3 + [ 0x04 ] = KEY_KP4, // 4 + [ 0x05 ] = KEY_KP5, // 5 + [ 0x06 ] = KEY_KP6, // 6 + [ 0x07 ] = KEY_KP7, // 7 + [ 0x08 ] = KEY_KP8, // 8 + [ 0x09 ] = KEY_KP9, // 9 + [ 0x0b ] = KEY_RED, // red button + [ 0x0c ] = KEY_OPTION, // black key without text + [ 0x0d ] = KEY_MENU, // menu + [ 0x0f ] = KEY_MUTE, // mute + [ 0x10 ] = KEY_VOLUMEUP, // volume + + [ 0x11 ] = KEY_VOLUMEDOWN, // volume - + [ 0x1e ] = KEY_NEXT, // skip >| + [ 0x1f ] = KEY_EXIT, // back/exit + [ 0x20 ] = KEY_CHANNELUP, // channel / program + + [ 0x21 ] = KEY_CHANNELDOWN, // channel / program - + [ 0x24 ] = KEY_PREVIOUS, // replay |< + [ 0x25 ] = KEY_ENTER, // OK + [ 0x29 ] = KEY_BLUE, // blue key + [ 0x2e ] = KEY_GREEN, // green button + [ 0x30 ] = KEY_PAUSE, // pause + [ 0x32 ] = KEY_REWIND, // backward << + [ 0x34 ] = KEY_FASTFORWARD, // forward >> + [ 0x35 ] = KEY_PLAY, // play + [ 0x36 ] = KEY_STOP, // stop + [ 0x37 ] = KEY_RECORD, // recording + [ 0x38 ] = KEY_YELLOW, // yellow key + [ 0x3b ] = KEY_SELECT, // top right button + [ 0x3c ] = KEY_ZOOM, // full + [ 0x3d ] = KEY_POWER, // system power (green button) +}; + /* ---------------------------------------------------------------------- */ struct cx88_IR { @@ -193,7 +231,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) break; case CX88_BOARD_HAUPPAUGE: case CX88_BOARD_HAUPPAUGE_DVB_T1: - ir_codes = ir_codes_rc5_tv; + ir_codes = ir_codes_hauppauge_new; ir_type = IR_TYPE_RC5; ir->sampling = 1; break; diff --git a/linux/drivers/media/video/tveeprom.c b/linux/drivers/media/video/tveeprom.c index 7ac3532e3..0bba7d25f 100644 --- a/linux/drivers/media/video/tveeprom.c +++ b/linux/drivers/media/video/tveeprom.c @@ -460,6 +460,114 @@ int tveeprom_dump(unsigned char *eedata, int len) } EXPORT_SYMBOL(tveeprom_dump); +/* ----------------------------------------------------------------------- */ +/* needed for ivtv.sf.net at the moment. Should go away in the long */ +/* run, just call the exported tveeprom_* directly, there is no point in */ +/* using the indirect way via i2c_driver->command() */ + +#ifndef I2C_DRIVERID_TVEEPROM +# define I2C_DRIVERID_TVEEPROM I2C_DRIVERID_EXP2 +#endif + +static unsigned short normal_i2c[] = { + 0xa0 >> 1, + I2C_CLIENT_END, +}; +static unsigned short normal_i2c_range[] = { I2C_CLIENT_END }; +I2C_CLIENT_INSMOD; + +struct i2c_driver i2c_driver_tveeprom; + +static int +tveeprom_command(struct i2c_client *client, + unsigned int cmd, + void *arg) +{ + struct tveeprom eeprom; + u32 *eeprom_props = arg; + u8 *buf; + + switch (cmd) { + case 0: + buf = kmalloc(256,GFP_KERNEL); + memset(buf,0,256); + tveeprom_read(client,buf,256); + tveeprom_hauppauge_analog(&eeprom,buf); + kfree(buf); + eeprom_props[0] = eeprom.tuner_type; + eeprom_props[1] = eeprom.tuner_formats; + eeprom_props[2] = eeprom.model; + eeprom_props[3] = eeprom.revision; + break; + default: + return -EINVAL; + } + return 0; +} + +static int +tveeprom_detect_client(struct i2c_adapter *adapter, + int address, + int kind) +{ + struct i2c_client *client; + + client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); + if (client == 0) + return -ENOMEM; + memset(client, 0, sizeof(struct i2c_client)); + client->addr = address; + client->adapter = adapter; + client->driver = &i2c_driver_tveeprom; + client->flags = I2C_CLIENT_ALLOW_USE; + snprintf(client->name, sizeof(client->name), "tveeprom"); + return 0; +} + +static int +tveeprom_attach_adapter (struct i2c_adapter *adapter) +{ + if (adapter->id != (I2C_ALGO_BIT | I2C_HW_B_BT848)) + return 0; + return i2c_probe(adapter, &addr_data, tveeprom_detect_client); +} + +static int +tveeprom_detach_client (struct i2c_client *client) +{ + int err; + + err = i2c_detach_client(client); + if (err) + return err; + + kfree(client); + return 0; +} + +struct i2c_driver i2c_driver_tveeprom = { + .owner = THIS_MODULE, + .name = "tveeprom", + .id = I2C_DRIVERID_TVEEPROM, + .flags = I2C_DF_NOTIFY, + .attach_adapter = tveeprom_attach_adapter, + .detach_client = tveeprom_detach_client, + .command = tveeprom_command, +}; + +static int __init tveeprom_init(void) +{ + return i2c_add_driver(&i2c_driver_tveeprom); +} + +static void __exit tveeprom_exit(void) +{ + i2c_del_driver(&i2c_driver_tveeprom); +} + +module_init(tveeprom_init); +module_exit(tveeprom_exit); + /* * Local variables: * c-basic-offset: 8 |