[PATCH] i2c-designware: add optional regulator support

2012-03-19 Thread Mika Westerberg
It is possible that some of the i2c busses are supplied by a separate regulator which needs to be enabled before we can access the bus. Thus add support for an optional regulator. We also implement enabling/disabling the regulator on system and runtime PM hooks. Signed-off-by: Mika Westerberg

Re: [PATCH] i2c-designware: add optional regulator support

2012-03-19 Thread Mika Westerberg
On Mon, Mar 19, 2012 at 02:28:07PM +, Mark Brown wrote: > On Mon, Mar 19, 2012 at 02:46:20PM +0200, Mika Westerberg wrote: > > > It is possible that some of the i2c busses are supplied by a separate > > regulator which needs to be enabled before we can access the bus. Thus a

Re: [PATCH] i2c-designware: add optional regulator support

2012-03-20 Thread Mika Westerberg
On Mon, Mar 19, 2012 at 04:24:34PM +, Mark Brown wrote: > This is all exactly what I'd expect and really sounds exactly like the > case I described - the panel needs the supply so the panel driver should > be managing it when required. There's nothing system or controller > specific about the

Re: Fwd: Hid over I2C and ACPI interaction

2012-07-05 Thread Mika Westerberg
On Thu, Jul 05, 2012 at 03:01:57PM +0800, Zhang Rui wrote: > +Note that although these are ACPI devices, we prefer to use PnP drivers > for them, > +this is because: > +1. all the non-ACPI-predefined Devices are exported as PnP devices as > well > +2. PnP bus is a well designed bus. Probing via PnP

Re: Fwd: Hid over I2C and ACPI interaction

2012-07-09 Thread Mika Westerberg
On Mon, Jul 09, 2012 at 11:24:45AM +0800, Lan Tianyu wrote: > I think we can add new interface to get acpi specific resources. e.g > struct acpi_resource pnp_get_acpi_resource(...). When the pnp acpi devices > were initialized, put those acpi specific resources into a new resource list > pnpdev->ac

Re: [RFC PATCH 1/6] Introduce acpi_match_device_id().

2012-09-28 Thread Mika Westerberg
On Fri, Sep 28, 2012 at 03:38:30PM +0800, Zhang Rui wrote: > >From 72df5d1f51fb27a4ba7f70a3b07df759d32b8288 Mon Sep 17 00:00:00 2001 > From: Zhang Rui > Date: Thu, 27 Sep 2012 15:11:55 +0800 > Subject: [RFC PATCH 1/6] Introduce acpi_match_device_id(). > > This API is used to check if a device id

Re: [RFC PATCH 1/6] Introduce acpi_match_device_id().

