Skip to content

Commit

Permalink
[PATCH] v4l: update for tuner cards and some V4L chips
Browse files Browse the repository at this point in the history
Tuner improvements and additions.  TEA5767 FM tuner added.  Several small
fixes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Nickolay V Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Mauro Carvalho Chehab authored and Linus Torvalds committed Jun 24, 2005
1 parent b45009b commit 56fc08c
Show file tree
Hide file tree
Showing 16 changed files with 333 additions and 155 deletions.
39 changes: 26 additions & 13 deletions drivers/media/common/ir-common.c
@@ -1,5 +1,5 @@
/*
* $Id: ir-common.c,v 1.8 2005/02/22 12:28:40 kraxel Exp $
* $Id: ir-common.c,v 1.10 2005/05/22 19:23:39 nsh Exp $
*
* some common structs and functions to handle infrared remotes via
* input layer ...
Expand Down Expand Up @@ -131,36 +131,36 @@ IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {
[ 18 ] = KEY_KP0,

[ 0 ] = KEY_POWER,
[ 27 ] = KEY_LANGUAGE, //MTS button
// [ 27 ] = MTS button
[ 2 ] = KEY_TUNER, // TV/FM
[ 30 ] = KEY_VIDEO,
[ 22 ] = KEY_INFO, //display button
// [ 22 ] = display button
[ 4 ] = KEY_VOLUMEUP,
[ 8 ] = KEY_VOLUMEDOWN,
[ 12 ] = KEY_CHANNELUP,
[ 16 ] = KEY_CHANNELDOWN,
[ 3 ] = KEY_ZOOM, // fullscreen
[ 31 ] = KEY_SUBTITLE, // closed caption/teletext
[ 32 ] = KEY_SLEEP,
[ 41 ] = KEY_SEARCH, //boss key
// [ 41 ] = boss key
[ 20 ] = KEY_MUTE,
[ 43 ] = KEY_RED,
[ 44 ] = KEY_GREEN,
[ 45 ] = KEY_YELLOW,
[ 46 ] = KEY_BLUE,
[ 24 ] = KEY_KPPLUS, //fine tune +
[ 25 ] = KEY_KPMINUS, //fine tune -
[ 42 ] = KEY_ANGLE, //picture in picture
[ 33 ] = KEY_KPDOT,
// [ 42 ] = picture in picture
[ 33 ] = KEY_KPDOT,
[ 19 ] = KEY_KPENTER,
[ 17 ] = KEY_AGAIN, //recall
// [ 17 ] = recall
[ 34 ] = KEY_BACK,
[ 35 ] = KEY_PLAYPAUSE,
[ 36 ] = KEY_NEXT,
[ 37 ] = KEY_T, //time shifting
// [ 37 ] = time shifting
[ 38 ] = KEY_STOP,
[ 39 ] = KEY_RECORD,
[ 40 ] = KEY_SHUFFLE //snapshot
[ 39 ] = KEY_RECORD
// [ 40 ] = snapshot
};
EXPORT_SYMBOL_GPL(ir_codes_winfast);

Expand All @@ -184,18 +184,30 @@ IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE] = {
[ 0x07 ] = KEY_KP7, // 7
[ 0x08 ] = KEY_KP8, // 8
[ 0x09 ] = KEY_KP9, // 9
[ 0x0a ] = KEY_TEXT, // keypad asterisk as well
[ 0x0b ] = KEY_RED, // red button
[ 0x0c ] = KEY_OPTION, // black key without text
[ 0x0c ] = KEY_RADIO, // radio
[ 0x0d ] = KEY_MENU, // menu
[ 0x0e ] = KEY_SUBTITLE, // also the # key
[ 0x0f ] = KEY_MUTE, // mute
[ 0x10 ] = KEY_VOLUMEUP, // volume +
[ 0x11 ] = KEY_VOLUMEDOWN, // volume -
[ 0x1e ] = KEY_NEXT, // skip >|
[ 0x12 ] = KEY_PREVIOUS, // previous channel
[ 0x14 ] = KEY_UP, // up
[ 0x15 ] = KEY_DOWN, // down
[ 0x16 ] = KEY_LEFT, // left
[ 0x17 ] = KEY_RIGHT, // right
[ 0x18 ] = KEY_VIDEO, // Videos
[ 0x19 ] = KEY_AUDIO, // Music
[ 0x1a ] = KEY_MHP, // Pictures - presume this means "Multimedia Home Platform"- no "PICTURES" key in input.h
[ 0x1b ] = KEY_EPG, // Guide
[ 0x1c ] = KEY_TV, // TV
[ 0x1e ] = KEY_NEXTSONG, // skip >|
[ 0x1f ] = KEY_EXIT, // back/exit
[ 0x20 ] = KEY_CHANNELUP, // channel / program +
[ 0x21 ] = KEY_CHANNELDOWN, // channel / program -
[ 0x22 ] = KEY_CHANNEL, // source (old black remote)
[ 0x24 ] = KEY_PREVIOUS, // replay |<
[ 0x24 ] = KEY_PREVIOUSSONG, // replay |<
[ 0x25 ] = KEY_ENTER, // OK
[ 0x26 ] = KEY_SLEEP, // minimize (old black remote)
[ 0x29 ] = KEY_BLUE, // blue key
Expand Down Expand Up @@ -412,3 +424,4 @@ EXPORT_SYMBOL_GPL(ir_decode_biphase);
* c-basic-offset: 8
* End:
*/

