Re: [PATCH 10/11] i2c: designware: Remove common i2c_dw_disable_int()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 26, 2022 at 03:39:11PM +0300, Jarkko Nikula wrote:
> i2c_dw_disable_int() and disable_int pointer in struct dw_i2c_dev were
> introduced by the commit 90312351fd1e ("i2c: designware: MASTER mode as
> separated driver") but it looks i2c_dw_disable_int() was never called
> through the pointer.

But the last part is not true... See below.

> Since i2c_dw_disable_int() is just masking interrupts and the direct
> DW_IC_INTR_MASK register write looks more clear in the code use that and
> remove from common code.

...

>  	else if (unlikely(dev->flags & ACCESS_INTR_MASK)) {
>  		/* Workaround to trigger pending interrupt */
>  		regmap_read(dev->map, DW_IC_INTR_MASK, &stat);
> -		i2c_dw_disable_int(dev);
> +		regmap_write(dev->map, DW_IC_INTR_MASK, 0);
>  		regmap_write(dev->map, DW_IC_INTR_MASK, stat);

Not sure I understood this dance. What exactly happen for the interrupts
that are getting masked and immediately unmasked? Is that the core of
the above mentioned workaround?

>  	}

...

> -	dev->disable_int(dev);
> +	regmap_write(dev->map, DW_IC_INTR_MASK, 0);

Called via pointer, didn't it?

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux