From patchwork Thu Apr 4 23:10:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2395441 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 9F1DE3FD1A for ; Thu, 4 Apr 2013 23:23:37 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNtVI-0003Jh-Sf for patchwork-linux-arm@patchwork.kernel.org; Thu, 04 Apr 2013 23:23: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 1UNtK1-0000DV-WA; Thu, 04 Apr 2013 23:11:58 +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 1UNtJy-0000Cw-UE for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2013 23:11:55 +0000 Received: by mail-la0-f43.google.com with SMTP id ek20so2977695lab.30 for ; Thu, 04 Apr 2013 16:11:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:to:subject:from:organization:date:cc:mime-version :content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=qOSgpseHZwOt7Eu79lVc9aLVoNbFRlNyCQ/omHfNTa8=; b=JmOnoN3hI0VuRJzRjkmpIhxX9w1la5TK/1VL10Q3VSgpsuIdFBFpXAXJIbQWIaYJMq XTbvJubY2nlahtbwH7XB6WJ0AXK8Zx6Fuv/Z1F2a0YF8r3PkxHtMXgwMMOZvBbqN+Mqz MFIvWRGi0zqB5xgfK+8PpayT8s0cCHuOWBCTRsFO8ST3y3NuCU8qolE5Nr/8N9yX5VaV encT2M6l9icgAFoVwR8sJC/IxWrw03rVxaF7Xm0t1wciBb/g/Ohmxe9B5Jy4tUfNd6yo jTA/3t3hEe5eXmzfneYpXAKODZk+jBevcmFMgBmlaPYWGND14NEMLGunhFIllN62GjPq dwhQ== X-Received: by 10.112.163.130 with SMTP id yi2mr4683641lbb.79.1365117112263; Thu, 04 Apr 2013 16:11:52 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-100-82.pppoe.mtu-net.ru. [91.79.100.82]) by mx.google.com with ESMTPS id kw9sm4615109lbb.4.2013.04.04.16.11.49 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Apr 2013 16:11:51 -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 7/8] ARM: shmobile: Marzen: pass platform data to USB PHY device From: Sergei Shtylyov Organization: Cogent Embedded Date: Fri, 5 Apr 2013 03:10:38 +0400 MIME-Version: 1.0 Message-Id: <201304050310.39289.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQkTsaXhT7JZ2GLf3Hzv9kD4uQgpZcfu71n4A/UGRz7P9209Qbf2piMXvwyXJgd5EFoPSBJ9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130404_191155_152279_AB786947 X-CRM114-Status: GOOD ( 15.47 ) 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: linux-usb@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 Since we're now going to setup the USBPCTRL0 register using the USB PHY device's platform data, we now need a way to pass those platform data from the board file to the device which is situated in setup-r8a7779.c -- and what I'm suggesting is r8a7779_add_usb_phy_device() that will register USB PHY platform device with the passed platform data using platform_device_register_resndata() call; creating this function involves deletion of 'usb_phy_device' from r8a7779_devices_dt[], so that it will no longer be registered for the generic R8A7779 machine (where we can't provide the platform data anyway), hence EHCI/OHCI drivers will fail to load as well. For the Marzen board, this new function will be called from marzen_init() to register the USB PHY device early enough. Signed-off-by: Sergei Shtylyov --- arch/arm/mach-shmobile/board-marzen.c | 5 +++++ arch/arm/mach-shmobile/include/mach/r8a7779.h | 2 ++ arch/arm/mach-shmobile/setup-r8a7779.c | 16 ++++++++-------- 3 files changed, 15 insertions(+), 8 deletions(-) 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 @@ -56,6 +56,10 @@ static struct regulator_consumer_supply REGULATOR_SUPPLY("vdd33a", "smsc911x"), }; +static struct rcar_phy_platform_data usb_phy_platform_data = { + .usbpctrl0 = 0, +}; + /* SMSC LAN89218 */ static struct resource smsc911x_resources[] = { [0] = { @@ -230,6 +234,7 @@ static void __init marzen_init(void) r8a7779_pinmux_init(); r8a7779_add_standard_devices(); + r8a7779_add_usb_phy_device(&usb_phy_platform_data); platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); } Index: renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h =================================================================== --- renesas.orig/arch/arm/mach-shmobile/include/mach/r8a7779.h +++ renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h @@ -4,6 +4,7 @@ #include #include #include +#include struct platform_device; @@ -33,6 +34,7 @@ extern void r8a7779_add_early_devices(vo extern void r8a7779_add_standard_devices(void); extern void r8a7779_add_standard_devices_dt(void); extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata); +extern void r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata); extern void r8a7779_init_late(void); extern void r8a7779_clock_init(void); extern void r8a7779_pinmux_init(void); Index: renesas/arch/arm/mach-shmobile/setup-r8a7779.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/setup-r8a7779.c +++ renesas/arch/arm/mach-shmobile/setup-r8a7779.c @@ -407,13 +407,6 @@ static struct resource usb_phy_resources }, }; -static struct platform_device usb_phy_device = { - .name = "rcar_usb_phy", - .id = -1, - .resource = usb_phy_resources, - .num_resources = ARRAY_SIZE(usb_phy_resources), -}; - /* USB */ static struct usb_phy *phy; @@ -586,7 +579,6 @@ static struct platform_device *r8a7779_d &scif5_device, &tmu00_device, &tmu01_device, - &usb_phy_device, }; static struct platform_device *r8a7779_standard_devices[] __initdata = { @@ -621,6 +613,14 @@ void __init r8a7779_add_ether_device(str pdata, sizeof(*pdata)); } +void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata) +{ + platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1, + usb_phy_resources, + ARRAY_SIZE(usb_phy_resources), + pdata, sizeof(*pdata)); +} + /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ void __init __weak r8a7779_register_twd(void) { }