public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@linaro.org>
To: Michael Turquette <mturquette@baylibre.com>
Cc: Jassi Brar <jassisinghbrar@gmail.com>,
	"Russell King <linux@arm.linux.org.uk>,
	Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	linux-clk@vger.kernel.org, sboyd@codeaurora.org
Subject: Re: Query: Clock driver requests mailbox channel
Date: Fri, 10 Jul 2015 14:08:46 +0800	[thread overview]
Message-ID: <20150710060846.GB14248@leoy-linaro> (raw)
In-Reply-To: <20150708165429.9112.88891@quantum>

On Wed, Jul 08, 2015 at 09:54:29AM -0700, Michael Turquette wrote:
> Cc'ing linux-clk and Stephen Boyd
> 
> Quoting Leo Yan (2015-07-07 07:04:25)
> > On Tue, Jul 07, 2015 at 10:54:55AM +0530, Jassi Brar wrote:
> > > On Mon, Jul 6, 2015 at 5:03 PM, Leo Yan <leo.yan@linaro.org> wrote:
> > > > Hi all,
> > > >
> > > > i'm working with one clock driver, which will invoke mailbox API to
> > > > request the mailbox channel and send message.
> > > >
> > > > Usually clock driver will init with devicetree, below is the example:
> > > > CLK_OF_DECLARE(hi6220_clk_power, "hisilicon,hi6220-clock-power",
> > > > hi6220_clk_power_init);
> > > >
> > > > Clock init function it will pass the pointer of struct device_node
> > > > but not the pointer of struct device. So finally it's difficult to
> > > > invoke mailbox API *mbox_request_channel()*, due it need use the
> > > > struct device to search DT's property "mboxes".
> > > >
> > > > I want to find which is the best way to resolve this issue, so do you
> > > > suggest clock driver to manually register one device? Or can we add
> > > > one more API to request the mailbox channel directly with device_node?
> > > >
> > > IIUC, such clocks (that require platform resources) should be
> > > populated from the platform_device's probe()?
> > 
> > Thanks for response, Jassi. If we use general platform_device's probe()
> > function, then we can smoothly to get device poiner.
> > 
> > But if we use the method with CLK_OF_DECLARE, then i tried to get device
> > pointer with the function of_find_device_by_node(), it will return the
> > device pointer is NULL. But this is the common case in many clock drivers.
> 
> Using platform_device is the right approach. Stephen has been trying to
> encourage use of that and discourage use of CLK_OF_DECLARE where
> possible.
> 
> If your clock driver needs to register some early clocks then perhaps
> those can be handled separately with CLK_OF_DECLARE and the rest can be
> managed through a proper platform_driver?

> > So i just wander if can provide another mailbox API for this case,
> > which will only need to pass device node pointer?
> 
> I can't comment on the mailbox API question, but I think the Right Thing
> is to use a platform_driver for your clock driver, which would solve
> your particular issue. This is something we are encouraging in Clock
> Land ;)

Got it and thanks for clarification. i will change to use platform_driver.
Looks like i can refer some examples in the folder drivers/clk/qcom. ;)

Thanks,
Leo Yan

      reply	other threads:[~2015-07-10  6:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150706113355.GA6967@leoy-linaro>
     [not found] ` <CABb+yY1qjq_uXTb-S4GO7rugs1Wa9j_VpSb3=0rq1Zv+-t+u2Q@mail.gmail.com>
     [not found]   ` <20150707140424.GA12992@leoy-linaro>
2015-07-08 16:54     ` Query: Clock driver requests mailbox channel Michael Turquette
2015-07-10  6:08       ` Leo Yan [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=20150710060846.GB14248@leoy-linaro \
    --to=leo.yan@linaro.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.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