Commit b0568ad5 authored by Erwan Gouriou's avatar Erwan Gouriou Committed by Kumar Gala
Browse files

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: default avatarErwan Gouriou <erwan.gouriou@linaro.org>
parent e3fe3ebb
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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 −0
Original line number Diff line number Diff line
#
# 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
...
+3 −0
Original line number Diff line number Diff line
@@ -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