From ee4b9dbb83c73c5408d7f479a501551a63ec57d3 Mon Sep 17 00:00:00 2001 From: Richard Röjfors Date: Tue, 2 Feb 2010 19:40:49 -0300 Subject: V4L/DVB: radio: add support for SAA7706H Car Radio DSP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initial support for the SAA7706H Car Radio DSP. It is a I2C device and currently the mute control is supported. When the device is unmuted it is brought out of reset and initiated using the proposed intialisation sequence. When muted the DSP is brought into reset state. [akpm@linux-foundation.org: include delay.h] Signed-off-by: Richard Röjfors Cc: Douglas Schilling Landgraf Cc: Hans Verkuil Cc: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-chip-ident.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/media/v4l2-chip-ident.h') diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 6cc107d198a..5341e3d931f 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h @@ -155,6 +155,9 @@ enum { /* module adv7343: just ident 7343 */ V4L2_IDENT_ADV7343 = 7343, + /* module saa7706h: just ident 7706 */ + V4L2_IDENT_SAA7706H = 7706, + /* module wm8739: just ident 8739 */ V4L2_IDENT_WM8739 = 8739, -- cgit v1.2.3-70-g09d2 From ff9118a516cd4d58f984dded2e39937395867a4b Mon Sep 17 00:00:00 2001 From: Santiago Nunez-Corrales Date: Fri, 18 Dec 2009 14:07:29 -0300 Subject: V4L/DVB: Support for TVP7002 in v4l2 definitions This patch provides required chip identification definitions within v4l2. Included only definitions for TVP7002. Signed-off-by: Santiago Nunez-Corrales Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-chip-ident.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/media/v4l2-chip-ident.h') diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 5341e3d931f..994e7ebd54c 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h @@ -134,6 +134,9 @@ enum { /* modules tef6862: just ident 6862 */ V4L2_IDENT_TEF6862 = 6862, + /* module tvp7002: just ident 7002 */ + V4L2_IDENT_TVP7002 = 7002, + /* module adv7170: just ident 7170 */ V4L2_IDENT_ADV7170 = 7170, -- cgit v1.2.3-70-g09d2 From 340dde817a4f68af79453ed295ca0e8de7232669 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 20 Feb 2010 08:07:51 -0300 Subject: V4L/DVB: saa7115: fix saa7111a support When the saa7111 driver was merged into saa7115 several bugs were introduced, in particular with the saa7111a support as is used in the mxb.c driver. This patch fixes the saa7111a support. This was tested with the mxb driver. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/mxb.c | 6 +++--- drivers/media/video/saa7115.c | 27 ++++++++++++++++----------- include/media/v4l2-chip-ident.h | 1 + 3 files changed, 20 insertions(+), 14 deletions(-) (limited to 'include/media/v4l2-chip-ident.h') diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c index 823f126b89c..9f01f14e4aa 100644 --- a/drivers/media/video/mxb.c +++ b/drivers/media/video/mxb.c @@ -298,7 +298,7 @@ static int mxb_init_done(struct saa7146_dev* dev) /* select tuner-output on saa7111a */ i = 0; saa7111a_call(mxb, video, s_routing, SAA7115_COMPOSITE0, - SAA7111_FMT_CCIR | SAA7111_VBI_BYPASS, 0); + SAA7111_FMT_CCIR, 0); /* select a tuner type */ tun_setup.mode_mask = T_ANALOG_TV; @@ -522,8 +522,8 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input) return err; /* switch video in saa7111a */ - if (saa7111a_call(mxb, video, s_routing, i, 0, 0)) - printk(KERN_ERR "VIDIOC_S_INPUT: could not address saa7111a #1.\n"); + if (saa7111a_call(mxb, video, s_routing, i, SAA7111_FMT_CCIR, 0)) + printk(KERN_ERR "VIDIOC_S_INPUT: could not address saa7111a.\n"); /* switch the audio-source only if necessary */ if (0 == mxb->cur_mute) diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 44873a016c2..c0a7f8a369f 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c @@ -104,6 +104,10 @@ static int saa711x_has_reg(const int id, const u8 reg) if (id == V4L2_IDENT_SAA7111) return reg < 0x20 && reg != 0x01 && reg != 0x0f && (reg < 0x13 || reg > 0x19) && reg != 0x1d && reg != 0x1e; + if (id == V4L2_IDENT_SAA7111A) + return reg < 0x20 && reg != 0x01 && reg != 0x0f && + reg != 0x14 && reg != 0x18 && reg != 0x19 && + reg != 0x1d && reg != 0x1e; /* common for saa7113/4/5/8 */ if (unlikely((reg >= 0x3b && reg <= 0x3f) || reg == 0x5c || reg == 0x5f || @@ -954,8 +958,7 @@ static void saa711x_set_v4lstd(struct v4l2_subdev *sd, v4l2_std_id std) 011 NTSC N (3.58MHz) PAL M (3.58MHz) 100 reserved NTSC-Japan (3.58MHz) */ - if (state->ident == V4L2_IDENT_SAA7111 || - state->ident == V4L2_IDENT_SAA7113) { + if (state->ident <= V4L2_IDENT_SAA7113) { u8 reg = saa711x_read(sd, R_0E_CHROMA_CNTL_1) & 0x8f; if (std == V4L2_STD_PAL_M) { @@ -1232,22 +1235,19 @@ static int saa711x_s_routing(struct v4l2_subdev *sd, u32 input, u32 output, u32 config) { struct saa711x_state *state = to_state(sd); - u8 mask = (state->ident == V4L2_IDENT_SAA7111) ? 0xf8 : 0xf0; + u8 mask = (state->ident <= V4L2_IDENT_SAA7111A) ? 0xf8 : 0xf0; v4l2_dbg(1, debug, sd, "decoder set input %d output %d\n", input, output); /* saa7111/3 does not have these inputs */ - if ((state->ident == V4L2_IDENT_SAA7113 || - state->ident == V4L2_IDENT_SAA7111) && + if (state->ident <= V4L2_IDENT_SAA7113 && (input == SAA7115_COMPOSITE4 || input == SAA7115_COMPOSITE5)) { return -EINVAL; } if (input > SAA7115_SVIDEO3) return -EINVAL; - if (output > SAA7115_IPORT_ON) - return -EINVAL; if (state->input == input && state->output == output) return 0; v4l2_dbg(1, debug, sd, "now setting %s input %s output\n", @@ -1256,7 +1256,7 @@ static int saa711x_s_routing(struct v4l2_subdev *sd, state->input = input; /* saa7111 has slightly different input numbering */ - if (state->ident == V4L2_IDENT_SAA7111) { + if (state->ident <= V4L2_IDENT_SAA7111A) { if (input >= SAA7115_COMPOSITE4) input -= 2; /* saa7111 specific */ @@ -1292,7 +1292,7 @@ static int saa711x_s_gpio(struct v4l2_subdev *sd, u32 val) { struct saa711x_state *state = to_state(sd); - if (state->ident != V4L2_IDENT_SAA7111) + if (state->ident > V4L2_IDENT_SAA7111A) return -EINVAL; saa711x_write(sd, 0x11, (saa711x_read(sd, 0x11) & 0x7f) | (val ? 0x80 : 0)); @@ -1596,6 +1596,10 @@ static int saa711x_probe(struct i2c_client *client, switch (chip_id) { case '1': state->ident = V4L2_IDENT_SAA7111; + if (saa711x_read(sd, R_00_CHIP_VERSION) & 0xf0) { + v4l_info(client, "saa7111a variant found\n"); + state->ident = V4L2_IDENT_SAA7111A; + } break; case '3': state->ident = V4L2_IDENT_SAA7113; @@ -1612,7 +1616,7 @@ static int saa711x_probe(struct i2c_client *client, default: state->ident = V4L2_IDENT_SAA7111; v4l2_info(sd, "WARNING: Chip is not known - Falling back to saa7111\n"); - + break; } state->audclk_freq = 48000; @@ -1623,6 +1627,7 @@ static int saa711x_probe(struct i2c_client *client, state->crystal_freq = SAA7115_FREQ_24_576_MHZ; switch (state->ident) { case V4L2_IDENT_SAA7111: + case V4L2_IDENT_SAA7111A: saa711x_writeregs(sd, saa7111_init); break; case V4L2_IDENT_SAA7113: @@ -1632,7 +1637,7 @@ static int saa711x_probe(struct i2c_client *client, state->crystal_freq = SAA7115_FREQ_32_11_MHZ; saa711x_writeregs(sd, saa7115_init_auto_input); } - if (state->ident != V4L2_IDENT_SAA7111) + if (state->ident > V4L2_IDENT_SAA7111A) saa711x_writeregs(sd, saa7115_init_misc); saa711x_set_v4lstd(sd, V4L2_STD_NTSC); diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 994e7ebd54c..56abf21dd78 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h @@ -39,6 +39,7 @@ enum { /* module saa7115: reserved range 101-149 */ V4L2_IDENT_SAA7111 = 101, + V4L2_IDENT_SAA7111A = 102, V4L2_IDENT_SAA7113 = 103, V4L2_IDENT_SAA7114 = 104, V4L2_IDENT_SAA7115 = 105, -- cgit v1.2.3-70-g09d2