Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138221
b: refs/heads/master
c: 2689d3d
h: refs/heads/master
i:
  138219: d418e16
v: v3
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 780fff3 commit 73f1961
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 51 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd27ade7a9195cb3b1f56df4d0ec39763830390b
refs/heads/master: 2689d3dcc6c75c0b4a05b66330db85df2c036d3e
3 changes: 2 additions & 1 deletion trunk/drivers/media/video/au0828/au0828-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ void au0828_card_setup(struct au0828_dev *dev)
tun_setup.type = dev->board.tuner_type;
tun_setup.addr = dev->board.tuner_addr;
tun_setup.tuner_callback = au0828_tuner_callback;
au0828_call_i2c_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup);
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr,
&tun_setup);
}
}

Expand Down
29 changes: 0 additions & 29 deletions trunk/drivers/media/video/au0828/au0828-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,33 +299,6 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap,
return retval;
}

static int attach_inform(struct i2c_client *client)
{
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;

return 0;
}

static int detach_inform(struct i2c_client *client)
{
dprintk(1, "i2c detach [client=%s]\n", client->name);

return 0;
}

void au0828_call_i2c_clients(struct au0828_dev *dev,
unsigned int cmd, void *arg)
{
if (dev->i2c_rc != 0)
return;

i2c_clients_command(&dev->i2c_adap, cmd, arg);
}

static u32 au0828_functionality(struct i2c_adapter *adap)
{
return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C;
Expand All @@ -343,8 +316,6 @@ static struct i2c_adapter au0828_i2c_adap_template = {
.owner = THIS_MODULE,
.id = I2C_HW_B_AU0828,
.algo = &au0828_i2c_algo_template,
.client_register = attach_inform,
.client_unregister = detach_inform,
};

static struct i2c_client au0828_i2c_client_template = {
Expand Down
32 changes: 14 additions & 18 deletions trunk/drivers/media/video/au0828/au0828-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
au0828_call_i2c_clients(dev, VIDIOC_QUERYCTRL, qc);
v4l2_device_call_all(&dev->v4l2_dev, 0, core, queryctrl, qc);
if (qc->type)
return 0;
else
Expand Down Expand Up @@ -1100,7 +1100,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * norm)
have to make the au0828 bridge adjust the size of its capture
buffer, which is currently hardcoded at 720x480 */

au0828_call_i2c_clients(dev, VIDIOC_S_STD, norm);
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_std, *norm);
return 0;
}

Expand Down Expand Up @@ -1182,7 +1182,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index)

route.input = AUVI_INPUT(index).vmux;
route.output = 0;
au0828_call_i2c_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route);
v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing, &route);

for (i = 0; i < AU0828_MAX_INPUT; i++) {
int enable = 0;
Expand All @@ -1206,8 +1206,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index)
}

route.input = AUVI_INPUT(index).amux;
au0828_call_i2c_clients(dev, VIDIOC_INT_S_AUDIO_ROUTING,
&route);
v4l2_device_call_all(&dev->v4l2_dev, 0, audio, s_routing, &route);
return 0;
}

Expand Down Expand Up @@ -1246,7 +1245,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;

au0828_call_i2c_clients(dev, VIDIOC_G_CTRL, ctrl);
v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_ctrl, ctrl);
return 0;

}
Expand All @@ -1256,7 +1255,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
au0828_call_i2c_clients(dev, VIDIOC_S_CTRL, ctrl);
v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_ctrl, ctrl);
return 0;
}

Expand All @@ -1269,8 +1268,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
return -EINVAL;

strcpy(t->name, "Auvitek tuner");

au0828_call_i2c_clients(dev, VIDIOC_G_TUNER, t);
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, g_tuner, t);
return 0;
}

Expand All @@ -1284,7 +1282,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
return -EINVAL;

t->type = V4L2_TUNER_ANALOG_TV;
au0828_call_i2c_clients(dev, VIDIOC_S_TUNER, t);
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_tuner, t);
dprintk(1, "VIDIOC_S_TUNER: signal = %x, afc = %x\n", t->signal,
t->afc);
return 0;
Expand Down Expand Up @@ -1315,7 +1313,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,

dev->ctrl_freq = freq->frequency;

au0828_call_i2c_clients(dev, VIDIOC_S_FREQUENCY, freq);
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, freq);

au0828_analog_stream_reset(dev);

Expand All @@ -1335,7 +1333,7 @@ static int vidioc_g_chip_ident(struct file *file, void *priv,
return 0;
}

au0828_call_i2c_clients(dev, VIDIOC_DBG_G_CHIP_IDENT, chip);
v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_chip_ident, chip);
if (chip->ident == V4L2_IDENT_NONE)
return -EINVAL;

Expand Down Expand Up @@ -1369,7 +1367,6 @@ static int vidioc_streamon(struct file *file, void *priv,
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
int b = V4L2_BUF_TYPE_VIDEO_CAPTURE;
int rc;

rc = check_dev(dev);
Expand All @@ -1378,7 +1375,7 @@ static int vidioc_streamon(struct file *file, void *priv,

if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
au0828_analog_stream_enable(dev);
au0828_call_i2c_clients(dev, VIDIOC_STREAMON, &b);
v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 1);
}

mutex_lock(&dev->lock);
Expand All @@ -1396,7 +1393,6 @@ static int vidioc_streamoff(struct file *file, void *priv,
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
int b = V4L2_BUF_TYPE_VIDEO_CAPTURE;
int i;
int ret;
int rc;
Expand All @@ -1411,7 +1407,7 @@ static int vidioc_streamoff(struct file *file, void *priv,
return -EINVAL;

if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
au0828_call_i2c_clients(dev, VIDIOC_STREAMOFF, &b);
v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 0);
ret = au0828_stream_interrupt(dev);
if (ret != 0)
return ret;
Expand Down Expand Up @@ -1439,7 +1435,7 @@ static int vidioc_g_register(struct file *file, void *priv,

switch (reg->match.type) {
case V4L2_CHIP_MATCH_I2C_DRIVER:
au0828_call_i2c_clients(dev, VIDIOC_DBG_G_REGISTER, reg);
v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_register, reg);
return 0;
default:
return -EINVAL;
Expand All @@ -1454,7 +1450,7 @@ static int vidioc_s_register(struct file *file, void *priv,

switch (reg->match.type) {
case V4L2_CHIP_MATCH_I2C_DRIVER:
au0828_call_i2c_clients(dev, VIDIOC_DBG_S_REGISTER, reg);
v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_register, reg);
return 0;
default:
return -EINVAL;
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/media/video/au0828/au0828.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@ extern void au0828_card_setup(struct au0828_dev *dev);
/* au0828-i2c.c */
extern int au0828_i2c_register(struct au0828_dev *dev);
extern int au0828_i2c_unregister(struct au0828_dev *dev);
extern void au0828_call_i2c_clients(struct au0828_dev *dev,
unsigned int cmd, void *arg);

/* ----------------------------------------------------------- */
/* au0828-video.c */
Expand Down

0 comments on commit 73f1961

Please sign in to comment.