Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added device tree supporting code and cleaning up code following Codi… #11

Open
wants to merge 1 commit into
base: rpi-4.1.y
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += rpi-ft5406-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += rpi-proto-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += rpi-power-switch-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += rpi-sense-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += sdio-overlay.dtb
Expand Down
10 changes: 10 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,16 @@ Load: dtoverlay=rpi-ft5406
Params: <None>


Name: rpi-power-switch
Info: Raspberry Pi Linux shutdown button driver
Load: dtoverlay=rpi-power-switch,<param>=<val>
Params: gpio_pin GPIO Pin number
{default 22}

mode 0 for pushbutton, 1 for on/off switch
{default button}


Name: rpi-proto
Info: Configures the RPi Proto audio card
Load: dtoverlay=rpi-proto
Expand Down
39 changes: 39 additions & 0 deletions arch/arm/boot/dts/overlays/rpi-power-switch-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Definitions for rpi-power-switch module
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";

fragment@0 {
target-path = "/";
__overlay__ {
rpi_power_switch: rpi_power_switch {
compatible = "rpi-power-switch";
pinctrl-names = "default";
pinctrl-0 = <&rpi_power_switch_pins>;
gpios = <&gpio 22 0>;
button_mode = <0>;
input;
force;
};
};
};

fragment@1 {
target = <&gpio>;
__overlay__ {
rpi_power_switch_pins: rpi_power_switch_pins {
brcm,pins = <22>;
brcm,function = <0>; // in
brcm,pull = <2>; // pull-up
};
};
};

__overrides__ {
gpio_pin = <&rpi_power_switch>,"gpios:4",
<&rpi_power_switch_pins>,"brcm,pins:0";
mode = <&rpi_power_switch>,"button_mode:0";
};
};
Loading