-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
of: unittest: add overlay gpio test to catch gpio hog problem
Geert reports that gpio hog nodes are not properly processed when the gpio hog node is added via an overlay reply and provides an RFC patch to fix the problem [1]. Add a unittest that shows the problem. Unittest will report "1 failed" test before applying Geert's RFC patch and "0 failed" after applying Geert's RFC patch. [1] https://lore.kernel.org/linux-devicetree/20191230133852.5890-1-geert+renesas@glider.be/ Signed-off-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Rob Herring <robh@kernel.org>
- Loading branch information
Frank Rowand
authored and
Rob Herring
committed
Feb 26, 2020
1 parent
2f7afc3
commit f4056e7
Showing
8 changed files
with
370 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
&unittest_test_bus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
gpio@0 { | ||
compatible = "unittest-gpio"; | ||
reg = <0>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
ngpios = <2>; | ||
gpio-line-names = "line-A", "line-B"; | ||
|
||
line-b { | ||
gpio-hog; | ||
gpios = <2 0>; | ||
input; | ||
line-name = "line-B-input"; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
&unittest_test_bus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
gpio@2 { | ||
compatible = "unittest-gpio"; | ||
reg = <2>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
ngpios = <2>; | ||
gpio-line-names = "line-A", "line-B"; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
&unittest_test_bus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
gpio@2 { | ||
line-a { | ||
gpio-hog; | ||
gpios = <1 0>; | ||
input; | ||
line-name = "line-A-input"; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
&unittest_test_bus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
gpio@3 { | ||
compatible = "unittest-gpio"; | ||
reg = <3>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
ngpios = <2>; | ||
gpio-line-names = "line-A", "line-B", "line-C", "line-D"; | ||
|
||
line-d { | ||
gpio-hog; | ||
gpios = <4 0>; | ||
input; | ||
line-name = "line-D-input"; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
&unittest_test_bus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
gpio@4 { | ||
compatible = "unittest-gpio"; | ||
reg = <4>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
ngpios = <2>; | ||
gpio-line-names = "line-A", "line-B", "line-C", "line-D"; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
&unittest_test_bus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
gpio@4 { | ||
line-c { | ||
gpio-hog; | ||
gpios = <3 0>; | ||
input; | ||
line-name = "line-C-input"; | ||
}; | ||
}; | ||
}; |
Oops, something went wrong.