Skip to content

Commit

Permalink
feat(boards)!: refactor common layouts
Browse files Browse the repository at this point in the history
Removed the combined .dtsi file for each group of common layouts, and
split the position map across the files in each group. This makes
reading the position maps slightly more difficult, but it aligns the
common layouts with the keyboard-specific ones such as
foostan/corne.dtsi in that simply including each header adds the
layout, with no need to set status = "okay".
  • Loading branch information
joelspadin authored and petejohanson committed Oct 3, 2024
1 parent 73ca365 commit 36f1462
Show file tree
Hide file tree
Showing 35 changed files with 318 additions and 355 deletions.
9 changes: 4 additions & 5 deletions app/boards/arm/bt60/bt60_v1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

/dts-v1/;
#include "bt60.dtsi"
#include <layouts/common/60percent/60percent.dtsi>
#include <layouts/common/60percent/all1u.dtsi>
#include <layouts/common/60percent/ansi.dtsi>
#include <layouts/common/60percent/hhkb.dtsi>
#include <layouts/common/60percent/iso.dtsi>


/ {
Expand Down Expand Up @@ -102,21 +105,17 @@
};

&layout_60_ansi {
status = "okay";
transform = <&ansi_transform>;
};

&layout_60_iso {
status = "okay";
transform = <&iso_transform>;
};

&layout_60_all1u {
status = "okay";
transform = <&all_1u_transform>;
};

&layout_60_hhkb {
status = "okay";
transform = <&hhkb_transform>;
};
9 changes: 4 additions & 5 deletions app/boards/arm/ckp/bt60_v2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

/dts-v1/;
#include "ckp.dtsi"
#include <layouts/common/60percent/60percent.dtsi>
#include <layouts/common/60percent/all1u.dtsi>
#include <layouts/common/60percent/ansi.dtsi>
#include <layouts/common/60percent/hhkb.dtsi>
#include <layouts/common/60percent/iso.dtsi>


/ {
Expand Down Expand Up @@ -72,21 +75,17 @@
};

&layout_60_ansi {
status = "okay";
transform = <&ansi_transform>;
};

&layout_60_iso {
status = "okay";
transform = <&iso_transform>;
};

&layout_60_all1u {
status = "okay";
transform = <&all_1u_transform>;
};

&layout_60_hhkb {
status = "okay";
transform = <&hhkb_transform>;
};
9 changes: 4 additions & 5 deletions app/boards/arm/ckp/bt65_v1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

/dts-v1/;
#include "ckp.dtsi"
#include <layouts/common/65percent/65percent.dtsi>
#include <layouts/common/65percent/all1u.dtsi>
#include <layouts/common/65percent/ansi.dtsi>
#include <layouts/common/65percent/iso.dtsi>
#include <layouts/common/65percent/hhkb.dtsi>


/ {
Expand Down Expand Up @@ -72,21 +75,17 @@
};

&layout_65_ansi {
status = "okay";
transform = <&ansi_transform>;
};

&layout_65_iso {
status = "okay";
transform = <&iso_transform>;
};

&layout_65_all1u {
status = "okay";
transform = <&all_1u_transform>;
};

&layout_65_hhkb {
status = "okay";
transform = <&hhkb_transform>;
};
7 changes: 3 additions & 4 deletions app/boards/arm/ckp/bt75_v1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

/dts-v1/;
#include "ckp.dtsi"
#include <layouts/common/75percent/75percent.dtsi>
#include <layouts/common/75percent/all1u.dtsi>
#include <layouts/common/75percent/ansi.dtsi>
#include <layouts/common/75percent/iso.dtsi>


/ {
Expand Down Expand Up @@ -62,16 +64,13 @@
};

&layout_75_ansi {
status = "okay";
transform = <&ansi_transform>;
};

&layout_75_iso {
status = "okay";
transform = <&iso_transform>;
};

&layout_75_all1u {
status = "okay";
transform = <&all_1u_transform>;
};
7 changes: 3 additions & 4 deletions app/boards/arm/planck/planck_rev6.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include <st/f3/stm32f303c(b-c)tx-pinctrl.dtsi>
#include <dt-bindings/zmk/matrix_transform.h>

#include <layouts/common/ortho_4x12/ortho_4x12.dtsi>
#include <layouts/common/ortho_4x12/1x2u.dtsi>
#include <layouts/common/ortho_4x12/2x2u.dtsi>
#include <layouts/common/ortho_4x12/all1u.dtsi>


