Messages in this thread | | | Date | Tue, 7 Jul 2015 22:04:25 +0800 | From | Leo Yan <> | Subject | Re: Query: Clock driver requests mailbox channel |
| |
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.
So i just wander if can provide another mailbox API for this case, which will only need to pass device node pointer?
Thanks, Leo Yan
| |