Skip to content

Commit

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

Pull i2c updates from Wolfram Sang:
 "I2C has quite some patches for you this time. I hope it is the move to
  per-driver-maintainers which is now showing results. We will see.

  The big news is two new drivers (Nuvoton NPCM and Qualcomm CCI),
  larger refactoring of the Designware, Tegra, and PXA drivers, the
  Cadence driver supports being a slave now, and there is support to
  instanciate SPD eeproms for well-known cases (which will be
  user-visible because the i801 driver supports it), and some
  devm_platform_ioremap_resource() conversions which blow up the
  diffstat.

  Note that I applied the Nuvoton driver quite late, so some minor fixup
  patches arrived during the merge window. I chose to apply them right
  away because they were trivial"

* 'i2c/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (109 commits)
  i2c: Drop stray comma in MODULE_AUTHOR statements
  i2c: npcm7xx: npcm_i2caddr[] can be static
  MAINTAINERS: npcm7xx: Add maintainer for Nuvoton NPCM BMC
  i2c: npcm7xx: Fix a couple of error codes in probe
  i2c: icy: Fix build with CONFIG_AMIGA_PCMCIA=n
  i2c: npcm7xx: Remove unnecessary parentheses
  i2c: npcm7xx: Add support for slave mode for Nuvoton
  i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver
  dt-bindings: i2c: npcm7xx: add NPCM I2C controller
  i2c: pxa: don't error out if there's no pinctrl
  i2c: add 'single-master' property to generic bindings
  i2c: designware: Add Baikal-T1 System I2C support
  i2c: designware: Move reg-space remapping into a dedicated function
  i2c: designware: Retrieve quirk flags as early as possible
  i2c: designware: Convert driver to using regmap API
  i2c: designware: Discard Cherry Trail model flag
  i2c: designware: Add Baytrail sem config DW I2C platform dependency
  i2c: designware: slave: Set DW I2C core module dependency
  i2c: designware: Use `-y` to build multi-object modules
  dt-bindings: i2c: dw: Add Baikal-T1 SoC I2C controller
  ...
  • Loading branch information
torvalds committed Jun 13, 2020
2 parents ac911b3 + d790eeb commit 91fa588
Show file tree
Hide file tree
Showing 80 changed files with 5,901 additions and 1,425 deletions.
73 changes: 0 additions & 73 deletions Documentation/devicetree/bindings/i2c/i2c-designware.txt

This file was deleted.

92 changes: 92 additions & 0 deletions Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Qualcomm Camera Control Interface (CCI) I2C controller

PROPERTIES:

- compatible:
Usage: required
Value type: <string>
Definition: must be one of:
"qcom,msm8916-cci"
"qcom,msm8996-cci"
"qcom,sdm845-cci"

- reg
Usage: required
Value type: <prop-encoded-array>
Definition: base address CCI I2C controller and length of memory
mapped region.

- interrupts:
Usage: required
Value type: <prop-encoded-array>
Definition: specifies the CCI I2C interrupt. The format of the
specifier is defined by the binding document describing
the node's interrupt parent.

- clocks:
Usage: required
Value type: <prop-encoded-array>
Definition: a list of phandle, should contain an entry for each
entries in clock-names.

- clock-names
Usage: required
Value type: <string>
Definition: a list of clock names, must include "cci" clock.

- power-domains
Usage: required for "qcom,msm8996-cci"
Value type: <prop-encoded-array>
Definition:

SUBNODES:

The CCI provides I2C masters for one (msm8916) or two i2c busses (msm8996 and
sdm845), described as subdevices named "i2c-bus@0" and "i2c-bus@1".

PROPERTIES:

- reg:
Usage: required
Value type: <u32>
Definition: Index of the CCI bus/master

- clock-frequency:
Usage: optional
Value type: <u32>
Definition: Desired I2C bus clock frequency in Hz, defaults to 100
kHz if omitted.

Example:

