Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/rockchip Calculate i2c divisor based on sclk no...



details:   https://anonhg.NetBSD.org/src/rev/937de0d90ca4
branches:  trunk
changeset: 366547:937de0d90ca4
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Sep 02 01:16:03 2018 +0000

description:
Calculate i2c divisor based on sclk not pclk

diffstat:

 sys/arch/arm/rockchip/rk_i2c.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 097afe9ea17c -r 937de0d90ca4 sys/arch/arm/rockchip/rk_i2c.c
--- a/sys/arch/arm/rockchip/rk_i2c.c    Sun Sep 02 00:48:12 2018 +0000
+++ b/sys/arch/arm/rockchip/rk_i2c.c    Sun Sep 02 01:16:03 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_i2c.c,v 1.2 2018/09/02 00:48:12 jmcneill Exp $ */
+/* $NetBSD: rk_i2c.c,v 1.3 2018/09/02 01:16:03 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: rk_i2c.c,v 1.2 2018/09/02 00:48:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_i2c.c,v 1.3 2018/09/02 01:16:03 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -137,7 +137,7 @@
         * SCL = PCLK / SCLK Divisor
         */
 
-       rate = clk_get_rate(sc->sc_pclk);
+       rate = clk_get_rate(sc->sc_sclk);
        div = howmany(rate, sc->sc_clkfreq * 8) - 2;
        if (div >= 0) {
                divl = div / 2;



Home | Main Index | Thread Index | Old Index