Date:2012-04-24 19:29:00 (8 years 6 months ago)
Author:Maarten ter Huurne
Commit:e7de309271c0d5199e6c27808c9784f2ffe4f4ef
Message:MIPS: JZ4740: SLCD: TV-out related cleanups.

Return -EINVAL on unknown TV modes.
More consistent code formatting.
Files: drivers/video/jz4740_slcd_fb.c (6 diffs)

Change Details

drivers/video/jz4740_slcd_fb.c
592592#define FB_A320TV_OFF 0
593593#define FB_A320TV_NTSC 1
594594#define FB_A320TV_PAL 2
595#define FB_A320TV_LAST 2
595596
596static void jzfb_tv_out(struct jzfb *jzfb, unsigned int mode)
597static int jzfb_tv_out(struct jzfb *jzfb, unsigned int mode)
597598{
598599    int blank = jzfb->is_enabled ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
599600    struct fb_event event = {
...... 
602603    };
603604
604605    printk("A320 TV out: %d\n", mode);
606    if (mode > FB_A320TV_LAST)
607        return -EINVAL;
605608
606609    if (mode != FB_A320TV_OFF) {
607610        cancel_delayed_work(&jzfb->refresh_work);
...... 
622625        if (mode == FB_A320TV_PAL) {
623626            /* PAL */
624627            /* H-Sync pulse start position */
625            writel(125, jzfb->base + JZ_REG_LCD_HSYNC);
628            writel(0x0000007D, jzfb->base + JZ_REG_LCD_HSYNC);
626629            /* virtual area size */
627630            writel(0x036c0112, jzfb->base + JZ_REG_LCD_VAT);
628631            /* horizontal start/end point */
629632            writel(0x02240364, jzfb->base + JZ_REG_LCD_DAH);
630633            /* vertical start/end point */
631            writel(0x1b010b, jzfb->base + JZ_REG_LCD_DAV);
632        }
633        else {
634            writel(0x001b010b, jzfb->base + JZ_REG_LCD_DAV);
635        } else {
634636            /* NTSC */
635            writel(0x3c, jzfb->base + JZ_REG_LCD_HSYNC);
637            writel(0x0000003c, jzfb->base + JZ_REG_LCD_HSYNC);
636638            writel(0x02e00110, jzfb->base + JZ_REG_LCD_VAT);
637639            writel(0x019902d9, jzfb->base + JZ_REG_LCD_DAH);
638            writel(0x1d010d, jzfb->base + JZ_REG_LCD_DAV);
640            writel(0x001d010d, jzfb->base + JZ_REG_LCD_DAV);
639641        }
640642        writel(0, jzfb->base + JZ_REG_LCD_PS);
641643        writel(0, jzfb->base + JZ_REG_LCD_CLS);
...... 
650652        writel(JZ_LCD_CTRL_BURST_16 | JZ_LCD_CTRL_ENABLE |
651653               JZ_LCD_CTRL_BPP_15_16,
652654               jzfb->base + JZ_REG_LCD_CTRL);
653    }
654    else {
655    } else {
655656        /* disable LCD controller and re-enable SLCD */
656657        writel(JZ_LCD_CFG_SLCD, jzfb->base + JZ_REG_LCD_CFG);
657658        jzfb->panel->enable(jzfb);
...... 
660661
661662    /* reaffirm the current blanking state, to trigger a backlight update */
662663    fb_notifier_call_chain(FB_EVENT_BLANK, &event);
664    return 0;
663665}
664666
665667static int jzfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
...... 
671673            if (!jzfb->is_enabled)
672674                return -EBUSY;
673675
674            jzfb_tv_out(jzfb, arg);
675            break;
676            return jzfb_tv_out(jzfb, arg);
676677        default:
677678            return -EINVAL;
678679    }

Archive Download the corresponding diff file



interactive