Lines Matching defs:elantech
147 #define ELANTECH_IS_CLICKPAD(sc) (((sc)->elantech->fw_version & 0x1000) != 0)
178 struct elantech_softc *elantech;
1744 u_char reg10 = (sc->elantech->fw_version == 0x20030 ? 0x54 : 0xc4);
1834 struct elantech_softc *elantech = sc->elantech;
1844 elantech->flags |= ELANTECH_F_HW_V1_OLD;
1848 elantech->fw_version = fw_version;
1855 elantech->flags |= ELANTECH_F_HAS_ROCKER;
1874 struct elantech_softc *elantech = sc->elantech;
1888 elantech->fw_version = fw_version;
1890 elantech->flags |= ELANTECH_F_REPORTS_PRESSURE;
1937 struct elantech_softc *elantech = sc->elantech;
1948 elantech->fw_version = fw_version;
1949 elantech->flags |= ELANTECH_F_REPORTS_PRESSURE;
1952 elantech->flags |= ELANTECH_F_CRC_ENABLED;
1962 hw->x_max = elantech->max_x = (resp[0] & 0x0f) << 8 | resp[1];
1963 hw->y_max = elantech->max_y = (resp[0] & 0xf0) << 4 | resp[2];
1974 struct elantech_softc *elantech = sc->elantech;
1986 elantech->fw_version = fw_version;
1987 elantech->flags |= ELANTECH_F_REPORTS_PRESSURE;
1990 elantech->flags |= ELANTECH_F_CRC_ENABLED;
2011 elantech->flags |= ELANTECH_F_TRACKPOINT;
2018 elantech->width = hw->x_max / (capabilities[1] - 1);
2054 struct elantech_softc *elantech = sc->elantech;
2060 if (sc->elantech == NULL) {
2061 sc->elantech = elantech = malloc(sizeof(struct elantech_softc),
2063 if (elantech == NULL) {
2064 printf("%s: elantech: not enough memory\n",
2070 free(sc->elantech, M_DEVBUF,
2072 sc->elantech = NULL;
2076 free(sc->elantech, M_DEVBUF,
2078 sc->elantech = NULL;
2079 printf("%s: elantech: setup failed\n", DEVNAME(sc));
2084 DEVNAME(sc), 1, sc->elantech->fw_version);
2088 for (i = 0; i < nitems(sc->elantech->parity); i++)
2089 sc->elantech->parity[i] = sc->elantech->parity[i & (i - 1)] ^ 1;
2102 struct elantech_softc *elantech = sc->elantech;
2107 if (sc->elantech == NULL) {
2108 sc->elantech = elantech = malloc(sizeof(struct elantech_softc),
2110 if (elantech == NULL) {
2111 printf("%s: elantech: not enough memory\n",
2117 free(sc->elantech, M_DEVBUF,
2119 sc->elantech = NULL;
2123 free(sc->elantech, M_DEVBUF,
2125 sc->elantech = NULL;
2126 printf("%s: elantech: setup failed\n", DEVNAME(sc));
2131 DEVNAME(sc), 2, sc->elantech->fw_version);
2146 struct elantech_softc *elantech = sc->elantech;
2151 if (sc->elantech == NULL) {
2152 sc->elantech = elantech = malloc(sizeof(struct elantech_softc),
2154 if (elantech == NULL) {
2155 printf("%s: elantech: not enough memory\n",
2161 free(sc->elantech, M_DEVBUF,
2163 sc->elantech = NULL;
2167 free(sc->elantech, M_DEVBUF,
2169 sc->elantech = NULL;
2170 printf("%s: elantech: setup failed\n", DEVNAME(sc));
2175 DEVNAME(sc), 3, sc->elantech->fw_version);
2190 struct elantech_softc *elantech = sc->elantech;
2196 if (sc->elantech == NULL) {
2197 sc->elantech = elantech = malloc(sizeof(struct elantech_softc),
2199 if (elantech == NULL) {
2200 printf("%s: elantech: not enough memory\n",
2206 free(sc->elantech, M_DEVBUF,
2208 sc->elantech = NULL;
2212 free(sc->elantech, M_DEVBUF,
2214 sc->elantech = NULL;
2215 printf("%s: elantech: setup failed\n", DEVNAME(sc));
2221 : "Touchpad"), sc->elantech->fw_version);
2223 if (sc->elantech->flags & ELANTECH_F_TRACKPOINT) {
2278 struct elantech_softc *elantech = sc->elantech;
2283 if (elantech->flags & ELANTECH_F_HW_V1_OLD) {
2284 elantech->p1 = (data & 0x20) >> 5;
2285 elantech->p2 = (data & 0x10) >> 4;
2287 elantech->p1 = (data & 0x10) >> 4;
2288 elantech->p2 = (data & 0x20) >> 5;
2290 elantech->p3 = (data & 0x04) >> 2;
2293 p = elantech->p1;
2296 p = elantech->p2;
2299 p = elantech->p3;
2305 if (data < 0 || data >= nitems(elantech->parity) ||
2311 (elantech->fw_version != 0x20022 && elantech->parity[data] != p))
2320 struct elantech_softc *elantech = sc->elantech;
2323 if (elantech->flags & ELANTECH_F_REPORTS_PRESSURE) {
2338 elantech->flags |= ELANTECH_F_2FINGER_PACKET;
2342 elantech->flags &= ~ELANTECH_F_2FINGER_PACKET;
2347 if (elantech->flags & ELANTECH_F_2FINGER_PACKET)
2353 if (elantech->flags & ELANTECH_F_2FINGER_PACKET) {
2371 struct elantech_softc *elantech = sc->elantech;
2375 if (elantech->flags & ELANTECH_F_CRC_ENABLED)
2381 if (elantech->flags & ELANTECH_F_CRC_ENABLED) {
2396 elantech_packet_type(struct elantech_softc *elantech, u_char b)
2402 if ((elantech->flags & ELANTECH_F_TRACKPOINT) && ((b & 0x0f) == 0x06))
2415 switch (elantech_packet_type(sc->elantech, data)) {
2419 if (sc->elantech->flags & ELANTECH_F_CRC_ENABLED)
2438 struct elantech_softc *elantech = sc->elantech;
2444 if (elantech->flags & ELANTECH_F_HAS_ROCKER) {
2451 if (elantech->flags & ELANTECH_F_HW_V1_OLD)
2461 if (elantech->fw_version == 0x20022 ||
2462 elantech->fw_version == 0x20600) {
2464 if (elantech->initial_pkt < 2) {
2465 elantech->initial_pkt++;
2468 } else if (elantech->initial_pkt) {
2469 elantech->initial_pkt = 0;
2489 struct elantech_softc *elantech = sc->elantech;
2506 if (elantech->flags & ELANTECH_F_REPORTS_PRESSURE)
2526 struct elantech_softc *elantech = sc->elantech;
2542 if (elantech->flags & ELANTECH_F_CRC_ENABLED) {
2560 ((x == 0 || y == 0 || x == elantech->max_x || y == elantech->max_y)
2561 && (x != elantech->old_x || y != elantech->old_y))) {
2562 x = elantech->old_x;
2563 y = elantech->old_y;
2566 if (elantech->flags & ELANTECH_F_REPORTS_PRESSURE)
2572 elantech->old_x = x;
2573 elantech->old_y = y;
2579 struct elantech_softc *elantech = sc->elantech;
2584 switch (elantech_packet_type(elantech, sc->packet[3])) {
2586 slots = elantech->mt_slots;
2587 elantech->mt_slots = sc->packet[1] & 0x1f;
2588 slots &= ~elantech->mt_slots;