Dmitry Torokhov | 30 Jul 22:14 2015

[PATCH] i2c: allow specifying separate wakeup interrupt in device tree

Instead of having each i2c driver individually parse device tree data in
case it or platform supports separate wakeup interrupt, and handle
enabling and disabling wakeup interrupts in their power management
routines, let's have i2c core do that for us.

Platforms wishing to specify separate wakeup interrupt for the device
should use named interrupt syntax in their DTSes:

	interrupt-parent = <&intc1>;
	interrupts = <5 0>, <6 0>;
	interrupt-names = "irq", "wakeup";

This patch is inspired by work done by Vignesh R <vigneshr@...> for
pixcir_i2c_ts driver.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...>
 drivers/i2c/i2c-core.c | 46 ++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 40 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index e6d4935..19e7a17 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
 <at>  <at>  -47,6 +47,7  <at>  <at> 
 #include <linux/rwsem.h>
 #include <linux/pm_runtime.h>
 #include <linux/pm_domain.h>
+#include <linux/pm_wakeirq.h>
 #include <linux/acpi.h>
(Continue reading)

Eddie Huang | 28 Jul 05:38 2015

[PATCH] i2c: mediatek: fix transfer error handling

From: Liguo Zhang <liguo.zhang@...>

Reset i2c dma engine in hw init function.
When occur i2c ack error, mtk_i2c_irq may is twice,
first is the ack error interrupt, then the complete interrupt,
so i2c->irq_stat need keep the two interrupt value, and only
call complete() for the complete interrupt.

Signed-off-by: Liguo Zhang <liguo.zhang@...>
Signed-off-by: Eddie Huang <eddie.huang@...>
 drivers/i2c/busses/i2c-mt65xx.c |   25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index 9920eef..57d11b7 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
 <at>  <at>  -59,6 +59,7  <at>  <at> 
 #define I2C_DMA_START_EN		0x0001
 #define I2C_DMA_INT_FLAG_NONE		0x0000
 #define I2C_DMA_CLR_FLAG		0x0000
