Skip to content

Commit

Permalink
dt-bindings: w1: Convert 1-Wire GPIO binding to a schema
Browse files Browse the repository at this point in the history
Bitbanged 1-Wire buses are supported by Linux thanks to their device
tree binding.

Now that we have the DT validation in place, let's convert the device
tree bindings for that driver over to a YAML schema.

Cc: Daniel Mack <zonque@gmail.com>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20210901091852.479202-39-maxime@cerno.tech
Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
Maxime Ripard authored and Rob Herring committed Sep 13, 2021
1 parent e978d52 commit dd2c898
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 27 deletions.
27 changes: 0 additions & 27 deletions Documentation/devicetree/bindings/w1/w1-gpio.txt

This file was deleted.

44 changes: 44 additions & 0 deletions Documentation/devicetree/bindings/w1/w1-gpio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/w1/w1-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Bitbanged GPIO 1-Wire Bus Device Tree Bindings

maintainers:
- Daniel Mack <zonque@gmail.com>

properties:
compatible:
const: w1-gpio

gpios:
minItems: 1
maxItems: 2
items:
- description: Data I/O pin
- description: Enable pin for an external pull-up resistor

linux,open-drain:
type: boolean
description: >
If specified, the data pin is considered in open-drain mode.
required:
- compatible
- gpios

additionalProperties:
type: object

examples:
- |
#include <dt-bindings/gpio/gpio.h>
onewire {
compatible = "w1-gpio";
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
};
...

0 comments on commit dd2c898

Please sign in to comment.