From patchwork Fri Jun 21 23:30:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2764931 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 98FE59F756 for ; Fri, 21 Jun 2013 23:30:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DB5D201A8 for ; Fri, 21 Jun 2013 23:30:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A413E201AE for ; Fri, 21 Jun 2013 23:30:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423318Ab3FUXaN (ORCPT ); Fri, 21 Jun 2013 19:30:13 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:37946 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161534Ab3FUXaI convert rfc822-to-8bit (ORCPT ); Fri, 21 Jun 2013 19:30:08 -0400 Received: by mail-la0-f47.google.com with SMTP id fe20so8073430lab.34 for ; Fri, 21 Jun 2013 16:30:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id:x-gm-message-state; bh=2pjI2Onlj0xfRv4tHh3yGjcSXP76Pyac7ELrqr/234U=; b=BKPD5JeQQw1bJEBnS4K6U1S6zTEORRYS2/fgnxX1g16sE0vBzsG8a2b7NFJ5NXqP1W PqVfbrNIyi4kqltQyPS25xU5a1VPO8oVSgOMuLjf10dz9mMudju+IEyd+8wBQwg8+dlZ VDXr4/ooxSvFkgPx51986kw0L01QT7v54RmHjodNo7YX7ppDgFvoIbTV05b7wU7xwRAD pMQt3rATS/g7K9w4Y/cfdam76GNOh2TgV4B62/Wg6yQJI4a+2xSHkx+ss4VSOQYmO32Q 5oF7bHszMliDGQ5eDs12olFIcFSm29kxz9Nx/QAPMu5kGvwBED8tnTAdkx1yd5y/wt4Q txeA== X-Received: by 10.112.161.66 with SMTP id xq2mr6443974lbb.34.1371857407007; Fri, 21 Jun 2013 16:30:07 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-149-228.pppoe.mtu-net.ru. [91.76.149.228]) by mx.google.com with ESMTPSA id e9sm2685621lbj.3.2013.06.21.16.30.05 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Jun 2013 16:30:05 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: horms@verge.net.au, linux-sh@vger.kernel.org Subject: [PATCH v5 2/3] ARM: shmobile: BOCK-W: add VIN and ML86V7667 support Date: Sat, 22 Jun 2013 03:30:13 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) Cc: magnus.damm@gmail.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, matsu@igel.co.jp, vladimir.barinov@cogentembedded.com References: <201306220326.46176.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201306220326.46176.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201306220330.13845.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQkrmmbzw2tDvz7Wi2XOJKXyu1UiiiCQTqUpU/e8VatYlUigquDk30OmxrLM36CPCfsI6FYU Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: renesas/arch/arm/mach-shmobile/board-bockw.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/board-bockw.c +++ renesas/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 @@ -142,6 +144,25 @@ static struct sh_mmcif_plat_data sh_mmci static struct rcar_phy_platform_data usb_phy_platform_data __initdata; +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", @@ -166,6 +187,16 @@ static const struct pinctrl_map bockw_pi "usb0", "usb0"), PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform", "pfc-r8a7778", "usb1", "usb1"), + /* 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 @@ -184,6 +215,16 @@ static void __init bockw_init(void) r8a7778_add_hspi_device(0); r8a7778_add_mmc_device(&sh_mmcif_plat); r8a7778_add_usb_phy_device(&usb_phy_platform_data); + 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));