2

I'm writing simple standalone linux kernel module, which can turn off the LCD controler. So I find some functions in 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;
}

How can I call this function from my standalone module?

cnd
  • 32,616
  • 62
  • 183
  • 313
ymn
  • 2,175
  • 2
  • 21
  • 39

1 Answers1

2

First of all, remove the 'static' keyword.

Then export this function to your module, you can do this with

EXPORT_SYMBOL(clcdfb_blank);

See here.

Community
  • 1
  • 1
Ezequiel Garcia
  • 1,037
  • 8
  • 20