dts: bindings: provide generic yaml description for i2c-devices
Provide generic yaml description for i2c-devices such as sensors New yaml binding category 'parent/child' is added. It aims at binding two types of related node such as bus master and bus slave. In case of i2c-device object, parent property is 'bus' with value 'i2c'. In the mean time, i2c node gets child property bus. Master and slave bus values should match. As such, 'i2c' node is bus master and 'i2c-devices' nodes are bus slaves Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
e3fe3ebb3f
commit
b0568ad592
3 changed files with 44 additions and 0 deletions
|
@ -6,6 +6,15 @@ description: >
|
|||
Describe in free form text w/ spanning lines what you
|
||||
are describing
|
||||
|
||||
|
||||
< parent | child >:
|
||||
# parent/child is used to document implicit relation between nodes.
|
||||
# This information is required to generate parent related bits in child
|
||||
# attributes.
|
||||
# In case parent has 'bus', slave inherits some information from master.
|
||||
# parent and child should share same bus-type value.
|
||||
bus: <bus-type>
|
||||
|
||||
# properties will be the contents of the device tree node
|
||||
# property names must match the property names in the DT
|
||||
|
||||
|
|
32
dts/bindings/i2c/i2c-device.yaml
Normal file
32
dts/bindings/i2c/i2c-device.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
#
|
||||
# Copyright (c) 2017, Linaro Limited
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
---
|
||||
title: I2C Device Base Structure
|
||||
id: i2c-device
|
||||
version: 0.1
|
||||
|
||||
description: >
|
||||
This binding gives the base structures for all i2c devices
|
||||
|
||||
parent:
|
||||
bus: i2c
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
type: string
|
||||
category: required
|
||||
description: compatible strings
|
||||
reg:
|
||||
type: array
|
||||
description: address on i2c bus
|
||||
generation: define
|
||||
category: required
|
||||
label:
|
||||
type: string
|
||||
category: required
|
||||
description: Human readable string describing the device (used by Zephyr for API name)
|
||||
generation: define
|
||||
...
|
|
@ -6,6 +6,9 @@ version: 0.1
|
|||
description: >
|
||||
This binding gives the base structures for all I2C devices
|
||||
|
||||
child:
|
||||
bus: i2c
|
||||
|
||||
properties:
|
||||
"#address-cells":
|
||||
type: int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue