From 796a8651acd1759db5223b03bdbfe43f94d7c11e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 28 Mar 2007 22:37:26 -0300 Subject: Use ARRAY_SIZE and a cleaner logic for initializing tuner From: Mauro Carvalho Chehab ATI HDTV Wonder needs to initialize some registers before allowing the tuner to start working. The current logic have lots of magic. This patch makes the code cleaner, using ARRAY_SIZE() for the initialization array and using a bidimensional array, instead of doing some stuff like: &buffer[i+2][0] Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cx88/cx88-cards.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'linux/drivers/media/video/cx88/cx88-cards.c') diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index 774bcfed9..825334ef3 100644 --- a/linux/drivers/media/video/cx88/cx88-cards.c +++ b/linux/drivers/media/video/cx88/cx88-cards.c @@ -1823,7 +1823,7 @@ static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core) { 0x03, 0x0C }, }; - for (i = 0; i < 13; i++) { + for (i = 0; i < ARRAY_SIZE(init_bufs); i++) { msg.buf = init_bufs[i]; msg.len = (i != 12 ? 5 : 2); err = i2c_transfer(&core->i2c_adap, &msg, 1); @@ -1950,12 +1950,21 @@ void cx88_card_setup(struct cx88_core *core) if (0 == core->i2c_rc) { /* enable tuner */ int i; - static const u8 buffer [] = { 0x10,0x12,0x13,0x04,0x16,0x00,0x14,0x04,0x017,0x00 }; + static const u8 buffer [][2] = { + {0x10,0x12}, + {0x13,0x04}, + {0x16,0x00}, + {0x14,0x04}, + {0x17,0x00} + }; core->i2c_client.addr = 0x0a; - for (i = 0; i < 5; i++) - if (2 != i2c_master_send(&core->i2c_client,&buffer[i*2],2)) - printk(KERN_WARNING "%s: Unable to enable tuner(%i).\n", + for (i = 0; i < ARRAY_SIZE(buffer); i++) + if (2 != i2c_master_send(&core->i2c_client, + buffer[i],2)) + printk(KERN_WARNING + "%s: Unable to enable " + "tuner(%i).\n", core->name, i); } break; -- cgit v1.2.3 From 16c93516480ddb3b9750a8963e2f29880c6d6bdb Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 31 Mar 2007 10:34:59 -0300 Subject: Cx88: Support the DTV1000 T analog inputs From: Jean Delvare Add support for the S-Video and CVBS (composite) analog video inputs of the Leadtek WinFast DTV1000 T adapter. Signed-off-by: Jean Delvare Acked-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cx88/cx88-cards.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/video/cx88/cx88-cards.c') diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index 825334ef3..6be16512a 100644 --- a/linux/drivers/media/video/cx88/cx88-cards.c +++ b/linux/drivers/media/video/cx88/cx88-cards.c @@ -886,6 +886,12 @@ struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_DVB, .vmux = 0, + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, }}, .mpeg = CX88_MPEG_DVB, }, @@ -1955,14 +1961,14 @@ void cx88_card_setup(struct cx88_core *core) {0x13,0x04}, {0x16,0x00}, {0x14,0x04}, - {0x17,0x00} + {0x17,0x00} }; core->i2c_client.addr = 0x0a; for (i = 0; i < ARRAY_SIZE(buffer); i++) if (2 != i2c_master_send(&core->i2c_client, buffer[i],2)) - printk(KERN_WARNING + printk(KERN_WARNING "%s: Unable to enable " "tuner(%i).\n", core->name, i); -- cgit v1.2.3 From 4ab7e7e5f0d2d8b0abcd7a23f6427c724a4d46bd Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 19 Apr 2007 11:21:50 -0300 Subject: Fix support for Winfast TV2000 XP Global From: C.masoyras Fix GPIO to work with TV and Composite inputs. Signed-off-by: C.masoyras Signed-off-by: Alex Deucher Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cx88/cx88-cards.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media/video/cx88/cx88-cards.c') diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index 6be16512a..7b1fb79b6 100644 --- a/linux/drivers/media/video/cx88/cx88-cards.c +++ b/linux/drivers/media/video/cx88/cx88-cards.c @@ -983,9 +983,17 @@ struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, - },{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, + .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */ + .gpio1 = 0x0000, + .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */ + + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */ + .gpio1 = 0x0000, + .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */ + },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, -- cgit v1.2.3 From adfab19699a13f2ec485a48b1c6dc58c37a3b880 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 19 Apr 2007 17:07:20 -0300 Subject: Reverting changeset 294b550d74f4ad567dfa7079555ab16250cbd602 From: Mauro Carvalho Chehab This patch went applied at the wrong board. Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cx88/cx88-cards.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'linux/drivers/media/video/cx88/cx88-cards.c') diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index 7b1fb79b6..6be16512a 100644 --- a/linux/drivers/media/video/cx88/cx88-cards.c +++ b/linux/drivers/media/video/cx88/cx88-cards.c @@ -983,17 +983,9 @@ struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, - .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */ - .gpio1 = 0x0000, - .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */ - - },{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */ - .gpio1 = 0x0000, - .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */ - + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, -- cgit v1.2.3