Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56fc08ca authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Linus Torvalds
Browse files

[PATCH] v4l: update for tuner cards and some V4L chips



Tuner improvements and additions.  TEA5767 FM tuner added.  Several small
fixes.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: default avatarNickolay V Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b45009b0
Loading
Loading
Loading
Loading
+26 −13
Original line number Diff line number Diff line
/*
 * $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 ...
@@ -131,10 +131,10 @@ 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,
@@ -142,7 +142,7 @@ IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {
	[  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,
@@ -150,17 +150,17 @@ IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {
	[ 46 ] = KEY_BLUE,
	[ 24 ] = KEY_KPPLUS,    //fine tune +
	[ 25 ] = KEY_KPMINUS,   //fine tune -
	[ 42 ] = KEY_ANGLE,     //picture in picture
//      [ 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);

@@ -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
@@ -412,3 +424,4 @@ EXPORT_SYMBOL_GPL(ir_decode_biphase);
 * c-basic-offset: 8
 * End:
 */
+30 −20
Original line number Diff line number Diff line
@@ -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;

/* ---------------------------------------------------------------------- */
@@ -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;

@@ -184,7 +183,7 @@ 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)) {
@@ -197,14 +196,19 @@ static int bt832_attach(struct i2c_adapter *adap, int addr,

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);
@@ -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);

@@ -249,19 +253,18 @@ static struct i2c_driver driver = {
};
static struct i2c_client client_template =
{
        .name   = "bt832",
	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);
}
@@ -269,3 +272,10 @@ static void bt832_cleanup_module(void)
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:
 */
+5 −8
Original line number Diff line number Diff line
@@ -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;

/* ----------------------------------------------------------------------- */
@@ -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) {
@@ -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;
}

@@ -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);
@@ -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);

+4 −0
Original line number Diff line number Diff line
/*
 * $Id: msp3400.h,v 1.3 2005/06/12 04:19:19 mchehab Exp $
 */

#ifndef MSP3400_H
#define MSP3400_H

+1 −0
Original line number Diff line number Diff line
@@ -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 */
Loading