Lines Matching +full:0 +full:- +full:mon
1 // SPDX-License-Identifier: GPL-2.0-only
48 #define BWTWO_REGISTER_OFFSET 0x400000
78 #define BWTWO_SR_RES_MASK 0x70
79 #define BWTWO_SR_1600_1280 0x50
80 #define BWTWO_SR_1152_900_76_A 0x40
81 #define BWTWO_SR_1152_900_76_B 0x60
82 #define BWTWO_SR_ID_MASK 0x0f
83 #define BWTWO_SR_ID_MONO 0x02
84 #define BWTWO_SR_ID_MONO_ECL 0x03
85 #define BWTWO_SR_ID_MSYNC 0x04
86 #define BWTWO_SR_ID_NOCONN 0x0a
89 #define BWTWO_CTL_ENABLE_INTS 0x80
90 #define BWTWO_CTL_ENABLE_VIDEO 0x40
91 #define BWTWO_CTL_ENABLE_TIMING 0x20
92 #define BWTWO_CTL_ENABLE_CURCMP 0x10
93 #define BWTWO_CTL_XTAL_MASK 0x0C
94 #define BWTWO_CTL_DIVISOR_MASK 0x03
97 #define BWTWO_STAT_PENDING_INT 0x80
98 #define BWTWO_STAT_MSENSE_MASK 0x70
99 #define BWTWO_STAT_ID_MASK 0x0f
106 #define BW2_FLAG_BLANKED 0x00000001
112 * bw2_blank - Optional function. Blanks the display.
119 struct bw2_par *par = (struct bw2_par *) info->par; in bw2_blank()
120 struct bw2_regs __iomem *regs = par->regs; in bw2_blank()
124 spin_lock_irqsave(&par->lock, flags); in bw2_blank()
128 val = sbus_readb(®s->control); in bw2_blank()
130 sbus_writeb(val, ®s->control); in bw2_blank()
131 par->flags &= ~BW2_FLAG_BLANKED; in bw2_blank()
138 val = sbus_readb(®s->control); in bw2_blank()
140 sbus_writeb(val, ®s->control); in bw2_blank()
141 par->flags |= BW2_FLAG_BLANKED; in bw2_blank()
145 spin_unlock_irqrestore(&par->lock, flags); in bw2_blank()
147 return 0; in bw2_blank()
154 { .size = 0 }
159 struct bw2_par *par = (struct bw2_par *)info->par; in bw2_sbusfb_mmap()
162 info->fix.smem_start, info->fix.smem_len, in bw2_sbusfb_mmap()
163 par->which_io, in bw2_sbusfb_mmap()
170 FBTYPE_SUN2BW, 1, info->fix.smem_len); in bw2_sbusfb_ioctl()
179 strscpy(info->fix.id, "bwtwo", sizeof(info->fix.id)); in bw2_init_fix()
181 info->fix.type = FB_TYPE_PACKED_PIXELS; in bw2_init_fix()
182 info->fix.visual = FB_VISUAL_MONO01; in bw2_init_fix()
184 info->fix.line_length = linebytes; in bw2_init_fix()
186 info->fix.accel = FB_ACCEL_SUN_BWTWO; in bw2_init_fix()
190 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13,
191 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e,
192 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01,
193 0x10, 0x21, 0
197 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c,
198 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23,
199 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01,
200 0x10, 0x20, 0
204 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13,
205 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22,
206 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
207 0x10, 0x20, 0
211 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f,
212 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a,
213 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01,
214 0x10, 0x24, 0
218 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14,
219 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24,
220 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01,
221 0x10, 0x20, 0
227 u8 status, mon; in bw2_do_default_mode() local
230 status = sbus_readb(&par->regs->status); in bw2_do_default_mode()
231 mon = status & BWTWO_SR_RES_MASK; in bw2_do_default_mode()
234 if (mon == BWTWO_SR_1600_1280) { in bw2_do_default_mode()
236 info->var.xres = info->var.xres_virtual = 1600; in bw2_do_default_mode()
237 info->var.yres = info->var.yres_virtual = 1280; in bw2_do_default_mode()
248 if (mon == BWTWO_SR_1152_900_76_A || in bw2_do_default_mode()
249 mon == BWTWO_SR_1152_900_76_B) in bw2_do_default_mode()
256 return 0; in bw2_do_default_mode()
261 return -EINVAL; in bw2_do_default_mode()
264 u8 __iomem *regp = &((u8 __iomem *)par->regs)[p[0]]; in bw2_do_default_mode()
267 return 0; in bw2_do_default_mode()
272 struct device_node *dp = op->dev.of_node; in bw2_probe()
277 info = framebuffer_alloc(sizeof(struct bw2_par), &op->dev); in bw2_probe()
279 err = -ENOMEM; in bw2_probe()
282 par = info->par; in bw2_probe()
284 spin_lock_init(&par->lock); in bw2_probe()
286 info->fix.smem_start = op->resource[0].start; in bw2_probe()
287 par->which_io = op->resource[0].flags & IORESOURCE_BITS; in bw2_probe()
289 sbusfb_fill_var(&info->var, dp, 1); in bw2_probe()
291 info->var.xres); in bw2_probe()
293 info->var.red.length = info->var.green.length = in bw2_probe()
294 info->var.blue.length = info->var.bits_per_pixel; in bw2_probe()
295 info->var.red.offset = info->var.green.offset = in bw2_probe()
296 info->var.blue.offset = 0; in bw2_probe()
298 par->regs = of_ioremap(&op->resource[0], BWTWO_REGISTER_OFFSET, in bw2_probe()
300 if (!par->regs) in bw2_probe()
309 info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres); in bw2_probe()
311 info->fbops = &bw2_ops; in bw2_probe()
313 info->screen_base = of_ioremap(&op->resource[0], 0, in bw2_probe()
314 info->fix.smem_len, "bw2 ram"); in bw2_probe()
315 if (!info->screen_base) { in bw2_probe()
316 err = -ENOMEM; in bw2_probe()
325 if (err < 0) in bw2_probe()
328 dev_set_drvdata(&op->dev, info); in bw2_probe()
331 dp, par->which_io, info->fix.smem_start); in bw2_probe()
333 return 0; in bw2_probe()
336 of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len); in bw2_probe()
339 of_iounmap(&op->resource[0], par->regs, sizeof(struct bw2_regs)); in bw2_probe()
350 struct fb_info *info = dev_get_drvdata(&op->dev); in bw2_remove()
351 struct bw2_par *par = info->par; in bw2_remove()
355 of_iounmap(&op->resource[0], par->regs, sizeof(struct bw2_regs)); in bw2_remove()
356 of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len); in bw2_remove()
381 return -ENODEV; in bw2_init()