From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Sender: rtc-linux@googlegroups.com Received: from relmlie4.idc.renesas.com (relmlor1.renesas.com. [210.160.252.171]) by gmr-mx.google.com with ESMTP id c123si1370764pfa.4.2017.03.17.06.20.12 for ; Fri, 17 Mar 2017 06:20:13 -0700 (PDT) From: Chris Brandt To: Geert Uytterhoeven CC: Alessandro Zummo , Alexandre Belloni , Rob Herring , Mark Rutland , Simon Horman , RTCLINUX , "devicetree@vger.kernel.org" , Linux-Renesas Subject: [rtc-linux] RE: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree Date: Fri, 17 Mar 2017 13:20:09 +0000 Message-ID: References: <20170316175112.27913-1-chris.brandt@renesas.com> <20170316175112.27913-4-chris.brandt@renesas.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 MIME-Version: 1.0 Reply-To: rtc-linux@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Hi Geert, On Friday, March 17, 2017, Geert Uytterhoeven wrote: > > --- a/arch/arm/boot/dts/r7s72100.dtsi > > +++ b/arch/arm/boot/dts/r7s72100.dtsi > > @@ -117,6 +117,15 @@ > > clock-output-names = "ostm0", "ostm1"; > > }; > > > > + mstp6_clks: mstp6_clks@fcfe042c { > > + #clock-cells = <1>; > > + compatible = "renesas,r7s72100-mstp-clocks", > "renesas,cpg-mstp-clocks"; > > + reg = <0xfcfe042c 4>; > > + clocks = <&p0_clk>; > > + clock-indices = ; > > + clock-output-names = "rtc0"; > > "rtc"? There's only one. The rtc-sh.c code wants to have a number at the end. So if I just put "rtc" as the clock name, it does not find it. Again, I didn't want to break any SH builds, so I just changed the DT to match the driver. [ from the rtc-sh.c code ] clk_id = pdev->id; /* With a single device, the clock id is still "rtc0" */ if (clk_id < 0) clk_id = 0; snprintf(clk_name, sizeof(clk_name), "rtc%d", clk_id); rtc->clk = devm_clk_get(&pdev->dev, clk_name); if (IS_ERR(rtc->clk)) { /* * No error handling for rtc->clk intentionally, not all * platforms will have a unique clock for the RTC, and * the clk API can handle the struct clk pointer being * NULL. */ rtc->clk = NULL; } clk_enable(rtc->clk); Cheers Chris -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Brandt Subject: RE: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree Date: Fri, 17 Mar 2017 13:20:09 +0000 Message-ID: References: <20170316175112.27913-1-chris.brandt@renesas.com> <20170316175112.27913-4-chris.brandt@renesas.com> Reply-To: rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Sender: rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org In-Reply-To: Content-Language: en-US List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Geert Uytterhoeven Cc: Alessandro Zummo , Alexandre Belloni , Rob Herring , Mark Rutland , Simon Horman , RTCLINUX , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Linux-Renesas List-Id: devicetree@vger.kernel.org Hi Geert, On Friday, March 17, 2017, Geert Uytterhoeven wrote: > > --- a/arch/arm/boot/dts/r7s72100.dtsi > > +++ b/arch/arm/boot/dts/r7s72100.dtsi > > @@ -117,6 +117,15 @@ > > clock-output-names = "ostm0", "ostm1"; > > }; > > > > + mstp6_clks: mstp6_clks@fcfe042c { > > + #clock-cells = <1>; > > + compatible = "renesas,r7s72100-mstp-clocks", > "renesas,cpg-mstp-clocks"; > > + reg = <0xfcfe042c 4>; > > + clocks = <&p0_clk>; > > + clock-indices = ; > > + clock-output-names = "rtc0"; > > "rtc"? There's only one. The rtc-sh.c code wants to have a number at the end. So if I just put "rtc" as the clock name, it does not find it. Again, I didn't want to break any SH builds, so I just changed the DT to match the driver. [ from the rtc-sh.c code ] clk_id = pdev->id; /* With a single device, the clock id is still "rtc0" */ if (clk_id < 0) clk_id = 0; snprintf(clk_name, sizeof(clk_name), "rtc%d", clk_id); rtc->clk = devm_clk_get(&pdev->dev, clk_name); if (IS_ERR(rtc->clk)) { /* * No error handling for rtc->clk intentionally, not all * platforms will have a unique clock for the RTC, and * the clk API can handle the struct clk pointer being * NULL. */ rtc->clk = NULL; } clk_enable(rtc->clk); Cheers Chris -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/d/optout. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relmlor1.renesas.com ([210.160.252.171]:46205 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750987AbdCQN1D (ORCPT ); Fri, 17 Mar 2017 09:27:03 -0400 From: Chris Brandt To: Geert Uytterhoeven CC: Alessandro Zummo , Alexandre Belloni , Rob Herring , Mark Rutland , Simon Horman , RTCLINUX , "devicetree@vger.kernel.org" , Linux-Renesas Subject: RE: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree Date: Fri, 17 Mar 2017 13:20:09 +0000 Message-ID: References: <20170316175112.27913-1-chris.brandt@renesas.com> <20170316175112.27913-4-chris.brandt@renesas.com> In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org List-ID: SGkgR2VlcnQsDQoNCk9uIEZyaWRheSwgTWFyY2ggMT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