| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pckbc_acpi.c,v 1.33 2010/03/05 14:00:17 jruoho Exp $ */ | | 1 | /* $NetBSD: pckbc_acpi.c,v 1.34 2013/10/17 21:19:03 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2000 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2000 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Jason R. Thorpe. | | 8 | * by Jason R. Thorpe. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -32,27 +32,27 @@ | | | @@ -32,27 +32,27 @@ |
32 | /* | | 32 | /* |
33 | * ACPI attachment for the PC Keyboard Controller driver. | | 33 | * ACPI attachment for the PC Keyboard Controller driver. |
34 | * | | 34 | * |
35 | * This is a little wonky. The keyboard controller actually | | 35 | * This is a little wonky. The keyboard controller actually |
36 | * has 2 ACPI nodes: one for the controller and the keyboard | | 36 | * has 2 ACPI nodes: one for the controller and the keyboard |
37 | * interrupt, and one for the aux port (mouse) interrupt. | | 37 | * interrupt, and one for the aux port (mouse) interrupt. |
38 | * | | 38 | * |
39 | * For this reason, we actually attach *two* instances of this | | 39 | * For this reason, we actually attach *two* instances of this |
40 | * driver. After both of them have been found, then we attach | | 40 | * driver. After both of them have been found, then we attach |
41 | * sub-devices. | | 41 | * sub-devices. |
42 | */ | | 42 | */ |
43 | | | 43 | |
44 | #include <sys/cdefs.h> | | 44 | #include <sys/cdefs.h> |
45 | __KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c,v 1.33 2010/03/05 14:00:17 jruoho Exp $"); | | 45 | __KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c,v 1.34 2013/10/17 21:19:03 christos Exp $"); |
46 | | | 46 | |
47 | #include <sys/param.h> | | 47 | #include <sys/param.h> |
48 | #include <sys/callout.h> | | 48 | #include <sys/callout.h> |
49 | #include <sys/device.h> | | 49 | #include <sys/device.h> |
50 | #include <sys/malloc.h> | | 50 | #include <sys/malloc.h> |
51 | #include <sys/systm.h> | | 51 | #include <sys/systm.h> |
52 | | | 52 | |
53 | #include <dev/acpi/acpivar.h> | | 53 | #include <dev/acpi/acpivar.h> |
54 | | | 54 | |
55 | #include <dev/isa/isareg.h> | | 55 | #include <dev/isa/isareg.h> |
56 | | | 56 | |
57 | #include <dev/ic/i8042reg.h> | | 57 | #include <dev/ic/i8042reg.h> |
58 | #include <dev/ic/pckbcvar.h> | | 58 | #include <dev/ic/pckbcvar.h> |
| @@ -120,41 +120,38 @@ pckbc_acpi_match(device_t parent, cfdata | | | @@ -120,41 +120,38 @@ pckbc_acpi_match(device_t parent, cfdata |
120 | if (rv) | | 120 | if (rv) |
121 | return rv; | | 121 | return rv; |
122 | return 0; | | 122 | return 0; |
123 | } | | 123 | } |
124 | | | 124 | |
125 | static void | | 125 | static void |
126 | pckbc_acpi_attach(device_t parent, device_t self, void *aux) | | 126 | pckbc_acpi_attach(device_t parent, device_t self, void *aux) |
127 | { | | 127 | { |
128 | struct pckbc_acpi_softc *psc = device_private(self); | | 128 | struct pckbc_acpi_softc *psc = device_private(self); |
129 | struct pckbc_softc *sc = &psc->sc_pckbc; | | 129 | struct pckbc_softc *sc = &psc->sc_pckbc; |
130 | struct pckbc_internal *t; | | 130 | struct pckbc_internal *t; |
131 | struct acpi_attach_args *aa = aux; | | 131 | struct acpi_attach_args *aa = aux; |
132 | bus_space_handle_t ioh_d, ioh_c; | | 132 | bus_space_handle_t ioh_d, ioh_c; |
133 | pckbc_slot_t peer; | | | |
134 | struct acpi_resources res; | | 133 | struct acpi_resources res; |
135 | struct acpi_io *io0, *io1, *ioswap; | | 134 | struct acpi_io *io0, *io1, *ioswap; |
136 | struct acpi_irq *irq; | | 135 | struct acpi_irq *irq; |
137 | ACPI_STATUS rv; | | 136 | ACPI_STATUS rv; |
138 | | | 137 | |
139 | sc->sc_dv = self; | | 138 | sc->sc_dv = self; |
140 | psc->sc_ic = aa->aa_ic; | | 139 | psc->sc_ic = aa->aa_ic; |
141 | | | 140 | |
142 | if (acpi_match_hid(aa->aa_node->ad_devinfo, pckbc_acpi_ids_kbd)) { | | 141 | if (acpi_match_hid(aa->aa_node->ad_devinfo, pckbc_acpi_ids_kbd)) { |
143 | psc->sc_slot = PCKBC_KBD_SLOT; | | 142 | psc->sc_slot = PCKBC_KBD_SLOT; |
144 | peer = PCKBC_AUX_SLOT; | | | |
145 | } else if (acpi_match_hid(aa->aa_node->ad_devinfo, pckbc_acpi_ids_ms)) { | | 143 | } else if (acpi_match_hid(aa->aa_node->ad_devinfo, pckbc_acpi_ids_ms)) { |
146 | psc->sc_slot = PCKBC_AUX_SLOT; | | 144 | psc->sc_slot = PCKBC_AUX_SLOT; |
147 | peer = PCKBC_KBD_SLOT; | | | |
148 | } else { | | 145 | } else { |
149 | aprint_error(": unknown port!\n"); | | 146 | aprint_error(": unknown port!\n"); |
150 | panic("pckbc_acpi_attach: impossible"); | | 147 | panic("pckbc_acpi_attach: impossible"); |
151 | } | | 148 | } |
152 | | | 149 | |
153 | aprint_normal(" (%s port)", pckbc_slot_names[psc->sc_slot]); | | 150 | aprint_normal(" (%s port)", pckbc_slot_names[psc->sc_slot]); |
154 | | | 151 | |
155 | /* parse resources */ | | 152 | /* parse resources */ |
156 | rv = acpi_resource_parse(sc->sc_dv, aa->aa_node->ad_handle, "_CRS", | | 153 | rv = acpi_resource_parse(sc->sc_dv, aa->aa_node->ad_handle, "_CRS", |
157 | &res, &acpi_resource_parse_ops_default); | | 154 | &res, &acpi_resource_parse_ops_default); |
158 | if (ACPI_FAILURE(rv)) | | 155 | if (ACPI_FAILURE(rv)) |
159 | return; | | 156 | return; |
160 | | | 157 | |