From fd034b76333cfde9741f8b374f65139b6d94a379 Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Wed, 18 Jun 2014 17:29:32 +0200 Subject: clk: Support for clock parents and rates assigned from device tree This patch adds helper functions to configure clock parents and rates as specified through 'assigned-clock-parents', 'assigned-clock-rates' DT properties for a clock provider or clock consumer device. The helpers are now being called by the bus code for the platform, I2C and SPI busses, before the driver probing and also in the clock core after registration of a clock provider. Change-Id: I96d98c9c9d576fcbf0dfc90d1cc75feb9fdf97cb Signed-off-by: Sylwester Nawrocki [s.nawrocki@samsung.com: backported to v3.10] Acked-by: Kyungmin Park Signed-off-by: Mike Turquette --- drivers/spi/spi.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/spi') diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 085db8b2f2b..869178714f9 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -240,6 +241,11 @@ EXPORT_SYMBOL_GPL(spi_bus_type); static int spi_drv_probe(struct device *dev) { const struct spi_driver *sdrv = to_spi_driver(dev->driver); + int ret; + + ret = of_clk_set_defaults(dev->of_node, false); + if (ret) + return ret; return sdrv->probe(to_spi_device(dev)); } -- cgit v1.2.3