50 changes: 30 additions & 20 deletions drivers/media/video/bt832.c
Expand Up @@ -6,7 +6,7 @@
It outputs an 8-bit 4:2:2 YUV or YCrCb video signal which can be directly
connected to bt848/bt878 GPIO pins on this purpose.
(see: VLSI Vision Ltd. www.vvl.co.uk for camera datasheets)
Supported Cards:
- Pixelview Rev.4E: 0x8a
GPIO 0x400000 toggles Bt832 RESET, and the chip changes to i2c 0x88 !
Expand All @@ -31,16 +31,16 @@
#include <linux/errno.h>
#include <linux/slab.h>

#include "id.h"
#include "audiochip.h"
#include <media/audiochip.h>
#include <media/id.h>
#include "bttv.h"
#include "bt832.h"

MODULE_LICENSE("GPL");

/* Addresses to scan */
static unsigned short normal_i2c[] = { I2C_BT832_ALT1>>1, I2C_BT832_ALT2>>1,
I2C_CLIENT_END };
static unsigned short normal_i2c[] = {I2C_CLIENT_END};
static unsigned short normal_i2c_range[] = {I2C_BT832_ALT1>>1,I2C_BT832_ALT2>>1,I2C_CLIENT_END};
I2C_CLIENT_INSMOD;

/* ---------------------------------------------------------------------- */
Expand Down Expand Up @@ -95,7 +95,7 @@ int bt832_init(struct i2c_client *i2c_client_s)

buf=kmalloc(65,GFP_KERNEL);
bt832_hexdump(i2c_client_s,buf);

