Skip to content

Commit

Permalink
auxdisplay: ht16k33: Fix frame buffer device blanking
Browse files Browse the repository at this point in the history
As the ht16k33 frame buffer sub-driver does not register an
fb_ops.fb_blank() handler, blanking does not work:

    $ echo 1 > /sys/class/graphics/fb0/blank
    sh: write error: Invalid argument

Fix this by providing a handler that always returns zero, to make sure
blank events will be sent to the actual device handling the backlight.

Reported-by: Robin van der Gracht <[email protected]>
Suggested-by: Robin van der Gracht <[email protected]>
Fixes: 8992da4 ("auxdisplay: ht16k33: Driver for LED controller")
Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
geertu authored and ojeda committed Oct 21, 2021
1 parent 80f9eb7 commit 840fe25
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/auxdisplay/ht16k33.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,15 @@ static const struct backlight_ops ht16k33_bl_ops = {
.check_fb = ht16k33_bl_check_fb,
};

/*
* Blank events will be passed to the actual device handling the backlight when
* we return zero here.
*/
static int ht16k33_blank(int blank, struct fb_info *info)
{
return 0;
}

static int ht16k33_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct ht16k33_priv *priv = info->par;
Expand All @@ -231,6 +240,7 @@ static const struct fb_ops ht16k33_fb_ops = {
.owner = THIS_MODULE,
.fb_read = fb_sys_read,
.fb_write = fb_sys_write,
.fb_blank = ht16k33_blank,
.fb_fillrect = sys_fillrect,
.fb_copyarea = sys_copyarea,
.fb_imageblit = sys_imageblit,
Expand Down

0 comments on commit 840fe25

Please sign in to comment.