Jean Delvare | 22 Jul 10:24 2016

[PATCH v2] i2c: designware-baytrail: Fix the Kconfig dependency fix

Commit b4ad0510f5d9 ("i2c: designware-baytrail: another fixup for
proper Kconfig dependencies") claims that the "Baytrail driver" isn't
tristate. But in fact there is no such thing as a "Baytrail driver",
i2c-designware-baytrail is not a stand-alone driver but an optional
addition to the i2c-designware-platform driver, and that driver *is*
tristate. So there is no reason why I2C_DESIGNWARE_BAYTRAIL couldn't
be enabled when IOSF_MBI=m, as long as I2C_DESIGNWARE_PLATFORM=m too.

Signed-off-by: Jean Delvare <jdelvare <at>>
Fixes: b4ad0510f5d9 ("i2c: designware-baytrail: another fixup for proper Kconfig dependencies")
Reviewed-by: Jarkko Nikula <jarkko.nikula <at>>
Cc: Andy Shevchenko <andriy.shevchenko <at>>
Cc: Mika Westerberg <mika.westerberg <at>>
Cc: Randy Dunlap <rdunlap <at>>
Cc: David E. Box < <at>>
Cc: Wolfram Sang <wsa <at>>
Changes since v1:
* Fixed Wolfram's Cc.
* Split the dependency line to avoid too long a line (suggested by
* Added more Ccs.

 drivers/i2c/busses/Kconfig |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-4.5-rc2.orig/drivers/i2c/busses/Kconfig	2016-02-02 14:32:22.762878539 +0100
+++ linux-4.5-rc2/drivers/i2c/busses/Kconfig	2016-02-04 21:01:49.075379053 +0100
 <at>  <at>  -490,7 +490,8  <at>  <at>  config I2C_DESIGNWARE_PCI

(Continue reading)

Grzegorz Jaszczyk | 21 Jul 12:39 2016

[PATCH] i2c: i2c-mv64xxx: add suspend/resume support

There is no need to implement subroutine for suspend since there is no
data to store before suspending.

Signed-off-by: Grzegorz Jaszczyk <jaz <at>>
 drivers/i2c/busses/i2c-mv64xxx.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index b4dec08..dc048e7 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
 <at>  <at>  -977,12 +977,24  <at>  <at>  mv64xxx_i2c_remove(struct platform_device *dev)
 	return 0;

+static int mv64xxx_i2c_resume(struct device *dev)
+	struct mv64xxx_i2c_data *drv_data = dev_get_drvdata(dev);
+	mv64xxx_i2c_hw_init(drv_data);
+	return 0;
+static SIMPLE_DEV_PM_OPS(mv64xxx_i2c_pm_ops, NULL, mv64xxx_i2c_resume);
 static struct platform_driver mv64xxx_i2c_driver = {
 	.probe	= mv64xxx_i2c_probe,
 	.remove	= mv64xxx_i2c_remove,
(Continue reading)

Phil Reid | 21 Jul 05:20 2016

RFI: I2c muxes I2C_MUX_LOCKED and interrupt support

G'day Peter,

I'm looking into modifying the i2c-mux-pca954x driver to add support for
the pca_9543 interrupt mux function.

So the first thing I need to add is a reg read function.
However based on the changes to the i2c mux code in the 4.6 series the
locking work around shouldn't be needed now if the mux is allocated with
I2C_MUX_LOCKED. Currently this driver is not doing this.
Also the same with the similar i2c-mux-pca9541 driver which does implement read.

So my question is should I change the driver to use I2C_MUX_LOCKED
or implement the read operation the same as the i2c-mux-pca9541?


Phil Reid

Amitoj Kaur Chawla | 20 Jul 07:14 2016

[PATCH v2] 2c: mv64xxx: Use clk_enable_prepare and clk_disable_unprepare

Replace clk_enable and clk_prepare with clk_enable_prepare and
clk_disable and clk_unprepare with clk_disable_unprepare.

The Coccinelle semantic patch used to make this change is as follows:
 <at>  <at> 
expression e;
 <at>  <at> 

- clk_prepare(e);
- clk_enable(e);
+ clk_prepare_enable(e);

 <at>  <at> 
expression e;
 <at>  <at> 

- clk_disable(e);
- clk_unprepare(e);
+ clk_disable_unprepare(e);

Signed-off-by: Amitoj Kaur Chawla <amitoj1606 <at>>
Changes in v2:
        -Rebased patch

 drivers/i2c/busses/i2c-mv64xxx.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 43207f5..79bae48 100644
(Continue reading)

Jean Delvare | 19 Jul 13:15 2016

[PATCH] i2c: i2c-smbus: drop useless stubs

Drivers which use the SMBus extensions select I2C_SMBUS, so the
stubs are not needed.

Signed-off-by: Jean Delvare <jdelvare <at>>
Cc: Benjamin Tissoires <benjamin.tissoires <at>>
Cc: Wolfram Sang <wsa <at>>
 include/linux/i2c-smbus.h |   15 ---------------
 1 file changed, 15 deletions(-)

--- linux-4.7-rc7.orig/include/linux/i2c-smbus.h	2016-07-19 13:06:08.873469372 +0200
+++ linux-4.7-rc7/include/linux/i2c-smbus.h	2016-07-19 13:11:46.265359168 +0200
 <at>  <at>  -73,23 +73,8  <at>  <at>  struct smbus_host_notify {
 	u8			addr;

 struct smbus_host_notify *i2c_setup_smbus_host_notify(struct i2c_adapter *adap);
 int i2c_handle_smbus_host_notify(struct smbus_host_notify *host_notify,
 				 unsigned short addr, unsigned int data);
-static inline struct smbus_host_notify *
-i2c_setup_smbus_host_notify(struct i2c_adapter *adap)
-	return NULL;
-static inline int
-i2c_handle_smbus_host_notify(struct smbus_host_notify *host_notify,
-			     unsigned short addr, unsigned int data)
(Continue reading)

Jean Delvare | 18 Jul 12:39 2016

[PATCH] i2c: Update the description of I2C_SMBUS

We support the SMBus Host Notify protocol now.

Signed-off-by: Jean Delvare <jdelvare <at>>
Cc: Benjamin Tissoires <benjamin.tissoires <at>>
Cc: Wolfram Sang <wsa <at>>
 drivers/i2c/Kconfig |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-4.7-rc7.orig/drivers/i2c/Kconfig	2016-07-04 08:01:00.000000000 +0200
+++ linux-4.7-rc7/drivers/i2c/Kconfig	2016-07-18 12:34:11.058067963 +0200
 <at>  <at>  -88,8 +88,8  <at>  <at>  config I2C_SMBUS
 	tristate "SMBus-specific protocols" if !I2C_HELPER_AUTO
 	  Say Y here if you want support for SMBus extensions to the I2C
-	  specification. At the moment, the only supported extension is
-	  the SMBus alert protocol.
+	  specification. At the moment, two extensions are supported:
+	  the SMBus Alert protocol and the SMBus Host Notify protocol.

 	  This support is also available as a module.  If so, the module
 	  will be called i2c-smbus.


Jean Delvare
SUSE L3 Support
Bartosz Golaszewski | 17 Jul 20:40 2016

[PATCH] eeprom: at24: tweak the loop_until_timeout() macro

loop_until_timeout() replaced a do {} while loop in the at24 driver
with a for loop which, under certain circumstances (such as heavy load
or low value of the write_timeout argument), can lead to the code in
the loop never being executed.

Make sure that at least one iteration of the code enclosed within
loop_until_timeout() is always executed.

Suggested-by: Wolfram Sang <wsa <at>>
Signed-off-by: Bartosz Golaszewski <bgolaszewski <at>>
 drivers/misc/eeprom/at24.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 0b8fafdb..1f62aaf 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
 <at>  <at>  -116,7 +116,8  <at>  <at>  MODULE_PARM_DESC(write_timeout, "Time (in ms) to try writes (default 25)");
  * Both reads and writes fail if the previous write didn't complete yet. This
  * macro loops a few times waiting at least long enough for one entire page
- * write to work.
+ * write to work while making sure that at least one iteration is run before
+ * checking the break condition.
  * It takes two parameters: a variable in which the future timeout in jiffies
  * will be stored and a temporary variable holding the time of the last
 <at>  <at>  -124,9 +125,8  <at>  <at>  MODULE_PARM_DESC(write_timeout, "Time (in ms) to try writes (default 25)");
  * holding at least 32 bits.
(Continue reading)

Jan Kandziora | 16 Jul 22:15 2016

[PATCH 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.

Signed-off-by: Jan Kandziora <jjj <at>>
 drivers/w1/slaves/Kconfig      |  19 +
 drivers/w1/slaves/Makefile     |   1 +
 drivers/w1/slaves/w1_ds28e17.c | 761 +++++++++++++++++++++++++++++++++++++++++
 drivers/w1/w1_family.h         |   1 +
 4 files changed, 782 insertions(+)
 create mode 100644 drivers/w1/slaves/w1_ds28e17.c

diff --git a/drivers/w1/slaves/Kconfig b/drivers/w1/slaves/Kconfig
index cfe74d0..9a9a422 100644
--- a/drivers/w1/slaves/Kconfig
+++ b/drivers/w1/slaves/Kconfig
 <at>  <at>  -126,6 +126,25  <at>  <at>  config W1_SLAVE_DS28E04

 	  If you are unsure, say N.

+config W1_SLAVE_DS28E17
+	tristate "1-wire-to-I2C master bridge (DS28E17)"
+	select CRC16
+	depends on I2C
+	help
+	  Say Y here if you want to use the DS28E17 1-wire-to-I2C master bridge.
+	  For each DS28E17 detected, a new I2C adapter is created within the
+	  kernel. I2C devices on that bus can be configured to be used by the
+	  kernel as on any other "native" I2C bus.
+	  In addition, that new I2C bus is accessible from userspace through
(Continue reading)

Jan Kandziora | 16 Jul 22:15 2016

[PATCH 1/2] wire: export w1_touch_bit

The w1_ds28e17 driver from the next part of this patch needs to emit
single-bit read timeslots to the DS28E17. The w1 subsystem already
has this function but it is not exported outside drivers/w1/w1_io.c

This subpatch exports the w1_touch_bit symbol with EXPORT_SYMBOL_GPL,
same as the other exported symbols in drivers/w1/w1_io.c

May be also useful later for writing drivers for other Onewire chips
which do single-bit communication.

Signed-off-by: Jan Kandziora <jjj <at>>
 drivers/w1/w1.h    | 1 +
 drivers/w1/w1_io.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h
index 129895f..ac8a6a5 100644
--- a/drivers/w1/w1.h
+++ b/drivers/w1/w1.h
 <at>  <at>  -302,6 +302,7  <at>  <at>  int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn);
 int w1_slave_detach(struct w1_slave *sl);

 u8 w1_triplet(struct w1_master *dev, int bdir);
+u8 w1_touch_bit(struct w1_master *dev, int bit);
 void w1_write_8(struct w1_master *, u8);
 u8 w1_read_8(struct w1_master *);
 int w1_reset_bus(struct w1_master *);
diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c
index f4bc8c1..1c34f97 100644
(Continue reading)

Jean Delvare | 16 Jul 15:45 2016

[PATCH] i2c: i2c-smbus: fix i2c_handle_smbus_host_notify documentation

The parameter description is from a previous implementation, update
it to describe the actual implementation.

Signed-off-by: Jean Delvare <jdelvare <at>>
Cc: Benjamin Tissoires <benjamin.tissoires <at>>
Cc: Wolfram Sang <wsa <at>>
 drivers/i2c/i2c-smbus.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/i2c/i2c-smbus.c
+++ b/drivers/i2c/i2c-smbus.c
 <at>  <at>  -302,8 +302,8  <at>  <at>  EXPORT_SYMBOL_GPL(i2c_setup_smbus_host_n
  * i2c_handle_smbus_host_notify - Forward a Host Notify event to the correct
  * I2C client.
  *  <at> host_notify: the struct host_notify attached to the relevant adapter
- *  <at> data: the Host Notify data which contains the payload and address of the
- * client
+ *  <at> addr: the I2C address of the notifying device
+ *  <at> data: the payload of the notification
  * Context: can't sleep
  * Helper function to be called from an I2C bus driver's interrupt


Jean Delvare
SUSE L3 Support

Alexey Khoroshilov | 16 Jul 01:36 2016

[PATCH] i2c: efm32: fix a failure path in efm32_i2c_probe()

There is the only failure path in efm32_i2c_probe(),
where clk_disable_unprepare() is missed.

Found by Linux Driver Verification project (

Signed-off-by: Alexey Khoroshilov <khoroshilov <at>>
 drivers/i2c/busses/i2c-efm32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-efm32.c b/drivers/i2c/busses/i2c-efm32.c
index 8eff62738877..e253598d764c 100644
--- a/drivers/i2c/busses/i2c-efm32.c
+++ b/drivers/i2c/busses/i2c-efm32.c
 <at>  <at>  -433,7 +433,7  <at>  <at>  static int efm32_i2c_probe(struct platform_device *pdev)
 	ret = request_irq(ddata->irq, efm32_i2c_irq, 0, DRIVER_NAME, ddata);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "failed to request irq (%d)\n", ret);
-		return ret;
+		goto err_disable_clk;

 	ret = i2c_add_adapter(&ddata->adapter);