From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Williams Subject: Re: [PATCH 1/2] i2c: pxa: migrate to new i2c_slave APIs Date: Tue, 1 Oct 2019 11:39:10 -0500 Message-ID: <20191001163910.GA2307@8c859006a84e.ant.amazon.com> References: <20191001160001.2388-1-alpawi@amazon.com> <20191001160001.2388-2-alpawi@amazon.com> <20191001162913.GR32742@smile.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <20191001162913.GR32742@smile.fi.intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Andy Shevchenko Cc: Patrick Williams , Wolfram Sang , Jean Delvare , Jarkko Nikula , Max Staudt , Juergen Fitschen , Elie Morisse , Ajay Gupta , Stefan Roese , Florian Fainelli , Enric Balletbo i Serra , Baolin Wang , Paul Cercueil , Enrico Weigelt , Allison Randal , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-i2c@vger.kernel.org Thanks for the review Andy. On Tue, Oct 01, 2019 at 07:29:13PM +0300, Andy Shevchenko wrote: > > > On Tue, Oct 01, 2019 at 10:59:59AM -0500, Patrick Williams wrote: > There are quite a few people in the Cc list. I'm not sure they all are > interested in this. I deliberately dropped few names, sorry, if I was mistaken. Agree it was kind of a big list. Just chose what was given to me by get_maintainer.pl. It seems like there isn't a direct identified maintainer of this file. > > > + if (isr & ISR_RWM) { > > + u8 byte = 0; > > + > > + i2c_slave_event(i2c->slave, I2C_SLAVE_READ_REQUESTED, > > + &byte); > > + writel(byte, _IDBR(i2c)); > > + } else { > > + i2c_slave_event(i2c->slave, I2C_SLAVE_WRITE_REQUESTED, > > + NULL); > > + } > > Hmm... Perhaps > > u8 byte = 0; > > i2c_slave_event(i2c->slave, I2C_SLAVE_READ_REQUESTED, &byte); > if (isr & ISR_RWM) > writel(byte, _IDBR(i2c)); > The two different paths also require READ_REQUEST vs WRITE_REQUESTED. I could do a ternary there but it seemed more obvious to just unroll the logic. -- - Patrick