This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] tw9603/6.c: use two separate const tables for the 50/60hz setup
Author:  Hans Verkuil <[email protected]>
Date:    Mon Mar 25 06:23:23 2013 -0300

Using two separate tables to setup the registers for 50 or 60 hz is
better than the non-const table that is filled in at runtime.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/i2c/tw9903.c |   19 +++++++++++++------
 drivers/media/i2c/tw9906.c |   19 +++++++++++++------
 2 files changed, 26 insertions(+), 12 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=d4a2cea4f2fd9c935f30666e4acdb1065ff60544

diff --git a/drivers/media/i2c/tw9903.c b/drivers/media/i2c/tw9903.c
index f0d0ef5..87880b1 100644
--- a/drivers/media/i2c/tw9903.c
+++ b/drivers/media/i2c/tw9903.c
@@ -127,15 +127,22 @@ static int tw9903_s_std(struct v4l2_subdev *sd, 
v4l2_std_id norm)
 {
        struct tw9903 *dec = to_state(sd);
        bool is_60hz = norm & V4L2_STD_525_60;
-       u8 regs[] = {
-               0x05, is_60hz ? 0x80 : 0x00,
-               0x07, is_60hz ? 0x02 : 0x12,
-               0x08, is_60hz ? 0x14 : 0x18,
-               0x09, is_60hz ? 0xf0 : 0x20,
+       static const u8 config_60hz[] = {
+               0x05, 0x80,
+               0x07, 0x02,
+               0x08, 0x14,
+               0x09, 0xf0,
+               0,    0,
+       };
+       static const u8 config_50hz[] = {
+               0x05, 0x00,
+               0x07, 0x12,
+               0x08, 0x18,
+               0x09, 0x20,
                0,    0,
        };
 
-       write_regs(sd, regs);
+       write_regs(sd, is_60hz ? config_60hz : config_50hz);
        dec->norm = norm;
        return 0;
 }
diff --git a/drivers/media/i2c/tw9906.c b/drivers/media/i2c/tw9906.c
index d94325b..accd79e 100644
--- a/drivers/media/i2c/tw9906.c
+++ b/drivers/media/i2c/tw9906.c
@@ -98,15 +98,22 @@ static int tw9906_s_std(struct v4l2_subdev *sd, v4l2_std_id 
norm)
 {
        struct tw9906 *dec = to_state(sd);
        bool is_60hz = norm & V4L2_STD_525_60;
-       u8 regs[] = {
-               0x05, is_60hz ? 0x81 : 0x01,
-               0x07, is_60hz ? 0x02 : 0x12,
-               0x08, is_60hz ? 0x14 : 0x18,
-               0x09, is_60hz ? 0xf0 : 0x20,
+       static const u8 config_60hz[] = {
+               0x05, 0x81,
+               0x07, 0x02,
+               0x08, 0x14,
+               0x09, 0xf0,
+               0,    0,
+       };
+       static const u8 config_50hz[] = {
+               0x05, 0x01,
+               0x07, 0x12,
+               0x08, 0x18,
+               0x09, 0x20,
                0,    0,
        };
 
-       write_regs(sd, regs);
+       write_regs(sd, is_60hz ? config_60hz : config_50hz);
        dec->norm = norm;
        return 0;
 }

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to