Skip to content

Commit 2bb8d48

Browse files
JohnAZoidbergkiram9
authored andcommitted
fwk: input_module: Allow full-width module in any location
Fixes: fwk-main 20999ff Fixes: fwk-tulip-29169 d98acb5 The existing logic goes through the top-row pogos from left to right and skips the ones that are covered. This does not work with a full-width inputmodule that is not connected to the left-most pogo. I didn't consider that the full-width module can have its connector on any of the pogos, because all of our official modules have them on the very left of the module. Customers are building modules and reporting issues. Add another loop that goes through every connector and returns true if a full-width module is connected to any pogo. To keep the logic simple, I also moved the touchpad check to the beginning, then the last loop can just return. > framework_tool --inputdeck Chassis Closed: true Input Deck State: On Touchpad present: true SLEEP# GPIO high: true Positions: Pos 0: Disconnected Pos 1: FullWidth Pos 2: Disconnected Pos 3: Disconnected Pos 4: Disconnected ec:~> inputdeck Deck state: ON C-Deck status 0 = 15 2813 mV [X - - - -] [Disconnected] C-Deck status 1 = 6 907 mV [- X - - -] [Generic Full Width] C-Deck status 2 = 15 2813 mV [- - X - -] [Disconnected] C-Deck status 3 = 15 2813 mV [- - - X -] [Disconnected] C-Deck status 4 = 15 2813 mV [- - - - X] [Disconnected] C-Deck status 5 = 13 2505 mV [Touchpad ] [Touchpad] C-Deck status 6 = 15 2813 mV [Toprow disc.] [Disconnected] C-Deck status 7 = 15 2813 mV [Hubboard ] [Disconnected] Input module Overcurrent Events: 0 BRANCH=fwk-tulip-29169 BUG=Full-width input module connected not to left-most pogo does not enable input deck power TEST=Keyboard/touchpad works with full-width inputmodule connected TEST=`framework_tool --inputdeck` TEST=EC console `inputdeck` command Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent d2be67b commit 2bb8d48

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

zephyr/program/framework/lotus/src/input_module.c

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,33 @@ bool input_deck_is_fully_populated(void)
123123
{
124124
int i;
125125

126+
/* All modules connect through the hubboard */
126127
if (hub_board_id[HUBBOARD] == INPUT_MODULE_SHORT ||
127128
hub_board_id[HUBBOARD] == INPUT_MODULE_DISCONNECTED) {
128129
return false;
129130
}
131+
132+
/* Touchpad is either present or not */
133+
if (hub_board_id[TOUCHPAD] != INPUT_MODULE_TOUCHPAD) {
134+
return false;
135+
}
136+
137+
/* The full-width module covers the whole input deck top row,
138+
* but unlike our other modules the connector does not have to be at
139+
* the left edge of the module - it can be anywhere.
140+
*/
141+
for (i = 0; i <= TOP_ROW_4; i++) {
142+
if (hub_board_id[i] == INPUT_MODULE_FULL_WIDTH)
143+
return true;
144+
}
145+
146+
/* Go through the input deck top row from left to right,
147+
* when detecting a module, jump over all empty slots that the module covers.
148+
* If the end is reached, the deck is fully covered.
149+
* If any slot after a module is empty, something is missing.
150+
*/
130151
for (i = 0; i <= TOP_ROW_4;) {
131152
switch (hub_board_id[i]) {
132-
case INPUT_MODULE_FULL_WIDTH:
133-
i += 5;
134-
break;
135153
case INPUT_MODULE_GENERIC_A:
136154
case INPUT_MODULE_KEYBOARD_A:
137155
i += 3;
@@ -148,10 +166,6 @@ bool input_deck_is_fully_populated(void)
148166
}
149167
}
150168

151-
if (hub_board_id[TOUCHPAD] != INPUT_MODULE_TOUCHPAD) {
152-
return false;
153-
}
154-
155169
return true;
156170
}
157171

0 commit comments

Comments
 (0)