Re: [PATCH 3/4] clk: bcm2835: register Raspberry Pi's firmware clk device

2019-06-05 Thread Stefan Wahren
Am 05.06.19 um 11:11 schrieb Nicolas Saenz Julienne:
> On Tue, 2019-06-04 at 17:00 -0700, Eric Anholt wrote:
>> Nicolas Saenz Julienne  writes:
>>
>>> Registers clk-raspberrypi as a platform device as part of the driver's
>>> probe sequence.
>> Similar to how we have VCHI register platform devices for the services
>> VCHI provides, shouldn't we have the firmware driver register the device
>> for clk_raspberrypi?  Or put the clk provider in the fw driver instead
>> of a separate driver (no opinion on my part).
> Makes sense to me, I'll move the platform driver registration into the 
> firmware
> driver.
Fine. Please keep in mind that you might need to add a MODULE_ALIAS
otherwise autoload won't work.


Re: [PATCH 3/4] clk: bcm2835: register Raspberry Pi's firmware clk device

2019-06-05 Thread Nicolas Saenz Julienne
On Tue, 2019-06-04 at 17:00 -0700, Eric Anholt wrote:
> Nicolas Saenz Julienne  writes:
> 
> > Registers clk-raspberrypi as a platform device as part of the driver's
> > probe sequence.
> 
> Similar to how we have VCHI register platform devices for the services
> VCHI provides, shouldn't we have the firmware driver register the device
> for clk_raspberrypi?  Or put the clk provider in the fw driver instead
> of a separate driver (no opinion on my part).

Makes sense to me, I'll move the platform driver registration into the firmware
driver.



signature.asc
Description: This is a digitally signed message part


Re: [PATCH 3/4] clk: bcm2835: register Raspberry Pi's firmware clk device

2019-06-04 Thread Eric Anholt
Nicolas Saenz Julienne  writes:

> Registers clk-raspberrypi as a platform device as part of the driver's
> probe sequence.

Similar to how we have VCHI register platform devices for the services
VCHI provides, shouldn't we have the firmware driver register the device
for clk_raspberrypi?  Or put the clk provider in the fw driver instead
of a separate driver (no opinion on my part).


signature.asc
Description: PGP signature


[PATCH 3/4] clk: bcm2835: register Raspberry Pi's firmware clk device

2019-06-04 Thread Nicolas Saenz Julienne
Registers clk-raspberrypi as a platform device as part of the driver's
probe sequence.

Signed-off-by: Nicolas Saenz Julienne 
---
 drivers/clk/bcm/clk-bcm2835.c | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index ccb0319fc2e9..6f370e6bafed 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -2098,6 +2098,7 @@ static int bcm2835_mark_sdc_parent_critical(struct clk 
*sdc)
 
 static int bcm2835_clk_probe(struct platform_device *pdev)
 {
+   struct platform_device *rpi_fw_clk;
struct device *dev = >dev;
struct clk_hw **hws;
struct bcm2835_cprman *cprman;
@@ -2150,8 +2151,18 @@ static int bcm2835_clk_probe(struct platform_device 
*pdev)
if (ret)
return ret;
 
-   return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
- >onecell);
+   ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
+>onecell);
+   if (ret)
+   return ret;
+
+   rpi_fw_clk = platform_device_register_data(NULL, "raspberrypi-clk", -1,
+  NULL, 0);
+   ret = PTR_ERR_OR_ZERO(rpi_fw_clk);
+   if (ret)
+   dev_err(dev, "Failed to create platform device, %d\n", ret);
+
+   return ret;
 }
 
 static const struct of_device_id bcm2835_clk_of_match[] = {
-- 
2.21.0