Skip to contentSkip to conversation

pcf2127: add watchdog support

RFC PATCH New Sean Nyekjaer 2 participants 2 messages Dec 15, 2016 – Dec 26, 2016 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 pcf2127: add watchdog support

---
- I have just noticed that the RTC driver for this device have been merged, should the watchdog part be included in the rtc driver or standalone?
- The hw_watchdog_reset is called far too often the device here is on i2c, with what i have done the reset is written every 1s
- What should be the default delay? I have chosen 20?

 drivers/watchdog/Kconfig       | 11 +++++++
 drivers/watchdog/Makefile      |  1 +
 drivers/watchdog/pcf2127_wdt.c | 69 ++++++++++++++++++++++++++++++++++++++++++
 include/pcf2127_wdt.h          |  3 ++
 4 files changed, 84 insertions(+)
 create mode 100644 drivers/watchdog/pcf2127_wdt.c
 create mode 100644 include/pcf2127_wdt.h
drivers/watchdog/Kconfig +11 -0
index e69de29bb2..957f2f3a87 100644
@@ -0,0 +1,11 @@
+#
+# Watchdog drivers configuration
+#
+
+menu "Watchdog"
+
+config PCF2127_WATCHDOG
+	depends on DM_I2C
+	bool "Enable pcf2127 i2c watchdog"
+
+endmenu
drivers/watchdog/Makefile +1 -0
index a007ae8234..3c573de016 100644
@@ -15,3 +15,4 @@ obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
 obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
+obj-$(CONFIG_PCF2127_WATCHDOG) += pcf2127_wdt.o
drivers/watchdog/pcf2127_wdt.c new file +69 -0

69 lines not on this page · raw message

include/pcf2127_wdt.h new file +3 -0
new file mode 100644
index 0000000000..3f293b2348
@@ -0,0 +1,3 @@
+#define PCF2127_I2C_ADDR 0x51
+
+void pcf2127_wdt_enable(void);
Signature · 1 line
2.11.0
#1 lore raw

RFC PATCH 1/1 pcf2127: add watchdog support

Quoted 47 lines · Sean Nyekjaer

---
- I have just noticed that the RTC driver for this device have been merged, should the watchdog part be included in the rtc driver or standalone?
- The hw_watchdog_reset is called far too often the device here is on i2c, with what i have done the reset is written every 1s
- What should be the default delay? I have chosen 20?

 drivers/watchdog/Kconfig       | 11 +++++++
 drivers/watchdog/Makefile      |  1 +
 drivers/watchdog/pcf2127_wdt.c | 69 ++++++++++++++++++++++++++++++++++++++++++
 include/pcf2127_wdt.h          |  3 ++
 4 files changed, 84 insertions(+)
 create mode 100644 drivers/watchdog/pcf2127_wdt.c
 create mode 100644 include/pcf2127_wdt.h
drivers/watchdog/Kconfig +11 -0
index e69de29bb2..957f2f3a87 100644
@@ -0,0 +1,11 @@
+#
+# Watchdog drivers configuration
+#
+
+menu "Watchdog"
+
+config PCF2127_WATCHDOG
+	depends on DM_I2C
+	bool "Enable pcf2127 i2c watchdog"
+
+endmenu
drivers/watchdog/Makefile +1 -0
index a007ae8234..3c573de016 100644
@@ -15,3 +15,4 @@ obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
 obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
+obj-$(CONFIG_PCF2127_WATCHDOG) += pcf2127_wdt.o
drivers/watchdog/pcf2127_wdt.c new file +0 -0
new file mode 100644
index 0000000000..f9276e3ea5

drivers/watchdog/pcf2127_wdt.c line 1

Quoted 1 line
drivers/watchdog/pcf2127_wdt.c new file +1 -0
@@ -0,0 +1,69 @@
+#include <common.h>

Please see all of the other c files in the code for the kind of license header you need to add here (and in the .h file).

drivers/watchdog/pcf2127_wdt.c line 57

Quoted 3 lines
drivers/watchdog/pcf2127_wdt.c new file +3 -0
+void hw_watchdog_reset(void)
+{
+	if(wdt_active == true) {

It should be 'if (wdt_active == true)', please run checkpatch.pl and fix whatever it points out.

Finally, please also enable this driver on sandbox so that it's built somewhere, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161226/f16caa44/attachment.sig>