cci@a0c000 {
compatible = "qcom,msm8996-cci";
#address-cells = <1>;
#size-cells = <0>;
reg = <0xa0c000 0x1000>;
interrupts = <GIC_SPI 295 IRQ_TYPE_EDGE_RISING>;
clocks = <&mmcc MMSS_MMAGIC_AHB_CLK>,
<&mmcc CAMSS_TOP_AHB_CLK>,
<&mmcc CAMSS_CCI_AHB_CLK>,
<&mmcc CAMSS_CCI_CLK>,
<&mmcc CAMSS_AHB_CLK>;
clock-names = "mmss_mmagic_ahb",
"camss_top_ahb",
"cci_ahb",
"cci",
"camss_ahb";

i2c-bus@0 {
reg = <0>;
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
};

i2c-bus@1 {
reg = <1>;
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
};
};
73 changes: 45 additions & 28 deletions Documentation/devicetree/bindings/i2c/i2c.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,26 @@ Generic device tree bindings for I2C busses
===========================================

This document describes generic bindings which can be used to describe I2C
busses in a device tree.
busses and their child devices in a device tree.

Required properties
-------------------
Required properties (per bus)
-----------------------------

- #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.
- compatible - name of I2C bus controller

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.
are described by a single value.

Optional properties
-------------------
Optional properties (per bus)
-----------------------------

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.
wants to support one of the below features, it should adapt these bindings.

- clock-frequency
frequency of bus clock in Hz.
Expand Down Expand Up @@ -73,31 +67,54 @@ wants to support one of the below features, it should adapt the bindings below.
i2c bus clock frequency (clock-frequency).
Specified in Hz.

- interrupts
interrupts used by the device.

- interrupt-names
"irq", "wakeup" and "smbus_alert" names are recognized by I2C core,
other names are left to individual drivers.

- host-notify
device uses SMBus host notify protocol instead of interrupt line.

- multi-master
states that there is another master active on this bus. The OS can use
this information to adapt power management to keep the arbitration awake
all the time, for example.
all the time, for example. Can not be combined with 'single-master'.

- wakeup-source
device can be used as a wakeup source.
- single-master
states that there is no other master active on this bus. The OS can use
this information to detect a stalled bus more reliably, for example.
Can not be combined with 'multi-master'.

Required properties (per child device)
--------------------------------------

- compatible
name of I2C slave device

- reg
I2C slave addresses
One or many I2C slave addresses. These are usually a 7 bit addresses.
However, flags can be attached to an 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 (per child device)
--------------------------------------

These properties may not be supported by all drivers. However, if a driver
wants to support one of the below features, it should adapt these bindings.

- host-notify
device uses SMBus host notify protocol instead of interrupt line.

- interrupts
interrupts used by the device.

- interrupt-names
"irq", "wakeup" and "smbus_alert" names are recognized by I2C core,
other names are left to individual drivers.

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

- wakeup-source
device can be used as a wakeup source.

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.
Expand Down
62 changes: 62 additions & 0 deletions Documentation/devicetree/bindings/i2c/nuvoton,npcm7xx-i2c.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/i2c/nuvoton,npcm7xx-i2c.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: nuvoton NPCM7XX I2C Controller Device Tree Bindings

description: |
The NPCM750x includes sixteen I2C bus controllers. All Controllers support
both master and slave mode. Each controller can switch between master and slave
at run time (i.e. IPMB mode). Each controller has two 16 byte HW FIFO for TX and
RX.
maintainers:
- Tali Perry <[email protected]>

properties:
compatible:
const: nuvoton,npcm7xx-i2c

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
maxItems: 1
description: Reference clock for the I2C bus

clock-frequency:
description: Desired I2C bus clock frequency in Hz. If not specified,
the default 100 kHz frequency will be used.
possible values are 100000, 400000 and 1000000.
default: 100000
enum: [100000, 400000, 1000000]

required:
- compatible
- reg
- interrupts
- clocks

allOf:
- $ref: /schemas/i2c/i2c-controller.yaml#

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/clock/nuvoton,npcm7xx-clock.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
i2c0: i2c@80000 {
reg = <0x80000 0x1000>;
clocks = <&clk NPCM7XX_CLK_APB2>;
clock-frequency = <100000>;
interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
compatible = "nuvoton,npcm750-i2c";
};
...
Loading

0 comments on commit 91fa588

Please sign in to comment.