[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191001162913.GR32742@smile.fi.intel.com>
Date: Tue, 1 Oct 2019 19:29:13 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Patrick Williams <alpawi@...zon.com>
Cc: Patrick Williams <patrick@...cx.xyz>,
Wolfram Sang <wsa@...-dreams.de>,
Jean Delvare <jdelvare@...e.de>,
Jarkko Nikula <jarkko.nikula@...ux.intel.com>,
Max Staudt <max@...as.org>,
Juergen Fitschen <jfi@...-embedded.de>,
Elie Morisse <syniurge@...il.com>,
Ajay Gupta <ajayg@...dia.com>, Stefan Roese <sr@...x.de>,
Florian Fainelli <f.fainelli@...il.com>,
Enric Balletbo i Serra <enric.balletbo@...labora.com>,
Baolin Wang <baolin.wang@...aro.org>,
Paul Cercueil <paul@...pouillou.net>,
Enrico Weigelt <info@...ux.net>,
Allison Randal <allison@...utok.net>,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] i2c: pxa: migrate to new i2c_slave APIs
On Tue, Oct 01, 2019 at 10:59:59AM -0500, Patrick Williams wrote:
> The i2c subsystem was enhanced circa 2015 to support operating as
> an i2c-slave device. Prior to that, the i2c-pxa driver supported
> an i2c-slave but had its own APIs. There are no existing in-kernel
> drivers or platforms that utilize the i2c-pxa APIs.
>
> Migrate the i2c-pxa driver to the general i2c-slave APIs so that
> existing drivers, such as the i2c-slave-eeprom, can be used.
>
> This has been tested with a Marvell EspressoBin, using i2c-pxa and
> i2c-slave-eeprom, acting as a slave, and a RaspeberryPi 3, using the
> at24 driver, acting as a master.
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.
> + 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));
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists