The patch number 10217 was added via Mauro Carvalho Chehab <mche...@redhat.com> to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel If anyone has any objections, please let us know by sending a message to: Linux Media Mailing List <linux-me...@vger.kernel.org> ------ From: Mauro Carvalho Chehab <mche...@redhat.com> merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com> --- linux/drivers/media/dvb/frontends/stb0899_algo.c | 3 linux/drivers/media/video/saa7127.c | 68 ++++++++------- v4l/versions.txt | 6 - 3 files changed, 45 insertions(+), 32 deletions(-) diff -r e485a740bd54 -r 8ba654b57802 linux/drivers/media/dvb/frontends/stb0899_algo.c --- a/linux/drivers/media/dvb/frontends/stb0899_algo.c Sun Jan 11 13:04:30 2009 -0200 +++ b/linux/drivers/media/dvb/frontends/stb0899_algo.c Mon Jan 12 03:30:56 2009 -0200 @@ -31,6 +31,8 @@ inline u32 stb0899_do_div(u64 n, u32 d) return n; } +#if 0 /* keep */ +/* These functions are currently unused */ /* * stb0899_calc_srate * Compute symbol rate @@ -63,6 +65,7 @@ static u32 stb0899_get_srate(struct stb0 return stb0899_calc_srate(internal->master_clk, sfr); } +#endif /* * stb0899_set_srate diff -r e485a740bd54 -r 8ba654b57802 linux/drivers/media/video/saa7127.c --- a/linux/drivers/media/video/saa7127.c Sun Jan 11 13:04:30 2009 -0200 +++ b/linux/drivers/media/video/saa7127.c Mon Jan 12 03:30:56 2009 -0200 @@ -155,7 +155,7 @@ static const struct i2c_reg_value saa712 { SAA7127_REG_COPYGEN_0, 0x77 }, { SAA7127_REG_COPYGEN_1, 0x41 }, { SAA7127_REG_COPYGEN_2, 0x00 }, /* Macrovision enable/disable */ - { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x9e }, + { SAA7127_REG_OUTPUT_PORT_CONTROL, 0xbf }, { SAA7127_REG_GAIN_LUMINANCE_RGB, 0x00 }, { SAA7127_REG_GAIN_COLORDIFF_RGB, 0x00 }, { SAA7127_REG_INPUT_PORT_CONTROL_1, 0x80 }, /* for color bars */ @@ -494,12 +494,18 @@ static int saa7127_set_output_type(struc break; case SAA7127_OUTPUT_TYPE_COMPOSITE: - state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */ + if (state->ident == V4L2_IDENT_SAA7129) + state->reg_2d = 0x20; /* CVBS only */ + else + state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */ state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ break; case SAA7127_OUTPUT_TYPE_SVIDEO: - state->reg_2d = 0xff; /* 11111111 croma -> R, luma -> CVBS + G + B */ + if (state->ident == V4L2_IDENT_SAA7129) + state->reg_2d = 0x18; /* Y + C */ + else + state->reg_2d = 0xff; /*11111111 croma -> R, luma -> CVBS + G + B */ state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ break; @@ -514,7 +520,10 @@ static int saa7127_set_output_type(struc break; case SAA7127_OUTPUT_TYPE_BOTH: - state->reg_2d = 0xbf; + if (state->ident == V4L2_IDENT_SAA7129) + state->reg_2d = 0x38; + else + state->reg_2d = 0xbf; state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ break; @@ -741,7 +750,31 @@ static int saa7127_probe(struct i2c_clie return -ENODEV; } - /* Configure Encoder */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) + if (id->driver_data) { /* Chip type is already known */ + state->ident = id->driver_data; + } else { /* Needs detection */ +#else + { +#endif + int read_result; + + /* Detect if it's an saa7129 */ + read_result = saa7127_read(sd, SAA7129_REG_FADE_KEY_COL2); + saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2, 0xaa); + if (saa7127_read(sd, SAA7129_REG_FADE_KEY_COL2) == 0xaa) { + saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2, + read_result); + state->ident = V4L2_IDENT_SAA7129; + strlcpy(client->name, "saa7129", I2C_NAME_SIZE); + } else { + state->ident = V4L2_IDENT_SAA7127; + strlcpy(client->name, "saa7127", I2C_NAME_SIZE); + } + } + + v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name, + client->addr << 1, client->adapter->name); v4l2_dbg(1, debug, sd, "Configuring encoder\n"); saa7127_write_inittab(sd, saa7127_init_config_common); @@ -759,31 +792,6 @@ static int saa7127_probe(struct i2c_clie saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_NORMAL); saa7127_set_video_enable(sd, 1); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) - if (id->driver_data) { /* Chip type is already known */ - state->ident = id->driver_data; - } else { /* Needs detection */ -#else - { -#endif - int read_result; - - /* Detect if it's an saa7129 */ - read_result = saa7127_read(sd, SAA7129_REG_FADE_KEY_COL2); - saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2, 0xaa); - if (saa7127_read(sd, SAA7129_REG_FADE_KEY_COL2) == 0xaa) { - saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2, - read_result); - state->ident = V4L2_IDENT_SAA7129; - strlcpy(client->name, "saa7129", I2C_NAME_SIZE); - } else { - state->ident = V4L2_IDENT_SAA7127; - strlcpy(client->name, "saa7127", I2C_NAME_SIZE); - } - } - - v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name, - client->addr << 1, client->adapter->name); if (state->ident == V4L2_IDENT_SAA7129) saa7127_write_inittab(sd, saa7129_init_config_extra); return 0; diff -r e485a740bd54 -r 8ba654b57802 v4l/versions.txt --- a/v4l/versions.txt Sun Jan 11 13:04:30 2009 -0200 +++ b/v4l/versions.txt Mon Jan 12 03:30:56 2009 -0200 @@ -4,9 +4,11 @@ [2.6.28] USB_STV06XX +[2.6.27] +# Needs struct pxa_dma_desc +VIDEO_PXA27x + [2.6.26] -# Needs camera.h -VIDEO_PXA27x # Requires struct i2c_device_id VIDEO_TVP514X # requires id_table and new i2c stuff --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/8ba654b578028673acd453ac45196fd588d3efd6 _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits