Lines Matching +full:bool +full:- +full:property
24 /* This has the hallmarks of a library to make it re-usable from the tests
25 * and from the list-quirks tool. It doesn't have all of the features from a
48 #include "util-list.h"
78 * Generic value holder for the property types we support. The type
82 struct property { struct
89 bool b;
148 uint32_t product[64]; /* zero-terminated */
165 bool has_match; /* to check for empty sections */
166 bool has_property; /* to check for empty sections */
182 struct property **properties;
220 if (ctx->log_type == QLOG_MOUSED_LOGGING) in quirk_log_msg_va()
229 ctx->log_handler(priority, in quirk_log_msg_va()
359 static inline struct property *
362 struct property *p; in property_new()
365 p->refcount = 1; in property_new()
366 list_init(&p->link); in property_new()
371 static inline struct property *
372 property_ref(struct property *p) in property_ref()
374 assert(p->refcount > 0); in property_ref()
375 p->refcount++; in property_ref()
379 static inline struct property *
380 property_unref(struct property *p) in property_unref()
384 assert(p->refcount > 0); in property_unref()
385 p->refcount--; in property_unref()
390 /* Separate call so we can verify that the caller unrefs the property
394 property_cleanup(struct property *p) in property_cleanup()
398 assert(p->refcount == 0); in property_cleanup()
400 list_remove(&p->link); in property_cleanup()
401 if (p->type == PT_STRING) in property_cleanup()
402 free(p->value.s); in property_cleanup()
476 /* devicetree/base/compatible has multiple null-terminated entries in init_dt()
493 xasprintf(&s->name, "%s (%s)", name, basename(path_dup)); in section_new()
495 list_init(&s->link); in section_new()
496 list_init(&s->properties); in section_new()
504 struct property *p; in section_destroy()
506 free(s->name); in section_destroy()
507 free(s->match.name); in section_destroy()
508 free(s->match.uniq); in section_destroy()
509 free(s->match.dmi); in section_destroy()
510 free(s->match.dt); in section_destroy()
512 list_for_each_safe(p, &s->properties, link) in section_destroy()
515 assert(list_empty(&s->properties)); in section_destroy()
517 list_remove(&s->link); in section_destroy()
521 static inline bool
547 static bool
556 if ((s_)->match.bits & (bit_)) goto out; \ in parse_match()
557 (s_)->match.bits |= (bit_); \ in parse_match()
564 s->match.name = safe_strdup(value); in parse_match()
567 s->match.uniq = safe_strdup(value); in parse_match()
571 s->match.bus = BT_USB; in parse_match()
573 s->match.bus = BT_BLUETOOTH; in parse_match()
575 s->match.bus = BT_PS2; in parse_match()
577 s->match.bus = BT_RMI; in parse_match()
579 s->match.bus = BT_I2C; in parse_match()
581 s->match.bus = BT_SPI; in parse_match()
591 s->match.vendor = vendor; in parse_match()
593 unsigned int product[ARRAY_LENGTH(s->match.product)] = {0}; in parse_match()
594 const size_t max = ARRAY_LENGTH(s->match.product) - 1; in parse_match()
604 memcpy(s->match.product, product, sizeof(product)); in parse_match()
612 s->match.version = version; in parse_match()
618 s->name); in parse_match()
621 s->match.dmi = safe_strdup(value); in parse_match()
625 s->match.udev_type = UDEV_TOUCHPAD; in parse_match()
627 s->match.udev_type = UDEV_MOUSE; in parse_match()
629 s->match.udev_type = UDEV_POINTINGSTICK; in parse_match()
631 s->match.udev_type = UDEV_KEYBOARD; in parse_match()
633 s->match.udev_type = UDEV_JOYSTICK; in parse_match()
635 s->match.udev_type = UDEV_TABLET; in parse_match()
636 else if (streq(value, "tablet-pad")) in parse_match()
637 s->match.udev_type = UDEV_TABLET_PAD; in parse_match()
642 s->match.dt = safe_strdup(value); in parse_match()
649 s->has_match = true; in parse_match()
664 static bool
670 bool b; in parse_model()
680 struct property *p = property_new(); in parse_model()
681 p->id = q, in parse_model()
682 p->type = PT_BOOL; in parse_model()
683 p->value.b = b; in parse_model()
684 list_append(&s->properties, &p->link); in parse_model()
685 s->has_property = true; in parse_model()
690 qlog_error(ctx, "Unknown key %s in %s\n", key, s->name); in parse_model()
706 static inline bool
712 struct property *p = property_new(); in parse_attr()
713 bool rc = false; in parse_attr()
717 bool b; in parse_attr()
721 p->id = QUIRK_ATTR_SIZE_HINT; in parse_attr()
724 p->type = PT_DIMENSION; in parse_attr()
725 p->value.dim = dim; in parse_attr()
728 p->id = QUIRK_ATTR_TOUCH_SIZE_RANGE; in parse_attr()
731 p->type = PT_RANGE; in parse_attr()
732 p->value.range = range; in parse_attr()
735 p->id = QUIRK_ATTR_PALM_SIZE_THRESHOLD; in parse_attr()
738 p->type = PT_UINT; in parse_attr()
739 p->value.u = v; in parse_attr()
742 p->id = QUIRK_ATTR_LID_SWITCH_RELIABILITY; in parse_attr()
747 p->type = PT_STRING; in parse_attr()
748 p->value.s = safe_strdup(value); in parse_attr()
751 p->id = QUIRK_ATTR_KEYBOARD_INTEGRATION; in parse_attr()
754 p->type = PT_STRING; in parse_attr()
755 p->value.s = safe_strdup(value); in parse_attr()
758 p->id = QUIRK_ATTR_TRACKPOINT_INTEGRATION; in parse_attr()
761 p->type = PT_STRING; in parse_attr()
762 p->value.s = safe_strdup(value); in parse_attr()
765 p->id = QUIRK_ATTR_TPKBCOMBO_LAYOUT; in parse_attr()
768 p->type = PT_STRING; in parse_attr()
769 p->value.s = safe_strdup(value); in parse_attr()
772 p->id = QUIRK_ATTR_PRESSURE_RANGE; in parse_attr()
775 p->type = PT_RANGE; in parse_attr()
776 p->value.range = range; in parse_attr()
779 p->id = QUIRK_ATTR_PALM_PRESSURE_THRESHOLD; in parse_attr()
782 p->type = PT_UINT; in parse_attr()
783 p->value.u = v; in parse_attr()
786 p->id = QUIRK_ATTR_RESOLUTION_HINT; in parse_attr()
789 p->type = PT_DIMENSION; in parse_attr()
790 p->value.dim = dim; in parse_attr()
793 p->id = QUIRK_ATTR_TRACKPOINT_MULTIPLIER; in parse_attr()
796 p->type = PT_DOUBLE; in parse_attr()
797 p->value.d = d; in parse_attr()
800 p->id = QUIRK_ATTR_USE_VELOCITY_AVERAGING; in parse_attr()
803 p->type = PT_BOOL; in parse_attr()
804 p->value.b = b; in parse_attr()
807 p->id = QUIRK_ATTR_TABLET_SMOOTHING; in parse_attr()
810 p->type = PT_BOOL; in parse_attr()
811 p->value.b = b; in parse_attr()
814 p->id = QUIRK_ATTR_THUMB_PRESSURE_THRESHOLD; in parse_attr()
817 p->type = PT_UINT; in parse_attr()
818 p->value.u = v; in parse_attr()
821 p->id = QUIRK_ATTR_THUMB_SIZE_THRESHOLD; in parse_attr()
824 p->type = PT_UINT; in parse_attr()
825 p->value.u = v; in parse_attr()
828 p->id = QUIRK_ATTR_MSC_TIMESTAMP; in parse_attr()
831 p->type = PT_STRING; in parse_attr()
832 p->value.s = safe_strdup(value); in parse_attr()
838 p->id = QUIRK_ATTR_EVENT_CODE; in parse_attr()
845 p->value.tuples.tuples[i].first = events[i].type; in parse_attr()
846 p->value.tuples.tuples[i].second = events[i].code; in parse_attr()
847 p->value.tuples.tuples[i].third = events[i].value; in parse_attr()
849 p->value.tuples.ntuples = nevents; in parse_attr()
850 p->type = PT_TUPLES; in parse_attr()
857 p->id = QUIRK_ATTR_INPUT_PROP; in parse_attr()
864 p->value.tuples.tuples[i].first = props[i].prop; in parse_attr()
865 p->value.tuples.tuples[i].second = props[i].enabled; in parse_attr()
870 qlog_error(ctx, "Unknown key %s in %s\n", key, s->name); in parse_attr()
874 list_append(&s->properties, &p->link); in parse_attr()
875 s->has_property = true; in parse_attr()
893 static inline bool
899 struct property *p = property_new(); in parse_moused()
900 bool rc = false; in parse_moused()
905 bool b; in parse_moused()
909 p->id = MOUSED_GRAB_DEVICE; in parse_moused()
912 p->type = PT_BOOL; in parse_moused()
913 p->value.b = b; in parse_moused()
916 p->id = MOUSED_IGNORE_DEVICE; in parse_moused()
919 p->type = PT_BOOL; in parse_moused()
920 p->value.b = b; in parse_moused()
923 p->id = MOUSED_CLICK_THRESHOLD; in parse_moused()
926 p->type = PT_UINT; in parse_moused()
927 p->value.u = v; in parse_moused()
930 p->id = MOUSED_DRIFT_TERMINATE; in parse_moused()
933 p->type = PT_BOOL; in parse_moused()
934 p->value.b = b; in parse_moused()
937 p->id = MOUSED_DRIFT_DISTANCE; in parse_moused()
940 p->type = PT_UINT; in parse_moused()
941 p->value.u = v; in parse_moused()
944 p->id = MOUSED_DRIFT_TIME; in parse_moused()
947 p->type = PT_UINT; in parse_moused()
948 p->value.u = v; in parse_moused()
951 p->id = MOUSED_DRIFT_AFTER; in parse_moused()
954 p->type = PT_UINT; in parse_moused()
955 p->value.u = v; in parse_moused()
958 p->id = MOUSED_EMULATE_THIRD_BUTTON; in parse_moused()
961 p->type = PT_BOOL; in parse_moused()
962 p->value.b = b; in parse_moused()
965 p->id = MOUSED_EMULATE_THIRD_BUTTON_TIMEOUT; in parse_moused()
968 p->type = PT_UINT; in parse_moused()
969 p->value.u = v; in parse_moused()
972 p->id = MOUSED_EXPONENTIAL_ACCEL; in parse_moused()
975 p->type = PT_DOUBLE; in parse_moused()
976 p->value.d = d; in parse_moused()
979 p->id = MOUSED_EXPONENTIAL_OFFSET; in parse_moused()
982 p->type = PT_DOUBLE; in parse_moused()
983 p->value.d = d; in parse_moused()
986 p->id = MOUSED_LINEAR_ACCEL_X; in parse_moused()
989 p->type = PT_DOUBLE; in parse_moused()
990 p->value.d = d; in parse_moused()
993 p->id = MOUSED_LINEAR_ACCEL_Y; in parse_moused()
996 p->type = PT_DOUBLE; in parse_moused()
997 p->value.d = d; in parse_moused()
1000 p->id = MOUSED_LINEAR_ACCEL_Z; in parse_moused()
1003 p->type = PT_DOUBLE; in parse_moused()
1004 p->value.d = d; in parse_moused()
1008 p->id = MOUSED_VIRTUAL_SCROLL_ENABLE; in parse_moused()
1011 p->type = PT_BOOL; in parse_moused()
1012 p->value.b = b; in parse_moused()
1015 p->id = MOUSED_HOR_VIRTUAL_SCROLL_ENABLE; in parse_moused()
1018 p->type = PT_BOOL; in parse_moused()
1019 p->value.b = b; in parse_moused()
1022 p->id = MOUSED_VIRTUAL_SCROLL_SPEED; in parse_moused()
1025 p->type = PT_UINT; in parse_moused()
1026 p->value.u = v; in parse_moused()
1029 p->id = MOUSED_VIRTUAL_SCROLL_THRESHOLD; in parse_moused()
1032 p->type = PT_UINT; in parse_moused()
1033 p->value.u = v; in parse_moused()
1036 p->id = MOUSED_WMODE; in parse_moused()
1039 p->type = PT_UINT; in parse_moused()
1040 p->value.u = v; in parse_moused()
1043 p->id = MOUSED_TWO_FINGER_SCROLL; in parse_moused()
1046 p->type = PT_BOOL; in parse_moused()
1047 p->value.b = b; in parse_moused()
1050 p->id = MOUSED_NATURAL_SCROLL; in parse_moused()
1053 p->type = PT_BOOL; in parse_moused()
1054 p->value.b = b; in parse_moused()
1057 p->id = MOUSED_THREE_FINGER_DRAG; in parse_moused()
1060 p->type = PT_BOOL; in parse_moused()
1061 p->value.b = b; in parse_moused()
1064 p->id = MOUSED_SOFTBUTTON2_X; in parse_moused()
1067 p->type = PT_UINT; in parse_moused()
1068 p->value.u = v; in parse_moused()
1071 p->id = MOUSED_SOFTBUTTON3_X; in parse_moused()
1074 p->type = PT_UINT; in parse_moused()
1075 p->value.u = v; in parse_moused()
1078 p->id = MOUSED_SOFTBUTTONS_Y; in parse_moused()
1081 p->type = PT_INT; in parse_moused()
1082 p->value.i = i; in parse_moused()
1085 p->id = MOUSED_TAP_TIMEOUT; in parse_moused()
1088 p->type = PT_UINT; in parse_moused()
1089 p->value.u = v; in parse_moused()
1092 p->id = MOUSED_TAP_PRESSURE_THRESHOLD; in parse_moused()
1095 p->type = PT_UINT; in parse_moused()
1096 p->value.u = v; in parse_moused()
1099 p->id = MOUSED_TAP_MAX_DELTA; in parse_moused()
1102 p->type = PT_DOUBLE; in parse_moused()
1103 p->value.d = d; in parse_moused()
1106 p->id = MOUSED_TAPHOLD_TIMEOUT; in parse_moused()
1109 p->type = PT_UINT; in parse_moused()
1110 p->value.u = v; in parse_moused()
1113 p->id = MOUSED_VSCROLL_MIN_DELTA; in parse_moused()
1116 p->type = PT_DOUBLE; in parse_moused()
1117 p->value.d = d; in parse_moused()
1120 p->id = MOUSED_VSCROLL_HOR_AREA; in parse_moused()
1123 p->type = PT_DOUBLE; in parse_moused()
1124 p->value.d = d; in parse_moused()
1127 p->id = MOUSED_VSCROLL_VER_AREA; in parse_moused()
1130 p->type = PT_DOUBLE; in parse_moused()
1131 p->value.d = d; in parse_moused()
1134 qlog_error(ctx, "Unknown key %s in %s\n", key, s->name); in parse_moused()
1138 list_append(&s->properties, &p->link); in parse_moused()
1139 s->has_property = true; in parse_moused()
1153 static bool
1156 bool rc = false; in parse_value_line()
1187 static inline bool
1199 bool rc = false; in parse_file()
1202 int lineno = -1; in parse_file()
1231 comment--; in parse_file()
1235 comment--; in parse_file()
1248 switch (line[strlen(line) - 1]) { in parse_file()
1270 if (line[strlen(line) - 1] != ']') { in parse_file()
1283 (!section->has_match || !section->has_property)) { in parse_file()
1285 path, lineno, section->name); in parse_file()
1291 list_append(&ctx->sections, §ion->link); in parse_file()
1294 /* entries must start with A-Z */ in parse_file()
1342 if ((!section->has_match || !section->has_property)) { in parse_file()
1344 path, lineno, section->name); in parse_file()
1358 return strendswith(dir->d_name, ".quirks"); in is_data_file()
1361 static inline bool
1365 int ndev = -1; in parse_files()
1383 namelist[idx]->d_name); in parse_files()
1406 ctx->refcount = 1; in quirks_init_subsystem()
1407 ctx->log_handler = log_handler; in quirks_init_subsystem()
1408 ctx->log_type = log_type; in quirks_init_subsystem()
1409 list_init(&ctx->quirks); in quirks_init_subsystem()
1410 list_init(&ctx->sections); in quirks_init_subsystem()
1414 ctx->dmi = init_dmi(); in quirks_init_subsystem()
1415 ctx->dt = init_dt(); in quirks_init_subsystem()
1416 if (!ctx->dmi && !ctx->dt) in quirks_init_subsystem()
1431 assert(ctx->refcount > 0); in quirks_context_ref()
1432 ctx->refcount++; in quirks_context_ref()
1445 assert(ctx->refcount >= 1); in quirks_context_unref()
1446 ctx->refcount--; in quirks_context_unref()
1448 if (ctx->refcount > 0) in quirks_context_unref()
1452 assert(list_empty(&ctx->quirks)); in quirks_context_unref()
1454 list_for_each_safe(s, &ctx->sections, link) { in quirks_context_unref()
1458 free(ctx->dmi); in quirks_context_unref()
1459 free(ctx->dt); in quirks_context_unref()
1471 q->refcount = 1; in quirks_new()
1472 q->nproperties = 0; in quirks_new()
1473 list_init(&q->link); in quirks_new()
1474 list_init(&q->floating_properties); in quirks_new()
1487 assert(q->refcount == 1); in quirks_unref()
1489 for (size_t i = 0; i < q->nproperties; i++) { in quirks_unref()
1490 property_unref(q->properties[i]); in quirks_unref()
1495 struct property *p; in quirks_unref()
1496 list_for_each_safe(p, &q->floating_properties, link) { in quirks_unref()
1500 list_remove(&q->link); in quirks_unref()
1501 free(q->properties); in quirks_unref()
1511 if (device->name[0] == 0) in match_fill_name()
1514 m->name = safe_strdup(device->name); in match_fill_name()
1516 m->bits |= M_NAME; in match_fill_name()
1523 if (device->uniq[0] == 0) in match_fill_uniq()
1526 m->uniq = safe_strdup(device->uniq); in match_fill_uniq()
1528 m->bits |= M_UNIQ; in match_fill_uniq()
1535 m->product[0] = device->id.product; in match_fill_bus_vid_pid()
1536 m->product[1] = 0; in match_fill_bus_vid_pid()
1537 m->vendor = device->id.vendor; in match_fill_bus_vid_pid()
1538 m->version = device->id.version; in match_fill_bus_vid_pid()
1539 m->bits |= M_PID|M_VID|M_VERSION; in match_fill_bus_vid_pid()
1540 switch (device->id.bustype) { in match_fill_bus_vid_pid()
1542 m->bus = BT_USB; in match_fill_bus_vid_pid()
1543 m->bits |= M_BUS; in match_fill_bus_vid_pid()
1546 m->bus = BT_BLUETOOTH; in match_fill_bus_vid_pid()
1547 m->bits |= M_BUS; in match_fill_bus_vid_pid()
1550 m->bus = BT_PS2; in match_fill_bus_vid_pid()
1551 m->bits |= M_BUS; in match_fill_bus_vid_pid()
1554 m->bus = BT_RMI; in match_fill_bus_vid_pid()
1555 m->bits |= M_BUS; in match_fill_bus_vid_pid()
1558 m->bus = BT_I2C; in match_fill_bus_vid_pid()
1559 m->bits |= M_BUS; in match_fill_bus_vid_pid()
1562 m->bus = BT_SPI; in match_fill_bus_vid_pid()
1563 m->bits |= M_BUS; in match_fill_bus_vid_pid()
1574 switch (device->type) { in match_fill_udev_type()
1576 m->udev_type |= UDEV_MOUSE; in match_fill_udev_type()
1579 m->udev_type |= UDEV_MOUSE | UDEV_POINTINGSTICK; in match_fill_udev_type()
1582 m->udev_type |= UDEV_TOUCHPAD; in match_fill_udev_type()
1585 m->udev_type |= UDEV_TABLET; in match_fill_udev_type()
1588 m->udev_type |= UDEV_TABLET_PAD; in match_fill_udev_type()
1591 m->udev_type |= UDEV_KEYBOARD; in match_fill_udev_type()
1594 m->udev_type |= UDEV_JOYSTICK; in match_fill_udev_type()
1599 m->bits |= M_UDEV_TYPE; in match_fill_udev_type()
1606 m->dmi = dmi; in match_fill_dmi_dt()
1607 m->bits |= M_DMI; in match_fill_dmi_dt()
1611 m->dt = dt; in match_fill_dmi_dt()
1612 m->bits |= M_DT; in match_fill_dmi_dt()
1634 free(m->name); in match_free()
1635 free(m->uniq); in match_free()
1642 const struct property *property) in quirk_merge_event_codes() argument
1644 for (size_t i = 0; i < q->nproperties; i++) { in quirk_merge_event_codes()
1645 struct property *p = q->properties[i]; in quirk_merge_event_codes()
1647 if (p->id != property->id) in quirk_merge_event_codes()
1650 /* We have a duplicated property, merge in with ours */ in quirk_merge_event_codes()
1651 size_t offset = p->value.tuples.ntuples; in quirk_merge_event_codes()
1652 size_t max = ARRAY_LENGTH(p->value.tuples.tuples); in quirk_merge_event_codes()
1653 for (size_t j = 0; j < property->value.tuples.ntuples; j++) { in quirk_merge_event_codes()
1656 p->value.tuples.tuples[offset + j] = property->value.tuples.tuples[j]; in quirk_merge_event_codes()
1657 p->value.tuples.ntuples++; in quirk_merge_event_codes()
1662 /* First time we add AttrEventCode: create a new property. in quirk_merge_event_codes()
1665 struct property *newprop = property_new(); in quirk_merge_event_codes()
1666 newprop->id = property->id; in quirk_merge_event_codes()
1667 newprop->type = property->type; in quirk_merge_event_codes()
1668 newprop->value.tuples = property->value.tuples; in quirk_merge_event_codes()
1669 /* Caller responsible for pre-allocating space */ in quirk_merge_event_codes()
1670 q->properties[q->nproperties++] = property_ref(newprop); in quirk_merge_event_codes()
1671 list_append(&q->floating_properties, &newprop->link); in quirk_merge_event_codes()
1679 struct property *p; in quirk_apply_section()
1683 list_for_each(p, &s->properties, link) { in quirk_apply_section()
1687 nprops += q->nproperties; in quirk_apply_section()
1688 tmp = realloc(q->properties, nprops * sizeof(p)); in quirk_apply_section()
1692 q->properties = tmp; in quirk_apply_section()
1693 list_for_each(p, &s->properties, link) { in quirk_apply_section()
1694 qlog_debug(ctx, "property added: %s from %s\n", in quirk_apply_section()
1695 quirk_get_name(p->id), s->name); in quirk_apply_section()
1699 * matching property and, later when checking the quirk, pick in quirk_apply_section()
1705 * only BTN_RIGHT. This should result in BTN_LEFT force-enabled in quirk_apply_section()
1706 * and BTN_RIGHT force-disabled. in quirk_apply_section()
1709 * have one struct property in the list (not owned by a section) in quirk_apply_section()
1712 if (p->id == QUIRK_ATTR_EVENT_CODE || in quirk_apply_section()
1713 p->id == QUIRK_ATTR_INPUT_PROP) in quirk_apply_section()
1716 q->properties[q->nproperties++] = property_ref(p); in quirk_apply_section()
1720 static bool
1732 if ((s->match.bits & flag) == 0) in quirk_match_section()
1737 if ((m->bits & flag) == 0) { in quirk_match_section()
1740 s->name, matchflagname(flag)); in quirk_match_section()
1747 if (fnmatch(s->match.name, m->name, 0) == 0) in quirk_match_section()
1751 if (fnmatch(s->match.uniq, m->uniq, 0) == 0) in quirk_match_section()
1755 if (m->bus == s->match.bus) in quirk_match_section()
1759 if (m->vendor == s->match.vendor) in quirk_match_section()
1763 ARRAY_FOR_EACH(m->product, mi) { in quirk_match_section()
1767 ARRAY_FOR_EACH(s->match.product, si) { in quirk_match_section()
1778 if (m->version == s->match.version) in quirk_match_section()
1782 if (fnmatch(s->match.dmi, m->dmi, 0) == 0) in quirk_match_section()
1786 if (fnmatch(s->match.dt, m->dt, 0) == 0) in quirk_match_section()
1790 if (s->match.udev_type & m->udev_type) in quirk_match_section()
1800 s->name, in quirk_match_section()
1805 if (s->match.bits == matched_flags) { in quirk_match_section()
1806 qlog_debug(ctx, "%s is full match\n", s->name); in quirk_match_section()
1823 qlog_debug(ctx, "%s: fetching quirks\n", device->path); in quirks_fetch_for_device()
1827 m = match_new(device, ctx->dmi, ctx->dt); in quirks_fetch_for_device()
1829 list_for_each(s, &ctx->sections, link) { in quirks_fetch_for_device()
1835 if (q->nproperties == 0) { in quirks_fetch_for_device()
1839 list_insert(&ctx->quirks, &q->link); in quirks_fetch_for_device()
1844 static inline struct property *
1848 for (ssize_t i = q->nproperties - 1; i >= 0; i--) { in quirk_find_prop()
1849 struct property *p = q->properties[i]; in quirk_find_prop()
1850 if (p->id == which) in quirk_find_prop()
1857 bool
1863 bool
1866 struct property *p; in quirks_get_int32()
1875 assert(p->type == PT_INT); in quirks_get_int32()
1876 *val = p->value.i; in quirks_get_int32()
1881 bool
1884 struct property *p; in quirks_get_uint32()
1893 assert(p->type == PT_UINT); in quirks_get_uint32()
1894 *val = p->value.u; in quirks_get_uint32()
1899 bool
1902 struct property *p; in quirks_get_double()
1911 assert(p->type == PT_DOUBLE); in quirks_get_double()
1912 *val = p->value.d; in quirks_get_double()
1917 bool
1920 struct property *p; in quirks_get_string()
1929 assert(p->type == PT_STRING); in quirks_get_string()
1930 *val = p->value.s; in quirks_get_string()
1935 bool
1936 quirks_get_bool(struct quirks *q, enum quirk which, bool *val) in quirks_get_bool()
1938 struct property *p; in quirks_get_bool()
1947 assert(p->type == PT_BOOL); in quirks_get_bool()
1948 *val = p->value.b; in quirks_get_bool()
1953 bool
1958 struct property *p; in quirks_get_dimensions()
1967 assert(p->type == PT_DIMENSION); in quirks_get_dimensions()
1968 *val = p->value.dim; in quirks_get_dimensions()
1973 bool
1978 struct property *p; in quirks_get_range()
1987 assert(p->type == PT_RANGE); in quirks_get_range()
1988 *val = p->value.range; in quirks_get_range()
1993 bool
1998 struct property *p; in quirks_get_tuples()
2007 assert(p->type == PT_TUPLES); in quirks_get_tuples()
2008 *tuples = &p->value.tuples; in quirks_get_tuples()
2013 bool
2019 struct property *p; in quirks_get_uint32_array()
2028 assert(p->type == PT_UINT_ARRAY); in quirks_get_uint32_array()
2029 *array = p->value.array.data.u; in quirks_get_uint32_array()
2030 *nelements = p->value.array.nelements; in quirks_get_uint32_array()