aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-12-26 13:33:05 -0500
committerOlof Johansson <olof@lixom.net>2013-12-26 13:33:05 -0500
commite7d248f0e0f93b86c56466ede82c46234f622615 (patch)
tree36adb8e2ff0b4cc570334372389f82a73e352002 /drivers/i2c
parent1c7af42fe579b5cf8c942319cbed38801305dda4 (diff)
parent8a0a1af30cbf56b41220a02e34835022c4d72f41 (diff)
Merge tag 'tegra-for-3.14-dmas-resets-rework' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/cleanup
From Stephen Warren: ARM: tegra: implement common DMA and resets DT bindings This series converts the Tegra DTs and drivers to use the common/ standard DMA and reset bindings, rather than custom bindings. It also adds complete documentation for the Tegra clock bindings without actually changing any binding definitions. This conversion relies on a few sets of patches in branches from outside the Tegra tree: 1) A patch to add an DMA channel request API which allows deferred probe to be implemented. 2) A patch to implement a common part of the of_xlate function for DMA controllers. 3) Some ASoC patches (which in turn rely on (1) above), which support deferred probe during DMA channel allocation. 4) The Tegra clock driver changes for 3.14. Consequently, this branch is based on a merge of all of those external branches. In turn, this branch is or will be pulled into a few places that either rely on features introduced here, or would otherwise conflict with the patches: a) Tegra's own for-3.14/powergate and for-4.14/dt branches, to avoid conflicts. b) The DRM tree, which introduces new code that relies on the reset controller framework introduced in this branch, and to avoid conflicts. * tag 'tegra-for-3.14-dmas-resets-rework' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: (30 commits) spi: tegra: checking for ERR_PTR instead of NULL ASoC: tegra: update module reset list for Tegra124 clk: tegra: remove bogus PCIE_XCLK clk: tegra: remove legacy reset APIs ARM: tegra: remove legacy DMA entries from DT ARM: tegra: remove legacy clock entries from DT USB: EHCI: tegra: use reset framework Input: tegra-kbc - use reset framework serial: tegra: convert to standard DMA DT bindings serial: tegra: use reset framework spi: tegra: convert to standard DMA DT bindings spi: tegra: use reset framework staging: nvec: use reset framework i2c: tegra: use reset framework ASoC: tegra: convert to standard DMA DT bindings ASoC: tegra: allocate AHUB FIFO during probe() not startup() ASoC: tegra: call pm_runtime APIs around register accesses ASoC: tegra: use reset framework dma: tegra: register as an OF DMA controller dma: tegra: use reset framework ... Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-tegra.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index e661edee4d0c..9704537aee3c 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -27,7 +27,7 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/of_device.h> 28#include <linux/of_device.h>
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/clk/tegra.h> 30#include <linux/reset.h>
31 31
32#include <asm/unaligned.h> 32#include <asm/unaligned.h>
33 33
@@ -160,6 +160,7 @@ struct tegra_i2c_dev {
160 struct i2c_adapter adapter; 160 struct i2c_adapter adapter;
161 struct clk *div_clk; 161 struct clk *div_clk;
162 struct clk *fast_clk; 162 struct clk *fast_clk;
163 struct reset_control *rst;
163 void __iomem *base; 164 void __iomem *base;
164 int cont_id; 165 int cont_id;
165 int irq; 166 int irq;
@@ -415,9 +416,9 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
415 return err; 416 return err;
416 } 417 }
417 418
418 tegra_periph_reset_assert(i2c_dev->div_clk); 419 reset_control_assert(i2c_dev->rst);
419 udelay(2); 420 udelay(2);
420 tegra_periph_reset_deassert(i2c_dev->div_clk); 421 reset_control_deassert(i2c_dev->rst);
421 422
422 if (i2c_dev->is_dvc) 423 if (i2c_dev->is_dvc)
423 tegra_dvc_init(i2c_dev); 424 tegra_dvc_init(i2c_dev);
@@ -743,6 +744,12 @@ static int tegra_i2c_probe(struct platform_device *pdev)
743 i2c_dev->cont_id = pdev->id; 744 i2c_dev->cont_id = pdev->id;
744 i2c_dev->dev = &pdev->dev; 745 i2c_dev->dev = &pdev->dev;
745 746
747 i2c_dev->rst = devm_reset_control_get(&pdev->dev, "i2c");
748 if (IS_ERR(i2c_dev->rst)) {
749 dev_err(&pdev->dev, "missing controller reset");
750 return PTR_ERR(i2c_dev->rst);
751 }
752
746 ret = of_property_read_u32(i2c_dev->dev->of_node, "clock-frequency", 753 ret = of_property_read_u32(i2c_dev->dev->of_node, "clock-frequency",
747 &i2c_dev->bus_clk_rate); 754 &i2c_dev->bus_clk_rate);
748 if (ret) 755 if (ret)