From patchwork Fri Apr 12 23:36:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2439351 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 26BA13FD40 for ; Fri, 12 Apr 2013 23:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753753Ab3DLXhW (ORCPT ); Fri, 12 Apr 2013 19:37:22 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:43500 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752759Ab3DLXhV (ORCPT ); Fri, 12 Apr 2013 19:37:21 -0400 Received: by mail-la0-f49.google.com with SMTP id fs12so2925929lab.22 for ; Fri, 12 Apr 2013 16:37:20 -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=G6WNF4WETE0/rJZvTwNO2hpsl2ryfU7oEFGhZy/s69U=; b=Yh3zrFKqhRfO/jDx2ovCdEjdzDrzOZE3t1qisosak4A+GKgKuKQ1Wzq/kKZgveVI5K p6dOtCllyP0HSgBx1RhmB/5hUk1pnLEir5ZhgW8fghqT0mcm7RwCMcRG4q8onqg1Bgqp kCnZNyFKNAN6ocqiZczOHdFPNdZ+CIln8JkpJP5NeHWspjZDXJo21DUvyqxfuYENzetn EhZJTPOgfVZ+dwd24IIYHfrWmsw5AHfVK4uo5KgI9+t0dgvPp3ripYN79e1z7Laxs/b8 eWRe+Cz30RCNr5hIuvsc3txK1m99GD1GhrHeO8+CUa004g9qiZj1mGznf6zeR7sK54T2 m8nw== X-Received: by 10.112.131.169 with SMTP id on9mr6180566lbb.124.1365809840093; Fri, 12 Apr 2013 16:37:20 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-80-224.pppoe.mtu-net.ru. [91.79.80.224]) by mx.google.com with ESMTPS id mq7sm4045506lab.1.2013.04.12.16.37.18 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Apr 2013 16:37:19 -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 v4 8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device Cc: linux-usb@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Sat, 13 Apr 2013 03:36:23 +0400 MIME-Version: 1.0 Message-Id: <201304130336.24079.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQkXXbj/JULVg4fdA2fRe7UBRwQYObuIdEr8LLAamxEzne5TLdWBevrO/aXg66UaGw+8VKtA Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.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 envolves 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. Note that the board and the SoC code have to be in one patch to keep the code bisectable... The patch has been tested on the Marzen board. Signed-off-by: Sergei Shtylyov Acked-by: Kuninori Morimoto Acked-by: Simon Horman --- Changes since version 3: - removed the initializer for 'usb_phy_platform_data'; - refreshed the 'board-marzen.c' file. Changes since version 2: - refreshed atop of the prior patches; - added a note about testing to the changelog; - added ACKs from Simon Horman and Kuninori Morimoto. Changes since the original posting: - added a note about bisectability to the changelog. arch/arm/mach-shmobile/board-marzen.c | 3 +++ arch/arm/mach-shmobile/include/mach/r8a7779.h | 2 ++ arch/arm/mach-shmobile/setup-r8a7779.c | 16 ++++++++-------- 3 files changed, 13 insertions(+), 8 deletions(-) -- 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-marzen.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/board-marzen.c +++ renesas/arch/arm/mach-shmobile/board-marzen.c @@ -57,6 +57,8 @@ static struct regulator_consumer_supply REGULATOR_SUPPLY("vdd33a", "smsc911x"), }; +static struct rcar_phy_platform_data usb_phy_platform_data; + /* SMSC LAN89218 */ static struct resource smsc911x_resources[] = { [0] = { @@ -231,6 +233,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 @@ -408,13 +408,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) { }