mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 11:16:11 +00:00
Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: PM / yenta: Fix cardbus suspend/resume regression PM / PCMCIA: Drop second argument of pcmcia_socket_dev_suspend()
This commit is contained in:
commit
9c1fe834c1
18 changed files with 65 additions and 57 deletions
|
@ -363,7 +363,7 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
|
|||
struct at91_cf_socket *cf = platform_get_drvdata(pdev);
|
||||
struct at91_cf_data *board = cf->board;
|
||||
|
||||
pcmcia_socket_dev_suspend(&pdev->dev, mesg);
|
||||
pcmcia_socket_dev_suspend(&pdev->dev);
|
||||
if (device_may_wakeup(&pdev->dev)) {
|
||||
enable_irq_wake(board->det_pin);
|
||||
if (board->irq_pin)
|
||||
|
|
|
@ -515,7 +515,7 @@ static int au1x00_drv_pcmcia_probe(struct platform_device *dev)
|
|||
static int au1x00_drv_pcmcia_suspend(struct platform_device *dev,
|
||||
pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&dev->dev);
|
||||
}
|
||||
|
||||
static int au1x00_drv_pcmcia_resume(struct platform_device *dev)
|
||||
|
|
|
@ -302,7 +302,7 @@ static int __devexit bfin_cf_remove(struct platform_device *pdev)
|
|||
|
||||
static int bfin_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&pdev->dev, mesg);
|
||||
return pcmcia_socket_dev_suspend(&pdev->dev);
|
||||
}
|
||||
|
||||
static int bfin_cf_resume(struct platform_device *pdev)
|
||||
|
|
|
@ -101,7 +101,7 @@ EXPORT_SYMBOL(pcmcia_socket_list_rwsem);
|
|||
static int socket_resume(struct pcmcia_socket *skt);
|
||||
static int socket_suspend(struct pcmcia_socket *skt);
|
||||
|
||||
int pcmcia_socket_dev_suspend(struct device *dev, pm_message_t state)
|
||||
int pcmcia_socket_dev_suspend(struct device *dev)
|
||||
{
|
||||
struct pcmcia_socket *socket;
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
|
|||
#ifdef CONFIG_PM
|
||||
static int i82092aa_socket_suspend (struct pci_dev *dev, pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&dev->dev);
|
||||
}
|
||||
|
||||
static int i82092aa_socket_resume (struct pci_dev *dev)
|
||||
|
|
|
@ -1241,7 +1241,7 @@ static int pcic_init(struct pcmcia_socket *s)
|
|||
static int i82365_drv_pcmcia_suspend(struct platform_device *dev,
|
||||
pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&dev->dev);
|
||||
}
|
||||
|
||||
static int i82365_drv_pcmcia_resume(struct platform_device *dev)
|
||||
|
|
|
@ -699,7 +699,7 @@ static struct pccard_operations pcc_operations = {
|
|||
static int cfc_drv_pcmcia_suspend(struct platform_device *dev,
|
||||
pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&dev->dev);
|
||||
}
|
||||
|
||||
static int cfc_drv_pcmcia_resume(struct platform_device *dev)
|
||||
|
|
|
@ -675,7 +675,7 @@ static struct pccard_operations pcc_operations = {
|
|||
static int pcc_drv_pcmcia_suspend(struct platform_device *dev,
|
||||
pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&dev->dev);
|
||||
}
|
||||
|
||||
static int pcc_drv_pcmcia_resume(struct platform_device *dev)
|
||||
|
|
|
@ -1296,7 +1296,7 @@ static int m8xx_remove(struct of_device *ofdev)
|
|||
#ifdef CONFIG_PM
|
||||
static int m8xx_suspend(struct platform_device *pdev, pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&pdev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&pdev->dev);
|
||||
}
|
||||
|
||||
static int m8xx_resume(struct platform_device *pdev)
|
||||
|
|
|
@ -334,7 +334,7 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
|
|||
|
||||
static int omap_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&pdev->dev, mesg);
|
||||
return pcmcia_socket_dev_suspend(&pdev->dev);
|
||||
}
|
||||
|
||||
static int omap_cf_resume(struct platform_device *pdev)
|
||||
|
|
|
@ -758,7 +758,7 @@ static void __devexit pd6729_pci_remove(struct pci_dev *dev)
|
|||
#ifdef CONFIG_PM
|
||||
static int pd6729_socket_suspend(struct pci_dev *dev, pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&dev->dev);
|
||||
}
|
||||
|
||||
static int pd6729_socket_resume(struct pci_dev *dev)
|
||||
|
|
|
@ -302,7 +302,7 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
|
|||
|
||||
static int pxa2xx_drv_pcmcia_suspend(struct device *dev)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(dev, PMSG_SUSPEND);
|
||||
return pcmcia_socket_dev_suspend(dev);
|
||||
}
|
||||
|
||||
static int pxa2xx_drv_pcmcia_resume(struct device *dev)
|
||||
|
|
|
@ -89,7 +89,7 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
|
|||
static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev,
|
||||
pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&dev->dev);
|
||||
}
|
||||
|
||||
static int sa11x0_drv_pcmcia_resume(struct platform_device *dev)
|
||||
|
|
|
@ -159,7 +159,7 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev)
|
|||
|
||||
static int pcmcia_suspend(struct sa1111_dev *dev, pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&dev->dev);
|
||||
}
|
||||
|
||||
static int pcmcia_resume(struct sa1111_dev *dev)
|
||||
|
|
|
@ -366,7 +366,7 @@ static int __init get_tcic_id(void)
|
|||
static int tcic_drv_pcmcia_suspend(struct platform_device *dev,
|
||||
pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&dev->dev);
|
||||
}
|
||||
|
||||
static int tcic_drv_pcmcia_resume(struct platform_device *dev)
|
||||
|
|
|
@ -707,7 +707,7 @@ __setup("vrc4171_card=", vrc4171_card_setup);
|
|||
static int vrc4171_card_suspend(struct platform_device *dev,
|
||||
pm_message_t state)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
return pcmcia_socket_dev_suspend(&dev->dev);
|
||||
}
|
||||
|
||||
static int vrc4171_card_resume(struct platform_device *dev)
|
||||
|
|
|
@ -1225,60 +1225,71 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
|
|||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state)
|
||||
static int yenta_dev_suspend_noirq(struct device *dev)
|
||||
{
|
||||
struct yenta_socket *socket = pci_get_drvdata(dev);
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
struct yenta_socket *socket = pci_get_drvdata(pdev);
|
||||
int ret;
|
||||
|
||||
ret = pcmcia_socket_dev_suspend(&dev->dev, state);
|
||||
ret = pcmcia_socket_dev_suspend(dev);
|
||||
|
||||
if (socket) {
|
||||
if (socket->type && socket->type->save_state)
|
||||
socket->type->save_state(socket);
|
||||
if (!socket)
|
||||
return ret;
|
||||
|
||||
/* FIXME: pci_save_state needs to have a better interface */
|
||||
pci_save_state(dev);
|
||||
pci_read_config_dword(dev, 16*4, &socket->saved_state[0]);
|
||||
pci_read_config_dword(dev, 17*4, &socket->saved_state[1]);
|
||||
pci_disable_device(dev);
|
||||
if (socket->type && socket->type->save_state)
|
||||
socket->type->save_state(socket);
|
||||
|
||||
/*
|
||||
* Some laptops (IBM T22) do not like us putting the Cardbus
|
||||
* bridge into D3. At a guess, some other laptop will
|
||||
* probably require this, so leave it commented out for now.
|
||||
*/
|
||||
/* pci_set_power_state(dev, 3); */
|
||||
}
|
||||
pci_save_state(pdev);
|
||||
pci_read_config_dword(pdev, 16*4, &socket->saved_state[0]);
|
||||
pci_read_config_dword(pdev, 17*4, &socket->saved_state[1]);
|
||||
pci_disable_device(pdev);
|
||||
|
||||
/*
|
||||
* Some laptops (IBM T22) do not like us putting the Cardbus
|
||||
* bridge into D3. At a guess, some other laptop will
|
||||
* probably require this, so leave it commented out for now.
|
||||
*/
|
||||
/* pci_set_power_state(dev, 3); */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int yenta_dev_resume (struct pci_dev *dev)
|
||||
static int yenta_dev_resume_noirq(struct device *dev)
|
||||
{
|
||||
struct yenta_socket *socket = pci_get_drvdata(dev);
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
struct yenta_socket *socket = pci_get_drvdata(pdev);
|
||||
int ret;
|
||||
|
||||
if (socket) {
|
||||
int rc;
|
||||
if (!socket)
|
||||
return 0;
|
||||
|
||||
pci_set_power_state(dev, 0);
|
||||
/* FIXME: pci_restore_state needs to have a better interface */
|
||||
pci_restore_state(dev);
|
||||
pci_write_config_dword(dev, 16*4, socket->saved_state[0]);
|
||||
pci_write_config_dword(dev, 17*4, socket->saved_state[1]);
|
||||
pci_write_config_dword(pdev, 16*4, socket->saved_state[0]);
|
||||
pci_write_config_dword(pdev, 17*4, socket->saved_state[1]);
|
||||
|
||||
rc = pci_enable_device(dev);
|
||||
if (rc)
|
||||
return rc;
|
||||
ret = pci_enable_device(pdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pci_set_master(dev);
|
||||
pci_set_master(pdev);
|
||||
|
||||
if (socket->type && socket->type->restore_state)
|
||||
socket->type->restore_state(socket);
|
||||
}
|
||||
if (socket->type && socket->type->restore_state)
|
||||
socket->type->restore_state(socket);
|
||||
|
||||
return pcmcia_socket_dev_resume(&dev->dev);
|
||||
return pcmcia_socket_dev_resume(dev);
|
||||
}
|
||||
|
||||
static struct dev_pm_ops yenta_pm_ops = {
|
||||
.suspend_noirq = yenta_dev_suspend_noirq,
|
||||
.resume_noirq = yenta_dev_resume_noirq,
|
||||
.freeze_noirq = yenta_dev_suspend_noirq,
|
||||
.thaw_noirq = yenta_dev_resume_noirq,
|
||||
.poweroff_noirq = yenta_dev_suspend_noirq,
|
||||
.restore_noirq = yenta_dev_resume_noirq,
|
||||
};
|
||||
|
||||
#define YENTA_PM_OPS (¥ta_pm_ops)
|
||||
#else
|
||||
#define YENTA_PM_OPS NULL
|
||||
#endif
|
||||
|
||||
#define CB_ID(vend,dev,type) \
|
||||
|
@ -1376,10 +1387,7 @@ static struct pci_driver yenta_cardbus_driver = {
|
|||
.id_table = yenta_table,
|
||||
.probe = yenta_probe,
|
||||
.remove = __devexit_p(yenta_close),
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = yenta_dev_suspend,
|
||||
.resume = yenta_dev_resume,
|
||||
#endif
|
||||
.driver.pm = YENTA_PM_OPS,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -279,7 +279,7 @@ extern struct pccard_resource_ops pccard_iodyn_ops;
|
|||
extern struct pccard_resource_ops pccard_nonstatic_ops;
|
||||
|
||||
/* socket drivers are expected to use these callbacks in their .drv struct */
|
||||
extern int pcmcia_socket_dev_suspend(struct device *dev, pm_message_t state);
|
||||
extern int pcmcia_socket_dev_suspend(struct device *dev);
|
||||
extern int pcmcia_socket_dev_resume(struct device *dev);
|
||||
|
||||
/* socket drivers use this callback in their IRQ handler */
|
||||
|
|
Loading…
Reference in a new issue