From: Chris Brandt <Chris.Brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> To: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>, Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>, Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>, Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>, Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>, "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, "linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" <linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, Linux-Renesas <linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> Subject: RE: [PATCH v3 1/3] mmc: sh_mobile_sdhi: add support for 2 clocks Date: Fri, 20 Jan 2017 15:52:04 +0000 [thread overview] Message-ID: <SG2PR06MB1165089B50C28BFD333299CB8A710@SG2PR06MB1165.apcprd06.prod.outlook.com> (raw) In-Reply-To: <CAPDyKFqO3YrDdKqOqJ=xKSH7uAiZ+rCPEDKMZ+c8Y5RKaVK4kg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> Hello Ulf, On Friday, January 20, 2017, Ulf Hansson wrote: > On 18 January 2017 at 18:25, Chris Brandt <chris.brandt@renesas.com> > wrote: > > Some controllers have 2 clock sources instead of 1, so they both need > > to be turned on/off. > > This doesn't tell me enough. Please elaborate. > > For example, tell how you treat the clocks, which of them that is optional > and why. Basically, the chip designers went in and broke out the logic that just does the card detect (more or less it's probably just some simple IRQ logic) so that you could shut off the IP block, but if you put in a card, the internal interrupt signal still went to the interrupt controller and registered the interrupt even though the rest of the IP block (including the register space) was dead. The idea seems to be that you could put the entire chip into low power mode and wake it up if you stuck a card in. My guess is that this was for some customer request or something. Personally...you could have done the same thing if you laid out a board and tied one of the extra IRQ lines to the cd signal...but I'm not sure if anyone thought about that at the time. So to your request, I could put all this ugly info into the documentation, but basically all I'm trying to do is join the 2 clocks back together to make it work like all the other SoCs since this new 'feature' might not really be practical to every use in this environment. > > static int sh_mobile_sdhi_card_busy(struct mmc_host *mmc) @@ -572,6 > > +581,10 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) > > goto eprobe; > > } > > > > + priv->clk_cd = devm_clk_get(&pdev->dev, "cd"); > > + if (IS_ERR(priv->clk_cd)) > > + priv->clk_cd = NULL; > > Is this clock solely about card detection? So in cases when you have a > GPIO card detect, the clock isn't needed? > > Just trying to understand things a bit better... According to the hardware manual, enabling the "core" clock but not the "cd" clock is not a valid setting. So in our case, it's always all or nothing. Chris
WARNING: multiple messages have this Message-ID (diff)
From: Chris Brandt <Chris.Brandt@renesas.com> To: Ulf Hansson <ulf.hansson@linaro.org> Cc: Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Simon Horman <horms@verge.net.au>, Wolfram Sang <wsa+renesas@sang-engineering.com>, Geert Uytterhoeven <geert@linux-m68k.org>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>, "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>, Linux-Renesas <linux-renesas-soc@vger.kernel.org> Subject: RE: [PATCH v3 1/3] mmc: sh_mobile_sdhi: add support for 2 clocks Date: Fri, 20 Jan 2017 15:52:04 +0000 [thread overview] Message-ID: <SG2PR06MB1165089B50C28BFD333299CB8A710@SG2PR06MB1165.apcprd06.prod.outlook.com> (raw) In-Reply-To: <CAPDyKFqO3YrDdKqOqJ=xKSH7uAiZ+rCPEDKMZ+c8Y5RKaVK4kg@mail.gmail.com> Hello Ulf, On Friday, January 20, 2017, Ulf Hansson wrote: > On 18 January 2017 at 18:25, Chris Brandt <chris.brandt@renesas.com> > wrote: > > Some controllers have 2 clock sources instead of 1, so they both need > > to be turned on/off. > > This doesn't tell me enough. Please elaborate. > > For example, tell how you treat the clocks, which of them that is optional > and why. Basically, the chip designers went in and broke out the logic that just does the card detect (more or less it's probably just some simple IRQ logic) so that you could shut off the IP block, but if you put in a card, the internal interrupt signal still went to the interrupt controller and registered the interrupt even though the rest of the IP block (including the register space) was dead. The idea seems to be that you could put the entire chip into low power mode and wake it up if you stuck a card in. My guess is that this was for some customer request or something. Personally...you could have done the same thing if you laid out a board and tied one of the extra IRQ lines to the cd signal...but I'm not sure if anyone thought about that at the time. So to your request, I could put all this ugly info into the documentation, but basically all I'm trying to do is join the 2 clocks back together to make it work like all the other SoCs since this new 'feature' might not really be practical to every use in this environment. > > static int sh_mobile_sdhi_card_busy(struct mmc_host *mmc) @@ -572,6 > > +581,10 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) > > goto eprobe; > > } > > > > + priv->clk_cd = devm_clk_get(&pdev->dev, "cd"); > > + if (IS_ERR(priv->clk_cd)) > > + priv->clk_cd = NULL; > > Is this clock solely about card detection? So in cases when you have a > GPIO card detect, the clock isn't needed? > > Just trying to understand things a bit better... According to the hardware manual, enabling the "core" clock but not the "cd" clock is not a valid setting. So in our case, it's always all or nothing. Chris
next prev parent reply other threads:[~2017-01-20 15:52 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-01-18 17:24 [PATCH v3 0/3] mmc: sh_mobile_sdhi: fix missing r7s72100 clocks Chris Brandt 2017-01-18 17:25 ` [PATCH v3 1/3] mmc: sh_mobile_sdhi: add support for 2 clocks Chris Brandt 2017-01-19 19:02 ` Wolfram Sang 2017-01-20 10:50 ` Ulf Hansson [not found] ` <CAPDyKFqO3YrDdKqOqJ=xKSH7uAiZ+rCPEDKMZ+c8Y5RKaVK4kg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2017-01-20 15:52 ` Chris Brandt [this message] 2017-01-20 15:52 ` Chris Brandt [not found] ` <SG2PR06MB1165089B50C28BFD333299CB8A710-ESzmfEwOt/xoAsOJh7vwSm0DtJ1/0DrXvxpqHgZTriW3zl9H0oFU5g@public.gmane.org> 2017-01-20 21:32 ` Wolfram Sang 2017-01-20 21:32 ` Wolfram Sang [not found] ` <20170118172502.13876-1-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> 2017-01-18 17:25 ` [PATCH v3 2/3] mmc: sh_mobile_sdhi: explain clock bindings Chris Brandt 2017-01-18 17:25 ` Chris Brandt 2017-01-19 19:02 ` Wolfram Sang 2017-01-20 11:02 ` Ulf Hansson [not found] ` <CAPDyKFq9psGMnKUx+SM_QGt6OKoMHgNFop6ANagtLOLwsMTT8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2017-01-20 16:05 ` Chris Brandt 2017-01-20 16:05 ` Chris Brandt 2017-01-20 17:12 ` Ulf Hansson 2017-01-20 18:51 ` Chris Brandt 2017-01-18 17:25 ` [PATCH v3 3/3] ARM: dts: r7s72100: update sdhi " Chris Brandt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=SG2PR06MB1165089B50C28BFD333299CB8A710@SG2PR06MB1165.apcprd06.prod.outlook.com \ --to=chris.brandt-zm6kxycvzfbbdgjk7y7tuq@public.gmane.org \ --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \ --cc=horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org \ --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \ --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \ --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \ --cc=wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.