From: Alexander Courtis Date: Tue, 26 Apr 2022 01:55:22 +0000 (+0000) Subject: AttrLidSwitchReliability quirk default unreliable->reliable X-Git-Tag: 1.21.0~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0813f4825568fb911421799a286ac889d093cb3;p=platform%2Fupstream%2Flibinput.git AttrLidSwitchReliability quirk default unreliable->reliable --- diff --git a/doc/user/device-quirks.rst b/doc/user/device-quirks.rst index 3d4fe83b..7c220282 100644 --- a/doc/user/device-quirks.rst +++ b/doc/user/device-quirks.rst @@ -71,7 +71,7 @@ devices. :: $ libinput quirks list /dev/input/event19 $ libinput quirks list /dev/input/event0 - AttrLidSwitchReliability=reliable + AttrLidSwitchReliability=unreliable The device `event19` does not have any quirks assigned. @@ -162,10 +162,11 @@ AttrPressureRange=N:M, AttrPalmPressureThreshold=O, AttrThumbPressureThreshold=P trigger a release (M), when a palm touch is triggered (O) and when a thumb touch is triggered (P). O > P > N > M. See :ref:`touchpad_pressure_hwdb` for more details. -AttrLidSwitchReliability=reliable|write_open - Indicates the reliability of the lid switch. This is a string enum. Do not - use "reliable" for any specific device. Very few devices need this, if in - doubt do not set. See :ref:`switches_lid` for details. +AttrLidSwitchReliability=reliable|unreliable|write_open + Indicates the reliability of the lid switch. This is a string enum. + Very few devices need this, if in doubt do not set. See :ref:`switches_lid` + for details. libinput 1.21.0 changed the default from unreliable to + reliable, which may be removed from local overrides. AttrKeyboardIntegration=internal|external Indicates the integration of the keyboard. This is a string enum. Generally only needed for USB keyboards. diff --git a/doc/user/tools.rst b/doc/user/tools.rst index 602319a0..85b207c0 100644 --- a/doc/user/tools.rst +++ b/doc/user/tools.rst @@ -326,7 +326,7 @@ Listing quirks assigned to a device The ``libinput quirks`` tool can show quirks applied for any given device. :: $ libinput quirks list /dev/input/event0 - AttrLidSwitchReliability=reliable + AttrLidSwitchReliability=unreliable If the tool's output is empty, no quirk is applied. See :ref:`device-quirks` for more information. diff --git a/quirks/10-generic-lid.quirks b/quirks/10-generic-lid.quirks deleted file mode 100644 index 1c20acd2..00000000 --- a/quirks/10-generic-lid.quirks +++ /dev/null @@ -1,11 +0,0 @@ -# Do not edit this file, it will be overwritten on update - -[Lid Switch Ct9] -MatchName=*Lid Switch* -MatchDMIModalias=dmi:*:ct9:* -AttrLidSwitchReliability=reliable - -[Lid Switch Ct10] -MatchName=*Lid Switch* -MatchDMIModalias=dmi:*:ct10:* -AttrLidSwitchReliability=reliable diff --git a/src/evdev.c b/src/evdev.c index 3c31b59a..38a0f2f9 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1007,13 +1007,13 @@ evdev_read_switch_reliability_prop(struct evdev_device *device) quirks = evdev_libinput_context(device)->quirks; q = quirks_fetch_for_device(quirks, device->udev_device); if (!q || !quirks_get_string(q, QUIRK_ATTR_LID_SWITCH_RELIABILITY, &prop)) { - r = RELIABILITY_UNKNOWN; + r = RELIABILITY_RELIABLE; } else if (!parse_switch_reliability_property(prop, &r)) { evdev_log_error(device, "%s: switch reliability set to unknown value '%s'\n", device->devname, prop); - r = RELIABILITY_UNKNOWN; + r = RELIABILITY_RELIABLE; } else if (r == RELIABILITY_WRITE_OPEN) { evdev_log_info(device, "will write switch open events\n"); } diff --git a/src/quirks.c b/src/quirks.c index 9c5efaa6..a5eb2e79 100644 --- a/src/quirks.c +++ b/src/quirks.c @@ -728,7 +728,8 @@ parse_attr(struct quirks_context *ctx, } else if (streq(key, quirk_get_name(QUIRK_ATTR_LID_SWITCH_RELIABILITY))) { p->id = QUIRK_ATTR_LID_SWITCH_RELIABILITY; if (!streq(value, "reliable") && - !streq(value, "write_open")) + !streq(value, "write_open") && + !streq(value, "unreliable")) goto out; p->type = PT_STRING; p->value.s = safe_strdup(value); diff --git a/src/util-prop-parsers.c b/src/util-prop-parsers.c index 598e40c9..20d301f8 100644 --- a/src/util-prop-parsers.c +++ b/src/util-prop-parsers.c @@ -209,12 +209,14 @@ parse_switch_reliability_property(const char *prop, enum switch_reliability *reliability) { if (!prop) { - *reliability = RELIABILITY_UNKNOWN; + *reliability = RELIABILITY_RELIABLE; return true; } if (streq(prop, "reliable")) *reliability = RELIABILITY_RELIABLE; + else if (streq(prop, "unreliable")) + *reliability = RELIABILITY_UNRELIABLE; else if (streq(prop, "write_open")) *reliability = RELIABILITY_WRITE_OPEN; else diff --git a/src/util-prop-parsers.h b/src/util-prop-parsers.h index 8fbeacd0..71789141 100644 --- a/src/util-prop-parsers.h +++ b/src/util-prop-parsers.h @@ -49,8 +49,8 @@ bool parse_tpkbcombo_layout_poperty(const char *prop, enum tpkbcombo_layout *layout); enum switch_reliability { - RELIABILITY_UNKNOWN, RELIABILITY_RELIABLE, + RELIABILITY_UNRELIABLE, RELIABILITY_WRITE_OPEN, }; diff --git a/test/test-utils.c b/test/test-utils.c index 46444d8a..0ae3668f 100644 --- a/test/test-utils.c +++ b/test/test-utils.c @@ -402,7 +402,8 @@ START_TEST(reliability_prop_parser) enum switch_reliability reliability; } tests[] = { { "reliable", true, RELIABILITY_RELIABLE }, - { "unreliable", false, 0 }, + { "unreliable", true, RELIABILITY_UNRELIABLE }, + { "write_open", true, RELIABILITY_WRITE_OPEN }, { "", false, 0 }, { "0", false, 0 }, { "1", false, 0 }, @@ -424,7 +425,7 @@ START_TEST(reliability_prop_parser) success = parse_switch_reliability_property(NULL, &r); ck_assert(success == true); - ck_assert_int_eq(r, RELIABILITY_UNKNOWN); + ck_assert_int_eq(r, RELIABILITY_RELIABLE); success = parse_switch_reliability_property("foo", NULL); ck_assert(success == false);