bw2.c (fdebffeba8b877368ddcc139c26278c1c97931a4) | bw2.c (3409343341b10eb99c8bf1eb46a2c49e9cdd786d) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* bw2.c: BWTWO frame buffer driver 3 * 4 * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) 5 * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz) 6 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) 7 * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) 8 * 9 * Driver layout based loosely on tgafb.c, see that file for credits. 10 */ 11 12#include <linux/module.h> 13#include <linux/kernel.h> 14#include <linux/errno.h> 15#include <linux/string.h> 16#include <linux/delay.h> 17#include <linux/init.h> 18#include <linux/fb.h> 19#include <linux/mm.h> | 1// SPDX-License-Identifier: GPL-2.0-only 2/* bw2.c: BWTWO frame buffer driver 3 * 4 * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) 5 * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz) 6 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) 7 * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) 8 * 9 * Driver layout based loosely on tgafb.c, see that file for credits. 10 */ 11 12#include <linux/module.h> 13#include <linux/kernel.h> 14#include <linux/errno.h> 15#include <linux/string.h> 16#include <linux/delay.h> 17#include <linux/init.h> 18#include <linux/fb.h> 19#include <linux/mm.h> |
20#include <linux/of.h> 21#include <linux/platform_device.h> | 20#include <linux/of_device.h> |
22 23#include <asm/io.h> 24#include <asm/fbio.h> 25 26#include "sbuslib.h" 27 28/* 29 * Local functions. 30 */ 31 32static int bw2_blank(int, struct fb_info *); 33 | 21 22#include <asm/io.h> 23#include <asm/fbio.h> 24 25#include "sbuslib.h" 26 27/* 28 * Local functions. 29 */ 30 31static int bw2_blank(int, struct fb_info *); 32 |
34static int bw2_mmap(struct fb_info *, struct vm_area_struct *); 35static int bw2_ioctl(struct fb_info *, unsigned int, unsigned long); | 33static int bw2_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma); 34static int bw2_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg); |
36 37/* 38 * Frame buffer operations 39 */ 40 41static const struct fb_ops bw2_ops = { 42 .owner = THIS_MODULE, | 35 36/* 37 * Frame buffer operations 38 */ 39 40static const struct fb_ops bw2_ops = { 41 .owner = THIS_MODULE, |
42 FB_DEFAULT_SBUS_OPS(bw2), |
|
43 .fb_blank = bw2_blank, | 43 .fb_blank = bw2_blank, |
44 .fb_fillrect = cfb_fillrect, 45 .fb_copyarea = cfb_copyarea, 46 .fb_imageblit = cfb_imageblit, 47 .fb_mmap = bw2_mmap, 48 .fb_ioctl = bw2_ioctl, 49#ifdef CONFIG_COMPAT 50 .fb_compat_ioctl = sbusfb_compat_ioctl, 51#endif | |
52}; 53 54/* OBio addresses for the bwtwo registers */ 55#define BWTWO_REGISTER_OFFSET 0x400000 56 57struct bt_regs { 58 u32 addr; 59 u32 color_map; --- 96 unchanged lines hidden (view full) --- 156 157static struct sbus_mmap_map bw2_mmap_map[] = { 158 { 159 .size = SBUS_MMAP_FBSIZE(1) 160 }, 161 { .size = 0 } 162}; 163 | 44}; 45 46/* OBio addresses for the bwtwo registers */ 47#define BWTWO_REGISTER_OFFSET 0x400000 48 49struct bt_regs { 50 u32 addr; 51 u32 color_map; --- 96 unchanged lines hidden (view full) --- 148 149static struct sbus_mmap_map bw2_mmap_map[] = { 150 { 151 .size = SBUS_MMAP_FBSIZE(1) 152 }, 153 { .size = 0 } 154}; 155 |
164static int bw2_mmap(struct fb_info *info, struct vm_area_struct *vma) | 156static int bw2_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma) |
165{ 166 struct bw2_par *par = (struct bw2_par *)info->par; 167 168 return sbusfb_mmap_helper(bw2_mmap_map, 169 info->fix.smem_start, info->fix.smem_len, 170 par->which_io, 171 vma); 172} 173 | 157{ 158 struct bw2_par *par = (struct bw2_par *)info->par; 159 160 return sbusfb_mmap_helper(bw2_mmap_map, 161 info->fix.smem_start, info->fix.smem_len, 162 par->which_io, 163 vma); 164} 165 |
174static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | 166static int bw2_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) |
175{ 176 return sbusfb_ioctl_helper(cmd, arg, info, 177 FBTYPE_SUN2BW, 1, info->fix.smem_len); 178} 179 180/* 181 * Initialisation 182 */ --- 222 unchanged lines hidden --- | 167{ 168 return sbusfb_ioctl_helper(cmd, arg, info, 169 FBTYPE_SUN2BW, 1, info->fix.smem_len); 170} 171 172/* 173 * Initialisation 174 */ --- 222 unchanged lines hidden --- |