[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201104103531.GA3984@ninjato>
Date: Wed, 4 Nov 2020 11:35:31 +0100
From: Wolfram Sang <wsa@...nel.org>
To: Michael.Wu@...ics.com
Cc: jarkko.nikula@...ux.intel.com, andriy.shevchenko@...ux.intel.com,
mika.westerberg@...ux.intel.com, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, morgan.chang@...ics.com
Subject: Re: [PATCH 2/2] i2c: designware: slave should do WRITE_REQUESTED
before WRITE_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.
Thanks for the detailed explanation! Okay, then what you do looks
correct to me (from a high level perspective without really knowing the
HW): when RX is full, you first send the state WRITE_REQUESTED when
there is no other transfer on-going. Then you send WRITE_RECEIVED
immediately. I think this is the way to do it.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists