Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit feb22b7f authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: add proper PCI PM support (v2)



* Keep pointer to ->init_chipset method also in
  struct ide_host and set it in ide_host_alloc_all().

* Add ide_pci_suspend() and ide_pci_resume() helpers
  (default ->suspend and ->resume implementations).

* ->init_chipset can no longer be marked __devinit.

* Add proper PCI PM support to IDE PCI host drivers
  (rz1000.c and tc86c001.c are skipped for now since
  they need to be converted from using ->init_hwif
  to use ->init_chipset instead).

v2:
* Cleanup CONFIG_PM #ifdef-s per akpm's suggestion.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 1785192b
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1586,8 +1586,10 @@ struct ide_host *ide_host_alloc_all(const struct ide_port_info *d,
	if (hws[0])
	if (hws[0])
		host->dev[0] = hws[0]->dev;
		host->dev[0] = hws[0]->dev;


	if (d)
	if (d) {
		host->init_chipset = d->init_chipset;
		host->host_flags = d->host_flags;
		host->host_flags = d->host_flags;
	}


	return host;
	return host;
}
}
+3 −1
Original line number Original line Diff line number Diff line
@@ -139,7 +139,7 @@ static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio)
	drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0);
	drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0);
}
}


static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev)
static unsigned int init_chipset_aec62xx(struct pci_dev *dev)
{
{
	/* These are necessary to get AEC6280 Macintosh cards to work */
	/* These are necessary to get AEC6280 Macintosh cards to work */
	if ((dev->device == PCI_DEVICE_ID_ARTOP_ATP865) ||
	if ((dev->device == PCI_DEVICE_ID_ARTOP_ATP865) ||
@@ -307,6 +307,8 @@ static struct pci_driver driver = {
	.id_table	= aec62xx_pci_tbl,
	.id_table	= aec62xx_pci_tbl,
	.probe		= aec62xx_init_one,
	.probe		= aec62xx_init_one,
	.remove		= __devexit_p(aec62xx_remove),
	.remove		= __devexit_p(aec62xx_remove),
	.suspend	= ide_pci_suspend,
	.resume		= ide_pci_resume,
};
};


static int __init aec62xx_ide_init(void)
static int __init aec62xx_ide_init(void)
+3 −1
Original line number Original line Diff line number Diff line
@@ -213,7 +213,7 @@ static int ali15x3_dma_setup(ide_drive_t *drive)
 *	appropriate also sets up the 1533 southbridge.
 *	appropriate also sets up the 1533 southbridge.
 */
 */


static unsigned int __devinit init_chipset_ali15x3(struct pci_dev *dev)
static unsigned int init_chipset_ali15x3(struct pci_dev *dev)
{
{
	unsigned long flags;
	unsigned long flags;
	u8 tmpbyte;
	u8 tmpbyte;
@@ -581,6 +581,8 @@ static struct pci_driver driver = {
	.id_table	= alim15x3_pci_tbl,
	.id_table	= alim15x3_pci_tbl,
	.probe		= alim15x3_init_one,
	.probe		= alim15x3_init_one,
	.remove		= ide_pci_remove,
	.remove		= ide_pci_remove,
	.suspend	= ide_pci_suspend,
	.resume		= ide_pci_resume,
};
};


static int __init ali15x3_ide_init(void)
static int __init ali15x3_ide_init(void)
+5 −3
Original line number Original line Diff line number Diff line
@@ -112,13 +112,13 @@ static void amd_set_pio_mode(ide_drive_t *drive, const u8 pio)
	amd_set_drive(drive, XFER_PIO_0 + pio);
	amd_set_drive(drive, XFER_PIO_0 + pio);
}
}


static void __devinit amd7409_cable_detect(struct pci_dev *dev)
static void amd7409_cable_detect(struct pci_dev *dev)
{
{
	/* no host side cable detection */
	/* no host side cable detection */
	amd_80w = 0x03;
	amd_80w = 0x03;
}
}


static void __devinit amd7411_cable_detect(struct pci_dev *dev)
static void amd7411_cable_detect(struct pci_dev *dev)
{
{
	int i;
	int i;
	u32 u = 0;
	u32 u = 0;
@@ -140,7 +140,7 @@ static void __devinit amd7411_cable_detect(struct pci_dev *dev)
 * The initialization callback.  Initialize drive independent registers.
 * The initialization callback.  Initialize drive independent registers.
 */
 */


static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev)
static unsigned int init_chipset_amd74xx(struct pci_dev *dev)
{
{
	u8 t = 0, offset = amd_offset(dev);
	u8 t = 0, offset = amd_offset(dev);


@@ -324,6 +324,8 @@ static struct pci_driver driver = {
	.id_table	= amd74xx_pci_tbl,
	.id_table	= amd74xx_pci_tbl,
	.probe		= amd74xx_probe,
	.probe		= amd74xx_probe,
	.remove		= ide_pci_remove,
	.remove		= ide_pci_remove,
	.suspend	= ide_pci_suspend,
	.resume		= ide_pci_resume,
};
};


static int __init amd74xx_ide_init(void)
static int __init amd74xx_ide_init(void)
+2 −0
Original line number Original line Diff line number Diff line
@@ -187,6 +187,8 @@ static struct pci_driver driver = {
	.id_table	= atiixp_pci_tbl,
	.id_table	= atiixp_pci_tbl,
	.probe		= atiixp_init_one,
	.probe		= atiixp_init_one,
	.remove		= ide_pci_remove,
	.remove		= ide_pci_remove,
	.suspend	= ide_pci_suspend,
	.resume		= ide_pci_resume,
};
};


static int __init atiixp_ide_init(void)
static int __init atiixp_ide_init(void)
Loading