diff options
author | Robby Cai <R63905@freescale.com> | 2011-04-26 17:54:37 +0800 |
---|---|---|
committer | Robby Cai <R63905@freescale.com> | 2011-04-27 16:17:03 +0800 |
commit | 8a1114f7381922aefbb305bf3840ecb38da40359 (patch) | |
tree | c20b679ae466f48a984e81eaa1eb6ec2c6467145 /drivers/video/mxc/mxcfb_seiko_wvga.c | |
parent | ea54d35e6758586c8d0cc014e71a3d7723155b1c (diff) |
ENGR00142581-2 MX50 RD3: Add PINMUX setting callback in wvga driver
Added get_pins/put_pins/enable_pins/disable_pins callbacks in driver,
which is passed as platform data.
Signed-off-by: Robby Cai <R63905@freescale.com>
Diffstat (limited to 'drivers/video/mxc/mxcfb_seiko_wvga.c')
-rw-r--r-- | drivers/video/mxc/mxcfb_seiko_wvga.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/video/mxc/mxcfb_seiko_wvga.c b/drivers/video/mxc/mxcfb_seiko_wvga.c index 9b3e9fddafe7..b5de61a5ab7e 100644 --- a/drivers/video/mxc/mxcfb_seiko_wvga.c +++ b/drivers/video/mxc/mxcfb_seiko_wvga.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -128,6 +128,9 @@ static int __devinit lcd_probe(struct platform_device *pdev) if (plat->reset) plat->reset(); + if (plat->get_pins) + plat->get_pins(); + io_reg = regulator_get(&pdev->dev, plat->io_reg); if (IS_ERR(io_reg)) io_reg = NULL; @@ -148,6 +151,7 @@ static int __devinit lcd_probe(struct platform_device *pdev) fb_register_client(&nb); + platform_set_drvdata(pdev, plat); plcd_dev = pdev; return 0; @@ -155,12 +159,16 @@ static int __devinit lcd_probe(struct platform_device *pdev) static int __devexit lcd_remove(struct platform_device *pdev) { + struct mxc_lcd_platform_data *plat = pdev->dev.platform_data; + fb_unregister_client(&nb); lcd_poweroff(); if (io_reg) regulator_put(io_reg); if (core_reg) regulator_put(core_reg); + if (plat->put_pins) + plat->put_pins(); return 0; } @@ -173,6 +181,11 @@ static int lcd_suspend(struct platform_device *pdev, pm_message_t state) static int lcd_resume(struct platform_device *pdev) { + struct mxc_lcd_platform_data *plat = pdev->dev.platform_data; + + if (plat && plat->reset) + plat->reset(); + return 0; } #else @@ -198,9 +211,14 @@ static struct platform_driver lcd_driver = { */ static void lcd_poweron(void) { + struct mxc_lcd_platform_data *plat = platform_get_drvdata(plcd_dev); + if (lcd_on) return; + if (plat->enable_pins) + plat->enable_pins(); + dev_dbg(&plcd_dev->dev, "turning on LCD\n"); if (core_reg) regulator_enable(core_reg); @@ -215,12 +233,17 @@ static void lcd_poweron(void) */ static void lcd_poweroff(void) { + struct mxc_lcd_platform_data *plat = platform_get_drvdata(plcd_dev); + lcd_on = 0; dev_dbg(&plcd_dev->dev, "turning off LCD\n"); if (io_reg) regulator_disable(io_reg); if (core_reg) regulator_disable(core_reg); + + if (plat->disable_pins) + plat->disable_pins(); } static int __init seiko_wvga_lcd_init(void) |