aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2014-06-18 11:29:32 -0400
committerMike Turquette <mturquette@linaro.org>2014-07-25 18:16:27 -0400
commit86be408bfbd846fab3c4ac21d6f9298bd2e4b790 (patch)
tree7fbcd8031f805c6faa8a55b7187bf9fd395664d7 /drivers/i2c
parent09575693a2511b5ddae0105546e0d9cefc936e34 (diff)
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. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 7c7f4b856bad..66aa83b99383 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -42,6 +42,7 @@
42#include <linux/of.h> 42#include <linux/of.h>
43#include <linux/of_device.h> 43#include <linux/of_device.h>
44#include <linux/of_irq.h> 44#include <linux/of_irq.h>
45#include <linux/clk/clk-conf.h>
45#include <linux/completion.h> 46#include <linux/completion.h>
46#include <linux/hardirq.h> 47#include <linux/hardirq.h>
47#include <linux/irqflags.h> 48#include <linux/irqflags.h>
@@ -274,6 +275,10 @@ static int i2c_device_probe(struct device *dev)
274 client->flags & I2C_CLIENT_WAKE); 275 client->flags & I2C_CLIENT_WAKE);
275 dev_dbg(dev, "probe\n"); 276 dev_dbg(dev, "probe\n");
276 277
278 status = of_clk_set_defaults(dev->of_node, false);
279 if (status < 0)
280 return status;
281
277 acpi_dev_pm_attach(&client->dev, true); 282 acpi_dev_pm_attach(&client->dev, true);
278 status = driver->probe(client, i2c_match_id(driver->id_table, client)); 283 status = driver->probe(client, i2c_match_id(driver->id_table, client));
279 if (status) 284 if (status)