summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2014-06-18 17:29:32 +0200
committerChanho Park <chanho61.park@samsung.com>2014-11-18 12:00:33 +0900
commitfd034b76333cfde9741f8b374f65139b6d94a379 (patch)
tree6e45973e1bb614a32ff167d97d809f9e99859757 /drivers/spi
parent14fee35ea8f9c5cd6f6d4c3167dce96f2aad2105 (diff)
downloadlinux-3.10-fd034b76333cfde9741f8b374f65139b6d94a379.tar.gz
linux-3.10-fd034b76333cfde9741f8b374f65139b6d94a379.tar.bz2
linux-3.10-fd034b76333cfde9741f8b374f65139b6d94a379.zip
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> [s.nawrocki@samsung.com: backported to v3.10] Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi.c6
1 files changed, 6 insertions, 0 deletions
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 <linux/mutex.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
+#include <linux/clk/clk-conf.h>
#include <linux/slab.h>
#include <linux/mod_devicetable.h>
#include <linux/spi/spi.h>
@@ -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));
}