diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-12 11:58:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-12 11:58:43 -0500 |
commit | cdd305454ebd181fa35b648c0921fe7df27d6f3b (patch) | |
tree | 93f2350402601465888e9f3c3e3e47d9fe598e22 | |
parent | 42cf0f203e877cc7e502883d43b3f72149033d86 (diff) | |
parent | 3c3c8e3618b018aee1dfd42343a74f3ab5ddf23c (diff) |
Merge tag 'devicetree-for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree changes from Rob Herring:
- DT unittests for I2C probing and overlays from Pantelis Antoniou
- Remove DT unittest dependency on OF_DYNAMIC from Gaurav Minocha
- Add Tegra compatible strings missing for newer parts from Paul
Walmsley
- Various vendor prefix additions
* tag 'devicetree-for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
of: Add vendor prefix for OmniVision Technologies
of: Use ovti for Omnivision
of: Add vendor prefix for Truly Semiconductors Limited
of: Add vendor prefix for Himax Technologies Inc.
of/fdt: fix sparse warning
of: unitest: Add I2C overlay unit tests.
Documentation: DT: document compatible string existence requirement
Documentation: DT bindings: add nvidia, tegra132-denver compatible string
Documentation: DT bindings: add more Tegra chip compatible strings
of: EXPORT_SYMBOL_GPL of_property_read_u64_array
of: Fix brace position for struct of_device_id definition
of/unittest: Remove obsolete code
dt-bindings: use isil prefix for Intersil in vendor-prefixes.txt
Add AD Holdings Plc. to vendor-prefixes.
dt-bindings: Add Silicon Mitus vendor prefix
Removes OF_UNITTEST dependency on OF_DYNAMIC config symbol
pinctrl: fix up device tree bindings
DT: Vendors: Add Everspin
doc: add bindings document for altera fpga manager
drivers: of: Export of_reserved_mem_device_{init,release}
36 files changed, 766 insertions, 172 deletions
diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt index b2aacbe16ed9..8b9e0a95de31 100644 --- a/Documentation/devicetree/bindings/arm/cpus.txt +++ b/Documentation/devicetree/bindings/arm/cpus.txt | |||
@@ -175,6 +175,7 @@ nodes to be present and contain the properties described below. | |||
175 | "marvell,pj4a" | 175 | "marvell,pj4a" |
176 | "marvell,pj4b" | 176 | "marvell,pj4b" |
177 | "marvell,sheeva-v5" | 177 | "marvell,sheeva-v5" |
178 | "nvidia,tegra132-denver" | ||
178 | "qcom,krait" | 179 | "qcom,krait" |
179 | "qcom,scorpion" | 180 | "qcom,scorpion" |
180 | - enable-method | 181 | - enable-method |
diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt index 234406d41c12..067c9790062f 100644 --- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt +++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt | |||
@@ -1,7 +1,10 @@ | |||
1 | NVIDIA Tegra AHB | 1 | NVIDIA Tegra AHB |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : "nvidia,tegra20-ahb" or "nvidia,tegra30-ahb" | 4 | - compatible : For Tegra20, must contain "nvidia,tegra20-ahb". For |
5 | Tegra30, must contain "nvidia,tegra30-ahb". Otherwise, must contain | ||
6 | '"nvidia,<chip>-ahb", "nvidia,tegra30-ahb"' where <chip> is tegra124, | ||
7 | tegra132, or tegra210. | ||
5 | - reg : Should contain 1 register ranges(address and length) | 8 | - reg : Should contain 1 register ranges(address and length) |
6 | 9 | ||
7 | Example: | 10 | Example: |
diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt index 68ac65f82a1c..dd75b972ee37 100644 --- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt +++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt | |||
@@ -6,7 +6,11 @@ modes. It provides power-gating controllers for SoC and CPU power-islands. | |||
6 | 6 | ||
7 | Required properties: | 7 | Required properties: |
8 | - name : Should be pmc | 8 | - name : Should be pmc |
9 | - compatible : Should contain "nvidia,tegra<chip>-pmc". | 9 | - compatible : For Tegra20, must contain "nvidia,tegra20-pmc". For Tegra30, |
10 | must contain "nvidia,tegra30-pmc". For Tegra114, must contain | ||
11 | "nvidia,tegra114-pmc". For Tegra124, must contain "nvidia,tegra124-pmc". | ||
12 | Otherwise, must contain "nvidia,<chip>-pmc", plus at least one of the | ||
13 | above, where <chip> is tegra132. | ||
10 | - reg : Offset and length of the register set for the device | 14 | - reg : Offset and length of the register set for the device |
11 | - clocks : Must contain an entry for each entry in clock-names. | 15 | - clocks : Must contain an entry for each entry in clock-names. |
12 | See ../clocks/clock-bindings.txt for details. | 16 | See ../clocks/clock-bindings.txt for details. |
diff --git a/Documentation/devicetree/bindings/ata/tegra-sata.txt b/Documentation/devicetree/bindings/ata/tegra-sata.txt index 946f2072570b..66c83c3e8915 100644 --- a/Documentation/devicetree/bindings/ata/tegra-sata.txt +++ b/Documentation/devicetree/bindings/ata/tegra-sata.txt | |||
@@ -1,7 +1,9 @@ | |||
1 | Tegra124 SoC SATA AHCI controller | 1 | Tegra124 SoC SATA AHCI controller |
2 | 2 | ||
3 | Required properties : | 3 | Required properties : |
4 | - compatible : "nvidia,tegra124-ahci". | 4 | - compatible : For Tegra124, must contain "nvidia,tegra124-ahci". Otherwise, |
5 | must contain '"nvidia,<chip>-ahci", "nvidia,tegra124-ahci"', where <chip> | ||
6 | is tegra132. | ||
5 | - reg : Should contain 2 entries: | 7 | - reg : Should contain 2 entries: |
6 | - AHCI register set (SATA BAR5) | 8 | - AHCI register set (SATA BAR5) |
7 | - SATA register set | 9 | - SATA register set |
diff --git a/Documentation/devicetree/bindings/fpga/altera-socfpga-fpga-mgr.txt b/Documentation/devicetree/bindings/fpga/altera-socfpga-fpga-mgr.txt new file mode 100644 index 000000000000..9b027a615486 --- /dev/null +++ b/Documentation/devicetree/bindings/fpga/altera-socfpga-fpga-mgr.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | Altera SOCFPGA FPGA Manager | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : should contain "altr,socfpga-fpga-mgr" | ||
5 | - reg : base address and size for memory mapped io. | ||
6 | - The first index is for FPGA manager register access. | ||
7 | - The second index is for writing FPGA configuration data. | ||
8 | - interrupts : interrupt for the FPGA Manager device. | ||
9 | |||
10 | Example: | ||
11 | |||
12 | hps_0_fpgamgr: fpgamgr@0xff706000 { | ||
13 | compatible = "altr,socfpga-fpga-mgr"; | ||
14 | reg = <0xFF706000 0x1000 | ||
15 | 0xFFB90000 0x1000>; | ||
16 | interrupts = <0 175 4>; | ||
17 | }; | ||
diff --git a/Documentation/devicetree/bindings/fuse/nvidia,tegra20-fuse.txt b/Documentation/devicetree/bindings/fuse/nvidia,tegra20-fuse.txt index d8c98c7614d0..23e1d3194174 100644 --- a/Documentation/devicetree/bindings/fuse/nvidia,tegra20-fuse.txt +++ b/Documentation/devicetree/bindings/fuse/nvidia,tegra20-fuse.txt | |||
@@ -1,11 +1,11 @@ | |||
1 | NVIDIA Tegra20/Tegra30/Tegr114/Tegra124 fuse block. | 1 | NVIDIA Tegra20/Tegra30/Tegr114/Tegra124 fuse block. |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : should be: | 4 | - compatible : For Tegra20, must contain "nvidia,tegra20-efuse". For Tegra30, |
5 | "nvidia,tegra20-efuse" | 5 | must contain "nvidia,tegra30-efuse". For Tegra114, must contain |
6 | "nvidia,tegra30-efuse" | 6 | "nvidia,tegra114-efuse". For Tegra124, must contain "nvidia,tegra124-efuse". |
7 | "nvidia,tegra114-efuse" | 7 | Otherwise, must contain "nvidia,<chip>-efuse", plus one of the above, where |
8 | "nvidia,tegra124-efuse" | 8 | <chip> is tegra132. |
9 | Details: | 9 | Details: |
10 | nvidia,tegra20-efuse: Tegra20 requires using APB DMA to read the fuse data | 10 | nvidia,tegra20-efuse: Tegra20 requires using APB DMA to read the fuse data |
11 | due to a hardware bug. Tegra20 also lacks certain information which is | 11 | due to a hardware bug. Tegra20 also lacks certain information which is |
diff --git a/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt b/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt index 4c32ef0b7db8..009f4bfa1590 100644 --- a/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt +++ b/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt | |||
@@ -197,7 +197,9 @@ of the following host1x client modules: | |||
197 | - sor: serial output resource | 197 | - sor: serial output resource |
198 | 198 | ||
199 | Required properties: | 199 | Required properties: |
200 | - compatible: "nvidia,tegra124-sor" | 200 | - compatible: For Tegra124, must contain "nvidia,tegra124-sor". Otherwise, |
201 | must contain '"nvidia,<chip>-sor", "nvidia,tegra124-sor"', where <chip> | ||
202 | is tegra132. | ||
201 | - reg: Physical base address and length of the controller's registers. | 203 | - reg: Physical base address and length of the controller's registers. |
202 | - interrupts: The interrupt outputs from the controller. | 204 | - interrupts: The interrupt outputs from the controller. |
203 | - clocks: Must contain an entry for each entry in clock-names. | 205 | - clocks: Must contain an entry for each entry in clock-names. |
@@ -222,7 +224,9 @@ of the following host1x client modules: | |||
222 | - nvidia,dpaux: phandle to a DispayPort AUX interface | 224 | - nvidia,dpaux: phandle to a DispayPort AUX interface |
223 | 225 | ||
224 | - dpaux: DisplayPort AUX interface | 226 | - dpaux: DisplayPort AUX interface |
225 | - compatible: "nvidia,tegra124-dpaux" | 227 | - compatible: For Tegra124, must contain "nvidia,tegra124-dpaux". Otherwise, |
228 | must contain '"nvidia,<chip>-dpaux", "nvidia,tegra124-dpaux"', where | ||
229 | <chip> is tegra132. | ||
226 | - reg: Physical base address and length of the controller's registers. | 230 | - reg: Physical base address and length of the controller's registers. |
227 | - interrupts: The interrupt outputs from the controller. | 231 | - interrupts: The interrupt outputs from the controller. |
228 | - clocks: Must contain an entry for each entry in clock-names. | 232 | - clocks: Must contain an entry for each entry in clock-names. |
diff --git a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt index 87507e9ce6db..656716b72cc4 100644 --- a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt | |||
@@ -1,11 +1,11 @@ | |||
1 | NVIDIA Tegra20/Tegra30/Tegra114 I2C controller driver. | 1 | NVIDIA Tegra20/Tegra30/Tegra114 I2C controller driver. |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : should be: | 4 | - compatible : For Tegra20, must be one of "nvidia,tegra20-i2c-dvc" or |
5 | "nvidia,tegra114-i2c" | 5 | "nvidia,tegra20-i2c". For Tegra30, must be "nvidia,tegra30-i2c". |
6 | "nvidia,tegra30-i2c" | 6 | For Tegra114, must be "nvidia,tegra114-i2c". Otherwise, must be |
7 | "nvidia,tegra20-i2c" | 7 | "nvidia,<chip>-i2c", plus at least one of the above, where <chip> is |
8 | "nvidia,tegra20-i2c-dvc" | 8 | tegra124, tegra132, or tegra210. |
9 | Details of compatible are as follows: | 9 | Details of compatible are as follows: |
10 | nvidia,tegra20-i2c-dvc: Tegra20 has specific I2C controller called as DVC I2C | 10 | nvidia,tegra20-i2c-dvc: Tegra20 has specific I2C controller called as DVC I2C |
11 | controller. This only support master mode of I2C communication. Register | 11 | controller. This only support master mode of I2C communication. Register |
diff --git a/Documentation/devicetree/bindings/media/atmel-isi.txt b/Documentation/devicetree/bindings/media/atmel-isi.txt index 17e71b7b44c6..251f008f220c 100644 --- a/Documentation/devicetree/bindings/media/atmel-isi.txt +++ b/Documentation/devicetree/bindings/media/atmel-isi.txt | |||
@@ -38,7 +38,7 @@ Example: | |||
38 | 38 | ||
39 | i2c1: i2c@f0018000 { | 39 | i2c1: i2c@f0018000 { |
40 | ov2640: camera@0x30 { | 40 | ov2640: camera@0x30 { |
41 | compatible = "omnivision,ov2640"; | 41 | compatible = "ovti,ov2640"; |
42 | reg = <0x30>; | 42 | reg = <0x30>; |
43 | 43 | ||
44 | port { | 44 | port { |
diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt index 52a14cf099ac..571b4c60665f 100644 --- a/Documentation/devicetree/bindings/media/video-interfaces.txt +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt | |||
@@ -162,7 +162,7 @@ pipelines can be active: ov772x -> ceu0 or imx074 -> csi2 -> ceu0. | |||
162 | i2c0: i2c@0xfff20000 { | 162 | i2c0: i2c@0xfff20000 { |
163 | ... | 163 | ... |
164 | ov772x_1: camera@0x21 { | 164 | ov772x_1: camera@0x21 { |
165 | compatible = "omnivision,ov772x"; | 165 | compatible = "ovti,ov772x"; |
166 | reg = <0x21>; | 166 | reg = <0x21>; |
167 | vddio-supply = <®ulator1>; | 167 | vddio-supply = <®ulator1>; |
168 | vddcore-supply = <®ulator2>; | 168 | vddcore-supply = <®ulator2>; |
diff --git a/Documentation/devicetree/bindings/misc/nvidia,tegra20-apbmisc.txt b/Documentation/devicetree/bindings/misc/nvidia,tegra20-apbmisc.txt index b97b8bef1fe5..47b205cc9cc7 100644 --- a/Documentation/devicetree/bindings/misc/nvidia,tegra20-apbmisc.txt +++ b/Documentation/devicetree/bindings/misc/nvidia,tegra20-apbmisc.txt | |||
@@ -1,11 +1,10 @@ | |||
1 | NVIDIA Tegra20/Tegra30/Tegr114/Tegra124 apbmisc block | 1 | NVIDIA Tegra20/Tegra30/Tegr114/Tegra124 apbmisc block |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : should be: | 4 | - compatible : For Tegra20, must be "nvidia,tegra20-apbmisc". For Tegra30, |
5 | "nvidia,tegra20-apbmisc" | 5 | must be "nvidia,tegra30-apbmisc". Otherwise, must contain |
6 | "nvidia,tegra30-apbmisc" | 6 | "nvidia,<chip>-apbmisc", plus one of the above, where <chip> is tegra114, |
7 | "nvidia,tegra114-apbmisc" | 7 | tegra124, tegra132. |
8 | "nvidia,tegra124-apbmisc" | ||
9 | - reg: Should contain 2 entries: the first entry gives the physical address | 8 | - reg: Should contain 2 entries: the first entry gives the physical address |
10 | and length of the registers which contain revision and debug features. | 9 | and length of the registers which contain revision and debug features. |
11 | The second entry gives the physical address and length of the | 10 | The second entry gives the physical address and length of the |
diff --git a/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt b/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt index f357c16ea815..15b8368ee1f2 100644 --- a/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt +++ b/Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt | |||
@@ -7,7 +7,11 @@ This file documents differences between the core properties described | |||
7 | by mmc.txt and the properties used by the sdhci-tegra driver. | 7 | by mmc.txt and the properties used by the sdhci-tegra driver. |
8 | 8 | ||
9 | Required properties: | 9 | Required properties: |
10 | - compatible : Should be "nvidia,<chip>-sdhci" | 10 | - compatible : For Tegra20, must contain "nvidia,tegra20-sdhci". |
11 | For Tegra30, must contain "nvidia,tegra30-sdhci". For Tegra114, | ||
12 | must contain "nvidia,tegra114-sdhci". For Tegra124, must contain | ||
13 | "nvidia,tegra124-sdhci". Otherwise, must contain "nvidia,<chip>-sdhci", | ||
14 | plus one of the above, where <chip> is tegra132 or tegra210. | ||
11 | - clocks : Must contain one entry, for the module clock. | 15 | - clocks : Must contain one entry, for the module clock. |
12 | See ../clocks/clock-bindings.txt for details. | 16 | See ../clocks/clock-bindings.txt for details. |
13 | - resets : Must contain an entry for each entry in reset-names. | 17 | - resets : Must contain an entry for each entry in reset-names. |
diff --git a/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt b/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt index d763e047c6ae..75321ae23c08 100644 --- a/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt +++ b/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt | |||
@@ -1,10 +1,10 @@ | |||
1 | NVIDIA Tegra PCIe controller | 1 | NVIDIA Tegra PCIe controller |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible: Must be one of: | 4 | - compatible: For Tegra20, must contain "nvidia,tegra20-pcie". For Tegra30, |
5 | - "nvidia,tegra20-pcie" | 5 | "nvidia,tegra30-pcie". For Tegra124, must contain "nvidia,tegra124-pcie". |
6 | - "nvidia,tegra30-pcie" | 6 | Otherwise, must contain "nvidia,<chip>-pcie", plus one of the above, where |
7 | - "nvidia,tegra124-pcie" | 7 | <chip> is tegra132 or tegra210. |
8 | - device_type: Must be "pci" | 8 | - device_type: Must be "pci" |
9 | - reg: A list of physical base address and length for each set of controller | 9 | - reg: A list of physical base address and length for each set of controller |
10 | registers. Must contain an entry for each entry in the reg-names property. | 10 | registers. Must contain an entry for each entry in the reg-names property. |
diff --git a/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt index 189814e7cdc7..ecb5c0d25218 100644 --- a/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt +++ b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt | |||
@@ -6,7 +6,8 @@ nvidia,tegra30-pinmux.txt. In fact, this document assumes that binding as | |||
6 | a baseline, and only documents the differences between the two bindings. | 6 | a baseline, and only documents the differences between the two bindings. |
7 | 7 | ||
8 | Required properties: | 8 | Required properties: |
9 | - compatible: "nvidia,tegra124-pinmux" | 9 | - compatible: For Tegra124, must contain "nvidia,tegra124-pinmux". For |
10 | Tegra132, must contain '"nvidia,tegra132-pinmux", "nvidia-tegra124-pinmux"'. | ||
10 | - reg: Should contain a list of base address and size pairs for: | 11 | - reg: Should contain a list of base address and size pairs for: |
11 | -- first entry - the drive strength and pad control registers. | 12 | -- first entry - the drive strength and pad control registers. |
12 | -- second entry - the pinmux registers | 13 | -- second entry - the pinmux registers |
diff --git a/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-xusb-padctl.txt b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-xusb-padctl.txt index 2f9c0bd66457..30676ded85bb 100644 --- a/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-xusb-padctl.txt +++ b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-xusb-padctl.txt | |||
@@ -13,7 +13,9 @@ how to describe and reference PHYs in device trees. | |||
13 | 13 | ||
14 | Required properties: | 14 | Required properties: |
15 | -------------------- | 15 | -------------------- |
16 | - compatible: should be "nvidia,tegra124-xusb-padctl" | 16 | - compatible: For Tegra124, must contain "nvidia,tegra124-xusb-padctl". |
17 | Otherwise, must contain '"nvidia,<chip>-xusb-padctl", | ||
18 | "nvidia-tegra124-xusb-padctl"', where <chip> is tegra132 or tegra210. | ||
17 | - reg: Physical base address and length of the controller's registers. | 19 | - reg: Physical base address and length of the controller's registers. |
18 | - resets: Must contain an entry for each entry in reset-names. | 20 | - resets: Must contain an entry for each entry in reset-names. |
19 | See ../reset/reset.txt for details. | 21 | See ../reset/reset.txt for details. |
diff --git a/Documentation/devicetree/bindings/pwm/nvidia,tegra20-pwm.txt b/Documentation/devicetree/bindings/pwm/nvidia,tegra20-pwm.txt index c7ea9d4a988b..c52f03b5032f 100644 --- a/Documentation/devicetree/bindings/pwm/nvidia,tegra20-pwm.txt +++ b/Documentation/devicetree/bindings/pwm/nvidia,tegra20-pwm.txt | |||
@@ -1,9 +1,10 @@ | |||
1 | Tegra SoC PWFM controller | 1 | Tegra SoC PWFM controller |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible: should be one of: | 4 | - compatible: For Tegra20, must contain "nvidia,tegra20-pwm". For Tegra30, |
5 | - "nvidia,tegra20-pwm" | 5 | must contain "nvidia,tegra30-pwm". Otherwise, must contain |
6 | - "nvidia,tegra30-pwm" | 6 | "nvidia,<chip>-pwm", plus one of the above, where <chip> is tegra114, |
7 | tegra124, tegra132, or tegra210. | ||
7 | - reg: physical base address and length of the controller's registers | 8 | - reg: physical base address and length of the controller's registers |
8 | - #pwm-cells: should be 2. See pwm.txt in this directory for a description of | 9 | - #pwm-cells: should be 2. See pwm.txt in this directory for a description of |
9 | the cells format. | 10 | the cells format. |
diff --git a/Documentation/devicetree/bindings/rtc/nvidia,tegra20-rtc.txt b/Documentation/devicetree/bindings/rtc/nvidia,tegra20-rtc.txt index 652d1ff2e8be..b7d98ed3e098 100644 --- a/Documentation/devicetree/bindings/rtc/nvidia,tegra20-rtc.txt +++ b/Documentation/devicetree/bindings/rtc/nvidia,tegra20-rtc.txt | |||
@@ -6,7 +6,9 @@ state. | |||
6 | 6 | ||
7 | Required properties: | 7 | Required properties: |
8 | 8 | ||
9 | - compatible : should be "nvidia,tegra20-rtc". | 9 | - compatible : For Tegra20, must contain "nvidia,tegra20-rtc". Otherwise, |
10 | must contain '"nvidia,<chip>-rtc", "nvidia,tegra20-rtc"', where <chip> | ||
11 | can be tegra30, tegra114, tegra124, or tegra132. | ||
10 | - reg : Specifies base physical address and size of the registers. | 12 | - reg : Specifies base physical address and size of the registers. |
11 | - interrupts : A single interrupt specifier. | 13 | - interrupts : A single interrupt specifier. |
12 | - clocks : Must contain one entry, for the module clock. | 14 | - clocks : Must contain one entry, for the module clock. |
diff --git a/Documentation/devicetree/bindings/serial/of-serial.txt b/Documentation/devicetree/bindings/serial/of-serial.txt index b52b98234b9b..bea60ef6cdc5 100644 --- a/Documentation/devicetree/bindings/serial/of-serial.txt +++ b/Documentation/devicetree/bindings/serial/of-serial.txt | |||
@@ -8,7 +8,10 @@ Required properties: | |||
8 | - "ns16550" | 8 | - "ns16550" |
9 | - "ns16750" | 9 | - "ns16750" |
10 | - "ns16850" | 10 | - "ns16850" |
11 | - "nvidia,tegra20-uart" | 11 | - For Tegra20, must contain "nvidia,tegra20-uart" |
12 | - For other Tegra, must contain '"nvidia,<chip>-uart", | ||
13 | "nvidia,tegra20-uart"' where <chip> is tegra30, tegra114, tegra124, | ||
14 | tegra132, or tegra210. | ||
12 | - "nxp,lpc3220-uart" | 15 | - "nxp,lpc3220-uart" |
13 | - "ralink,rt2880-uart" | 16 | - "ralink,rt2880-uart" |
14 | - "ibm,qpace-nwp-serial" | 17 | - "ibm,qpace-nwp-serial" |
diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.txt index 946e2ac46091..0e9a1895d7fb 100644 --- a/Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.txt +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.txt | |||
@@ -1,7 +1,10 @@ | |||
1 | NVIDIA Tegra30 AHUB (Audio Hub) | 1 | NVIDIA Tegra30 AHUB (Audio Hub) |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : "nvidia,tegra30-ahub", "nvidia,tegra114-ahub", etc. | 4 | - compatible : For Tegra30, must contain "nvidia,tegra30-ahub". For Tegra114, |
5 | must contain "nvidia,tegra114-ahub". For Tegra124, must contain | ||
6 | "nvidia,tegra124-ahub". Otherwise, must contain "nvidia,<chip>-ahub", | ||
7 | plus at least one of the above, where <chip> is tegra132. | ||
5 | - reg : Should contain the register physical address and length for each of | 8 | - reg : Should contain the register physical address and length for each of |
6 | the AHUB's register blocks. | 9 | the AHUB's register blocks. |
7 | - Tegra30 requires 2 entries, for the APBIF and AHUB/AUDIO register blocks. | 10 | - Tegra30 requires 2 entries, for the APBIF and AHUB/AUDIO register blocks. |
diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt index b4730c2822bc..13e2ef496724 100644 --- a/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt | |||
@@ -1,7 +1,9 @@ | |||
1 | NVIDIA Tegra30 HDA controller | 1 | NVIDIA Tegra30 HDA controller |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : "nvidia,tegra30-hda" | 4 | - compatible : For Tegra30, must contain "nvidia,tegra30-hda". Otherwise, |
5 | must contain '"nvidia,<chip>-hda", "nvidia,tegra30-hda"', where <chip> is | ||
6 | tegra114, tegra124, or tegra132. | ||
5 | - reg : Should contain the HDA registers location and length. | 7 | - reg : Should contain the HDA registers location and length. |
6 | - interrupts : The interrupt from the HDA controller. | 8 | - interrupts : The interrupt from the HDA controller. |
7 | - clocks : Must contain an entry for each required entry in clock-names. | 9 | - clocks : Must contain an entry for each required entry in clock-names. |
diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra30-i2s.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra30-i2s.txt index 0c113ffe3814..38caa936f6f8 100644 --- a/Documentation/devicetree/bindings/sound/nvidia,tegra30-i2s.txt +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra30-i2s.txt | |||
@@ -1,7 +1,10 @@ | |||
1 | NVIDIA Tegra30 I2S controller | 1 | NVIDIA Tegra30 I2S controller |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : "nvidia,tegra30-i2s" | 4 | - compatible : For Tegra30, must contain "nvidia,tegra30-i2s". For Tegra124, |
5 | must contain "nvidia,tegra124-i2s". Otherwise, must contain | ||
6 | "nvidia,<chip>-i2s" plus at least one of the above, where <chip> is | ||
7 | tegra114 or tegra132. | ||
5 | - reg : Should contain I2S registers location and length | 8 | - reg : Should contain I2S registers location and length |
6 | - clocks : Must contain one entry, for the module clock. | 9 | - clocks : Must contain one entry, for the module clock. |
7 | See ../clocks/clock-bindings.txt for details. | 10 | See ../clocks/clock-bindings.txt for details. |
diff --git a/Documentation/devicetree/bindings/spi/nvidia,tegra114-spi.txt b/Documentation/devicetree/bindings/spi/nvidia,tegra114-spi.txt index 7ea701e07dc2..b785976fe98a 100644 --- a/Documentation/devicetree/bindings/spi/nvidia,tegra114-spi.txt +++ b/Documentation/devicetree/bindings/spi/nvidia,tegra114-spi.txt | |||
@@ -1,7 +1,9 @@ | |||
1 | NVIDIA Tegra114 SPI controller. | 1 | NVIDIA Tegra114 SPI controller. |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : should be "nvidia,tegra114-spi". | 4 | - compatible : For Tegra114, must contain "nvidia,tegra114-spi". |
5 | Otherwise, must contain '"nvidia,<chip>-spi", "nvidia,tegra114-spi"' where | ||
6 | <chip> is tegra124, tegra132, or tegra210. | ||
5 | - reg: Should contain SPI registers location and length. | 7 | - reg: Should contain SPI registers location and length. |
6 | - interrupts: Should contain SPI interrupts. | 8 | - interrupts: Should contain SPI interrupts. |
7 | - clock-names : Must include the following entries: | 9 | - clock-names : Must include the following entries: |
diff --git a/Documentation/devicetree/bindings/submitting-patches.txt b/Documentation/devicetree/bindings/submitting-patches.txt index b7ba01ad1426..56742bc70218 100644 --- a/Documentation/devicetree/bindings/submitting-patches.txt +++ b/Documentation/devicetree/bindings/submitting-patches.txt | |||
@@ -15,6 +15,29 @@ I. For patch submitters | |||
15 | 3) The Documentation/ portion of the patch should come in the series before | 15 | 3) The Documentation/ portion of the patch should come in the series before |
16 | the code implementing the binding. | 16 | the code implementing the binding. |
17 | 17 | ||
18 | 4) Any compatible strings used in a chip or board DTS file must be | ||
19 | previously documented in the corresponding DT binding text file | ||
20 | in Documentation/devicetree/bindings. This rule applies even if | ||
21 | the Linux device driver does not yet match on the compatible | ||
22 | string. [ checkpatch will emit warnings if this step is not | ||
23 | followed as of commit bff5da4335256513497cc8c79f9a9d1665e09864 | ||
24 | ("checkpatch: add DT compatible string documentation checks"). ] | ||
25 | |||
26 | 5) The wildcard "<chip>" may be used in compatible strings, as in | ||
27 | the following example: | ||
28 | |||
29 | - compatible: Must contain '"nvidia,<chip>-pcie", | ||
30 | "nvidia,tegra20-pcie"' where <chip> is tegra30, tegra132, ... | ||
31 | |||
32 | As in the above example, the known values of "<chip>" should be | ||
33 | documented if it is used. | ||
34 | |||
35 | 6) If a documented compatible string is not yet matched by the | ||
36 | driver, the documentation should also include a compatible | ||
37 | string that is matched by the driver (as in the "nvidia,tegra20-pcie" | ||
38 | example above). | ||
39 | |||
40 | |||
18 | II. For kernel maintainers | 41 | II. For kernel maintainers |
19 | 42 | ||
20 | 1) If you aren't comfortable reviewing a given binding, reply to it and ask | 43 | 1) If you aren't comfortable reviewing a given binding, reply to it and ask |
diff --git a/Documentation/devicetree/bindings/thermal/tegra-soctherm.txt b/Documentation/devicetree/bindings/thermal/tegra-soctherm.txt index ecf3ed76cd46..6b68cd150405 100644 --- a/Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +++ b/Documentation/devicetree/bindings/thermal/tegra-soctherm.txt | |||
@@ -7,7 +7,9 @@ notifications. It is also used to manage emergency shutdown in an | |||
7 | overheating situation. | 7 | overheating situation. |
8 | 8 | ||
9 | Required properties : | 9 | Required properties : |
10 | - compatible : "nvidia,tegra124-soctherm". | 10 | - compatible : For Tegra124, must contain "nvidia,tegra124-soctherm". |
11 | For Tegra132, must contain "nvidia,tegra132-soctherm". | ||
12 | For Tegra210, must contain "nvidia,tegra210-soctherm". | ||
11 | - reg : Should contain 1 entry: | 13 | - reg : Should contain 1 entry: |
12 | - SOCTHERM register set | 14 | - SOCTHERM register set |
13 | - interrupts : Defines the interrupt used by SOCTHERM | 15 | - interrupts : Defines the interrupt used by SOCTHERM |
diff --git a/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt b/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt index b5082a1cf461..1761f53ee36f 100644 --- a/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt +++ b/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt | |||
@@ -6,7 +6,9 @@ trigger a legacy watchdog reset. | |||
6 | 6 | ||
7 | Required properties: | 7 | Required properties: |
8 | 8 | ||
9 | - compatible : should be "nvidia,tegra30-timer", "nvidia,tegra20-timer". | 9 | - compatible : For Tegra30, must contain "nvidia,tegra30-timer". Otherwise, |
10 | must contain '"nvidia,<chip>-timer", "nvidia,tegra30-timer"' where | ||
11 | <chip> is tegra124 or tegra132. | ||
10 | - reg : Specifies base physical address and size of the registers. | 12 | - reg : Specifies base physical address and size of the registers. |
11 | - interrupts : A list of 6 interrupts; one per each of timer channels 1 | 13 | - interrupts : A list of 6 interrupts; one per each of timer channels 1 |
12 | through 5, and one for the shared interrupt for the remaining channels. | 14 | through 5, and one for the shared interrupt for the remaining channels. |
diff --git a/Documentation/devicetree/bindings/unittest.txt b/Documentation/devicetree/bindings/unittest.txt index 0f92a22fddfa..8933211f32f9 100644 --- a/Documentation/devicetree/bindings/unittest.txt +++ b/Documentation/devicetree/bindings/unittest.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | * OF selftest platform device | 1 | 1) OF selftest platform device |
2 | 2 | ||
3 | ** selftest | 3 | ** selftest |
4 | 4 | ||
@@ -12,3 +12,60 @@ Example: | |||
12 | compatible = "selftest"; | 12 | compatible = "selftest"; |
13 | status = "okay"; | 13 | status = "okay"; |
14 | }; | 14 | }; |
15 | |||
16 | 2) OF selftest i2c adapter platform device | ||
17 | |||
18 | ** platform device unittest adapter | ||
19 | |||
20 | Required properties: | ||
21 | - compatible: must be selftest-i2c-bus | ||
22 | |||
23 | Children nodes contain selftest i2c devices. | ||
24 | |||
25 | Example: | ||
26 | selftest-i2c-bus { | ||
27 | compatible = "selftest-i2c-bus"; | ||
28 | status = "okay"; | ||
29 | }; | ||
30 | |||
31 | 3) OF selftest i2c device | ||
32 | |||
33 | ** I2C selftest device | ||
34 | |||
35 | Required properties: | ||
36 | - compatible: must be selftest-i2c-dev | ||
37 | |||
38 | All other properties are optional | ||
39 | |||
40 | Example: | ||
41 | selftest-i2c-dev { | ||
42 | compatible = "selftest-i2c-dev"; | ||
43 | status = "okay"; | ||
44 | }; | ||
45 | |||
46 | 4) OF selftest i2c mux device | ||
47 | |||
48 | ** I2C selftest mux | ||
49 | |||
50 | Required properties: | ||
51 | - compatible: must be selftest-i2c-mux | ||
52 | |||
53 | Children nodes contain selftest i2c bus nodes per channel. | ||
54 | |||
55 | Example: | ||
56 | selftest-i2c-mux { | ||
57 | compatible = "selftest-i2c-mux"; | ||
58 | status = "okay"; | ||
59 | #address-cells = <1>; | ||
60 | #size-cells = <0>; | ||
61 | channel-0 { | ||
62 | reg = <0>; | ||
63 | #address-cells = <1>; | ||
64 | #size-cells = <0>; | ||
65 | i2c-dev { | ||
66 | reg = <8>; | ||
67 | compatible = "selftest-i2c-dev"; | ||
68 | status = "okay"; | ||
69 | }; | ||
70 | }; | ||
71 | }; | ||
diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra20-ehci.txt b/Documentation/devicetree/bindings/usb/nvidia,tegra20-ehci.txt index 3dc9140e3dfb..f60785f73d3d 100644 --- a/Documentation/devicetree/bindings/usb/nvidia,tegra20-ehci.txt +++ b/Documentation/devicetree/bindings/usb/nvidia,tegra20-ehci.txt | |||
@@ -6,7 +6,10 @@ Practice : Universal Serial Bus" with the following modifications | |||
6 | and additions : | 6 | and additions : |
7 | 7 | ||
8 | Required properties : | 8 | Required properties : |
9 | - compatible : Should be "nvidia,tegra20-ehci". | 9 | - compatible : For Tegra20, must contain "nvidia,tegra20-ehci". |
10 | For Tegra30, must contain "nvidia,tegra30-ehci". Otherwise, must contain | ||
11 | "nvidia,<chip>-ehci" plus at least one of the above, where <chip> is | ||
12 | tegra114, tegra124, tegra132, or tegra210. | ||
10 | - nvidia,phy : phandle of the PHY that the controller is connected to. | 13 | - nvidia,phy : phandle of the PHY that the controller is connected to. |
11 | - clocks : Must contain one entry, for the module clock. | 14 | - clocks : Must contain one entry, for the module clock. |
12 | See ../clocks/clock-bindings.txt for details. | 15 | See ../clocks/clock-bindings.txt for details. |
diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra20-usb-phy.txt b/Documentation/devicetree/bindings/usb/nvidia,tegra20-usb-phy.txt index c9205fbf26e2..a9aa79fb90ed 100644 --- a/Documentation/devicetree/bindings/usb/nvidia,tegra20-usb-phy.txt +++ b/Documentation/devicetree/bindings/usb/nvidia,tegra20-usb-phy.txt | |||
@@ -3,7 +3,10 @@ Tegra SOC USB PHY | |||
3 | The device node for Tegra SOC USB PHY: | 3 | The device node for Tegra SOC USB PHY: |
4 | 4 | ||
5 | Required properties : | 5 | Required properties : |
6 | - compatible : Should be "nvidia,tegra<chip>-usb-phy". | 6 | - compatible : For Tegra20, must contain "nvidia,tegra20-usb-phy". |
7 | For Tegra30, must contain "nvidia,tegra30-usb-phy". Otherwise, must contain | ||
8 | "nvidia,<chip>-usb-phy" plus at least one of the above, where <chip> is | ||
9 | tegra114, tegra124, tegra132, or tegra210. | ||
7 | - reg : Defines the following set of registers, in the order listed: | 10 | - reg : Defines the following set of registers, in the order listed: |
8 | - The PHY's own register set. | 11 | - The PHY's own register set. |
9 | Always present. | 12 | Always present. |
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index e344fa2f6c4d..7075698abd8c 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt | |||
@@ -7,6 +7,7 @@ abilis Abilis Systems | |||
7 | active-semi Active-Semi International Inc | 7 | active-semi Active-Semi International Inc |
8 | ad Avionic Design GmbH | 8 | ad Avionic Design GmbH |
9 | adapteva Adapteva, Inc. | 9 | adapteva Adapteva, Inc. |
10 | adh AD Holdings Plc. | ||
10 | adi Analog Devices, Inc. | 11 | adi Analog Devices, Inc. |
11 | aeroflexgaisler Aeroflex Gaisler AB | 12 | aeroflexgaisler Aeroflex Gaisler AB |
12 | allwinner Allwinner Technology Co., Ltd. | 13 | allwinner Allwinner Technology Co., Ltd. |
@@ -57,6 +58,7 @@ est ESTeem Wireless Modems | |||
57 | ettus NI Ettus Research | 58 | ettus NI Ettus Research |
58 | eukrea Eukréa Electromatique | 59 | eukrea Eukréa Electromatique |
59 | everest Everest Semiconductor Co. Ltd. | 60 | everest Everest Semiconductor Co. Ltd. |
61 | everspin Everspin Technologies, Inc. | ||
60 | excito Excito | 62 | excito Excito |
61 | fcs Fairchild Semiconductor | 63 | fcs Fairchild Semiconductor |
62 | fsl Freescale Semiconductor | 64 | fsl Freescale Semiconductor |
@@ -70,6 +72,7 @@ gumstix Gumstix, Inc. | |||
70 | gw Gateworks Corporation | 72 | gw Gateworks Corporation |
71 | hannstar HannStar Display Corporation | 73 | hannstar HannStar Display Corporation |
72 | haoyu Haoyu Microelectronic Co. Ltd. | 74 | haoyu Haoyu Microelectronic Co. Ltd. |
75 | himax Himax Technologies, Inc. | ||
73 | hisilicon Hisilicon Limited. | 76 | hisilicon Hisilicon Limited. |
74 | hit Hitachi Ltd. | 77 | hit Hitachi Ltd. |
75 | honeywell Honeywell | 78 | honeywell Honeywell |
@@ -83,8 +86,7 @@ innolux Innolux Corporation | |||
83 | intel Intel Corporation | 86 | intel Intel Corporation |
84 | intercontrol Inter Control Group | 87 | intercontrol Inter Control Group |
85 | isee ISEE 2007 S.L. | 88 | isee ISEE 2007 S.L. |
86 | isil Intersil (deprecated, use isl) | 89 | isil Intersil |
87 | isl Intersil | ||
88 | karo Ka-Ro electronics GmbH | 90 | karo Ka-Ro electronics GmbH |
89 | keymile Keymile GmbH | 91 | keymile Keymile GmbH |
90 | lacie LaCie | 92 | lacie LaCie |
@@ -119,6 +121,7 @@ nvidia NVIDIA | |||
119 | nxp NXP Semiconductors | 121 | nxp NXP Semiconductors |
120 | onnn ON Semiconductor Corp. | 122 | onnn ON Semiconductor Corp. |
121 | opencores OpenCores.org | 123 | opencores OpenCores.org |
124 | ovti OmniVision Technologies | ||
122 | panasonic Panasonic Corporation | 125 | panasonic Panasonic Corporation |
123 | pericom Pericom Technology Inc. | 126 | pericom Pericom Technology Inc. |
124 | phytec PHYTEC Messtechnik GmbH | 127 | phytec PHYTEC Messtechnik GmbH |
@@ -146,6 +149,7 @@ seagate Seagate Technology PLC | |||
146 | semtech Semtech Corporation | 149 | semtech Semtech Corporation |
147 | sil Silicon Image | 150 | sil Silicon Image |
148 | silabs Silicon Laboratories | 151 | silabs Silicon Laboratories |
152 | siliconmitus Silicon Mitus, Inc. | ||
149 | simtek | 153 | simtek |
150 | sii Seiko Instruments, Inc. | 154 | sii Seiko Instruments, Inc. |
151 | silergy Silergy Corp. | 155 | silergy Silergy Corp. |
@@ -167,6 +171,7 @@ tlm Trusted Logic Mobility | |||
167 | toradex Toradex AG | 171 | toradex Toradex AG |
168 | toshiba Toshiba Corporation | 172 | toshiba Toshiba Corporation |
169 | toumaz Toumaz | 173 | toumaz Toumaz |
174 | truly Truly Semiconductors Limited | ||
170 | usi Universal Scientific Industrial Co., Ltd. | 175 | usi Universal Scientific Industrial Co., Ltd. |
171 | v3 V3 Semiconductor | 176 | v3 V3 Semiconductor |
172 | variscite Variscite Ltd. | 177 | variscite Variscite Ltd. |
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index b5e0c873d4e1..38d1c51f58b1 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig | |||
@@ -10,7 +10,6 @@ menu "Device Tree and Open Firmware support" | |||
10 | config OF_UNITTEST | 10 | config OF_UNITTEST |
11 | bool "Device Tree runtime unit tests" | 11 | bool "Device Tree runtime unit tests" |
12 | depends on OF_IRQ && OF_EARLY_FLATTREE | 12 | depends on OF_IRQ && OF_EARLY_FLATTREE |
13 | select OF_DYNAMIC | ||
14 | select OF_RESOLVE | 13 | select OF_RESOLVE |
15 | help | 14 | help |
16 | This option builds in test cases for the device tree infrastructure | 15 | This option builds in test cases for the device tree infrastructure |
diff --git a/drivers/of/base.c b/drivers/of/base.c index 36536b6a8834..0a8aeb8523fe 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -1303,6 +1303,7 @@ int of_property_read_u64_array(const struct device_node *np, | |||
1303 | } | 1303 | } |
1304 | return 0; | 1304 | return 0; |
1305 | } | 1305 | } |
1306 | EXPORT_SYMBOL_GPL(of_property_read_u64_array); | ||
1306 | 1307 | ||
1307 | /** | 1308 | /** |
1308 | * of_property_read_string - Find and read a string from a property | 1309 | * of_property_read_string - Find and read a string from a property |
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 510074226d57..3a896c9aeb74 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -762,7 +762,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node) | |||
762 | #ifdef CONFIG_SERIAL_EARLYCON | 762 | #ifdef CONFIG_SERIAL_EARLYCON |
763 | extern struct of_device_id __earlycon_of_table[]; | 763 | extern struct of_device_id __earlycon_of_table[]; |
764 | 764 | ||
765 | int __init early_init_dt_scan_chosen_serial(void) | 765 | static int __init early_init_dt_scan_chosen_serial(void) |
766 | { | 766 | { |
767 | int offset; | 767 | int offset; |
768 | const char *p; | 768 | const char *p; |
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index dc566b38645f..726ebe792813 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c | |||
@@ -265,6 +265,7 @@ int of_reserved_mem_device_init(struct device *dev) | |||
265 | 265 | ||
266 | return ret; | 266 | return ret; |
267 | } | 267 | } |
268 | EXPORT_SYMBOL_GPL(of_reserved_mem_device_init); | ||
268 | 269 | ||
269 | /** | 270 | /** |
270 | * of_reserved_mem_device_release() - release reserved memory device structures | 271 | * of_reserved_mem_device_release() - release reserved memory device structures |
@@ -289,3 +290,4 @@ void of_reserved_mem_device_release(struct device *dev) | |||
289 | 290 | ||
290 | rmem->ops->device_release(rmem, dev); | 291 | rmem->ops->device_release(rmem, dev); |
291 | } | 292 | } |
293 | EXPORT_SYMBOL_GPL(of_reserved_mem_device_release); | ||
diff --git a/drivers/of/unittest-data/tests-overlay.dtsi b/drivers/of/unittest-data/tests-overlay.dtsi index a2b687d5f324..244226cbb5a3 100644 --- a/drivers/of/unittest-data/tests-overlay.dtsi +++ b/drivers/of/unittest-data/tests-overlay.dtsi | |||
@@ -68,6 +68,48 @@ | |||
68 | status = "disabled"; | 68 | status = "disabled"; |
69 | reg = <8>; | 69 | reg = <8>; |
70 | }; | 70 | }; |
71 | |||
72 | i2c-test-bus { | ||
73 | compatible = "selftest-i2c-bus"; | ||
74 | status = "okay"; | ||
75 | reg = <50>; | ||
76 | |||
77 | #address-cells = <1>; | ||
78 | #size-cells = <0>; | ||
79 | |||
80 | test-selftest12 { | ||
81 | reg = <8>; | ||
82 | compatible = "selftest-i2c-dev"; | ||
83 | status = "disabled"; | ||
84 | }; | ||
85 | |||
86 | test-selftest13 { | ||
87 | reg = <9>; | ||
88 | compatible = "selftest-i2c-dev"; | ||
89 | status = "okay"; | ||
90 | }; | ||
91 | |||
92 | test-selftest14 { | ||
93 | reg = <10>; | ||
94 | compatible = "selftest-i2c-mux"; | ||
95 | status = "okay"; | ||
96 | |||
97 | #address-cells = <1>; | ||
98 | #size-cells = <0>; | ||
99 | |||
100 | i2c@0 { | ||
101 | #address-cells = <1>; | ||
102 | #size-cells = <0>; | ||
103 | reg = <0>; | ||
104 | |||
105 | test-mux-dev { | ||
106 | reg = <32>; | ||
107 | compatible = "selftest-i2c-dev"; | ||
108 | status = "okay"; | ||
109 | }; | ||
110 | }; | ||
111 | }; | ||
112 | }; | ||
71 | }; | 113 | }; |
72 | }; | 114 | }; |
73 | 115 | ||
@@ -231,5 +273,57 @@ | |||
231 | }; | 273 | }; |
232 | }; | 274 | }; |
233 | }; | 275 | }; |
276 | |||
277 | /* test enable using absolute target path (i2c) */ | ||
278 | overlay12 { | ||
279 | fragment@0 { | ||
280 | target-path = "/testcase-data/overlay-node/test-bus/i2c-test-bus/test-selftest12"; | ||
281 | __overlay__ { | ||
282 | status = "okay"; | ||
283 | }; | ||
284 | }; | ||
285 | }; | ||
286 | |||
287 | /* test disable using absolute target path (i2c) */ | ||
288 | overlay13 { | ||
289 | fragment@0 { | ||
290 | target-path = "/testcase-data/overlay-node/test-bus/i2c-test-bus/test-selftest13"; | ||
291 | __overlay__ { | ||
292 | status = "disabled"; | ||
293 | }; | ||
294 | }; | ||
295 | }; | ||
296 | |||
297 | /* test mux overlay */ | ||
298 | overlay15 { | ||
299 | fragment@0 { | ||
300 | target-path = "/testcase-data/overlay-node/test-bus/i2c-test-bus"; | ||
301 | __overlay__ { | ||
302 | #address-cells = <1>; | ||
303 | #size-cells = <0>; | ||
304 | test-selftest15 { | ||
305 | reg = <11>; | ||
306 | compatible = "selftest-i2c-mux"; | ||
307 | status = "okay"; | ||
308 | |||
309 | #address-cells = <1>; | ||
310 | #size-cells = <0>; | ||
311 | |||
312 | i2c@0 { | ||
313 | #address-cells = <1>; | ||
314 | #size-cells = <0>; | ||
315 | reg = <0>; | ||
316 | |||
317 | test-mux-dev { | ||
318 | reg = <32>; | ||
319 | compatible = "selftest-i2c-dev"; | ||
320 | status = "okay"; | ||
321 | }; | ||
322 | }; | ||
323 | }; | ||
324 | }; | ||
325 | }; | ||
326 | }; | ||
327 | |||
234 | }; | 328 | }; |
235 | }; | 329 | }; |
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 41a4a138f53b..0cf9a236d438 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c | |||
@@ -20,6 +20,9 @@ | |||
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/of_platform.h> | 21 | #include <linux/of_platform.h> |
22 | 22 | ||
23 | #include <linux/i2c.h> | ||
24 | #include <linux/i2c-mux.h> | ||
25 | |||
23 | #include "of_private.h" | 26 | #include "of_private.h" |
24 | 27 | ||
25 | static struct selftest_results { | 28 | static struct selftest_results { |
@@ -27,11 +30,6 @@ static struct selftest_results { | |||
27 | int failed; | 30 | int failed; |
28 | } selftest_results; | 31 | } selftest_results; |
29 | 32 | ||
30 | #define NO_OF_NODES 3 | ||
31 | static struct device_node *nodes[NO_OF_NODES]; | ||
32 | static int last_node_index; | ||
33 | static bool selftest_live_tree; | ||
34 | |||
35 | #define selftest(result, fmt, ...) ({ \ | 33 | #define selftest(result, fmt, ...) ({ \ |
36 | bool failed = !(result); \ | 34 | bool failed = !(result); \ |
37 | if (failed) { \ | 35 | if (failed) { \ |
@@ -822,6 +820,7 @@ static void update_node_properties(struct device_node *np, | |||
822 | static int attach_node_and_children(struct device_node *np) | 820 | static int attach_node_and_children(struct device_node *np) |
823 | { | 821 | { |
824 | struct device_node *next, *dup, *child; | 822 | struct device_node *next, *dup, *child; |
823 | unsigned long flags; | ||
825 | 824 | ||
826 | dup = of_find_node_by_path(np->full_name); | 825 | dup = of_find_node_by_path(np->full_name); |
827 | if (dup) { | 826 | if (dup) { |
@@ -829,17 +828,19 @@ static int attach_node_and_children(struct device_node *np) | |||
829 | return 0; | 828 | return 0; |
830 | } | 829 | } |
831 | 830 | ||
832 | /* Children of the root need to be remembered for removal */ | ||
833 | if (np->parent == of_root) { | ||
834 | if (WARN_ON(last_node_index >= NO_OF_NODES)) | ||
835 | return -EINVAL; | ||
836 | nodes[last_node_index++] = np; | ||
837 | } | ||
838 | |||
839 | child = np->child; | 831 | child = np->child; |
840 | np->child = NULL; | 832 | np->child = NULL; |
841 | np->sibling = NULL; | 833 | |
842 | of_attach_node(np); | 834 | mutex_lock(&of_mutex); |
835 | raw_spin_lock_irqsave(&devtree_lock, flags); | ||
836 | np->sibling = np->parent->child; | ||
837 | np->parent->child = np; | ||
838 | of_node_clear_flag(np, OF_DETACHED); | ||
839 | raw_spin_unlock_irqrestore(&devtree_lock, flags); | ||
840 | |||
841 | __of_attach_node_sysfs(np); | ||
842 | mutex_unlock(&of_mutex); | ||
843 | |||
843 | while (child) { | 844 | while (child) { |
844 | next = child->sibling; | 845 | next = child->sibling; |
845 | attach_node_and_children(child); | 846 | attach_node_and_children(child); |
@@ -889,10 +890,7 @@ static int __init selftest_data_add(void) | |||
889 | } | 890 | } |
890 | 891 | ||
891 | if (!of_root) { | 892 | if (!of_root) { |
892 | /* enabling flag for removing nodes */ | ||
893 | selftest_live_tree = true; | ||
894 | of_root = selftest_data_node; | 893 | of_root = selftest_data_node; |
895 | |||
896 | for_each_of_allnodes(np) | 894 | for_each_of_allnodes(np) |
897 | __of_attach_node_sysfs(np); | 895 | __of_attach_node_sysfs(np); |
898 | of_aliases = of_find_node_by_path("/aliases"); | 896 | of_aliases = of_find_node_by_path("/aliases"); |
@@ -911,59 +909,6 @@ static int __init selftest_data_add(void) | |||
911 | return 0; | 909 | return 0; |
912 | } | 910 | } |
913 | 911 | ||
914 | /** | ||
915 | * detach_node_and_children - detaches node | ||
916 | * and its children from live tree | ||
917 | * | ||
918 | * @np: Node to detach from live tree | ||
919 | */ | ||
920 | static void detach_node_and_children(struct device_node *np) | ||
921 | { | ||
922 | while (np->child) | ||
923 | detach_node_and_children(np->child); | ||
924 | of_detach_node(np); | ||
925 | } | ||
926 | |||
927 | /** | ||
928 | * selftest_data_remove - removes the selftest data | ||
929 | * nodes from the live tree | ||
930 | */ | ||
931 | static void selftest_data_remove(void) | ||
932 | { | ||
933 | struct device_node *np; | ||
934 | struct property *prop; | ||
935 | |||
936 | if (selftest_live_tree) { | ||
937 | of_node_put(of_aliases); | ||
938 | of_node_put(of_chosen); | ||
939 | of_aliases = NULL; | ||
940 | of_chosen = NULL; | ||
941 | for_each_child_of_node(of_root, np) | ||
942 | detach_node_and_children(np); | ||
943 | __of_detach_node_sysfs(of_root); | ||
944 | of_root = NULL; | ||
945 | return; | ||
946 | } | ||
947 | |||
948 | while (last_node_index-- > 0) { | ||
949 | if (nodes[last_node_index]) { | ||
950 | np = of_find_node_by_path(nodes[last_node_index]->full_name); | ||
951 | if (np == nodes[last_node_index]) { | ||
952 | if (of_aliases == np) { | ||
953 | of_node_put(of_aliases); | ||
954 | of_aliases = NULL; | ||
955 | } | ||
956 | detach_node_and_children(np); | ||
957 | } else { | ||
958 | for_each_property_of_node(np, prop) { | ||
959 | if (strcmp(prop->name, "testcase-alias") == 0) | ||
960 | of_remove_property(np, prop); | ||
961 | } | ||
962 | } | ||
963 | } | ||
964 | } | ||
965 | } | ||
966 | |||
967 | #ifdef CONFIG_OF_OVERLAY | 912 | #ifdef CONFIG_OF_OVERLAY |
968 | 913 | ||
969 | static int selftest_probe(struct platform_device *pdev) | 914 | static int selftest_probe(struct platform_device *pdev) |
@@ -1034,17 +979,94 @@ static int of_path_platform_device_exists(const char *path) | |||
1034 | return pdev != NULL; | 979 | return pdev != NULL; |
1035 | } | 980 | } |
1036 | 981 | ||
1037 | static const char *selftest_path(int nr) | 982 | #if IS_ENABLED(CONFIG_I2C) |
983 | |||
984 | /* get the i2c client device instantiated at the path */ | ||
985 | static struct i2c_client *of_path_to_i2c_client(const char *path) | ||
1038 | { | 986 | { |
987 | struct device_node *np; | ||
988 | struct i2c_client *client; | ||
989 | |||
990 | np = of_find_node_by_path(path); | ||
991 | if (np == NULL) | ||
992 | return NULL; | ||
993 | |||
994 | client = of_find_i2c_device_by_node(np); | ||
995 | of_node_put(np); | ||
996 | |||
997 | return client; | ||
998 | } | ||
999 | |||
1000 | /* find out if a i2c client device exists at that path */ | ||
1001 | static int of_path_i2c_client_exists(const char *path) | ||
1002 | { | ||
1003 | struct i2c_client *client; | ||
1004 | |||
1005 | client = of_path_to_i2c_client(path); | ||
1006 | if (client) | ||
1007 | put_device(&client->dev); | ||
1008 | return client != NULL; | ||
1009 | } | ||
1010 | #else | ||
1011 | static int of_path_i2c_client_exists(const char *path) | ||
1012 | { | ||
1013 | return 0; | ||
1014 | } | ||
1015 | #endif | ||
1016 | |||
1017 | enum overlay_type { | ||
1018 | PDEV_OVERLAY, | ||
1019 | I2C_OVERLAY | ||
1020 | }; | ||
1021 | |||
1022 | static int of_path_device_type_exists(const char *path, | ||
1023 | enum overlay_type ovtype) | ||
1024 | { | ||
1025 | switch (ovtype) { | ||
1026 | case PDEV_OVERLAY: | ||
1027 | return of_path_platform_device_exists(path); | ||
1028 | case I2C_OVERLAY: | ||
1029 | return of_path_i2c_client_exists(path); | ||
1030 | } | ||
1031 | return 0; | ||
1032 | } | ||
1033 | |||
1034 | static const char *selftest_path(int nr, enum overlay_type ovtype) | ||
1035 | { | ||
1036 | const char *base; | ||
1039 | static char buf[256]; | 1037 | static char buf[256]; |
1040 | 1038 | ||
1041 | snprintf(buf, sizeof(buf) - 1, | 1039 | switch (ovtype) { |
1042 | "/testcase-data/overlay-node/test-bus/test-selftest%d", nr); | 1040 | case PDEV_OVERLAY: |
1041 | base = "/testcase-data/overlay-node/test-bus"; | ||
1042 | break; | ||
1043 | case I2C_OVERLAY: | ||
1044 | base = "/testcase-data/overlay-node/test-bus/i2c-test-bus"; | ||
1045 | break; | ||
1046 | default: | ||
1047 | buf[0] = '\0'; | ||
1048 | return buf; | ||
1049 | } | ||
1050 | snprintf(buf, sizeof(buf) - 1, "%s/test-selftest%d", base, nr); | ||
1043 | buf[sizeof(buf) - 1] = '\0'; | 1051 | buf[sizeof(buf) - 1] = '\0'; |
1044 | |||
1045 | return buf; | 1052 | return buf; |
1046 | } | 1053 | } |
1047 | 1054 | ||
1055 | static int of_selftest_device_exists(int selftest_nr, enum overlay_type ovtype) | ||
1056 | { | ||
1057 | const char *path; | ||
1058 | |||
1059 | path = selftest_path(selftest_nr, ovtype); | ||
1060 | |||
1061 | switch (ovtype) { | ||
1062 | case PDEV_OVERLAY: | ||
1063 | return of_path_platform_device_exists(path); | ||
1064 | case I2C_OVERLAY: | ||
1065 | return of_path_i2c_client_exists(path); | ||
1066 | } | ||
1067 | return 0; | ||
1068 | } | ||
1069 | |||
1048 | static const char *overlay_path(int nr) | 1070 | static const char *overlay_path(int nr) |
1049 | { | 1071 | { |
1050 | static char buf[256]; | 1072 | static char buf[256]; |
@@ -1093,16 +1115,15 @@ out: | |||
1093 | 1115 | ||
1094 | /* apply an overlay while checking before and after states */ | 1116 | /* apply an overlay while checking before and after states */ |
1095 | static int of_selftest_apply_overlay_check(int overlay_nr, int selftest_nr, | 1117 | static int of_selftest_apply_overlay_check(int overlay_nr, int selftest_nr, |
1096 | int before, int after) | 1118 | int before, int after, enum overlay_type ovtype) |
1097 | { | 1119 | { |
1098 | int ret; | 1120 | int ret; |
1099 | 1121 | ||
1100 | /* selftest device must not be in before state */ | 1122 | /* selftest device must not be in before state */ |
1101 | if (of_path_platform_device_exists(selftest_path(selftest_nr)) | 1123 | if (of_selftest_device_exists(selftest_nr, ovtype) != before) { |
1102 | != before) { | ||
1103 | selftest(0, "overlay @\"%s\" with device @\"%s\" %s\n", | 1124 | selftest(0, "overlay @\"%s\" with device @\"%s\" %s\n", |
1104 | overlay_path(overlay_nr), | 1125 | overlay_path(overlay_nr), |
1105 | selftest_path(selftest_nr), | 1126 | selftest_path(selftest_nr, ovtype), |
1106 | !before ? "enabled" : "disabled"); | 1127 | !before ? "enabled" : "disabled"); |
1107 | return -EINVAL; | 1128 | return -EINVAL; |
1108 | } | 1129 | } |
@@ -1114,11 +1135,10 @@ static int of_selftest_apply_overlay_check(int overlay_nr, int selftest_nr, | |||
1114 | } | 1135 | } |
1115 | 1136 | ||
1116 | /* selftest device must be to set to after state */ | 1137 | /* selftest device must be to set to after state */ |
1117 | if (of_path_platform_device_exists(selftest_path(selftest_nr)) | 1138 | if (of_selftest_device_exists(selftest_nr, ovtype) != after) { |
1118 | != after) { | ||
1119 | selftest(0, "overlay @\"%s\" failed to create @\"%s\" %s\n", | 1139 | selftest(0, "overlay @\"%s\" failed to create @\"%s\" %s\n", |
1120 | overlay_path(overlay_nr), | 1140 | overlay_path(overlay_nr), |
1121 | selftest_path(selftest_nr), | 1141 | selftest_path(selftest_nr, ovtype), |
1122 | !after ? "enabled" : "disabled"); | 1142 | !after ? "enabled" : "disabled"); |
1123 | return -EINVAL; | 1143 | return -EINVAL; |
1124 | } | 1144 | } |
@@ -1128,16 +1148,16 @@ static int of_selftest_apply_overlay_check(int overlay_nr, int selftest_nr, | |||
1128 | 1148 | ||
1129 | /* apply an overlay and then revert it while checking before, after states */ | 1149 | /* apply an overlay and then revert it while checking before, after states */ |
1130 | static int of_selftest_apply_revert_overlay_check(int overlay_nr, | 1150 | static int of_selftest_apply_revert_overlay_check(int overlay_nr, |
1131 | int selftest_nr, int before, int after) | 1151 | int selftest_nr, int before, int after, |
1152 | enum overlay_type ovtype) | ||
1132 | { | 1153 | { |
1133 | int ret, ov_id; | 1154 | int ret, ov_id; |
1134 | 1155 | ||
1135 | /* selftest device must be in before state */ | 1156 | /* selftest device must be in before state */ |
1136 | if (of_path_platform_device_exists(selftest_path(selftest_nr)) | 1157 | if (of_selftest_device_exists(selftest_nr, ovtype) != before) { |
1137 | != before) { | ||
1138 | selftest(0, "overlay @\"%s\" with device @\"%s\" %s\n", | 1158 | selftest(0, "overlay @\"%s\" with device @\"%s\" %s\n", |
1139 | overlay_path(overlay_nr), | 1159 | overlay_path(overlay_nr), |
1140 | selftest_path(selftest_nr), | 1160 | selftest_path(selftest_nr, ovtype), |
1141 | !before ? "enabled" : "disabled"); | 1161 | !before ? "enabled" : "disabled"); |
1142 | return -EINVAL; | 1162 | return -EINVAL; |
1143 | } | 1163 | } |
@@ -1150,11 +1170,10 @@ static int of_selftest_apply_revert_overlay_check(int overlay_nr, | |||
1150 | } | 1170 | } |
1151 | 1171 | ||
1152 | /* selftest device must be in after state */ | 1172 | /* selftest device must be in after state */ |
1153 | if (of_path_platform_device_exists(selftest_path(selftest_nr)) | 1173 | if (of_selftest_device_exists(selftest_nr, ovtype) != after) { |
1154 | != after) { | ||
1155 | selftest(0, "overlay @\"%s\" failed to create @\"%s\" %s\n", | 1174 | selftest(0, "overlay @\"%s\" failed to create @\"%s\" %s\n", |
1156 | overlay_path(overlay_nr), | 1175 | overlay_path(overlay_nr), |
1157 | selftest_path(selftest_nr), | 1176 | selftest_path(selftest_nr, ovtype), |
1158 | !after ? "enabled" : "disabled"); | 1177 | !after ? "enabled" : "disabled"); |
1159 | return -EINVAL; | 1178 | return -EINVAL; |
1160 | } | 1179 | } |
@@ -1163,16 +1182,15 @@ static int of_selftest_apply_revert_overlay_check(int overlay_nr, | |||
1163 | if (ret != 0) { | 1182 | if (ret != 0) { |
1164 | selftest(0, "overlay @\"%s\" failed to be destroyed @\"%s\"\n", | 1183 | selftest(0, "overlay @\"%s\" failed to be destroyed @\"%s\"\n", |
1165 | overlay_path(overlay_nr), | 1184 | overlay_path(overlay_nr), |
1166 | selftest_path(selftest_nr)); | 1185 | selftest_path(selftest_nr, ovtype)); |
1167 | return ret; | 1186 | return ret; |
1168 | } | 1187 | } |
1169 | 1188 | ||
1170 | /* selftest device must be again in before state */ | 1189 | /* selftest device must be again in before state */ |
1171 | if (of_path_platform_device_exists(selftest_path(selftest_nr)) | 1190 | if (of_selftest_device_exists(selftest_nr, PDEV_OVERLAY) != before) { |
1172 | != before) { | ||
1173 | selftest(0, "overlay @\"%s\" with device @\"%s\" %s\n", | 1191 | selftest(0, "overlay @\"%s\" with device @\"%s\" %s\n", |
1174 | overlay_path(overlay_nr), | 1192 | overlay_path(overlay_nr), |
1175 | selftest_path(selftest_nr), | 1193 | selftest_path(selftest_nr, ovtype), |
1176 | !before ? "enabled" : "disabled"); | 1194 | !before ? "enabled" : "disabled"); |
1177 | return -EINVAL; | 1195 | return -EINVAL; |
1178 | } | 1196 | } |
@@ -1186,7 +1204,7 @@ static void of_selftest_overlay_0(void) | |||
1186 | int ret; | 1204 | int ret; |
1187 | 1205 | ||
1188 | /* device should enable */ | 1206 | /* device should enable */ |
1189 | ret = of_selftest_apply_overlay_check(0, 0, 0, 1); | 1207 | ret = of_selftest_apply_overlay_check(0, 0, 0, 1, PDEV_OVERLAY); |
1190 | if (ret != 0) | 1208 | if (ret != 0) |
1191 | return; | 1209 | return; |
1192 | 1210 | ||
@@ -1199,7 +1217,7 @@ static void of_selftest_overlay_1(void) | |||
1199 | int ret; | 1217 | int ret; |
1200 | 1218 | ||
1201 | /* device should disable */ | 1219 | /* device should disable */ |
1202 | ret = of_selftest_apply_overlay_check(1, 1, 1, 0); | 1220 | ret = of_selftest_apply_overlay_check(1, 1, 1, 0, PDEV_OVERLAY); |
1203 | if (ret != 0) | 1221 | if (ret != 0) |
1204 | return; | 1222 | return; |
1205 | 1223 | ||
@@ -1212,7 +1230,7 @@ static void of_selftest_overlay_2(void) | |||
1212 | int ret; | 1230 | int ret; |
1213 | 1231 | ||
1214 | /* device should enable */ | 1232 | /* device should enable */ |
1215 | ret = of_selftest_apply_overlay_check(2, 2, 0, 1); | 1233 | ret = of_selftest_apply_overlay_check(2, 2, 0, 1, PDEV_OVERLAY); |
1216 | if (ret != 0) | 1234 | if (ret != 0) |
1217 | return; | 1235 | return; |
1218 | 1236 | ||
@@ -1225,7 +1243,7 @@ static void of_selftest_overlay_3(void) | |||
1225 | int ret; | 1243 | int ret; |
1226 | 1244 | ||
1227 | /* device should disable */ | 1245 | /* device should disable */ |
1228 | ret = of_selftest_apply_overlay_check(3, 3, 1, 0); | 1246 | ret = of_selftest_apply_overlay_check(3, 3, 1, 0, PDEV_OVERLAY); |
1229 | if (ret != 0) | 1247 | if (ret != 0) |
1230 | return; | 1248 | return; |
1231 | 1249 | ||
@@ -1238,7 +1256,7 @@ static void of_selftest_overlay_4(void) | |||
1238 | int ret; | 1256 | int ret; |
1239 | 1257 | ||
1240 | /* device should disable */ | 1258 | /* device should disable */ |
1241 | ret = of_selftest_apply_overlay_check(4, 4, 0, 1); | 1259 | ret = of_selftest_apply_overlay_check(4, 4, 0, 1, PDEV_OVERLAY); |
1242 | if (ret != 0) | 1260 | if (ret != 0) |
1243 | return; | 1261 | return; |
1244 | 1262 | ||
@@ -1251,7 +1269,7 @@ static void of_selftest_overlay_5(void) | |||
1251 | int ret; | 1269 | int ret; |
1252 | 1270 | ||
1253 | /* device should disable */ | 1271 | /* device should disable */ |
1254 | ret = of_selftest_apply_revert_overlay_check(5, 5, 0, 1); | 1272 | ret = of_selftest_apply_revert_overlay_check(5, 5, 0, 1, PDEV_OVERLAY); |
1255 | if (ret != 0) | 1273 | if (ret != 0) |
1256 | return; | 1274 | return; |
1257 | 1275 | ||
@@ -1268,12 +1286,12 @@ static void of_selftest_overlay_6(void) | |||
1268 | 1286 | ||
1269 | /* selftest device must be in before state */ | 1287 | /* selftest device must be in before state */ |
1270 | for (i = 0; i < 2; i++) { | 1288 | for (i = 0; i < 2; i++) { |
1271 | if (of_path_platform_device_exists( | 1289 | if (of_selftest_device_exists(selftest_nr + i, PDEV_OVERLAY) |
1272 | selftest_path(selftest_nr + i)) | ||
1273 | != before) { | 1290 | != before) { |
1274 | selftest(0, "overlay @\"%s\" with device @\"%s\" %s\n", | 1291 | selftest(0, "overlay @\"%s\" with device @\"%s\" %s\n", |
1275 | overlay_path(overlay_nr + i), | 1292 | overlay_path(overlay_nr + i), |
1276 | selftest_path(selftest_nr + i), | 1293 | selftest_path(selftest_nr + i, |
1294 | PDEV_OVERLAY), | ||
1277 | !before ? "enabled" : "disabled"); | 1295 | !before ? "enabled" : "disabled"); |
1278 | return; | 1296 | return; |
1279 | } | 1297 | } |
@@ -1300,12 +1318,12 @@ static void of_selftest_overlay_6(void) | |||
1300 | 1318 | ||
1301 | for (i = 0; i < 2; i++) { | 1319 | for (i = 0; i < 2; i++) { |
1302 | /* selftest device must be in after state */ | 1320 | /* selftest device must be in after state */ |
1303 | if (of_path_platform_device_exists( | 1321 | if (of_selftest_device_exists(selftest_nr + i, PDEV_OVERLAY) |
1304 | selftest_path(selftest_nr + i)) | ||
1305 | != after) { | 1322 | != after) { |
1306 | selftest(0, "overlay @\"%s\" failed @\"%s\" %s\n", | 1323 | selftest(0, "overlay @\"%s\" failed @\"%s\" %s\n", |
1307 | overlay_path(overlay_nr + i), | 1324 | overlay_path(overlay_nr + i), |
1308 | selftest_path(selftest_nr + i), | 1325 | selftest_path(selftest_nr + i, |
1326 | PDEV_OVERLAY), | ||
1309 | !after ? "enabled" : "disabled"); | 1327 | !after ? "enabled" : "disabled"); |
1310 | return; | 1328 | return; |
1311 | } | 1329 | } |
@@ -1316,19 +1334,20 @@ static void of_selftest_overlay_6(void) | |||
1316 | if (ret != 0) { | 1334 | if (ret != 0) { |
1317 | selftest(0, "overlay @\"%s\" failed destroy @\"%s\"\n", | 1335 | selftest(0, "overlay @\"%s\" failed destroy @\"%s\"\n", |
1318 | overlay_path(overlay_nr + i), | 1336 | overlay_path(overlay_nr + i), |
1319 | selftest_path(selftest_nr + i)); | 1337 | selftest_path(selftest_nr + i, |
1338 | PDEV_OVERLAY)); | ||
1320 | return; | 1339 | return; |
1321 | } | 1340 | } |
1322 | } | 1341 | } |
1323 | 1342 | ||
1324 | for (i = 0; i < 2; i++) { | 1343 | for (i = 0; i < 2; i++) { |
1325 | /* selftest device must be again in before state */ | 1344 | /* selftest device must be again in before state */ |
1326 | if (of_path_platform_device_exists( | 1345 | if (of_selftest_device_exists(selftest_nr + i, PDEV_OVERLAY) |
1327 | selftest_path(selftest_nr + i)) | ||
1328 | != before) { | 1346 | != before) { |
1329 | selftest(0, "overlay @\"%s\" with device @\"%s\" %s\n", | 1347 | selftest(0, "overlay @\"%s\" with device @\"%s\" %s\n", |
1330 | overlay_path(overlay_nr + i), | 1348 | overlay_path(overlay_nr + i), |
1331 | selftest_path(selftest_nr + i), | 1349 | selftest_path(selftest_nr + i, |
1350 | PDEV_OVERLAY), | ||
1332 | !before ? "enabled" : "disabled"); | 1351 | !before ? "enabled" : "disabled"); |
1333 | return; | 1352 | return; |
1334 | } | 1353 | } |
@@ -1370,7 +1389,8 @@ static void of_selftest_overlay_8(void) | |||
1370 | if (ret == 0) { | 1389 | if (ret == 0) { |
1371 | selftest(0, "overlay @\"%s\" was destroyed @\"%s\"\n", | 1390 | selftest(0, "overlay @\"%s\" was destroyed @\"%s\"\n", |
1372 | overlay_path(overlay_nr + 0), | 1391 | overlay_path(overlay_nr + 0), |
1373 | selftest_path(selftest_nr)); | 1392 | selftest_path(selftest_nr, |
1393 | PDEV_OVERLAY)); | ||
1374 | return; | 1394 | return; |
1375 | } | 1395 | } |
1376 | 1396 | ||
@@ -1380,7 +1400,8 @@ static void of_selftest_overlay_8(void) | |||
1380 | if (ret != 0) { | 1400 | if (ret != 0) { |
1381 | selftest(0, "overlay @\"%s\" not destroyed @\"%s\"\n", | 1401 | selftest(0, "overlay @\"%s\" not destroyed @\"%s\"\n", |
1382 | overlay_path(overlay_nr + i), | 1402 | overlay_path(overlay_nr + i), |
1383 | selftest_path(selftest_nr)); | 1403 | selftest_path(selftest_nr, |
1404 | PDEV_OVERLAY)); | ||
1384 | return; | 1405 | return; |
1385 | } | 1406 | } |
1386 | } | 1407 | } |
@@ -1395,16 +1416,17 @@ static void of_selftest_overlay_10(void) | |||
1395 | char *child_path; | 1416 | char *child_path; |
1396 | 1417 | ||
1397 | /* device should disable */ | 1418 | /* device should disable */ |
1398 | ret = of_selftest_apply_overlay_check(10, 10, 0, 1); | 1419 | ret = of_selftest_apply_overlay_check(10, 10, 0, 1, PDEV_OVERLAY); |
1399 | if (selftest(ret == 0, "overlay test %d failed; overlay application\n", 10)) | 1420 | if (selftest(ret == 0, |
1421 | "overlay test %d failed; overlay application\n", 10)) | ||
1400 | return; | 1422 | return; |
1401 | 1423 | ||
1402 | child_path = kasprintf(GFP_KERNEL, "%s/test-selftest101", | 1424 | child_path = kasprintf(GFP_KERNEL, "%s/test-selftest101", |
1403 | selftest_path(10)); | 1425 | selftest_path(10, PDEV_OVERLAY)); |
1404 | if (selftest(child_path, "overlay test %d failed; kasprintf\n", 10)) | 1426 | if (selftest(child_path, "overlay test %d failed; kasprintf\n", 10)) |
1405 | return; | 1427 | return; |
1406 | 1428 | ||
1407 | ret = of_path_platform_device_exists(child_path); | 1429 | ret = of_path_device_type_exists(child_path, PDEV_OVERLAY); |
1408 | kfree(child_path); | 1430 | kfree(child_path); |
1409 | if (selftest(ret, "overlay test %d failed; no child device\n", 10)) | 1431 | if (selftest(ret, "overlay test %d failed; no child device\n", 10)) |
1410 | return; | 1432 | return; |
@@ -1416,11 +1438,331 @@ static void of_selftest_overlay_11(void) | |||
1416 | int ret; | 1438 | int ret; |
1417 | 1439 | ||
1418 | /* device should disable */ | 1440 | /* device should disable */ |
1419 | ret = of_selftest_apply_revert_overlay_check(11, 11, 0, 1); | 1441 | ret = of_selftest_apply_revert_overlay_check(11, 11, 0, 1, |
1420 | if (selftest(ret == 0, "overlay test %d failed; overlay application\n", 11)) | 1442 | PDEV_OVERLAY); |
1443 | if (selftest(ret == 0, | ||
1444 | "overlay test %d failed; overlay application\n", 11)) | ||
1421 | return; | 1445 | return; |
1422 | } | 1446 | } |
1423 | 1447 | ||
1448 | #if IS_ENABLED(CONFIG_I2C) && IS_ENABLED(CONFIG_OF_OVERLAY) | ||
1449 | |||
1450 | struct selftest_i2c_bus_data { | ||
1451 | struct platform_device *pdev; | ||
1452 | struct i2c_adapter adap; | ||
1453 | }; | ||
1454 | |||
1455 | static int selftest_i2c_master_xfer(struct i2c_adapter *adap, | ||
1456 | struct i2c_msg *msgs, int num) | ||
1457 | { | ||
1458 | struct selftest_i2c_bus_data *std = i2c_get_adapdata(adap); | ||
1459 | |||
1460 | (void)std; | ||
1461 | |||
1462 | return num; | ||
1463 | } | ||
1464 | |||
1465 | static u32 selftest_i2c_functionality(struct i2c_adapter *adap) | ||
1466 | { | ||
1467 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; | ||
1468 | } | ||
1469 | |||
1470 | static const struct i2c_algorithm selftest_i2c_algo = { | ||
1471 | .master_xfer = selftest_i2c_master_xfer, | ||
1472 | .functionality = selftest_i2c_functionality, | ||
1473 | }; | ||
1474 | |||
1475 | static int selftest_i2c_bus_probe(struct platform_device *pdev) | ||
1476 | { | ||
1477 | struct device *dev = &pdev->dev; | ||
1478 | struct device_node *np = dev->of_node; | ||
1479 | struct selftest_i2c_bus_data *std; | ||
1480 | struct i2c_adapter *adap; | ||
1481 | int ret; | ||
1482 | |||
1483 | if (np == NULL) { | ||
1484 | dev_err(dev, "No OF data for device\n"); | ||
1485 | return -EINVAL; | ||
1486 | |||
1487 | } | ||
1488 | |||
1489 | dev_dbg(dev, "%s for node @%s\n", __func__, np->full_name); | ||
1490 | |||
1491 | std = devm_kzalloc(dev, sizeof(*std), GFP_KERNEL); | ||
1492 | if (!std) { | ||
1493 | dev_err(dev, "Failed to allocate selftest i2c data\n"); | ||
1494 | return -ENOMEM; | ||
1495 | } | ||
1496 | |||
1497 | /* link them together */ | ||
1498 | std->pdev = pdev; | ||
1499 | platform_set_drvdata(pdev, std); | ||
1500 | |||
1501 | adap = &std->adap; | ||
1502 | i2c_set_adapdata(adap, std); | ||
1503 | adap->nr = -1; | ||
1504 | strlcpy(adap->name, pdev->name, sizeof(adap->name)); | ||
1505 | adap->class = I2C_CLASS_DEPRECATED; | ||
1506 | adap->algo = &selftest_i2c_algo; | ||
1507 | adap->dev.parent = dev; | ||
1508 | adap->dev.of_node = dev->of_node; | ||
1509 | adap->timeout = 5 * HZ; | ||
1510 | adap->retries = 3; | ||
1511 | |||
1512 | ret = i2c_add_numbered_adapter(adap); | ||
1513 | if (ret != 0) { | ||
1514 | dev_err(dev, "Failed to add I2C adapter\n"); | ||
1515 | return ret; | ||
1516 | } | ||
1517 | |||
1518 | return 0; | ||
1519 | } | ||
1520 | |||
1521 | static int selftest_i2c_bus_remove(struct platform_device *pdev) | ||
1522 | { | ||
1523 | struct device *dev = &pdev->dev; | ||
1524 | struct device_node *np = dev->of_node; | ||
1525 | struct selftest_i2c_bus_data *std = platform_get_drvdata(pdev); | ||
1526 | |||
1527 | dev_dbg(dev, "%s for node @%s\n", __func__, np->full_name); | ||
1528 | i2c_del_adapter(&std->adap); | ||
1529 | |||
1530 | return 0; | ||
1531 | } | ||
1532 | |||
1533 | static struct of_device_id selftest_i2c_bus_match[] = { | ||
1534 | { .compatible = "selftest-i2c-bus", }, | ||
1535 | {}, | ||
1536 | }; | ||
1537 | |||
1538 | static struct platform_driver selftest_i2c_bus_driver = { | ||
1539 | .probe = selftest_i2c_bus_probe, | ||
1540 | .remove = selftest_i2c_bus_remove, | ||
1541 | .driver = { | ||
1542 | .name = "selftest-i2c-bus", | ||
1543 | .of_match_table = of_match_ptr(selftest_i2c_bus_match), | ||
1544 | }, | ||
1545 | }; | ||
1546 | |||
1547 | static int selftest_i2c_dev_probe(struct i2c_client *client, | ||
1548 | const struct i2c_device_id *id) | ||
1549 | { | ||
1550 | struct device *dev = &client->dev; | ||
1551 | struct device_node *np = client->dev.of_node; | ||
1552 | |||
1553 | if (!np) { | ||
1554 | dev_err(dev, "No OF node\n"); | ||
1555 | return -EINVAL; | ||
1556 | } | ||
1557 | |||
1558 | dev_dbg(dev, "%s for node @%s\n", __func__, np->full_name); | ||
1559 | |||
1560 | return 0; | ||
1561 | }; | ||
1562 | |||
1563 | static int selftest_i2c_dev_remove(struct i2c_client *client) | ||
1564 | { | ||
1565 | struct device *dev = &client->dev; | ||
1566 | struct device_node *np = client->dev.of_node; | ||
1567 | |||
1568 | dev_dbg(dev, "%s for node @%s\n", __func__, np->full_name); | ||
1569 | return 0; | ||
1570 | } | ||
1571 | |||
1572 | static const struct i2c_device_id selftest_i2c_dev_id[] = { | ||
1573 | { .name = "selftest-i2c-dev" }, | ||
1574 | { } | ||
1575 | }; | ||
1576 | |||
1577 | static struct i2c_driver selftest_i2c_dev_driver = { | ||
1578 | .driver = { | ||
1579 | .name = "selftest-i2c-dev", | ||
1580 | .owner = THIS_MODULE, | ||
1581 | }, | ||
1582 | .probe = selftest_i2c_dev_probe, | ||
1583 | .remove = selftest_i2c_dev_remove, | ||
1584 | .id_table = selftest_i2c_dev_id, | ||
1585 | }; | ||
1586 | |||
1587 | #if IS_ENABLED(CONFIG_I2C_MUX) | ||
1588 | |||
1589 | struct selftest_i2c_mux_data { | ||
1590 | int nchans; | ||
1591 | struct i2c_adapter *adap[]; | ||
1592 | }; | ||
1593 | |||
1594 | static int selftest_i2c_mux_select_chan(struct i2c_adapter *adap, | ||
1595 | void *client, u32 chan) | ||
1596 | { | ||
1597 | return 0; | ||
1598 | } | ||
1599 | |||
1600 | static int selftest_i2c_mux_probe(struct i2c_client *client, | ||
1601 | const struct i2c_device_id *id) | ||
1602 | { | ||
1603 | int ret, i, nchans, size; | ||
1604 | struct device *dev = &client->dev; | ||
1605 | struct i2c_adapter *adap = to_i2c_adapter(dev->parent); | ||
1606 | struct device_node *np = client->dev.of_node, *child; | ||
1607 | struct selftest_i2c_mux_data *stm; | ||
1608 | u32 reg, max_reg; | ||
1609 | |||
1610 | dev_dbg(dev, "%s for node @%s\n", __func__, np->full_name); | ||
1611 | |||
1612 | if (!np) { | ||
1613 | dev_err(dev, "No OF node\n"); | ||
1614 | return -EINVAL; | ||
1615 | } | ||
1616 | |||
1617 | max_reg = (u32)-1; | ||
1618 | for_each_child_of_node(np, child) { | ||
1619 | ret = of_property_read_u32(child, "reg", ®); | ||
1620 | if (ret) | ||
1621 | continue; | ||
1622 | if (max_reg == (u32)-1 || reg > max_reg) | ||
1623 | max_reg = reg; | ||
1624 | } | ||
1625 | nchans = max_reg == (u32)-1 ? 0 : max_reg + 1; | ||
1626 | if (nchans == 0) { | ||
1627 | dev_err(dev, "No channels\n"); | ||
1628 | return -EINVAL; | ||
1629 | } | ||
1630 | |||
1631 | size = offsetof(struct selftest_i2c_mux_data, adap[nchans]); | ||
1632 | stm = devm_kzalloc(dev, size, GFP_KERNEL); | ||
1633 | if (!stm) { | ||
1634 | dev_err(dev, "Out of memory\n"); | ||
1635 | return -ENOMEM; | ||
1636 | } | ||
1637 | stm->nchans = nchans; | ||
1638 | for (i = 0; i < nchans; i++) { | ||
1639 | stm->adap[i] = i2c_add_mux_adapter(adap, dev, client, | ||
1640 | 0, i, 0, selftest_i2c_mux_select_chan, NULL); | ||
1641 | if (!stm->adap[i]) { | ||
1642 | dev_err(dev, "Failed to register mux #%d\n", i); | ||
1643 | for (i--; i >= 0; i--) | ||
1644 | i2c_del_mux_adapter(stm->adap[i]); | ||
1645 | return -ENODEV; | ||
1646 | } | ||
1647 | } | ||
1648 | |||
1649 | i2c_set_clientdata(client, stm); | ||
1650 | |||
1651 | return 0; | ||
1652 | }; | ||
1653 | |||
1654 | static int selftest_i2c_mux_remove(struct i2c_client *client) | ||
1655 | { | ||
1656 | struct device *dev = &client->dev; | ||
1657 | struct device_node *np = client->dev.of_node; | ||
1658 | struct selftest_i2c_mux_data *stm = i2c_get_clientdata(client); | ||
1659 | int i; | ||
1660 | |||
1661 | dev_dbg(dev, "%s for node @%s\n", __func__, np->full_name); | ||
1662 | for (i = stm->nchans - 1; i >= 0; i--) | ||
1663 | i2c_del_mux_adapter(stm->adap[i]); | ||
1664 | return 0; | ||
1665 | } | ||
1666 | |||
1667 | static const struct i2c_device_id selftest_i2c_mux_id[] = { | ||
1668 | { .name = "selftest-i2c-mux" }, | ||
1669 | { } | ||
1670 | }; | ||
1671 | |||
1672 | static struct i2c_driver selftest_i2c_mux_driver = { | ||
1673 | .driver = { | ||
1674 | .name = "selftest-i2c-mux", | ||
1675 | .owner = THIS_MODULE, | ||
1676 | }, | ||
1677 | .probe = selftest_i2c_mux_probe, | ||
1678 | .remove = selftest_i2c_mux_remove, | ||
1679 | .id_table = selftest_i2c_mux_id, | ||
1680 | }; | ||
1681 | |||
1682 | #endif | ||
1683 | |||
1684 | static int of_selftest_overlay_i2c_init(void) | ||
1685 | { | ||
1686 | int ret; | ||
1687 | |||
1688 | ret = i2c_add_driver(&selftest_i2c_dev_driver); | ||
1689 | if (selftest(ret == 0, | ||
1690 | "could not register selftest i2c device driver\n")) | ||
1691 | return ret; | ||
1692 | |||
1693 | ret = platform_driver_register(&selftest_i2c_bus_driver); | ||
1694 | if (selftest(ret == 0, | ||
1695 | "could not register selftest i2c bus driver\n")) | ||
1696 | return ret; | ||
1697 | |||
1698 | #if IS_ENABLED(CONFIG_I2C_MUX) | ||
1699 | ret = i2c_add_driver(&selftest_i2c_mux_driver); | ||
1700 | if (selftest(ret == 0, | ||
1701 | "could not register selftest i2c mux driver\n")) | ||
1702 | return ret; | ||
1703 | #endif | ||
1704 | |||
1705 | return 0; | ||
1706 | } | ||
1707 | |||
1708 | static void of_selftest_overlay_i2c_cleanup(void) | ||
1709 | { | ||
1710 | #if IS_ENABLED(CONFIG_I2C_MUX) | ||
1711 | i2c_del_driver(&selftest_i2c_mux_driver); | ||
1712 | #endif | ||
1713 | platform_driver_unregister(&selftest_i2c_bus_driver); | ||
1714 | i2c_del_driver(&selftest_i2c_dev_driver); | ||
1715 | } | ||
1716 | |||
1717 | static void of_selftest_overlay_i2c_12(void) | ||
1718 | { | ||
1719 | int ret; | ||
1720 | |||
1721 | /* device should enable */ | ||
1722 | ret = of_selftest_apply_overlay_check(12, 12, 0, 1, I2C_OVERLAY); | ||
1723 | if (ret != 0) | ||
1724 | return; | ||
1725 | |||
1726 | selftest(1, "overlay test %d passed\n", 12); | ||
1727 | } | ||
1728 | |||
1729 | /* test deactivation of device */ | ||
1730 | static void of_selftest_overlay_i2c_13(void) | ||
1731 | { | ||
1732 | int ret; | ||
1733 | |||
1734 | /* device should disable */ | ||
1735 | ret = of_selftest_apply_overlay_check(13, 13, 1, 0, I2C_OVERLAY); | ||
1736 | if (ret != 0) | ||
1737 | return; | ||
1738 | |||
1739 | selftest(1, "overlay test %d passed\n", 13); | ||
1740 | } | ||
1741 | |||
1742 | /* just check for i2c mux existence */ | ||
1743 | static void of_selftest_overlay_i2c_14(void) | ||
1744 | { | ||
1745 | } | ||
1746 | |||
1747 | static void of_selftest_overlay_i2c_15(void) | ||
1748 | { | ||
1749 | int ret; | ||
1750 | |||
1751 | /* device should enable */ | ||
1752 | ret = of_selftest_apply_overlay_check(16, 15, 0, 1, I2C_OVERLAY); | ||
1753 | if (ret != 0) | ||
1754 | return; | ||
1755 | |||
1756 | selftest(1, "overlay test %d passed\n", 15); | ||
1757 | } | ||
1758 | |||
1759 | #else | ||
1760 | |||
1761 | static inline void of_selftest_overlay_i2c_14(void) { } | ||
1762 | static inline void of_selftest_overlay_i2c_15(void) { } | ||
1763 | |||
1764 | #endif | ||
1765 | |||
1424 | static void __init of_selftest_overlay(void) | 1766 | static void __init of_selftest_overlay(void) |
1425 | { | 1767 | { |
1426 | struct device_node *bus_np = NULL; | 1768 | struct device_node *bus_np = NULL; |
@@ -1445,15 +1787,15 @@ static void __init of_selftest_overlay(void) | |||
1445 | goto out; | 1787 | goto out; |
1446 | } | 1788 | } |
1447 | 1789 | ||
1448 | if (!of_path_platform_device_exists(selftest_path(100))) { | 1790 | if (!of_selftest_device_exists(100, PDEV_OVERLAY)) { |
1449 | selftest(0, "could not find selftest0 @ \"%s\"\n", | 1791 | selftest(0, "could not find selftest0 @ \"%s\"\n", |
1450 | selftest_path(100)); | 1792 | selftest_path(100, PDEV_OVERLAY)); |
1451 | goto out; | 1793 | goto out; |
1452 | } | 1794 | } |
1453 | 1795 | ||
1454 | if (of_path_platform_device_exists(selftest_path(101))) { | 1796 | if (of_selftest_device_exists(101, PDEV_OVERLAY)) { |
1455 | selftest(0, "selftest1 @ \"%s\" should not exist\n", | 1797 | selftest(0, "selftest1 @ \"%s\" should not exist\n", |
1456 | selftest_path(101)); | 1798 | selftest_path(101, PDEV_OVERLAY)); |
1457 | goto out; | 1799 | goto out; |
1458 | } | 1800 | } |
1459 | 1801 | ||
@@ -1472,6 +1814,18 @@ static void __init of_selftest_overlay(void) | |||
1472 | of_selftest_overlay_10(); | 1814 | of_selftest_overlay_10(); |
1473 | of_selftest_overlay_11(); | 1815 | of_selftest_overlay_11(); |
1474 | 1816 | ||
1817 | #if IS_ENABLED(CONFIG_I2C) | ||
1818 | if (selftest(of_selftest_overlay_i2c_init() == 0, "i2c init failed\n")) | ||
1819 | goto out; | ||
1820 | |||
1821 | of_selftest_overlay_i2c_12(); | ||
1822 | of_selftest_overlay_i2c_13(); | ||
1823 | of_selftest_overlay_i2c_14(); | ||
1824 | of_selftest_overlay_i2c_15(); | ||
1825 | |||
1826 | of_selftest_overlay_i2c_cleanup(); | ||
1827 | #endif | ||
1828 | |||
1475 | out: | 1829 | out: |
1476 | of_node_put(bus_np); | 1830 | of_node_put(bus_np); |
1477 | } | 1831 | } |
@@ -1514,9 +1868,6 @@ static int __init of_selftest(void) | |||
1514 | of_selftest_platform_populate(); | 1868 | of_selftest_platform_populate(); |
1515 | of_selftest_overlay(); | 1869 | of_selftest_overlay(); |
1516 | 1870 | ||
1517 | /* removing selftest data from live tree */ | ||
1518 | selftest_data_remove(); | ||
1519 | |||
1520 | /* Double check linkage after removing testcase data */ | 1871 | /* Double check linkage after removing testcase data */ |
1521 | of_selftest_check_tree_linkage(); | 1872 | of_selftest_check_tree_linkage(); |
1522 | 1873 | ||
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 745def862580..bbf85d612be5 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -220,8 +220,7 @@ struct serio_device_id { | |||
220 | /* | 220 | /* |
221 | * Struct used for matching a device | 221 | * Struct used for matching a device |
222 | */ | 222 | */ |
223 | struct of_device_id | 223 | struct of_device_id { |
224 | { | ||
225 | char name[32]; | 224 | char name[32]; |
226 | char type[32]; | 225 | char type[32]; |
227 | char compatible[128]; | 226 | char compatible[128]; |