public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V1] i2c: designware: fix wrong tx/rx fifo for ACPI
@ 2016-11-29  3:32 Tin Huynh
  2016-11-29  9:04 ` Mika Westerberg
  0 siblings, 1 reply; 4+ messages in thread
From: Tin Huynh @ 2016-11-29  3:32 UTC (permalink / raw)
  To: Jarkko Nikula, Andy Shevchenko, Mika Westerberg, Wolfram Sang
  Cc: linux-i2c, linux-kernel, linux-acpi, Loc Ho, Thang Nguyen,
	Phong Vo, patches, Tin Huynh

ACPI always sets txfifo and rxfifo to 32. This configuration will
cause problem if the IP core supports a fifo size of 16 bytes only.
Set the default value to 0 so the driver will get these parameters 
from IP core.

Signed-off-by: Tin Huynh <tnhuynh@apm.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 0b42a12..c88a4b8 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -97,8 +97,8 @@ static int dw_i2c_acpi_configure(struct platform_device *pdev)
 	const struct acpi_device_id *id;
 
 	dev->adapter.nr = -1;
-	dev->tx_fifo_depth = 32;
-	dev->rx_fifo_depth = 32;
+	dev->tx_fifo_depth = 0;
+	dev->rx_fifo_depth = 0;
 
 	/*
 	 * Try to get SDA hold time and *CNT values from an ACPI method if
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH V1] i2c: designware: fix wrong tx/rx fifo for ACPI
  2016-11-29  3:32 [PATCH V1] i2c: designware: fix wrong tx/rx fifo for ACPI Tin Huynh
@ 2016-11-29  9:04 ` Mika Westerberg
       [not found]   ` <CANQ9TuBLeiXCcZANic7K+JrwPSpgZ8Qxm8kPBrwvK0h1y7bOuA@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Mika Westerberg @ 2016-11-29  9:04 UTC (permalink / raw)
  To: Tin Huynh
  Cc: Jarkko Nikula, Andy Shevchenko, Wolfram Sang, linux-i2c,
	linux-kernel, linux-acpi, Loc Ho, Thang Nguyen, Phong Vo, patches

On Tue, Nov 29, 2016 at 10:32:07AM +0700, Tin Huynh wrote:
> ACPI always sets txfifo and rxfifo to 32. This configuration will
> cause problem if the IP core supports a fifo size of 16 bytes only.
> Set the default value to 0 so the driver will get these parameters 
> from IP core.

Except when those values are not available which is the reason why we
have the default 32 for ACPI systems.

Are you saying you have DW I2C controller on ACPI system where the FIFO
is smaller than 32?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V1] i2c: designware: fix wrong tx/rx fifo for ACPI
       [not found]   ` <CANQ9TuBLeiXCcZANic7K+JrwPSpgZ8Qxm8kPBrwvK0h1y7bOuA@mail.gmail.com>
@ 2016-11-29  9:26     ` Mika Westerberg
  2016-11-29  9:36       ` Tin Huynh
  0 siblings, 1 reply; 4+ messages in thread
From: Mika Westerberg @ 2016-11-29  9:26 UTC (permalink / raw)
  To: Tin Huynh
  Cc: Jarkko Nikula, Andy Shevchenko, Wolfram Sang, linux-i2c,
	linux-kernel, linux-acpi, Loc Ho, Thang Nguyen, Phong Vo, patches

On Tue, Nov 29, 2016 at 04:15:13PM +0700, Tin Huynh wrote:
>    Yes , My IP core supports 16 bytes size only . Should we get this
>    parameter from ACPI table instead of 32 ?

What if we set the default 32 from ACPI as currently but then read the
value from hardware as well and pick the smaller one of the two?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V1] i2c: designware: fix wrong tx/rx fifo for ACPI
  2016-11-29  9:26     ` Mika Westerberg
@ 2016-11-29  9:36       ` Tin Huynh
  0 siblings, 0 replies; 4+ messages in thread
From: Tin Huynh @ 2016-11-29  9:36 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Jarkko Nikula, Andy Shevchenko, Wolfram Sang, linux-i2c,
	linux-kernel, linux-acpi, Loc Ho, Thang Nguyen, Phong Vo, patches

On Tue, Nov 29, 2016 at 4:26 PM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> On Tue, Nov 29, 2016 at 04:15:13PM +0700, Tin Huynh wrote:
>>    Yes , My IP core supports 16 bytes size only . Should we get this
>>    parameter from ACPI table instead of 32 ?
>
> What if we set the default 32 from ACPI as currently but then read the
> value from hardware as well and pick the smaller one of the two?
Yes , it should be ok. I will create new patch as your request


-- 
Sr SW Eng

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-29  9:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-29  3:32 [PATCH V1] i2c: designware: fix wrong tx/rx fifo for ACPI Tin Huynh
2016-11-29  9:04 ` Mika Westerberg
     [not found]   ` <CANQ9TuBLeiXCcZANic7K+JrwPSpgZ8Qxm8kPBrwvK0h1y7bOuA@mail.gmail.com>
2016-11-29  9:26     ` Mika Westerberg
2016-11-29  9:36       ` Tin Huynh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox