Skip to content

Commit

Permalink
refactor(shields): Use dynamic display PD for ZMK Uno.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Jan 29, 2024
1 parent f308ead commit 523d230
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
2 changes: 2 additions & 0 deletions app/boards/shields/zmk_uno/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ if SHIELD_ZMK_UNO_BASE
config SHIELD_ZMK_UNO_PM
bool "ZMK Uno Automatic Power Management"
default y
select ZMK_POWER_DOMAINS
select ZMK_POWER_DOMAINS_DYNAMIC_DEFAULT
select PM_DEVICE
select PM_DEVICE_POWER_DOMAIN
select PM_DEVICE_RUNTIME
Expand Down
22 changes: 4 additions & 18 deletions app/boards/shields/zmk_uno/zmk_uno.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,6 @@

&arduino_i2c {
status = "okay";

oled: ssd1306@3c {
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
label = "DISPLAY";
width = <128>;
height = <64>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <63>;
prechargep = <0x22>;

power-domain = <&core_power_domain>;
zephyr,pm-device-runtime-auto;
};
};

nice_view_spi: &arduino_spi {
Expand Down Expand Up @@ -68,11 +52,13 @@ nice_view_spi: &arduino_spi {
zmk,underglow = &led_strip;
zmk,matrix-transform = &matrix_transform;

zephyr,display = &oled;
zmk,display-default-power-domain = &core_power_domain;
};

core_power_domain: core_power_domain {
compatible = "power-domain-gpio";
// The "power-domain" compatible is needed for any PDs used for that have dynamic deps,
// e.g. for displays or RGB not assigned to the PD in the devicetree statically.
compatible = "power-domain-gpio", "power-domain";
startup-delay-us = <2000>;
off-on-delay-us = <2000>;
enable-gpios = <&arduino_header 0 GPIO_ACTIVE_LOW>;
Expand Down

0 comments on commit 523d230

Please sign in to comment.