aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-i2c.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 10:09:14 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 10:09:14 -0700
commitb94d10e7f6fce9af7d5054845511a00575c4b4f5 (patch)
tree8be617e5d9cfc8a1fe232ac2b6454caec7ca466a /drivers/media/video/cx23885/cx23885-i2c.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse (diff)
parentV4L/DVB (11316): saa7191: tuner ops wasn't set. (diff)
downloadlinux-dev-b94d10e7f6fce9af7d5054845511a00575c4b4f5.tar.xz
linux-dev-b94d10e7f6fce9af7d5054845511a00575c4b4f5.zip
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (707 commits) V4L/DVB (11316): saa7191: tuner ops wasn't set. V4L/DVB (11315): cx25840: fix 'unused variable' warning. V4L/DVB (11314): au8522: remove unused I2C_DRIVERID V4L/DVB (11313): v4l2-subdev: add enum_framesizes and enum_frameintervals. V4L/DVB (11312): tuner: remove V4L1 code from this driver. V4L/DVB (11311): v4l: replace 'ioctl' references in v4l i2c drivers V4L/DVB (11310): cx18: remove intermediate 'ioctl' step V4L/DVB (11309): cx25840: cleanup: remove intermediate 'ioctl' step V4L/DVB (11308): msp3400: use the V4L2 header since no V4L1 code is there V4L/DVB (11305): cx88: prevent probing rtc and ir devices V4L/DVB (11304): v4l2: remove v4l2_subdev_command calls where they are no longer needed. V4L/DVB (11303): tda7432: remove legacy code for old-style i2c API V4L/DVB (11302): tda9875: remove legacy code for old-style i2c API V4L/DVB (11301): wm8775: remove legacy code for old-style i2c API V4L/DVB (11300): cx88: convert to v4l2_subdev. V4L/DVB (11298): cx25840: remove legacy code for old-style i2c API V4L/DVB (11297): cx23885: convert to v4l2_subdev. V4L/DVB (11296): cx23885: bugfix error message if firmware is not found V4L/DVB (11295): cx23885: convert to v4l2_device. V4L/DVB (11293): uvcvideo: Add zero fill for VIDIOC_ENUM_FMT ...
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-i2c.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-i2c.c68
1 files changed, 5 insertions, 63 deletions
diff --git a/drivers/media/video/cx23885/cx23885-i2c.c b/drivers/media/video/cx23885/cx23885-i2c.c
index bb7f71a1fcbe..3421bd12056a 100644
--- a/drivers/media/video/cx23885/cx23885-i2c.c
+++ b/drivers/media/video/cx23885/cx23885-i2c.c
@@ -268,64 +268,6 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap,
return retval;
}
-static int attach_inform(struct i2c_client *client)
-{
- struct cx23885_i2c *bus = i2c_get_adapdata(client->adapter);
- struct cx23885_dev *dev = bus->dev;
- struct tuner_setup tun_setup;
-
- dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n",
- client->driver->driver.name, client->addr, client->name);
-
- if (!client->driver->command)
- return 0;
-
- if (dev->tuner_type != UNSET) {
-
- dprintk(1, "%s (tuner) i2c attach [addr=0x%x,client=%s]\n",
- client->driver->driver.name, client->addr,
- client->name);
-
- if ((dev->tuner_addr == ADDR_UNSET) ||
- (dev->tuner_addr == client->addr)) {
-
- dprintk(1, "%s (tuner || addr UNSET)\n",
- client->driver->driver.name);
-
- dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n",
- client->driver->driver.name,
- client->addr, client->name);
-
- tun_setup.mode_mask = T_ANALOG_TV;
- tun_setup.type = dev->tuner_type;
- tun_setup.addr = dev->tuner_addr;
-
- client->driver->command(client, TUNER_SET_TYPE_ADDR,
- &tun_setup);
- }
- }
-
- return 0;
-}
-
-static int detach_inform(struct i2c_client *client)
-{
- struct cx23885_dev *dev = i2c_get_adapdata(client->adapter);
-
- dprintk(1, "i2c detach [client=%s]\n", client->name);
-
- return 0;
-}
-
-void cx23885_call_i2c_clients(struct cx23885_i2c *bus,
- unsigned int cmd, void *arg)
-{
- if (bus->i2c_rc != 0)
- return;
-
- i2c_clients_command(&bus->i2c_adap, cmd, arg);
-}
-
static u32 cx23885_functionality(struct i2c_adapter *adap)
{
return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C;
@@ -343,9 +285,6 @@ static struct i2c_adapter cx23885_i2c_adap_template = {
.owner = THIS_MODULE,
.id = I2C_HW_B_CX23885,
.algo = &cx23885_i2c_algo_template,
- .class = I2C_CLASS_TV_ANALOG,
- .client_register = attach_inform,
- .client_unregister = detach_inform,
};
static struct i2c_client cx23885_i2c_client_template = {
@@ -402,15 +341,18 @@ int cx23885_i2c_register(struct cx23885_i2c *bus)
bus->i2c_algo.data = bus;
bus->i2c_adap.algo_data = bus;
- i2c_set_adapdata(&bus->i2c_adap, bus);
+ i2c_set_adapdata(&bus->i2c_adap, &dev->v4l2_dev);
i2c_add_adapter(&bus->i2c_adap);
bus->i2c_client.adapter = &bus->i2c_adap;
if (0 == bus->i2c_rc) {
dprintk(1, "%s: i2c bus %d registered\n", dev->name, bus->nr);
- if (i2c_scan)
+ if (i2c_scan) {
+ printk(KERN_INFO "%s: scan bus %d:\n",
+ dev->name, bus->nr);
do_i2c_scan(dev->name, &bus->i2c_client);
+ }
} else
printk(KERN_WARNING "%s: i2c bus %d register FAILED\n",
dev->name, bus->nr);