Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1181352

Re: [PATCH-v3 02/11] i2c: pxa: No need to set slave addr for i2c master mode reset

From Wolfram Sang <wsa@the-dreams.de>
Newsgroups linux.kernel
Subject Re: [PATCH-v3 02/11] i2c: pxa: No need to set slave addr for i2c master mode reset
Date 2015-07-10 10:20 +0200
Message-ID <pKBHk-3ui-11@gated-at.bofh.it> (permalink)
References <pJkfw-3Ye-3@gated-at.bofh.it> <pJkfw-3Ye-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Tue, Jul 07, 2015 at 12:54:46AM +0530, Vaibhav Hiremath wrote:
> Normally i2c controller works as master, so slave addr is not needed, or it
> will impact some slave device (eg. ST NFC chip) i2c accesses, because it has
> the same i2c address with controller.

Just to make sure: Does it? As I read the code, slave interrupts are
enabled later only when slave mode is selected? Is that a HW bug? And if
so, can't the code just be moved into this #ifdef block later?

> 
> Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
>  drivers/i2c/busses/i2c-pxa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index f4ac8c5..023e59f 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -459,7 +459,7 @@ static void i2c_pxa_reset(struct pxa_i2c *i2c)
>  	writel(I2C_ISR_INIT, _ISR(i2c));
>  	writel(readl(_ICR(i2c)) & ~ICR_UR, _ICR(i2c));
>  
> -	if (i2c->reg_isar)
> +	if (i2c->reg_isar && IS_ENABLED(CONFIG_I2C_PXA_SLAVE))
>  		writel(i2c->slave_addr, _ISAR(i2c));
>  
>  	/* set control register values */
> -- 
> 1.9.1
> 

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH-v3 02/11] i2c: pxa: No need to set slave addr for i2c  master mode reset Wolfram Sang <wsa@the-dreams.de> - 2015-07-10 10:20 +0200
  Re: [PATCH-v3 02/11] i2c: pxa: No need to set slave addr for i2c  master mode reset Vaibhav Hiremath <vaibhav.hiremath@linaro.org> - 2015-07-13 09:20 +0200

csiph-web