From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Shubin Date: Wed, 20 Oct 2021 09:51:00 +0300 Subject: [PATCH v2 4/5] lib: utils/i2c: Add minimal SiFive I2C driver In-Reply-To: References: <20211015131925.22585-1-nikita.shubin@maquefel.me> <20211015131925.22585-5-nikita.shubin@maquefel.me> Message-ID: <20211020095100.6796dfff@redslave.neermore.group> List-Id: To: opensbi@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello Alexandre! On Tue, 19 Oct 2021 14:34:30 +0200 Alexandre Ghiti 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.