mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
Adding w1-gpio device tree overlays
N.B. Requires firmware supporting multi-target overrides
w1-gpio-overlay:
Use if a pullup pin is not required.
Parameters:
gpiopin=<i/o pin> // default 4
w1-gpio-pullup-overlay:
Use if a pullup pin is required.
Parameters:
gpiopin=<i/o pin> // default 4
pullup=<pullup pin> // default 5
This commit is contained in:
37
arch/arm/boot/dts/w1-gpio-overlay.dts
Normal file
37
arch/arm/boot/dts/w1-gpio-overlay.dts
Normal file
@@ -0,0 +1,37 @@
|
||||
// Definitions for lirc-rpi module
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
|
||||
w1: onewire@0 {
|
||||
compatible = "w1-gpio";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&w1_pins>;
|
||||
gpios = <&gpio 4 0>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
w1_pins: w1_pins {
|
||||
brcm,pins = <4>;
|
||||
brcm,function = <0>; // in (initially)
|
||||
brcm,pull = <0>; // off
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
gpiopin = <&w1>,"gpios:4",
|
||||
<&w1_pins>,"brcm,pins:0";
|
||||
};
|
||||
};
|
||||
39
arch/arm/boot/dts/w1-gpio-pullup-overlay.dts
Normal file
39
arch/arm/boot/dts/w1-gpio-pullup-overlay.dts
Normal file
@@ -0,0 +1,39 @@
|
||||
// Definitions for lirc-rpi module
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
|
||||
w1: onewire@0 {
|
||||
compatible = "w1-gpio";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&w1_pins>;
|
||||
gpios = <&gpio 4 0>, <&gpio 5 1>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&gpio>;
|
||||
__overlay__ {
|
||||
w1_pins: w1_pins {
|
||||
brcm,pins = <4 5>;
|
||||
brcm,function = <0 1>; // in out
|
||||
brcm,pull = <0 0>; // off off
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
gpiopin = <&w1>,"gpios:4",
|
||||
<&w1_pins>,"brcm,pins:0";
|
||||
pullup = <&w1>,"gpios:16",
|
||||
<&w1_pins>,"brcm,pins:4";
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user