BigW Consortium Gitlab

Commit 20d5c7d4 by Thibaut

Add Kconfig for integration of the driver in the kernel build process

Add option to configure frame rate at the drievr load operation
parent 4f4bf016
......@@ -12,6 +12,23 @@ http://www.youtube.com/watch?v=KCNrq1hb99U
[国内用户:] http://www.tudou.com/programs/view/rJd1TwZzRZk/
How to Integrate the Linux Kernel Driver in the Kernel build operation
======================================================================
1) Copy the content of linux-driver folder in your kernel source (ideally in a new folder called robopeak inside the drivers/video folder)
2) Replace the Makefile file by the NewMakefile one
3) Edit the Kconfig file of the drivers/video file and insert the line
* source "drivers/video/robopeak/Kconfig"
after the line
* comment "Frame buffer hardware drivers"
4) Change the .config of your kernel through the menuconfig
* make ARCH=your_architecture your_defconfig menuconfig
5) In the menu "Device Drivers -> Graphic supports -> Support for frame buffer display" a Robopeak USB Display menu appears
6) Set the Robopeak USB Display as module (this selection activates automatically the requested frame buffer option, see Prerequites of How to build the Linux Kernel Driver chapter)
7) Generate your kernel
How to Build the Linux Kernel Driver
====================================
Here we only provide you the basic building process. Please refer to the related documents for details.
......@@ -106,6 +123,10 @@ Once you had deployed the kernel driver and all of its dependencies, you can ask
modprobe rp_usbdisplay
By default the frame per seconds is set to 16. You can change it with the fps option when you load the driver :
modprobe rp_usbdisplay fps=25
In this case the frame per seconds is set to 25.
If you want to let the kernel load the driver automatically each time when the system starts, you can added the following line into the file /etc/modules:
rp_usbdisplay
......
menuconfig FB_RPUSBDISP
tristate "Robopeak USB Display"
depends on FB && m
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
select FB_SYS_FILLRECT
select FB_SYS_COPYAREA
select FB_SYS_IMAGEBLIT
select FB_SYS_FOPS
select FB_MODE_HELPER
select FB_DEFERRED_IO
help
Frame buffer driver for RoboPeak usb display
The module will be called rp_usbdisplay.
config RPUSBDISP_FPS
int "display frame rate"
default 16
depends on FB_RPUSBDISP
help
Specify the frame rate used by the FB_DEFERRED_IO to update
the display content
This value can be overridden by the modprobe
with the fps parameter
######################################
#
# RoboPeak USB LCD Display Linux Driver
#
# Copyright (C) 2009 - 2013 RoboPeak Team
# This file is licensed under the GPL. See LICENSE in the package.
#
# http://www.robopeak.net
#
# Author Shikai Chen
#
######################################
DRIVER_NAME := rp_usbdisplay
EXTRA_CFLAGS += -I$(PWD)/src -I$(PWD)/../common
obj-$(CONFIG_FB_RPUSBDISP) := $(DRIVER_NAME).o
DRIVER_FILES := src/main.o \
src/usbhandlers.o \
src/fbhandlers.o \
src/touchhandlers.o
$(DRIVER_NAME)-objs:= $(DRIVER_FILES)
......@@ -405,7 +405,8 @@ static int _on_create_new_fb(struct fb_info ** out_fb, struct rpusbdisp_dev *dev
fbdefio = /*kmalloc*/kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);
if (fbdefio) {
fbdefio->delay = HZ/16;
// frame rate is configurable through the fps option during the load operation
fbdefio->delay = HZ/fps;
fbdefio->deferred_io = _display_defio_handler;
} else {
err("Cannot alloc the fb_deferred_io.\n");
......
......@@ -41,6 +41,7 @@
#include "inc/protocol.h"
extern int fps;
// object predefine
......
......@@ -40,6 +40,9 @@ static struct usb_class_driver lcd_class = {
};
#endif
int fps = 0;
module_param(fps,int,0);
MODULE_PARM_DESC(fps,"Specify the frame rate used to refresh the display (override kernel config)");
......@@ -47,6 +50,16 @@ static int __init usb_disp_init(void)
{
int result;
if (fps == 0) {
/* frame rate is not set through the modprobe command. Use the value defined in the .config */
#ifdef CONFIG_RPUSBDISP_FPS
fps = CONFIG_RPUSBDISP_FPS;
#else
/* Just in case for background compliance. Maybe the Kconfig file of the driver is not integrated */
fps = 16;
#endif
}
do {
result = register_touch_handler();
......
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