aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2007-02-07 12:19:37 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-07 12:19:37 -0500
commite3a59b4d9378522479609042836ae930305a67fe (patch)
tree1dd41aefac4d7f370dd3798818c2ca36c654fe7c /include/linux/ide.h
parent78281c5350029e3fa21758d6db9b45ffc7bf72a1 (diff)
ACPI support for IDE devices
This patch implements ACPI integration for generic IDE devices. The ACPI spec mandates that some methods are called during suspend and resume. And consequently there most modern Laptops cannot resume properly without it. According to the spec, we should call '_GTM' (Get Timing) upon suspend to store the current IDE adapter settings. Upon resume we should call '_STM' (Set Timing) to initialize the adapter with the stored settings; afterwards '_GTF' (Get Taskfile) should be called which returns a buffer with some IDE initialisation commands. Those commands should be passed to the drive. There are two module params which control the behaviour of this patch: 'ide=noacpi' Do not call any ACPI methods (Disables any ACPI method calls) 'ide=acpigtf' Enable execution of _GTF methods upon resume. Has no effect if 'ide=noacpi' is set. 'ide=acpionboot' Enable execution of ACPI methods during boot. This might be required on some machines if 'ide=acpigtf' is selected as some machines modify the _GTF information depending on the drive identification passed down with _STM. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index e26a03981a94..ba1c92999f6e 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -18,6 +18,9 @@
18#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/completion.h> 20#include <linux/completion.h>
21#ifdef CONFIG_BLK_DEV_IDEACPI
22#include <acpi/acpi.h>
23#endif
21#include <asm/byteorder.h> 24#include <asm/byteorder.h>
22#include <asm/system.h> 25#include <asm/system.h>
23#include <asm/io.h> 26#include <asm/io.h>
@@ -541,6 +544,11 @@ typedef enum {
541struct ide_driver_s; 544struct ide_driver_s;
542struct ide_settings_s; 545struct ide_settings_s;
543 546
547#ifdef CONFIG_BLK_DEV_IDEACPI
548struct ide_acpi_drive_link;
549struct ide_acpi_hwif_link;
550#endif
551
544typedef struct ide_drive_s { 552typedef struct ide_drive_s {
545 char name[4]; /* drive name, such as "hda" */ 553 char name[4]; /* drive name, such as "hda" */
546 char driver_req[10]; /* requests specific driver */ 554 char driver_req[10]; /* requests specific driver */
@@ -637,6 +645,9 @@ typedef struct ide_drive_s {
637 645
638 int lun; /* logical unit */ 646 int lun; /* logical unit */
639 int crc_count; /* crc counter to reduce drive speed */ 647 int crc_count; /* crc counter to reduce drive speed */
648#ifdef CONFIG_BLK_DEV_IDEACPI
649 struct ide_acpi_drive_link *acpidata;
650#endif
640 struct list_head list; 651 struct list_head list;
641 struct device gendev; 652 struct device gendev;
642 struct completion gendev_rel_comp; /* to deal with device release() */ 653 struct completion gendev_rel_comp; /* to deal with device release() */
@@ -804,6 +815,10 @@ typedef struct hwif_s {
804 void *hwif_data; /* extra hwif data */ 815 void *hwif_data; /* extra hwif data */
805 816
806 unsigned dma; 817 unsigned dma;
818
819#ifdef CONFIG_BLK_DEV_IDEACPI
820 struct ide_acpi_hwif_link *acpidata;
821#endif
807} ____cacheline_internodealigned_in_smp ide_hwif_t; 822} ____cacheline_internodealigned_in_smp ide_hwif_t;
808 823
809/* 824/*
@@ -1298,6 +1313,18 @@ static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
1298static inline void ide_release_dma(ide_hwif_t *drive) {;} 1313static inline void ide_release_dma(ide_hwif_t *drive) {;}
1299#endif 1314#endif
1300 1315
1316#ifdef CONFIG_BLK_DEV_IDEACPI
1317extern int ide_acpi_exec_tfs(ide_drive_t *drive);
1318extern void ide_acpi_get_timing(ide_hwif_t *hwif);
1319extern void ide_acpi_push_timing(ide_hwif_t *hwif);
1320extern void ide_acpi_init(ide_hwif_t *hwif);
1321#else
1322static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; }
1323static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; }
1324static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; }
1325static inline void ide_acpi_init(ide_hwif_t *hwif) { ; }
1326#endif
1327
1301extern int ide_hwif_request_regions(ide_hwif_t *hwif); 1328extern int ide_hwif_request_regions(ide_hwif_t *hwif);
1302extern void ide_hwif_release_regions(ide_hwif_t* hwif); 1329extern void ide_hwif_release_regions(ide_hwif_t* hwif);
1303extern void ide_unregister (unsigned int index); 1330extern void ide_unregister (unsigned int index);