Skip to content

Commit 3fc27e7

Browse files
RuibinChangjhedberg
authored andcommitted
drivers: input: it8xxx2: resolve runtime assertion failure
When the kso[17:16] lines are enabled and `CONFIG_ASSERT` is configured, the following error occurs: "Input cannot be enabled for 'Open Drain', 'Open Source' modes without Output." To address this, this commit configures kso16 and kso17 as gpio output before applying the pinctrl settings. Tested with: no abnormal keyscan occurs during initialization Signed-off-by: Ruibin Chang <[email protected]> Signed-off-by: Ren Chen <[email protected]>
1 parent 3a4cc12 commit 3fc27e7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/input/input_ite_it8xxx2_kbd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ static int it8xxx2_kbd_init(const struct device *dev)
171171
* Bit[7:6] = 00b: Select alternate KSO function
172172
* Bit[2] = 1b: Enable the internal pull-up of KSO pin
173173
*
174-
* NOTE: Set input temporarily for gpio_pin_configure(), after
175-
* that pinctrl_apply_state() set to alternate function
176-
* immediately.
174+
* NOTE: Set (output | dt_flag) temporarily for kso16 and
175+
* kso17 pins, after that pinctrl_apply_state() set to
176+
* alternate function immediately.
177177
*/
178178
if (!(config->kso_ignore_mask & BIT(16))) {
179-
gpio_pin_configure_dt(&config->kso16_gpios, GPIO_INPUT);
179+
gpio_pin_configure_dt(&config->kso16_gpios, GPIO_OUTPUT);
180180
}
181181
if (common->col_size > 17 && !(config->kso_ignore_mask & BIT(17))) {
182-
gpio_pin_configure_dt(&config->kso17_gpios, GPIO_INPUT);
182+
gpio_pin_configure_dt(&config->kso17_gpios, GPIO_OUTPUT);
183183
}
184184
}
185185
/*

0 commit comments

Comments
 (0)