Commit 41288dfa authored by Marc Dietrich's avatar Marc Dietrich Committed by Greg Kroah-Hartman
Browse files

staging: nvec: make keyboard init synchronous



Currently, we are constantly sending commands to the EC without waiting for them to be
executed. This can lead to confusion, especially if we initialize several different devices
one after the other.
To avoid this, we are switching from asynchronous to synchronous command transmission.

Signed-off-by: default avatarMarc Dietrich <marvin24@gmx.de>
Link: https://lore.kernel.org/r/20240406123123.37148-3-marvin24@gmx.de


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 244b6e92
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -148,15 +148,16 @@ static int nvec_kbd_probe(struct platform_device *pdev)
	nvec_register_notifier(nvec, &keys_dev.notifier, 0);

	/* Enable keyboard */
	nvec_write_async(nvec, enable_kbd, 2);
	nvec_write_sync(nvec, enable_kbd, 2, NULL);

	/* configures wake on special keys */
	nvec_write_async(nvec, cnfg_wake, 4);
	nvec_write_sync(nvec, cnfg_wake, 4, NULL);

	/* enable wake key reporting */
	nvec_write_async(nvec, cnfg_wake_key_reporting, 3);
	nvec_write_sync(nvec, cnfg_wake_key_reporting, 3, NULL);

	/* Disable caps lock LED */
	nvec_write_async(nvec, clear_leds, sizeof(clear_leds));
	nvec_write_sync(nvec, clear_leds, sizeof(clear_leds), NULL);

	return 0;
}