2012-09-30 Thread Mika Westerberg
On Sat, Sep 29, 2012 at 01:31:52PM +, Zhang, Rui wrote: > > > > +{ > > > + acpi_handle handle = DEVICE_ACPI_HANDLE(dev); > > > > If the device is not bound to an ACPI handle this will return NULL. And > > I don't see you doing that in this series meaning that.. > > > > > You're right, I s

Re: [RFC PATCH 0/6] ACPI: ACPI 5.0 device enumeration proposal

2012-09-30 Thread Mika Westerberg
On Fri, Sep 28, 2012 at 03:37:43PM +0800, Zhang Rui wrote: > > the main idea is that, for Serial Buses like I2C and SPI, we enumerate > the controller as a platform device, and then enumerate the slaves via > i2c/spi_register_board_info. And then, when the controller is really > probed and enabled

Re: [RFC PATCH 2/6] Introduce ACPI style match in platform_match

2012-09-30 Thread Mika Westerberg
On Fri, Sep 28, 2012 at 03:39:15PM +0800, Zhang Rui wrote: > >From 5d7ecd12c2994b8c5905d52718c2870c3b62746e Mon Sep 17 00:00:00 2001 > From: Zhang Rui > Date: Fri, 28 Sep 2012 14:51:03 +0800 > Subject: [RFC PATCH 2/6] Introduce ACPI style match in platform_match > > Signed-off-by: Zhang Rui > --

Re: [RFC PATCH 5/6] ACPI: Introduce ACPI I2C controller enumeration driver

2012-09-30 Thread Mika Westerberg
On Fri, Sep 28, 2012 at 03:40:32PM +0800, Zhang Rui wrote: > +acpi_status __init i2c_enumerate_slave(acpi_handle handle, u32 level, > +void *data, void **return_value) > +{ > + int result; > + acpi_status status; > + struct acpi_buffer buffer; > +

Re: [RFC PATCH 1/6] Introduce acpi_match_device_id().

2012-10-01 Thread Mika Westerberg
On Mon, Oct 01, 2012 at 01:56:17PM +, Zhang, Rui wrote: > > > > -Original Message- > > From: Mika Westerberg [mailto:mika.westerb...@linux.intel.com] > > Sent: Monday, October 01, 2012 2:38 PM > > To: Zhang, Rui > > Cc: LKML; linux-pm; linux-

Re: [RFC PATCH 5/6] ACPI: Introduce ACPI I2C controller enumeration driver

2012-10-01 Thread Mika Westerberg
On Mon, Oct 01, 2012 at 02:19:49PM +, Zhang, Rui wrote: > > > > -Original Message- > > From: linux-i2c-ow...@vger.kernel.org [mailto:linux-i2c- > > ow...@vger.kernel.org] On Behalf Of Mika Westerberg > > Sent: Monday, October 01, 2012 2:55 PM > > T

Re: [RFC PATCH 0/6] ACPI: ACPI 5.0 device enumeration proposal

2012-10-01 Thread Mika Westerberg
On Mon, Oct 01, 2012 at 02:30:00PM +, Zhang, Rui wrote: > > > > -Original Message- > > From: Mika Westerberg [mailto:mika.westerb...@linux.intel.com] > > Sent: Monday, October 01, 2012 2:45 PM > > To: Zhang, Rui > > Cc: LKML; linux-pm; linux-

[PATCH 1/4] i2c-designware: add missing MODULE_LICENSE

2013-01-17 Thread Mika Westerberg
The driver can also be built as a module so add MODULE_LICENSE for it. In addition add MODULE_DESCRIPTION as well. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-core.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/i2c/busses/i2c-designware-core.c b

[PATCH 4/4] i2c-designware: add support for Intel Lynxpoint

2013-01-17 Thread Mika Westerberg
Intel Lynxpoint has two I2C controllers. These controllers are enumerated from ACPI namespace with IDs INT33C2 and INT33C3. Add support for these to the I2C DesignWare platform driver. This is based on the work of Dirk Brandewie. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c

[PATCH 2/4] i2c-designware: always set the STOP bit after last byte

2013-01-17 Thread Mika Westerberg
from the hardware registers, so we must make sure that the STOP bit is always set once the last byte of the last message is transferred. This patch is based on the work of Dirk Brandewie. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-core.c | 16 ++-- 1

[PATCH 0/4] i2c-designware: add Intel Lynxpoint support

2013-01-17 Thread Mika Westerberg
the designware platform driver. This is useful if the PM subsystem/domain implements runtime PM, like in case of ACPI. Patch [4/4] finally implements ACPI enumeration support for the designware platform driver and adds Lynxpoint ACPI IDs. Please review. Mika Westerberg (4): i2c-designware: add

[PATCH 3/4] i2c-designware: add minimal support for runtime PM

2013-01-17 Thread Mika Westerberg
s can save more power by power gating the device etc. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-platdrv.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c

Re: [PATCH 2/4] i2c-designware: always set the STOP bit after last byte

2013-01-17 Thread Mika Westerberg
On Thu, Jan 17, 2013 at 12:32:48PM +0200, Felipe Balbi wrote: > Hi, > > On Thu, Jan 17, 2013 at 12:31:05PM +0200, Mika Westerberg wrote: > > If IC_EMPTYFIFO_HOLD_MASTER_EN is set to one, the DesignWare I2C controller > > doesn't generate STOP on the bus when the FIFO i

Re: [PATCH 0/4] i2c-designware: add Intel Lynxpoint support

2013-01-24 Thread Mika Westerberg
On Thu, Jan 24, 2013 at 08:28:46AM +0100, Wolfram Sang wrote: > I can't tell much about ACPI usage, but rest looks good to me. Applied > to next. Thanks! -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo inf

Re: [PATCH] i2c-designware: Interrupt sharing and SDA hold time

2013-02-15 Thread Mika Westerberg
On Fri, Feb 15, 2013 at 11:11:50AM +0100, Christian Ruppert wrote: > This patch implements interrupt sharing and SDA hold time configuration in > the designware i2c driver. Both functions are enabled through platform data > or device tree. Tested with Linux-3.8rc4 (Synopsys ARC port, see > https://

Re: [PATCH] i2c-designware: Interrupt sharing and SDA hold time

2013-02-15 Thread Mika Westerberg
On Fri, Feb 15, 2013 at 02:05:10PM +0100, Christian Ruppert wrote: > On Fri, Feb 15, 2013 at 01:50:37PM +0200, Mika Westerberg wrote: > > On Fri, Feb 15, 2013 at 11:11:50AM +0100, Christian Ruppert wrote: > > > This patch implements interrupt sharing and SDA hold time configur

Re: [PATCH v2] i2c-designware: make SDA hold time configurable

2013-02-18 Thread Mika Westerberg
On Mon, Feb 18, 2013 at 11:14:27AM +0100, Christian Ruppert wrote: > This patch makes the SDA hold time configurable through device tree. > It was tested on a hybrid of i2c/next and arc-3.8-baseline (see > https://github.com/foss-for-synopsys-dwc-arc-processors/linux/commits/arc-3.8-baseline) > si

Re: [PATCH v3] i2c-designware: make SDA hold time configurable

2013-02-18 Thread Mika Westerberg
-baseline) > since our platform is ARC based and this architecture is not yet > supported by i2c/next. > > Signed-off-by: Christian Ruppert > Signed-off-by: Pierrick Hascoet Reviewed-by: Mika Westerberg Thanks! -- To unsubscribe from this list: send the line "unsubscribe linux-

[PATCH 2/7] i2c-designware-pci: use dev_err() instead of printk()

2013-03-21 Thread Mika Westerberg
From: Andy Shevchenko With dev_err() we can get the device instance printed as well and is pretty much standard to use dev_* macros in drivers anyway. In addition correct indentation of probe() arguments. Signed-off-by: Andy Shevchenko Signed-off-by: Mika Westerberg --- drivers/i2c/busses

[PATCH 4/7] i2c-designware: use dynamic adapter numbering on Lynxpoint

2013-03-21 Thread Mika Westerberg
numbering on Intel Lynxpoint. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-platdrv.c |9 - 1 file changed, 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index c19c4ce..a22a852 100644 --- a

[PATCH 5/7] i2c-designware: enable/disable the controller properly

2013-03-21 Thread Mika Westerberg
function returns. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-core.c | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c index 94fd818

[PATCH 3/7] i2c-designware-pci: use managed functions pcim_* and devm_*

2013-03-21 Thread Mika Westerberg
From: Andy Shevchenko This makes the error handling much more simpler than open-coding everything and in addition makes the probe function smaller an tidier. Signed-off-by: Andy Shevchenko Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-pcidrv.c | 68

[PATCH 7/7] i2c-designware: switch to use runtime PM autosuspend

2013-03-21 Thread Mika Westerberg
Using autosuspend helps to reduce the resume latency in situations where another I2C message is going to be started soon. For example with HID over I2C touch panels we get several messages in a short period of time while the touch panel is in use. Signed-off-by: Mika Westerberg --- drivers/i2c

[PATCH 6/7] i2c-designware: use usleep_range() in the busy-loop

2013-03-21 Thread Mika Westerberg
This is not an atomic context so there is no need to use mdelay() but instead use usleep_range(). Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-core.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-designware-core.c b

[PATCH 1/7] i2c-designware: move to managed functions (devm_*)

2013-03-21 Thread Mika Westerberg
From: Andy Shevchenko This makes the error handling much more simpler than open-coding everything and in addition makes the probe function smaller and tidier. Signed-off-by: Andy Shevchenko Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-platdrv.c | 73

Re: [PATCH] ACPI / I2C: Use parent's ACPI_HANDLE() in acpi_i2c_register_devices()

2013-04-01 Thread Mika Westerberg
> struct i2c_adapter's ACPI handle (which should be NULL). > > Make that happen and modify the i2c-designware-platdrv driver, > which currently is the only driver for ACPI-enumerated I2C > controller chips, not to set the ACPI handle for the > struct i2c_adapter it creates.

Re: [PATCH 1/7] i2c-designware: move to managed functions (devm_*)

2013-04-08 Thread Mika Westerberg
Hi Wolfram, Any comments on this series? Could you consider merging these for 3.10? Thanks. On Thu, Mar 21, 2013 at 02:09:54PM +0200, Mika Westerberg wrote: > From: Andy Shevchenko > > This makes the error handling much more simpler than open-coding everything > and in additi

Re: [1/7] i2c-designware: move to managed functions (devm_*)

2013-04-09 Thread Mika Westerberg
On Tue, Apr 09, 2013 at 11:00:32AM +0200, Wolfram Sang wrote: > > > @@ -108,32 +108,27 @@ static int dw_i2c_probe(struct platform_device *pdev) > > return irq; /* -ENXIO */ > > } > > > > - ioarea = request_mem_region(mem->start, resource_size(mem), > > - pdev-

Re: [4/7] i2c-designware: use dynamic adapter numbering on Lynxpoint

2013-04-09 Thread Mika Westerberg
On Tue, Apr 09, 2013 at 11:06:05AM +0200, Wolfram Sang wrote: > On Thu, Mar 21, 2013 at 02:09:57AM -0000, Mika Westerberg wrote: > > It is not good idea to mix static and dynamic I2C adapter numbering. In > > this particular case on Lynxpoint we had graphics I2C adapter which too

Re: [5/7] i2c-designware: enable/disable the controller properly

2013-04-09 Thread Mika Westerberg
On Tue, Apr 09, 2013 at 11:09:14AM +0200, Wolfram Sang wrote: > > > +static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable) > > +{ > > + int timeout = 100; > > + > > + do { > > + dw_writel(dev, enable, DW_IC_ENABLE); > > + if ((dw_readl(dev, DW_IC_ENABLE_STATUS) &

Re: [4/7] i2c-designware: use dynamic adapter numbering on Lynxpoint

2013-04-09 Thread Mika Westerberg
On Tue, Apr 09, 2013 at 11:29:24AM +0200, Wolfram Sang wrote: > On Tue, Apr 09, 2013 at 12:23:19PM +0300, Mika Westerberg wrote: > > On Tue, Apr 09, 2013 at 11:06:05AM +0200, Wolfram Sang wrote: > > > On Thu, Mar 21, 2013 at 02:09:57AM -0000, Mika Westerberg wrote: > > &g

Re: [5/7] i2c-designware: enable/disable the controller properly

2013-04-09 Thread Mika Westerberg
On Tue, Apr 09, 2013 at 11:28:57AM +0200, Wolfram Sang wrote: > On Tue, Apr 09, 2013 at 12:28:36PM +0300, Mika Westerberg wrote: > > On Tue, Apr 09, 2013 at 11:09:14AM +0200, Wolfram Sang wrote: > > > > > > > +static void __i2c_dw_enable(struc

[PATCH v2 2/7] i2c-designware-pci: use dev_err() instead of printk()

2013-04-10 Thread Mika Westerberg
From: Andy Shevchenko With dev_err() we can get the device instance printed as well and is pretty much standard to use dev_* macros in the drivers anyway. In addition correct the indentation of probe() arguments. Signed-off-by: Andy Shevchenko Signed-off-by: Mika Westerberg --- drivers/i2c

[PATCH v2 6/7] i2c-designware: use usleep_range() in the busy-loop

2013-04-10 Thread Mika Westerberg
This is not an atomic context so there is no need to use mdelay() but instead use usleep_range(). Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-core.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-designware-core.c b

[PATCH v2 7/7] i2c-designware: switch to use runtime PM autosuspend

2013-04-10 Thread Mika Westerberg
Using autosuspend helps to reduce the resume latency in situations where another I2C message is going to be started soon. For example with HID over I2C touch panels we get several messages in a short period of time while the touch panel is in use. Signed-off-by: Mika Westerberg --- drivers/i2c

[PATCH v2 4/7] i2c-designware: use dynamic adapter numbering on Lynxpoint

2013-04-10 Thread Mika Westerberg
there is no hardware available outside Intel we can fix this by switching to use dynamic adapter numbering instead of static. Signed-off-by: Mika Westerberg --- Changes to v1: - Updated commit message to mention that this change should not cause regressions as there are no real users

[PATCH v2 3/7] i2c-designware-pci: use managed functions pcim_* and devm_*

2013-04-10 Thread Mika Westerberg
From: Andy Shevchenko This makes the error handling much more simpler than open-coding everything and in addition makes the probe function smaller an tidier. Signed-off-by: Andy Shevchenko Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-pcidrv.c | 68

[PATCH v2 5/7] i2c-designware: enable/disable the controller properly

2013-04-10 Thread Mika Westerberg
the function returns. Signed-off-by: Mika Westerberg --- Changes to v1: - Added comment about why we sleep 25us after each iteration. - } while (timeout--); instead of } while (timeout-- > 0); drivers/i2c/busses/i2c-designware-core.c | 34 -- 1 f

[PATCH v2 1/7] i2c-designware: move to managed functions (devm_*)

2013-04-10 Thread Mika Westerberg
From: Andy Shevchenko This makes the error handling much more simpler than open-coding everything and in addition makes the probe function smaller and tidier. Signed-off-by: Andy Shevchenko Signed-off-by: Mika Westerberg --- Changes to v1: - dropped redundant dev_err() after

Re: [PATCH v2 7/7] i2c-designware: switch to use runtime PM autosuspend

2013-04-10 Thread Mika Westerberg
On Wed, Apr 10, 2013 at 05:13:57PM +0530, Shubhrajyoti Datta wrote: > Hi Mika, > > > > On Wed, Apr 10, 2013 at 4:06 PM, Mika Westerberg < > mika.westerb...@linux.intel.com> wrote: > > > Using autosuspend helps to reduce the resume latency in situations where &g

Re: [PATCH 2/3] i2c: designware-plat: drop superfluous {get|put}_device

2013-04-19 Thread Mika Westerberg
On Thu, Apr 18, 2013 at 07:13:37PM +0200, Wolfram Sang wrote: > Driver core already takes care of refcounting, no need to do this on > driver level again. > > Signed-off-by: Wolfram Sang Tested-by: Mika Westerberg -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH 3/3] i2c: designware-pci: drop superfluous {get|put}_device

2013-04-19 Thread Mika Westerberg
On Thu, Apr 18, 2013 at 07:13:38PM +0200, Wolfram Sang wrote: > Driver core already takes care of refcounting, no need to do this on > driver level again. > > Signed-off-by: Wolfram Sang Tested-by: Mika Westerberg -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] i2c-designware: fix RX FIFO overrun

2013-04-22 Thread Mika Westerberg
On Fri, Apr 19, 2013 at 07:05:30PM +0100, Josef Ahmad wrote: > >From a969728248c3b439dc97a69e7dac133b5efa34e7 Mon Sep 17 00:00:00 2001 > From: Josef Ahmad > Date: Fri, 19 Apr 2013 17:28:10 +0100 > Subject: [PATCH] i2c-designware: fix RX FIFO overrun > > i2c_dw_xfer_msg() pushes a number of bytes

Re: [PATCH] i2c-designware: fix RX FIFO overrun

2013-04-22 Thread Mika Westerberg
elements): > > State of the fifos: > +-+ > TX -> | E E E E E W W R | > +-+ > +-+ > RX | E E R R R R R R | <- > +-+ > > Now, say the transaction requires to pum

[PATCH 1/2] i2c-designware: always clear interrupts before enabling them

2013-05-13 Thread Mika Westerberg
detected bit in its status register causing the driver to fail subsequent transfers. Fix this by always clearing all interrupts before we start a transfer. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-core.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH 2/2] i2c-designware: add Intel BayTrail ACPI ID

2013-05-13 Thread Mika Westerberg
This is the same controller as on Intel Lynxpoint but the ACPI ID is different (8086F41). Add support for this. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-platdrv.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b

Re: [PATCH v7] i2c-designware: make SDA hold time configurable

2013-05-14 Thread Mika Westerberg
On Tue, Apr 09, 2013 at 12:59:54PM +0200, Christian Ruppert wrote: > This patch makes the SDA hold time configurable through device tree. > > Signed-off-by: Christian Ruppert > Signed-off-by: Pierrick Hascoet Hi Wolfram, What happened to this patch? I don't see it merged for 3.10. The reason

Re: [PATCH v7] i2c-designware: make SDA hold time configurable

2013-05-17 Thread Mika Westerberg
On Fri, May 17, 2013 at 10:29:28AM +0200, Wolfram Sang wrote: > On Tue, May 14, 2013 at 02:07:45PM +0300, Mika Westerberg wrote: > > On Tue, Apr 09, 2013 at 12:59:54PM +0200, Christian Ruppert wrote: > > > This patch makes the SDA hold time configurable through device tree. >

Re: [PATCH] i2c: i2c-designware: Fix compilation warning

2013-05-21 Thread Mika Westerberg
d-off-by: EunBong Song Thanks for fixing this! Acked-by: Mika Westerberg -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] i2c: designware: prevent signals from aborting I2C transfers

