从内核空间禁用LCD控制器

时间:2012-07-31 09:52:53

标签: embedded-linux kernel kernel-module

我正在编写简单的独立Linux内核模块,它可以关闭LCD控制器。所以我在drivers / video / amba-clcd.c中找到了一些函数:

/*
 *  Blank the screen if blank_mode != 0, else unblank. If blank == NULL
 *  then the caller blanks by setting the CLUT (Color Look Up Table) to all
 *  black. Return 0 if blanking succeeded, != 0 if un-/blanking failed due
 *  to e.g. a video mode which doesn't support it. Implements VESA suspend
 *  and powerdown modes on hardware that supports disabling hsync/vsync:
 *    blank_mode == 2: suspend vsync
 *    blank_mode == 3: suspend hsync
 *    blank_mode == 4: powerdown
 */
static int clcdfb_blank(int blank_mode, struct fb_info *info)
{
    struct clcd_fb *fb = to_clcd(info);

    if (blank_mode != 0) {
        clcdfb_disable(fb);
    } else {
        clcdfb_enable(fb, fb->clcd_cntl);
    }
    return 0;
}

如何从我的独立模块调用此功能?

1 个答案:

答案 0 :(得分:2)

首先,删除'static'关键字。

然后将此功能导出到您的模块,您可以执行此操作 与

EXPORT_SYMBOL(clcdfb_blank);

请参阅here