From: Juergen Fitschen <me@jue.yt>
To: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 3/4] i2c: at91: added slave mode support
Date: Wed, 1 Nov 2017 14:04:18 +0100 [thread overview]
Message-ID: <20171101130417.GA17787@jfi-dev> (raw)
In-Reply-To: <b81e56548dbe4fa6c37fec4c80b38622f1f1fcdf.1509112910.git.me@jue.yt>
Helle Ludovic,
while going through this patch a question related to the Atmel / Microchip HW
came into mind:
On Fri, Oct 27, 2017 at 05:12:00PM +0200, Juergen Fitschen wrote:
> diff --git a/drivers/i2c/busses/i2c-at91.h b/drivers/i2c/busses/i2c-at91.h
> (...)
> #define AT91_TWI_INT_MASK \
> - (AT91_TWI_TXCOMP | AT91_TWI_RXRDY | AT91_TWI_TXRDY | AT91_TWI_NACK)
> + (AT91_TWI_TXCOMP | AT91_TWI_RXRDY | AT91_TWI_TXRDY | AT91_TWI_NACK \
> + | AT91_TWI_SVACC | AT91_TWI_EOSACC)
The AT91_TWI_INT_MASK is used to disable all interrputs in the
at91_disable_twi_interrupts function by writing the mask to the interrupt
disable register (IDR). I wonder what happens on MPUs that don't have
AT91_TWI_SVACC and AT91_TWI_EOSACC implemented, like the AT91RM9200? Do you
think we should revise this and write specific masks depending on the current
moude the I2C HW is in?
Something like this:
void at91_disable_twi_interrupts(struct at91_twi_dev *dev)
{
if (dev->slave_detected)
at91_twi_write(dev, AT91_TWI_IDR, AT91_TWI_INT_MASK_SLAVE);
else
at91_twi_write(dev, AT91_TWI_IDR, AT91_TWI_INT_MASK_MASTER);
}
Best regards
Juergen
next prev parent reply other threads:[~2017-11-01 13:04 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-27 15:10 [PATCH RFC 0/4] i2c: at91: slave mode support Juergen Fitschen
2017-10-27 15:10 ` Juergen Fitschen
2017-10-27 15:11 ` [PATCH RFC 1/4] i2c: at91: segregate master mode specific code from probe and init func Juergen Fitschen
2017-10-31 15:03 ` Ludovic Desroches
2017-10-31 15:03 ` Ludovic Desroches
2017-10-27 15:11 ` [PATCH RFC 2/4] i2c: at91: split driver into core and master file Juergen Fitschen
2017-10-31 15:04 ` Ludovic Desroches
2017-10-31 15:04 ` Ludovic Desroches
2017-10-27 15:12 ` [PATCH RFC 3/4] i2c: at91: added slave mode support Juergen Fitschen
2017-10-31 15:55 ` Ludovic Desroches
2017-10-31 15:55 ` Ludovic Desroches
2017-11-01 11:35 ` Juergen Fitschen
2017-11-01 13:04 ` Juergen Fitschen [this message]
2017-11-02 14:53 ` Ludovic Desroches
2017-11-02 14:53 ` Ludovic Desroches
2017-10-27 15:12 ` [PATCH RFC 4/4] i2c: at91: take slave mode capabilities of hardware into account Juergen Fitschen
2017-10-31 15:22 ` Ludovic Desroches
2017-10-31 15:22 ` Ludovic Desroches
2017-11-01 11:16 ` Juergen Fitschen
2017-11-02 14:47 ` Ludovic Desroches
2017-11-02 14:47 ` Ludovic Desroches
2017-11-03 8:46 ` Ludovic Desroches
2017-11-03 8:46 ` Ludovic Desroches
2017-11-03 14:07 ` Juergen Fitschen
2017-11-03 14:26 ` Ludovic Desroches
2017-11-03 14:26 ` Ludovic Desroches
2017-10-31 14:07 ` [PATCH RFC 0/4] i2c: at91: slave mode support Ludovic Desroches
2017-10-31 14:07 ` Ludovic Desroches
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=20171101130417.GA17787@jfi-dev \
--to=me@jue.yt \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@microchip.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.