2 * Frame buffer driver for ADV7393/2 video encoder
4 * Copyright 2006-2009 Analog Devices Inc.
5 * Licensed under the GPL-2 or late.
13 #define DRIVER_NAME "bfin-adv7393"
15 #define pr_fmt(fmt) DRIVER_NAME ": " fmt
17 #include <linux/module.h>
18 #include <linux/kernel.h>
19 #include <linux/errno.h>
20 #include <linux/string.h>
22 #include <linux/tty.h>
23 #include <linux/slab.h>
24 #include <linux/delay.h>
26 #include <linux/ioport.h>
27 #include <linux/init.h>
28 #include <linux/types.h>
29 #include <linux/interrupt.h>
30 #include <linux/sched.h>
31 #include <asm/blackfin.h>
34 #include <linux/uaccess.h>
35 #include <linux/gpio.h>
36 #include <asm/portmux.h>
38 #include <linux/dma-mapping.h>
39 #include <linux/proc_fs.h>
40 #include <linux/platform_device.h>
41 #include <linux/i2c.h>
43 #include "bfin_adv7393fb.h"
45 static int mode
= VMODE
;
46 static int mem
= VMEM
;
47 static int nocursor
= 1;
49 static const unsigned short ppi_pins
[] = {
50 P_PPI0_CLK
, P_PPI0_FS1
, P_PPI0_FS2
,
51 P_PPI0_D0
, P_PPI0_D1
, P_PPI0_D2
, P_PPI0_D3
,
52 P_PPI0_D4
, P_PPI0_D5
, P_PPI0_D6
, P_PPI0_D7
,
53 P_PPI0_D8
, P_PPI0_D9
, P_PPI0_D10
, P_PPI0_D11
,
54 P_PPI0_D12
, P_PPI0_D13
, P_PPI0_D14
, P_PPI0_D15
,
62 static struct bfin_adv7393_fb_par
{
63 /* structure holding blackfin / adv7393 parameters when
66 u8 Mode
; /* ntsc/pal/? */
71 /* --------------------------------------------------------------------- */
73 static struct fb_var_screeninfo bfin_adv7393_fb_defined
= {
79 .activate
= FB_ACTIVATE_TEST
,
86 .vmode
= FB_VMODE_INTERLACED
,
93 static struct fb_fix_screeninfo bfin_adv7393_fb_fix
= {
95 .smem_len
= 720 * 480 * 2,
96 .type
= FB_TYPE_PACKED_PIXELS
,
97 .visual
= FB_VISUAL_TRUECOLOR
,
100 .line_length
= 720 * 2,
101 .accel
= FB_ACCEL_NONE
104 static struct fb_ops bfin_adv7393_fb_ops
= {
105 .owner
= THIS_MODULE
,
106 .fb_open
= bfin_adv7393_fb_open
,
107 .fb_release
= bfin_adv7393_fb_release
,
108 .fb_check_var
= bfin_adv7393_fb_check_var
,
109 .fb_pan_display
= bfin_adv7393_fb_pan_display
,
110 .fb_blank
= bfin_adv7393_fb_blank
,
111 .fb_fillrect
= cfb_fillrect
,
112 .fb_copyarea
= cfb_copyarea
,
113 .fb_imageblit
= cfb_imageblit
,
114 .fb_cursor
= bfin_adv7393_fb_cursor
,
115 .fb_setcolreg
= bfin_adv7393_fb_setcolreg
,
118 static int dma_desc_list(struct adv7393fb_device
*fbdev
, u16 arg
)
120 if (arg
== BUILD
) { /* Build */
121 fbdev
->vb1
= l1_data_sram_zalloc(sizeof(struct dmasg
));
122 if (fbdev
->vb1
== NULL
)
125 fbdev
->av1
= l1_data_sram_zalloc(sizeof(struct dmasg
));
126 if (fbdev
->av1
== NULL
)
129 fbdev
->vb2
= l1_data_sram_zalloc(sizeof(struct dmasg
));
130 if (fbdev
->vb2
== NULL
)
133 fbdev
->av2
= l1_data_sram_zalloc(sizeof(struct dmasg
));
134 if (fbdev
->av2
== NULL
)
137 /* Build linked DMA descriptor list */
138 fbdev
->vb1
->next_desc_addr
= fbdev
->av1
;
139 fbdev
->av1
->next_desc_addr
= fbdev
->vb2
;
140 fbdev
->vb2
->next_desc_addr
= fbdev
->av2
;
141 fbdev
->av2
->next_desc_addr
= fbdev
->vb1
;
144 fbdev
->descriptor_list_head
= fbdev
->av2
;
146 /* Vertical Blanking Field 1 */
147 fbdev
->vb1
->start_addr
= VB_DUMMY_MEMORY_SOURCE
;
148 fbdev
->vb1
->cfg
= DMA_CFG_VAL
;
150 fbdev
->vb1
->x_count
=
151 fbdev
->modes
[mode
].xres
+ fbdev
->modes
[mode
].boeft_blank
;
153 fbdev
->vb1
->x_modify
= 0;
154 fbdev
->vb1
->y_count
= fbdev
->modes
[mode
].vb1_lines
;
155 fbdev
->vb1
->y_modify
= 0;
157 /* Active Video Field 1 */
159 fbdev
->av1
->start_addr
= (unsigned long)fbdev
->fb_mem
;
160 fbdev
->av1
->cfg
= DMA_CFG_VAL
;
161 fbdev
->av1
->x_count
=
162 fbdev
->modes
[mode
].xres
+ fbdev
->modes
[mode
].boeft_blank
;
163 fbdev
->av1
->x_modify
= fbdev
->modes
[mode
].bpp
/ 8;
164 fbdev
->av1
->y_count
= fbdev
->modes
[mode
].a_lines
;
165 fbdev
->av1
->y_modify
=
166 (fbdev
->modes
[mode
].xres
- fbdev
->modes
[mode
].boeft_blank
+
167 1) * (fbdev
->modes
[mode
].bpp
/ 8);
169 /* Vertical Blanking Field 2 */
171 fbdev
->vb2
->start_addr
= VB_DUMMY_MEMORY_SOURCE
;
172 fbdev
->vb2
->cfg
= DMA_CFG_VAL
;
173 fbdev
->vb2
->x_count
=
174 fbdev
->modes
[mode
].xres
+ fbdev
->modes
[mode
].boeft_blank
;
176 fbdev
->vb2
->x_modify
= 0;
177 fbdev
->vb2
->y_count
= fbdev
->modes
[mode
].vb2_lines
;
178 fbdev
->vb2
->y_modify
= 0;
180 /* Active Video Field 2 */
182 fbdev
->av2
->start_addr
=
183 (unsigned long)fbdev
->fb_mem
+ fbdev
->line_len
;
185 fbdev
->av2
->cfg
= DMA_CFG_VAL
;
187 fbdev
->av2
->x_count
=
188 fbdev
->modes
[mode
].xres
+ fbdev
->modes
[mode
].boeft_blank
;
190 fbdev
->av2
->x_modify
= (fbdev
->modes
[mode
].bpp
/ 8);
191 fbdev
->av2
->y_count
= fbdev
->modes
[mode
].a_lines
;
193 fbdev
->av2
->y_modify
=
194 (fbdev
->modes
[mode
].xres
- fbdev
->modes
[mode
].boeft_blank
+
195 1) * (fbdev
->modes
[mode
].bpp
/ 8);
201 l1_data_sram_free(fbdev
->vb1
);
202 l1_data_sram_free(fbdev
->av1
);
203 l1_data_sram_free(fbdev
->vb2
);
204 l1_data_sram_free(fbdev
->av2
);
209 static int bfin_config_dma(struct adv7393fb_device
*fbdev
)
211 BUG_ON(!(fbdev
->fb_mem
));
213 set_dma_x_count(CH_PPI
, fbdev
->descriptor_list_head
->x_count
);
214 set_dma_x_modify(CH_PPI
, fbdev
->descriptor_list_head
->x_modify
);
215 set_dma_y_count(CH_PPI
, fbdev
->descriptor_list_head
->y_count
);
216 set_dma_y_modify(CH_PPI
, fbdev
->descriptor_list_head
->y_modify
);
217 set_dma_start_addr(CH_PPI
, fbdev
->descriptor_list_head
->start_addr
);
218 set_dma_next_desc_addr(CH_PPI
,
219 fbdev
->descriptor_list_head
->next_desc_addr
);
220 set_dma_config(CH_PPI
, fbdev
->descriptor_list_head
->cfg
);
225 static void bfin_disable_dma(void)
227 bfin_write_DMA0_CONFIG(bfin_read_DMA0_CONFIG() & ~DMAEN
);
230 static void bfin_config_ppi(struct adv7393fb_device
*fbdev
)
232 if (ANOMALY_05000183
) {
233 bfin_write_TIMER2_CONFIG(WDTH_CAP
);
234 bfin_write_TIMER_ENABLE(TIMEN2
);
237 bfin_write_PPI_CONTROL(0x381E);
238 bfin_write_PPI_FRAME(fbdev
->modes
[mode
].tot_lines
);
239 bfin_write_PPI_COUNT(fbdev
->modes
[mode
].xres
+
240 fbdev
->modes
[mode
].boeft_blank
- 1);
241 bfin_write_PPI_DELAY(fbdev
->modes
[mode
].aoeft_blank
- 1);
244 static void bfin_enable_ppi(void)
246 bfin_write_PPI_CONTROL(bfin_read_PPI_CONTROL() | PORT_EN
);
249 static void bfin_disable_ppi(void)
251 bfin_write_PPI_CONTROL(bfin_read_PPI_CONTROL() & ~PORT_EN
);
254 static inline int adv7393_write(struct i2c_client
*client
, u8 reg
, u8 value
)
256 return i2c_smbus_write_byte_data(client
, reg
, value
);
259 static inline int adv7393_read(struct i2c_client
*client
, u8 reg
)
261 return i2c_smbus_read_byte_data(client
, reg
);
265 adv7393_write_block(struct i2c_client
*client
,
266 const u8
*data
, unsigned int len
)
273 ret
= adv7393_write(client
, reg
, *data
++);
282 static int adv7393_mode(struct i2c_client
*client
, u16 mode
)
285 case POWER_ON
: /* ADV7393 Sleep mode OFF */
286 adv7393_write(client
, 0x00, 0x1E);
288 case POWER_DOWN
: /* ADV7393 Sleep mode ON */
289 adv7393_write(client
, 0x00, 0x1F);
291 case BLANK_OFF
: /* Pixel Data Valid */
292 adv7393_write(client
, 0x82, 0xCB);
294 case BLANK_ON
: /* Pixel Data Invalid */
295 adv7393_write(client
, 0x82, 0x8B);
304 static irqreturn_t
ppi_irq_error(int irq
, void *dev_id
)
307 struct adv7393fb_device
*fbdev
= (struct adv7393fb_device
*)dev_id
;
309 u16 status
= bfin_read_PPI_STATUS();
311 pr_debug("%s: PPI Status = 0x%X\n", __func__
, status
);
314 bfin_disable_dma(); /* TODO: Check Sequence */
316 bfin_clear_PPI_STATUS();
317 bfin_config_dma(fbdev
);
325 static int proc_output(char *buf
)
331 "echo 0x[REG][Value] > adv7393\n"
332 "example: echo 0x1234 >adv7393\n"
333 "writes 0x34 into Register 0x12\n");
339 adv7393_read_proc(struct file
*file
, char __user
*buf
,
340 size_t size
, loff_t
*ppos
)
342 static const char message
[] = "Usage:\n"
343 "echo 0x[REG][Value] > adv7393\n"
344 "example: echo 0x1234 >adv7393\n"
345 "writes 0x34 into Register 0x12\n";
346 return simple_read_from_buffer(buf
, size
, ppos
, message
,
351 adv7393_write_proc(struct file
*file
, const char __user
* buffer
,
352 size_t count
, loff_t
*ppos
)
354 struct adv7393fb_device
*fbdev
= PDE_DATA(file_inode(file
));
358 ret
= kstrtouint_from_user(buffer
, count
, 0, &val
);
362 adv7393_write(fbdev
->client
, val
>> 8, val
& 0xff);
367 static const struct file_operations fops
= {
368 .read
= adv7393_read_proc
,
369 .write
= adv7393_write_proc
,
370 .llseek
= default_llseek
,
373 static int bfin_adv7393_fb_probe(struct i2c_client
*client
,
374 const struct i2c_device_id
*id
)
377 struct proc_dir_entry
*entry
;
379 struct adv7393fb_device
*fbdev
= NULL
;
382 dev_err(&client
->dev
, "mem out of allowed range [1;2]\n");
386 if (mode
>= ARRAY_SIZE(known_modes
)) {
387 dev_err(&client
->dev
, "mode %d: not supported", mode
);
391 fbdev
= kzalloc(sizeof(*fbdev
), GFP_KERNEL
);
393 dev_err(&client
->dev
, "failed to allocate device private record");
397 i2c_set_clientdata(client
, fbdev
);
399 fbdev
->modes
= known_modes
;
400 fbdev
->client
= client
;
403 mem
* fbdev
->modes
[mode
].xres
* fbdev
->modes
[mode
].xres
*
404 (fbdev
->modes
[mode
].bpp
/ 8);
407 fbdev
->modes
[mode
].xres
* (fbdev
->modes
[mode
].bpp
/ 8);
409 /* Workaround "PPI Does Not Start Properly In Specific Mode" */
410 if (ANOMALY_05000400
) {
411 ret
= gpio_request_one(P_IDENT(P_PPI0_FS3
), GPIOF_OUT_INIT_LOW
,
414 dev_err(&client
->dev
, "PPI0_FS3 GPIO request failed\n");
420 if (peripheral_request_list(ppi_pins
, DRIVER_NAME
)) {
421 dev_err(&client
->dev
, "requesting PPI peripheral failed\n");
427 dma_alloc_coherent(NULL
, fbdev
->fb_len
, &fbdev
->dma_handle
,
430 if (NULL
== fbdev
->fb_mem
) {
431 dev_err(&client
->dev
, "couldn't allocate dma buffer (%d bytes)\n",
432 (u32
) fbdev
->fb_len
);
437 fbdev
->info
.screen_base
= (void *)fbdev
->fb_mem
;
438 bfin_adv7393_fb_fix
.smem_start
= (int)fbdev
->fb_mem
;
440 bfin_adv7393_fb_fix
.smem_len
= fbdev
->fb_len
;
441 bfin_adv7393_fb_fix
.line_length
= fbdev
->line_len
;
444 bfin_adv7393_fb_fix
.ypanstep
= 1;
446 bfin_adv7393_fb_defined
.red
.length
= 5;
447 bfin_adv7393_fb_defined
.green
.length
= 6;
448 bfin_adv7393_fb_defined
.blue
.length
= 5;
450 bfin_adv7393_fb_defined
.xres
= fbdev
->modes
[mode
].xres
;
451 bfin_adv7393_fb_defined
.yres
= fbdev
->modes
[mode
].yres
;
452 bfin_adv7393_fb_defined
.xres_virtual
= fbdev
->modes
[mode
].xres
;
453 bfin_adv7393_fb_defined
.yres_virtual
= mem
* fbdev
->modes
[mode
].yres
;
454 bfin_adv7393_fb_defined
.bits_per_pixel
= fbdev
->modes
[mode
].bpp
;
456 fbdev
->info
.fbops
= &bfin_adv7393_fb_ops
;
457 fbdev
->info
.var
= bfin_adv7393_fb_defined
;
458 fbdev
->info
.fix
= bfin_adv7393_fb_fix
;
459 fbdev
->info
.par
= &bfin_par
;
460 fbdev
->info
.flags
= FBINFO_DEFAULT
;
462 fbdev
->info
.pseudo_palette
= kzalloc(sizeof(u32
) * 16, GFP_KERNEL
);
463 if (!fbdev
->info
.pseudo_palette
) {
464 dev_err(&client
->dev
, "failed to allocate pseudo_palette\n");
469 if (fb_alloc_cmap(&fbdev
->info
.cmap
, BFIN_LCD_NBR_PALETTE_ENTRIES
, 0) < 0) {
470 dev_err(&client
->dev
, "failed to allocate colormap (%d entries)\n",
471 BFIN_LCD_NBR_PALETTE_ENTRIES
);
476 if (request_dma(CH_PPI
, "BF5xx_PPI_DMA") < 0) {
477 dev_err(&client
->dev
, "unable to request PPI DMA\n");
482 if (request_irq(IRQ_PPI_ERROR
, ppi_irq_error
, 0,
483 "PPI ERROR", fbdev
) < 0) {
484 dev_err(&client
->dev
, "unable to request PPI ERROR IRQ\n");
491 ret
= adv7393_write_block(client
, fbdev
->modes
[mode
].adv7393_i2c_initd
,
492 fbdev
->modes
[mode
].adv7393_i2c_initd_len
);
495 dev_err(&client
->dev
, "i2c attach: init error\n");
500 if (register_framebuffer(&fbdev
->info
) < 0) {
501 dev_err(&client
->dev
, "unable to register framebuffer\n");
506 dev_info(&client
->dev
, "fb%d: %s frame buffer device\n",
507 fbdev
->info
.node
, fbdev
->info
.fix
.id
);
508 dev_info(&client
->dev
, "fb memory address : 0x%p\n", fbdev
->fb_mem
);
510 entry
= proc_create_data("driver/adv7393", 0, NULL
, &fops
, fbdev
);
512 dev_err(&client
->dev
, "unable to create /proc entry\n");
519 unregister_framebuffer(&fbdev
->info
);
521 free_irq(IRQ_PPI_ERROR
, fbdev
);
525 fb_dealloc_cmap(&fbdev
->info
.cmap
);
527 kfree(fbdev
->info
.pseudo_palette
);
529 dma_free_coherent(NULL
, fbdev
->fb_len
, fbdev
->fb_mem
,
532 peripheral_free_list(ppi_pins
);
534 if (ANOMALY_05000400
)
535 gpio_free(P_IDENT(P_PPI0_FS3
));
542 static int bfin_adv7393_fb_open(struct fb_info
*info
, int user
)
544 struct adv7393fb_device
*fbdev
= to_adv7393fb_device(info
);
546 fbdev
->info
.screen_base
= (void *)fbdev
->fb_mem
;
547 if (!fbdev
->info
.screen_base
) {
548 dev_err(&fbdev
->client
->dev
, "unable to map device\n");
553 dma_desc_list(fbdev
, BUILD
);
554 adv7393_mode(fbdev
->client
, BLANK_OFF
);
555 bfin_config_ppi(fbdev
);
556 bfin_config_dma(fbdev
);
562 static int bfin_adv7393_fb_release(struct fb_info
*info
, int user
)
564 struct adv7393fb_device
*fbdev
= to_adv7393fb_device(info
);
566 adv7393_mode(fbdev
->client
, BLANK_ON
);
569 dma_desc_list(fbdev
, DESTRUCT
);
575 bfin_adv7393_fb_check_var(struct fb_var_screeninfo
*var
, struct fb_info
*info
)
578 switch (var
->bits_per_pixel
) {
579 case 16:/* DIRECTCOLOUR, 64k */
580 var
->red
.offset
= info
->var
.red
.offset
;
581 var
->green
.offset
= info
->var
.green
.offset
;
582 var
->blue
.offset
= info
->var
.blue
.offset
;
583 var
->red
.length
= info
->var
.red
.length
;
584 var
->green
.length
= info
->var
.green
.length
;
585 var
->blue
.length
= info
->var
.blue
.length
;
586 var
->transp
.offset
= 0;
587 var
->transp
.length
= 0;
588 var
->transp
.msb_right
= 0;
589 var
->red
.msb_right
= 0;
590 var
->green
.msb_right
= 0;
591 var
->blue
.msb_right
= 0;
594 pr_debug("%s: depth not supported: %u BPP\n", __func__
,
595 var
->bits_per_pixel
);
599 if (info
->var
.xres
!= var
->xres
||
600 info
->var
.yres
!= var
->yres
||
601 info
->var
.xres_virtual
!= var
->xres_virtual
||
602 info
->var
.yres_virtual
!= var
->yres_virtual
) {
603 pr_debug("%s: Resolution not supported: X%u x Y%u\n",
604 __func__
, var
->xres
, var
->yres
);
612 if ((info
->fix
.line_length
* var
->yres_virtual
) > info
->fix
.smem_len
) {
613 pr_debug("%s: Memory Limit requested yres_virtual = %u\n",
614 __func__
, var
->yres_virtual
);
622 bfin_adv7393_fb_pan_display(struct fb_var_screeninfo
*var
, struct fb_info
*info
)
626 struct adv7393fb_device
*fbdev
= to_adv7393fb_device(info
);
631 if (var
->xoffset
- info
->var
.xoffset
) {
632 /* No support for X panning for now! */
635 dy
= var
->yoffset
- info
->var
.yoffset
;
638 pr_debug("%s: Panning screen of %d lines\n", __func__
, dy
);
640 dmaaddr
= fbdev
->av1
->start_addr
;
641 dmaaddr
+= (info
->fix
.line_length
* dy
);
642 /* TODO: Wait for current frame to finished */
644 fbdev
->av1
->start_addr
= (unsigned long)dmaaddr
;
645 fbdev
->av2
->start_addr
= (unsigned long)dmaaddr
+ fbdev
->line_len
;
652 /* 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off */
653 static int bfin_adv7393_fb_blank(int blank
, struct fb_info
*info
)
655 struct adv7393fb_device
*fbdev
= to_adv7393fb_device(info
);
659 case VESA_NO_BLANKING
:
661 adv7393_mode(fbdev
->client
, BLANK_OFF
);
664 case VESA_VSYNC_SUSPEND
:
665 case VESA_HSYNC_SUSPEND
:
668 adv7393_mode(fbdev
->client
, BLANK_ON
);
678 int bfin_adv7393_fb_cursor(struct fb_info
*info
, struct fb_cursor
*cursor
)
683 return -EINVAL
; /* just to force soft_cursor() call */
686 static int bfin_adv7393_fb_setcolreg(u_int regno
, u_int red
, u_int green
,
687 u_int blue
, u_int transp
,
688 struct fb_info
*info
)
690 if (regno
>= BFIN_LCD_NBR_PALETTE_ENTRIES
)
693 if (info
->var
.grayscale
)
694 /* grayscale = 0.30*R + 0.59*G + 0.11*B */
695 red
= green
= blue
= (red
* 77 + green
* 151 + blue
* 28) >> 8;
697 if (info
->fix
.visual
== FB_VISUAL_TRUECOLOR
) {
699 /* Place color in the pseudopalette */
703 red
>>= (16 - info
->var
.red
.length
);
704 green
>>= (16 - info
->var
.green
.length
);
705 blue
>>= (16 - info
->var
.blue
.length
);
707 value
= (red
<< info
->var
.red
.offset
) |
708 (green
<< info
->var
.green
.offset
)|
709 (blue
<< info
->var
.blue
.offset
);
712 ((u32
*) (info
->pseudo_palette
))[regno
] = value
;
718 static int bfin_adv7393_fb_remove(struct i2c_client
*client
)
720 struct adv7393fb_device
*fbdev
= i2c_get_clientdata(client
);
722 adv7393_mode(client
, POWER_DOWN
);
725 dma_free_coherent(NULL
, fbdev
->fb_len
, fbdev
->fb_mem
, fbdev
->dma_handle
);
727 free_irq(IRQ_PPI_ERROR
, fbdev
);
728 unregister_framebuffer(&fbdev
->info
);
729 remove_proc_entry("driver/adv7393", NULL
);
730 fb_dealloc_cmap(&fbdev
->info
.cmap
);
731 kfree(fbdev
->info
.pseudo_palette
);
733 if (ANOMALY_05000400
)
734 gpio_free(P_IDENT(P_PPI0_FS3
)); /* FS3 */
735 peripheral_free_list(ppi_pins
);
742 static int bfin_adv7393_fb_suspend(struct device
*dev
)
744 struct adv7393fb_device
*fbdev
= dev_get_drvdata(dev
);
749 dma_desc_list(fbdev
, DESTRUCT
);
751 adv7393_mode(fbdev
->client
, POWER_DOWN
);
756 static int bfin_adv7393_fb_resume(struct device
*dev
)
758 struct adv7393fb_device
*fbdev
= dev_get_drvdata(dev
);
760 adv7393_mode(fbdev
->client
, POWER_ON
);
763 dma_desc_list(fbdev
, BUILD
);
764 bfin_config_ppi(fbdev
);
765 bfin_config_dma(fbdev
);
772 static const struct dev_pm_ops bfin_adv7393_dev_pm_ops
= {
773 .suspend
= bfin_adv7393_fb_suspend
,
774 .resume
= bfin_adv7393_fb_resume
,
778 static const struct i2c_device_id bfin_adv7393_id
[] = {
783 MODULE_DEVICE_TABLE(i2c
, bfin_adv7393_id
);
785 static struct i2c_driver bfin_adv7393_fb_driver
= {
789 .pm
= &bfin_adv7393_dev_pm_ops
,
792 .probe
= bfin_adv7393_fb_probe
,
793 .remove
= bfin_adv7393_fb_remove
,
794 .id_table
= bfin_adv7393_id
,
797 static int __init
bfin_adv7393_fb_driver_init(void)
799 #if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
800 request_module("i2c-bfin-twi");
802 request_module("i2c-gpio");
805 return i2c_add_driver(&bfin_adv7393_fb_driver
);
807 module_init(bfin_adv7393_fb_driver_init
);
809 static void __exit
bfin_adv7393_fb_driver_cleanup(void)
811 i2c_del_driver(&bfin_adv7393_fb_driver
);
813 module_exit(bfin_adv7393_fb_driver_cleanup
);
815 MODULE_LICENSE("GPL");
816 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
817 MODULE_DESCRIPTION("Frame buffer driver for ADV7393/2 Video Encoder");
819 module_param(mode
, int, 0);
820 MODULE_PARM_DESC(mode
,
821 "Video Mode (0=NTSC,1=PAL,2=NTSC 640x480,3=PAL 640x480,4=NTSC YCbCr input,5=PAL YCbCr input)");
823 module_param(mem
, int, 0);
824 MODULE_PARM_DESC(mem
,
825 "Size of frame buffer memory 1=Single 2=Double Size (allows y-panning / frame stacking)");
827 module_param(nocursor
, int, 0644);
828 MODULE_PARM_DESC(nocursor
, "cursor enable/disable");