From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Michael.Wu@vatics.com, wsa@kernel.org
Cc: andriy.shevchenko@linux.intel.com,
mika.westerberg@linux.intel.com, linux-i2c@vger.kernel.org,
linux-kernel@vger.kernel.org, morgan.chang@vatics.com
Subject: Re: [PATCH 2/2] i2c: designware: slave should do WRITE_REQUESTED before WRITE_RECEIVED
Date: Thu, 5 Nov 2020 11:13:14 +0200 [thread overview]
Message-ID: <815503b2-0124-b42e-be08-1f47e2dd0ee8@linux.intel.com> (raw)
In-Reply-To: <5DB475451BAA174CB158B5E897FC1525B1295560@MBS07.vivotek.tw>
On 11/4/20 12:17 PM, Michael.Wu@vatics.com wrote:
> Hi Wolfram,
>
>>> dev->status can be used to record the current state, especially Designware
>>> I2C controller has no interrupts to identify a write-request. This patch
>>
>> Just double-checking: the designware HW does not raise an interrupt when
>> its own address + RW bit has been received?
>
> Not exactly. There're an interrupt state name "RD_REQ" but no one named
> like "WR_REQ".
>
> For read-request, the slave will get a RD_REQ interrupt.
> For write-request, the slave won't be interrupted until data arrived to
> trigger interrupt "RX_FULL".
>
> I tried to use GPIO to simulate an I2C master. I only sent its own
> address + W bit without any data and then I got only a STOP_DET interrupt.
> If I sent its own address + W bit + one byte data and then I got one
> RX_FULL and a STOP_DET.
>
> It seems the controller doesn't interrupt when RW bit is W, but R does.
> What do you think, Jarkko?
>
Yes, the datasheet has a flowchart for slave mode and it shows for a
write only RX_FULL interrupt followed by read from IC_DATA_CMD to
retrieve received byte. Which I believe won't occur if there is no
incoming data byte and only STOP_DET happens as you have observed. The
flowchart however doesn't include the STOP_DET flow.
Jarkko
next prev parent reply other threads:[~2020-11-05 9:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 8:04 [PATCH 0/2] Designware I2C slave confusing IC_INTR_STOP_DET handle Michael Wu
2020-10-30 8:04 ` [PATCH 1/2] i2c: designware: call i2c_dw_read_clear_intrbits_slave() once Michael Wu
2020-10-30 8:04 ` [PATCH 2/2] i2c: designware: slave should do WRITE_REQUESTED before WRITE_RECEIVED Michael Wu
2020-10-30 14:46 ` Jarkko Nikula
2020-11-03 21:03 ` Wolfram Sang
2020-11-04 10:17 ` Michael.Wu
2020-11-04 10:35 ` Wolfram Sang
2020-11-04 10:51 ` Michael.Wu
2020-11-05 9:13 ` Jarkko Nikula [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-10-16 6:04 [PATCH 1/2] i2c: designware: call i2c_dw_read_clear_intrbits_slave() once Michael Wu
2020-10-16 6:04 ` [PATCH 2/2] i2c: designware: slave should do WRITE_REQUESTED before WRITE_RECEIVED Michael Wu
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=815503b2-0124-b42e-be08-1f47e2dd0ee8@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=Michael.Wu@vatics.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=morgan.chang@vatics.com \
--cc=wsa@kernel.org \
/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).