Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208192
b: refs/heads/master
c: 72c851b
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Aug 9, 2010
1 parent 0456831 commit a53ea77
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 25 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: 59b8311a9b4cdd3e11d1c7d434bb9abf1ae3bc5c
refs/heads/master: 72c851b00f6c86353c54fdd9f1ef88d82e8df6c5
23 changes: 15 additions & 8 deletions trunk/drivers/media/video/cx25840/cx25840-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,11 +1127,6 @@ static int cx25840_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
struct i2c_client *client = v4l2_get_subdevdata(sd);

switch (ctrl->id) {
case CX25840_CID_ENABLE_PVR150_WORKAROUND:
state->pvr150_workaround = ctrl->value;
set_input(client, state->vid_input, state->aud_input);
break;

case V4L2_CID_BRIGHTNESS:
if (ctrl->value < 0 || ctrl->value > 255) {
v4l_err(client, "invalid brightness setting %d\n",
Expand Down Expand Up @@ -1194,9 +1189,6 @@ static int cx25840_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
struct i2c_client *client = v4l2_get_subdevdata(sd);

switch (ctrl->id) {
case CX25840_CID_ENABLE_PVR150_WORKAROUND:
ctrl->value = state->pvr150_workaround;
break;
case V4L2_CID_BRIGHTNESS:
ctrl->value = (s8)cx25840_read(client, 0x414) + 128;
break;
Expand Down Expand Up @@ -1792,6 +1784,20 @@ static int cx25840_log_status(struct v4l2_subdev *sd)
return 0;
}

static int cx25840_s_config(struct v4l2_subdev *sd, int irq, void *platform_data)
{
struct cx25840_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);

if (platform_data) {
struct cx25840_platform_data *pdata = platform_data;

state->pvr150_workaround = pdata->pvr150_workaround;
set_input(client, state->vid_input, state->aud_input);
}
return 0;
}

static int cx23885_irq_handler(struct v4l2_subdev *sd, u32 status,
bool *handled)
{
Expand Down Expand Up @@ -1879,6 +1885,7 @@ static int cx25840_irq_handler(struct v4l2_subdev *sd, u32 status,

static const struct v4l2_subdev_core_ops cx25840_core_ops = {
.log_status = cx25840_log_status,
.s_config = cx25840_s_config,
.g_chip_ident = cx25840_g_chip_ident,
.g_ctrl = cx25840_g_ctrl,
.s_ctrl = cx25840_s_ctrl,
Expand Down
8 changes: 0 additions & 8 deletions trunk/drivers/media/video/cx25840/cx25840-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@
#include <media/v4l2-chip-ident.h>
#include <linux/i2c.h>

/* ENABLE_PVR150_WORKAROUND activates a workaround for a hardware bug that is
present in Hauppauge PVR-150 (and possibly PVR-500) cards that have
certain NTSC tuners (tveeprom tuner model numbers 85, 99 and 112). The
audio autodetect fails on some channels for these models and the workaround
is to select the audio standard explicitly. Many thanks to Hauppauge for
providing this information. */
#define CX25840_CID_ENABLE_PVR150_WORKAROUND (V4L2_CID_PRIVATE_BASE+0)

struct cx25840_ir_state;

struct cx25840_state {
Expand Down
9 changes: 1 addition & 8 deletions trunk/drivers/media/video/ivtv/ivtv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/media/video/ivtv/ivtv-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include "ivtv-cards.h"
#include "ivtv-gpio.h"
#include "ivtv-i2c.h"
#include <media/cx25840.h>

/* i2c implementation for cx23415/6 chip, ivtv project.
* Author: Kevin Thayer (nufan_wfk at yahoo.com)
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 12 additions & 0 deletions trunk/include/media/cx25840.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,16 @@ enum cx23885_io_pad {
CX23885_PAD_IRQ_N,
CX23885_PAD_GPIO16,
};

/* pvr150_workaround activates a workaround for a hardware bug that is
present in Hauppauge PVR-150 (and possibly PVR-500) cards that have
certain NTSC tuners (tveeprom tuner model numbers 85, 99 and 112). The
audio autodetect fails on some channels for these models and the workaround
is to select the audio standard explicitly. Many thanks to Hauppauge for
providing this information.
This platform data only needs to be supplied by the ivtv driver. */
struct cx25840_platform_data {
int pvr150_workaround;
};

#endif

0 comments on commit a53ea77

Please sign in to comment.