Commit e2b8cf4c authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (4005): Add support for the cx25836/7 video decoder.

Signed-off-by: default avatarScott Alfter <salfter@ssai.us>
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 3eb73170
...@@ -31,7 +31,8 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) ...@@ -31,7 +31,8 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
return -EINVAL; return -EINVAL;
/* assert soft reset */ /* assert soft reset */
cx25840_and_or(client, 0x810, ~0x1, 0x01); if (!state->is_cx25836)
cx25840_and_or(client, 0x810, ~0x1, 0x01);
/* common for all inputs and rates */ /* common for all inputs and rates */
/* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */ /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */
...@@ -46,6 +47,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) ...@@ -46,6 +47,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */ /* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0xee39bb01); cx25840_write4(client, 0x110, 0xee39bb01);
if (state->is_cx25836)
break;
/* src3/4/6_ctl = 0x0801f77f */ /* src3/4/6_ctl = 0x0801f77f */
cx25840_write4(client, 0x900, 0x7ff70108); cx25840_write4(client, 0x900, 0x7ff70108);
cx25840_write4(client, 0x904, 0x7ff70108); cx25840_write4(client, 0x904, 0x7ff70108);
...@@ -59,6 +63,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) ...@@ -59,6 +63,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */ /* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0xd66bec00); cx25840_write4(client, 0x110, 0xd66bec00);
if (state->is_cx25836)
break;
/* src3/4/6_ctl = 0x08016d59 */ /* src3/4/6_ctl = 0x08016d59 */
cx25840_write4(client, 0x900, 0x596d0108); cx25840_write4(client, 0x900, 0x596d0108);
cx25840_write4(client, 0x904, 0x596d0108); cx25840_write4(client, 0x904, 0x596d0108);
...@@ -72,6 +79,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) ...@@ -72,6 +79,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */ /* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0xe5d69800); cx25840_write4(client, 0x110, 0xe5d69800);
if (state->is_cx25836)
break;
/* src3/4/6_ctl = 0x08014faa */ /* src3/4/6_ctl = 0x08014faa */
cx25840_write4(client, 0x900, 0xaa4f0108); cx25840_write4(client, 0x900, 0xaa4f0108);
cx25840_write4(client, 0x904, 0xaa4f0108); cx25840_write4(client, 0x904, 0xaa4f0108);
...@@ -87,6 +97,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) ...@@ -87,6 +97,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */ /* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0x69082a01); cx25840_write4(client, 0x110, 0x69082a01);
if (state->is_cx25836)
break;
/* src1_ctl = 0x08010000 */ /* src1_ctl = 0x08010000 */
cx25840_write4(client, 0x8f8, 0x00000108); cx25840_write4(client, 0x8f8, 0x00000108);
...@@ -106,6 +119,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) ...@@ -106,6 +119,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */ /* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0xd66bec00); cx25840_write4(client, 0x110, 0xd66bec00);
if (state->is_cx25836)
break;
/* src1_ctl = 0x08010000 */ /* src1_ctl = 0x08010000 */
cx25840_write4(client, 0x8f8, 0xcd600108); cx25840_write4(client, 0x8f8, 0xcd600108);
...@@ -122,6 +138,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) ...@@ -122,6 +138,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */ /* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0xe5d69800); cx25840_write4(client, 0x110, 0xe5d69800);
if (state->is_cx25836)
break;
/* src1_ctl = 0x08010000 */ /* src1_ctl = 0x08010000 */
cx25840_write4(client, 0x8f8, 0x00800108); cx25840_write4(client, 0x8f8, 0x00800108);
...@@ -134,7 +153,8 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) ...@@ -134,7 +153,8 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
} }
/* deassert soft reset */ /* deassert soft reset */
cx25840_and_or(client, 0x810, ~0x1, 0x00); if (!state->is_cx25836)
cx25840_and_or(client, 0x810, ~0x1, 0x00);
state->audclk_freq = freq; state->audclk_freq = freq;
......
This diff is collapsed.
...@@ -33,12 +33,15 @@ ...@@ -33,12 +33,15 @@
#define CX25840_CID_ENABLE_PVR150_WORKAROUND (V4L2_CID_PRIVATE_BASE+0) #define CX25840_CID_ENABLE_PVR150_WORKAROUND (V4L2_CID_PRIVATE_BASE+0)
struct cx25840_state { struct cx25840_state {
struct i2c_client c;
int pvr150_workaround; int pvr150_workaround;
int radio; int radio;
enum cx25840_video_input vid_input; enum cx25840_video_input vid_input;
enum cx25840_audio_input aud_input; enum cx25840_audio_input aud_input;
u32 audclk_freq; u32 audclk_freq;
int audmode; int audmode;
enum v4l2_chip_ident id;
int is_cx25836;
}; };
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
...@@ -47,7 +50,7 @@ int cx25840_write(struct i2c_client *client, u16 addr, u8 value); ...@@ -47,7 +50,7 @@ int cx25840_write(struct i2c_client *client, u16 addr, u8 value);
int cx25840_write4(struct i2c_client *client, u16 addr, u32 value); int cx25840_write4(struct i2c_client *client, u16 addr, u32 value);
u8 cx25840_read(struct i2c_client *client, u16 addr); u8 cx25840_read(struct i2c_client *client, u16 addr);
u32 cx25840_read4(struct i2c_client *client, u16 addr); u32 cx25840_read4(struct i2c_client *client, u16 addr);
int cx25840_and_or(struct i2c_client *client, u16 addr, u8 mask, u8 value); int cx25840_and_or(struct i2c_client *client, u16 addr, unsigned mask, u8 value);
v4l2_std_id cx25840_get_v4lstd(struct i2c_client *client); v4l2_std_id cx25840_get_v4lstd(struct i2c_client *client);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
......
...@@ -112,6 +112,8 @@ enum v4l2_chip_ident { ...@@ -112,6 +112,8 @@ enum v4l2_chip_ident {
V4L2_IDENT_SAA7129 = 159, V4L2_IDENT_SAA7129 = 159,
/* module cx25840: reserved range 200-249 */ /* module cx25840: reserved range 200-249 */
V4L2_IDENT_CX25836 = 236,
V4L2_IDENT_CX25837 = 237,
V4L2_IDENT_CX25840 = 240, V4L2_IDENT_CX25840 = 240,
V4L2_IDENT_CX25841 = 241, V4L2_IDENT_CX25841 = 241,
V4L2_IDENT_CX25842 = 242, V4L2_IDENT_CX25842 = 242,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment