Skip to content

Commit

Permalink
[PATCH] PATA libata: suspend/resume simple cases
Browse files Browse the repository at this point in the history
This patch adds the suspend/resume callbacks for drivers which don't need
any additional help (beyond the pci resume quirk patch I posted earlier
anyway). Also bring version numbers back inline with master copies.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Alan-Cox authored and Jeff Garzik committed Dec 2, 2006
1 parent 8550c16 commit 30ced0f
Show file tree
Hide file tree
Showing 15 changed files with 82 additions and 47 deletions.
8 changes: 6 additions & 2 deletions drivers/ata/ata_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <linux/libata.h>

#define DRV_NAME "ata_generic"
#define DRV_VERSION "0.2.7"
#define DRV_VERSION "0.2.10"

/*
* A generic parallel ATA driver using libata
Expand Down Expand Up @@ -118,6 +118,8 @@ static struct scsi_host_template generic_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static struct ata_port_operations generic_port_ops = {
Expand Down Expand Up @@ -226,7 +228,9 @@ static struct pci_driver ata_generic_pci_driver = {
.name = DRV_NAME,
.id_table = ata_generic,
.probe = ata_generic_init_one,
.remove = ata_pci_remove_one
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init ata_generic_init(void)
Expand Down
8 changes: 6 additions & 2 deletions drivers/ata/pata_atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_atiixp"
#define DRV_VERSION "0.4.3"
#define DRV_VERSION "0.4.4"

enum {
ATIIXP_IDE_PIO_TIMING = 0x40,
Expand Down Expand Up @@ -218,6 +218,8 @@ static struct scsi_host_template atiixp_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static struct ata_port_operations atiixp_port_ops = {
Expand Down Expand Up @@ -281,7 +283,9 @@ static struct pci_driver atiixp_pci_driver = {
.name = DRV_NAME,
.id_table = atiixp,
.probe = atiixp_init_one,
.remove = ata_pci_remove_one
.remove = ata_pci_remove_one,
.resume = ata_pci_device_resume,
.suspend = ata_pci_device_suspend,
};

static int __init atiixp_init(void)
Expand Down
6 changes: 5 additions & 1 deletion drivers/ata/pata_cs5535.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <asm/msr.h>

#define DRV_NAME "cs5535"
#define DRV_VERSION "0.2.10"
#define DRV_VERSION "0.2.11"

/*
* The Geode (Aka Athlon GX now) uses an internal MSR based
Expand Down Expand Up @@ -186,6 +186,8 @@ static struct scsi_host_template cs5535_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static struct ata_port_operations cs5535_port_ops = {
Expand Down Expand Up @@ -269,6 +271,8 @@ static struct pci_driver cs5535_pci_driver = {
.id_table = cs5535,
.probe = cs5535_init_one,
.remove = ata_pci_remove_one
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init cs5535_init(void)
Expand Down
8 changes: 6 additions & 2 deletions drivers/ata/pata_cypress.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_cypress"
#define DRV_VERSION "0.1.2"
#define DRV_VERSION "0.1.4"

/* here are the offset definitions for the registers */

Expand Down Expand Up @@ -137,6 +137,8 @@ static struct scsi_host_template cy82c693_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static struct ata_port_operations cy82c693_port_ops = {
Expand Down Expand Up @@ -204,7 +206,9 @@ static struct pci_driver cy82c693_pci_driver = {
.name = DRV_NAME,
.id_table = cy82c693,
.probe = cy82c693_init_one,
.remove = ata_pci_remove_one
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init cy82c693_init(void)
Expand Down
6 changes: 5 additions & 1 deletion drivers/ata/pata_efar.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <linux/ata.h>

#define DRV_NAME "pata_efar"
#define DRV_VERSION "0.4.2"
#define DRV_VERSION "0.4.3"

/**
* efar_pre_reset - check for 40/80 pin
Expand Down Expand Up @@ -235,6 +235,8 @@ static struct scsi_host_template efar_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static const struct ata_port_operations efar_ops = {
Expand Down Expand Up @@ -316,6 +318,8 @@ static struct pci_driver efar_pci_driver = {
.id_table = efar_pci_tbl,
.probe = efar_init_one,
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init efar_init(void)
Expand Down
6 changes: 5 additions & 1 deletion drivers/ata/pata_marvell.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <linux/ata.h>

#define DRV_NAME "pata_marvell"
#define DRV_VERSION "0.0.5u"
#define DRV_VERSION "0.1.1"

/**
* marvell_pre_reset - check for 40/80 pin
Expand Down Expand Up @@ -103,6 +103,8 @@ static struct scsi_host_template marvell_sht = {
.slave_configure = ata_scsi_slave_config,
/* Use standard CHS mapping rules */
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static const struct ata_port_operations marvell_ops = {
Expand Down Expand Up @@ -197,6 +199,8 @@ static struct pci_driver marvell_pci_driver = {
.id_table = marvell_pci_tbl,
.probe = marvell_init_one,
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init marvell_init(void)
Expand Down
8 changes: 6 additions & 2 deletions drivers/ata/pata_mpiix.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_mpiix"
#define DRV_VERSION "0.7.2"
#define DRV_VERSION "0.7.3"

enum {
IDETIM = 0x6C, /* IDE control register */
Expand Down Expand Up @@ -168,6 +168,8 @@ static struct scsi_host_template mpiix_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static struct ata_port_operations mpiix_port_ops = {
Expand Down Expand Up @@ -285,7 +287,9 @@ static struct pci_driver mpiix_pci_driver = {
.name = DRV_NAME,
.id_table = mpiix,
.probe = mpiix_init_one,
.remove = mpiix_remove_one
.remove = mpiix_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init mpiix_init(void)
Expand Down
6 changes: 5 additions & 1 deletion drivers/ata/pata_netcell.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <linux/ata.h>

#define DRV_NAME "pata_netcell"
#define DRV_VERSION "0.1.5"
#define DRV_VERSION "0.1.6"

/**
* netcell_probe_init - check for 40/80 pin
Expand Down Expand Up @@ -65,6 +65,8 @@ static struct scsi_host_template netcell_sht = {
.slave_destroy = ata_scsi_slave_destroy,
/* Use standard CHS mapping rules */
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static const struct ata_port_operations netcell_ops = {
Expand Down Expand Up @@ -153,6 +155,8 @@ static struct pci_driver netcell_pci_driver = {
.id_table = netcell_pci_tbl,
.probe = netcell_init_one,
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init netcell_init(void)
Expand Down
8 changes: 6 additions & 2 deletions drivers/ata/pata_ns87410.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_ns87410"
#define DRV_VERSION "0.4.2"
#define DRV_VERSION "0.4.3"

/**
* ns87410_pre_reset - probe begin
Expand Down Expand Up @@ -158,6 +158,8 @@ static struct scsi_host_template ns87410_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static struct ata_port_operations ns87410_port_ops = {
Expand Down Expand Up @@ -210,7 +212,9 @@ static struct pci_driver ns87410_pci_driver = {
.name = DRV_NAME,
.id_table = ns87410,
.probe = ns87410_init_one,
.remove = ata_pci_remove_one
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init ns87410_init(void)
Expand Down
4 changes: 4 additions & 0 deletions drivers/ata/pata_oldpiix.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ static struct scsi_host_template oldpiix_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static const struct ata_port_operations oldpiix_pata_ops = {
Expand Down Expand Up @@ -314,6 +316,8 @@ static struct pci_driver oldpiix_pci_driver = {
.id_table = oldpiix_pci_tbl,
.probe = oldpiix_init_one,
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init oldpiix_init(void)
Expand Down
33 changes: 6 additions & 27 deletions drivers/ata/pata_opti.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_opti"
#define DRV_VERSION "0.2.5"
#define DRV_VERSION "0.2.7"

enum {
READ_REG = 0, /* index of Read cycle timing register */
Expand Down Expand Up @@ -109,30 +109,6 @@ static void opti_write_reg(struct ata_port *ap, u8 val, int reg)
outb(0x83, regio + 2);
}

#if 0
/**
* opti_read_reg - control register read
* @ap: ATA port
* @reg: control register number
*
* The Opti uses magic 'trapdoor' register accesses to do configuration
* rather than using PCI space as other controllers do. The double inw
* on the error register activates configuration mode. We can then read
* the control register
*/

static u8 opti_read_reg(struct ata_port *ap, int reg)
{
unsigned long regio = ap->ioaddr.cmd_addr;
u8 ret;
inw(regio + 1);
inw(regio + 1);
outb(3, regio + 2);
ret = inb(regio + reg);
outb(0x83, regio + 2);
}
#endif

/**
* opti_set_piomode - set initial PIO mode data
* @ap: ATA interface
Expand Down Expand Up @@ -204,12 +180,13 @@ static struct scsi_host_template opti_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static struct ata_port_operations opti_port_ops = {
.port_disable = ata_port_disable,
.set_piomode = opti_set_piomode,
/* .set_dmamode = opti_set_dmamode, */
.tf_load = ata_tf_load,
.tf_read = ata_tf_read,
.check_status = ata_check_status,
Expand Down Expand Up @@ -267,7 +244,9 @@ static struct pci_driver opti_pci_driver = {
.name = DRV_NAME,
.id_table = opti,
.probe = opti_init_one,
.remove = ata_pci_remove_one
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init opti_init(void)
Expand Down
8 changes: 6 additions & 2 deletions drivers/ata/pata_optidma.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_optidma"
#define DRV_VERSION "0.2.2"
#define DRV_VERSION "0.2.3"

enum {
READ_REG = 0, /* index of Read cycle timing register */
Expand Down Expand Up @@ -361,6 +361,8 @@ static struct scsi_host_template optidma_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static struct ata_port_operations optidma_port_ops = {
Expand Down Expand Up @@ -522,7 +524,9 @@ static struct pci_driver optidma_pci_driver = {
.name = DRV_NAME,
.id_table = optidma,
.probe = optidma_init_one,
.remove = ata_pci_remove_one
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init optidma_init(void)
Expand Down
4 changes: 4 additions & 0 deletions drivers/ata/pata_radisys.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ static struct scsi_host_template radisys_sht = {
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
.resume = ata_scsi_device_resume,
.suspend = ata_scsi_device_suspend,
};

static const struct ata_port_operations radisys_pata_ops = {
Expand Down Expand Up @@ -311,6 +313,8 @@ static struct pci_driver radisys_pci_driver = {
.id_table = radisys_pci_tbl,
.probe = radisys_init_one,
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
};

static int __init radisys_init(void)
Expand Down
Loading

0 comments on commit 30ced0f

Please sign in to comment.