Lines Matching refs:rpi

56 	struct raspberrypi_clk *rpi;  member
173 struct raspberrypi_clk *rpi = data->rpi; in raspberrypi_fw_is_prepared() local
177 ret = raspberrypi_clock_property(rpi->firmware, data, in raspberrypi_fw_is_prepared()
191 struct raspberrypi_clk *rpi = data->rpi; in raspberrypi_fw_get_rate() local
195 ret = raspberrypi_clock_property(rpi->firmware, data, in raspberrypi_fw_get_rate()
208 struct raspberrypi_clk *rpi = data->rpi; in raspberrypi_fw_set_rate() local
212 ret = raspberrypi_clock_property(rpi->firmware, data, in raspberrypi_fw_set_rate()
215 dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d\n", in raspberrypi_fw_set_rate()
254 static struct clk_hw *raspberrypi_clk_register(struct raspberrypi_clk *rpi, in raspberrypi_clk_register() argument
264 data = devm_kzalloc(rpi->dev, sizeof(*data), GFP_KERNEL); in raspberrypi_clk_register()
267 data->rpi = rpi; in raspberrypi_clk_register()
271 init.name = devm_kasprintf(rpi->dev, GFP_KERNEL, in raspberrypi_clk_register()
279 ret = raspberrypi_clock_property(rpi->firmware, data, in raspberrypi_clk_register()
283 dev_err(rpi->dev, "Failed to get clock %d min freq: %d\n", in raspberrypi_clk_register()
288 ret = raspberrypi_clock_property(rpi->firmware, data, in raspberrypi_clk_register()
292 dev_err(rpi->dev, "Failed to get clock %d max freq: %d\n", in raspberrypi_clk_register()
297 ret = devm_clk_hw_register(rpi->dev, &data->hw); in raspberrypi_clk_register()
304 ret = devm_clk_hw_register_clkdev(rpi->dev, &data->hw, in raspberrypi_clk_register()
307 dev_err(rpi->dev, "Failed to initialize clkdev\n"); in raspberrypi_clk_register()
333 static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, in raspberrypi_discover_clocks() argument
344 clks = devm_kcalloc(rpi->dev, in raspberrypi_discover_clocks()
350 ret = rpi_firmware_property(rpi->firmware, RPI_FIRMWARE_GET_CLOCKS, in raspberrypi_discover_clocks()
360 dev_err(rpi->dev, "Unknown clock id: %u (max: %u)\n", in raspberrypi_discover_clocks()
369 hw = raspberrypi_clk_register(rpi, clks->parent, in raspberrypi_discover_clocks()
390 struct raspberrypi_clk *rpi; in raspberrypi_clk_probe() local
413 rpi = devm_kzalloc(dev, sizeof(*rpi), GFP_KERNEL); in raspberrypi_clk_probe()
414 if (!rpi) in raspberrypi_clk_probe()
417 rpi->dev = dev; in raspberrypi_clk_probe()
418 rpi->firmware = firmware; in raspberrypi_clk_probe()
419 platform_set_drvdata(pdev, rpi); in raspberrypi_clk_probe()
427 ret = raspberrypi_discover_clocks(rpi, clk_data); in raspberrypi_clk_probe()
436 rpi->cpufreq = platform_device_register_data(dev, "raspberrypi-cpufreq", in raspberrypi_clk_probe()
444 struct raspberrypi_clk *rpi = platform_get_drvdata(pdev); in raspberrypi_clk_remove() local
446 platform_device_unregister(rpi->cpufreq); in raspberrypi_clk_remove()