Skip to content

Commit dda9d6a

Browse files
author
Stephen Warren
committed
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>
1 parent 5608bd3 commit dda9d6a

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎drivers/i2c/busses/i2c-tegra.c‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <linux/slab.h>
2828
#include <linux/of_device.h>
2929
#include <linux/module.h>
30-
#include <linux/clk/tegra.h>
30+
#include <linux/reset.h>
3131

3232
#include <asm/unaligned.h>
3333

@@ -160,6 +160,7 @@ struct tegra_i2c_dev {
160160
struct i2c_adapter adapter;
161161
struct clk *div_clk;
162162
struct clk *fast_clk;
163+
struct reset_control *rst;
163164
void __iomem *base;
164165
int cont_id;
165166
int irq;
@@ -415,9 +416,9 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
415416
return err;
416417
}
417418

418-
tegra_periph_reset_assert(i2c_dev->div_clk);
419+
reset_control_assert(i2c_dev->rst);
419420
udelay(2);
420-
tegra_periph_reset_deassert(i2c_dev->div_clk);
421+
reset_control_deassert(i2c_dev->rst);
421422

422423
if (i2c_dev->is_dvc)
423424
tegra_dvc_init(i2c_dev);
@@ -743,6 +744,12 @@ static int tegra_i2c_probe(struct platform_device *pdev)
743744
i2c_dev->cont_id = pdev->id;
744745
i2c_dev->dev = &pdev->dev;
745746

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+
746753
ret = of_property_read_u32(i2c_dev->dev->of_node, "clock-frequency",
747754
&i2c_dev->bus_clk_rate);
748755
if (ret)

0 commit comments

Comments
 (0)