Commit f4960b00 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fbdev-for-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev updates from Helge Deller:
 - video: Reduce code when CONFIG_HAS_IOPORT=n
 - xenfb: Fix crash by assigning fb_info->device
 - pxafb: Fix possible use after free in pxafb_task()
 - efifb: Introduce and use new devm_register_framebuffer() function
 - mmpfb: Utilize devm_clk_get_enabled() helpers
 - various typo fixes and code cleanups

* tag 'fbdev-for-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: omapfb: Fix typo in comment
  fbdev: pxafb: Fix possible use after free in pxafb_task()
  fbdev: xen-fbfront: Assign fb_info->device
  fbdev: hyperv_fb: Convert comma to semicolon
  fbdev: imsttfb: convert comma to semicolon
  fbdev: pxa3xx-gcu: Convert comma to semicolon
  fbdev: efifb: Use driver-private screen_info for sysfs
  fbdev: efifb: Use devm_register_framebuffer()
  fbdev: efifb: Register sysfs groups through driver core
  fbdev: Introduce devm_register_framebuffer()
  fbdev: omapfb: Use sysfs_emit_at() to simplify code
  fbdev: omapfb: panel-sony-acx565akm: Simplify show_cabc_available_modes()
  fbdev: mmp: Use devm_clk_get_enabled() helpers
  fbdev: hpfb: Fix an error handling path in hpfb_dio_probe()
  video: Handle HAS_IOPORT dependencies
