aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/shpchp.h
diff options
context:
space:
mode:
authorKristen Accardi <kristen.c.accardi@intel.com>2006-03-03 13:16:05 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 17:35:17 -0500
commit783c49fc506d9afe4784390b556fa25ede5d6d1f (patch)
tree8090c2251193211129816254f16f10cbb33ed20c /drivers/pci/hotplug/shpchp.h
parentf5afe8064f3087bead8fea7e32547c2a3ada5fd0 (diff)
[PATCH] PCI Hotplug: add common acpi functions to core
shpchprm_acpi.c and pciehprm_acpi.c are nearly identical. In addition, there are functions in both these files that are also in acpiphp_glue.c. This patch will remove duplicate functions from shpchp, pciehp, and acpiphp and move this functionality to pci_hotplug, as it is not hardware specific. Get rid of shpchprm* and pciehprm* files since they are no longer needed. shpchprm_nonacpi.c and pciehprm_nonacpi.c are identical, as well as shpchprm_legacy.c and can be replaced with a macro. This patch also changes acpiphp to use the common hpp code. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/shpchp.h')
-rw-r--r--drivers/pci/hotplug/shpchp.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index f10f1ba877af..5c70f43908c4 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -106,12 +106,6 @@ struct controller {
106 volatile int cmd_busy; 106 volatile int cmd_busy;
107}; 107};
108 108
109struct hotplug_params {
110 u8 cache_line_size;
111 u8 latency_timer;
112 u8 enable_serr;
113 u8 enable_perr;
114};
115 109
116/* Define AMD SHPC ID */ 110/* Define AMD SHPC ID */
117#define PCI_DEVICE_ID_AMD_GOLAM_7450 0x7450 111#define PCI_DEVICE_ID_AMD_GOLAM_7450 0x7450
@@ -193,15 +187,29 @@ extern u8 shpchp_handle_power_fault(u8 hp_slot, void *inst_id);
193extern int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slots, int first_device_num); 187extern int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slots, int first_device_num);
194extern int shpchp_configure_device(struct slot *p_slot); 188extern int shpchp_configure_device(struct slot *p_slot);
195extern int shpchp_unconfigure_device(struct slot *p_slot); 189extern int shpchp_unconfigure_device(struct slot *p_slot);
196extern void get_hp_hw_control_from_firmware(struct pci_dev *dev);
197extern void get_hp_params_from_firmware(struct pci_dev *dev,
198 struct hotplug_params *hpp);
199extern int shpchprm_get_physical_slot_number(struct controller *ctrl,
200 u32 *sun, u8 busnum, u8 devnum);
201extern void shpchp_remove_ctrl_files(struct controller *ctrl); 190extern void shpchp_remove_ctrl_files(struct controller *ctrl);
202extern void cleanup_slots(struct controller *ctrl); 191extern void cleanup_slots(struct controller *ctrl);
203extern void queue_pushbutton_work(void *data); 192extern void queue_pushbutton_work(void *data);
204 193
194
195#ifdef CONFIG_ACPI
196static inline int get_hp_params_from_firmware(struct pci_dev *dev,
197 struct hotplug_params *hpp)
198{
199 if (ACPI_FAILURE(acpi_get_hp_params_from_firmware(dev, hpp)))
200 return -ENODEV;
201 return 0;
202}
203#define get_hp_hw_control_from_firmware(pdev) \
204 do { \
205 if (DEVICE_ACPI_HANDLE(&(pdev->dev))) \
206 acpi_run_oshp(DEVICE_ACPI_HANDLE(&(pdev->dev))); \
207 } while (0)
208#else
209#define get_hp_params_from_firmware(dev, hpp) (-ENODEV)
210#define get_hp_hw_control_from_firmware(dev) do { } while (0)
211#endif
212
205struct ctrl_reg { 213struct ctrl_reg {
206 volatile u32 base_offset; 214 volatile u32 base_offset;
207 volatile u32 slot_avail1; 215 volatile u32 slot_avail1;