V4L/DVB (3307): Some cleanups at I2C modules
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>
Mon, 9 Jan 2006 17:53:26 +0000 (15:53 -0200)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 9 Jan 2006 17:53:26 +0000 (15:53 -0200)
- i2c names shorten
- removed obsoleted flags on newer modules
- small cleanups

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
18 files changed:
drivers/media/video/bttv-i2c.c
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/cx25840/cx25840.h
drivers/media/video/ir-kbd-i2c.c
drivers/media/video/msp3400-driver.c
drivers/media/video/saa6588.c
drivers/media/video/saa711x.c
drivers/media/video/saa7134/saa6752hs.c
drivers/media/video/tda7432.c
drivers/media/video/tda9875.c
drivers/media/video/tda9887.c
drivers/media/video/tuner-core.c
drivers/media/video/tvaudio.c
drivers/media/video/tvmixer.c
drivers/media/video/tvp5150.c
drivers/media/video/wm8775.c
include/media/tuner.h
include/media/v4l2-common.h

index fd66d386fa7de85eb6f458441ffb6bfe06bb4171..748d630c7fe49b06c16635b992edbfba6cda7c3c 100644 (file)
@@ -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 */,
index 29b378b6097d6f546e338d9dbaca6c228ec05db8..d45237d508c45e868dafa4b3afef8103756ea72f 100644 (file)
@@ -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,
index 4260c3faa37aea2fe16f78d6b457dac273b99e54..fd22f30dcc1bf6ed1155b3f651bd0e2875f5b71d 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef _CX25840_H_
 #define _CX25840_H_
 
+
 #include <linux/videodev2.h>
 #include <linux/i2c.h>
 
index caa0f58d149ea7522b5060a95ee9350bd351e58b..58b0e698282206e0e028423d202be8c24d5db35c 100644 (file)
@@ -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,
index eece5fe46cbec02bb2ee12c964490c8d9e221823..fbd85120c331e099d715a5cad07c4dd23620c786 100644 (file)
@@ -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)
index ad582bd39819ceb4b148bbf27da0baa53adcf81e..e70b17ef36e9d0938d7b805f51527c0d8edd6f82 100644 (file)
@@ -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,
index 8008537391b5425ed3ce71c92cf3267cc6a2b580..f39a7be08588010fe5c29393793f2e576c5cbf1c 100644 (file)
@@ -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,
index 4615a982ac64c8470544611f8854ddd50b39c405..ad73c4a60f2b2078f788d2d45aed9502bd065441 100644 (file)
@@ -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,
index c6efc9826ba59e4eac105f2e9c793f1354d671c2..99261f15e66ebebdb15a3ea9921ff1029188d291 100644 (file)
@@ -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,
index 760ec3c2ac67ea56722632d78ce65f502b5052bd..299393bf900a38c7fd67754a8845a8be102f070e 100644 (file)
@@ -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,
index f64baa4b00253721caa62774de59b9799c7f3710..9cf47dc65579c28acc2b9fcf4224593884484745 100644 (file)
@@ -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,
        },
index a727c3ae62c358dd8b3d15af81e5553fd0fbde27..57bc585a6955c135dfad3c37fefd0f4eaf58c79c 100644 (file)
@@ -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)",
index 9f6b6d855f00722e16800dcabf51649b13f0de75..b582943a0d3e57406f9d3ed1434c20f26586b873 100644 (file)
@@ -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,
index ce0da9c1a768b0eea920e97faf9e9968ab2cbb78..9e86caeb96a7b530da89b05e18a0cb44d53d7865 100644 (file)
@@ -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,
index 07ad675cd58e3f2e855f7ef2ab1a8e14ca870e0f..c35b8042eee58dd84bd7080a28801762bb36c4c9 100644 (file)
@@ -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,
index 20b4ec93d7c982202bb8655fd6eb6f319cd7e9fa..c2e6d2e9f5f12ad70bcd52c6421debeef62dda25 100644 (file)
@@ -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,
 };
 
 
index 584f3ab1fcf71c3a31bca7bb426db8855e82829d..7674b121ce8bb4c4005f601ea867d4584b0f24c5 100644 (file)
@@ -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)
index 51cdca8365c9c93d3a4512c1aa8332ee98700463..3cc3132f391ec967839f39ff8423f1d8502b2b6b 100644 (file)
@@ -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)