/ {
Expand Down Expand Up @@ -142,16 +144,13 @@ zephyr_udc0: &usb {
};

&layout_ortho_4x12_all1u {
status = "okay";
transform = <&layout_grid_transform>;
};

&layout_ortho_4x12_1x2u {
status = "okay";
transform = <&layout_mit_transform>;
};

&layout_ortho_4x12_2x2u {
status = "okay";
transform = <&layout_2x2u_transform>;
};
7 changes: 3 additions & 4 deletions app/boards/arm/preonic/preonic_rev3.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include <st/f3/stm32f303c(b-c)tx-pinctrl.dtsi>
#include <dt-bindings/zmk/matrix_transform.h>

#include <layouts/common/ortho_5x12/ortho_5x12.dtsi>
#include <layouts/common/ortho_5x12/1x2u.dtsi>
#include <layouts/common/ortho_5x12/2x2u.dtsi>
#include <layouts/common/ortho_5x12/all1u.dtsi>

/ {
model = "Preonic PCD, rev3";
Expand Down Expand Up @@ -134,16 +136,13 @@ zephyr_udc0: &usb {
};

&layout_ortho_5x12_all1u {
status = "okay";
transform = <&layout_grid_transform>;
};

&layout_ortho_5x12_1x2u {
status = "okay";
transform = <&layout_mit_transform>;
};

&layout_ortho_5x12_2x2u {
status = "okay";
transform = <&layout_2x2u_transform>;
};
72 changes: 0 additions & 72 deletions app/dts/layouts/common/60percent/60percent.dtsi

This file was deleted.

16 changes: 15 additions & 1 deletion app/dts/layouts/common/60percent/all1u.dtsi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <layouts/common/60percent/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
Expand Down Expand Up @@ -74,4 +75,17 @@
, <&key_physical_attrs 100 100 1400 400 0 0 0>
;
};
};
};

&layouts_common_60_percent_position_map {
layout_60_all1u {
physical-layout = <&layout_60_all1u>;
positions
= < 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14>
, <15 16 17 18 19 20 21 22 23 24 25 26 27 28>
, <29 30 31 32 33 34 35 36 37 38 39 40 41>
, <42 43 44 45 46 47 48 49 50 51 52 53 54 55 56>
, <57 58 59 60 61 62 64 63 65>
;
};
};
16 changes: 15 additions & 1 deletion app/dts/layouts/common/60percent/ansi.dtsi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <layouts/common/60percent/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
Expand Down Expand Up @@ -69,4 +70,17 @@
, <&key_physical_attrs 125 100 1375 400 0 0 0>
;
};
};
};

&layouts_common_60_percent_position_map {
layout_60_ansi {
physical-layout = <&layout_60_ansi>;
positions
= < 0 1 2 3 4 5 6 7 8 9 10 11 12 13 61>
, <14 15 16 17 18 19 20 21 22 23 24 25 26 27>
, <28 29 30 31 32 33 34 35 36 37 38 39 40>
, <41 62 42 43 44 45 46 47 48 49 50 51 52 63 64>
, <53 54 55 56 57 58 60 59 65>
;
};
};
16 changes: 15 additions & 1 deletion app/dts/layouts/common/60percent/hhkb.dtsi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <layouts/common/60percent/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
Expand Down Expand Up @@ -68,4 +69,17 @@
, <&key_physical_attrs 150 100 1350 400 0 0 0>
;
};
};
};

&layouts_common_60_percent_position_map {
layout_60_hhkb {
physical-layout = <&layout_60_hhkb>;
positions
= < 0 1 2 3 4 5 6 7 8 9 10 11 12 13 60>
, <14 15 16 17 18 19 20 21 22 23 24 25 26 27>
, <28 29 30 31 32 33 34 35 36 37 38 39 40>
, <41 61 42 43 44 45 46 47 48 49 50 51 52 62 63>
, <53 54 55 56 57 58 59 64 65>
;
};
};
16 changes: 15 additions & 1 deletion app/dts/layouts/common/60percent/iso.dtsi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <layouts/common/60percent/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
Expand Down Expand Up @@ -70,4 +71,17 @@
, <&key_physical_attrs 125 100 1375 400 0 0 0>
;
};
};
};

&layouts_common_60_percent_position_map {
layout_60_iso {
physical-layout = <&layout_60_iso>;
positions
= < 0 1 2 3 4 5 6 7 8 9 10 11 12 13 62>
, <14 15 16 17 18 19 20 21 22 23 24 25 26 63>
, <27 28 29 30 31 32 33 34 35 36 37 38 40>
, <41 42 43 44 45 46 47 48 49 50 51 52 53 64 65>
, <54 55 56 57 58 59 61 60 39>
;
};
};
7 changes: 7 additions & 0 deletions app/dts/layouts/common/60percent/position_map.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/ {
layouts_common_60_percent_position_map: layouts_common_60_percent_position_map {
compatible = "zmk,physical-layout-position-map";

complete;
};
};
Loading

0 comments on commit 36f1462

Please sign in to comment.