forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'i2c/for-4.3' of git://git.kernel.org/pub/scm/linux/kern…
…el/git/wsa/linux Pull i2c updates from Wolfram Sang: "Features: - new drivers: Renesas EMEV2, register based MUX, NXP LPC2xxx - core: scans DT and assigns wakeup interrupts. no driver changes needed. - core: some refcouting issues fixed and better API for that - core: new helper function for best effort block read emulation - slave framework: proper DT bindings and userspace instantiation - some bigger work for xiic, pxa, omap drivers .. and quite a number of smaller driver fixes, cleanups, improvements" * 'i2c/for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (65 commits) i2c: mux: reg Change ioread endianness for readback i2c: mux: reg: fix compilation warnings i2c: mux: reg: simplify register size checking i2c: muxes: fix leaked i2c adapter device node references i2c: allow specifying separate wakeup interrupt in device tree of/irq: export of_get_irq_byname() i2c: xgene-slimpro: dma_mapping_error() doesn't return an error code i2c: Replace I2C_CROS_EC_TUNNEL dependency eeprom: at24: use i2c_smbus_read_i2c_block_data_or_emulated i2c: core: Add support for best effort block read emulation i2c: lpc2k: add driver i2c: mux: Add register-based mux i2c-mux-reg i2c: dt: describe generic bindings i2c: slave: print warning if slave flag not set i2c: support 10 bit and slave addresses in sysfs 'new_device' i2c: take address space into account when checking for used addresses i2c: apply DT flags when probing i2c: make address check indpendent from client struct i2c: rename address check functions i2c: apply address offset for slaves, too ...
- Loading branch information
Showing
46 changed files
with
2,189 additions
and
524 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Device tree configuration for Renesas EMEV2 IIC controller | ||
|
||
Required properties: | ||
- compatible : "renesas,iic-emev2" | ||
- reg : address start and address range size of device | ||
- interrupts : specifier for the IIC controller interrupt | ||
- clocks : phandle to the IP core SCLK | ||
- clock-names : must be "sclk" | ||
- #address-cells : should be <1> | ||
- #size-cells : should be <0> | ||
|
||
Example: | ||
|
||
iic0: i2c@e0070000 { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
compatible = "renesas,iic-emev2"; | ||
reg = <0xe0070000 0x28>; | ||
interrupts = <0 32 IRQ_TYPE_EDGE_RISING>; | ||
clocks = <&iic0_sclk>; | ||
clock-names = "sclk"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
NXP I2C controller for LPC2xxx/178x/18xx/43xx | ||
|
||
Required properties: | ||
- compatible: must be "nxp,lpc1788-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: | ||
- clock-frequency: the desired I2C bus clock frequency in Hz; in | ||
absence of this property the default value is used (100 kHz). | ||
|
||
Example: | ||
i2c0: i2c@400a1000 { | ||
compatible = "nxp,lpc1788-i2c"; | ||
reg = <0x400a1000 0x1000>; | ||
interrupts = <18>; | ||
clocks = <&ccu1 CLK_APB1_I2C0>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
}; | ||
|
||
&i2c0 { | ||
clock-frequency = <400000>; | ||
|
||
lm75@48 { | ||
compatible = "nxp,lm75"; | ||
reg = <0x48>; | ||
}; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
Register-based I2C Bus Mux | ||
|
||
This binding describes an I2C bus multiplexer that uses a single register | ||
to route the I2C signals. | ||
|
||
Required properties: | ||
- compatible: i2c-mux-reg | ||
- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side | ||
port is connected to. | ||
* Standard I2C mux properties. See mux.txt in this directory. | ||
* I2C child bus nodes. See mux.txt in this directory. | ||
|
||
Optional properties: | ||
- reg: this pair of <offset size> specifies the register to control the mux. | ||
The <offset size> depends on its parent node. It can be any memory-mapped | ||
address. The size must be either 1, 2, or 4 bytes. If reg is omitted, the | ||
resource of this device will be used. | ||
- little-endian: The existence indicates the register is in little endian. | ||
- big-endian: The existence indicates the register is in big endian. | ||
If both little-endian and big-endian are omitted, the endianness of the | ||
CPU will be used. | ||
- write-only: The existence indicates the register is write-only. | ||
- idle-state: value to set the muxer to when idle. When no value is | ||
given, it defaults to the last value used. | ||
|
||
Whenever an access is made to a device on a child bus, the value set | ||
in the revelant node's reg property will be output to the register. | ||
|
||
If an idle state is defined, using the idle-state (optional) property, | ||
whenever an access is not being made to a device on a child bus, the | ||
register will be set according to the idle value. | ||
|
||
If an idle state is not defined, the most recently used value will be | ||
left programmed into the register. | ||
|
||
Example of a mux on PCIe card, the host is a powerpc SoC (big endian): | ||
|
||
i2c-mux { | ||
/* the <offset size> depends on the address translation | ||
* of the parent device. If omitted, device resource | ||
* will be used instead. The size is to determine | ||
* whether iowrite32, iowrite16, or iowrite8 will be used. | ||
*/ | ||
reg = <0x6028 0x4>; | ||
little-endian; /* little endian register on PCIe */ | ||
compatible = "i2c-mux-reg"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
i2c-parent = <&i2c1>; | ||
i2c@0 { | ||
reg = <0>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
si5338: clock-generator@70 { | ||
compatible = "silabs,si5338"; | ||
reg = <0x70>; | ||
/* other stuff */ | ||
}; | ||
}; | ||
|
||
i2c@1 { | ||
/* data is written using iowrite32 */ | ||
reg = <1>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
si5338: clock-generator@70 { | ||
compatible = "silabs,si5338"; | ||
reg = <0x70>; | ||
/* other stuff */ | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Generic device tree bindings for I2C busses | ||
=========================================== | ||
|
||
This document describes generic bindings which can be used to describe I2C | ||
busses in a device tree. | ||
|
||
Required properties | ||
------------------- | ||
|
||
- #address-cells - should be <1>. Read more about addresses below. | ||
- #size-cells - should be <0>. | ||
- compatible - name of I2C bus controller following generic names | ||
recommended practice. | ||
|
||
For other required properties e.g. to describe register sets, | ||
clocks, etc. check the binding documentation of the specific driver. | ||
|
||
The cells properties above define that an address of children of an I2C bus | ||
are described by a single value. This is usually a 7 bit address. However, | ||
flags can be attached to the address. I2C_TEN_BIT_ADDRESS is used to mark a 10 | ||
bit address. It is needed to avoid the ambiguity between e.g. a 7 bit address | ||
of 0x50 and a 10 bit address of 0x050 which, in theory, can be on the same bus. | ||
Another flag is I2C_OWN_SLAVE_ADDRESS to mark addresses on which we listen to | ||
be devices ourselves. | ||
|
||
Optional properties | ||
------------------- | ||
|
||
These properties may not be supported by all drivers. However, if a driver | ||
wants to support one of the below features, it should adapt the bindings below. | ||
|
||
- clock-frequency - frequency of bus clock in Hz. | ||
- wakeup-source - device can be used as a wakeup source. | ||
|
||
- interrupts - interrupts used by the device. | ||
- interrupt-names - "irq" and "wakeup" names are recognized by I2C core, | ||
other names are left to individual drivers. | ||
|
||
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. | ||
|
||
Also, if device is marked as a wakeup source, I2C core will set up "wakeup" | ||
interrupt for the device. If "wakeup" interrupt name is not present in the | ||
binding, then primary interrupt will be used as wakeup interrupt. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.