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

Commit 66304207 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull i2c updates from Wolfram Sang:
 "Here is the I2C pull request for 4.8:

   - the core and i801 driver gained support for SMBus Host Notify

   - core support for more than one address in DT

   - i2c_add_adapter() has now better error messages.  We can remove all
     error messages from drivers calling it as a next step.

   - bigger updates to rk3x driver to support rk3399 SoC

   - the at24 eeprom driver got refactored and can now read special
     variants with unique serials or fixed MAC addresses.

  The rest is regular driver updates and bugfixes"

* 'i2c/for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (66 commits)
  i2c: i801: use IS_ENABLED() instead of checking for built-in or module
  Documentation: i2c: slave: give proper example for pm usage
  Documentation: i2c: slave: describe buffer problems a bit better
  i2c: bcm2835: Don't complain on -EPROBE_DEFER from getting our clock
  i2c: i2c-smbus: drop useless stubs
  i2c: efm32: fix a failure path in efm32_i2c_probe()
  Revert "i2c: core: Cleanup I2C ACPI namespace"
  Revert "i2c: core: Add function for finding the bus speed from ACPI"
  i2c: Update the description of I2C_SMBUS
  i2c: i2c-smbus: fix i2c_handle_smbus_host_notify documentation
  eeprom: at24: tweak the loop_until_timeout() macro
  eeprom: at24: add support for at24mac series
  eeprom: at24: support reading the serial number for 24csxx
  eeprom: at24: platform_data: use BIT() macro
  eeprom: at24: split at24_eeprom_write() into specialized functions
  eeprom: at24: split at24_eeprom_read() into specialized functions
  eeprom: at24: hide the read/write loop behind a macro
  eeprom: at24: call read/write functions via function pointers
  eeprom: at24: coding style fixes
  eeprom: at24: move at24_read() below at24_eeprom_write()
  ...
parents 7ae0ae4a 175c7080
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -6,10 +6,20 @@ RK3xxx SoCs.
Required properties :

 - reg : Offset and length of the register set for the device
 - compatible : should be "rockchip,rk3066-i2c", "rockchip,rk3188-i2c",
		"rockchip,rk3228-i2c" or "rockchip,rk3288-i2c".
 - compatible: should be one of the following:
   - "rockchip,rk3066-i2c": for rk3066
   - "rockchip,rk3188-i2c": for rk3188
   - "rockchip,rk3228-i2c": for rk3228
   - "rockchip,rk3288-i2c": for rk3288
   - "rockchip,rk3399-i2c": for rk3399
 - interrupts : interrupt number
 - clocks : parent clock
 - clocks: See ../clock/clock-bindings.txt
   - For older hardware (rk3066, rk3188, rk3228, rk3288):
     - There is one clock that's used both to derive the functional clock
       for the device and as the bus clock.
   - For newer hardware (rk3399): specified by name
     - "i2c": This is used to derive the functional clock.
     - "pclk": This is the bus clock.

Required on RK3066, RK3188 :

+7 −0
Original line number Diff line number Diff line
@@ -62,6 +62,13 @@ wants to support one of the below features, it should adapt the bindings below.
- wakeup-source
	device can be used as a wakeup source.

- reg
	I2C slave addresses

- reg-names
	Names of map programmable addresses.
	It can contain any map needing another address than default one.

Binding may contain optional "interrupts" property, describing interrupts
used by the device. I2C core will assign "irq" interrupt (or the very first
interrupt if not using interrupt names) as primary interrupt for the slave.
+10 −9
Original line number Diff line number Diff line
@@ -139,9 +139,9 @@ If you want to add slave support to the bus driver:
* implement calls to register/unregister the slave and add those to the
  struct i2c_algorithm. When registering, you probably need to set the i2c
  slave address and enable slave specific interrupts. If you use runtime pm, you
  should use pm_runtime_forbid() because your device usually needs to be powered
  on always to be able to detect its slave address. When unregistering, do the
  inverse of the above.
  should use pm_runtime_get_sync() because your device usually needs to be
  powered on always to be able to detect its slave address. When unregistering,
  do the inverse of the above.

* Catch the slave interrupts and send appropriate i2c_slave_events to the backend.

@@ -173,13 +173,14 @@ During development of this API, the question of using buffers instead of just
bytes came up. Such an extension might be possible, usefulness is unclear at
this time of writing. Some points to keep in mind when using buffers:

* Buffers should be opt-in and slave drivers will always have to support
  byte-based transactions as the ultimate fallback because this is how the
  majority of HW works.
* Buffers should be opt-in and backend drivers will always have to support
  byte-based transactions as the ultimate fallback anyhow because this is how
  the majority of HW works.

* For backends simulating hardware registers, buffers are not helpful because
  on writes an action should be immediately triggered. For reads, the data in
  the buffer might get stale.
* For backends simulating hardware registers, buffers are largely not helpful
  because after each byte written an action should be immediately triggered.
  For reads, the data kept in the buffer might get stale if the backend just
  updated a register because of internal processing.

* A master can send STOP at any time. For partially transferred buffers, this
  means additional code to handle this exception. Such code tends to be
+6 −0
Original line number Diff line number Diff line
@@ -199,6 +199,12 @@ alerting device's address.

[S] [HostAddr] [Wr] A [DevAddr] A [DataLow] A [DataHigh] A [P]

This is implemented in the following way in the Linux kernel:
* I2C bus drivers which support SMBus Host Notify should call
  i2c_setup_smbus_host_notify() to setup SMBus Host Notify support.
* I2C drivers for devices which can trigger SMBus Host Notify should implement
  the optional alert() callback.


Packet Error Checking (PEC)
===========================
+5 −1
Original line number Diff line number Diff line
@@ -568,12 +568,16 @@ static void retry_timeout(unsigned long data)
}


static void ssif_alert(struct i2c_client *client, unsigned int data)
static void ssif_alert(struct i2c_client *client, enum i2c_alert_protocol type,
		       unsigned int data)
{
	struct ssif_info *ssif_info = i2c_get_clientdata(client);
	unsigned long oflags, *flags;
	bool do_get = false;

	if (type != I2C_PROTOCOL_SMBUS_ALERT)
		return;

	ssif_inc_stat(ssif_info, alerts);

	flags = ipmi_ssif_lock_cond(ssif_info, &oflags);
Loading