From patchwork Fri Nov 13 03:04:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 59705 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAD3M6SK010536 for ; Fri, 13 Nov 2009 03:22:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755113AbZKMDV6 (ORCPT ); Thu, 12 Nov 2009 22:21:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755250AbZKMDV6 (ORCPT ); Thu, 12 Nov 2009 22:21:58 -0500 Received: from mail.renesas.com ([202.234.163.13]:43748 "EHLO mail04.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755101AbZKMDV5 (ORCPT ); Thu, 12 Nov 2009 22:21:57 -0500 X-AuditID: ac140387-00000009000005fd-2c-4afcd0d7639c Received: from guardian01.idc.renesas.com ([172.20.8.200]) by mail04.idc.renesas.com (sendmail) with ESMTP id nAD3LxGL000199; Fri, 13 Nov 2009 12:21:59 +0900 (JST) Received: (from root@localhost) by guardian01.idc.renesas.com with id nAD3LxJn027927; Fri, 13 Nov 2009 12:21:59 +0900 (JST) Received: from mta01.idc.renesas.com (localhost [127.0.0.1]) by mta01.idc.renesas.com with ESMTP id nAD3LwKV022916; Fri, 13 Nov 2009 12:21:58 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KT100ESO2ONB6@ims05.idc.renesas.com>; Fri, 13 Nov 2009 12:21:59 +0900 (JST) Date: Fri, 13 Nov 2009 12:04:01 +0900 From: Kuninori Morimoto Subject: [PATCH v2] soc-camera: tw9910: modify V/H outpit pin setting to use VALID To: Guennadi Liakhovetski Cc: Linux Media Mailing List Message-id: MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.3 (i386-msvc-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.02-dev (RINDOU) (2009-06-17 Rev.4261) X-Brightmail-Tracker: AAAAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c index 6d8dede..82135f2 100644 --- a/drivers/media/video/tw9910.c +++ b/drivers/media/video/tw9910.c @@ -239,18 +239,6 @@ struct tw9910_priv { u32 revision; }; -/* - * register settings - */ - -#define ENDMARKER { 0xff, 0xff } - -static const struct regval_list tw9910_default_regs[] = -{ - { OUTCTR1, VSP_LO | VSSL_VVALID | HSP_HI | HSSL_HSYNC }, - ENDMARKER, -}; - static const enum v4l2_imgbus_pixelcode tw9910_color_codes[] = { V4L2_IMGBUS_FMT_VYUY, }; @@ -463,20 +451,6 @@ static int tw9910_set_hsync(struct i2c_client *client, return ret; } -static int tw9910_write_array(struct i2c_client *client, - const struct regval_list *vals) -{ - while (vals->reg_num != 0xff) { - int ret = i2c_smbus_write_byte_data(client, - vals->reg_num, - vals->value); - if (ret < 0) - return ret; - vals++; - } - return 0; -} - static void tw9910_reset(struct i2c_client *client) { tw9910_mask_set(client, ACNTL1, SRESET, SRESET); @@ -578,7 +552,14 @@ static int tw9910_s_stream(struct v4l2_subdev *sd, int enable) static int tw9910_set_bus_param(struct soc_camera_device *icd, unsigned long flags) { - return 0; + struct v4l2_subdev *sd = soc_camera_to_subdev(icd); + struct i2c_client *client = sd->priv; + + /* + * set OUTCTR1 + */ + return i2c_smbus_write_byte_data(client, OUTCTR1, + VSSL_VVALID | HSSL_DVALID); } static unsigned long tw9910_query_bus_param(struct soc_camera_device *icd) @@ -681,9 +662,6 @@ static int tw9910_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) * reset hardware */ tw9910_reset(client); - ret = tw9910_write_array(client, tw9910_default_regs); - if (ret < 0) - goto tw9910_set_fmt_error; /* * set bus width