Port-arm archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Configuring the I2C clock on the ODROID C2
Hi,
I'm testing my I2C driver for the ODROID C2 and it fails to get the I2C
peripheral clock.
In meson-gxbb.dtsi, I have:
&i2c_A {
clocks = <&clkc CLKID_I2C>;
};
and CLKID_I2C is defined as 22 in dt-bindings/clock/gxbb-clkc.h.
No clock-name is defined for this clock in the DTS.
My understanding is that the I2C peripheral shares the same clock as
many other peripherals and CLKID_I2C is only used for clock gating.
At least, it's what I guess from the very superficial public data sheet
given by HardKernel.
However, I need to first enable it, then determine this clock's
frequency in order to calculate the division factor to generate a proper
I2C SCK signal.
I sought inspiration in rk_i2c.c and did this:
sc->sc_sclk = fdtbus_clock_get(phandle, "xtal");
if (sc->sc_sclk == NULL) {
aprint_error(": couldn't get CLKID_I2C\n");
return;
} else if (clk_enable(sc->sc_sclk) != 0) {
aprint_error(": couldn't enable CLKID_I2C\n");
return;
}
"xtal" is the clock name I found in the definition of clkc.
Result: sc->sc_sclk == NULL
Then, I replaced the fdtbus_clock_get line with:
sc->sc_sclk = fdtbus_clock_get_index(phandle, 22);
22 being the value found in dt-bindings/clock/gxbb-clkc.h.
Result: sc->sc_sclk == NULL
Obviously, my guessing engine performs very poorly on this problem and I
could use some help. :)
Vincent
Home |
Main Index |
Thread Index |
Old Index