diff options
Diffstat (limited to 'drivers/video/mxsfb.c')
-rw-r--r-- | drivers/video/mxsfb.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 4a89f889852d..abbe691047bd 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <linux/clk.h> | 45 | #include <linux/clk.h> |
46 | #include <linux/dma-mapping.h> | 46 | #include <linux/dma-mapping.h> |
47 | #include <linux/io.h> | 47 | #include <linux/io.h> |
48 | #include <linux/pinctrl/consumer.h> | ||
48 | #include <mach/mxsfb.h> | 49 | #include <mach/mxsfb.h> |
49 | 50 | ||
50 | #define REG_SET 4 | 51 | #define REG_SET 4 |
@@ -756,6 +757,7 @@ static int __devinit mxsfb_probe(struct platform_device *pdev) | |||
756 | struct mxsfb_info *host; | 757 | struct mxsfb_info *host; |
757 | struct fb_info *fb_info; | 758 | struct fb_info *fb_info; |
758 | struct fb_modelist *modelist; | 759 | struct fb_modelist *modelist; |
760 | struct pinctrl *pinctrl; | ||
759 | int i, ret; | 761 | int i, ret; |
760 | 762 | ||
761 | if (!pdata) { | 763 | if (!pdata) { |
@@ -793,6 +795,12 @@ static int __devinit mxsfb_probe(struct platform_device *pdev) | |||
793 | 795 | ||
794 | host->devdata = &mxsfb_devdata[pdev->id_entry->driver_data]; | 796 | host->devdata = &mxsfb_devdata[pdev->id_entry->driver_data]; |
795 | 797 | ||
798 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); | ||
799 | if (IS_ERR(pinctrl)) { | ||
800 | ret = PTR_ERR(pinctrl); | ||
801 | goto error_getpin; | ||
802 | } | ||
803 | |||
796 | host->clk = clk_get(&host->pdev->dev, NULL); | 804 | host->clk = clk_get(&host->pdev->dev, NULL); |
797 | if (IS_ERR(host->clk)) { | 805 | if (IS_ERR(host->clk)) { |
798 | ret = PTR_ERR(host->clk); | 806 | ret = PTR_ERR(host->clk); |
@@ -848,6 +856,7 @@ error_init_fb: | |||
848 | error_pseudo_pallette: | 856 | error_pseudo_pallette: |
849 | clk_put(host->clk); | 857 | clk_put(host->clk); |
850 | error_getclock: | 858 | error_getclock: |
859 | error_getpin: | ||
851 | iounmap(host->base); | 860 | iounmap(host->base); |
852 | error_ioremap: | 861 | error_ioremap: |
853 | framebuffer_release(fb_info); | 862 | framebuffer_release(fb_info); |
@@ -880,6 +889,18 @@ static int __devexit mxsfb_remove(struct platform_device *pdev) | |||
880 | return 0; | 889 | return 0; |
881 | } | 890 | } |
882 | 891 | ||
892 | static void mxsfb_shutdown(struct platform_device *pdev) | ||
893 | { | ||
894 | struct fb_info *fb_info = platform_get_drvdata(pdev); | ||
895 | struct mxsfb_info *host = to_imxfb_host(fb_info); | ||
896 | |||
897 | /* | ||
898 | * Force stop the LCD controller as keeping it running during reboot | ||
899 | * might interfere with the BootROM's boot mode pads sampling. | ||
900 | */ | ||
901 | writel(CTRL_RUN, host->base + LCDC_CTRL + REG_CLR); | ||
902 | } | ||
903 | |||
883 | static struct platform_device_id mxsfb_devtype[] = { | 904 | static struct platform_device_id mxsfb_devtype[] = { |
884 | { | 905 | { |
885 | .name = "imx23-fb", | 906 | .name = "imx23-fb", |
@@ -896,6 +917,7 @@ MODULE_DEVICE_TABLE(platform, mxsfb_devtype); | |||
896 | static struct platform_driver mxsfb_driver = { | 917 | static struct platform_driver mxsfb_driver = { |
897 | .probe = mxsfb_probe, | 918 | .probe = mxsfb_probe, |
898 | .remove = __devexit_p(mxsfb_remove), | 919 | .remove = __devexit_p(mxsfb_remove), |
920 | .shutdown = mxsfb_shutdown, | ||
899 | .id_table = mxsfb_devtype, | 921 | .id_table = mxsfb_devtype, |
900 | .driver = { | 922 | .driver = { |
901 | .name = DRIVER_NAME, | 923 | .name = DRIVER_NAME, |