2013-05-22 Thread Mika Westerberg
be aborted) I2C drivers aren't supposed to abort transactions on signals. To prevent this switch to use wait_for_completion_timeout() instead of wait_for_completion_interruptible_timeout() in the designware I2C driver. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-c

Re: [PATCH 1/2] i2c: designware: fix race between subsequent xfers

2013-06-06 Thread Mika Westerberg
Hi Christian, On Thu, Jun 06, 2013 at 03:43:35PM +0200, Christian Ruppert wrote: > The designware block is not always properly disabled in the case of > transfer errors. Interrupts from aborted transfers might be handled > after the data structures for the following transfer are initialised but >

Re: [PATCH 2/2] i2c: designware: make i2c xfers non-interruptible

2013-06-06 Thread Mika Westerberg
On Thu, Jun 06, 2013 at 03:43:36PM +0200, Christian Ruppert wrote: > When the process at the source of an i2c transfer is killed in the > middle of the transfer, the transfer is interrupted. Interrupted > transfers might cause buggy slaves on the bus (or higher level drivers) > to go haywire. > Thi

Re: [PATCH REBASE] i2c-designware: make SDA hold time configurable

2013-06-17 Thread Mika Westerberg
On Wed, Jun 12, 2013 at 04:47:45PM +0200, Christian Ruppert wrote: > On Mon, Jun 10, 2013 at 05:29:55PM +0200, Wolfram Sang wrote: > > On Tue, May 14, 2013 at 03:04:02PM +0200, Christian Ruppert wrote: > > > This patch makes the SDA hold time configurable through device tree. > > > > > > [rebased

Re: [PATCH V2] i2c: designware: fix race between subsequent xfers

2013-06-17 Thread Mika Westerberg
On Fri, Jun 14, 2013 at 04:37:41PM +0200, Wolfram Sang wrote: > On Fri, Jun 07, 2013 at 10:51:23AM +0200, Christian Ruppert wrote: > > The designware block is not always properly disabled in the case of > > transfer errors. Interrupts from aborted transfers might be handled > > after the data struc

[PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe

2010-03-23 Thread Mika Westerberg
e1a0331c e3a01000 (e18210b3) ---[ end trace 1b75b31a2719ed1c ]--- This patch moves register shift setting before any register accesses are done. Signed-off-by: Mika Westerberg Cc: Cory Maccarrone --- drivers/i2c/busses/i2c-omap.c | 10 +- 1 files changed, 5 insertions(+), 5

Re: [PATCH] i2c: omap: fix OOPS in omap_i2c_unidle() during probe

2010-05-11 Thread Mika Westerberg
On Tue, May 11, 2010 at 08:54:07AM +0200, ext Jarkko Nikula wrote: > On Fri, 16 Apr 2010 12:47:50 +0300 > Grazvydas Ignotas wrote: > > > >> Tested-by: Paul Walmsley > > Uhm why does this patch (or Tony's version) doesn't reach mainline for > > so long? It's critical for all OMAPs except the very

[PATCH] i2c-designware: configure SDA hold time from ACPI

2013-07-03 Thread Mika Westerberg
Some Intel LPSS I2C devices make the SDA hold time parameter available via SSCN (standard mode) and FMCN (fast mode) ACPI methods. If we find that such method exist, we evaluate it and pass the returned SDA hold value to the i2c-designware core analogous to Device Tree. Signed-off-by: Mika

Re: [PATCH] i2c-designware: Manually set RESTART bit between messages

2013-07-04 Thread Mika Westerberg
On Wed, Jul 03, 2013 at 10:15:11PM +0200, Wolfram Sang wrote: > > CCing Mika and Christian. > > On Fri, Jun 21, 2013 at 03:05:28PM +0800, Chew Chiau Ee wrote: > > From: Chew, Chiau Ee > > > > If both IC_EMPTYFIFO_HOLD_MASTER_EN and IC_RESTART_EN are set to 1, the > > Designware I2C controller d

[PATCH 2/2] i2c-designware: configure *CNT values from ACPI

2013-07-08 Thread Mika Westerberg
and otherwise use the default method based solely on the input clock speed. Signed-off-by: Mika Westerberg --- This applies on top of following patch which is not yet in i2c tree: http://permalink.gmane.org/gmane.linux.drivers.i2c/15754 drivers/i2c/busses/i2c-designware-platdrv.c | 25

[PATCH 1/2] i2c-designware: make *CNT values configurable

2013-07-08 Thread Mika Westerberg
. that are very platform specific and have an effect on the clock signal. With this patch we let the platform code to specify more accurate, optimal *CNT values if they are known beforehand. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-core.c | 46

Re: [PATCH 1/2] i2c-designware: make *CNT values configurable

2013-07-09 Thread Mika Westerberg
On Mon, Jul 08, 2013 at 03:42:17PM +0200, Christian Ruppert wrote: > On Mon, Jul 08, 2013 at 02:45:26PM +0300, Mika Westerberg wrote: > > The DesignWare I2C controller has high count (HCNT) and low count (LCNT) > > registers for each of the I2C speed modes (standard and fast). Thes

Re: [PATCH 1/2] i2c-designware: make *CNT values configurable

2013-07-10 Thread Mika Westerberg
On Tue, Jul 09, 2013 at 06:19:28PM +0200, Christian Ruppert wrote: > What I meant is the following: The clock cycle time Tc is composed of > the four components > > Tc = Th + Tf + Tl + Tr > > where > Th: Time during which the signal is high > Tf: Falling edge transition time > Tl: Time du

Re: [PATCH 2/2] i2c-designware: configure *CNT values from ACPI

2013-07-10 Thread Mika Westerberg
On Mon, Jul 08, 2013 at 02:45:27PM +0300, Mika Westerberg wrote: > Some Intel LPSS I2C devices make the *CNT values available from ACPI > namespace in similar way than the SDA hold value. These values allow > platform/BIOS to specify the most accurate *CNT values for the device > d

Re: [PATCH] i2c-designware: configure SDA hold time from ACPI

2013-07-10 Thread Mika Westerberg
On Wed, Jul 03, 2013 at 12:52:40PM +0300, Mika Westerberg wrote: > Some Intel LPSS I2C devices make the SDA hold time parameter available via > SSCN (standard mode) and FMCN (fast mode) ACPI methods. If we find that > such method exist, we evaluate it and pass the returned SDA hold value

Re: [PATCH 1/2] i2c-designware: make *CNT values configurable

2013-07-11 Thread Mika Westerberg
On Wed, Jul 10, 2013 at 06:56:35PM +0200, Christian Ruppert wrote: > On Wed, Jul 10, 2013 at 01:52:15PM +0300, Mika Westerberg wrote: > > On Tue, Jul 09, 2013 at 06:19:28PM +0200, Christian Ruppert wrote: > > > What I meant is the following: The clock cycle time Tc is composed

Re: [PATCH 1/2] i2c-designware: make *CNT values configurable

2013-07-11 Thread Mika Westerberg
On Thu, Jul 11, 2013 at 10:36:00AM +0300, Mika Westerberg wrote: > On Wed, Jul 10, 2013 at 06:56:35PM +0200, Christian Ruppert wrote: > > On Wed, Jul 10, 2013 at 01:52:15PM +0300, Mika Westerberg wrote: > > > On Tue, Jul 09, 2013 at 06:19:28PM +0200, Christian Ruppert wrote: &g

Re: [PATCH 1/2] i2c-designware: make *CNT values configurable

2013-07-12 Thread Mika Westerberg
On Fri, Jul 12, 2013 at 04:56:49PM +0900, Shinya Kuribayashi wrote: > On 7/11/13 7:13 PM, Mika Westerberg wrote: > >On Thu, Jul 11, 2013 at 10:36:00AM +0300, Mika Westerberg wrote: > >>On Wed, Jul 10, 2013 at 06:56:35PM +0200, Christian Ruppert wrote: > >>>On Wed, Ju

Re: [PATCH 1/2] i2c-designware: make *CNT values configurable

2013-08-18 Thread Mika Westerberg
Sorry for the slooow response, I've been on vacation. On Tue, Jul 16, 2013 at 01:16:18PM +0200, Christian Ruppert wrote: > > Second step is that if current i2c_dw_scl_hcnt and i2c_dw_scl_lcnt > > calculations don't suit with later DW I2C cores, then it would be > > nice for someone who can access

Re: [PATCH 1/2] i2c-designware: make *CNT values configurable

2013-08-19 Thread Mika Westerberg
On Fri, Aug 16, 2013 at 11:15:12AM +0900, Shinya Kuribayashi wrote: > >Actually, the I2C specification clearly defines f_SCL;max (and thus > >implies t_SCL;min), both in the tables and the timing diagrams. Why can > >we ignore this constraint while having to meet all the others? > > If we meet t_r

[PATCH v2 1/2] i2c-designware: make HCNT/LCNT values configurable

2013-08-19 Thread Mika Westerberg
makes it possible for the platform code to pass more optimal HCNT/LCNT values to the core driver if they are known beforehand. If these are not set we use the calculated and more conservative values. Signed-off-by: Mika Westerberg --- Changes to the previous version: * Updated changelog * Reduce

[PATCH v2 2/2] i2c-designware: get SDA hold time, HCNT and LCNT configuration from ACPI

2013-08-19 Thread Mika Westerberg
structure for core to use. Signed-off-by: Mika Westerberg --- Changes to the previous version: * Combined SDA hold time and *CNT value setting to be in a single patch drivers/i2c/busses/i2c-designware-platdrv.c | 34 + 1 file changed, 34 insertions(+) diff --git a

Re: [PATCH] i2c: move of helpers into the core

2013-08-20 Thread Mika Westerberg
hen? Here is the ACPI version based on the current patch from Wolfram (there is a compile error because of missing dummy implementation of of_i2c_register_devices()) From: Mika Westerberg Subject: [PATCH] i2c: move ACPI helpers into the core This follows what has already been done for the D

[RFC PATCH 2/2] i2c: attach/detach I2C client device to the ACPI power domain

2013-08-20 Thread Mika Westerberg
that's the case, attach it to the ACPI power domain. In addition we make sure that the device is fully powered when its ->probe() function gets called. For non-ACPI devices this patch is a no-op. Signed-off-by: Lv Zheng Signed-off-by: Mika Westerberg --- drivers/i2c/i2c-core.c | 9

[RFC PATCH 1/2] i2c: prepare runtime PM support for I2C client devices

2013-08-20 Thread Mika Westerberg
I2C controller device. The adapter device is handled along with the I2C controller device (it uses pm_runtime_no_callbacks()). Signed-off-by: Aaron Lu Signed-off-by: Mika Westerberg --- drivers/i2c/i2c-core.c | 48 +++- 1 file changed, 47 insertions(

[RFC PATCH 0/2] runtime PM support for I2C clients

2013-08-20 Thread Mika Westerberg
Hi all, With the advent of ACPI 5.0 we are starting to see I2C client devices described in ACPI namespace that support power management by the means of standard ACPI _PSx-methods. For example Intel Haswell based platforms might have touch screen or sensor-hub connected to the I2C bus that can be p

Re: [PATCH] i2c: move of helpers into the core

2013-08-21 Thread Mika Westerberg
On Tue, Aug 20, 2013 at 04:30:43PM +0200, Wolfram Sang wrote: > On Tue, Aug 20, 2013 at 12:28:13PM +0300, Mika Westerberg wrote: > > [Added Jerry as he found out a problem when acpi_i2c is being build as a > > module, this should solve it as well.] > > > > On Tue, Aug 2

[PATCH v2] i2c: move ACPI helpers into the core

2013-08-21 Thread Mika Westerberg
ff-by: Mika Westerberg Acked-by: Rafael J. Wysocki --- This is rebased on top of Wolfram's V2 patch here: http://marc.info/?l=linux-acpi&m=137709287521491&w=2 Changed to use #if IS_ENABLED(CONFIG_ACPI) as is done in the DeviceTree version. Documentation/acpi/enumeration.

Re: [RFC PATCH 1/2] i2c: prepare runtime PM support for I2C client devices

2013-09-02 Thread Mika Westerberg
On Wed, Aug 28, 2013 at 11:38:58AM +0200, Wolfram Sang wrote: > On Tue, Aug 20, 2013 at 05:03:35PM +0300, Mika Westerberg wrote: > > From: Aaron Lu > > > > This patch adds runtime PM support for the I2C bus in a similar way that > > has been done for PCI bus already.

[PATCH RESEND 1/2] i2c: prepare runtime PM support for I2C client devices

2013-09-09 Thread Mika Westerberg
I2C controller device. The adapter device is handled along with the I2C controller device (it uses pm_runtime_no_callbacks()). Signed-off-by: Aaron Lu Signed-off-by: Mika Westerberg Acked-by: Rafael J. Wysocki --- drivers/i2c/i2c-core.c | 48 +++-

[PATCH RESEND 0/2] runtime PM support for I2C clients

2013-09-09 Thread Mika Westerberg
[Resend with linux-arm-kernel included and added acks from Rafael] Hi all, With the advent of ACPI 5.0 we are starting to see I2C client devices described in ACPI namespace that support power management by the means of standard ACPI _PSx-methods. For example Intel Haswell based platforms might ha

[PATCH RESEND 2/2] i2c: attach/detach I2C client device to the ACPI power domain

2013-09-09 Thread Mika Westerberg
that's the case, attach it to the ACPI power domain. In addition we make sure that the device is fully powered when its ->probe() function gets called. For non-ACPI devices this patch is a no-op. Signed-off-by: Lv Zheng Signed-off-by: Mika Westerberg Acked-by: Rafael J. Wysocki --- dri

Re: [PATCH RESEND 1/2] i2c: prepare runtime PM support for I2C client devices

2013-09-10 Thread Mika Westerberg
On Mon, Sep 09, 2013 at 04:40:28PM +0100, Mark Brown wrote: > On Mon, Sep 09, 2013 at 04:34:38PM +0300, Mika Westerberg wrote: > > > + /* > > +* Enable runtime PM for the client device. If the client wants to > > +* participate on runtime PM it should call

Re: [PATCH RESEND 1/2] i2c: prepare runtime PM support for I2C client devices

2013-09-10 Thread Mika Westerberg
On Tue, Sep 10, 2013 at 01:27:54PM +0100, Mark Brown wrote: > On Tue, Sep 10, 2013 at 10:51:00AM +0300, Mika Westerberg wrote: > > On Mon, Sep 09, 2013 at 04:40:28PM +0100, Mark Brown wrote: > > > > How is this going to interact with client devices which are already > >

Re: [PATCH RESEND 1/2] i2c: prepare runtime PM support for I2C client devices

2013-09-11 Thread Mika Westerberg
On Wed, Sep 11, 2013 at 10:55:52AM +0100, Mark Brown wrote: > On Wed, Sep 11, 2013 at 09:01:16AM +0800, Aaron Lu wrote: > > > Looks like, it all boils down to how many I2C devices should be allowed > > for runtime PM by default and how many I2C devices should be forbidden. > > , and then we allow/

Re: [PATCH RESEND 1/2] i2c: prepare runtime PM support for I2C client devices

2013-09-11 Thread Mika Westerberg
On Wed, Sep 11, 2013 at 12:14:09PM +0100, Mark Brown wrote: > On Wed, Sep 11, 2013 at 02:05:43PM +0300, Mika Westerberg wrote: > > > I'll also look into converting the existing I2C client drivers to use this > > method. One question, though, is it better to have the con

[PATCH v2 3/9] Input: misc - convert existing I2C client drivers to use I2C core runtime PM

2013-09-11 Thread Mika Westerberg
to pm_runtime_set_autosuspend_delay() in mpu3050 driver because the driver doesn't seem to use autosuspend anyway. Signed-off-by: Mika Westerberg --- drivers/input/misc/bma150.c | 4 ++-- drivers/input/misc/mpu3050.c | 16 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/in

[PATCH v2 4/9] [media] s5p-tv: convert to use I2C core runtime PM

2013-09-11 Thread Mika Westerberg
The I2C core now prepares runtime PM on behalf of the I2C client device, so only thing the driver needs to do is to call pm_runtime_put() at the end of its ->probe(). This patch converts s5p-tv driver to use this model. Signed-off-by: Mika Westerberg --- drivers/media/platform/s5p

[PATCH v2 9/9] spi: attach/detach SPI device to the ACPI power domain

2013-09-11 Thread Mika Westerberg
ACPI power domain if the device has an ACPI handle. This makes sure that the device is powered on when its ->probe() is called. For non-ACPI devices this patch is a no-op. Signed-off-by: Mika Westerberg --- drivers/spi/spi.c | 9 + 1 file changed, 9 insertions(+) diff --git a/driv

[PATCH v2 2/9] i2c: attach/detach I2C client device to the ACPI power domain

2013-09-11 Thread Mika Westerberg
that's the case, attach it to the ACPI power domain. In addition we make sure that the device is fully powered when its ->probe() function gets called. For non-ACPI devices this patch is a no-op. Signed-off-by: Lv Zheng Signed-off-by: Mika Westerberg Acked-by: Rafael J. Wysocki --- drivers

[PATCH v2 1/9] i2c: prepare runtime PM support for I2C client devices

2013-09-11 Thread Mika Westerberg
evice is handled along with the I2C controller device (it uses pm_runtime_no_callbacks()). Signed-off-by: Aaron Lu Signed-off-by: Mika Westerberg --- drivers/i2c/i2c-core.c | 44 +++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH v2 6/9] mfd: wm8994: convert to use I2C core runtime PM

2013-09-11 Thread Mika Westerberg
The I2C core now prepares runtime PM on behalf of the I2C client device, so only thing the driver needs to do is to call pm_runtime_put() at the end of its ->probe(). This patch converts wm8994 driver to use this model. Signed-off-by: Mika Westerberg --- drivers/mfd/wm8994-core.c | 5 ++---

[PATCH v2 5/9] drivers/misc: convert existing I2C clients driver to use I2C core runtime PM

2013-09-11 Thread Mika Westerberg
The I2C core now prepares runtime PM on behalf of the I2C client device, so only thing the driver needs to do is to call pm_runtime_put() at the end of its ->probe(). This patch converts I2C client drivers under drivers/misc to use this model. Signed-off-by: Mika Westerberg --- drivers/m

[PATCH v2 0/9] runtime PM support for I2C and SPI client devices

2013-09-11 Thread Mika Westerberg
afael ACKed the previous version but I've changed the patches a bit, so I only kept his ACK in the second patch (it is unchanged). ] Aaron Lu (1): i2c: prepare runtime PM support for I2C client devices Lv Zheng (1): i2c: attach/detach I2C client device to the ACPI power domain Mika Wes

[PATCH v2 8/9] spi: prepare runtime PM support for SPI devices

2013-09-11 Thread Mika Westerberg
stion is regarded as being runtime PM active and powered on. This patch adds also runtime PM support for the SPI master device because it is needed to be able to runtime power manage the SPI controller device. The SPI master device is handled along with the SPI controller device. Signed-off-

  1   2   3   4   >