ref: 6a3c510a4e864da781a5aac3b01d68c3368b9e3a
parent: 9b68b426103ca0564d522d9918082125836a9f23
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Nov 5 11:39:54 EST 2023
i2cbcm: use core clock rate from vcore instead of hardcoding 250Mhz
--- a/sys/src/9/bcm/i2cbcm.c
+++ b/sys/src/9/bcm/i2cbcm.c
@@ -110,7 +110,7 @@
i2cinit(I2Cbus*)
{
ctlr.regs = (Bsc*)I2CREGS;
- ctlr.regs->clkdiv = 2500;
+ ctlr.regs->clkdiv = getclkrate(ClkCore) / 100000;
gpiosel(SDA0Pin, Alt0);
gpiosel(SCL0Pin, Alt0);