[PATCH v2 4/5] lib: utils/i2c: Add minimal SiFive I2C driver
Nikita Shubin
nikita.shubin at maquefel.me
Tue Oct 19 23:51:00 PDT 2021
Hello Alexandre!
On Tue, 19 Oct 2021 14:34:30 +0200
Alexandre Ghiti <alexandre.ghiti at canonical.com> wrote:
> > +static inline void sifive_i2c_setreg(struct sifive_i2c_adapter
> > *adap,
> > + int reg, u8 value)
> > +{
> > + writel(value, (volatile void *)adap->addr + reg);
> > +}
> > +
> > +static inline u8 sifive_i2c_getreg(struct sifive_i2c_adapter
> > *adap, int reg) +{
> > + return readl((volatile void *)adap->addr + reg);
> > +}
> > +
>
> reg is defined as a uint8_t in calling functions and here as an int.
Agreed.
More information about the opensbi
mailing list