Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7dbaef5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull i2c updates from Wolfram Sang:
 "Highlights:

   - class based instantiation finally dropped for most embedded drivers
     bringing boot up performance gains
   - removed two drivers (one outdated, one a duplicate)
   - ACPI has now operation region support (thanks to Lan Tianyu)
   - the i2c-stub driver got overhauled and gained new features to
     become more useful when writing i2c client drivers (thanks to
     Guenter Roeck and Jean Delvare)

  The rest is driver bugfixes, added bindings/ids, cleanups..."

* 'i2c/for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (43 commits)
  i2c: mpc: delete unneeded test before of_node_put
  i2c: rk3x: fix interrupt handling issue
  i2c: imx: Fix format warning for dev_dbg
  i2c: qup: disable clks and return instead of just returning error
  i2c: exynos5: always enable HSI2C
  i2c: designware: add new bindings
  i2c: gpio: Drop dead code in i2c_gpio_remove
  i2c: pca954x: put the mux to disconnected state after resume
  i2c: st: Update i2c timings
  drivers/i2c/busses: use correct type for dma_map/unmap
  i2c: i2c-st: Use %pa to print 'resource_size_t' type
  i2c: s3c2410: resume the I2C controller earlier
  i2c: stub: Avoid an array overrun on I2C block transfers
  i2c: i801: Add device ID for Intel Wildcat Point PCH
  i2c: i801: Fix the alignment of the device table
  i2c: stub: Add support for banked register ranges
  i2c: stub: Remember the number of emulated chips
  i2c: stub: Add support for SMBus block commands
  i2c: efm32: correct namespacing of location property
  i2c: exynos5: remove extra line and fix an assignment
  ...
parents 7b9828d4 ebba48b7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ Required properties :
Recommended properties :

 - clock-frequency : maximal I2C bus clock frequency in Hz.
 - efm32,location : Decides the location of the USART I/O pins.
 - energymicro,location : Decides the location of the USART I/O pins.
   Allowed range : [0 .. 6]

Example:
@@ -23,7 +23,7 @@ Example:
		clocks = <&cmu clk_HFPERCLKI2C0>;
		clock-frequency = <100000>;
		status = "ok";
		efm32,location = <3>;
		energymicro,location = <3>;

		eeprom@50 {
			compatible = "microchip,24c02";
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ Supported adapters:
  * Intel Avoton (SOC)
  * Intel Wellsburg (PCH)
  * Intel Coleto Creek (PCH)
  * Intel Wildcat Point (PCH)
  * Intel Wildcat Point-LP (PCH)
  * Intel BayTrail (SOC)
   Datasheets: Publicly available at the Intel website
+17 −6
Original line number Diff line number Diff line
@@ -2,9 +2,9 @@ MODULE: i2c-stub

DESCRIPTION:

This module is a very simple fake I2C/SMBus driver.  It implements five
This module is a very simple fake I2C/SMBus driver.  It implements six
types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, (r/w)
word data, and (r/w) I2C block data.
word data, (r/w) I2C block data, and (r/w) SMBus block data.

You need to provide chip addresses as a module parameter when loading this
driver, which will then only react to SMBus commands to these addresses.
@@ -19,6 +19,14 @@ A pointer register with auto-increment is implemented for all byte
operations.  This allows for continuous byte reads like those supported by
EEPROMs, among others.

SMBus block command support is disabled by default, and must be enabled
explicitly by setting the respective bits (0x03000000) in the functionality
module parameter.

SMBus block commands must be written to configure an SMBus command for
SMBus block operations. Writes can be partial. Block read commands always
return the number of bytes selected with the largest write so far.

The typical use-case is like this:
	1. load this module
	2. use i2cset (from the i2c-tools project) to pre-load some data
@@ -39,15 +47,18 @@ unsigned long functionality:
	value 0x1f0000 would only enable the quick, byte and byte data
	commands.

u8 bank_reg[10]
u8 bank_mask[10]
u8 bank_start[10]
u8 bank_end[10]:
	Optional bank settings. They tell which bits in which register
	select the active bank, as well as the range of banked registers.

CAVEATS:

If your target driver polls some byte or word waiting for it to change, the
stub could lock it up.  Use i2cset to unlock it.

If the hardware for your driver has banked registers (e.g. Winbond sensors
chips) this module will not work well - although it could be extended to
support that pretty easily.

If you spam it hard enough, printk can be lossy.  This module really wants
something like relayfs.
+17 −1
Original line number Diff line number Diff line
@@ -2,7 +2,9 @@
# I2C subsystem configuration
#

menuconfig I2C
menu "I2C support"

config I2C
	tristate "I2C support"
	select RT_MUTEXES
	---help---
@@ -21,6 +23,18 @@ menuconfig I2C
	  This I2C support can also be built as a module.  If so, the module
	  will be called i2c-core.

config I2C_ACPI
	bool "I2C ACPI support"
	select I2C
	depends on ACPI
	default y
	help
	  Say Y here if you want to enable ACPI I2C support. This includes support
	  for automatic enumeration of I2C slave devices and support for ACPI I2C
	  Operation Regions. Operation Regions allow firmware (BIOS) code to
	  access I2C slave devices, such as smart batteries through an I2C host
	  controller driver.

if I2C

config I2C_BOARDINFO
@@ -124,3 +138,5 @@ config I2C_DEBUG_BUS
	  on.

endif # I2C

endmenu
+4 −1
Original line number Diff line number Diff line
@@ -2,8 +2,11 @@
# Makefile for the i2c core.
#

i2ccore-y := i2c-core.o
i2ccore-$(CONFIG_I2C_ACPI)	+= i2c-acpi.o

obj-$(CONFIG_I2C_BOARDINFO)	+= i2c-boardinfo.o
obj-$(CONFIG_I2C)		+= i2c-core.o
obj-$(CONFIG_I2C)		+= i2ccore.o
obj-$(CONFIG_I2C_SMBUS)		+= i2c-smbus.o
obj-$(CONFIG_I2C_CHARDEV)	+= i2c-dev.o
obj-$(CONFIG_I2C_MUX)		+= i2c-mux.o
Loading