~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy-proposed

« back to all changes in this revision

Viewing changes to drivers/video/imxfb.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Stefan Bader, Upstream Kernel Changes
  • Date: 2012-08-15 17:17:43 UTC
  • Revision ID: package-import@ubuntu.com-20120815171743-h5wnuf51xe7pvdid
Tags: 3.5.0-207.13
[ Paolo Pisati ]

* Start new release

[ Stefan Bader ]

* (config) Enable getabis to use local package copies

[ Upstream Kernel Changes ]

* fixup: gargabe collect iva_seq[0|1] init
* [Config] enable all SND_OMAP_SOC_*s
* fixup: cm2xxx_3xxx.o is needed for omap2_cm_read|write_reg
* fixup: add some snd_soc_dai* helper functions
* fixup: s/snd_soc_dpcm_params/snd_soc_dpcm/g
* fixup: typo, no_host_mode and useless SDP4430 init
* fixup: enable again aess hwmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
struct imxfb_info {
132
132
        struct platform_device  *pdev;
133
133
        void __iomem            *regs;
134
 
        struct clk              *clk;
 
134
        struct clk              *clk_ipg;
 
135
        struct clk              *clk_ahb;
 
136
        struct clk              *clk_per;
135
137
 
136
138
        /*
137
139
         * These are the addresses we mapped
340
342
 
341
343
        pr_debug("var->bits_per_pixel=%d\n", var->bits_per_pixel);
342
344
 
343
 
        lcd_clk = clk_get_rate(fbi->clk);
 
345
        lcd_clk = clk_get_rate(fbi->clk_per);
344
346
 
345
347
        tmp = var->pixclock * (unsigned long long)lcd_clk;
346
348
 
455
457
 
456
458
        fbi->pwmr = (fbi->pwmr & ~0xFF) | brightness;
457
459
 
458
 
        if (bl->props.fb_blank != FB_BLANK_UNBLANK)
459
 
                clk_enable(fbi->clk);
 
460
        if (bl->props.fb_blank != FB_BLANK_UNBLANK) {
 
461
                clk_prepare_enable(fbi->clk_ipg);
 
462
                clk_prepare_enable(fbi->clk_ahb);
 
463
                clk_prepare_enable(fbi->clk_per);
 
464
        }
460
465
        writel(fbi->pwmr, fbi->regs + LCDC_PWMR);
461
 
        if (bl->props.fb_blank != FB_BLANK_UNBLANK)
462
 
                clk_disable(fbi->clk);
 
466
        if (bl->props.fb_blank != FB_BLANK_UNBLANK) {
 
467
                clk_disable_unprepare(fbi->clk_per);
 
468
                clk_disable_unprepare(fbi->clk_ahb);
 
469
                clk_disable_unprepare(fbi->clk_ipg);
 
470
        }
463
471
 
464
472
        return 0;
465
473
}
522
530
         */
523
531
        writel(RMCR_LCDC_EN_MX1, fbi->regs + LCDC_RMCR);
524
532
 
525
 
        clk_enable(fbi->clk);
 
533
        clk_prepare_enable(fbi->clk_ipg);
 
534
        clk_prepare_enable(fbi->clk_ahb);
 
535
        clk_prepare_enable(fbi->clk_per);
526
536
 
527
537
        if (fbi->backlight_power)
528
538
                fbi->backlight_power(1);
539
549
        if (fbi->lcd_power)
540
550
                fbi->lcd_power(0);
541
551
 
542
 
        clk_disable(fbi->clk);
 
552
        clk_disable_unprepare(fbi->clk_per);
 
553
        clk_disable_unprepare(fbi->clk_ipg);
 
554
        clk_disable_unprepare(fbi->clk_ahb);
543
555
 
544
556
        writel(0, fbi->regs + LCDC_RMCR);
545
557
}
770
782
                goto failed_req;
771
783
        }
772
784
 
773
 
        fbi->clk = clk_get(&pdev->dev, NULL);
774
 
        if (IS_ERR(fbi->clk)) {
775
 
                ret = PTR_ERR(fbi->clk);
776
 
                dev_err(&pdev->dev, "unable to get clock: %d\n", ret);
 
785
        fbi->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
 
786
        if (IS_ERR(fbi->clk_ipg)) {
 
787
                ret = PTR_ERR(fbi->clk_ipg);
 
788
                goto failed_getclock;
 
789
        }
 
790
 
 
791
        fbi->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
 
792
        if (IS_ERR(fbi->clk_ahb)) {
 
793
                ret = PTR_ERR(fbi->clk_ahb);
 
794
                goto failed_getclock;
 
795
        }
 
796
 
 
797
        fbi->clk_per = devm_clk_get(&pdev->dev, "per");
 
798
        if (IS_ERR(fbi->clk_per)) {
 
799
                ret = PTR_ERR(fbi->clk_per);
777
800
                goto failed_getclock;
778
801
        }
779
802
 
858
881
failed_map:
859
882
        iounmap(fbi->regs);
860
883
failed_ioremap:
861
 
        clk_put(fbi->clk);
862
884
failed_getclock:
863
885
        release_mem_region(res->start, resource_size(res));
864
886
failed_req:
895
917
 
896
918
        iounmap(fbi->regs);
897
919
        release_mem_region(res->start, resource_size(res));
898
 
        clk_disable(fbi->clk);
899
 
        clk_put(fbi->clk);
900
920
 
901
921
        platform_set_drvdata(pdev, NULL);
902
922