+#define I2C_DMA_HARD_RST		0x0002

 #define I2C_DEFAULT_SPEED		100000	/* hz */
 #define MAX_FS_MODE_SPEED		400000
 <at>  <at>  -81,6 +82,7  <at>  <at>  enum DMA_REGS_OFFSET {
 	OFFSET_INT_EN = 0x04,
 	OFFSET_EN = 0x08,
(Continue reading)

Matt Fleming | 27 Jul 17:21 2015

Regression in v4.2-rc1 caused by hierarchical irqdomain changes

A git bisect just pointed me at commit d32932d02e18 ("x86/irq: Convert
IOAPIC to use hierarchical irqdomain interfaces") as the reason for why
the trackpad on my Dell XPS13 is no longer working with v4.2-rc1.

I'm now seeing the following errors when booting,

[    1.615017] i2c_designware INT3433:00: controller timed out
[    1.642496] i2c_designware INT3433:00: timeout in disabling adapter        
[    1.642500] i2c_hid i2c-DLL0665:01: hid_descr_cmd failed

I tried commit d32932d02e18~1, which works, and things definitely break
starting with commit d32932d02e18.

Any suggestions or requests to try and diagnose why the irqdomain
changes broke this i2c controller driver?


Matt Fleming, Intel Open Source Technology Center
Vladimir Zapolskiy | 27 Jul 16:30 2015

[PATCH v2 0/4] i2c: fix i2c adapter device driver user counter

The series fixes i2c bus device refcounting for clients of i2c_get_adapter(),
of_find_i2c_adapter_by_node() and of_find_i2c_device_by_node() interfaces.

The v2 3/4 change adds and exports new of_get_i2c_adapter_by_node()
interface of i2c core, v2 4/4 is an unchanged version of v1 10/10, which
utilizes this new interface in order to fix the refcounting bug described
below in detail.

of_find_i2c_adapter_by_node() call requires quite often missing
put_device(), and i2c_put_adapter() releases a device locked by
i2c_get_adapter() only. In general module_put(adapter->owner) and
put_device(dev) are not interchangeable.

This is a common error reproduction scenario as a result of the
misusage described above (this is run on iMX6 platform with
HDMI and I2C bus drivers compiled as kernel modules for clearness):

    root <at> mx6q:~# lsmod | grep i2c
    i2c_imx                10213  0
    root <at> mx6q:~# lsmod | grep dw_hdmi_imx
    dw_hdmi_imx             3631  0
    dw_hdmi                11846  1 dw_hdmi_imx
    imxdrm                  8674  3 dw_hdmi_imx,imx_ipuv3_crtc,imx_ldb
    drm_kms_helper        113765  5 dw_hdmi,imxdrm,imx_ipuv3_crtc,imx_ldb
    root <at> mx6q:~# rmmod dw_hdmi_imx
    root <at> mx6q:~# lsmod | grep i2c
    i2c_imx                10213  -1


(Continue reading)

Sifan Naeem | 27 Jul 13:55 2015

[PATCH 0/7] i2c: img-scb: enchancements to support i2c on pistachio

Following patches are required to enchance the existing driver to
support i2c on pistachio.

This patch series depends on the series of fixes posted earlier[1].
The features added in this series were tested with the earlier fixes

Tested on Pistachio bub and on tz1090 using an Adafruit I2C
Non-Volatile FRAM Breakout (256Kbit / 32KByte) eeprom.

Used i2c buildroot tools to test the eeprom and the other i2c blocks.
Also used dd commands to copy data to and then to dump data from the
eeprom. i2ctransfer was used to test repeated starts and verified
using a scope.


Sifan Naeem (7):
  i2c: img-scb: support I2C_M_IGNORE_NAK
  i2c: img-scb: support repeated starts on IP v3.3
  i2c: img-scb: mark transaction as complete when all data is read
  i2c: img-scb: mark transaction as complete when no more data to write
  i2c: img-scb: remove fifo EMPTYING interrupts handle
  i2c: img-scb: add handle for stop detected interrupt
  i2c: img-scb: add handle for Master halt interrupt

 drivers/i2c/busses/i2c-img-scb.c |  129 ++++++++++++++++++++++++++++++--------
 1 file changed, 104 insertions(+), 25 deletions(-)

(Continue reading)

Fugang Duan | 27 Jul 10:26 2015

[PATCH] i2c: imx: change dev_info to dev_dbg to reduce dummy log

For most of imx platforms, there have no DMA support for I2C bus.
So, by default, there is only cpu mode.

The current driver to check whether there have DMA channel config in
dts file to judge whether it support DMA mode or not, if doesn't config
it print out "can't use DMA" for each bus during probe.

kernel boot up log:
i2c i2c-0: IMX I2C adapter registered
i2c i2c-0: can't use DMA
i2c i2c-1: IMX I2C adapter registered
i2c i2c-1: can't use DMA
i2c i2c-2: IMX I2C adapter registered
i2c i2c-2: can't use DMA
i2c i2c-3: IMX I2C adapter registered
i2c i2c-3: can't use DMA

It is very ugly and confused. So change the dev_info() to deb_dbg() to
avoid print dummy and redundant log.

Signed-off-by: Fugang Duan <B38611@...>
 drivers/i2c/busses/i2c-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 785aa67..28fba91 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
 <at>  <at>  -339,7 +339,7  <at>  <at>  fail_tx:
(Continue reading)

Vladimir Zapolskiy | 26 Jul 23:16 2015

[PATCH] i2c: slave eeprom: clean up sysfs bin attribute read()/write()

The change removes redundant sysfs binary file boundary checks,
since this task is already done on caller side in fs/sysfs/file.c

Note, on file size overflow read() now returns 0, and this is a
correct and expected EOF notification according to POSIX.

Signed-off-by: Vladimir Zapolskiy <vz@...>
 drivers/i2c/i2c-slave-eeprom.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/i2c/i2c-slave-eeprom.c b/drivers/i2c/i2c-slave-eeprom.c
index 8223746..1da4496 100644
--- a/drivers/i2c/i2c-slave-eeprom.c
+++ b/drivers/i2c/i2c-slave-eeprom.c
 <at>  <at>  -80,9 +80,6  <at>  <at>  static ssize_t i2c_slave_eeprom_bin_read(struct file *filp, struct kobject *kobj
 	struct eeprom_data *eeprom;
 	unsigned long flags;

-	if (off + count > attr->size)
-		return -EFBIG;
 	eeprom = dev_get_drvdata(container_of(kobj, struct device, kobj));

 	spin_lock_irqsave(&eeprom->buffer_lock, flags);
 <at>  <at>  -98,9 +95,6  <at>  <at>  static ssize_t i2c_slave_eeprom_bin_write(struct file *filp, struct kobject *kob
 	struct eeprom_data *eeprom;
 	unsigned long flags;

-	if (off + count > attr->size)
(Continue reading)

Free Gift

I intend to give to you a portion of my Wealth as a free-will financial donation to you. 
Respond now to partake.

Maria-Elisabeth Schaeffler 
Alexander Flockhart | 25 Jul 03:05 2015


Dear Friend , 

I have a good business proposal for you , 
it's easy and no risk involve, 
please get back to me for brief details 


Alexander Flockhart 
Crt Mori | 24 Jul 15:20 2015

[PATCH] i2c: core: add support for read commands longer than byte

If you want to send more than 1 byte as command to slave you need to go away
from the smbus (which has a 8 bit command defined in specification). i2c has
no such limitation in specification and since we want to have a longer than
1 byte command, we need additional function to handle it. With outside
buffers we have also avoided endianness problems (if we would just define a
u16 command instead of u8). Also there are now no limitations (as per i2c
specification) of command length.
Addressed read function is when we have a slave device which accepts commands
longer than byte or some subcommands in same write string before issuing a
repeat start before read cycle to read more than byte (or byte) from slave

Signed-off-by: Crt Mori <cmo@...>
 drivers/i2c/i2c-core.c | 40 ++++++++++++++++++++++++++++++++++++++++
 include/linux/i2c.h    |  4 ++++
 2 files changed, 44 insertions(+)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 069a41f..bccf83f 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
 <at>  <at>  -2980,6 +2980,46  <at>  <at>  int i2c_slave_unregister(struct i2c_client *client)

+ * i2c_addressed_read - writes read commands with desired length and read
+ * desired length of data.
+ *  <at> client: Handle to slave device
(Continue reading)

Benjamin Tissoires | 23 Jul 20:55 2015

[PATCH v4 0/3] I2C/SMBus: add support for Host Notify (in i2c_i801)


this is the v4 of this patch series which fixes the race we discovered this
week when accessing the registers in i2c_i801.

Compared to v3, i2c_handle_smbus_host_notify can now be called in a non sleeping
thread because a worker will be spawn later on.
That also means that we need to allocate the worker and some other structures,
so I introduced i2c_setup_smbus_host_notify().


Benjamin Tissoires (3):
  i2c: add a protocol parameter to the alert callback
  i2c-smbus: add SMBus Host Notify support
  i2c: i801: add support of Host Notify

 Documentation/i2c/smbus-protocol |   3 +
 drivers/char/ipmi/ipmi_ssif.c    |   6 +-
 drivers/hwmon/lm90.c             |   3 +-
 drivers/i2c/busses/i2c-i801.c    | 164 +++++++++++++++++++++++++++++----------
 drivers/i2c/i2c-smbus.c          | 113 +++++++++++++++++++++++++--
 include/linux/i2c-smbus.h        |  43 ++++++++++
 include/linux/i2c.h              |  10 ++-
 include/uapi/linux/i2c.h         |   1 +
 8 files changed, 292 insertions(+), 51 deletions(-)


(Continue reading)