2

我正在编写简单的独立 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;
}

如何从我的独立模块调用此函数?

4

1 回答 1

2

首先,删除“静态”关键字。

然后将此功能导出到您的模块,您可以使用

EXPORT_SYMBOL(clcdfb_blank);

这里

于 2012-08-24T19:34:17.980 回答