Ioan Nicu | 25 Mar 18:43 2015

[PATCH] i2c: i2c-mux-gpio: Change log level to debug for probe deferrals

Probe deferral is not an error case. It happens only when
the necessary dependencies are not there yet.

The driver core is already printing a message when a driver
requests probe deferral, so this can be traced in the logs
without these error prints.

This patch changes the error messages from these deferral cases
to debug messages.

Signed-off-by: Ionut Nicu <ioan.nicu.ext@...>
---
 drivers/i2c/muxes/i2c-mux-gpio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
index f5798eb..9f1cfca 100644
--- a/drivers/i2c/muxes/i2c-mux-gpio.c
+++ b/drivers/i2c/muxes/i2c-mux-gpio.c
 <at>  <at>  -77,7 +77,7  <at>  <at>  static int i2c_mux_gpio_probe_dt(struct gpiomux *mux,
        }
        adapter = of_find_i2c_adapter_by_node(adapter_np);
        if (!adapter) {
-               dev_err(&pdev->dev, "Cannot find parent bus\n");
+               dev_dbg(&pdev->dev, "Cannot find parent bus\n");
                return -EPROBE_DEFER;
        }
        mux->data.parent = i2c_adapter_id(adapter);
 <at>  <at>  -178,7 +178,7  <at>  <at>  static int i2c_mux_gpio_probe(struct platform_device *pdev)

(Continue reading)

Irina Tirdea | 25 Mar 15:33 2015
Picon

[RFC PATCH 1/1] i2c: core: Add support for best effort block read emulation

There are devices that need to handle block transactions
regardless of the capabilities exported by the adapter.
For performance reasons, they need to use i2c read blocks
if available, otherwise emulate the block transaction with word
or byte transactions.

Add support for a helper function that would read a data block
using the best transfer available: I2C_FUNC_SMBUS_READ_I2C_BLOCK,
I2C_FUNC_SMBUS_READ_WORD_DATA or I2C_FUNC_SMBUS_READ_BYTE_DATA.

Signed-off-by: Irina Tirdea <irina.tirdea@...>
---

Hi,

This is a new API proposal to handle i2c block emulation in the
core instead of the driver code.

This is needed for a set of iio sensor changes ([1], [2], [3])
that would otherwise duplicate this code. There are also some
usages of this functionality in the kernel (e.g. eeprom driver at24).

Please let me know what you think.

Thanks,
Irina

[1] https://lkml.org/lkml/2015/2/16/408
[2] https://lkml.org/lkml/2015/2/16/413
[3] https://lkml.org/lkml/2015/2/16/402
(Continue reading)

Eddie Huang | 21 Mar 07:05 2015

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

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

Earlier MTK SoC ((for example, MT6589, MT8135)) I2C HW has some limitationes.
New generation SoC like MT8173 fix these 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.0-rc1.

Change in v5:
Apply new i2c_adapter_quirks patch [2]. Change to use dam_map_single to map
dma buffer. Add spinlock to fix race condition. Check of_property_read_u32
(Continue reading)

Baruch Siach | 19 Mar 12:16 2015
Picon

[PATCH v3 1/2] i2c: dt binding documentation for the Digicolor I2C controller

The CX92755 is an SoC in the Conexant Digicolor series. This devicetree binding
document describes the I2C controller on the CX92755 SoC, that is also shared
by some other SoCs in the Digicolor series.

Signed-off-by: Baruch Siach <baruch@...>
---
v3: No change
v2: No change
---
 .../devicetree/bindings/i2c/i2c-digicolor.txt      | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-digicolor.txt

diff --git a/Documentation/devicetree/bindings/i2c/i2c-digicolor.txt b/Documentation/devicetree/bindings/i2c/i2c-digicolor.txt
new file mode 100644
index 000000000000..457a098d4f7e
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-digicolor.txt
 <at>  <at>  -0,0 +1,25  <at>  <at> 
+Conexant Digicolor I2C controller
+
+Required properties:
+ - compatible: must be "cnxt,cx92755-i2c"
+ - reg: physical address and length of the device registers
+ - interrupts: a single interrupt specifier
+ - clocks: clock for the device
+ - #address-cells: should be <1>
+ - #size-cells: should be <0>
+
+Optional properties:
(Continue reading)

Kamal Dasu | 18 Mar 22:44 2015
Picon

[PATCH] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver

Adding support for i2c controller driver for Broadcom settop
SoCs.

Signed-off-by: Kamal Dasu <kdasu.kdev@...>
---
 .../devicetree/bindings/i2c/i2c-brcmstb.txt        |  28 +
 drivers/i2c/busses/Kconfig                         |  10 +
 drivers/i2c/busses/Makefile                        |   1 +
 drivers/i2c/busses/i2c-brcmstb.c                   | 703 +++++++++++++++++++++
 4 files changed, 742 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-brcmstb.txt
 create mode 100644 drivers/i2c/busses/i2c-brcmstb.c

diff --git a/Documentation/devicetree/bindings/i2c/i2c-brcmstb.txt b/Documentation/devicetree/bindings/i2c/i2c-brcmstb.txt
new file mode 100644
index 0000000..d6f724e
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-brcmstb.txt
 <at>  <at>  -0,0 +1,28  <at>  <at> 
+Broadcom stb bsc iic master controller
+
+Required properties:
+
+- compatible: should be "brcm,brcmstb-i2c"
+- clock-frequency: 32-bit decimal value of iic master clock freqency in Hz
+		   valid values are 375000, 390000, 187500, 200000
+		   93750, 97500, 46875 and 50000
+- reg: specifies the base physical address and size of the registers
+
+Optional properties :
(Continue reading)

Jayachandran C | 18 Mar 12:50 2015

[PATCH v4 0/3] i2c: Support for Netlogic XLP9XX/5XX I2C controller

Here is v4 of the driver for XLP9xx I2C controller. We have udpated
the driver to address review comments Uwe and Arnd.

Please let me know if there are any more comments or suggestions.

Thanks,
JC.

Changes v3->v4:
* Second round of changes from Uwe Kleine-König's review:
 - added variable in xlp9xx_i2c_mask_irq & xlp9xx_i2c_unmask_irq
 - use DIV_ROUND_UP when calculating prescale
 - removed unnecessary braces
 - renamed xlp9xx_i2c_set_rx_fifo_thres to xlp9xx_i2c_update_rx_fifo_thres
   and moved min macro there
* Changes for comments from Arnd Bergmann
 - made a separate patch for i2c device tree document
 - Use netlogic,xlp980-i2c as DT compatible string

Changes v2->v3:
* Implement changes from Uwe Kleine-König's review:
  - add documentation link
  - remove unnecessary #includes
  - remove DATARDY interrupt
  - clean up alignment and whitespace
  - set CMD_STOP flag only for the last transfer
  - correct freq assignment in xlp9xx_i2c_get_frequency
  - remove printing out adap.nr in case of failure
  - update writing to control register to make the logic clear
  - clean up the #define ordering and naming a bit more
(Continue reading)

Peter Hüwe | 18 Mar 00:14 2015
Picon
Picon

I2C Slave support - how to use it?

Hi Wolfram,

I think the I2C slave support is an excellent feature you added to Linux  
(thanks for that) but I somehow have some problems to get it working on -rc4.

What are the magical commands to get a linux slave on e.g. bus 1?

What I tried:
modprobe i2c-dev
modprobe i2c-slave-eeprom

# echo i2c_slave_eeprom 0x20 > /sys/bus/i2c/devices/i2c-1/new_device 
[ 16.119] i2c i2c-1: new_device: Instantiated device i2c_slave_eeprom at 0x20

# find /sys -name '*eeprom*'
/sys/bus/i2c/drivers/i2c-slave-eeprom
/sys/module/i2c_slave_eeprom
/sys/module/i2c_slave_eeprom/drivers/i2c:i2c-slave-eeprom

# ls  -lah /sys/bus/i2c/devices/1-0020/
insgesamt 0
drwxr-xr-x 3 root root    0 18. Mär 00:11 .
drwxr-xr-x 5 root root    0 18. Mär 00:11 ..
-r--r--r-- 1 root root 4,0K 18. Mär 00:11 modalias
-r--r--r-- 1 root root 4,0K 18. Mär 00:11 name
drwxr-xr-x 2 root root    0 18. Mär 00:11 power
lrwxrwxrwx 1 root root    0 18. Mär 00:11 subsystem -> ../../../../../bus/i2c
-rw-r--r-- 1 root root 4,0K 18. Mär 00:11 uevent

--> the slave-eeprom file mentioned here is not present.
(Continue reading)

Uwe Kleine-König | 17 Mar 15:41 2015
Picon

Re: [PATCH v3 2/2] i2c: Support for Netlogic XLP9XX/5XX I2C controller.

Hello,

On Tue, Mar 17, 2015 at 08:00:40PM +0530, Jayachandran C. wrote:
> On Sat, Mar 14, 2015 at 09:01:24PM +0100, Uwe Kleine-König wrote:
> > On Sat, Mar 14, 2015 at 05:18:37PM +0530, Jayachandran C. wrote:
> > > On Fri, Mar 13, 2015 at 11:24:06AM +0100, Uwe Kleine-König wrote:
> > > > On Fri, Mar 13, 2015 at 11:59:58AM +0530, Jayachandran C wrote:
> > > > > diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c
> > > > > new file mode 100644
> > > > > index 00000000..2f303ad
> > > > > --- /dev/null
> > > > > +++ b/drivers/i2c/busses/i2c-xlp9xx.c
> > > > >  <at>  <at>  -0,0 +1,446  <at>  <at> 
> > > > > [...]
> > > > > +
> > > > > +/*
> > > > > + * see Documentation/devicetree/bindings/i2c/i2c-xlp9xx.txt for device
> > > > > + * tree bindings documentation
> > > > > + */
> > > > When I asked for documentation here, I didn't meant the device tree
> > > > binding, but the hardware reference manual.
> > > 
> > > Unfortunately there is no standalone documentation for the I2C controller,
> > > this block is used in XLP9xx and XLP5xx SoCs and you can get the documentation
> > > for the whole SoC from support.broadcom.com if you have an account there.
> > I don't. According to the instructions to get such an account I have to
> > contact my "Sales/Engineering contacts at Broadcom or its
> > Distributors/Manufacturer's representatives directly". Who would that be
> > for me? You?
> 
(Continue reading)

Ben Dooks | 17 Mar 13:14 2015
Picon

[PATCH] i2c-gpio: add board_info to pdata

Add board_info so that the i2c-gpio driver can probe devices on probe
so that i2c_register_board_info() does not need to be used. This is
preferable for devices that get hotplugged as otherwise we need to do
i2c_unregister_board_info() which would be more code.

Signed-off-by: Ben Dooks <ben.dooks@...>
---
 drivers/i2c/busses/i2c-gpio.c | 8 ++++++++
 include/linux/i2c-gpio.h      | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index 34cfc0e..d1050bd 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
 <at>  <at>  -232,6 +232,14  <at>  <at>  static int i2c_gpio_probe(struct platform_device *pdev)
 		 pdata->scl_is_output_only
 		 ? ", no clock stretching" : "");

+	if (pdata->board_info) {
+		struct i2c_board_info const *info = pdata->board_info;
+		int nr;
+
+		for (nr = 0; nr <  pdata->board_size; info++, nr++)
+			i2c_new_device(adap, info);
+	}
+
 	return 0;
 }

(Continue reading)

Ben Dooks | 17 Mar 13:04 2015
Picon

[PATCH] i2c: i2c-gpio: fix some of gpio sleep issues

The i2c-gpio driver can be used in systems where the GPIO itself is
provided by a GPIO driver that may be sleeping (for example, SPI or
USB). In this case, it is preferable to use the _cansleep() variants
of the GPIO code.

We can only fix this up for the case where the i2c-gpio implementation
provides open-drain outputs as there are no gpio_direction_xxx_cansleep()
provided.

This removes the issues on the customer system with the console constantly
showing the following warning:

WARNING: CPU: 0 PID: 1 at drivers/gpio/gpiolib.c:2389 gpiod_set_raw_value

Signed-off-by: Ben Dooks <ben.dooks@...>
--
CC: Haavard Skinnemoen <hskinnemoen@...>
CC: Wolfram Sang <wsa@...>
CC: linux-i2c@...
---
 drivers/i2c/busses/i2c-gpio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index d1050bd..9d4d59c 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
 <at>  <at>  -44,7 +44,7  <at>  <at>  static void i2c_gpio_setsda_val(void *data, int state)
 {
 	struct i2c_gpio_platform_data *pdata = data;
(Continue reading)

Nicholas Mc Guire | 17 Mar 08:51 2015

[PATCH] i2c: davinci: fixup wait_for_completion_timeout handling

wait_for_completion_timeout return 0 (timeout) or >=1 (completion) so the check
for >= 0 is always true and can be dropped implying that r==-EREMOTEIO and thus
the return of -EREMOTEIO can be done in the   if (dev->buf_len)  branch.
As wait_for_completion_timeout returns unsigned long not int, and   int r   is
exclusively used for wait_for_completion_timeout it is renamed and the type
changed to unsigned long.

Signed-off-by: Nicholas Mc Guire <hofrat@...>
---

Patch was compile tested with davinci_all_defconfig (implies CONFIG_I2C_DAVINCI=y)

Patch is against 4.0-rc4 (localversion-next is -next-20150317)

 drivers/i2c/busses/i2c-davinci.c |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 6dc7ff5..120a4ef 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
 <at>  <at>  -304,7 +304,7  <at>  <at>  i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop)
 	struct davinci_i2c_platform_data *pdata = dev->pdata;
 	u32 flag;
 	u16 w;
-	int r;
+	unsigned long time_left;

 	/* Introduce a delay, required for some boards (e.g Davinci EVM) */
 	if (pdata->bus_delay)
(Continue reading)


Gmane