Skip to content
Permalink
Browse files

scripts/dts: add basic test for IO channel property

Test the new io-channel support

Signed-off-by: Jim Paris <jim@jtan.com>
  • Loading branch information...
jimparis authored and galak committed Aug 7, 2019
1 parent ca8d038 commit 998d7a01dda2c7c4ea23e0a6ea737d5d0921ce5c
Showing with 37 additions and 0 deletions.
  1. +14 −0 scripts/dts/test-bindings/io-channel.yaml
  2. +16 −0 scripts/dts/test.dts
  3. +7 −0 scripts/dts/testedtlib.py
@@ -0,0 +1,14 @@
#
# SPDX-License-Identifier: BSD-3-Clause
#

title: IO channel with one cell
description: IO channel with one cell

properties:
compatible:
constraint: "io-channel"
type: string-array

"#cells":
- one
@@ -195,6 +195,22 @@
};
};

//
// IO channels
//

// Lots of common code with PWMs and clocks, so just test the basics
io-channel-test {
io-channel {
compatible = "io-channel";
#io-channel-cells = <1>;
};
node {
io-channels = <&{/io-channel-test/io-channel} 1>;
io-channel-names = "io-channel";
};
};

//
// 'reg'
//
@@ -72,6 +72,13 @@ def verify_streq(actual, expected):
verify_streq(edt.get_dev("/pwm-test/node").pwms,
"[<PWM, name: zero-cell, target: <Device /pwm-test/pwm-0 in 'test.dts', binding test-bindings/pwm-0-cell.yaml>, specifier: {}>, <PWM, name: one-cell, target: <Device /pwm-test/pwm-1 in 'test.dts', binding test-bindings/pwm-1-cell.yaml>, specifier: {'one': 1}>]")

#
# Test IO channels
#

verify_streq(edt.get_dev("/io-channel-test/node").iochannels,
"[<IOChannel, name: io-channel, target: <Device /io-channel-test/io-channel in 'test.dts', binding test-bindings/io-channel.yaml>, specifier: {'one': 1}>]")

#
# Test 'reg'
#

0 comments on commit 998d7a0

Please sign in to comment.
You can’t perform that action at this time.