/* * On/Off for driving the DisplayLink framebuffer to the display * 0x00 H and V sync on * 0x01 H and V sync off (screen blank but powered) * 0x07 DPMS powerdown (requires modeset to come back) */ static char *dlfb_enable_hvsync(char *buf, bool enable) { if (enable) return dlfb_set_register(buf, 0x1F, 0x00); else return dlfb_set_register(buf, 0x1F, 0x07); }
/* * Map FB_BLANK_* to DisplayLink register * DLReg FB_BLANK_* * ----- ----------------------------- * 0x00 FB_BLANK_UNBLANK (0) * 0x01 FB_BLANK (1) * 0x03 FB_BLANK_VSYNC_SUSPEND (2) * 0x05 FB_BLANK_HSYNC_SUSPEND (3) * 0x07 FB_BLANK_POWERDOWN (4) Note: requires modeset to come back */ static char *dlfb_blanking(char *buf, int fb_blank) { u8 reg; switch (fb_blank) { case FB_BLANK_POWERDOWN: reg = 0x07; break; case FB_BLANK_HSYNC_SUSPEND: reg = 0x05; break; case FB_BLANK_VSYNC_SUSPEND: reg = 0x03; break; case FB_BLANK_NORMAL: reg = 0x01; break; default: reg = 0x00; } buf = dlfb_set_register(buf, 0x1F, reg); return buf; }
static char *dlfb_vidreg_unlock(char *buf) { return dlfb_set_register(buf, 0xFF, 0xFF); }
static char *dlfb_set_color_depth(char *buf, u8 selection) { return dlfb_set_register(buf, 0x00, selection); }