Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sm501: add inversion controls for VBIASEN and FPEN

Add flags to allow the driver to invert the sense of both VBIASEN and FPEN
signals comming from the SM501.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Ben Dooks and committed by
Linus Torvalds
206c5d69 968910bd

+24 -4
+22 -4
drivers/video/sm501fb.c
··· 663 663 sm501fb_sync_regs(fbi); 664 664 mdelay(10); 665 665 666 + /* VBIASEN */ 667 + 666 668 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) { 667 - control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */ 669 + if (pd->flags & SM501FB_FLAG_PANEL_INV_VBIASEN) 670 + control &= ~SM501_DC_PANEL_CONTROL_BIAS; 671 + else 672 + control |= SM501_DC_PANEL_CONTROL_BIAS; 673 + 668 674 writel(control, ctrl_reg); 669 675 sm501fb_sync_regs(fbi); 670 676 mdelay(10); 671 677 } 672 678 673 679 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) { 674 - control |= SM501_DC_PANEL_CONTROL_FPEN; 680 + if (pd->flags & SM501FB_FLAG_PANEL_INV_FPEN) 681 + control &= ~SM501_DC_PANEL_CONTROL_FPEN; 682 + else 683 + control |= SM501_DC_PANEL_CONTROL_FPEN; 684 + 675 685 writel(control, ctrl_reg); 676 686 sm501fb_sync_regs(fbi); 677 687 mdelay(10); ··· 689 679 } else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) { 690 680 /* disable panel power */ 691 681 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) { 692 - control &= ~SM501_DC_PANEL_CONTROL_FPEN; 682 + if (pd->flags & SM501FB_FLAG_PANEL_INV_FPEN) 683 + control |= SM501_DC_PANEL_CONTROL_FPEN; 684 + else 685 + control &= ~SM501_DC_PANEL_CONTROL_FPEN; 686 + 693 687 writel(control, ctrl_reg); 694 688 sm501fb_sync_regs(fbi); 695 689 mdelay(10); 696 690 } 697 691 698 692 if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) { 699 - control &= ~SM501_DC_PANEL_CONTROL_BIAS; 693 + if (pd->flags & SM501FB_FLAG_PANEL_INV_VBIASEN) 694 + control |= SM501_DC_PANEL_CONTROL_BIAS; 695 + else 696 + control &= ~SM501_DC_PANEL_CONTROL_BIAS; 697 + 700 698 writel(control, ctrl_reg); 701 699 sm501fb_sync_regs(fbi); 702 700 mdelay(10);
+2
include/linux/sm501.h
··· 73 73 #define SM501FB_FLAG_USE_HWACCEL (1<<3) 74 74 #define SM501FB_FLAG_PANEL_NO_FPEN (1<<4) 75 75 #define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5) 76 + #define SM501FB_FLAG_PANEL_INV_FPEN (1<<6) 77 + #define SM501FB_FLAG_PANEL_INV_VBIASEN (1<<7) 76 78 77 79 struct sm501_platdata_fbsub { 78 80 struct fb_videomode *def_mode;