Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/atkbdc/psm.c
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | |||||
/* end of driver specific options */ | /* end of driver specific options */ | ||||
#define PSMCPNP_DRIVER_NAME "psmcpnp" | #define PSMCPNP_DRIVER_NAME "psmcpnp" | ||||
struct psmcpnp_softc { | struct psmcpnp_softc { | ||||
enum { | enum { | ||||
PSMCPNP_GENERIC, | PSMCPNP_GENERIC, | ||||
PSMCPNP_FORCEPAD, | PSMCPNP_FORCEPAD, | ||||
PSMCPNP_TOPBUTTONPAD, | |||||
} type; /* Based on PnP ID */ | } type; /* Based on PnP ID */ | ||||
}; | }; | ||||
/* input queue */ | /* input queue */ | ||||
#define PSM_BUFSIZE 960 | #define PSM_BUFSIZE 960 | ||||
#define PSM_SMALLBUFSIZE 240 | #define PSM_SMALLBUFSIZE 240 | ||||
/* operation levels */ | /* operation levels */ | ||||
▲ Show 20 Lines • Show All 1,674 Lines • ▼ Show 20 Lines | psm_register_synaptics(device_t dev) | ||||
evdev_support_event(evdev_a, EV_SYN); | evdev_support_event(evdev_a, EV_SYN); | ||||
evdev_support_event(evdev_a, EV_KEY); | evdev_support_event(evdev_a, EV_KEY); | ||||
evdev_support_event(evdev_a, EV_ABS); | evdev_support_event(evdev_a, EV_ABS); | ||||
evdev_support_prop(evdev_a, INPUT_PROP_POINTER); | evdev_support_prop(evdev_a, INPUT_PROP_POINTER); | ||||
if (sc->synhw.capAdvancedGestures) | if (sc->synhw.capAdvancedGestures) | ||||
evdev_support_prop(evdev_a, INPUT_PROP_SEMI_MT); | evdev_support_prop(evdev_a, INPUT_PROP_SEMI_MT); | ||||
if (sc->synhw.capClickPad) | if (sc->synhw.capClickPad) | ||||
evdev_support_prop(evdev_a, INPUT_PROP_BUTTONPAD); | evdev_support_prop(evdev_a, INPUT_PROP_BUTTONPAD); | ||||
if (sc->synhw.capClickPad && sc->synhw.topButtonPad) | |||||
evdev_support_prop(evdev_a, INPUT_PROP_TOPBUTTONPAD); | |||||
evdev_support_key(evdev_a, BTN_TOUCH); | evdev_support_key(evdev_a, BTN_TOUCH); | ||||
evdev_support_nfingers(evdev_a, 3); | evdev_support_nfingers(evdev_a, 3); | ||||
psm_support_abs_bulk(evdev_a, synaptics_absinfo_st); | psm_support_abs_bulk(evdev_a, synaptics_absinfo_st); | ||||
if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) | if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) | ||||
psm_support_abs_bulk(evdev_a, synaptics_absinfo_mt); | psm_support_abs_bulk(evdev_a, synaptics_absinfo_mt); | ||||
if (sc->synhw.capPalmDetect) | if (sc->synhw.capPalmDetect) | ||||
evdev_support_abs(evdev_a, ABS_TOOL_WIDTH, 0, 0, 15, 0, 0, 0); | evdev_support_abs(evdev_a, ABS_TOOL_WIDTH, 0, 0, 15, 0, 0, 0); | ||||
evdev_support_key(evdev_a, BTN_LEFT); | evdev_support_key(evdev_a, BTN_LEFT); | ||||
▲ Show 20 Lines • Show All 3,869 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
/* | /* | ||||
* Set predefined sizes for softbuttons. | * Set predefined sizes for softbuttons. | ||||
* Values are taken to match HP Pavilion dv6 clickpad drawings | * Values are taken to match HP Pavilion dv6 clickpad drawings | ||||
* with thin middle softbutton placed on separator | * with thin middle softbutton placed on separator | ||||
*/ | */ | ||||
/* hw.psm.synaptics.softbuttons_y */ | /* hw.psm.synaptics.softbuttons_y */ | ||||
sc->syninfo.softbuttons_y = 1700; | sc->syninfo.softbuttons_y = sc->synhw.topButtonPad ? -1700 : 1700; | ||||
SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, | SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, | ||||
SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, | SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, | ||||
"softbuttons_y", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, | "softbuttons_y", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, | ||||
sc, SYNAPTICS_SYSCTL_SOFTBUTTONS_Y, | sc, SYNAPTICS_SYSCTL_SOFTBUTTONS_Y, | ||||
synaptics_sysctl, "I", | synaptics_sysctl, "I", | ||||
"Vertical size of softbuttons area"); | "Vertical size of softbuttons area"); | ||||
/* hw.psm.synaptics.softbutton2_x */ | /* hw.psm.synaptics.softbutton2_x */ | ||||
▲ Show 20 Lines • Show All 713 Lines • ▼ Show 20 Lines | if (synhw.nExtendedQueries >= 4) { | ||||
* ClickPad properties are not exported through PS/2 | * ClickPad properties are not exported through PS/2 | ||||
* protocol. Detection is based on controller's PnP ID. | * protocol. Detection is based on controller's PnP ID. | ||||
*/ | */ | ||||
if (synhw.capClickPad && psmcpnp_sc != NULL) { | if (synhw.capClickPad && psmcpnp_sc != NULL) { | ||||
switch (psmcpnp_sc->type) { | switch (psmcpnp_sc->type) { | ||||
case PSMCPNP_FORCEPAD: | case PSMCPNP_FORCEPAD: | ||||
synhw.forcePad = 1; | synhw.forcePad = 1; | ||||
break; | break; | ||||
case PSMCPNP_TOPBUTTONPAD: | |||||
synhw.topButtonPad = 1; | |||||
break; | |||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
if (verbose >= 2) { | if (verbose >= 2) { | ||||
printf(" Continued capabilities:\n"); | printf(" Continued capabilities:\n"); | ||||
printf(" capClickPad: %d\n", | printf(" capClickPad: %d\n", | ||||
Show All 26 Lines | if (synhw.nExtendedQueries >= 4) { | ||||
} | } | ||||
if (synhw.capReportsMin) { | if (synhw.capReportsMin) { | ||||
printf(" minimumXCoord: %d\n", | printf(" minimumXCoord: %d\n", | ||||
synhw.minimumXCoord); | synhw.minimumXCoord); | ||||
printf(" minimumYCoord: %d\n", | printf(" minimumYCoord: %d\n", | ||||
synhw.minimumYCoord); | synhw.minimumYCoord); | ||||
} | } | ||||
if (synhw.capClickPad) { | if (synhw.capClickPad) { | ||||
printf(" Clickpad capabilities:\n"); | |||||
printf(" forcePad: %d\n", | printf(" forcePad: %d\n", | ||||
synhw.forcePad); | synhw.forcePad); | ||||
printf(" topButtonPad: %d\n", | |||||
synhw.topButtonPad); | |||||
} | } | ||||
} | } | ||||
buttons += synhw.capClickPad; | buttons += synhw.capClickPad; | ||||
} | } | ||||
} | } | ||||
if (verbose >= 2) { | if (verbose >= 2) { | ||||
if (synhw.capExtended) | if (synhw.capExtended) | ||||
▲ Show 20 Lines • Show All 831 Lines • ▼ Show 20 Lines | static struct isa_pnp_id psmcpnp_ids[] = { | ||||
{ 0x0190d94d, "SONY VAIO PS/2 mouse port"}, /* SNY9001, Vaio */ | { 0x0190d94d, "SONY VAIO PS/2 mouse port"}, /* SNY9001, Vaio */ | ||||
{ 0x0290d94d, "SONY VAIO PS/2 mouse port"}, /* SNY9002, Vaio */ | { 0x0290d94d, "SONY VAIO PS/2 mouse port"}, /* SNY9002, Vaio */ | ||||
{ 0x0390d94d, "SONY VAIO PS/2 mouse port"}, /* SNY9003, Vaio */ | { 0x0390d94d, "SONY VAIO PS/2 mouse port"}, /* SNY9003, Vaio */ | ||||
{ 0x0490d94d, "SONY VAIO PS/2 mouse port"}, /* SNY9004, Vaio */ | { 0x0490d94d, "SONY VAIO PS/2 mouse port"}, /* SNY9004, Vaio */ | ||||
{ 0 } | { 0 } | ||||
}; | }; | ||||
/* _HID list for quirk detection. Any device below has _CID from psmcpnp_ids */ | /* _HID list for quirk detection. Any device below has _CID from psmcpnp_ids */ | ||||
static struct isa_pnp_id topbtpad_ids[] = { | |||||
{ 0x1700ae30, "Lenovo PS/2 clickpad port" }, /* LEN0017, ThinkPad */ | |||||
{ 0x1800ae30, "Lenovo PS/2 clickpad port" }, /* LEN0018, ThinkPad */ | |||||
{ 0x1900ae30, "Lenovo PS/2 clickpad port" }, /* LEN0019, ThinkPad */ | |||||
{ 0x2300ae30, "Lenovo PS/2 clickpad port" }, /* LEN0023, ThinkPad */ | |||||
{ 0x2a00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002a, ThinkPad */ | |||||
{ 0x2b00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002b, ThinkPad */ | |||||
{ 0x2c00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002c, ThinkPad */ | |||||
{ 0x2d00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002d, ThinkPad */ | |||||
{ 0x2e00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002e, ThinkPad */ | |||||
{ 0x3300ae30, "Lenovo PS/2 clickpad port" }, /* LEN0033, ThinkPad */ | |||||
{ 0x3400ae30, "Lenovo PS/2 clickpad port" }, /* LEN0034, ThinkPad */ | |||||
{ 0x3500ae30, "Lenovo PS/2 clickpad port" }, /* LEN0035, ThinkPad */ | |||||
{ 0x3600ae30, "Lenovo PS/2 clickpad port" }, /* LEN0036, ThinkPad */ | |||||
{ 0x3700ae30, "Lenovo PS/2 clickpad port" }, /* LEN0037, ThinkPad */ | |||||
{ 0x3800ae30, "Lenovo PS/2 clickpad port" }, /* LEN0038, ThinkPad */ | |||||
{ 0x3900ae30, "Lenovo PS/2 clickpad port" }, /* LEN0039, ThinkPad */ | |||||
{ 0x4100ae30, "Lenovo PS/2 clickpad port" }, /* LEN0041, ThinkPad */ | |||||
{ 0x4200ae30, "Lenovo PS/2 clickpad port" }, /* LEN0042, ThinkPad */ | |||||
{ 0x4500ae30, "Lenovo PS/2 clickpad port" }, /* LEN0045, ThinkPad */ | |||||
{ 0x4700ae30, "Lenovo PS/2 clickpad port" }, /* LEN0047, ThinkPad */ | |||||
{ 0x4900ae30, "Lenovo PS/2 clickpad port" }, /* LEN0049, ThinkPad */ | |||||
{ 0x0020ae30, "Lenovo PS/2 clickpad port" }, /* LEN2000, ThinkPad */ | |||||
{ 0x0120ae30, "Lenovo PS/2 clickpad port" }, /* LEN2001, ThinkPad */ | |||||
{ 0x0220ae30, "Lenovo PS/2 clickpad port" }, /* LEN2002, ThinkPad */ | |||||
{ 0x0320ae30, "Lenovo PS/2 clickpad port" }, /* LEN2003, ThinkPad */ | |||||
{ 0x0420ae30, "Lenovo PS/2 clickpad port" }, /* LEN2004, ThinkPad */ | |||||
{ 0x0520ae30, "Lenovo PS/2 clickpad port" }, /* LEN2005, ThinkPad */ | |||||
{ 0x0620ae30, "Lenovo PS/2 clickpad port" }, /* LEN2006, ThinkPad */ | |||||
{ 0x0720ae30, "Lenovo PS/2 clickpad port" }, /* LEN2007, ThinkPad */ | |||||
{ 0x0820ae30, "Lenovo PS/2 clickpad port" }, /* LEN2008, ThinkPad */ | |||||
{ 0x0920ae30, "Lenovo PS/2 clickpad port" }, /* LEN2009, ThinkPad */ | |||||
{ 0x0a20ae30, "Lenovo PS/2 clickpad port" }, /* LEN200a, ThinkPad */ | |||||
{ 0x0b20ae30, "Lenovo PS/2 clickpad port" }, /* LEN200b, ThinkPad */ | |||||
{ 0 } | |||||
}; | |||||
/* _HID list for quirk detection. Any device below has _CID from psmcpnp_ids */ | |||||
static struct isa_pnp_id forcepad_ids[] = { | static struct isa_pnp_id forcepad_ids[] = { | ||||
{ 0x0d302e4f, "HP PS/2 forcepad port" }, /* SYN300D, EB 1040 */ | { 0x0d302e4f, "HP PS/2 forcepad port" }, /* SYN300D, EB 1040 */ | ||||
{ 0x14302e4f, "HP PS/2 forcepad port" }, /* SYN3014, EB 1040 */ | { 0x14302e4f, "HP PS/2 forcepad port" }, /* SYN3014, EB 1040 */ | ||||
{ 0 } | { 0 } | ||||
}; | }; | ||||
static int | static int | ||||
create_a_copy(device_t atkbdc, device_t me) | create_a_copy(device_t atkbdc, device_t me) | ||||
Show All 23 Lines | |||||
{ | { | ||||
struct psmcpnp_softc *sc = device_get_softc(dev); | struct psmcpnp_softc *sc = device_get_softc(dev); | ||||
struct resource *res; | struct resource *res; | ||||
u_long irq; | u_long irq; | ||||
int rid; | int rid; | ||||
if (ISA_PNP_PROBE(device_get_parent(dev), dev, forcepad_ids) == 0) | if (ISA_PNP_PROBE(device_get_parent(dev), dev, forcepad_ids) == 0) | ||||
sc->type = PSMCPNP_FORCEPAD; | sc->type = PSMCPNP_FORCEPAD; | ||||
else if (ISA_PNP_PROBE(device_get_parent(dev), dev, topbtpad_ids) == 0) | |||||
sc->type = PSMCPNP_TOPBUTTONPAD; | |||||
else if (ISA_PNP_PROBE(device_get_parent(dev), dev, psmcpnp_ids) == 0) | else if (ISA_PNP_PROBE(device_get_parent(dev), dev, psmcpnp_ids) == 0) | ||||
sc->type = PSMCPNP_GENERIC; | sc->type = PSMCPNP_GENERIC; | ||||
else | else | ||||
return (ENXIO); | return (ENXIO); | ||||
/* | /* | ||||
* The PnP BIOS and ACPI are supposed to assign an IRQ (12) | * The PnP BIOS and ACPI are supposed to assign an IRQ (12) | ||||
* to the PS/2 mouse device node. But, some buggy PnP BIOS | * to the PS/2 mouse device node. But, some buggy PnP BIOS | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |