From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock
Date: Fri, 2 Mar 2018 09:53:46 +0530 [thread overview]
Message-ID: <20180302042345.GI15443@localhost> (raw)
In-Reply-To: <87lgfcdweo.fsf@bootlin.com>
On Thu, Mar 01, 2018 at 09:37:03AM +0100, Gregory CLEMENT wrote:
> Hi Vinod,
>
> On jeu., mars 01 2018, Vinod Koul <vinod.koul@intel.com> wrote:
>
>
> >> >> Optional properties:
> >> >> -- clocks: Optional reference to the clock used by the XOR engine.
> >> >> +- clocks: Optional reference to the clocks used by the XOR engine.
> >> >> +- clock-names: mandatory if there is a second clock, in this case the
> >> >> + name must be "core" for the first clock and "reg" for the second
> >> >> + one
> >> >> +
> >> >>
> >> >> Example:
> >> >>
> >> >> diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c
> >> >> index f652a0e0f5a2..93b3d80ce701 100644
> >> >> --- a/drivers/dma/mv_xor_v2.c
> >> >> +++ b/drivers/dma/mv_xor_v2.c
> >> >> @@ -163,6 +163,7 @@ struct mv_xor_v2_device {
> >> >> void __iomem *dma_base;
> >> >> void __iomem *glob_base;
> >> >> struct clk *clk;
> >> >> + struct clk *reg_clk;
> >> >> struct tasklet_struct irq_tasklet;
> >> >> struct list_head free_sw_desc;
> >> >> struct dma_device dmadev;
> >> >> @@ -749,13 +750,24 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
> >> >> if (ret)
> >> >> return ret;
> >> >>
> >> >> - xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
> >> >> - if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER)
> >> >> + xor_dev->reg_clk = devm_clk_get(&pdev->dev, "reg");
> >> >
> >> > is this an exiting property?
> >>
> >> It is the name of the new optional clock described in the first part of
> >> this patch.
> >
> > okay I am missing something then, you are reading "reg" but property added is
> > "clock-names", where are you reading this?
>
> "reg" is actually the _name_ of the clock given by the clock-names
> property.
>
> With devm_clk_get the second parameter is a pointer to the name of the
> clock name. When it is NULL then, the first clock is used, else in the
> common clock framework looks for the clock associated with the name
> given.
>
> With this patch both clock have now a name, but in order to be backward
> compatible, I don't use the name for the first clock. It allows to still
> use this clock with a device tree using the old binding.
Okay fine then, it might help to add this to changelog
>
> Gregory
>
>
> >
> >>
> >> About the typo, do you need a new version or do you plan to fix them
> >> while applying the patch?
please send an update
Thanks
--
~Vinod
prev parent reply other threads:[~2018-03-02 4:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 16:27 [PATCH] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock Gregory CLEMENT
2018-02-27 15:15 ` Vinod Koul
2018-02-27 15:19 ` Gregory CLEMENT
2018-03-01 8:25 ` Vinod Koul
2018-03-01 8:37 ` Gregory CLEMENT
2018-03-02 4:23 ` Vinod Koul [this message]
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=20180302042345.GI15443@localhost \
--to=vinod.koul@intel.com \
--cc=linux-arm-kernel@lists.infradead.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).