[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190812200906.31344-18-andrew.smirnov@gmail.com>
Date: Mon, 12 Aug 2019 13:09:01 -0700
From: Andrey Smirnov <andrew.smirnov@...il.com>
To: linux-watchdog@...r.kernel.org
Cc: Andrey Smirnov <andrew.smirnov@...il.com>,
Chris Healy <cphealy@...il.com>,
Guenter Roeck <linux@...ck-us.net>,
Rick Ramstetter <rick@...eaterllc.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 17/22] watchdog: ziirave_wdt: Fix DOWNLOAD_END payload
Bootloader firmware expects the following traffic for DOWNLOAD_END:
S Addr Wr [A] 0x11 [A] P
using ziirave_firm_write_byte() will result in
S Addr Wr [A] 0x11 [A] 0x01 [A] 0x01 [A] P
which happens to work because firmware will ignore any extra bytes
sent. Fix this by converting the code to use i2c_smbus_write_byte()
instead.
Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.com>
Cc: Chris Healy <cphealy@...il.com>
Cc: Guenter Roeck <linux@...ck-us.net>
Cc: Rick Ramstetter <rick@...eaterllc.com>
Cc: linux-watchdog@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
drivers/watchdog/ziirave_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/ziirave_wdt.c b/drivers/watchdog/ziirave_wdt.c
index 0185b9175cc0..a598780d73d3 100644
--- a/drivers/watchdog/ziirave_wdt.c
+++ b/drivers/watchdog/ziirave_wdt.c
@@ -425,7 +425,7 @@ static int ziirave_firm_upload(struct watchdog_device *wdd,
}
/* End download operation */
- ret = ziirave_firm_write_byte(wdd, ZIIRAVE_CMD_DOWNLOAD_END, 1, false);
+ ret = i2c_smbus_write_byte(client, ZIIRAVE_CMD_DOWNLOAD_END);
if (ret) {
dev_err(&client->dev,
"Failed to end firmware download: %d\n", ret);
--
2.21.0
Powered by blists - more mailing lists