summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2021-01-13 11:01:19 +0000
committerkettenis <kettenis@openbsd.org>2021-01-13 11:01:19 +0000
commit48c44e63ed4ef2dc2c40dfccc9f1e07f2606dec9 (patch)
treea76559d2139ec3a9b44c910909ea1a3fd515abcb
parentExtend med test with a withdraw that causes a flip in the order. (diff)
downloadwireguard-openbsd-48c44e63ed4ef2dc2c40dfccc9f1e07f2606dec9.tar.xz
wireguard-openbsd-48c44e63ed4ef2dc2c40dfccc9f1e07f2606dec9.zip
Add support for the HYM8563 RTC, which is a PCF8563 clone.
ok kurt@
-rw-r--r--sys/dev/i2c/pcf8563.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/i2c/pcf8563.c b/sys/dev/i2c/pcf8563.c
index c1776e1c51d..1b78492f055 100644
--- a/sys/dev/i2c/pcf8563.c
+++ b/sys/dev/i2c/pcf8563.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcf8563.c,v 1.2 2019/10/06 15:45:37 kettenis Exp $ */
+/* $OpenBSD: pcf8563.c,v 1.3 2021/01/13 11:01:19 kettenis Exp $ */
/*
* Copyright (c) 2005 Kimihiro Nonaka
@@ -44,8 +44,6 @@
* PCF8563 Real-Time Clock
*/
-#define PCF8563_ADDR 0x51 /* Fixed I2C Slave Address */
-
#define PCF8563_CONTROL1 0x00
#define PCF8563_CONTROL2 0x01
#define PCF8563_SECONDS 0x02
@@ -106,8 +104,8 @@ pcxrtc_match(struct device *parent, void *v, void *arg)
{
struct i2c_attach_args *ia = arg;
- if (strcmp(ia->ia_name, "nxp,pcf8563") == 0 &&
- ia->ia_addr == PCF8563_ADDR)
+ if (strcmp(ia->ia_name, "nxp,pcf8563") == 0 ||
+ strcmp(ia->ia_name, "haoyu,hym8563") == 0)
return (1);
return (0);