Re: Meson I2C driver working

Vincent DEFERT <[email protected]>
Newsgroups gmane.os.netbsd.ports.arm
Message-ID <[email protected]>
Thank you for the review! :)
I have updated https://www.defert.com/meson-i2c.tgz accordingly.

I have used an external 24C256 for my tests.
I tested both 100kHz and 400kHz and verified the clock frequency with an 
oscilloscope.
I also tested both i2c_A and i2c_B, available on the ODROID C2's GPIO 
connector.
I used my own test program to make sure my code works with large blocks 
of data (seeprom(4) works only one byte at a time).


On 28/06/2025 21:34, Robert Swindells wrote:
> Vincent DEFERT <[email protected]> wrote:
>> Now, what's the procedure for submitting it for merge?
>> I have added 2 files and modified 2 other files.
> I spotted some style things that I think we would want to change before
> adding it:
>
> There was some trailing whitespace in the meson_i2c.c file.
>
> We usually tag softc structure members with a common stem, so members of
> 'struct mesoni2c_softc' would start with 'sc_'.
>
> The comment on the first line and a line after the include of
> <sys/cdefs.h> with a __KERNEL_RCSID macro to hold the CVS tag were
> missing.
>
> The #define values at the top of the file could be made to line up.
>
> The entry in files.meson for it doesn't define a 'condition', so the
> file would always get included whether it was in a kernel config or
> not. The GENERIC64 kernel ends up including everything anyway but
> some people (like me) still do custom kernels.
>
> Maybe change it to this:
>
> device  mesoniic: i2cbus, i2cexec
> attach  mesoniic at fdt with meson_i2c
> file    arch/arm/amlogic/meson_i2c.c            meson_i2c
>
> Then change the first argument to the CFATTACH_DECL_NEW to match it:
>
> CFATTACH_DECL_NEW(meson_i2c, sizeof(struct mesoni2c_softc),
>      mesoni2c_match, mesoni2c_attach, NULL, NULL);
>
>
> Did you wire up an EPROM yourself or is it actually on all the odroid-c2
> boards?
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.