Commit b7ce0b5d authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Greg Kroah-Hartman

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: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b0dceb6a
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
# define MXC_W1_CONTROL_RPP BIT(7) # define MXC_W1_CONTROL_RPP BIT(7)
#define MXC_W1_TIME_DIVIDER 0x02 #define MXC_W1_TIME_DIVIDER 0x02
#define MXC_W1_RESET 0x04 #define MXC_W1_RESET 0x04
# define MXC_W1_RESET_RST BIT(0)
struct mxc_w1_device { struct mxc_w1_device {
void __iomem *regs; void __iomem *regs;
...@@ -129,6 +130,10 @@ static int mxc_w1_probe(struct platform_device *pdev) ...@@ -129,6 +130,10 @@ static int mxc_w1_probe(struct platform_device *pdev)
if (err) if (err)
return 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); writeb(clkdiv - 1, mdev->regs + MXC_W1_TIME_DIVIDER);
mdev->bus_master.data = mdev; mdev->bus_master.data = mdev;
......
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