parents eec91e22 de5e89b6
...@@ -544,6 +544,36 @@ unregister_framebuffer(struct fb_info *fb_info) ...@@ -544,6 +544,36 @@ unregister_framebuffer(struct fb_info *fb_info)
} }
EXPORT_SYMBOL(unregister_framebuffer); EXPORT_SYMBOL(unregister_framebuffer);
static void devm_unregister_framebuffer(void *data)
{
struct fb_info *info = data;
unregister_framebuffer(info);
}
/**
* devm_register_framebuffer - resource-managed frame buffer device registration
* @dev: device the framebuffer belongs to
* @fb_info: frame buffer info structure
*
* Registers a frame buffer device @fb_info to device @dev.
*
* Returns negative errno on error, or zero for success.
*
*/
int
devm_register_framebuffer(struct device *dev, struct fb_info *fb_info)
{
int ret;
ret = register_framebuffer(fb_info);
if (ret)
return ret;
return devm_add_action_or_reset(dev, devm_unregister_framebuffer, fb_info);
}
EXPORT_SYMBOL(devm_register_framebuffer);
/** /**
* fb_set_suspend - low level driver signals suspend * fb_set_suspend - low level driver signals suspend
* @info: framebuffer affected * @info: framebuffer affected
......
...@@ -322,7 +322,7 @@ static ssize_t name##_show(struct device *dev, \ ...@@ -322,7 +322,7 @@ static ssize_t name##_show(struct device *dev, \
struct device_attribute *attr, \ struct device_attribute *attr, \
char *buf) \ char *buf) \
{ \ { \
struct screen_info *si = dev_get_platdata(dev); \ struct screen_info *si = dev_get_drvdata(dev); \
if (!si) \ if (!si) \
return -ENODEV; \ return -ENODEV; \
return sprintf(buf, fmt "\n", (si->lfb_##name)); \ return sprintf(buf, fmt "\n", (si->lfb_##name)); \
...@@ -369,6 +369,8 @@ static int efifb_probe(struct platform_device *dev) ...@@ -369,6 +369,8 @@ static int efifb_probe(struct platform_device *dev)
if (!si) if (!si)
return -ENOMEM; return -ENOMEM;
dev_set_drvdata(&dev->dev, si);
if (si->orig_video_isVGA != VIDEO_TYPE_EFI) if (si->orig_video_isVGA != VIDEO_TYPE_EFI)
return -ENODEV; return -ENODEV;
...@@ -449,7 +451,6 @@ static int efifb_probe(struct platform_device *dev) ...@@ -449,7 +451,6 @@ static int efifb_probe(struct platform_device *dev)
err = -ENOMEM; err = -ENOMEM;
goto err_release_mem; goto err_release_mem;
} }
platform_set_drvdata(dev, info);
par = info->par; par = info->par;
info->pseudo_palette = par->pseudo_palette; info->pseudo_palette = par->pseudo_palette;
...@@ -561,15 +562,10 @@ static int efifb_probe(struct platform_device *dev) ...@@ -561,15 +562,10 @@ static int efifb_probe(struct platform_device *dev)
break; break;
} }
err = sysfs_create_groups(&dev->dev.kobj, efifb_groups);
if (err) {
pr_err("efifb: cannot add sysfs attrs\n");
goto err_unmap;
}
err = fb_alloc_cmap(&info->cmap, 256, 0); err = fb_alloc_cmap(&info->cmap, 256, 0);
if (err < 0) { if (err < 0) {
pr_err("efifb: cannot allocate colormap\n"); pr_err("efifb: cannot allocate colormap\n");
goto err_groups; goto err_unmap;
} }
err = devm_aperture_acquire_for_platform_device(dev, par->base, par->size); err = devm_aperture_acquire_for_platform_device(dev, par->base, par->size);
...@@ -577,7 +573,7 @@ static int efifb_probe(struct platform_device *dev) ...@@ -577,7 +573,7 @@ static int efifb_probe(struct platform_device *dev)
pr_err("efifb: cannot acquire aperture\n"); pr_err("efifb: cannot acquire aperture\n");
goto err_fb_dealloc_cmap; goto err_fb_dealloc_cmap;
} }
err = register_framebuffer(info); err = devm_register_framebuffer(&dev->dev, info);
if (err < 0) { if (err < 0) {
pr_err("efifb: cannot register framebuffer\n"); pr_err("efifb: cannot register framebuffer\n");
goto err_fb_dealloc_cmap; goto err_fb_dealloc_cmap;
...@@ -587,8 +583,6 @@ static int efifb_probe(struct platform_device *dev) ...@@ -587,8 +583,6 @@ static int efifb_probe(struct platform_device *dev)
err_fb_dealloc_cmap: err_fb_dealloc_cmap:
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
err_groups:
sysfs_remove_groups(&dev->dev.kobj, efifb_groups);
err_unmap: err_unmap:
if (mem_flags & (EFI_MEMORY_UC | EFI_MEMORY_WC)) if (mem_flags & (EFI_MEMORY_UC | EFI_MEMORY_WC))
iounmap(info->screen_base); iounmap(info->screen_base);
...@@ -602,21 +596,12 @@ static int efifb_probe(struct platform_device *dev) ...@@ -602,21 +596,12 @@ static int efifb_probe(struct platform_device *dev)
return err; return err;
} }
static void efifb_remove(struct platform_device *pdev)
{
struct fb_info *info = platform_get_drvdata(pdev);
/* efifb_destroy takes care of info cleanup */
unregister_framebuffer(info);
sysfs_remove_groups(&pdev->dev.kobj, efifb_groups);
}
static struct platform_driver efifb_driver = { static struct platform_driver efifb_driver = {
.driver = { .driver = {
.name = "efi-framebuffer", .name = "efi-framebuffer",
.dev_groups = efifb_groups,
}, },
.probe = efifb_probe, .probe = efifb_probe,
.remove_new = efifb_remove,
}; };
builtin_platform_driver(efifb_driver); builtin_platform_driver(efifb_driver);
...@@ -345,6 +345,7 @@ static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent) ...@@ -345,6 +345,7 @@ static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent)
if (hpfb_init_one(paddr, vaddr)) { if (hpfb_init_one(paddr, vaddr)) {
if (d->scode >= DIOII_SCBASE) if (d->scode >= DIOII_SCBASE)
iounmap((void *)vaddr); iounmap((void *)vaddr);
release_mem_region(d->resource.start, resource_size(&d->resource));
return -ENOMEM; return -ENOMEM;
} }
return 0; return 0;
......
...@@ -1189,7 +1189,7 @@ static int hvfb_probe(struct hv_device *hdev, ...@@ -1189,7 +1189,7 @@ static int hvfb_probe(struct hv_device *hdev,
* which is almost at the end of list, with priority = INT_MIN + 1. * which is almost at the end of list, with priority = INT_MIN + 1.
*/ */
par->hvfb_panic_nb.notifier_call = hvfb_on_panic; par->hvfb_panic_nb.notifier_call = hvfb_on_panic;
par->hvfb_panic_nb.priority = INT_MIN + 10, par->hvfb_panic_nb.priority = INT_MIN + 10;
atomic_notifier_chain_register(&panic_notifier_list, atomic_notifier_chain_register(&panic_notifier_list,
&par->hvfb_panic_nb); &par->hvfb_panic_nb);
......
...@@ -995,7 +995,7 @@ imsttfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) ...@@ -995,7 +995,7 @@ imsttfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
bgc |= (bgc << 8); bgc |= (bgc << 8);
bgc |= (bgc << 16); bgc |= (bgc << 16);
Bpp = info->var.bits_per_pixel >> 3, Bpp = info->var.bits_per_pixel >> 3;
line_pitch = info->fix.line_length; line_pitch = info->fix.line_length;
dy = rect->dy * line_pitch; dy = rect->dy * line_pitch;
...@@ -1036,7 +1036,7 @@ imsttfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) ...@@ -1036,7 +1036,7 @@ imsttfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
__u32 Bpp, line_pitch, fb_offset_old, fb_offset_new, sp, dp_octl; __u32 Bpp, line_pitch, fb_offset_old, fb_offset_new, sp, dp_octl;
__u32 cnt, bltctl, sx, sy, dx, dy, height, width; __u32 cnt, bltctl, sx, sy, dx, dy, height, width;
Bpp = info->var.bits_per_pixel >> 3, Bpp = info->var.bits_per_pixel >> 3;
sx = area->sx * Bpp; sx = area->sx * Bpp;
sy = area->sy; sy = area->sy;
......
...@@ -512,16 +512,13 @@ static int mmphw_probe(struct platform_device *pdev) ...@@ -512,16 +512,13 @@ static int mmphw_probe(struct platform_device *pdev)
} }
/* get clock */ /* get clock */
ctrl->clk = devm_clk_get(ctrl->dev, mi->clk_name); ctrl->clk = devm_clk_get_enabled(ctrl->dev, mi->clk_name);
if (IS_ERR(ctrl->clk)) { if (IS_ERR(ctrl->clk)) {
ret = PTR_ERR(ctrl->clk); ret = PTR_ERR(ctrl->clk);
dev_err_probe(ctrl->dev, ret, dev_err_probe(ctrl->dev, ret,
"unable to get clk %s\n", mi->clk_name); "unable to get clk %s\n", mi->clk_name);
goto failed; goto failed;
} }
ret = clk_prepare_enable(ctrl->clk);
if (ret)
goto failed;
/* init global regs */ /* init global regs */
ctrl_set_default(ctrl); ctrl_set_default(ctrl);
...@@ -556,7 +553,6 @@ static int mmphw_probe(struct platform_device *pdev) ...@@ -556,7 +553,6 @@ static int mmphw_probe(struct platform_device *pdev)
path_deinit(path_plat); path_deinit(path_plat);
} }
clk_disable_unprepare(ctrl->clk);
failed: failed:
dev_err(&pdev->dev, "device init failed\n"); dev_err(&pdev->dev, "device init failed\n");
......
...@@ -1241,14 +1241,13 @@ static ssize_t omapfb_show_caps_num(struct device *dev, ...@@ -1241,14 +1241,13 @@ static ssize_t omapfb_show_caps_num(struct device *dev,
{ {
struct omapfb_device *fbdev = dev_get_drvdata(dev); struct omapfb_device *fbdev = dev_get_drvdata(dev);
int plane; int plane;
size_t size; size_t size = 0;
struct omapfb_caps caps; struct omapfb_caps caps;
plane = 0; plane = 0;
size = 0; while (plane < OMAPFB_PLANE_NUM) {
while (size < PAGE_SIZE && plane < OMAPFB_PLANE_NUM) {
omapfb_get_caps(fbdev, plane, &caps); omapfb_get_caps(fbdev, plane, &caps);
size += scnprintf(&buf[size], PAGE_SIZE - size, size += sysfs_emit_at(buf, size,
"plane#%d %#010x %#010x %#010x\n", "plane#%d %#010x %#010x %#010x\n",
plane, caps.ctrl, caps.plane_color, caps.wnd_color); plane, caps.ctrl, caps.plane_color, caps.wnd_color);
plane++; plane++;
...@@ -1263,34 +1262,27 @@ static ssize_t omapfb_show_caps_text(struct device *dev, ...@@ -1263,34 +1262,27 @@ static ssize_t omapfb_show_caps_text(struct device *dev,
int i; int i;
struct omapfb_caps caps; struct omapfb_caps caps;
int plane; int plane;
size_t size; size_t size = 0;
plane = 0; plane = 0;
size = 0; while (plane < OMAPFB_PLANE_NUM) {
while (size < PAGE_SIZE && plane < OMAPFB_PLANE_NUM) {
omapfb_get_caps(fbdev, plane, &caps); omapfb_get_caps(fbdev, plane, &caps);
size += scnprintf(&buf[size], PAGE_SIZE - size, size += sysfs_emit_at(buf, size, "plane#%d:\n", plane);
"plane#%d:\n", plane); for (i = 0; i < ARRAY_SIZE(ctrl_caps); i++) {
for (i = 0; i < ARRAY_SIZE(ctrl_caps) &&
size < PAGE_SIZE; i++) {
if (ctrl_caps[i].flag & caps.ctrl) if (ctrl_caps[i].flag & caps.ctrl)
size += scnprintf(&buf[size], PAGE_SIZE - size, size += sysfs_emit_at(buf, size,
" %s\n", ctrl_caps[i].name); " %s\n", ctrl_caps[i].name);
} }
size += scnprintf(&buf[size], PAGE_SIZE - size, size += sysfs_emit_at(buf, size, " plane colors:\n");
" plane colors:\n"); for (i = 0; i < ARRAY_SIZE(color_caps); i++) {
for (i = 0; i < ARRAY_SIZE(color_caps) &&
size < PAGE_SIZE; i++) {
if (color_caps[i].flag & caps.plane_color) if (color_caps[i].flag & caps.plane_color)
size += scnprintf(&buf[size], PAGE_SIZE - size, size += sysfs_emit_at(buf, size,
" %s\n", color_caps[i].name); " %s\n", color_caps[i].name);
} }
size += scnprintf(&buf[size], PAGE_SIZE - size, size += sysfs_emit_at(buf, size, " window colors:\n");
" window colors:\n"); for (i = 0; i < ARRAY_SIZE(color_caps); i++) {
for (i = 0; i < ARRAY_SIZE(color_caps) &&
size < PAGE_SIZE; i++) {
if (color_caps[i].flag & caps.wnd_color) if (color_caps[i].flag & caps.wnd_color)
size += scnprintf(&buf[size], PAGE_SIZE - size, size += sysfs_emit_at(buf, size,
" %s\n", color_caps[i].name); " %s\n", color_caps[i].name);
} }
......
...@@ -466,19 +466,20 @@ static ssize_t show_cabc_available_modes(struct device *dev, ...@@ -466,19 +466,20 @@ static ssize_t show_cabc_available_modes(struct device *dev,
char *buf) char *buf)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(dev); struct panel_drv_data *ddata = dev_get_drvdata(dev);
int len; int len = 0;
int i; int i;
if (!ddata->has_cabc) if (!ddata->has_cabc)
return sysfs_emit(buf, "%s\n", cabc_modes[0]); return sysfs_emit(buf, "%s\n", cabc_modes[0]);
for (i = 0, len = 0; for (i = 0; i < ARRAY_SIZE(cabc_modes); i++)
len < PAGE_SIZE && i < ARRAY_SIZE(cabc_modes); i++) len += sysfs_emit_at(buf, len, "%s ", cabc_modes[i]);
len += snprintf(&buf[len], PAGE_SIZE - len, "%s%s%s",
i ? " " : "", cabc_modes[i], /* Remove the trailing space */
i == ARRAY_SIZE(cabc_modes) - 1 ? "\n" : ""); if (len)
buf[len - 1] = '\n';
return len < PAGE_SIZE ? len : PAGE_SIZE - 1; return len;
} }
static DEVICE_ATTR(cabc_mode, S_IRUGO | S_IWUSR, static DEVICE_ATTR(cabc_mode, S_IRUGO | S_IWUSR,
......
...@@ -351,7 +351,7 @@ struct omap_hdmi { ...@@ -351,7 +351,7 @@ struct omap_hdmi {
bool audio_configured; bool audio_configured;
struct omap_dss_audio audio_config; struct omap_dss_audio audio_config;
/* This lock should be taken when booleans bellow are touched. */ /* This lock should be taken when booleans below are touched. */
spinlock_t audio_playing_lock; spinlock_t audio_playing_lock;
bool audio_playing; bool audio_playing;
bool display_enabled; bool display_enabled;
......
...@@ -594,8 +594,8 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev) ...@@ -594,8 +594,8 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
* container_of(). This isn't really necessary as we have a fixed minor * container_of(). This isn't really necessary as we have a fixed minor
* number anyway, but this is to avoid statics. */ * number anyway, but this is to avoid statics. */
priv->misc_dev.minor = PXA3XX_GCU_MINOR, priv->misc_dev.minor = PXA3XX_GCU_MINOR;
priv->misc_dev.name = DRV_NAME, priv->misc_dev.name = DRV_NAME;
priv->misc_dev.fops = &pxa3xx_gcu_miscdev_fops; priv->misc_dev.fops = &pxa3xx_gcu_miscdev_fops;
/* handle IO resources */ /* handle IO resources */
......
...@@ -2403,6 +2403,7 @@ static void pxafb_remove(struct platform_device *dev) ...@@ -2403,6 +2403,7 @@ static void pxafb_remove(struct platform_device *dev)
info = &fbi->fb; info = &fbi->fb;
pxafb_overlay_exit(fbi); pxafb_overlay_exit(fbi);
cancel_work_sync(&fbi->task);
unregister_framebuffer(info); unregister_framebuffer(info);
pxafb_disable_controller(fbi); pxafb_disable_controller(fbi);
......
...@@ -407,6 +407,7 @@ static int xenfb_probe(struct xenbus_device *dev, ...@@ -407,6 +407,7 @@ static int xenfb_probe(struct xenbus_device *dev,
/* complete the abuse: */ /* complete the abuse: */
fb_info->pseudo_palette = fb_info->par; fb_info->pseudo_palette = fb_info->par;
fb_info->par = info; fb_info->par = info;
fb_info->device = &dev->dev;
fb_info->screen_buffer = info->fb; fb_info->screen_buffer = info->fb;
......
...@@ -601,6 +601,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, ...@@ -601,6 +601,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
/* fbmem.c */ /* fbmem.c */
extern int register_framebuffer(struct fb_info *fb_info); extern int register_framebuffer(struct fb_info *fb_info);
extern void unregister_framebuffer(struct fb_info *fb_info); extern void unregister_framebuffer(struct fb_info *fb_info);
extern int devm_register_framebuffer(struct device *dev, struct fb_info *fb_info);
extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);
extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx,
u32 height, u32 shift_high, u32 shift_low, u32 mod); u32 height, u32 shift_high, u32 shift_low, u32 mod);
......
...@@ -197,9 +197,26 @@ struct vgastate { ...@@ -197,9 +197,26 @@ struct vgastate {
extern int save_vga(struct vgastate *state); extern int save_vga(struct vgastate *state);
extern int restore_vga(struct vgastate *state); extern int restore_vga(struct vgastate *state);
static inline unsigned char vga_mm_r (void __iomem *regbase, unsigned short port)
{
return readb (regbase + port);
}
static inline void vga_mm_w (void __iomem *regbase, unsigned short port, unsigned char val)
{
writeb (val, regbase + port);
}
static inline void vga_mm_w_fast (void __iomem *regbase, unsigned short port,
unsigned char reg, unsigned char val)
{
writew (VGA_OUT16VAL (val, reg), regbase + port);
}
/* /*
* generic VGA port read/write * generic VGA port read/write
*/ */
#ifdef CONFIG_HAS_IOPORT
static inline unsigned char vga_io_r (unsigned short port) static inline unsigned char vga_io_r (unsigned short port)
{ {
...@@ -217,22 +234,6 @@ static inline void vga_io_w_fast (unsigned short port, unsigned char reg, ...@@ -217,22 +234,6 @@ static inline void vga_io_w_fast (unsigned short port, unsigned char reg,
outw(VGA_OUT16VAL (val, reg), port); outw(VGA_OUT16VAL (val, reg), port);
} }
static inline unsigned char vga_mm_r (void __iomem *regbase, unsigned short port)
{
return readb (regbase + port);
}
static inline void vga_mm_w (void __iomem *regbase, unsigned short port, unsigned char val)
{
writeb (val, regbase + port);
}
static inline void vga_mm_w_fast (void __iomem *regbase, unsigned short port,
unsigned char reg, unsigned char val)
{
writew (VGA_OUT16VAL (val, reg), regbase + port);
}
static inline unsigned char vga_r (void __iomem *regbase, unsigned short port) static inline unsigned char vga_r (void __iomem *regbase, unsigned short port)
{ {
if (regbase) if (regbase)
...@@ -258,8 +259,25 @@ static inline void vga_w_fast (void __iomem *regbase, unsigned short port, ...@@ -258,8 +259,25 @@ static inline void vga_w_fast (void __iomem *regbase, unsigned short port,
else else
vga_io_w_fast (port, reg, val); vga_io_w_fast (port, reg, val);
} }
#else /* CONFIG_HAS_IOPORT */
static inline unsigned char vga_r (void __iomem *regbase, unsigned short port)
{
return vga_mm_r (regbase, port);
}
static inline void vga_w (void __iomem *regbase, unsigned short port, unsigned char val)
{
vga_mm_w (regbase, port, val);
}
static inline void vga_w_fast (void __iomem *regbase, unsigned short port,
unsigned char reg, unsigned char val)
{
vga_mm_w_fast (regbase, port, reg, val);
}
#endif /* CONFIG_HAS_IOPORT */
/* /*
* VGA CRTC register read/write * VGA CRTC register read/write
*/ */
...@@ -280,6 +298,7 @@ static inline void vga_wcrt (void __iomem *regbase, unsigned char reg, unsigned ...@@ -280,6 +298,7 @@ static inline void vga_wcrt (void __iomem *regbase, unsigned char reg, unsigned
#endif /* VGA_OUTW_WRITE */ #endif /* VGA_OUTW_WRITE */
} }
#ifdef CONFIG_HAS_IOPORT
static inline unsigned char vga_io_rcrt (unsigned char reg) static inline unsigned char vga_io_rcrt (unsigned char reg)
{ {
vga_io_w (VGA_CRT_IC, reg); vga_io_w (VGA_CRT_IC, reg);
...@@ -295,6 +314,7 @@ static inline void vga_io_wcrt (unsigned char reg, unsigned char val) ...@@ -295,6 +314,7 @@ static inline void vga_io_wcrt (unsigned char reg, unsigned char val)
vga_io_w (VGA_CRT_DC, val); vga_io_w (VGA_CRT_DC, val);
#endif /* VGA_OUTW_WRITE */ #endif /* VGA_OUTW_WRITE */
} }
#endif /* CONFIG_HAS_IOPORT */
static inline unsigned char vga_mm_rcrt (void __iomem *regbase, unsigned char reg) static inline unsigned char vga_mm_rcrt (void __iomem *regbase, unsigned char reg)
{ {
...@@ -333,6 +353,7 @@ static inline void vga_wseq (void __iomem *regbase, unsigned char reg, unsigned ...@@ -333,6 +353,7 @@ static inline void vga_wseq (void __iomem *regbase, unsigned char reg, unsigned
#endif /* VGA_OUTW_WRITE */ #endif /* VGA_OUTW_WRITE */
} }
#ifdef CONFIG_HAS_IOPORT
static inline unsigned char vga_io_rseq (unsigned char reg) static inline unsigned char vga_io_rseq (unsigned char reg)
{ {
vga_io_w (VGA_SEQ_I, reg); vga_io_w (VGA_SEQ_I, reg);
...@@ -348,6 +369,7 @@ static inline void vga_io_wseq (unsigned char reg, unsigned char val) ...@@ -348,6 +369,7 @@ static inline void vga_io_wseq (unsigned char reg, unsigned char val)
vga_io_w (VGA_SEQ_D, val); vga_io_w (VGA_SEQ_D, val);
#endif /* VGA_OUTW_WRITE */ #endif /* VGA_OUTW_WRITE */
} }
#endif /* CONFIG_HAS_IOPORT */
static inline unsigned char vga_mm_rseq (void __iomem *regbase, unsigned char reg) static inline unsigned char vga_mm_rseq (void __iomem *regbase, unsigned char reg)
{ {
...@@ -385,6 +407,7 @@ static inline void vga_wgfx (void __iomem *regbase, unsigned char reg, unsigned ...@@ -385,6 +407,7 @@ static inline void vga_wgfx (void __iomem *regbase, unsigned char reg, unsigned
#endif /* VGA_OUTW_WRITE */ #endif /* VGA_OUTW_WRITE */
} }
#ifdef CONFIG_HAS_IOPORT
static inline unsigned char vga_io_rgfx (unsigned char reg) static inline unsigned char vga_io_rgfx (unsigned char reg)
{ {
vga_io_w (VGA_GFX_I, reg); vga_io_w (VGA_GFX_I, reg);
...@@ -400,6 +423,7 @@ static inline void vga_io_wgfx (unsigned char reg, unsigned char val) ...@@ -400,6 +423,7 @@ static inline void vga_io_wgfx (unsigned char reg, unsigned char val)
vga_io_w (VGA_GFX_D, val); vga_io_w (VGA_GFX_D, val);
#endif /* VGA_OUTW_WRITE */ #endif /* VGA_OUTW_WRITE */
} }
#endif /* CONFIG_HAS_IOPORT */
static inline unsigned char vga_mm_rgfx (void __iomem *regbase, unsigned char reg) static inline unsigned char vga_mm_rgfx (void __iomem *regbase, unsigned char reg)
{ {
...@@ -434,6 +458,7 @@ static inline void vga_wattr (void __iomem *regbase, unsigned char reg, unsigned ...@@ -434,6 +458,7 @@ static inline void vga_wattr (void __iomem *regbase, unsigned char reg, unsigned
vga_w (regbase, VGA_ATT_W, val); vga_w (regbase, VGA_ATT_W, val);
} }
#ifdef CONFIG_HAS_IOPORT
static inline unsigned char vga_io_rattr (unsigned char reg) static inline unsigned char vga_io_rattr (unsigned char reg)
{ {
vga_io_w (VGA_ATT_IW, reg); vga_io_w (VGA_ATT_IW, reg);
...@@ -445,6 +470,7 @@ static inline void vga_io_wattr (unsigned char reg, unsigned char val) ...@@ -445,6 +470,7 @@ static inline void vga_io_wattr (unsigned char reg, unsigned char val)
vga_io_w (VGA_ATT_IW, reg); vga_io_w (VGA_ATT_IW, reg);
vga_io_w (VGA_ATT_W, val); vga_io_w (VGA_ATT_W, val);
} }
#endif /* CONFIG_HAS_IOPORT */
static inline unsigned char vga_mm_rattr (void __iomem *regbase, unsigned char reg) static inline unsigned char vga_mm_rattr (void __iomem *regbase, unsigned char reg)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment