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:
Erwan Gouriou 2017-10-19 16:31:44 +02:00 committed by Kumar Gala
commit b0568ad592
3 changed files with 44 additions and 0 deletions

View file

@ -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

View 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
...

View file

@ -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