Commit dda9d6a8 authored by Stephen Warren's avatar Stephen Warren

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: default avatarStephen Warren <swarren@nvidia.com>
Acked-by: default avatarWolfram Sang <wsa@the-dreams.de>
Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
parent 5608bd3e
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/clk/tegra.h> #include <linux/reset.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
...@@ -160,6 +160,7 @@ struct tegra_i2c_dev { ...@@ -160,6 +160,7 @@ struct tegra_i2c_dev {
struct i2c_adapter adapter; struct i2c_adapter adapter;
struct clk *div_clk; struct clk *div_clk;
struct clk *fast_clk; struct clk *fast_clk;
struct reset_control *rst;
void __iomem *base; void __iomem *base;
int cont_id; int cont_id;
int irq; int irq;
...@@ -415,9 +416,9 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev) ...@@ -415,9 +416,9 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
return err; return err;
} }
tegra_periph_reset_assert(i2c_dev->div_clk); reset_control_assert(i2c_dev->rst);
udelay(2); udelay(2);
tegra_periph_reset_deassert(i2c_dev->div_clk); reset_control_deassert(i2c_dev->rst);
if (i2c_dev->is_dvc) if (i2c_dev->is_dvc)
tegra_dvc_init(i2c_dev); tegra_dvc_init(i2c_dev);
...@@ -743,6 +744,12 @@ static int tegra_i2c_probe(struct platform_device *pdev) ...@@ -743,6 +744,12 @@ static int tegra_i2c_probe(struct platform_device *pdev)
i2c_dev->cont_id = pdev->id; i2c_dev->cont_id = pdev->id;
i2c_dev->dev = &pdev->dev; i2c_dev->dev = &pdev->dev;
i2c_dev->rst = devm_reset_control_get(&pdev->dev, "i2c");
if (IS_ERR(i2c_dev->rst)) {
dev_err(&pdev->dev, "missing controller reset");
return PTR_ERR(i2c_dev->rst);
}
ret = of_property_read_u32(i2c_dev->dev->of_node, "clock-frequency", ret = of_property_read_u32(i2c_dev->dev->of_node, "clock-frequency",
&i2c_dev->bus_clk_rate); &i2c_dev->bus_clk_rate);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment