Skip to content

Commit

Permalink
Merge branch 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/wsa/linux

Pull i2c updates from Wolfram Sang:

 - mainly feature additions to drivers (stm32f7, qup, xlp9xx, mlxcpld, ...)

 - conversion to use the i2c_8bit_addr_from_msg macro consistently

 - move includes to platform_data

 - core updates to allow the (still in review) I3C subsystem to connect

 - and the regular share of smaller driver updates

* 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (68 commits)
  i2c: qup: fix building without CONFIG_ACPI
  i2c: tegra: Remove suspend-resume
  i2c: imx-lpi2c: Switch to SPDX identifier
  i2c: mxs: Switch to SPDX identifier
  i2c: busses: make use of i2c_8bit_addr_from_msg
  i2c: algos: make use of i2c_8bit_addr_from_msg
  i2c: rcar: document R8A77980 bindings
  i2c: qup: Add command-line parameter to override SCL frequency
  i2c: qup: Correct duty cycle for FM and FM+
  i2c: qup: Add support for Fast Mode Plus
  i2c: qup: add probe path for Centriq ACPI devices
  i2c: robotfuzz-osif: drop pointless test
  i2c: robotfuzz-osif: remove pointless local variable
  i2c: rk3x: Don't print visible virtual mapping MMIO address
  i2c: opal: don't check number of messages in the driver
  i2c: ibm_iic: don't check number of messages in the driver
  i2c: imx: Switch to SPDX identifier
  i2c: mux: pca954x: merge calls to of_match_device and of_device_get_match_data
  i2c: mux: demux-pinctrl: use proper parent device for demux adapter
  i2c: mux: improve error message for failed symlink
  ...
  • Loading branch information
torvalds committed Jun 14, 2018
2 parents 463f202 + 53e3962 commit 9bca19a
Show file tree
Hide file tree
Showing 94 changed files with 1,683 additions and 483 deletions.
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/i2c/i2c-davinci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Recommended properties :
- clock-frequency : desired I2C bus clock frequency in Hz.
- ti,has-pfunc: boolean; if defined, it indicates that SoC supports PFUNC
registers. PFUNC registers allow to switch I2C pins to function as
GPIOs, so they can by toggled manually.
GPIOs, so they can be toggled manually.

