diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2014-05-08 11:56:39 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-19 17:43:34 -0700 |
commit | b7ce0b5d03f303cba0fff3f9df17f400d4e7a2d8 (patch) | |
tree | eb888153def72a66ffcb36d667bc11c8a99b300f /drivers/w1/masters/mxc_w1.c | |
parent | b0dceb6a96c2f87a40a9f99bc05711a3f7c1eaa2 (diff) | |
download | op-kernel-dev-b7ce0b5d03f303cba0fff3f9df17f400d4e7a2d8.zip op-kernel-dev-b7ce0b5d03f303cba0fff3f9df17f400d4e7a2d8.tar.gz |
w1: mxc_w1: Perform a software reset at startup
This patch adds a software reset for 1-Wire module at driver startup.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1/masters/mxc_w1.c')
-rw-r--r-- | drivers/w1/masters/mxc_w1.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c index 0d05abe..741d2bb4 100644 --- a/drivers/w1/masters/mxc_w1.c +++ b/drivers/w1/masters/mxc_w1.c @@ -32,6 +32,7 @@ # define MXC_W1_CONTROL_RPP BIT(7) #define MXC_W1_TIME_DIVIDER 0x02 #define MXC_W1_RESET 0x04 +# define MXC_W1_RESET_RST BIT(0) struct mxc_w1_device { void __iomem *regs; @@ -129,6 +130,10 @@ static int mxc_w1_probe(struct platform_device *pdev) if (err) return err; + /* Software reset 1-Wire module */ + writeb(MXC_W1_RESET_RST, mdev->regs + MXC_W1_RESET); + writeb(0, mdev->regs + MXC_W1_RESET); + writeb(clkdiv - 1, mdev->regs + MXC_W1_TIME_DIVIDER); mdev->bus_master.data = mdev; |