From d13d382b9f1f43d188a4af2c980829a63c1bdb8c Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 25 Mar 2013 06:23:23 -0300 Subject: [PATCH] --- yaml --- r: 366821 b: refs/heads/master c: d4a2cea4f2fd9c935f30666e4acdb1065ff60544 h: refs/heads/master i: 366819: 65251dc565768771371a499710db557c845afc9c v: v3 --- [refs] | 2 +- trunk/drivers/media/i2c/tw9903.c | 19 +++++++++++++------ trunk/drivers/media/i2c/tw9906.c | 19 +++++++++++++------ 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 846f97b2ba21..83e036c2013d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 59aea928d57f171453474a883f087e4fccb83e94 +refs/heads/master: d4a2cea4f2fd9c935f30666e4acdb1065ff60544 diff --git a/trunk/drivers/media/i2c/tw9903.c b/trunk/drivers/media/i2c/tw9903.c index f0d0ef5da30c..87880b19d8c3 100644 --- a/trunk/drivers/media/i2c/tw9903.c +++ b/trunk/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/trunk/drivers/media/i2c/tw9906.c b/trunk/drivers/media/i2c/tw9906.c index d94325b68b81..accd79e5a7fd 100644 --- a/trunk/drivers/media/i2c/tw9906.c +++ b/trunk/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; }