summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorJoshua Stein <jcs@cvs.openbsd.org>2019-07-16 19:12:33 +0000
committerJoshua Stein <jcs@cvs.openbsd.org>2019-07-16 19:12:33 +0000
commitd2026e1834bf12902d9c0a87da24c33571f2d9a9 (patch)
treecabd4985674983869ed83ecc31041add1cce37e8 /sys/dev/ic
parentd1f9da99abf646810d0fb5ab5150eeb312567192 (diff)
don't bother reading default timing parameters if they're just going
to be overridden from ACPI
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/dwiic.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/ic/dwiic.c b/sys/dev/ic/dwiic.c
index 01d4549f55b..89489a909eb 100644
--- a/sys/dev/ic/dwiic.c
+++ b/sys/dev/ic/dwiic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwiic.c,v 1.4 2018/05/23 22:08:00 kettenis Exp $ */
+/* $OpenBSD: dwiic.c,v 1.5 2019/07/16 19:12:32 jcs Exp $ */
/*
* Synopsys DesignWare I2C controller
*
@@ -137,6 +137,18 @@ dwiic_init(struct dwiic_softc *sc)
return 1;
}
+ /* fetch default timing parameters if not already specified */
+ if (!sc->ss_hcnt)
+ sc->ss_hcnt = dwiic_read(sc, DW_IC_SS_SCL_HCNT);
+ if (!sc->ss_lcnt)
+ sc->ss_lcnt = dwiic_read(sc, DW_IC_SS_SCL_LCNT);
+ if (!sc->fs_hcnt)
+ sc->fs_hcnt = dwiic_read(sc, DW_IC_FS_SCL_HCNT);
+ if (!sc->fs_lcnt)
+ sc->fs_lcnt = dwiic_read(sc, DW_IC_FS_SCL_LCNT);
+ if (!sc->sda_hold_time)
+ sc->sda_hold_time = dwiic_read(sc, DW_IC_SDA_HOLD);
+
/* disable the adapter */
dwiic_enable(sc, 0);