Skip to content

Commit

Permalink
WIP: 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 committed Sep 30, 2024
1 parent e68abe5 commit 9c8dd43
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 86 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>;
};
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;
};
};

0 comments on commit 9c8dd43

Please sign in to comment.