linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: pierre-yves.mordret@st.com (Pierre Yves MORDRET)
To: linux-arm-kernel@lists.infradead.org
Subject: [RESEND PATCH v1 2/6] i2c: i2c-stm32f7: Add slave support
Date: Wed, 21 Mar 2018 11:47:27 +0100	[thread overview]
Message-ID: <f5389af1-257d-2887-531c-d3bd67b20524@st.com> (raw)
In-Reply-To: <c7fa1cc2-a298-967c-6006-942fd631b4f0@st.com>

Hi Wolfram

STM32 I2C F7 can be both Master and Slave mode.
Whenever a master command (I2C or SMBus) a START condition is generated and the
master flag (master_mode) is set and managed accordingly : sw and ITs/
Now if a slave is registered it's managed accordingly as long as there is no
master command on going.
IRqs are not separated neither Regs bits. The routing is done though out START
condition.
This driver is not slave-only driver and can act as master if a master command
is issued and slave if registered as such.

Hope it clarifies
Regards

On 03/20/2018 11:17 AM, Pierre Yves MORDRET wrote:
> 
> 
> On 03/20/2018 10:52 AM, Wolfram Sang wrote:
>>
>>> I do believe the hw can support it, even it looks odd to me having the same I2C
>>> in slave and master mode at the same time.
>>
>> I2C is multi-master, so it is perfectly valid for a device to be master
>> and slave. I do have seen designs making use of that more than once.
>>
>>> Nevertheless the driver is devised to support either master or slave more but
>>> not at the same time.
>>
>> Why should we limit ourselves here? Also, why should we have an
>> unnecessary configuration option?
>>
>> Unless the HW is broken and does not support it, I usually don't accept
>> slave-only solutions. If the needs for master and slave arises later,
>> this is hard to refactor and better done properly right away.
>>
>> Is it so hard? Usually you have irqs for master and for slave seperated,
>> so you can code things quite orthogonal. Check de20d1857dd6 ("i2c: rcar:
>> add slave support") as an example.
>>
> 
> I need to check at my end but status bits are shared between master and slave in
> my IP: i.e. Tx Empty, Rx Empty, NAxk, Stop.
> Both bits have a meaning in either master and slave mode. In your case status
> bits are separated between master and slave.
> BTW I need to think about it.
> 

  reply	other threads:[~2018-03-21 10:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12 10:53 [RESEND PATCH v1 0/6] Add different features for I2C Pierre-Yves MORDRET
2018-03-12 10:53 ` [RESEND PATCH v1 1/6] i2c: i2c-stm32f7: Add 10-bit address support Pierre-Yves MORDRET
2018-03-12 10:53 ` [RESEND PATCH v1 2/6] i2c: i2c-stm32f7: Add slave support Pierre-Yves MORDRET
2018-03-17 20:51   ` Wolfram Sang
2018-03-19  8:41     ` Pierre Yves MORDRET
2018-03-20  9:52       ` Wolfram Sang
2018-03-20 10:17         ` Pierre Yves MORDRET
2018-03-21 10:47           ` Pierre Yves MORDRET [this message]
2018-03-12 10:53 ` [RESEND PATCH v1 3/6] i2c: i2c-stm32f7: Add initial SMBus protocols support Pierre-Yves MORDRET
2018-03-13 12:52   ` kbuild test robot
2018-03-13 12:52   ` [PATCH] i2c: i2c-stm32f7: fix semicolon.cocci warnings kbuild test robot
2018-03-12 10:53 ` [RESEND PATCH v1 4/6] i2c: i2c-stm32: Add generic DMA API Pierre-Yves MORDRET
2018-03-12 10:53 ` [RESEND PATCH v1 5/6] i2c: i2c-stm32f7: Add DMA support Pierre-Yves MORDRET
2018-03-14  9:06   ` kbuild test robot
2018-03-12 10:53 ` [RESEND PATCH v1 6/6] i2c: i2c-stm32f7: Implement I2C recovery mechanism Pierre-Yves MORDRET
2018-03-17 20:47   ` Wolfram Sang
2018-03-19  8:51     ` Pierre Yves MORDRET
2018-03-20  9:31       ` Pierre Yves MORDRET
2018-03-20  9:42         ` Wolfram Sang
2018-03-20  9:45           ` Pierre Yves MORDRET
2018-03-19  9:36   ` Phil Reid
2018-03-19 16:25     ` Pierre Yves MORDRET
  -- strict thread matches above, loose matches on Subject: below --
2018-02-27  9:48 [RESEND PATCH v1 0/6] Add different features for I2C Pierre-Yves MORDRET
2018-02-27  9:48 ` [RESEND PATCH v1 2/6] i2c: i2c-stm32f7: Add slave support Pierre-Yves MORDRET

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=f5389af1-257d-2887-531c-d3bd67b20524@st.com \
    --to=pierre-yves.mordret@st.com \
    --cc=linux-arm-kernel@lists.infradead.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).