Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753935AbbHYFsR (ORCPT ); Tue, 25 Aug 2015 01:48:17 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:26264 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751501AbbHYFsP (ORCPT ); Tue, 25 Aug 2015 01:48:15 -0400 X-IronPort-AV: E=Sophos;i="5.15,744,1432566000"; d="scan'208";a="193032583" From: Yoshihiro Shimoda To: Geert Uytterhoeven CC: "kishon@ti.com" , Rob Herring , "Pawel Moll" , Mark Rutland , Ian Campbell , Kumar Gala , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , Linux-sh list Subject: RE: [PATCH] phy: rcar-gen3-usb2: Add R-Car Gen3 USB2 PHY driver Thread-Topic: [PATCH] phy: rcar-gen3-usb2: Add R-Car Gen3 USB2 PHY driver Thread-Index: AQHQ2xFteqkc6k8OAkyrK0SASgX6fZ4bFmGAgAEho1A= Date: Tue, 25 Aug 2015 05:48:09 +0000 Message-ID: References: <1440052098-4840-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> In-Reply-To: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yoshihiro.shimoda.uh@renesas.com; x-originating-ip: [211.11.155.144] x-microsoft-exchange-diagnostics: 1;SG2PR06MB0919;5:16ZE5By4j3rXfB5BrkzcV+N1xSis4vwou44cDz+lsYMoYMbiyI9hsV6iaRwHlnlg129gGXjR+wS5CgvaXfsHIBzUjuTHdTyVBhxDMNV2o1qheQM1HvyqLXMac2nr5BY08gDT6GhcX9Vgm36AEPqSgA==;24:JcmOiLEKacTmGPhgAmh9nVRhuITgpjdg0lgk2hFqWbcM8rZU2rAcnIUG2YJQQdCbq4LKGF26A2WZYMcFekuh7sA+MsZzxKZ183fwEC4X+yo=;20:RlQYV91LqXutTEhYGNe+eVYNJuSViVnOQWmVOTtsOlmZe5GnXIJ8/PPXX7bg1T1SVzZ3nYo+SAd4bAxmhUcrUPKDJO1Xp7Yaop2IzeDJyORz/mkqyGl3BFJNnjva59yqz8I6OhsqxeG4jTusqTaLwipN+QLG6JrZmUsAeb85gIQ= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0919; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(8121501046)(5005006)(3002001);SRVR:SG2PR06MB0919;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0919; x-forefront-prvs: 06793E740F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(43544003)(24454002)(199003)(45984002)(189002)(40100003)(106116001)(102836002)(5003600100002)(189998001)(62966003)(2950100001)(68736005)(77096005)(19580395003)(230783001)(46102003)(106356001)(2656002)(33656002)(86362001)(575784001)(50986999)(105586002)(122556002)(19580405001)(92566002)(5004730100002)(77156002)(5001860100001)(74316001)(76576001)(5001960100002)(2900100001)(101416001)(10400500002)(66066001)(64706001)(5001830100001)(110136002)(4001540100001)(87936001)(5002640100001)(81156007)(76176999)(5007970100001)(54356999)(97736004);DIR:OUT;SFP:1102;SCL:1;SRVR:SG2PR06MB0919;H:SG2PR06MB0919.apcprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Aug 2015 05:48:09.3592 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0919 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t7P5mMo7015584 Content-Length: 4786 Lines: 151 Hi Geert-san, > Sent: Monday, August 24, 2015 9:13 PM > > Hi Shimoda-san, > > On Thu, Aug 20, 2015 at 8:28 AM, Yoshihiro Shimoda > wrote: > > This patch adds support for R-Car generation 3 USB2 PHY driver. > > This SoC has 3 EHCI/OHCI channels, and the channel 0 is shared > > with the HSUSB (USB2.0 peripheral) device. > > > > So, the purpose of this driver is: > > 1) initializes some registers of SoC specific to use the > > {ehci,ohci}-platform driver. > > > > 2) detects id pin to select host or peripheral on the channel 0. > > > > For now, this driver only supports 1) above. > > Thanks for your patch! Thank you very much for your review! > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt > > @@ -0,0 +1,37 @@ > > +* Renesas R-Car generation 3 USB 2.0 PHY > > + > > +This file provides information on what the device node for the R-Car generation > > +3 USB 2.0 PHY contains. > > + > > +Required properties: > > +- compatible: "renesas,usb2-phy-r8a7795" if the device is a part of R8A7795 SoC. > > "an R8A7795 SoC". I will fix this in v2. (I will submit v2 patch late today.) > > +- reg: offset and length of the USB2.0 host register block. > > +- reg-names: must be "usb2". > > +- clocks: clock phandle and specifier pair. > > "pair(s)." I will fix this. > > +- clock-names: string, clock input name, must be "usb2", and optional "hsusb". > > names Thank you for the point. As you mentioned about runtime PM below, I will remove this property. > > +- #phy-cells: see phy-bindings.txt in the same directory, must be <0>. > > + > > +Optional proparies: > > properties Oops, I will fix it. I should have done aspell command before I submitted. If I did that command, I found other typo in this patch :) > > +To use a USB channel which EHCI/OHCI and HSUSB are combined, the device tree > > s/which/where/ > > > +node should set HSUSB proparies to reg and reg-names proparies: > > properties (x2) I will fix it. > > +- reg: offset and length of the HSUSB register block. > > +- reg-names: must be "hsusb". > > + > > +Example (R-Car H3): > > + > > + usb-phy@ee080200 { > > + compatible = "renesas,usb2-phy-r8a7795"; > > + reg = <0 0xee080200 0 0x6ff>, <0 0xe6590100 0 0x100>; > > + reg-names = "usb2", "hsusb"; > > + clocks = <&mstp7_clks R8A7795_CLK_EHCI0>, > > + <&mstp7_clks R8A7795_CLK_HSUSB>; > > If you ever want to enable Runtime PM, do you want the first MSTP clock to be > managed automatically? > What about the second optional clock? Thank you very much for the point. I didn't take care about Runtime PM. However, I want to enable Runtime PM because usb host and function drivers support it. > > + clock-names = "usb2", "hsusb"; > > + }; > > + > > + usb-phy@ee0a0200 { > > + compatible = "renesas,usb2-phy-r8a7795"; > > + reg = <0 0xee0a0200 0 0x6ff>; > > + reg-names = "usb2"; > > + clocks = <&mstp7_clks R8A7795_CLK_EHCI0>; > > + clock-names = "usb2"; > > + }; > > > --- /dev/null > > +++ b/drivers/phy/phy-rcar-gen3-usb2.c > > > +static int rcar_gen3_phy_usb2_init(struct phy *p) > > +{ > > + struct rcar_gen3_phy_usb2_channel *channel = phy_get_drvdata(p); > > + unsigned long flags; > > + void __iomem *usb2_base = channel->usb2.base; > > + void __iomem *hsusb_base = channel->hsusb.base; > > + u32 tmp; > > + > > + /* Since ops->init() is called once, this driver enables both clocks */ > > + clk_prepare_enable(channel->usb2.clk); > > + clk_prepare_enable(channel->hsusb.clk); > > So this driver manages its clock(s) itself, and doesn't support Runtime PM. So, I will use remove clk APIs in this driver. Best regards, Yoshihiro Shimoda > > +static int rcar_gen3_phy_usb2_exit(struct phy *p) > > +{ > > + struct rcar_gen3_phy_usb2_channel *channel = phy_get_drvdata(p); > > + > > + writel(0, channel->usb2.base + USB2_INT_ENABLE); > > + > > + clk_disable_unprepare(channel->hsusb.clk); > > + clk_disable_unprepare(channel->usb2.clk); > > + > > + return 0; > > +} > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?