if(buf[0x40] != 0x31) {
printk("bt832: this i2c chip is no bt832 (id=%02x). Detaching.\n",buf[0x40]);
kfree(buf);
Expand Down Expand Up @@ -135,7 +135,7 @@ int bt832_init(struct i2c_client *i2c_client_s)
buf[1]= 0x27 & (~0x01); // Default | !skip
if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
printk("bt832: i2c i/o error EO: rc == %d (should be 2)\n",rc);

bt832_hexdump(i2c_client_s,buf);

#if 0
Expand Down Expand Up @@ -168,8 +168,7 @@ int bt832_init(struct i2c_client *i2c_client_s)



static int bt832_attach(struct i2c_adapter *adap, int addr,
unsigned short flags, int kind)
static int bt832_attach(struct i2c_adapter *adap, int addr, int kind)
{
struct bt832 *t;

Expand All @@ -184,27 +183,32 @@ static int bt832_attach(struct i2c_adapter *adap, int addr,
return -ENOMEM;
memset(t,0,sizeof(*t));
t->client = client_template;
t->client.data = t;
i2c_set_clientdata(&t->client, t);
i2c_attach_client(&t->client);

if(! bt832_init(&t->client)) {
bt832_detach(&t->client);
return -1;
}

return 0;
}

static int bt832_probe(struct i2c_adapter *adap)
{
#ifdef I2C_CLASS_TV_ANALOG
if (adap->class & I2C_CLASS_TV_ANALOG)
return i2c_probe(adap, &addr_data, bt832_attach);
#else
if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848))
return i2c_probe(adap, &addr_data, bt832_attach);
#endif
return 0;
}

static int bt832_detach(struct i2c_client *client)
{
struct bt832 *t = (struct bt832*)client->data;
struct bt832 *t = i2c_get_clientdata(client);

printk("bt832: detach.\n");
i2c_detach_client(client);
Expand All @@ -215,7 +219,7 @@ static int bt832_detach(struct i2c_client *client)
static int
bt832_command(struct i2c_client *client, unsigned int cmd, void *arg)
{
struct bt832 *t = (struct bt832*)client->data;
struct bt832 *t = i2c_get_clientdata(client);

printk("bt832: command %x\n",cmd);

Expand Down Expand Up @@ -249,23 +253,29 @@ static struct i2c_driver driver = {
};
static struct i2c_client client_template =
{
.name = "bt832",
.flags = I2C_CLIENT_ALLOW_USE,
.driver = &driver,
I2C_DEVNAME("bt832"),
.flags = I2C_CLIENT_ALLOW_USE,
.driver = &driver,
};


int bt832_init_module(void)
static int __init bt832_init_module(void)
{
i2c_add_driver(&driver);
return 0;
return i2c_add_driver(&driver);
}

static void bt832_cleanup_module(void)
static void __exit bt832_cleanup_module(void)
{
i2c_del_driver(&driver);
}

module_init(bt832_init_module);
module_exit(bt832_cleanup_module);

/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* ---------------------------------------------------------------------------
* Local variables:
* c-basic-offset: 8
* End:
*/
36 changes: 18 additions & 18 deletions drivers/media/video/bt832.h
@@ -1,6 +1,6 @@
/* Bt832 CMOS Camera Video Processor (VP)
The Bt832 CMOS Camera Video Processor chip connects a Quartsight CMOS
The Bt832 CMOS Camera Video Processor chip connects a Quartsight CMOS
color digital camera directly to video capture devices via an 8-bit,
4:2:2 YUV or YCrCb video interface.
Expand Down Expand Up @@ -85,7 +85,7 @@
#define BT832_DEVICE_ID 63
# define BT832_DEVICE_ID__31 0x31 // Bt832 has ID 0x31

/* STMicroelectronivcs VV5404 camera module
/* STMicroelectronivcs VV5404 camera module
i2c: 0x20: sensor address
i2c: 0xa0: eeprom for ccd defect map
*/
Expand Down Expand Up @@ -256,26 +256,26 @@ For the CCIR-601 standards, the sampling is based on a static orthogonal samplin
//===========================================================================
// Timing generator SRAM table values for CCIR601 720x480 NTSC
//===========================================================================
// For NTSC CCIR656
// For NTSC CCIR656
BYTE BtCard::SRAMTable_NTSC[] =
{
// SRAM Timing Table for NTSC
0x0c, 0xc0, 0x00,
0x00, 0x90, 0xc2,
0x03, 0x10, 0x03,
0x06, 0x10, 0x34,
0x12, 0x12, 0x65,
0x02, 0x13, 0x24,
0x19, 0x00, 0x24,
0x39, 0x00, 0x96,
0x59, 0x08, 0x93,
0x0c, 0xc0, 0x00,
0x00, 0x90, 0xc2,
0x03, 0x10, 0x03,
0x06, 0x10, 0x34,
0x12, 0x12, 0x65,
0x02, 0x13, 0x24,
0x19, 0x00, 0x24,
0x39, 0x00, 0x96,
0x59, 0x08, 0x93,
0x83, 0x08, 0x97,
0x03, 0x50, 0x30,
0xc0, 0x40, 0x30,
0x86, 0x01, 0x01,
0xa6, 0x0d, 0x62,
0x03, 0x11, 0x61,
0x05, 0x37, 0x30,
0x03, 0x50, 0x30,
0xc0, 0x40, 0x30,
0x86, 0x01, 0x01,
0xa6, 0x0d, 0x62,
0x03, 0x11, 0x61,
0x05, 0x37, 0x30,
0xac, 0x21, 0x50
};
Expand Down
13 changes: 5 additions & 8 deletions drivers/media/video/msp3400.c
Expand Up @@ -147,6 +147,7 @@ static unsigned short normal_i2c[] = {
I2C_MSP3400C_ALT >> 1,
I2C_CLIENT_END
};
static unsigned short normal_i2c_range[] = {I2C_CLIENT_END,I2C_CLIENT_END};
I2C_CLIENT_INSMOD;

/* ----------------------------------------------------------------------- */
Expand Down Expand Up @@ -735,7 +736,6 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout)
{
DECLARE_WAITQUEUE(wait, current);

again:
add_wait_queue(&msp->wq, &wait);
if (!kthread_should_stop()) {
if (timeout < 0) {
Expand All @@ -751,12 +751,9 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout)
#endif
}
}

if (current->flags & PF_FREEZE)
refrigerator(PF_FREEZE);
remove_wait_queue(&msp->wq, &wait);

if (try_to_freeze(PF_FREEZE))
goto again;

return msp->restart;
}

