From patchwork Tue May 12 15:13:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 23262 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 n4CFDOV7027906 for ; Tue, 12 May 2009 15:13:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752007AbZELPNW (ORCPT ); Tue, 12 May 2009 11:13:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753105AbZELPNW (ORCPT ); Tue, 12 May 2009 11:13:22 -0400 Received: from mail.gmx.net ([213.165.64.20]:56340 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752007AbZELPNV (ORCPT ); Tue, 12 May 2009 11:13:21 -0400 Received: (qmail invoked by alias); 12 May 2009 15:13:20 -0000 Received: from p57BD1CA6.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.28.166] by mail.gmx.net (mp034) with SMTP; 12 May 2009 17:13:20 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1/cGEcPLy3cWMsHePf+RSrVl1PVE0GW7lC0cnlr0t kxKyRosenYrECc Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1M3tfg-0002Mx-Dz; Tue, 12 May 2009 17:13:32 +0200 Date: Tue, 12 May 2009 17:13:32 +0200 (CEST) From: Guennadi Liakhovetski To: Linux Media Mailing List cc: Paul Mundt , linux-sh@vger.kernel.org, Magnus Damm Subject: [PATCH 1/3] soc-camera: unify i2c camera device platform data In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.49 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Unify i2c camera device platform data to point to struct soc_camera_link for a smooth transition to soc-camera as a platform driver. Signed-off-by: Guennadi Liakhovetski --- arch/sh/boards/board-ap325rxa.c | 2 +- arch/sh/boards/mach-migor/setup.c | 4 ++-- drivers/media/video/ov772x.c | 6 ++++-- drivers/media/video/tw9910.c | 6 ++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 39e4691..54c5cd1 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c @@ -414,7 +414,7 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { }, { I2C_BOARD_INFO("ov772x", 0x21), - .platform_data = &ov7725_info, + .platform_data = &ov7725_info.link, }, }; diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index 1ee1de0..c4b97e1 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c @@ -430,11 +430,11 @@ static struct i2c_board_info migor_i2c_devices[] = { }, { I2C_BOARD_INFO("ov772x", 0x21), - .platform_data = &ov7725_info, + .platform_data = &ov7725_info.link, }, { I2C_BOARD_INFO("tw9910", 0x45), - .platform_data = &tw9910_info, + .platform_data = &tw9910_info.link, }, }; diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c index c0d9112..0bce255 100644 --- a/drivers/media/video/ov772x.c +++ b/drivers/media/video/ov772x.c @@ -1067,10 +1067,12 @@ static int ov772x_probe(struct i2c_client *client, struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); int ret; - info = client->dev.platform_data; - if (!info) + if (!client->dev.platform_data) return -EINVAL; + info = container_of(client->dev.platform_data, + struct ov772x_camera_info, link); + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { dev_err(&adapter->dev, "I2C-Adapter doesn't support " diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c index a399476..aa5065e 100644 --- a/drivers/media/video/tw9910.c +++ b/drivers/media/video/tw9910.c @@ -875,10 +875,12 @@ static int tw9910_probe(struct i2c_client *client, const struct tw9910_scale_ctrl *scale; int i, ret; - info = client->dev.platform_data; - if (!info) + if (!client->dev.platform_data) return -EINVAL; + info = container_of(client->dev.platform_data, + struct tw9910_video_info, link); + if (!i2c_check_functionality(to_i2c_adapter(client->dev.parent), I2C_FUNC_SMBUS_BYTE_DATA)) { dev_err(&client->dev,