linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Patrick Williams <alpawi@amazon.com>
Cc: Patrick Williams <patrick@stwcx.xyz>,
	Wolfram Sang <wsa@the-dreams.de>, Jean Delvare <jdelvare@suse.de>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Max Staudt <max@enpas.org>,
	Juergen Fitschen <jfi@ssv-embedded.de>,
	Elie Morisse <syniurge@gmail.com>, Ajay Gupta <ajayg@nvidia.com>,
	Stefan Roese <sr@denx.de>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Baolin Wang <baolin.wang@linaro.org>,
	Paul Cercueil <paul@crapouillou.net>,
	Enrico Weigelt <info@metux.net>,
	Allison Randal <allison@lohutok.net>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] i2c: pxa: migrate to new i2c_slave APIs
Date: Tue, 1 Oct 2019 19:29:13 +0300	[thread overview]
Message-ID: <20191001162913.GR32742@smile.fi.intel.com> (raw)
In-Reply-To: <20191001160001.2388-2-alpawi@amazon.com>



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

  reply	other threads:[~2019-10-01 16:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 15:59 [PATCH 0/2] i2c: pxa: migrate to i2c-core-slave APIs Patrick Williams
2019-10-01 15:59 ` [PATCH 1/2] i2c: pxa: migrate to new i2c_slave APIs Patrick Williams
2019-10-01 16:29   ` Andy Shevchenko [this message]
2019-10-01 16:39     ` Patrick Williams
2019-11-11 20:10   ` Wolfram Sang
2019-10-01 16:00 ` [PATCH 2/2] i2c: pxa: remove unused i2c-slave APIs Patrick Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191001162913.GR32742@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=ajayg@nvidia.com \
    --cc=allison@lohutok.net \
    --cc=alpawi@amazon.com \
    --cc=baolin.wang@linaro.org \
    --cc=enric.balletbo@collabora.com \
    --cc=f.fainelli@gmail.com \
    --cc=info@metux.net \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jdelvare@suse.de \
    --cc=jfi@ssv-embedded.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max@enpas.org \
    --cc=patrick@stwcx.xyz \
    --cc=paul@crapouillou.net \
    --cc=sr@denx.de \
    --cc=syniurge@gmail.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).