Expand Down Expand Up @@ -1436,7 +1433,7 @@ static int msp_detach(struct i2c_client *client);
static int msp_probe(struct i2c_adapter *adap);
static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg);

static int msp_suspend(struct device * dev, pm_message_t state, u32 level);
static int msp_suspend(struct device * dev, u32 state, u32 level);
static int msp_resume(struct device * dev, u32 level);

static void msp_wake_thread(struct i2c_client *client);
Expand Down Expand Up @@ -1841,7 +1838,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
return 0;
}

static int msp_suspend(struct device * dev, pm_message_t state, u32 level)
static int msp_suspend(struct device * dev, u32 state, u32 level)
{
struct i2c_client *c = container_of(dev, struct i2c_client, dev);

Expand Down
4 changes: 4 additions & 0 deletions drivers/media/video/msp3400.h
@@ -1,3 +1,7 @@
/*
* $Id: msp3400.h,v 1.3 2005/06/12 04:19:19 mchehab Exp $
*/

#ifndef MSP3400_H
#define MSP3400_H

Expand Down
1 change: 1 addition & 0 deletions drivers/media/video/tda7432.c
Expand Up @@ -74,6 +74,7 @@ static unsigned short normal_i2c[] = {
I2C_TDA7432 >> 1,
I2C_CLIENT_END,
};
static unsigned short normal_i2c_range[] = { I2C_CLIENT_END, I2C_CLIENT_END };
I2C_CLIENT_INSMOD;

/* Structure of address and subaddresses for the tda7432 */
Expand Down
1 change: 1 addition & 0 deletions drivers/media/video/tda9875.c
Expand Up @@ -44,6 +44,7 @@ static unsigned short normal_i2c[] = {
I2C_TDA9875 >> 1,
I2C_CLIENT_END
};
static unsigned short normal_i2c_range[] = {I2C_CLIENT_END};
I2C_CLIENT_INSMOD;

/* This is a superset of the TDA9875 */
Expand Down

0 comments on commit 56fc08c

Please sign in to comment.