mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-14 06:41:36 +08:00
WIP: device tree MVP
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
# Copyright 2019-2020 Peter Bigot Consulting, LLC
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: GPIO-controlled regulators
|
||||
|
||||
include: regulator.yaml
|
||||
|
||||
# NOTE: The driver supports "regulator-fixed-sync" as a specializing
|
||||
# variant when it's known that the GPIO state change operations are
|
||||
# isr-ok and not sleep, and both startup and off-on delays are zero.
|
||||
# This bypasses the asynchronous onoff manager which optimizes both time
|
||||
# and memory use.
|
||||
#
|
||||
# To enable this use both:
|
||||
# compatible = "regulator-fixed-sync", "regulator-fixed";
|
||||
#
|
||||
|
||||
compatible: "regulator-fixed"
|
||||
|
||||
properties:
|
||||
label:
|
||||
required: true
|
||||
|
||||
regulator-name:
|
||||
type: string
|
||||
required: true
|
||||
description: Descriptive name for regulator outputs.
|
||||
|
||||
enable-gpios:
|
||||
type: phandle-array
|
||||
required: true
|
||||
description: |
|
||||
GPIO to use to enable/disable the regulator.
|
||||
|
||||
Unlike the gpio property in the Linux bindings this array must
|
||||
provide the GPIO polarity and open-drain status in the phandle
|
||||
selector. The Linux enable-active-high and gpio-open-drain
|
||||
properties are not valid for Zephyr devicetree files.
|
||||
|
||||
startup-delay-us:
|
||||
type: int
|
||||
required: false
|
||||
default: 0
|
||||
description: Startup time, in microseconds
|
||||
|
||||
off-on-delay-us:
|
||||
type: int
|
||||
required: false
|
||||
default: 0
|
||||
description: Off delay time, in microseconds
|
||||
@@ -0,0 +1,92 @@
|
||||
# Copyright (c), 2021 NXP
|
||||
# SPDX -License-Identifier: Apache-2.0
|
||||
|
||||
description: PMIC controlled regulator
|
||||
|
||||
include: regulator.yaml
|
||||
|
||||
compatible: "regulator-pmic"
|
||||
|
||||
properties:
|
||||
label:
|
||||
required: false
|
||||
voltage-range:
|
||||
type: array
|
||||
required: true
|
||||
description: |
|
||||
array of voltage values in uV, followed by the register value that
|
||||
must be written to enable the voltage. For example, [3300000, 0x3]
|
||||
denotes a value of 0x3 must be written to the register to set 3.3V
|
||||
num-voltages:
|
||||
type: int
|
||||
required: true
|
||||
description: number of voltages present in the voltage-range array.
|
||||
vsel-reg:
|
||||
type: int
|
||||
required: true
|
||||
description: I2C register to write voltage selection value to
|
||||
vsel-mask:
|
||||
type: int
|
||||
required: true
|
||||
description: |
|
||||
Mask to apply to the voltage range value when written to vsel
|
||||
register
|
||||
enable-reg:
|
||||
type: int
|
||||
required: true
|
||||
description: I2C register to write enable value to
|
||||
enable-mask:
|
||||
type: int
|
||||
required: true
|
||||
description: |
|
||||
Mask to apply to the enable bit (either 1 for enabled,
|
||||
or 0 for disabled) when writing it to the I2C enable register.
|
||||
enable-val:
|
||||
type: int
|
||||
required: true
|
||||
description: |
|
||||
value to apply enable-mask to, and write to enable-reg in order
|
||||
to enable the regulator output.
|
||||
min-uV:
|
||||
type: int
|
||||
required: true
|
||||
description: |
|
||||
Minimum voltage in microvolts that this regulator supports
|
||||
max-uV:
|
||||
type: int
|
||||
required: true
|
||||
description: |
|
||||
Maximum voltage in microvolts that this regulator supports
|
||||
enable-inverted:
|
||||
type: boolean
|
||||
required: false
|
||||
description: |
|
||||
If the enable bit should be zero to turn the regulator on, add this
|
||||
property.
|
||||
current-levels:
|
||||
type: array
|
||||
required: false
|
||||
description: |
|
||||
Array of current limit values in uA, followed by the register value
|
||||
that must be written to enable the current limit. For example,
|
||||
[800000, 0x3] denotes a value of 0x3 must be written to the register
|
||||
to set a current limit of 800mA
|
||||
num-current-levels:
|
||||
type: int
|
||||
required: false
|
||||
default: 0
|
||||
description: |
|
||||
Number of current limit levels this regulator supports. If left as
|
||||
default, regulator current support will be disabled.
|
||||
ilim-reg:
|
||||
type: int
|
||||
required: false
|
||||
description: |
|
||||
Register to write the register value given in current-levels into
|
||||
to set the current limit
|
||||
ilim-mask:
|
||||
type: int
|
||||
required: false
|
||||
description: |
|
||||
Mask to apply to the current-levels value before writing it to the
|
||||
ilim-reg value to set the current limit
|
||||
@@ -0,0 +1,17 @@
|
||||
# Copyright 2019-2020, Peter Bigot Consulting, LLC
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Voltage/Current Regulators
|
||||
|
||||
include: [base.yaml, power.yaml]
|
||||
|
||||
# Linux defines several dozen properties. We're providing only the ones
|
||||
# currently useful to Zephyr.
|
||||
properties:
|
||||
regulator-always-on:
|
||||
type: boolean
|
||||
description: regulator should always be on
|
||||
|
||||
regulator-boot-on:
|
||||
type: boolean
|
||||
description: regulator should be turned on at startup
|
||||
Reference in New Issue
Block a user