~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/video/atmel_lcdfb.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
}
69
69
#endif
70
70
 
71
 
static const u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
 
71
static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
72
72
                | ATMEL_LCDC_POL_POSITIVE
73
73
                | ATMEL_LCDC_ENA_PWMENABLE;
74
74
 
127
127
                return;
128
128
 
129
129
        memset(&props, 0, sizeof(struct backlight_properties));
 
130
        props.type = BACKLIGHT_RAW;
130
131
        props.max_brightness = 0xff;
131
132
        bl = backlight_device_register("backlight", &sinfo->pdev->dev, sinfo,
132
133
                                       &atmel_lcdc_bl_ops, &props);
163
164
 
164
165
static void init_contrast(struct atmel_lcdfb_info *sinfo)
165
166
{
 
167
        /* contrast pwm can be 'inverted' */
 
168
        if (sinfo->lcdcon_pol_negative)
 
169
                        contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE);
 
170
 
166
171
        /* have some default contrast/backlight settings */
167
172
        lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
168
173
        lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT);
632
637
 *      magnitude which needs to be scaled in this function for the hardware.
633
638
 *      Things to take into consideration are how many color registers, if
634
639
 *      any, are supported with the current color visual. With truecolor mode
635
 
 *      no color palettes are supported. Here a psuedo palette is created
 
640
 *      no color palettes are supported. Here a pseudo palette is created
636
641
 *      which we store the value in pseudo_palette in struct fb_info. For
637
642
 *      pseudocolor mode we have a limited color palette. To deal with this
638
643
 *      we can program what color is displayed for a particular pixel value.
710
715
        return 0;
711
716
}
712
717
 
 
718
static int atmel_lcdfb_blank(int blank_mode, struct fb_info *info)
 
719
{
 
720
        struct atmel_lcdfb_info *sinfo = info->par;
 
721
 
 
722
        switch (blank_mode) {
 
723
        case FB_BLANK_UNBLANK:
 
724
        case FB_BLANK_NORMAL:
 
725
                atmel_lcdfb_start(sinfo);
 
726
                break;
 
727
        case FB_BLANK_VSYNC_SUSPEND:
 
728
        case FB_BLANK_HSYNC_SUSPEND:
 
729
                break;
 
730
        case FB_BLANK_POWERDOWN:
 
731
                atmel_lcdfb_stop(sinfo);
 
732
                break;
 
733
        default:
 
734
                return -EINVAL;
 
735
        }
 
736
 
 
737
        /* let fbcon do a soft blank for us */
 
738
        return ((blank_mode == FB_BLANK_NORMAL) ? 1 : 0);
 
739
}
 
740
 
713
741
static struct fb_ops atmel_lcdfb_ops = {
714
742
        .owner          = THIS_MODULE,
715
743
        .fb_check_var   = atmel_lcdfb_check_var,
716
744
        .fb_set_par     = atmel_lcdfb_set_par,
717
745
        .fb_setcolreg   = atmel_lcdfb_setcolreg,
 
746
        .fb_blank       = atmel_lcdfb_blank,
718
747
        .fb_pan_display = atmel_lcdfb_pan_display,
719
748
        .fb_fillrect    = cfb_fillrect,
720
749
        .fb_copyarea    = cfb_copyarea,
816
845
                sinfo->guard_time = pdata_sinfo->guard_time;
817
846
                sinfo->smem_len = pdata_sinfo->smem_len;
818
847
                sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight;
 
848
                sinfo->lcdcon_pol_negative = pdata_sinfo->lcdcon_pol_negative;
819
849
                sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode;
820
850
        } else {
821
851
                dev_err(dev, "cannot get default configuration\n");