Example (enbw_cmc board):
i2c@1c22000 {
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/i2c/i2c-rcar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Required properties:
"renesas,i2c-r8a7796" if the device is a part of a R8A7796 SoC.
"renesas,i2c-r8a77965" if the device is a part of a R8A77965 SoC.
"renesas,i2c-r8a77970" if the device is a part of a R8A77970 SoC.
"renesas,i2c-r8a77980" if the device is a part of a R8A77980 SoC.
"renesas,i2c-r8a77995" if the device is a part of a R8A77995 SoC.
"renesas,rcar-gen1-i2c" for a generic R-Car Gen1 compatible device.
"renesas,rcar-gen2-i2c" for a generic R-Car Gen2 or RZ/G1 compatible
Expand Down
4 changes: 1 addition & 3 deletions Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ Required properties:
(b) "samsung, s3c2440-i2c", for i2c compatible with s3c2440 i2c.
(c) "samsung, s3c2440-hdmiphy-i2c", for s3c2440-like i2c used
inside HDMIPHY block found on several samsung SoCs
(d) "samsung, exynos5440-i2c", for s3c2440-like i2c used
on EXYNOS5440 which does not need GPIO configuration.
(e) "samsung, exynos5-sata-phy-i2c", for s3c2440-like i2c used as
(d) "samsung, exynos5-sata-phy-i2c", for s3c2440-like i2c used as
a host to SATA PHY controller on an internal bus.
- reg: physical base address of the controller and length of memory mapped
region.
Expand Down
4 changes: 4 additions & 0 deletions Documentation/i2c/busses/i2c-mlxcpld
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ The next transaction types are supported:
- Write Byte/Block.

Registers:
CPBLTY 0x0 - capability reg.
Bits [6:5] - transaction length. b01 - 72B is supported,
36B in other case.
Bit 7 - SMBus block read support.
CTRL 0x1 - control reg.
Resets all the registers.
HALF_CYC 0x4 - cycle reg.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/i2c/busses/i2c-ocores
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Usage
i2c-ocores uses the platform bus, so you need to provide a struct
platform_device with the base address and interrupt number. The
dev.platform_data of the device should also point to a struct
ocores_i2c_platform_data (see linux/i2c-ocores.h) describing the
ocores_i2c_platform_data (see linux/platform_data/i2c-ocores.h) describing the
distance between registers and the input clock speed.
There is also a possibility to attach a list of i2c_board_info which
the i2c-ocores driver will add to the bus upon creation.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/i2c/muxes/i2c-mux-gpio
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ i2c-mux-gpio uses the platform bus, so you need to provide a struct
platform_device with the platform_data pointing to a struct
i2c_mux_gpio_platform_data with the I2C adapter number of the master
bus, the number of bus segments to create and the GPIO pins used
to control it. See include/linux/i2c-mux-gpio.h for details.
to control it. See include/linux/platform_data/i2c-mux-gpio.h for details.

E.G. something like this for a MUX providing 4 bus segments
controlled through 3 GPIO pins:

#include <linux/i2c-mux-gpio.h>
#include <linux/platform_data/i2c-mux-gpio.h>
#include <linux/platform_device.h>

static const unsigned myboard_gpiomux_gpios[] = {
Expand Down
8 changes: 4 additions & 4 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5953,14 +5953,14 @@ GENERIC GPIO I2C DRIVER
M: Haavard Skinnemoen <hskinnemoen@gmail.com>
S: Supported
F: drivers/i2c/busses/i2c-gpio.c
F: include/linux/i2c-gpio.h
F: include/linux/platform_data/i2c-gpio.h

GENERIC GPIO I2C MULTIPLEXER DRIVER
M: Peter Korsgaard <peter.korsgaard@barco.com>
L: linux-i2c@vger.kernel.org
S: Supported
F: drivers/i2c/muxes/i2c-mux-gpio.c
F: include/linux/i2c-mux-gpio.h
F: include/linux/platform_data/i2c-mux-gpio.h
F: Documentation/i2c/muxes/i2c-mux-gpio

GENERIC HDLC (WAN) DRIVERS
Expand Down Expand Up @@ -10392,7 +10392,7 @@ F: arch/arm/mach-omap1/
F: arch/arm/plat-omap/
F: arch/arm/configs/omap1_defconfig
F: drivers/i2c/busses/i2c-omap.c
F: include/linux/i2c-omap.h
F: include/linux/platform_data/i2c-omap.h

OMAP2+ SUPPORT
M: Tony Lindgren <tony@atomide.com>
Expand Down Expand Up @@ -10424,7 +10424,7 @@ F: drivers/regulator/tps65218-regulator.c
F: drivers/regulator/tps65910-regulator.c
F: drivers/regulator/twl-regulator.c
F: drivers/regulator/twl6030-regulator.c
F: include/linux/i2c-omap.h
F: include/linux/platform_data/i2c-omap.h

ONION OMEGA2+ BOARD
M: Harvey Hunt <harveyhuntnexus@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ks8695/board-acs5k.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <linux/gpio/machine.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/i2c-gpio.h>
#include <linux/platform_data/i2c-gpio.h>
#include <linux/platform_data/pca953x.h>

#include <linux/mtd/mtd.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/board-htcherald.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
#include <linux/platform_data/i2c-gpio.h>
#include <linux/htcpld.h>
#include <linux/leds.h>
#include <linux/spi/spi.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define __ARCH_ARM_MACH_OMAP1_COMMON_H

#include <linux/mtd/mtd.h>
#include <linux/i2c-omap.h>
#include <linux/platform_data/i2c-omap.h>
#include <linux/reboot.h>

#include <asm/exception.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

#include <linux/i2c.h>
#include <linux/i2c-omap.h>
#include <linux/platform_data/i2c-omap.h>
#include <mach/mux.h>
#include "soc.h"

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/mfd/twl.h>
#include <linux/i2c-omap.h>
#include <linux/platform_data/i2c-omap.h>
#include <linux/reboot.h>
#include <linux/irqchip/irq-omap-intc.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod_2420_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* XXX these should be marked initdata for multi-OMAP kernels
*/

#include <linux/i2c-omap.h>
#include <linux/platform_data/i2c-omap.h>
#include <linux/omap-dma.h>

#include "omap_hwmod.h"
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod_2430_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* XXX these should be marked initdata for multi-OMAP kernels
*/

#include <linux/i2c-omap.h>
#include <linux/platform_data/i2c-omap.h>
#include <linux/platform_data/hsmmc-omap.h>
#include <linux/omap-dma.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod_33xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* GNU General Public License for more details.
*/

#include <linux/i2c-omap.h>
#include <linux/platform_data/i2c-omap.h>

#include "omap_hwmod.h"
#include "omap_hwmod_common_data.h"
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* XXX these should be marked initdata for multi-OMAP kernels
*/

#include <linux/i2c-omap.h>
#include <linux/platform_data/i2c-omap.h>
#include <linux/power/smartreflex.h>
#include <linux/platform_data/hsmmc-omap.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod_44xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <linux/io.h>
#include <linux/platform_data/hsmmc-omap.h>
#include <linux/power/smartreflex.h>
#include <linux/i2c-omap.h>
#include <linux/platform_data/i2c-omap.h>

#include <linux/omap-dma.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod_54xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <linux/io.h>
#include <linux/platform_data/hsmmc-omap.h>
#include <linux/power/smartreflex.h>
#include <linux/i2c-omap.h>
#include <linux/platform_data/i2c-omap.h>

#include <linux/omap-dma.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod_7xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <linux/io.h>
#include <linux/platform_data/hsmmc-omap.h>
#include <linux/power/smartreflex.h>
#include <linux/i2c-omap.h>
#include <linux/platform_data/i2c-omap.h>

#include <linux/omap-dma.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/palmz72.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <linux/wm97xx.h>
#include <linux/power_supply.h>
#include <linux/usb/gpio_vbus.h>
#include <linux/i2c-gpio.h>
#include <linux/platform_data/i2c-gpio.h>
#include <linux/gpio/machine.h>

#include <asm/mach-types.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/viper.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <linux/sched.h>
#include <linux/gpio.h>
#include <linux/jiffies.h>
#include <linux/i2c-gpio.h>
#include <linux/platform_data/i2c-gpio.h>
#include <linux/gpio/machine.h>
#include <linux/platform_data/i2c-pxa.h>
#include <linux/serial_8250.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-sa1100/simpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <linux/input.h>
#include <linux/gpio_keys.h>
#include <linux/leds.h>
#include <linux/i2c-gpio.h>
#include <linux/platform_data/i2c-gpio.h>

#include "generic.h"

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/alchemy/board-gpr.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <linux/leds.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
#include <linux/platform_data/i2c-gpio.h>
#include <linux/gpio/machine.h>
#include <asm/bootinfo.h>
#include <asm/idle.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boards/board-sh7785lcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/i2c-pca-platform.h>
#include <linux/platform_data/i2c-pca-platform.h>
#include <linux/i2c-algo-pca.h>
#include <linux/usb/r8a66597.h>
#include <linux/sh_intc.h>
Expand Down
4 changes: 1 addition & 3 deletions drivers/i2c/algos/i2c-algo-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,7 @@ static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
}
}
} else { /* normal 7bit address */
addr = msg->addr << 1;
if (flags & I2C_M_RD)
addr |= 1;
addr = i2c_8bit_addr_from_msg(msg);
if (flags & I2C_M_REV_DIR_ADDR)
addr ^= 1;
ret = try_address(i2c_adap, addr, retries);
Expand Down
5 changes: 1 addition & 4 deletions drivers/i2c/algos/i2c-algo-pca.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,8 @@ static int pca_address(struct i2c_algo_pca_data *adap,
struct i2c_msg *msg)
{
int sta = pca_get_con(adap);
int addr;
int addr = i2c_8bit_addr_from_msg(msg);

addr = ((0x7f & msg->addr) << 1);
if (msg->flags & I2C_M_RD)
addr |= 1;
DEB2("=== SLAVE ADDRESS %#04x+%c=%#04x\n",
msg->addr, msg->flags & I2C_M_RD ? 'R' : 'W', addr);

Expand Down
8 changes: 2 additions & 6 deletions drivers/i2c/algos/i2c-algo-pcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,9 @@ static int pcf_readbytes(struct i2c_adapter *i2c_adap, char *buf,
static int pcf_doAddress(struct i2c_algo_pcf_data *adap,
struct i2c_msg *msg)
{
unsigned short flags = msg->flags;
unsigned char addr;
unsigned char addr = i2c_8bit_addr_from_msg(msg);

addr = msg->addr << 1;
if (flags & I2C_M_RD)
addr |= 1;
if (flags & I2C_M_REV_DIR_ADDR)
if (msg->flags & I2C_M_REV_DIR_ADDR)
addr ^= 1;
i2c_outb(adap, addr);

Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ config I2C_STM32F4
config I2C_STM32F7
tristate "STMicroelectronics STM32F7 I2C support"
depends on ARCH_STM32 || COMPILE_TEST
select I2C_SLAVE
help
Enable this option to add support for STM32 I2C controller embedded
in STM32F7 SoCs.
Expand Down
3 changes: 2 additions & 1 deletion drivers/i2c/busses/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ obj-$(CONFIG_I2C_SIRF) += i2c-sirf.o
obj-$(CONFIG_I2C_SPRD) += i2c-sprd.o
obj-$(CONFIG_I2C_ST) += i2c-st.o
obj-$(CONFIG_I2C_STM32F4) += i2c-stm32f4.o
obj-$(CONFIG_I2C_STM32F7) += i2c-stm32f7.o
i2c-stm32f7-drv-objs := i2c-stm32f7.o i2c-stm32.o
obj-$(CONFIG_I2C_STM32F7) += i2c-stm32f7-drv.o
obj-$(CONFIG_I2C_STU300) += i2c-stu300.o
obj-$(CONFIG_I2C_SUN6I_P2WI) += i2c-sun6i-p2wi.o
obj-$(CONFIG_I2C_SYNQUACER) += i2c-synquacer.o
Expand Down
3 changes: 1 addition & 2 deletions drivers/i2c/busses/i2c-aspeed.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,12 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
{
u32 command = ASPEED_I2CD_M_START_CMD | ASPEED_I2CD_M_TX_CMD;
struct i2c_msg *msg = &bus->msgs[bus->msgs_index];
u8 slave_addr = msg->addr << 1;
u8 slave_addr = i2c_8bit_addr_from_msg(msg);

bus->master_state = ASPEED_I2C_MASTER_START;
bus->buf_index = 0;

if (msg->flags & I2C_M_RD) {
slave_addr |= 1;
command |= ASPEED_I2CD_M_RX_CMD;
/* Need to let the hardware know to NACK after RX. */
if (msg->len == 1 && !(msg->flags & I2C_M_RECV_LEN))
Expand Down
12 changes: 10 additions & 2 deletions drivers/i2c/busses/i2c-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,16 @@ static irqreturn_t atmel_twi_interrupt(int irq, void *dev_id)
* the RXRDY interrupt first in order to not keep garbage data in the
* Receive Holding Register for the next transfer.
*/
if (irqstatus & AT91_TWI_RXRDY)
at91_twi_read_next_byte(dev);
if (irqstatus & AT91_TWI_RXRDY) {
/*
* Read all available bytes at once by polling RXRDY usable w/
* and w/o FIFO. With FIFO enabled we could also read RXFL and
* avoid polling RXRDY.
*/
do {
at91_twi_read_next_byte(dev);
} while (at91_twi_read(dev, AT91_TWI_SR) & AT91_TWI_RXRDY);
}

/*
* When a NACK condition is detected, the I2C controller sets the NACK,
Expand Down
Loading

0 comments on commit 9bca19a

Please sign in to comment.