From patchwork Fri Apr 19 22:33:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2467361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id A7D6D3FD8C for ; Fri, 19 Apr 2013 22:34:45 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UTJt7-0004rM-DQ; Fri, 19 Apr 2013 22:34:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UTJsx-0007f6-EM; Fri, 19 Apr 2013 22:34:27 +0000 Received: from mail-la0-x22b.google.com ([2a00:1450:4010:c03::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UTJsu-0007en-S6 for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2013 22:34:25 +0000 Received: by mail-la0-f43.google.com with SMTP id ea20so500132lab.30 for ; Fri, 19 Apr 2013 15:34:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:to:subject:cc:from:organization:date:mime-version :content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=Ee8gfgaqnKKatofJEAHoFX2n+1bQhNAzJ5eJj60QRss=; b=GE0NTShRkrmEnqmsPtoSjpTsTOVcXJBJhd5Otu8sZQhwNvn1mFcRnb97eMH5+u/tS4 JaxJc/J8MEaqTBCs7Jh8QLZobe/9Yvgz2lIIU506G5TJJdvt91FEbsm8kLxMmcoe+C86 rzNV5Dg1RXL5k8TACBhw1UlRN252VnB76hs0eW7lDxmREO1rafhEAKJYKkXf8bip7LKQ pr7ixNlMwqO+7+QTcMO4LJ4mPahNEKxzxej1+AueTMdXXAsbBf31Dox6oNEYyZrFIeUJ Rmfp/xP3U9zroBokjqaVc9dXKoiwSWs1qu/W/NZ2rlKg3CkAmaFMI5jJhrPmlmrgQA+d 5BzA== X-Received: by 10.152.29.102 with SMTP id j6mr9064495lah.47.1366410863136; Fri, 19 Apr 2013 15:34:23 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-86-130.pppoe.mtu-net.ru. [91.79.86.130]) by mx.google.com with ESMTPS id b2sm6547720lbv.4.2013.04.19.15.34.21 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 19 Apr 2013 15:34:22 -0700 (PDT) To: horms@verge.net.au, magnus.damm@gmail.com, linux@arm.linux.org.uk, linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/4] ARM: shmobile: Marzen: add VIN and ADV7180 support From: Sergei Shtylyov Organization: Cogent Embedded Date: Sat, 20 Apr 2013 02:33:32 +0400 MIME-Version: 1.0 Message-Id: <201304200233.33555.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQkr20gKmgSUGBLuKN2GpGfMV8q8FCXaFb1rs1XMJCFFX2oCK2xrcpwNVk+JQ3MxLgDWsFiP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130419_183425_085399_6328AA77 X-CRM114-Status: GOOD ( 16.01 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: matsu@igel.co.jp, vladimir.barinov@cogentembedded.com, linux-media@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Vladimir Barinov Add ADV7180 platform devices on the Marzen board, configure VIN1/3 pins, and register VIN1/3 devices with the ADV7180 specific platform data. Signed-off-by: Vladimir Barinov [Sergei: removed superfluous tabulation and inserted empty lines in the macro definition; updated the copyrights] Signed-off-by: Sergei Shtylyov --- Changes since the original posting: - used a macro to define the camera platform devices; - updated the copyrights; - refreshed the patch. arch/arm/mach-shmobile/board-marzen.c | 44 +++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) Index: renesas/arch/arm/mach-shmobile/board-marzen.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/board-marzen.c +++ renesas/arch/arm/mach-shmobile/board-marzen.c @@ -1,8 +1,9 @@ /* * marzen board support * - * Copyright (C) 2011 Renesas Solutions Corp. + * Copyright (C) 2011, 2013 Renesas Solutions Corp. * Copyright (C) 2011 Magnus Damm + * Copyright (C) 2013 Cogent Embedded, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -178,12 +180,40 @@ static struct platform_device leds_devic }, }; +static struct rcar_vin_platform_data vin_platform_data = { + .flags = RCAR_VIN_BT656, +}; + +#define MARZEN_CAMERA(idx) \ +static struct i2c_board_info camera##idx##_info = { \ + I2C_BOARD_INFO("adv7180", 0x20 + (idx)), \ +}; \ + \ +static struct soc_camera_link iclink##idx##_adv7180 = { \ + .bus_id = 1 + 2 * (idx), \ + .i2c_adapter_id = 0, \ + .board_info = &camera##idx##_info, \ +}; \ + \ +static struct platform_device camera##idx##_device = { \ + .name = "soc-camera-pdrv", \ + .id = idx, \ + .dev = { \ + .platform_data = &iclink##idx##_adv7180, \ + }, \ +}; + +MARZEN_CAMERA(0); +MARZEN_CAMERA(1); + static struct platform_device *marzen_devices[] __initdata = { ð_device, &sdhi0_device, &thermal_device, &hspi_device, &leds_device, + &camera0_device, + &camera1_device, }; static const struct pinctrl_map marzen_pinctrl_map[] = { @@ -219,6 +249,16 @@ static const struct pinctrl_map marzen_p /* USB2 */ PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.1", "pfc-r8a7779", "usb2", "usb2"), + /* VIN1 */ + PIN_MAP_MUX_GROUP_DEFAULT("rcar_vin.1", "pfc-r8a7779", + "vin1_clk", "vin1"), + PIN_MAP_MUX_GROUP_DEFAULT("rcar_vin.1", "pfc-r8a7779", + "vin1_data8", "vin1"), + /* VIN3 */ + PIN_MAP_MUX_GROUP_DEFAULT("rcar_vin.3", "pfc-r8a7779", + "vin3_clk", "vin3"), + PIN_MAP_MUX_GROUP_DEFAULT("rcar_vin.3", "pfc-r8a7779", + "vin3_data8", "vin3"), }; static void __init marzen_init(void) @@ -235,6 +275,8 @@ static void __init marzen_init(void) r8a7779_add_standard_devices(); r8a7779_add_usb_phy_device(&usb_phy_platform_data); + r8a7779_add_vin_device(1, &vin_platform_data); + r8a7779_add_vin_device(3, &vin_platform_data); platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); }