diff options
Diffstat (limited to 'drivers/mfd/mcp-sa11x0.c')
-rw-r--r-- | drivers/mfd/mcp-sa11x0.c | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c index e9806fbbe69..1eab7cffcea 100644 --- a/drivers/mfd/mcp-sa11x0.c +++ b/drivers/mfd/mcp-sa11x0.c @@ -18,7 +18,7 @@ #include <linux/delay.h> #include <linux/spinlock.h> #include <linux/slab.h> -#include <linux/device.h> +#include <linux/platform_device.h> #include <asm/dma.h> #include <asm/hardware.h> @@ -138,9 +138,8 @@ static struct mcp_ops mcp_sa11x0 = { .disable = mcp_sa11x0_disable, }; -static int mcp_sa11x0_probe(struct device *dev) +static int mcp_sa11x0_probe(struct platform_device *pdev) { - struct platform_device *pdev = to_platform_device(dev); struct mcp_plat_data *data = pdev->dev.platform_data; struct mcp *mcp; int ret; @@ -165,7 +164,7 @@ static int mcp_sa11x0_probe(struct device *dev) mcp->dma_telco_rd = DMA_Ser4MCP1Rd; mcp->dma_telco_wr = DMA_Ser4MCP1Wr; - dev_set_drvdata(dev, mcp); + platform_set_drvdata(pdev, mcp); if (machine_is_assabet()) { ASSABET_BCR_set(ASSABET_BCR_CODEC_RST); @@ -202,56 +201,55 @@ static int mcp_sa11x0_probe(struct device *dev) release: release_mem_region(0x80060000, 0x60); - dev_set_drvdata(dev, NULL); + platform_set_drvdata(pdev, NULL); out: return ret; } -static int mcp_sa11x0_remove(struct device *dev) +static int mcp_sa11x0_remove(struct platform_device *dev) { - struct mcp *mcp = dev_get_drvdata(dev); + struct mcp *mcp = platform_get_drvdata(dev); - dev_set_drvdata(dev, NULL); + platform_set_drvdata(dev, NULL); mcp_host_unregister(mcp); release_mem_region(0x80060000, 0x60); return 0; } -static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state, u32 level) +static int mcp_sa11x0_suspend(struct platform_device *dev, pm_message_t state) { - struct mcp *mcp = dev_get_drvdata(dev); + struct mcp *mcp = platform_get_drvdata(dev); + + priv(mcp)->mccr0 = Ser4MCCR0; + priv(mcp)->mccr1 = Ser4MCCR1; + Ser4MCCR0 &= ~MCCR0_MCE; - if (level == SUSPEND_DISABLE) { - priv(mcp)->mccr0 = Ser4MCCR0; - priv(mcp)->mccr1 = Ser4MCCR1; - Ser4MCCR0 &= ~MCCR0_MCE; - } return 0; } -static int mcp_sa11x0_resume(struct device *dev, u32 level) +static int mcp_sa11x0_resume(struct platform_device *dev) { - struct mcp *mcp = dev_get_drvdata(dev); + struct mcp *mcp = platform_get_drvdata(dev); + + Ser4MCCR1 = priv(mcp)->mccr1; + Ser4MCCR0 = priv(mcp)->mccr0; - if (level == RESUME_RESTORE_STATE) { - Ser4MCCR1 = priv(mcp)->mccr1; - Ser4MCCR0 = priv(mcp)->mccr0; - } return 0; } /* * The driver for the SA11x0 MCP port. */ -static struct device_driver mcp_sa11x0_driver = { - .name = "sa11x0-mcp", - .bus = &platform_bus_type, +static struct platform_driver mcp_sa11x0_driver = { .probe = mcp_sa11x0_probe, .remove = mcp_sa11x0_remove, .suspend = mcp_sa11x0_suspend, .resume = mcp_sa11x0_resume, + .driver = { + .name = "sa11x0-mcp", + }, }; /* @@ -259,12 +257,12 @@ static struct device_driver mcp_sa11x0_driver = { */ static int __init mcp_sa11x0_init(void) { - return driver_register(&mcp_sa11x0_driver); + return platform_driver_register(&mcp_sa11x0_driver); } static void __exit mcp_sa11x0_exit(void) { - driver_unregister(&mcp_sa11x0_driver); + platform_driver_unregister(&mcp_sa11x0_driver); } module_init(mcp_sa11x0_init); |