aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2020-12-16 07:59:47 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2020-12-16 07:59:47 +0000
commit229a31e894c4e473b48c66d7a15ad3f1ddfbd8b1 (patch)
tree077ec668a9049cc991ab12926d79b34ef82c0799
parent3f3bc560b30289cb146161120d4d128238410c77 (diff)
downloadsrc-229a31e894c4e473b48c66d7a15ad3f1ddfbd8b1.tar.gz
src-229a31e894c4e473b48c66d7a15ad3f1ddfbd8b1.zip
MFC: r367349, r367854, r368365, r368374(by cem)
r367349: atkbdc(4): Add quirk for "System76 lemur Pro" laptops. Currently atkbdc(4) assumes all coreboot BIOSes belonging to Chromebooks and unconditionally sets a number of quirks to workaround known issues. Exclude "System76" laptops from this set as they appeared to be a traditional hardware ("lemur Pro" is a rebranded Clevo chassis) with coreboot firmware on board. KBDC_QUIRK_KEEP_ACTIVATED quirk activated for Chromebook platform makes keyboard on this devices inoperable. "Purism Librem" laptops may require the same exclusion too. PR: 250711 Reported by: nick.lott@gmail.com r367854: psm(4): Disable AUX multiplexer probing on all Lenovo laptops. Rudimentary AUX multiplexing support was added to kernel to make possible touchpad initialization on some HP EliteBook laptops with trackpoint. Disable multiplexer probing on all Lenovo laptops now as they use touchpad pass-through port rather than AUX multiplexer to connect trackpoint and at least two model (X120e and X121e) is known for getting PS/2 AUX port dysfunctional after switching back to hidden multiplexing mode. AUX MUX probing can be reenabled with setting of hw.psm.mux_disabled loader tunable to 0. PR: 249987 Reported by: jwb r368365: atkbd(4): Change quirk table end-of-list marker to NULL vendor/maker/product This fixes regression introduced in r367349 which effectively resulted in truncation of quirk table. PR: 250711 Submitted by: grembo Reported by: Matthias Apitz <guru@unixarea.de> r368374 (by cem): atkbd(4): Just use nitems() for quirk enumeration Reviewed by: imp, wulf Differential Revision: https://reviews.freebsd.org/D27489
Notes
Notes: svn path=/stable/12/; revision=368689
-rw-r--r--sys/dev/atkbdc/atkbdc.c7
-rw-r--r--sys/dev/atkbdc/atkbdcreg.h1
-rw-r--r--sys/dev/atkbdc/psm.c5
3 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/atkbdc/atkbdc.c b/sys/dev/atkbdc/atkbdc.c
index adf55ec54d1b..d9a6cfdcc3be 100644
--- a/sys/dev/atkbdc/atkbdc.c
+++ b/sys/dev/atkbdc/atkbdc.c
@@ -124,11 +124,12 @@ struct atkbdc_quirks {
};
static struct atkbdc_quirks quirks[] = {
+ {"coreboot", "System76", NULL, 0},
{"coreboot", NULL, NULL,
KBDC_QUIRK_KEEP_ACTIVATED | KBDC_QUIRK_IGNORE_PROBE_RESULT |
KBDC_QUIRK_RESET_AFTER_PROBE | KBDC_QUIRK_SETLEDS_ON_INIT},
-
- {NULL, NULL, NULL, 0}
+ /* KBDC hangs on Lenovo X120e and X121e after disabling AUX MUX */
+ {NULL, "LENOVO", NULL, KBDC_QUIRK_DISABLE_MUX_PROBE},
};
#define QUIRK_STR_MATCH(s1, s2) (s1 == NULL || \
@@ -142,7 +143,7 @@ atkbdc_getquirks(void)
char* maker = kern_getenv("smbios.system.maker");
char* product = kern_getenv("smbios.system.product");
- for (i=0; quirks[i].quirk != 0; ++i)
+ for (i = 0; i < nitems(quirks); i++)
if (QUIRK_STR_MATCH(quirks[i].bios_vendor, bios_vendor) &&
QUIRK_STR_MATCH(quirks[i].maker, maker) &&
QUIRK_STR_MATCH(quirks[i].product, product))
diff --git a/sys/dev/atkbdc/atkbdcreg.h b/sys/dev/atkbdc/atkbdcreg.h
index 43486cb6248f..b5f38676848c 100644
--- a/sys/dev/atkbdc/atkbdcreg.h
+++ b/sys/dev/atkbdc/atkbdcreg.h
@@ -211,6 +211,7 @@ typedef struct atkbdc_softc {
#define KBDC_QUIRK_IGNORE_PROBE_RESULT (1 << 1)
#define KBDC_QUIRK_RESET_AFTER_PROBE (1 << 2)
#define KBDC_QUIRK_SETLEDS_ON_INIT (1 << 3)
+#define KBDC_QUIRK_DISABLE_MUX_PROBE (1 << 4)
int aux_mux_enabled; /* active PS/2 multiplexing is enabled */
int aux_mux_port; /* current aux mux port */
} atkbdc_softc_t;
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index 6d9028b78644..9bce67f1326f 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -516,7 +516,7 @@ static int verbose = PSM_DEBUG;
static int synaptics_support = 1;
static int trackpoint_support = 1;
static int elantech_support = 1;
-static int mux_disabled = 0;
+static int mux_disabled = -1;
/* for backward compatibility */
#define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t)
@@ -6256,7 +6256,8 @@ enable_synaptics_mux(struct psm_softc *sc, enum probearg arg)
int active_ports_count = 0;
int active_ports_mask = 0;
- if (mux_disabled != 0)
+ if (mux_disabled == 1 || (mux_disabled == -1 &&
+ (kbdc->quirks & KBDC_QUIRK_DISABLE_MUX_PROBE) != 0))
return (FALSE);
version = enable_aux_mux(kbdc);