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

2010-03-23 Thread Mika Westerberg
register accesses are done. Signed-off-by: Mika Westerberg ext-mika.1.westerb...@nokia.com Cc: Cory Maccarrone darkstar6...@gmail.com --- drivers/i2c/busses/i2c-omap.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses

[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 add support

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

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 rui.zh...@intel.com 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

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

2012-10-01 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 should set

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

2012-10-01 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 in

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

2012-10-01 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 rui.zh...@intel.com Date: Fri, 28 Sep 2012 14:51:03 +0800 Subject: [RFC PATCH 2/6] Introduce ACPI style match in platform_match Signed-off-by:

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

2012-10-01 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-02 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-i2c; linux-a...@vger.kernel.org; Len, Brown; Rafael

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

2012-10-02 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 To: Zhang, Rui Cc: LKML; linux-pm; linux-i2c

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

2012-10-02 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-i2c; linux-a...@vger.kernel.org; Len, Brown; Rafael

[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 mika.westerb...@linux.intel.com --- drivers/i2c/busses/i2c-designware-core.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/i2c

[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 mika.westerb...@linux.intel.com

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

2013-01-17 Thread Mika Westerberg
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 mika.westerb...@linux.intel.com --- drivers/i2c/busses/i2c-designware-core.c | 16

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

2013-01-17 Thread Mika Westerberg
for 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
save more power by power gating the device etc. Signed-off-by: Mika Westerberg mika.westerb...@linux.intel.com --- 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

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 is empty. This violates the rules

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 info

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

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 configuration in the designware

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) since

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

2013-02-18 Thread Mika Westerberg
our platform is ARC based and this architecture is not yet supported by i2c/next. Signed-off-by: Christian Ruppert christian.rupp...@abilis.com Signed-off-by: Pierrick Hascoet pierrick.hasc...@abilis.com Reviewed-by: Mika Westerberg mika.westerb...@linux.intel.com Thanks! -- To unsubscribe

[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 mika.westerb...@linux.intel.com --- 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

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

2013-03-21 Thread Mika Westerberg
the function returns. Signed-off-by: Mika Westerberg mika.westerb...@linux.intel.com --- 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

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

2013-03-21 Thread Mika Westerberg
From: Andy Shevchenko andriy.shevche...@linux.intel.com 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 andriy.shevche...@linux.intel.com Signed-off-by: Mika Westerberg

[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 mika.westerb

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

2013-03-21 Thread Mika Westerberg
From: Andy Shevchenko andriy.shevche...@linux.intel.com 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 andriy.shevche...@linux.intel.com Signed-off-by: Mika Westerberg

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

2013-04-01 Thread Mika Westerberg
...@intel.com Acked-by: Mika Westerberg mika.westerb...@linux.intel.com -- 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

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 andriy.shevche...@linux.intel.com This makes the error handling much more simpler than open-coding everything

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-name); -

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 -, 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 took the first numbers

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) 1) == enable)

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 -, Mika Westerberg wrote: It is not good idea to mix static

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(struct dw_i2c_dev *dev, bool enable) +{ + int timeout

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

2013-04-10 Thread Mika Westerberg
...@linux.intel.com Signed-off-by: Mika Westerberg mika.westerb...@linux.intel.com --- drivers/i2c/busses/i2c-designware-pcidrv.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index

[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 mika.westerb...@linux.intel.com --- drivers/i2c/busses/i2c-designware-core.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses

[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 mika.westerb

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

2013-04-10 Thread Mika Westerberg
and 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 mika.westerb...@linux.intel.com --- Changes to v1: - Updated commit message to mention that this change should not cause

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

2013-04-10 Thread Mika Westerberg
From: Andy Shevchenko andriy.shevche...@linux.intel.com 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 andriy.shevche...@linux.intel.com Signed-off-by: Mika Westerberg

[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 mika.westerb...@linux.intel.com --- 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

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

2013-04-10 Thread Mika Westerberg
From: Andy Shevchenko andriy.shevche...@linux.intel.com 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 andriy.shevche...@linux.intel.com Signed-off-by: Mika Westerberg

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 another I2C message is going to be started

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 w...@the-dreams.de Tested-by: Mika Westerberg mika.westerb...@linux.intel.com -- To unsubscribe from this list

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 w...@the-dreams.de Tested-by: Mika Westerberg mika.westerb...@linux.intel.com -- To unsubscribe from this list

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 josef.ah...@linux.intel.com Date: Fri, 19 Apr 2013 17:28:10 +0100 Subject: [PATCH] i2c-designware: fix RX FIFO overrun i2c_dw_xfer_msg()

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

2013-04-22 Thread Mika Westerberg
. Makes sense to me now. Feel free to add my Acked-by: Mika Westerberg mika.westerb...@linux.intel.com -- 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 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 mika.westerb...@linux.intel.com --- drivers/i2c/busses/i2c-designware-core.c |3 ++- 1 file changed, 2

[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 mika.westerb...@linux.intel.com --- drivers/i2c/busses/i2c-designware-platdrv.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses

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 christian.rupp...@abilis.com Signed-off-by: Pierrick Hascoet pierrick.hasc...@abilis.com Hi Wolfram, What happened to this

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. Signed-off

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

2013-05-21 Thread Mika Westerberg
...@samsung.com Thanks for fixing this! Acked-by: Mika Westerberg mika.westerb...@linux.intel.com -- 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
to 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 mika.westerb...@linux.intel.com --- drivers

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. This

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 to

[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 chiau.ee.c...@intel.com If both IC_EMPTYFIFO_HOLD_MASTER_EN and IC_RESTART_EN are set to 1, the Designware I2C

[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 mika.westerb...@linux.intel.com --- drivers/i2c/busses/i2c-designware-core.c

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). These registers

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 during

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 driver to use. So

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 to the i2c

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, Jul 10, 2013 at 01:52:15PM +0300, Mika

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

2013-08-19 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 to

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, t_f,

[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 mika.westerb...@linux.intel.com --- Changes to the previous version

[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 mika.westerb...@linux.intel.com --- 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

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

2013-08-20 Thread Mika Westerberg
implementation of of_i2c_register_devices()) From: Mika Westerberg mika.westerb...@linux.intel.com Subject: [PATCH] i2c: move ACPI helpers into the core This follows what has already been done for the DeviceTree helpers. Move the ACPI helpers from drivers/acpi/acpi_i2c.c to the I2C core and update

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

2013-08-20 Thread Mika Westerberg
an ACPI handle and if 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 lv.zh...@intel.com Signed-off-by: Mika Westerberg mika.westerb

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

2013-08-20 Thread Mika Westerberg
power manage the 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 aaron...@intel.com Signed-off-by: Mika Westerberg mika.westerb...@linux.intel.com --- drivers/i2c/i2c-core.c | 48

[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

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 20, 2013 at 01:25:27AM +0200, Rafael

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

2013-08-21 Thread Mika Westerberg
-by: Mika Westerberg mika.westerb...@linux.intel.com Acked-by: Rafael J. Wysocki rafael.j.wyso...@intel.com --- This is rebased on top of Wolfram's V2 patch here: http://marc.info/?l=linux-acpim=137709287521491w=2 Changed to use #if IS_ENABLED(CONFIG_ACPI) as is done in the DeviceTree version

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

2013-09-09 Thread Mika Westerberg
power manage the 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 aaron...@intel.com Signed-off-by: Mika Westerberg mika.westerb...@linux.intel.com Acked-by: Rafael J. Wysocki rafael.j.wyso

[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

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

2013-09-09 Thread Mika Westerberg
an ACPI handle and if 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 lv.zh...@intel.com Signed-off-by: Mika Westerberg mika.westerb

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 pm_runtime_put() in its +* probe

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 enabling runtime PM for themselves

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/forbid

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 conversion in the same patch

[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 mika.westerb...@linux.intel.com --- drivers/input/misc/bma150.c | 4 ++-- drivers/input/misc/mpu3050.c | 16 2 files changed, 6 insertions(+), 14 deletions(-) diff

[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 mika.westerb...@linux.intel.com --- drivers

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

2013-09-11 Thread Mika Westerberg
to the 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 mika.westerb...@linux.intel.com --- drivers/spi/spi.c | 9 + 1 file changed, 9

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

2013-09-11 Thread Mika Westerberg
handle and if 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 lv.zh...@intel.com Signed-off-by: Mika Westerberg mika.westerb

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

2013-09-11 Thread Mika Westerberg
. The adapter device is handled along with the I2C controller device (it uses pm_runtime_no_callbacks()). Signed-off-by: Aaron Lu aaron...@intel.com Signed-off-by: Mika Westerberg mika.westerb...@linux.intel.com --- drivers/i2c/i2c-core.c | 44 +++- 1 file changed

[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 mika.westerb...@linux.intel.com --- drivers

[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 mika.westerb

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

2013-09-11 Thread Mika Westerberg
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 Westerberg (7): Input

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

2013-09-11 Thread Mika Westerberg
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-by: Mika Westerberg

[PATCH v2 7/9] ASoC: codecs: convert existing I2C client drivers 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 ASoC codec drivers to use this model. Signed-off-by: Mika Westerberg mika.westerb...@linux.intel.com

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

2013-09-12 Thread Mika Westerberg
On Wed, Sep 11, 2013 at 06:12:43PM +0200, Samuel Ortiz wrote: Hi Mika, On Wed, Sep 11, 2013 at 06:32:37PM +0300, Mika Westerberg wrote: 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

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

2013-09-12 Thread Mika Westerberg
On Wed, Sep 11, 2013 at 04:51:20PM +0100, Mark Brown wrote: On Wed, Sep 11, 2013 at 06:32:39PM +0300, Mika Westerberg wrote: This patch adds runtime PM support for the SPI bus analogous to what has been done for the I2C bus. This means that the SPI core prepares runtime PM for a client

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

2013-09-12 Thread Mika Westerberg
On Thu, Sep 12, 2013 at 10:31:45AM +0100, Mark Brown wrote: On Thu, Sep 12, 2013 at 12:27:43PM +0300, Mika Westerberg wrote: On Wed, Sep 11, 2013 at 04:51:20PM +0100, Mark Brown wrote: I would be able to have this and the other patch in the SPI tree in case it overlaps with other work

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

2013-09-12 Thread Mika Westerberg
On Thu, Sep 12, 2013 at 01:04:28PM +0200, Wolfram Sang wrote: On Thu, Sep 12, 2013 at 01:04:55PM +0200, Rafael J. Wysocki wrote: On Thursday, September 12, 2013 12:43:02 PM Mika Westerberg wrote: On Thu, Sep 12, 2013 at 10:31:45AM +0100, Mark Brown wrote: On Thu, Sep 12, 2013 at 12:27

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

2013-09-12 Thread Mika Westerberg
On Thu, Sep 12, 2013 at 01:04:55PM +0200, Rafael J. Wysocki wrote: On Thursday, September 12, 2013 12:43:02 PM Mika Westerberg wrote: On Thu, Sep 12, 2013 at 10:31:45AM +0100, Mark Brown wrote: On Thu, Sep 12, 2013 at 12:27:43PM +0300, Mika Westerberg wrote: On Wed, Sep 11, 2013 at 04:51

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

2013-09-13 Thread Mika Westerberg
On Thu, Sep 12, 2013 at 02:34:21PM -0700, Kevin Hilman wrote: diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index f32ca29..44374b4 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -248,11 +248,30 @@ static int i2c_device_probe(struct device *dev)

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

2013-09-13 Thread Mika Westerberg
On Fri, Sep 13, 2013 at 10:59:50AM +0100, Mark Brown wrote: On Fri, Sep 13, 2013 at 09:54:34AM +0300, Mika Westerberg wrote: On Thu, Sep 12, 2013 at 02:34:21PM -0700, Kevin Hilman wrote: For hardware that is disabled/powered-off on startup, there will now be a mismatch between

  1   2   3   4   >