18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci *  linux/drivers/video/fm2fb.c -- BSC FrameMaster II/Rainbow II frame buffer
38c2ecf20Sopenharmony_ci *				   device
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *	Copyright (C) 1998 Steffen A. Mork (linux-dev@morknet.de)
68c2ecf20Sopenharmony_ci *	Copyright (C) 1999 Geert Uytterhoeven
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci *  Written for 2.0.x by Steffen A. Mork
98c2ecf20Sopenharmony_ci *  Ported to 2.1.x by Geert Uytterhoeven
108c2ecf20Sopenharmony_ci *  Ported to new api by James Simmons
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci *  This file is subject to the terms and conditions of the GNU General Public
138c2ecf20Sopenharmony_ci *  License. See the file COPYING in the main directory of this archive for
148c2ecf20Sopenharmony_ci *  more details.
158c2ecf20Sopenharmony_ci */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#include <linux/module.h>
188c2ecf20Sopenharmony_ci#include <linux/mm.h>
198c2ecf20Sopenharmony_ci#include <linux/fb.h>
208c2ecf20Sopenharmony_ci#include <linux/init.h>
218c2ecf20Sopenharmony_ci#include <linux/zorro.h>
228c2ecf20Sopenharmony_ci#include <asm/io.h>
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/*
258c2ecf20Sopenharmony_ci *	Some technical notes:
268c2ecf20Sopenharmony_ci *
278c2ecf20Sopenharmony_ci *	The BSC FrameMaster II (or Rainbow II) is a simple very dumb
288c2ecf20Sopenharmony_ci *	frame buffer which allows to display 24 bit true color images.
298c2ecf20Sopenharmony_ci *	Each pixel is 32 bit width so it's very easy to maintain the
308c2ecf20Sopenharmony_ci *	frame buffer. One long word has the following layout:
318c2ecf20Sopenharmony_ci *	AARRGGBB which means: AA the alpha channel byte, RR the red
328c2ecf20Sopenharmony_ci *	channel, GG the green channel and BB the blue channel.
338c2ecf20Sopenharmony_ci *
348c2ecf20Sopenharmony_ci *	The FrameMaster II supports the following video modes.
358c2ecf20Sopenharmony_ci *	- PAL/NTSC
368c2ecf20Sopenharmony_ci *	- interlaced/non interlaced
378c2ecf20Sopenharmony_ci *	- composite sync/sync/sync over green
388c2ecf20Sopenharmony_ci *
398c2ecf20Sopenharmony_ci *	The resolution is to the following both ones:
408c2ecf20Sopenharmony_ci *	- 768x576 (PAL)
418c2ecf20Sopenharmony_ci *	- 768x480 (NTSC)
428c2ecf20Sopenharmony_ci *
438c2ecf20Sopenharmony_ci *	This means that pixel access per line is fixed due to the
448c2ecf20Sopenharmony_ci *	fixed line width. In case of maximal resolution the frame
458c2ecf20Sopenharmony_ci *	buffer needs an amount of memory of 1.769.472 bytes which
468c2ecf20Sopenharmony_ci *	is near to 2 MByte (the allocated address space of Zorro2).
478c2ecf20Sopenharmony_ci *	The memory is channel interleaved. That means every channel
488c2ecf20Sopenharmony_ci *	owns four VRAMs. Unfortunately most FrameMasters II are
498c2ecf20Sopenharmony_ci *	not assembled with memory for the alpha channel. In this
508c2ecf20Sopenharmony_ci *	case it could be possible to add the frame buffer into the
518c2ecf20Sopenharmony_ci *	normal memory pool.
528c2ecf20Sopenharmony_ci *
538c2ecf20Sopenharmony_ci *	At relative address 0x1ffff8 of the frame buffers base address
548c2ecf20Sopenharmony_ci *	there exists a control register with the number of
558c2ecf20Sopenharmony_ci *	four control bits. They have the following meaning:
568c2ecf20Sopenharmony_ci *	bit value meaning
578c2ecf20Sopenharmony_ci *
588c2ecf20Sopenharmony_ci *	 0    1   0=interlaced/1=non interlaced
598c2ecf20Sopenharmony_ci *	 1    2   0=video out disabled/1=video out enabled
608c2ecf20Sopenharmony_ci *	 2    4   0=normal mode as jumpered via JP8/1=complement mode
618c2ecf20Sopenharmony_ci *	 3    8   0=read  onboard ROM/1 normal operation (required)
628c2ecf20Sopenharmony_ci *
638c2ecf20Sopenharmony_ci *	As mentioned above there are several jumper. I think there
648c2ecf20Sopenharmony_ci *	is not very much information about the FrameMaster II in
658c2ecf20Sopenharmony_ci *	the world so I add these information for completeness.
668c2ecf20Sopenharmony_ci *
678c2ecf20Sopenharmony_ci *	JP1  interlace selection (1-2 non interlaced/2-3 interlaced)
688c2ecf20Sopenharmony_ci *	JP2  wait state creation (leave as is!)
698c2ecf20Sopenharmony_ci *	JP3  wait state creation (leave as is!)
708c2ecf20Sopenharmony_ci *	JP4  modulate composite sync on green output (1-2 composite
718c2ecf20Sopenharmony_ci *	     sync on green channel/2-3 normal composite sync)
728c2ecf20Sopenharmony_ci *	JP5  create test signal, shorting this jumper will create
738c2ecf20Sopenharmony_ci *	     a white screen
748c2ecf20Sopenharmony_ci *	JP6  sync creation (1-2 composite sync/2-3 H-sync output)
758c2ecf20Sopenharmony_ci *	JP8  video mode (1-2 PAL/2-3 NTSC)
768c2ecf20Sopenharmony_ci *
778c2ecf20Sopenharmony_ci *	With the following jumpering table you can connect the
788c2ecf20Sopenharmony_ci *	FrameMaster II to a normal TV via SCART connector:
798c2ecf20Sopenharmony_ci *	JP1:  2-3
808c2ecf20Sopenharmony_ci *	JP4:  2-3
818c2ecf20Sopenharmony_ci *	JP6:  2-3
828c2ecf20Sopenharmony_ci *	JP8:  1-2 (means PAL for Europe)
838c2ecf20Sopenharmony_ci *
848c2ecf20Sopenharmony_ci *	NOTE:
858c2ecf20Sopenharmony_ci *	There is no other possibility to change the video timings
868c2ecf20Sopenharmony_ci *	except the interlaced/non interlaced, sync control and the
878c2ecf20Sopenharmony_ci *	video mode PAL (50 Hz)/NTSC (60 Hz). Inside this
888c2ecf20Sopenharmony_ci *	FrameMaster II driver are assumed values to avoid anomalies
898c2ecf20Sopenharmony_ci *	to a future X server. Except the pixel clock is really
908c2ecf20Sopenharmony_ci *	constant at 30 MHz.
918c2ecf20Sopenharmony_ci *
928c2ecf20Sopenharmony_ci *	9 pin female video connector:
938c2ecf20Sopenharmony_ci *
948c2ecf20Sopenharmony_ci *	1  analog red 0.7 Vss
958c2ecf20Sopenharmony_ci *	2  analog green 0.7 Vss
968c2ecf20Sopenharmony_ci *	3  analog blue 0.7 Vss
978c2ecf20Sopenharmony_ci *	4  H-sync TTL
988c2ecf20Sopenharmony_ci *	5  V-sync TTL
998c2ecf20Sopenharmony_ci *	6  ground
1008c2ecf20Sopenharmony_ci *	7  ground
1018c2ecf20Sopenharmony_ci *	8  ground
1028c2ecf20Sopenharmony_ci *	9  ground
1038c2ecf20Sopenharmony_ci *
1048c2ecf20Sopenharmony_ci *	Some performance notes:
1058c2ecf20Sopenharmony_ci *	The FrameMaster II was not designed to display a console
1068c2ecf20Sopenharmony_ci *	this driver would do! It was designed to display still true
1078c2ecf20Sopenharmony_ci *	color images. Imagine: When scroll up a text line there
1088c2ecf20Sopenharmony_ci *	must copied ca. 1.7 MBytes to another place inside this
1098c2ecf20Sopenharmony_ci *	frame buffer. This means 1.7 MByte read and 1.7 MByte write
1108c2ecf20Sopenharmony_ci *	over the slow 16 bit wide Zorro2 bus! A scroll of one
1118c2ecf20Sopenharmony_ci *	line needs 1 second so do not expect to much from this
1128c2ecf20Sopenharmony_ci *	driver - he is at the limit!
1138c2ecf20Sopenharmony_ci *
1148c2ecf20Sopenharmony_ci */
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci/*
1178c2ecf20Sopenharmony_ci *	definitions
1188c2ecf20Sopenharmony_ci */
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci#define FRAMEMASTER_SIZE	0x200000
1218c2ecf20Sopenharmony_ci#define FRAMEMASTER_REG		0x1ffff8
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#define FRAMEMASTER_NOLACE	1
1248c2ecf20Sopenharmony_ci#define FRAMEMASTER_ENABLE	2
1258c2ecf20Sopenharmony_ci#define FRAMEMASTER_COMPL	4
1268c2ecf20Sopenharmony_ci#define FRAMEMASTER_ROM		8
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_cistatic volatile unsigned char *fm2fb_reg;
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_cistatic struct fb_fix_screeninfo fb_fix = {
1318c2ecf20Sopenharmony_ci	.smem_len =	FRAMEMASTER_REG,
1328c2ecf20Sopenharmony_ci	.type =		FB_TYPE_PACKED_PIXELS,
1338c2ecf20Sopenharmony_ci	.visual =	FB_VISUAL_TRUECOLOR,
1348c2ecf20Sopenharmony_ci	.line_length =	(768 << 2),
1358c2ecf20Sopenharmony_ci	.mmio_len =	(8),
1368c2ecf20Sopenharmony_ci	.accel =	FB_ACCEL_NONE,
1378c2ecf20Sopenharmony_ci};
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_cistatic int fm2fb_mode = -1;
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci#define FM2FB_MODE_PAL	0
1428c2ecf20Sopenharmony_ci#define FM2FB_MODE_NTSC	1
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_cistatic struct fb_var_screeninfo fb_var_modes[] = {
1458c2ecf20Sopenharmony_ci    {
1468c2ecf20Sopenharmony_ci	/* 768 x 576, 32 bpp (PAL) */
1478c2ecf20Sopenharmony_ci	768, 576, 768, 576, 0, 0, 32, 0,
1488c2ecf20Sopenharmony_ci	{ 16, 8, 0 }, { 8, 8, 0 }, { 0, 8, 0 }, { 24, 8, 0 },
1498c2ecf20Sopenharmony_ci	0, FB_ACTIVATE_NOW, -1, -1, FB_ACCEL_NONE,
1508c2ecf20Sopenharmony_ci	33333, 10, 102, 10, 5, 80, 34, FB_SYNC_COMP_HIGH_ACT, 0
1518c2ecf20Sopenharmony_ci    }, {
1528c2ecf20Sopenharmony_ci	/* 768 x 480, 32 bpp (NTSC - not supported yet */
1538c2ecf20Sopenharmony_ci	768, 480, 768, 480, 0, 0, 32, 0,
1548c2ecf20Sopenharmony_ci	{ 16, 8, 0 }, { 8, 8, 0 }, { 0, 8, 0 }, { 24, 8, 0 },
1558c2ecf20Sopenharmony_ci	0, FB_ACTIVATE_NOW, -1, -1, FB_ACCEL_NONE,
1568c2ecf20Sopenharmony_ci	33333, 10, 102, 10, 5, 80, 34, FB_SYNC_COMP_HIGH_ACT, 0
1578c2ecf20Sopenharmony_ci    }
1588c2ecf20Sopenharmony_ci};
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci    /*
1618c2ecf20Sopenharmony_ci     *  Interface used by the world
1628c2ecf20Sopenharmony_ci     */
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_cistatic int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
1658c2ecf20Sopenharmony_ci                           u_int transp, struct fb_info *info);
1668c2ecf20Sopenharmony_cistatic int fm2fb_blank(int blank, struct fb_info *info);
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_cistatic const struct fb_ops fm2fb_ops = {
1698c2ecf20Sopenharmony_ci	.owner		= THIS_MODULE,
1708c2ecf20Sopenharmony_ci	.fb_setcolreg	= fm2fb_setcolreg,
1718c2ecf20Sopenharmony_ci	.fb_blank	= fm2fb_blank,
1728c2ecf20Sopenharmony_ci	.fb_fillrect	= cfb_fillrect,
1738c2ecf20Sopenharmony_ci	.fb_copyarea	= cfb_copyarea,
1748c2ecf20Sopenharmony_ci	.fb_imageblit	= cfb_imageblit,
1758c2ecf20Sopenharmony_ci};
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci    /*
1788c2ecf20Sopenharmony_ci     *  Blank the display.
1798c2ecf20Sopenharmony_ci     */
1808c2ecf20Sopenharmony_cistatic int fm2fb_blank(int blank, struct fb_info *info)
1818c2ecf20Sopenharmony_ci{
1828c2ecf20Sopenharmony_ci	unsigned char t = FRAMEMASTER_ROM;
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci	if (!blank)
1858c2ecf20Sopenharmony_ci		t |= FRAMEMASTER_ENABLE | FRAMEMASTER_NOLACE;
1868c2ecf20Sopenharmony_ci	fm2fb_reg[0] = t;
1878c2ecf20Sopenharmony_ci	return 0;
1888c2ecf20Sopenharmony_ci}
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci    /*
1918c2ecf20Sopenharmony_ci     *  Set a single color register. The values supplied are already
1928c2ecf20Sopenharmony_ci     *  rounded down to the hardware's capabilities (according to the
1938c2ecf20Sopenharmony_ci     *  entries in the var structure). Return != 0 for invalid regno.
1948c2ecf20Sopenharmony_ci     */
1958c2ecf20Sopenharmony_cistatic int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
1968c2ecf20Sopenharmony_ci                         u_int transp, struct fb_info *info)
1978c2ecf20Sopenharmony_ci{
1988c2ecf20Sopenharmony_ci	if (regno < 16) {
1998c2ecf20Sopenharmony_ci		red >>= 8;
2008c2ecf20Sopenharmony_ci		green >>= 8;
2018c2ecf20Sopenharmony_ci		blue >>= 8;
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci		((u32*)(info->pseudo_palette))[regno] = (red << 16) |
2048c2ecf20Sopenharmony_ci			(green << 8) | blue;
2058c2ecf20Sopenharmony_ci	}
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci	return 0;
2088c2ecf20Sopenharmony_ci}
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ci    /*
2118c2ecf20Sopenharmony_ci     *  Initialisation
2128c2ecf20Sopenharmony_ci     */
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_cistatic int fm2fb_probe(struct zorro_dev *z, const struct zorro_device_id *id);
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_cistatic const struct zorro_device_id fm2fb_devices[] = {
2178c2ecf20Sopenharmony_ci	{ ZORRO_PROD_BSC_FRAMEMASTER_II },
2188c2ecf20Sopenharmony_ci	{ ZORRO_PROD_HELFRICH_RAINBOW_II },
2198c2ecf20Sopenharmony_ci	{ 0 }
2208c2ecf20Sopenharmony_ci};
2218c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(zorro, fm2fb_devices);
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_cistatic struct zorro_driver fm2fb_driver = {
2248c2ecf20Sopenharmony_ci	.name		= "fm2fb",
2258c2ecf20Sopenharmony_ci	.id_table	= fm2fb_devices,
2268c2ecf20Sopenharmony_ci	.probe		= fm2fb_probe,
2278c2ecf20Sopenharmony_ci};
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_cistatic int fm2fb_probe(struct zorro_dev *z, const struct zorro_device_id *id)
2308c2ecf20Sopenharmony_ci{
2318c2ecf20Sopenharmony_ci	struct fb_info *info;
2328c2ecf20Sopenharmony_ci	unsigned long *ptr;
2338c2ecf20Sopenharmony_ci	int is_fm;
2348c2ecf20Sopenharmony_ci	int x, y;
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci	is_fm = z->id == ZORRO_PROD_BSC_FRAMEMASTER_II;
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci	if (!zorro_request_device(z,"fm2fb"))
2398c2ecf20Sopenharmony_ci		return -ENXIO;
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci	info = framebuffer_alloc(16 * sizeof(u32), &z->dev);
2428c2ecf20Sopenharmony_ci	if (!info) {
2438c2ecf20Sopenharmony_ci		zorro_release_device(z);
2448c2ecf20Sopenharmony_ci		return -ENOMEM;
2458c2ecf20Sopenharmony_ci	}
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
2488c2ecf20Sopenharmony_ci		framebuffer_release(info);
2498c2ecf20Sopenharmony_ci		zorro_release_device(z);
2508c2ecf20Sopenharmony_ci		return -ENOMEM;
2518c2ecf20Sopenharmony_ci	}
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci	/* assigning memory to kernel space */
2548c2ecf20Sopenharmony_ci	fb_fix.smem_start = zorro_resource_start(z);
2558c2ecf20Sopenharmony_ci	info->screen_base = ioremap(fb_fix.smem_start, FRAMEMASTER_SIZE);
2568c2ecf20Sopenharmony_ci	fb_fix.mmio_start = fb_fix.smem_start + FRAMEMASTER_REG;
2578c2ecf20Sopenharmony_ci	fm2fb_reg  = (unsigned char *)(info->screen_base+FRAMEMASTER_REG);
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci	strcpy(fb_fix.id, is_fm ? "FrameMaster II" : "Rainbow II");
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_ci	/* make EBU color bars on display */
2628c2ecf20Sopenharmony_ci	ptr = (unsigned long *)fb_fix.smem_start;
2638c2ecf20Sopenharmony_ci	for (y = 0; y < 576; y++) {
2648c2ecf20Sopenharmony_ci		for (x = 0; x < 96; x++) *ptr++ = 0xffffff;/* white */
2658c2ecf20Sopenharmony_ci		for (x = 0; x < 96; x++) *ptr++ = 0xffff00;/* yellow */
2668c2ecf20Sopenharmony_ci		for (x = 0; x < 96; x++) *ptr++ = 0x00ffff;/* cyan */
2678c2ecf20Sopenharmony_ci		for (x = 0; x < 96; x++) *ptr++ = 0x00ff00;/* green */
2688c2ecf20Sopenharmony_ci		for (x = 0; x < 96; x++) *ptr++ = 0xff00ff;/* magenta */
2698c2ecf20Sopenharmony_ci		for (x = 0; x < 96; x++) *ptr++ = 0xff0000;/* red */
2708c2ecf20Sopenharmony_ci		for (x = 0; x < 96; x++) *ptr++ = 0x0000ff;/* blue */
2718c2ecf20Sopenharmony_ci		for (x = 0; x < 96; x++) *ptr++ = 0x000000;/* black */
2728c2ecf20Sopenharmony_ci	}
2738c2ecf20Sopenharmony_ci	fm2fb_blank(0, info);
2748c2ecf20Sopenharmony_ci
2758c2ecf20Sopenharmony_ci	if (fm2fb_mode == -1)
2768c2ecf20Sopenharmony_ci		fm2fb_mode = FM2FB_MODE_PAL;
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci	info->fbops = &fm2fb_ops;
2798c2ecf20Sopenharmony_ci	info->var = fb_var_modes[fm2fb_mode];
2808c2ecf20Sopenharmony_ci	info->pseudo_palette = info->par;
2818c2ecf20Sopenharmony_ci	info->par = NULL;
2828c2ecf20Sopenharmony_ci	info->fix = fb_fix;
2838c2ecf20Sopenharmony_ci	info->flags = FBINFO_DEFAULT;
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci	if (register_framebuffer(info) < 0) {
2868c2ecf20Sopenharmony_ci		fb_dealloc_cmap(&info->cmap);
2878c2ecf20Sopenharmony_ci		iounmap(info->screen_base);
2888c2ecf20Sopenharmony_ci		framebuffer_release(info);
2898c2ecf20Sopenharmony_ci		zorro_release_device(z);
2908c2ecf20Sopenharmony_ci		return -EINVAL;
2918c2ecf20Sopenharmony_ci	}
2928c2ecf20Sopenharmony_ci	fb_info(info, "%s frame buffer device\n", fb_fix.id);
2938c2ecf20Sopenharmony_ci	return 0;
2948c2ecf20Sopenharmony_ci}
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_ciint __init fm2fb_setup(char *options)
2978c2ecf20Sopenharmony_ci{
2988c2ecf20Sopenharmony_ci	char *this_opt;
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci	if (!options || !*options)
3018c2ecf20Sopenharmony_ci		return 0;
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci	while ((this_opt = strsep(&options, ",")) != NULL) {
3048c2ecf20Sopenharmony_ci		if (!strncmp(this_opt, "pal", 3))
3058c2ecf20Sopenharmony_ci			fm2fb_mode = FM2FB_MODE_PAL;
3068c2ecf20Sopenharmony_ci		else if (!strncmp(this_opt, "ntsc", 4))
3078c2ecf20Sopenharmony_ci			fm2fb_mode = FM2FB_MODE_NTSC;
3088c2ecf20Sopenharmony_ci	}
3098c2ecf20Sopenharmony_ci	return 0;
3108c2ecf20Sopenharmony_ci}
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ciint __init fm2fb_init(void)
3138c2ecf20Sopenharmony_ci{
3148c2ecf20Sopenharmony_ci	char *option = NULL;
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci	if (fb_get_options("fm2fb", &option))
3178c2ecf20Sopenharmony_ci		return -ENODEV;
3188c2ecf20Sopenharmony_ci	fm2fb_setup(option);
3198c2ecf20Sopenharmony_ci	return zorro_register_driver(&fm2fb_driver);
3208c2ecf20Sopenharmony_ci}
3218c2ecf20Sopenharmony_ci
3228c2ecf20Sopenharmony_cimodule_init(fm2fb_init);
3238c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL");
324