From 72c851b00f6c86353c54fdd9f1ef88d82e8df6c5 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 6 Aug 2010 10:53:19 -0300 Subject: V4L/DVB: cx25840/ivtv: replace ugly priv control with s_config The cx25840 used a private control CX25840_CID_ENABLE_PVR150_WORKAROUND to be told whether to enable a workaround for certain pvr150 cards. This is really config data that it needs to get at load time. Implemented this in cx25840 and ivtv. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/ivtv/ivtv-driver.c | 9 +-------- drivers/media/video/ivtv/ivtv-i2c.c | 7 +++++++ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/media/video/ivtv') diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index 07c5c18..f72e9d1 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c @@ -1269,15 +1269,8 @@ int ivtv_init_on_first_open(struct ivtv *itv) IVTV_DEBUG_INFO("Getting firmware version..\n"); ivtv_firmware_versions(itv); - if (itv->card->hw_all & IVTV_HW_CX25840) { - struct v4l2_control ctrl; - + if (itv->card->hw_all & IVTV_HW_CX25840) v4l2_subdev_call(itv->sd_video, core, load_fw); - /* CX25840_CID_ENABLE_PVR150_WORKAROUND */ - ctrl.id = V4L2_CID_PRIVATE_BASE; - ctrl.value = itv->pvr150_workaround; - v4l2_subdev_call(itv->sd_video, core, s_ctrl, &ctrl); - } vf.tuner = 0; vf.type = V4L2_TUNER_ANALOG_TV; diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c index a5b92d1..d391bbd 100644 --- a/drivers/media/video/ivtv/ivtv-i2c.c +++ b/drivers/media/video/ivtv/ivtv-i2c.c @@ -63,6 +63,7 @@ #include "ivtv-cards.h" #include "ivtv-gpio.h" #include "ivtv-i2c.h" +#include /* i2c implementation for cx23415/6 chip, ivtv project. * Author: Kevin Thayer (nufan_wfk at yahoo.com) @@ -292,6 +293,12 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx) if (hw == IVTV_HW_UPD64031A || hw == IVTV_HW_UPD6408X) { sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, mod, type, 0, I2C_ADDRS(hw_addrs[idx])); + } else if (hw == IVTV_HW_CX25840) { + struct cx25840_platform_data pdata; + + pdata.pvr150_workaround = itv->pvr150_workaround; + sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev, + adap, mod, type, 0, &pdata, hw_addrs[idx], NULL); } else { sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, mod, type, hw_addrs[idx], NULL); -- cgit v1.1