scripts/dts: add basic test for IO channel property
Test the new io-channel support Signed-off-by: Jim Paris <jim@jtan.com>
This commit is contained in:
parent
ca8d038e2d
commit
998d7a01dd
3 changed files with 37 additions and 0 deletions
14
scripts/dts/test-bindings/io-channel.yaml
Normal file
14
scripts/dts/test-bindings/io-channel.yaml
Normal file
|
@ -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 run():
|
|||
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'
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue