Skip to content

Commit 4e8662b

Browse files
kaccardilenb
authored andcommitted
ACPIPHP: use ACPI dock driver
Modify the acpiphp driver to use the ACPI dock driver for dock notifications. Only load the acpiphp driver if we find we have pci dock devices. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent a5e1b94 commit 4e8662b

5 files changed

Lines changed: 87 additions & 519 deletions

File tree

‎drivers/pci/hotplug/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ ibmphp-objs := ibmphp_core.o \
4040
ibmphp_hpc.o
4141

4242
acpiphp-objs := acpiphp_core.o \
43-
acpiphp_glue.o \
44-
acpiphp_dock.o
43+
acpiphp_glue.o
4544

4645
rpaphp-objs := rpaphp_core.o \
4746
rpaphp_pci.o \

‎drivers/pci/hotplug/acpiphp.h‎

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct acpiphp_func {
130130

131131
struct list_head sibling;
132132
struct pci_dev *pci_dev;
133-
133+
struct notifier_block nb;
134134
acpi_handle handle;
135135

136136
u8 function; /* pci function# */
@@ -151,24 +151,6 @@ struct acpiphp_attention_info
151151
};
152152

153153

154-
struct dependent_device {
155-
struct list_head device_list;
156-
struct list_head pci_list;
157-
acpi_handle handle;
158-
struct acpiphp_func *func;
159-
};
160-
161-
162-
struct acpiphp_dock_station {
163-
acpi_handle handle;
164-
u32 last_dock_time;
165-
u32 flags;
166-
struct acpiphp_func *dock_bridge;
167-
struct list_head dependent_devices;
168-
struct list_head pci_dependent_devices;
169-
};
170-
171-
172154
/* PCI bus bridge HID */
173155
#define ACPI_PCI_HOST_HID "PNP0A03"
174156

@@ -207,11 +189,6 @@ struct acpiphp_dock_station {
207189
#define FUNC_HAS_PS2 (0x00000040)
208190
#define FUNC_HAS_PS3 (0x00000080)
209191
#define FUNC_HAS_DCK (0x00000100)
210-
#define FUNC_IS_DD (0x00000200)
211-
212-
/* dock station flags */
213-
#define DOCK_DOCKING (0x00000001)
214-
#define DOCK_HAS_BRIDGE (0x00000002)
215192

216193
/* function prototypes */
217194

@@ -236,16 +213,6 @@ extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot);
236213
extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot);
237214
extern u32 acpiphp_get_address (struct acpiphp_slot *slot);
238215

239-
/* acpiphp_dock.c */
240-
extern int find_dock_station(void);
241-
extern void remove_dock_station(void);
242-
extern void add_dependent_device(struct dependent_device *new_dd);
243-
extern void add_pci_dependent_device(struct dependent_device *new_dd);
244-
extern struct dependent_device *get_dependent_device(acpi_handle handle);
245-
extern int is_dependent_device(acpi_handle handle);
246-
extern int detect_dependent_devices(acpi_handle *bridge_handle);
247-
extern struct dependent_device *alloc_dependent_device(acpi_handle handle);
248-
249216
/* variables */
250217
extern int acpiphp_debug;
251218

‎drivers/pci/hotplug/acpiphp_core.c‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -416,36 +416,19 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
416416

417417
static int __init acpiphp_init(void)
418418
{
419-
int retval;
420-
int docking_station;
421-
422419
info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
423420

424421
acpiphp_debug = debug;
425422

426-
docking_station = find_dock_station();
427-
428423
/* read all the ACPI info from the system */
429-
retval = init_acpi();
430-
431-
/* if we have found a docking station, we should
432-
* go ahead and load even if init_acpi has found
433-
* no slots. This handles the case when the _DCK
434-
* method not defined under the actual dock bridge
435-
*/
436-
if (docking_station)
437-
return 0;
438-
else
439-
return retval;
424+
return init_acpi();
440425
}
441426

442427

443428
static void __exit acpiphp_exit(void)
444429
{
445430
/* deallocate internal data structures etc. */
446431
acpiphp_glue_exit();
447-
448-
remove_dock_station();
449432
}
450433

451434
module_init(acpiphp_init);

0 commit comments

Comments
 (0)