s. wicki | 22 May 10:36 2015

[PATCH] i2c: busses: i2c-bcm2835: limits cdiv to allowed values

fixes:	round down divider instead of incrementing
adds:	make sure bits 16-31 of cdiv register are always 0
adds:	assume minimal divider of 2 if divider resulted in 0
	(bcm2835 sets divider to 32768 if cdiv is set to 0)

Signed-off-by: s. wicki <linux_wi@...>
 drivers/i2c/busses/i2c-bcm2835.c | 38 +++++++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
index c9336a3..745181c 100644
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
 <at>  <at>  -51,6 +51,9  <at>  <at> 
 #define BCM2835_I2C_S_LEN	BIT(10) /* Fake bit for SW error reporting */

 #define BCM2835_I2C_TIMEOUT (msecs_to_jiffies(1000))
+#define BCM2835_I2C_CDIV_MIN	0x0002
+#define BCM2835_I2C_CDIV_MAX	0xFFFE
+#define BCM2835_I2C_CDIV_BITMSK	0xFFFE

 struct bcm2835_i2c_dev {
 	struct device *dev;
 <at>  <at>  -251,13 +254,34  <at>  <at>  static int bcm2835_i2c_probe(struct platform_device *pdev)

 	divider = DIV_ROUND_UP(clk_get_rate(i2c_dev->clk), bus_clk_rate);
-	/*
-	 * Per the datasheet, the register is always interpreted as an even
(Continue reading)

Wolfram Sang | 19 May 18:29 2015

[PATCH] i2c: check for proper length of the reg property

From: Wolfram Sang <wsa+renesas@...>

int is vague, let's simply use the type of the variable in question.

Signed-off-by: Wolfram Sang <wsa+renesas@...>
 drivers/i2c/i2c-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 987c124432c501..c517fc9d222c8f 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
 <at>  <at>  -1272,7 +1272,7  <at>  <at>  static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,

 	addr = of_get_property(node, "reg", &len);
-	if (!addr || (len < sizeof(int))) {
+	if (!addr || (len < sizeof(*addr))) {
 		dev_err(&adap->dev, "of_i2c: invalid reg on %s\n",
 		return ERR_PTR(-EINVAL);


Kamal Dasu | 19 May 18:23 2015

[V4, 1/2] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver

Adding support for i2c controller driver for Broadcom settop

Signed-off-by: Kamal Dasu <kdasu.kdev@...>
 - added COMPILE_TEST dependency to CONFIG_I2C_BRCMSTB
 - alphabetically ordered delay.h before device.h
 - disabled l2 interrupt on a timeout 
 - removed redundant white spaces 
 - call brcmstb_i2c_set_bsc_reg_defaults()
   before calling i2c_add_adapter()
 - removed kfree(dev->bsc_regmap) since using devm_kzalloc()
   for bsc_regmap
 drivers/i2c/busses/Kconfig       |  10 +
 drivers/i2c/busses/Makefile      |   1 +
 drivers/i2c/busses/i2c-brcmstb.c | 697 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 708 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-brcmstb.c

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 2255af2..c35903a 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
 <at>  <at>  -392,6 +392,16  <at>  <at>  config I2C_BCM_KONA

 	  If you do not need KONA I2C interface, say N.

+config I2C_BRCMSTB
+	tristate "BRCM Settop I2C controller"
(Continue reading)

Robert Dolca | 19 May 16:03 2015

[PATCH RFC] i2c: Use ID table to detect ACPI I2C devices

For i2c devices enumerated with ACPI you need to declare both
acpi_match_table and id_table. When using ACPI, the i2c_device_id structure
supplied to the probe function is null and you have to handle this case
in the driver.

The current name for the i2c client when using ACPI is "HID:UID" where the
UID has 7 or 8 characters and the UID has 2 characters. The UID is not
relevant for identifying the chip so it does not have any practical

Modifying i2c_match_id we make the comparison by ignoring the UID from the
client name when the device was discovered using ACPI. The comparison is
case insensitive because the ACPI names are uppercase and the DT and ID
table names are lowercase. It would not make sense to have two different
chips with the same name and the only diference being the capitalized

With these changes the probe function gets a valid i2c_device_id and the
driver doesn't have to declare acpi_match_table.

Signed-off-by: Robert Dolca <robert.dolca@...>
 drivers/i2c/i2c-core.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index fec0e0d..c9b30b7 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
 <at>  <at>  -447,8 +447,18  <at>  <at>  static inline int acpi_i2c_install_space_handler(struct i2c_adapter *adapter)
(Continue reading)

Ravi Kumar | 19 May 10:38 2015


Disclaimer for the Electronic Transmission Message- E-mail

The information contained in this Electronic Transmission Message i.e. E-Mail and any attachments to
this electronic message are intended for the exclusive use of the address(s) and may contain
proprietary, confidential or privileged information. If you are not intended recipient, you should not
disseminate, distribute or copy this e-mail. If you have received this message in error, you should
destroy this message and may please notify the sender by email.

E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted,
corrupted, lost, destroyed, arrive late or incomplete, or may contain virus in transmission. The E-mail
and its contents (with or without referred errors) shall therefore not attach any liability on the
originator/sender of message or BHEL or its affiliates. Views or opinions, if any, presented in this
e-mail are solely those of the sender and may not necessarily reflect the views or opinions of BHEL or its
affiliates. Intended recipients(s) may like to verify the information or intended meaning through
alternate communication mechanism before taking action on the E-mail or its contents.

WARNING: Although the company has taken reasonable precaution to ensure no viruses are present in this
email, the recipient should check this email and any attachments for the presence of virus. The sender of
the mail or BHEL accepts no liability for any damage caused by any virus transmitted by this email.
Attachment (1 bbc.docx): application/vnd.openxmlformats-officedocument.wordprocessingml.document, 251 KiB
Sudip Mukherjee | 19 May 07:55 2015

Re: [PATCH 11/11] i2c-core: Fix typo in comment

On Tue, May 19, 2015 at 10:31:36AM +0530, Shailendra Verma wrote:
> Hello Sudip,
> Those were my older patches in different module and I had posted them
> already.
You do not need to mention the count of your older patches here.
When you mentioned 11/11, it meant your current submission is a patchset
of 11 patches. So when the maintainer decides to apply your patch he will
search your remaining 10 patches because he needs to apply them in series.


Shailendra Verma | 18 May 19:07 2015

[PATCH 12/12] i2c-algo-pca: Fix typo in comment.

Signed-off-by: Shailendra Verma <shailendra.capricorn@...>
 drivers/i2c/algos/i2c-algo-pca.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
index 580dbf0..e370804 100644
--- a/drivers/i2c/algos/i2c-algo-pca.c
+++ b/drivers/i2c/algos/i2c-algo-pca.c
 <at>  <at>  -521,7 +521,7  <at>  <at>  static int pca_init(struct i2c_adapter *adap)

 		pca_set_con(pca_data, I2C_PCA_CON_ENSIO);
-	udelay(500); /* 500 us for oscilator to stabilise */
+	udelay(500); /* 500 us for oscillator to stabilise */

 	return 0;


Shailendra Verma | 18 May 18:54 2015

[PATCH 11/11] i2c-core: Fix typo in comment

Signed-off-by: Shailendra Verma <shailendra.capricorn@...>
 drivers/i2c/i2c-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 987c124..c40141b 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
 <at>  <at>  -1673,7 +1673,7  <at>  <at>  void i2c_del_adapter(struct i2c_adapter *adap)
 	 * FIXME: This is old code and should ideally be replaced by an
 	 * alternative which results in decoupling the lifetime of the struct
 	 * device from the i2c_adapter, like spi or netdev do. Any solution
-	 * should be throughly tested with DEBUG_KOBJECT_RELEASE enabled!
+	 * should be thoroughly tested with DEBUG_KOBJECT_RELEASE enabled!


Eddie Huang | 18 May 18:40 2015

[PATCH v8 0/3] ARM: mediatek: Add driver for Mediatek I2C

This series is for Mediatek SoCs I2C controller common bus driver.

Earlier MTK SoC (for example, MT6589, MT8135) I2C HW has some limitations.
New generation SoC like MT8173 fix following limitations:

1. Only support one i2c_msg number. One exception is WRRD (write then read)
mode. WRRD can have two i2c_msg numbers.

2. Mediatek I2C controller support WRRD(write then read) mode, in WRRD
mode the Repeat Start will be issued between 2 messages.
In this driver if 2 messages is first write then read, the driver will
combine 2 messages using Write-Read mode so the RS will be issued between
the 2 messages.

3. The max transfer data length is 255 in one message. In WRRD mode, the
max data length of second msg is 31.

MT8135 and MT6589 can control I2C pins on PMIC(MT6397) by setting the i2c
registers in MT8135 side. In this case, driver should set OFFSET_PATH_DIR
bit first, the operation on other registers are still the same.
For now MT6589/MT8135 support this, MT6577/MT6595/MT8127 do not support.
For example, If want to use I2C4/5/6 pins on MT8135 just need to enable
the pinmux, else if want to use I2C pins on PMIC(MT6397) need to add
"mediatek,have-pmic" property in the .dts file of each platform.

This driver is based on 4.1-rc1.

Change in v8:
Fix Wolfram's review comments like sort include file order, remove thin
wrapper functions, remove define number that only use once, and revise
(Continue reading)

Jisheng Zhang | 15 May 14:31 2015

[PATCH] i2c: designware: separate ops for system_sleep_pm and runtime_pm

Commit 1fc2fe204cb9 ("i2c: designware: Add runtime PM hooks") adds
runtime pm support using the same ops for system sleep and runtime pm.
When suspend to ram, the i2c host may have been runtime suspended, thus
i2c_dw_disable() hangs.

This patch fixes this issue by separating ops for system sleep pm and
runtime pm, and in the system suspend/resume path, runtime pm apis are
used to ensure the device is at correct state.

Signed-off-by: Jisheng Zhang <jszhang@...>
 drivers/i2c/busses/i2c-designware-platdrv.c | 48 ++++++++++++++++++++++++++---
 1 file changed, 43 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 0a80e4a..d306397 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
 <at>  <at>  -298,14 +298,16  <at>  <at>  static const struct of_device_id dw_i2c_of_match[] = {
 MODULE_DEVICE_TABLE(of, dw_i2c_of_match);

-#ifdef CONFIG_PM
 static int dw_i2c_suspend(struct device *dev)
 	struct platform_device *pdev = to_platform_device(dev);
 	struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);

+	pm_runtime_get_sync(dev);
(Continue reading)

Stevens, Nick | 14 May 21:44 2015

i2c bus driver for FTDI MPSSE

Recently I've been working on I2C device drivers for a number of devices
on an embedded platform (specifically the Microchip line of A2Ds), and
I'm planning to submit patches with my changes. However, my development
is on an older system running Linux 3.10, and I'd really like to test my
drivers with a more recent kernel. Getting a PC running a recent kernel
release is straightforward, but I've found that there aren't a lot of
great options for pluggable I2C busses on the PC (the USB Tiny is about
the only one).

That leads to my question - FTDI makes a number of USB interface chips
with their Multi-Protocol Synchronous Serial Engine (MPSSE) component,
which supports I2C. Kernel support for using the MPSSE as an I2C bus
seems like it would provide a really convenient way to test I2C drivers
on a PC, especially since the FTDI chips are easily available in
multiple form factors from multiple vendors.  Has anyone explored this?
Are there obvious obstacles that I'm not thinking of? Would this be
useful to anyone else?

To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html