提交 cab462f7 编写于 作者: M Mauro Carvalho Chehab 提交者: Mauro Carvalho Chehab

V4L/DVB (3307): Some cleanups at I2C modules

- i2c names shorten
- removed obsoleted flags on newer modules
- small cleanups
Signed-off-by: NMauro Carvalho Chehab <mchehab@brturbo.com.br>
上级 0680481c
......@@ -107,7 +107,7 @@ static struct i2c_algo_bit_data bttv_i2c_algo_bit_template = {
static struct i2c_adapter bttv_i2c_adap_sw_template = {
.owner = THIS_MODULE,
.class = I2C_CLASS_TV_ANALOG,
.name = "bt848",
.name = "bttv",
.id = I2C_HW_B_BT848,
.client_register = attach_inform,
};
......@@ -274,7 +274,7 @@ static struct i2c_algorithm bttv_algo = {
};
static struct i2c_adapter bttv_i2c_adap_hw_template = {
.owner = THIS_MODULE,
.owner = THIS_MODULE,
.class = I2C_CLASS_TV_ANALOG,
.name = "bt878",
.id = I2C_HW_B_BT848 /* FIXME */,
......
......@@ -939,9 +939,7 @@ static struct i2c_driver i2c_driver_cx25840 = {
.driver = {
.name = "cx25840",
},
.id = I2C_DRIVERID_CX25840,
.attach_adapter = cx25840_attach_adapter,
.detach_client = cx25840_detach_client,
.command = cx25840_command,
......
......@@ -20,6 +20,7 @@
#ifndef _CX25840_H_
#define _CX25840_H_
#include <linux/videodev2.h>
#include <linux/i2c.h>
......
......@@ -279,7 +279,7 @@ static int ir_probe(struct i2c_adapter *adap);
static struct i2c_driver driver = {
.driver = {
.name = "ir remote kbd driver",
.name = "ir-kbd-i2c",
},
.id = I2C_DRIVERID_INFRARED,
.attach_adapter = ir_probe,
......
......@@ -106,10 +106,8 @@ MODULE_PARM_DESC(dolby, "Activates Dolby processsing");
/* Addresses to scan */
static unsigned short normal_i2c[] = { 0x80 >> 1, 0x88 >> 1, I2C_CLIENT_END };
I2C_CLIENT_INSMOD;
/* ----------------------------------------------------------------------- */
/* functions for talking to the MSP3400C Sound processor */
......@@ -975,7 +973,6 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver;
client->flags = I2C_CLIENT_ALLOW_USE;
snprintf(client->name, sizeof(client->name) - 1, "msp3400");
if (msp_reset(client) == -1) {
......@@ -1119,7 +1116,6 @@ static struct i2c_driver i2c_driver = {
.suspend = msp_suspend,
.resume = msp_resume,
},
.owner = THIS_MODULE,
};
static int __init msp3400_init_module(void)
......
......@@ -486,7 +486,7 @@ static int saa6588_command(struct i2c_client *client, unsigned int cmd,
static struct i2c_driver driver = {
.driver = {
.name = "i2c saa6588 driver",
.name = "saa6588",
},
.id = -1, /* FIXME */
.attach_adapter = saa6588_probe,
......
......@@ -567,9 +567,7 @@ static struct i2c_driver i2c_driver_saa711x = {
.driver = {
.name = "saa711x",
},
.id = I2C_DRIVERID_SAA711X,
.attach_adapter = saa711x_attach_adapter,
.detach_client = saa711x_detach_client,
.command = saa711x_command,
......
......@@ -9,7 +9,8 @@
#include <linux/poll.h>
#include <linux/i2c.h>
#include <linux/types.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include <linux/init.h>
#include <linux/crc32.h>
......@@ -509,7 +510,6 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind)
{
struct saa6752hs_state *h;
printk("saa6752hs: chip found @ 0x%x\n", addr<<1);
if (NULL == (h = kmalloc(sizeof(*h), GFP_KERNEL)))
return -ENOMEM;
......@@ -525,6 +525,8 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind)
i2c_set_clientdata(&h->client, h);
i2c_attach_client(&h->client);
v4l_info(&h->client,"saa6752hs: chip found @ 0x%x\n", addr<<1);
return 0;
}
......@@ -598,7 +600,7 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg)
static struct i2c_driver driver = {
.driver = {
.name = "i2c saa6752hs MPEG encoder",
.name = "saa6752hs",
},
.id = I2C_DRIVERID_SAA6752HS,
.attach_adapter = saa6752hs_probe,
......
......@@ -341,8 +341,8 @@ static int tda7432_command(struct i2c_client *client,
{
struct tda7432 *t = i2c_get_clientdata(client);
v4l_dbg(2,client,"In tda7432_command\n");
if (debug>1)
v4l_i2c_print_ioctl(client,cmd);
if (debug>1)
v4l_i2c_print_ioctl(client,cmd);
switch (cmd) {
/* --- v4l ioctls --- */
......@@ -489,7 +489,7 @@ static int tda7432_command(struct i2c_client *client,
static struct i2c_driver driver = {
.driver = {
.name = "i2c tda7432 driver",
.name = "tda7432",
},
.id = I2C_DRIVERID_TDA7432,
.attach_adapter = tda7432_probe,
......
......@@ -368,7 +368,7 @@ static int tda9875_command(struct i2c_client *client,
static struct i2c_driver driver = {
.driver = {
.name = "i2c tda9875 driver",
.name = "tda9875",
},
.id = I2C_DRIVERID_TDA9875,
.attach_adapter = tda9875_probe,
......
......@@ -882,7 +882,7 @@ static struct i2c_driver driver = {
.detach_client = tda9887_detach,
.command = tda9887_command,
.driver = {
.name = "i2c tda9887 driver",
.name = "tda9887",
.suspend = tda9887_suspend,
.resume = tda9887_resume,
},
......
......@@ -805,10 +805,10 @@ static struct i2c_driver driver = {
.detach_client = tuner_detach,
.command = tuner_command,
.driver = {
.name = "tuner",
.suspend = tuner_suspend,
.resume = tuner_resume,
},
.name = "tuner",
.suspend = tuner_suspend,
.resume = tuner_resume,
},
};
static struct i2c_client client_template = {
.name = "(tuner unset)",
......
......@@ -1744,10 +1744,9 @@ static int chip_command(struct i2c_client *client,
return 0;
}
static struct i2c_driver driver = {
.driver = {
.name = "generic i2c audio driver",
.name = "tvaudio",
},
.id = I2C_DRIVERID_TVAUDIO,
.attach_adapter = chip_probe,
......
......@@ -227,13 +227,9 @@ static int tvmixer_release(struct inode *inode, struct file *file)
}
static struct i2c_driver driver = {
#ifdef I2C_PEC
.driver = {
.name = "tv card mixer driver",
.name = "tvmixer",
},
#else
.name = "tv card mixer driver",
#endif
.id = I2C_DRIVERID_TVMIXER,
.detach_adapter = tvmixer_adapters,
.attach_adapter = tvmixer_adapters,
......
......@@ -30,14 +30,15 @@ module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0-1)");
#define tvp5150_info(fmt, arg...) do { \
printk(KERN_INFO "%s %d-%04x: " fmt, c->driver->name, \
printk(KERN_INFO "%s %d-%04x: " fmt, c->driver->driver.name, \
i2c_adapter_id(c->adapter), c->addr , ## arg); } while (0)
#define tvp5150_dbg(num, fmt, arg...) \
do { \
if (debug >= num) \
printk(KERN_DEBUG "%s debug %d-%04x: " fmt, c->driver->name, \
i2c_adapter_id(c->adapter), c->addr , ## arg); \
} while (0)
printk(KERN_DEBUG "%s debug %d-%04x: " fmt,\
c->driver->driver.name, \
i2c_adapter_id(c->adapter), \
c->addr , ## arg); } while (0)
/* supported controls */
static struct v4l2_queryctrl tvp5150_qctrl[] = {
......@@ -1137,9 +1138,7 @@ static struct i2c_driver driver = {
.driver = {
.name = "tvp5150",
},
/* FIXME */
.id = I2C_DRIVERID_SAA7110,
.id = I2C_DRIVERID_TVP5150,
.attach_adapter = tvp5150_attach_adapter,
.detach_client = tvp5150_detach_client,
......
......@@ -237,12 +237,10 @@ static struct i2c_driver i2c_driver = {
.driver = {
.name = "wm8775",
},
.id = I2C_DRIVERID_WM8775,
.id = I2C_DRIVERID_WM8775,
.attach_adapter = wm8775_probe,
.detach_client = wm8775_detach,
.command = wm8775_command,
.detach_client = wm8775_detach,
.command = wm8775_command,
};
......
......@@ -214,7 +214,6 @@ extern int tea5767_autodetection(struct i2c_client *c);
#define tuner_warn(fmt, arg...) do {\
printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
#define tuner_info(fmt, arg...) do {\
printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
......
......@@ -34,7 +34,7 @@
#define v4l_printk(level, name, adapter, addr, fmt, arg...) \
printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg)
#define v4l_client_printk(level, client, fmt, arg...) \
#define v4l_client_printk(level, client, fmt, arg...) \
v4l_printk(level, (client)->driver->driver.name, (client)->adapter, \
(client)->addr, fmt , ## arg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册