Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: tegra: use reset framework

Tegra's clock driver now provides an implementation of the common
reset API (include/linux/reset.h). Use this instead of the old Tegra-
specific API; that will soon be removed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Reviewed-by: Thierry Reding <treding@nvidia.com>

+10 -3
+10 -3
drivers/i2c/busses/i2c-tegra.c
··· 27 27 #include <linux/slab.h> 28 28 #include <linux/of_device.h> 29 29 #include <linux/module.h> 30 - #include <linux/clk/tegra.h> 30 + #include <linux/reset.h> 31 31 32 32 #include <asm/unaligned.h> 33 33 ··· 160 160 struct i2c_adapter adapter; 161 161 struct clk *div_clk; 162 162 struct clk *fast_clk; 163 + struct reset_control *rst; 163 164 void __iomem *base; 164 165 int cont_id; 165 166 int irq; ··· 416 415 return err; 417 416 } 418 417 419 - tegra_periph_reset_assert(i2c_dev->div_clk); 418 + reset_control_assert(i2c_dev->rst); 420 419 udelay(2); 421 - tegra_periph_reset_deassert(i2c_dev->div_clk); 420 + reset_control_deassert(i2c_dev->rst); 422 421 423 422 if (i2c_dev->is_dvc) 424 423 tegra_dvc_init(i2c_dev); ··· 743 742 i2c_dev->irq = irq; 744 743 i2c_dev->cont_id = pdev->id; 745 744 i2c_dev->dev = &pdev->dev; 745 + 746 + i2c_dev->rst = devm_reset_control_get(&pdev->dev, "i2c"); 747 + if (IS_ERR(i2c_dev->rst)) { 748 + dev_err(&pdev->dev, "missing controller reset"); 749 + return PTR_ERR(i2c_dev->rst); 750 + } 746 751 747 752 ret = of_property_read_u32(i2c_dev->dev->of_node, "clock-frequency", 748 753 &i2c_dev->bus_clk_rate);