Changeset 16952


Ignore:
Timestamp:
2009-07-21T23:14:16+02:00 (7 years ago)
Author:
lars
Message:

[s3c24xx] glamo: Use dev_pm_ops instead of platform suspend/resume.

Location:
trunk/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-core.c

    r16936 r16952  
    4444#include <asm/div64.h> 
    4545 
    46 #ifdef CONFIG_PM 
    4746#include <linux/pm.h> 
    48 #endif 
    4947 
    5048#include "glamo-regs.h" 
     
    12821280#ifdef CONFIG_PM 
    12831281 
    1284 static int glamo_suspend(struct platform_device *pdev, pm_message_t state) 
    1285 { 
    1286         struct glamo_core *glamo = dev_get_drvdata(&pdev->dev); 
     1282static int glamo_suspend(struct device *dev) 
     1283{ 
     1284        struct glamo_core *glamo = dev_get_drvdata(dev); 
    12871285        glamo->suspending = 1; 
    12881286        glamo_power(glamo, GLAMO_POWER_SUSPEND); 
     
    12911289} 
    12921290 
    1293 static int glamo_resume(struct platform_device *pdev) 
    1294 { 
    1295         struct glamo_core *glamo = dev_get_drvdata(&pdev->dev); 
     1291static int glamo_resume(struct device *dev) 
     1292{ 
     1293        struct glamo_core *glamo = dev_get_drvdata(dev); 
    12961294        glamo_power(glamo, GLAMO_POWER_ON); 
    12971295        glamo->suspending = 0; 
     
    13001298} 
    13011299 
     1300static struct dev_pm_ops glamo_pm_ops = { 
     1301        .suspend = glamo_suspend, 
     1302        .resume  = glamo_resume, 
     1303}; 
     1304 
     1305#define GLAMO_PM_OPS (&glamo_pm_ops) 
     1306 
    13021307#else 
    1303 #define glamo_suspend NULL 
    1304 #define glamo_resume  NULL 
     1308#define GLAMO_PM_OPS NULL 
    13051309#endif 
    13061310 
     
    13081312        .probe          = glamo_probe, 
    13091313        .remove         = glamo_remove, 
    1310         .suspend        = glamo_suspend, 
    1311         .resume = glamo_resume, 
    13121314        .driver         = { 
    13131315                .name   = "glamo3362", 
    13141316                .owner  = THIS_MODULE, 
     1317                .pm     = GLAMO_PM_OPS, 
    13151318        }, 
    13161319}; 
  • trunk/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-fb.c

    r16936 r16952  
    954954#ifdef CONFIG_PM 
    955955 
    956 static int glamofb_suspend(struct platform_device *pdev, pm_message_t state) 
    957 { 
    958         struct glamofb_handle *gfb = platform_get_drvdata(pdev); 
     956static int glamofb_suspend(struct device *dev) 
     957{ 
     958        struct glamofb_handle *gfb = dev_get_drvdata(dev); 
    959959 
    960960        /* we need to stop anything touching our framebuffer */ 
     
    969969} 
    970970 
    971 static int glamofb_resume(struct platform_device *pdev) 
    972 { 
    973         struct glamofb_handle *gfb = platform_get_drvdata(pdev); 
    974         struct glamo_fb_platform_data *mach_info = pdev->dev.platform_data; 
     971static int glamofb_resume(struct device *dev) 
     972{ 
     973        struct glamofb_handle *gfb = dev_get_drvdata(dev); 
     974        struct glamo_fb_platform_data *mach_info = dev->platform_data; 
    975975 
    976976        /* OK let's allow framebuffer ops again */ 
     
    980980        glamo_engine_reset(mach_info->core, GLAMO_ENGINE_LCD); 
    981981 
    982         printk(KERN_ERR"spin_lock_init\n"); 
    983         spin_lock_init(&gfb->lock_cmd); 
    984982        glamofb_init_regs(gfb); 
    985983#ifdef CONFIG_MFD_GLAMO_HWACCEL 
     
    991989        return 0; 
    992990} 
     991 
     992static struct dev_pm_ops glamofb_pm_ops = { 
     993        .suspend = glamofb_suspend, 
     994        .resume = glamofb_resume, 
     995}; 
     996 
     997#define GLAMOFB_PM_OPS (&glamofb_pm_ops) 
     998 
    993999#else 
    994 #define glamofb_suspend NULL 
    995 #define glamofb_resume  NULL 
     1000#define GLAMOFB_PM_OPS NULL 
    9961001#endif 
    9971002 
     
    9991004        .probe          = glamofb_probe, 
    10001005        .remove         = glamofb_remove, 
    1001         .suspend        = glamofb_suspend, 
    1002         .resume = glamofb_resume, 
    10031006        .driver         = { 
    10041007                .name   = "glamo-fb", 
    10051008                .owner  = THIS_MODULE, 
     1009                .pm     = GLAMOFB_PM_OPS 
    10061010        }, 
    10071011}; 
  • trunk/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-mci.c

    r16936 r16952  
    140140static void glamo_mci_clock_disable(struct glamo_mci_host *host) { 
    141141        if (host->clk_enabled) { 
    142 /*              glamo_engine_div_disable(host->pdata->core, GLAMO_ENGINE_MMC);*/ 
     142                glamo_engine_div_disable(host->pdata->core, GLAMO_ENGINE_MMC); 
    143143                host->clk_enabled = 0; 
    144         printk("clk disabled\n"); 
    145144        } 
    146145} 
     
    152151                glamo_engine_div_enable(host->pdata->core, GLAMO_ENGINE_MMC); 
    153152                host->clk_enabled = 1; 
    154         printk("clk enabled\n"); 
    155153        } 
    156154} 
     
    830828#ifdef CONFIG_PM 
    831829 
    832 static int glamo_mci_suspend(struct platform_device *dev, pm_message_t state) 
    833 { 
    834         struct mmc_host *mmc = platform_get_drvdata(dev); 
     830static int glamo_mci_suspend(struct device *dev) 
     831{ 
     832        struct mmc_host *mmc = dev_get_drvdata(dev); 
    835833        struct glamo_mci_host *host = mmc_priv(mmc); 
    836834        int ret; 
     
    838836        cancel_work_sync(&host->irq_work); 
    839837 
    840         ret = mmc_suspend_host(mmc, state); 
     838        ret = mmc_suspend_host(mmc, PMSG_SUSPEND); 
    841839        glamo_mci_clock_enable(host); 
    842840 
     
    844842} 
    845843 
    846 static int glamo_mci_resume(struct platform_device *dev) 
    847 { 
    848         struct mmc_host *mmc = platform_get_drvdata(dev); 
     844static int glamo_mci_resume(struct device *dev) 
     845{ 
     846        struct mmc_host *mmc = dev_get_drvdata(dev); 
    849847        struct glamo_mci_host *host = mmc_priv(mmc); 
    850848        int ret; 
    851849 
    852     glamo_engine_enable(host->pdata->core, GLAMO_ENGINE_MMC); 
    853     glamo_engine_reset(host->pdata->core, GLAMO_ENGINE_MMC); 
     850        glamo_engine_enable(host->pdata->core, GLAMO_ENGINE_MMC); 
     851        glamo_engine_reset(host->pdata->core, GLAMO_ENGINE_MMC); 
    854852 
    855853        glamo_reg_write(host, GLAMO_REG_MMC_WDATADS1, 
     
    862860        glamo_reg_write(host, GLAMO_REG_MMC_RDATADS2, 
    863861                        (u16)(host->data_mem->start >> 16)); 
    864     mdelay(5); 
     862        mdelay(5); 
    865863 
    866864        ret = mmc_resume_host(host->mmc); 
     
    869867        return 0; 
    870868} 
    871 EXPORT_SYMBOL_GPL(glamo_mci_resume); 
     869 
     870static struct dev_pm_ops glamo_mci_pm_ops = { 
     871        .suspend = glamo_mci_suspend, 
     872        .resume  = glamo_mci_resume, 
     873}; 
     874#define GLAMO_MCI_PM_OPS (&glamo_mci_pm_ops) 
    872875 
    873876#else /* CONFIG_PM */ 
    874 #define glamo_mci_suspend NULL 
    875 #define glamo_mci_resume NULL 
     877#define GLAMO_MCI_PM_OPS NULL 
    876878#endif /* CONFIG_PM */ 
    877879 
     
    879881static struct platform_driver glamo_mci_driver = 
    880882{ 
    881         .driver.name    = "glamo-mci", 
    882         .probe          = glamo_mci_probe, 
    883         .remove         = glamo_mci_remove, 
    884         .suspend        = glamo_mci_suspend, 
    885         .resume         = glamo_mci_resume, 
     883        .probe  = glamo_mci_probe, 
     884        .remove = glamo_mci_remove, 
     885        .driver = { 
     886                .name  = "glamo-mci", 
     887                .owner = THIS_MODULE, 
     888                .pm    = GLAMO_MCI_PM_OPS, 
     889        }, 
    886890}; 
    887891 
  • trunk/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-spi-gpio.c

    r16863 r16952  
    212212} 
    213213 
    214 /*#define glamo_spigpio_suspend NULL 
    215 #define glamo_spigpio_resume NULL 
    216 */ 
    217  
    218214 
    219215#ifdef CONFIG_PM 
    220 static int glamo_spigpio_suspend(struct platform_device *pdev, pm_message_t state) 
    221 { 
    222         return 0; 
    223 } 
    224  
    225 static int glamo_spigpio_resume(struct platform_device *pdev) 
    226 { 
    227         struct glamo_spigpio *sp = platform_get_drvdata(pdev); 
     216/*static int glamo_spigpio_suspend(struct device *dev) 
     217{ 
     218        return 0; 
     219}*/ 
     220 
     221static int glamo_spigpio_resume(struct device *dev) 
     222{ 
     223        struct glamo_spigpio *sp = dev_get_drvdata(dev); 
    228224 
    229225        if (!sp) 
     
    243239        return 0; 
    244240} 
     241 
     242static struct dev_pm_ops glamo_spigpio_pm_ops = { 
     243/*      .suspend = glamo_spiogpio_suspend,*/ 
     244        .resume_noirq = glamo_spigpio_resume, 
     245}; 
     246 
     247#define GLAMO_SPIGPIO_PM_OPS (&glamo_spigpio_pm_ops) 
     248 
     249#else 
     250#define GLAMO_SPIGPIO_PM_OPS NULL 
    245251#endif 
    246252 
     
    248254        .probe          = glamo_spigpio_probe, 
    249255        .remove         = glamo_spigpio_remove, 
    250 #ifdef CONFIG_PM 
    251         .suspend_late   = glamo_spigpio_suspend, 
    252         .resume_early   = glamo_spigpio_resume, 
    253 #endif 
    254256        .driver         = { 
    255257                .name   = "glamo-spi-gpio", 
    256258                .owner  = THIS_MODULE, 
     259                .pm     = GLAMO_SPIGPIO_PM_OPS, 
    257260        }, 
    258261}; 
Note: See TracChangeset for help on using the changeset viewer.