From patchwork Thu Aug 22 21:38:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 269219 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 84AF72C0089 for ; Fri, 23 Aug 2013 07:39:23 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VCcb5-0002to-Oa; Thu, 22 Aug 2013 21:39:16 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VCcb3-0003NY-Dt; Thu, 22 Aug 2013 21:39:13 +0000 Received: from mail-la0-f42.google.com ([209.85.215.42]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VCcb0-0003MQ-N7 for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2013 21:39:11 +0000 Received: by mail-la0-f42.google.com with SMTP id ep20so1936783lab.29 for ; Thu, 22 Aug 2013 14:38:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:organization:to:subject:date:user-agent:cc :references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=2pS+EtqHqwCQNavm5YVlO31sEuwC3AVd/UET8Ct+si4=; b=SrxpqGuE6qHvkHRc1bvxaIRMVG9qu8Y3xgMzeiP0HG8e4mZZvFFdDscrFLwP31Qz5v vm+AedsNj/VKDK5eh0lyCgTGeZ9AXS0aG42OMVN7YIbypVs5CQGjxVCQ32Tc2FPFk9vC MsePGrANGlw+hhlKP/50RGYf9CJ8nTA+33DUTmEq0njTkCtXE5FAKXu/EKtFkPNgaYMY AW2BLCn+WU3aW8ole4nz4GrXOuo9NaOZhRuor9q+xe+crgKK4REo9pInYG8qnc/62wi9 5z/TLzbTbm/MiFU8ZRbOIcXQSfbk4idBa0vw6wmi6cKbmggQhMJVbqICJ7FUKgNE01J7 LBag== X-Gm-Message-State: ALoCoQm2LvNtIallmclmhSzA6epvA4iek5e6gsLX1yl0SMVyzCRoRX0HJ1DycpQ4oW0YV8KVoLoX X-Received: by 10.152.2.4 with SMTP id 4mr12372994laq.0.1377207525463; Thu, 22 Aug 2013 14:38:45 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-84-46.pppoe.mtu-net.ru. [91.76.84.46]) by mx.google.com with ESMTPSA id q5sm5674015lbe.10.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 22 Aug 2013 14:38:44 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: horms@verge.net.au, linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org, m.chehab@samsung.com, linux-media@vger.kernel.org Subject: [PATCH v6 2/3] ARM: shmobile: BOCK-W: add VIN and ML86V7667 support Date: Fri, 23 Aug 2013 01:38:50 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) References: <201308230134.26092.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201308230134.26092.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201308230138.51408.sergei.shtylyov@cogentembedded.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130822_173910_891341_F9E0C2A2 X-CRM114-Status: GOOD ( 15.23 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.42 listed in list.dnswl.org] -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: linux@arm.linux.org.uk, magnus.damm@gmail.com, vladimir.barinov@cogentembedded.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Vladimir Barinov Add ML86V7667 platform devices on BOCK-W board, configure VIN0/1 pins, and register VIN0/1 devices with the ML86V7667 specific platform data. Signed-off-by: Vladimir Barinov [Sergei: some macro/comment cleanup; updated the copyrights, removed duplicate #include, annotated all platform data as '__initdata', added a сheck for the 'sh_eth' driver being enabled before registering VIN1 due to a pin conflict, removed superfluous semicolon after iclink[01]_ml86v7667' initializer.] Signed-off-by: Sergei Shtylyov --- Changes since version 5: - resolved reject, refreshed the patch. Changes since version 4: - added a сheck for the 'sh_eth' driver being enabled before registering VIN1 due to a pin conflict; - removed superfluous semicolon after iclink[01]_ml86v7667' initializer; - resolved rejects, refreshed the patch. Changes since version 3: - changed the VIN platform device names to be R8A7778 specific; - resolved reject due to USB patch rework, refreshed the patch. Changes since version 2: - removed duplicate #include ; - annotated all platform data as '__initdata' since they're kmemdup()'ed while registering the platform devices anyway; - resolved rejects, refreshed the patch. arch/arm/mach-shmobile/board-bockw.c | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) Index: media_tree/arch/arm/mach-shmobile/board-bockw.c =================================================================== --- media_tree.orig/arch/arm/mach-shmobile/board-bockw.c +++ media_tree/arch/arm/mach-shmobile/board-bockw.c @@ -3,6 +3,7 @@ * * Copyright (C) 2013 Renesas Solutions Corp. * Copyright (C) 2013 Kuninori Morimoto + * 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 @@ -28,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -143,6 +145,25 @@ static struct sh_mmcif_plat_data sh_mmci MMC_CAP_NEEDS_POLL, }; +static struct rcar_vin_platform_data vin_platform_data __initdata = { + .flags = RCAR_VIN_BT656, +}; + +/* In the default configuration both decoders reside on I2C bus 0 */ +#define BOCKW_CAMERA(idx) \ +static struct i2c_board_info camera##idx##_info = { \ + I2C_BOARD_INFO("ml86v7667", 0x41 + 2 * (idx)), \ +}; \ + \ +static struct soc_camera_link iclink##idx##_ml86v7667 __initdata = { \ + .bus_id = idx, \ + .i2c_adapter_id = 0, \ + .board_info = &camera##idx##_info, \ +} + +BOCKW_CAMERA(0); +BOCKW_CAMERA(1); + static const struct pinctrl_map bockw_pinctrl_map[] = { /* Ether */ PIN_MAP_MUX_GROUP_DEFAULT("r8a777x-ether", "pfc-r8a7778", @@ -168,6 +189,16 @@ static const struct pinctrl_map bockw_pi /* SDHI0 */ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778", "sdhi0", "sdhi0"), + /* VIN0 */ + PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.0", "pfc-r8a7778", + "vin0_clk", "vin0"), + PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.0", "pfc-r8a7778", + "vin0_data8", "vin0"), + /* VIN1 */ + PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.1", "pfc-r8a7778", + "vin1_clk", "vin1"), + PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.1", "pfc-r8a7778", + "vin1_data8", "vin1"), }; #define FPGA 0x18200000 @@ -186,6 +217,16 @@ static void __init bockw_init(void) r8a7778_add_i2c_device(0); r8a7778_add_hspi_device(0); r8a7778_add_mmc_device(&sh_mmcif_plat); + r8a7778_add_vin_device(0, &vin_platform_data); + /* VIN1 has a pin conflict with Ether */ + if (!IS_ENABLED(CONFIG_SH_ETH)) + r8a7778_add_vin_device(1, &vin_platform_data); + platform_device_register_data(&platform_bus, "soc-camera-pdrv", 0, + &iclink0_ml86v7667, + sizeof(iclink0_ml86v7667)); + platform_device_register_data(&platform_bus, "soc-camera-pdrv", 1, + &iclink1_ml86v7667, + sizeof(iclink1_ml86v7667)); i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));