]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
auxdisplay: ht16k33: Fix frame buffer device blanking
authorGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 19 Oct 2021 14:45:09 +0000 (16:45 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:34 +0000 (09:48 +0100)
BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit 840fe258332544aa7321921e1723d37b772af7a9 ]

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 <robin@protonic.nl>
Suggested-by: Robin van der Gracht <robin@protonic.nl>
Fixes: 8992da44c6805d53 ("auxdisplay: ht16k33: Driver for LED controller")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/auxdisplay/ht16k33.c

index 2b630e194570f6e570ae2fe8d5ae8b2b57b04c65..ed5808349990782ce3a6685baf5118bc2d5f7e89 100644 (file)
@@ -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;
@@ -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,