// SPDX-License-Identifier: GPL-2.0-only /* p9100.c: P9100 frame buffer driver * * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) * Copyright 1999 Derrick J Brashear (shadow@dementia.org) * * Driver layout based loosely on tgafb.c, see that file for credits.
*/
/** * p9100_setcolreg - Optional function. Sets a color register. * @regno: boolean, 0 copy local, 1 get_user() function * @red: frame buffer colormap structure * @green: The green value which can be up to 16 bits wide * @blue: The blue value which can be up to 16 bits wide. * @transp: If supported the alpha value which can be up to 16 bits wide. * @info: frame buffer info structure
*/ staticint p9100_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *info)
{ struct p9100_par *par = (struct p9100_par *) info->par; struct p9100_regs __iomem *regs = par->regs; unsignedlong flags;
/** * p9100_blank - Optional function. Blanks the display. * @blank: the blank mode we want. * @info: frame buffer structure that represents a single frame buffer
*/ staticint
p9100_blank(int blank, struct fb_info *info)
{ struct p9100_par *par = (struct p9100_par *) info->par; struct p9100_regs __iomem *regs = par->regs; unsignedlong flags;
u32 val;
spin_lock_irqsave(&par->lock, flags);
switch (blank) { case FB_BLANK_UNBLANK: /* Unblanking */
val = sbus_readl(®s->vid_screenpaint_timectl1);
val |= SCREENPAINT_TIMECTL1_ENABLE_VIDEO;
sbus_writel(val, ®s->vid_screenpaint_timectl1);
par->flags &= ~P9100_FLAG_BLANKED; break;
case FB_BLANK_NORMAL: /* Normal blanking */ case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */ case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ case FB_BLANK_POWERDOWN: /* Poweroff */
val = sbus_readl(®s->vid_screenpaint_timectl1);
val &= ~SCREENPAINT_TIMECTL1_ENABLE_VIDEO;
sbus_writel(val, ®s->vid_screenpaint_timectl1);
par->flags |= P9100_FLAG_BLANKED; break;
}
info = framebuffer_alloc(sizeof(struct p9100_par), &op->dev);
err = -ENOMEM; if (!info) goto out_err;
par = info->par;
spin_lock_init(&par->lock);
/* This is the framebuffer and the only resource apps can mmap. */
info->fix.smem_start = op->resource[2].start;
par->which_io = op->resource[2].flags & IORESOURCE_BITS;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.