aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-02-07 10:31:56 -0500
committerNicolas Ferre <nicolas.ferre@atmel.com>2013-03-13 06:05:11 -0400
commit557b7d5d0787997247a798e6f46541fe9dc977fa (patch)
treee38f38290608819345f711ebd1f286054475b1d6 /drivers/video
parent67cf9c0a00bd88443adb7d6c3efa8b18d03f97c5 (diff)
ARM: at91/avr32/atmel_lcdfb: add bus-clock entry
Add hclk entry for the atmel_lcdfb bus clock. On at91sam9261, at91sam9g10 and at32ap the bus clock has to be enabled as well as the peripheral clock. Add the appropriate lookup entries to these SOCs and fake clocks to the SOCs that do not use it. This allows us to get rid of the conditional enabling of the clocks in the driver which relied on the cpu_is macros. Tested on at91sam9263 and at91sam9g45, compile-tested for other AT91-SOCs, and untested for AVR32. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/atmel_lcdfb.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 025428e04c33..c5883cafa38a 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -821,15 +821,13 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
821 821
822static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo) 822static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
823{ 823{
824 if (sinfo->bus_clk) 824 clk_enable(sinfo->bus_clk);
825 clk_enable(sinfo->bus_clk);
826 clk_enable(sinfo->lcdc_clk); 825 clk_enable(sinfo->lcdc_clk);
827} 826}
828 827
829static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo) 828static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
830{ 829{
831 if (sinfo->bus_clk) 830 clk_disable(sinfo->bus_clk);
832 clk_disable(sinfo->bus_clk);
833 clk_disable(sinfo->lcdc_clk); 831 clk_disable(sinfo->lcdc_clk);
834} 832}
835 833
@@ -888,13 +886,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
888 info->fix = atmel_lcdfb_fix; 886 info->fix = atmel_lcdfb_fix;
889 887
890 /* Enable LCDC Clocks */ 888 /* Enable LCDC Clocks */
891 if (cpu_is_at91sam9261() || cpu_is_at91sam9g10() 889 sinfo->bus_clk = clk_get(dev, "hclk");
892 || cpu_is_at32ap7000()) { 890 if (IS_ERR(sinfo->bus_clk)) {
893 sinfo->bus_clk = clk_get(dev, "hck1"); 891 ret = PTR_ERR(sinfo->bus_clk);
894 if (IS_ERR(sinfo->bus_clk)) { 892 goto free_info;
895 ret = PTR_ERR(sinfo->bus_clk);
896 goto free_info;
897 }
898 } 893 }
899 sinfo->lcdc_clk = clk_get(dev, "lcdc_clk"); 894 sinfo->lcdc_clk = clk_get(dev, "lcdc_clk");
900 if (IS_ERR(sinfo->lcdc_clk)) { 895 if (IS_ERR(sinfo->lcdc_clk)) {
@@ -1055,8 +1050,7 @@ stop_clk:
1055 atmel_lcdfb_stop_clock(sinfo); 1050 atmel_lcdfb_stop_clock(sinfo);
1056 clk_put(sinfo->lcdc_clk); 1051 clk_put(sinfo->lcdc_clk);
1057put_bus_clk: 1052put_bus_clk:
1058 if (sinfo->bus_clk) 1053 clk_put(sinfo->bus_clk);
1059 clk_put(sinfo->bus_clk);
1060free_info: 1054free_info:
1061 framebuffer_release(info); 1055 framebuffer_release(info);
1062out: 1056out:
@@ -1081,8 +1075,7 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
1081 unregister_framebuffer(info); 1075 unregister_framebuffer(info);
1082 atmel_lcdfb_stop_clock(sinfo); 1076 atmel_lcdfb_stop_clock(sinfo);
1083 clk_put(sinfo->lcdc_clk); 1077 clk_put(sinfo->lcdc_clk);
1084 if (sinfo->bus_clk) 1078 clk_put(sinfo->bus_clk);
1085 clk_put(sinfo->bus_clk);
1086 fb_dealloc_cmap(&info->cmap); 1079 fb_dealloc_cmap(&info->cmap);
1087 free_irq(sinfo->irq_base, info); 1080 free_irq(sinfo->irq_base, info);
1088 iounmap(sinfo->mmio); 1081 iounmap(sinfo->mmio);