firmware: raspberrypi: register clk device
Since clk-raspberrypi is tied to the VC4 firmware instead of particular hardware it's registration should be performed by the firmware driver. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
4e85e535e6
commit
91f2cf4a6b
|
@ -20,6 +20,7 @@
|
||||||
#define MBOX_CHAN_PROPERTY 8
|
#define MBOX_CHAN_PROPERTY 8
|
||||||
|
|
||||||
static struct platform_device *rpi_hwmon;
|
static struct platform_device *rpi_hwmon;
|
||||||
|
static struct platform_device *rpi_clk;
|
||||||
|
|
||||||
struct rpi_firmware {
|
struct rpi_firmware {
|
||||||
struct mbox_client cl;
|
struct mbox_client cl;
|
||||||
|
@ -207,6 +208,12 @@ rpi_register_hwmon_driver(struct device *dev, struct rpi_firmware *fw)
|
||||||
-1, NULL, 0);
|
-1, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rpi_register_clk_driver(struct device *dev)
|
||||||
|
{
|
||||||
|
rpi_clk = platform_device_register_data(dev, "raspberrypi-clk",
|
||||||
|
-1, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static int rpi_firmware_probe(struct platform_device *pdev)
|
static int rpi_firmware_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
|
@ -234,6 +241,7 @@ static int rpi_firmware_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
rpi_firmware_print_firmware_revision(fw);
|
rpi_firmware_print_firmware_revision(fw);
|
||||||
rpi_register_hwmon_driver(dev, fw);
|
rpi_register_hwmon_driver(dev, fw);
|
||||||
|
rpi_register_clk_driver(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -254,6 +262,8 @@ static int rpi_firmware_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
platform_device_unregister(rpi_hwmon);
|
platform_device_unregister(rpi_hwmon);
|
||||||
rpi_hwmon = NULL;
|
rpi_hwmon = NULL;
|
||||||
|
platform_device_unregister(rpi_clk);
|
||||||
|
rpi_clk = NULL;
|
||||||
mbox_free_channel(fw->chan);
|
mbox_free_channel(fw->chan);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue