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

staging: nvec: 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: Marc Dietrich <marvin24@gmx.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Thierry Reding <treding@nvidia.com>

+12 -4
+8 -3
drivers/staging/nvec/nvec.c
··· 36 36 #include <linux/slab.h> 37 37 #include <linux/spinlock.h> 38 38 #include <linux/workqueue.h> 39 - #include <linux/clk/tegra.h> 40 39 41 40 #include "nvec.h" 42 41 ··· 733 734 734 735 clk_prepare_enable(nvec->i2c_clk); 735 736 736 - tegra_periph_reset_assert(nvec->i2c_clk); 737 + reset_control_assert(nvec->rst); 737 738 udelay(2); 738 - tegra_periph_reset_deassert(nvec->i2c_clk); 739 + reset_control_deassert(nvec->rst); 739 740 740 741 val = I2C_CNFG_NEW_MASTER_SFM | I2C_CNFG_PACKET_MODE_EN | 741 742 (0x2 << I2C_CNFG_DEBOUNCE_CNT_SHIFT); ··· 834 835 if (IS_ERR(i2c_clk)) { 835 836 dev_err(nvec->dev, "failed to get controller clock\n"); 836 837 return -ENODEV; 838 + } 839 + 840 + nvec->rst = devm_reset_control_get(&pdev->dev, "i2c"); 841 + if (IS_ERR(nvec->rst)) { 842 + dev_err(nvec->dev, "failed to get controller reset\n"); 843 + return PTR_ERR(nvec->rst); 837 844 } 838 845 839 846 nvec->base = base;
+4 -1
drivers/staging/nvec/nvec.h
··· 23 23 #include <linux/list.h> 24 24 #include <linux/mutex.h> 25 25 #include <linux/notifier.h> 26 + #include <linux/reset.h> 26 27 #include <linux/spinlock.h> 27 28 #include <linux/workqueue.h> 28 29 ··· 110 109 * @irq: The IRQ of the I2C device 111 110 * @i2c_addr: The address of the I2C slave 112 111 * @base: The base of the memory mapped region of the I2C device 113 - * @clk: The clock of the I2C device 112 + * @i2c_clk: The clock of the I2C device 113 + * @rst: The reset of the I2C device 114 114 * @notifier_list: Notifiers to be called on received messages, see 115 115 * nvec_register_notifier() 116 116 * @rx_data: Received messages that have to be processed ··· 141 139 int i2c_addr; 142 140 void __iomem *base; 143 141 struct clk *i2c_clk; 142 + struct reset_control *rst; 144 143 struct atomic_notifier_head notifier_list; 145 144 struct list_head rx_data, tx_data; 146 145 struct notifier_block nvec_status_notifier;