Skip to content

Add I2C support to Broadcom iProc

Ray Jui linux-arm-kernel linux-devicetree linux-gpio linux-i2c linux-pci linux-serial linux-spi lkml 16 versions – Applied

Status from this message: Applied to for-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 posting 2/23 patches 1 replyIn review
  2. v7 posting 2/24 patches 1 replyApplied
  3. v6 posting 2/24 patches 5 repliesApplied
Earlier versions · 13
VersionPostedPatchesRepliesStatus
v5 posting 2/24 patches7 repliesSuperseded
v4 posting 2/24 patches3 repliesSuperseded
v3 posting 2/23 patches6 repliesSuperseded
v9 Latest3 patches11 repliesApplied
v8 posting 1/23 patches5 repliesSuperseded
v7 posting 1/23 patches4 repliesSuperseded
v6 posting 1/23 patches2 repliesSuperseded
v5 posting 1/23 patches9 repliesSuperseded
v4 posting 1/23 patches19 repliesSuperseded
v2 posting 2/24 patches17 repliesSuperseded
v3 posting 1/23 patches8 repliesSuperseded
v2 posting 1/24 patches4 repliesSuperseded
v14 patches9 repliesSuperseded

Changes in v9 from the cover letter

- Sort header includes in alphabetical order
- Use correct error code
- Get rid of redundant functions and combine functions to make driver more slim
- Get rid of redundant debugging prints that are already available from the I2C framework
- Other minor improvements

Patches in v9 Applied

#Subject and filesSizeRepliesApplied
1/3i2c: iProc: define Broadcom iProc I2C bindingDocumentation/devicetree/bindings/i2c/brcm,iproc-i2c.txt+37 -01 reply
2/3i2c: iproc: Add Broadcom iProc I2C Driverdrivers/i2c/busses/Kconfig drivers/i2c/busses/Makefile drivers/i2c/busses/i2c-bcm-iproc.c+472 -06 replies
3/3ARM: dts: add I2C device nodes for Broadcom Cygnusarch/arm/boot/dts/bcm-cygnus.dtsi+20 -04 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchScott BrandenKevin Cernekee
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v9 thread

Cover letter [PATCH v9 0/3] Add I2C support to Broadcom iProc

This patchset contains the initial I2C support for Broadcom iProc family of SoCs.

The iProc I2C controller has separate internal TX and RX FIFOs, each has a size of 64 bytes. The iProc I2C controller supports two bus speeds including standard mode (100 kHz) and fast mode (400 kHz)

Synced code base to Linux 3.19-rc7

Changes from v8:
- Sort header includes in alphabetical order
- Use correct error code
- Get rid of redundant functions and combine functions to make driver more slim
- Get rid of redundant debugging prints that are already available from the I2C framework
- Other minor improvements

Changes from v7:
- Remove redundant 10-bit address check in the driver
- Fix the driver that accidentally emits 1-byte of data with zero content in the case of SMBUS quick command
- Improve debugging prints in the driver
- Other minor improvements

Changes from v6:
- Get rid of unnecessary atomic variable usage in the driver
- Improve the "waiting for transaction to complete" logic further by making sure there's no pending/ongoing interrupt by the time when flag 'xfer_is_done' is checked
- After disabling interrupt with 'writel', add 'readl' to the same register to flush the bus to ensure the write has gone through

Changes from v5:
- Improve the "waiting for transaction to be complete" logic to take care of the corner case when an interrupt fires after wait_for_completion_timeout times out
- Improve the logic to disable I2C interrupt in the remove function. Make it more generic so it works for both dedicated and shared interrupt

Changes from v4:
- Remove redundant header file includes
- Change the logic that waits for the host controller to be idle to simply return -EBUSY
- Use proper print level and error codes in the driver
- Allow zero length message in the driver to support I2C_SMBUS_QUICK
- Change back to use devm_request_irq. Disable interrupt in the remove function so there's no outstanding I2C interrupt when the driver is being removed from the framework
- Other minor miscellaneous improvements and fixes

Changes from v3:
- Add config dependency to COMPILE_TEST to allow the driver to be build tested by other platforms
- Improve CPU utilization efficiency in the loop of waiting for bus to idle
- Add more comment in the driver to clarify the way how the "start busy" interrupt is triggered from the I2C controller
- Fix inconsistent coding style and format
- Improve the bus speed validation logic in the driver
- Add code to free the interrupt line in driver's remove function. Also change to use non-devm API to request the interrupt line
- Other miscellaneous improvements and fixes

Changes from v2:
- Have the I2C driver default to y so it does not need to be selected from ARCH_BCM_IPROC. This also helps to get rid of one patch. The driver still depends on ARCH_BCM_IPROC
- Get rid of redundant check on resource returned by platform_get_resource

Changes from v1:
- Fix function argument parenthesis
- Get rid of redundant driver owner field

Ray Jui (3):
i2c: iProc: define Broadcom iProc I2C binding
i2c: iproc: Add Broadcom iProc I2C Driver
ARM: dts: add I2C device nodes for Broadcom Cygnus

 .../devicetree/bindings/i2c/brcm,iproc-i2c.txt     |   37 ++
 arch/arm/boot/dts/bcm-cygnus.dtsi                  |   20 +
 drivers/i2c/busses/Kconfig                         |   10 +
 drivers/i2c/busses/Makefile                        |    1 +
 drivers/i2c/busses/i2c-bcm-iproc.c                 |  461 ++++++++++++++++++++
 5 files changed, 529 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/brcm,iproc-i2c.txt
 create mode 100644 drivers/i2c/busses/i2c-bcm-iproc.c
Signature · 1 line
1.7.9.5