Received: by 10.223.148.5 with SMTP id 5csp6454347wrq; Wed, 17 Jan 2018 14:04:40 -0800 (PST) X-Google-Smtp-Source: ACJfBotNWZan9ct8cnLr13aRCrZdcRxqnHWFleH9/KtLJv73a9NTJKAcLLipRcfeuiUpWf6q5KED X-Received: by 10.159.246.139 with SMTP id c11mr9549383pls.95.1516226680635; Wed, 17 Jan 2018 14:04:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516226680; cv=none; d=google.com; s=arc-20160816; b=PsSSjC6in4WU0x4ImH1Ad72+fx92j5F8ADhzIRHvFM4VDiiXpIzksWGwPsWC5x0sZw jVzg7ry3T1K0TM7p3d0kSfPjyby3WUXpoLrmqsGP+nhVKnY2Wgpt1RLOKgCuFQkv+VjP 4IPGGwR/yyHBtVqU+UwnfHmcS5HrOM8qILto6BXoyuTw7y9lnevERNNlHe/HzukNqArr EC48RvBgBml6a4/FxM6Nw/g+Fad4ZDJoZiIV07F2qCWagqnPMs913oWwFIaOrSbjRYRO BoxRx7rClKZy9pepixbfs+nlc4JJZlXyO/yFXKfs0M1af1P0s0FqtxqpYlF9Bc6NyVab YdhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=LLn6+GNJQbvlBTlX169Dd5cd1ExufPFjNf6WFznLVlI=; b=S/tad6eEChQGkGllaqd6KGnhK4cAU2Kd2Pa4gjMCp4Uc61GhSeFDqjDbf3P0ADO7Gu OX9L8lkJAmNuc1RMnQKwbFun0l/PoZXdMcTk0fr5IM0s/v0w2A/uIfe9WNmQ4lmvUh+C COqNr4bTsX7HVl/CIQMPsuLcjQ68y+YiNJCqj6i1beeZAKD05vvrp24U6WPdcBjBwgWt 9Pu3DQ1a352DGUPG046EJtEmOqcQ1z2zQI3x+tclXqdAwxYbT8rp+y9Tb60J8wCVoFRN /DxZHr3f6Y2Hoy334synanmXon44bzXNnM7/jRRHAxUjjgecmg97uitIoXuDkJy/bQ+/ 0KgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h129si4615706pgc.490.2018.01.17.14.04.25; Wed, 17 Jan 2018 14:04:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753901AbeAQWDh (ORCPT + 99 others); Wed, 17 Jan 2018 17:03:37 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:40792 "EHLO smtp.domeneshop.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753738AbeAQWDg (ORCPT ); Wed, 17 Jan 2018 17:03:36 -0500 Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:60487 helo=[192.168.10.157]) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ebvnx-00042h-UK; Wed, 17 Jan 2018 23:03:33 +0100 Subject: Re: [PATCH v16 01/10] video: backlight: Add helpers to enable and disable backlight To: Daniel Thompson , Meghana Madhyastha , Lee Jones , Jingoo Han , Thierry Reding , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <0ef2305477e69efdf61a378079fb7404a40c909f.1516098341.git.meghana.madhyastha@gmail.com> <84821d63-edc4-9a9a-db54-a180bf5fe9f6@linaro.org> From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= Message-ID: <7fe263d8-7b4a-68f1-2799-4b29d45dac89@tronnes.org> Date: Wed, 17 Jan 2018 23:03:24 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <84821d63-edc4-9a9a-db54-a180bf5fe9f6@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Den 17.01.2018 18.00, skrev Daniel Thompson: > > > On 16/01/18 10:31, Meghana Madhyastha wrote: >> Add helper functions backlight_enable and backlight_disable to >> enable/disable a backlight device. These helper functions can >> then be used by different drm and tinydrm drivers to avoid >> repetition of code and also to enforce a uniform and consistent >> way to enable/disable a backlight device. >> >> Signed-off-by: Meghana Madhyastha > > To be clear I don't disagree with anthing Daniel V. said about the > horribly confused (and confusing) power states for backlight. > > Nevertheless I don't recall seeing any response (positive or negative) > to this post from v13: > https://www.spinics.net/lists/dri-devel/msg154459.html > I see that Daniel V has answered while I was chasing this down, but anyways: A grep suggests that omap1_bl is the only driver that only checks fb_blank. All the other drivers check both fb_blank and power, a few check state. The backlight fbdev notifier callback doesn't set power, but sets fb_blank and state. fb_blank was marked 'Due to be removed' 9 years ago, so it hasn't been high priority. So for completeness I guess it makes sense to set fb_blank. Noralf. $ grep -r -C10 "props\.fb_blank" . ./drivers/video/backlight/corgi_lcd.c-  if (bd->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/corgi_lcd.c-          intensity = 0; ./drivers/video/backlight/corgi_lcd.c- ./drivers/video/backlight/corgi_lcd.c:  if (bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/corgi_lcd.c-          intensity = 0; -- ./drivers/video/backlight/adp8860_bl.c- if (bl->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/adp8860_bl.c-         brightness = 0; ./drivers/video/backlight/adp8860_bl.c- ./drivers/video/backlight/adp8860_bl.c: if (bl->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/adp8860_bl.c-         brightness = 0; -- ./drivers/video/backlight/hp680_bl.c-   if (bd->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/hp680_bl.c-           intensity = 0; ./drivers/video/backlight/hp680_bl.c:   if (bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/hp680_bl.c-           intensity = 0; -- ./drivers/video/backlight/cr_bllcd.c-static int cr_backlight_set_intensity(struct backlight_device *bd) ./drivers/video/backlight/cr_bllcd.c-{ ./drivers/video/backlight/cr_bllcd.c-   int intensity = bd->props.brightness; ./drivers/video/backlight/cr_bllcd.c-   u32 addr = gpio_bar + CRVML_PANEL_PORT; ./drivers/video/backlight/cr_bllcd.c-   u32 cur = inl(addr); ./drivers/video/backlight/cr_bllcd.c- ./drivers/video/backlight/cr_bllcd.c-   if (bd->props.power == FB_BLANK_UNBLANK) ./drivers/video/backlight/cr_bllcd.c-           intensity = FB_BLANK_UNBLANK; ./drivers/video/backlight/cr_bllcd.c:   if (bd->props.fb_blank == FB_BLANK_UNBLANK) ./drivers/video/backlight/cr_bllcd.c-           intensity = FB_BLANK_UNBLANK; ./drivers/video/backlight/cr_bllcd.c-   if (bd->props.power == FB_BLANK_POWERDOWN) ./drivers/video/backlight/cr_bllcd.c-           intensity = FB_BLANK_POWERDOWN; ./drivers/video/backlight/cr_bllcd.c:   if (bd->props.fb_blank == FB_BLANK_POWERDOWN) ./drivers/video/backlight/cr_bllcd.c-           intensity = FB_BLANK_POWERDOWN; -- ./drivers/video/backlight/max8925_bl.c- if (bl->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/max8925_bl.c-         brightness = 0; ./drivers/video/backlight/max8925_bl.c- ./drivers/video/backlight/max8925_bl.c: if (bl->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/max8925_bl.c-         brightness = 0; ./drivers/video/backlight/max8925_bl.c- ./drivers/video/backlight/max8925_bl.c- if (bl->props.state & BL_CORE_SUSPENDED) ./drivers/video/backlight/max8925_bl.c-         brightness = 0; -- ./drivers/video/backlight/lv5207lp.c-   if (backlight->props.power != FB_BLANK_UNBLANK || ./drivers/video/backlight/lv5207lp.c: backlight->props.fb_blank != FB_BLANK_UNBLANK || ./drivers/video/backlight/lv5207lp.c- backlight->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) ./drivers/video/backlight/lv5207lp.c-           brightness = 0; -- ./drivers/video/backlight/lm3533_bl.c-  if (bd->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/lm3533_bl.c-          brightness = 0; ./drivers/video/backlight/lm3533_bl.c:  if (bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/lm3533_bl.c-          brightness = 0; -- ./drivers/video/backlight/omap1_bl.c-static int omapbl_update_status(struct backlight_device *dev) ./drivers/video/backlight/omap1_bl.c-{ ./drivers/video/backlight/omap1_bl.c-   struct omap_backlight *bl = bl_get_data(dev); ./drivers/video/backlight/omap1_bl.c- ./drivers/video/backlight/omap1_bl.c-   if (bl->current_intensity != dev->props.brightness) { ./drivers/video/backlight/omap1_bl.c-           if (bl->powermode == FB_BLANK_UNBLANK) ./drivers/video/backlight/omap1_bl.c- omapbl_send_intensity(dev->props.brightness); ./drivers/video/backlight/omap1_bl.c- bl->current_intensity = dev->props.brightness; ./drivers/video/backlight/omap1_bl.c-   } ./drivers/video/backlight/omap1_bl.c- ./drivers/video/backlight/omap1_bl.c:   if (dev->props.fb_blank != bl->powermode) ./drivers/video/backlight/omap1_bl.c: omapbl_set_power(dev, dev->props.fb_blank); ./drivers/video/backlight/omap1_bl.c- ./drivers/video/backlight/omap1_bl.c-   return 0; ./drivers/video/backlight/omap1_bl.c-} ./drivers/video/backlight/omap1_bl.c- -- ./drivers/video/backlight/kb3886_bl.c-  if (bd->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/kb3886_bl.c-          intensity = 0; ./drivers/video/backlight/kb3886_bl.c:  if (bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/kb3886_bl.c-          intensity = 0; -- ./drivers/video/backlight/pwm_bl.c-     if (bl->props.power != FB_BLANK_UNBLANK || ./drivers/video/backlight/pwm_bl.c:         bl->props.fb_blank != FB_BLANK_UNBLANK || ./drivers/video/backlight/pwm_bl.c-         bl->props.state & BL_CORE_FBBLANK) ./drivers/video/backlight/pwm_bl.c-             brightness = 0; -- ./drivers/video/backlight/pm8941-wled.c-        if (bl->props.power != FB_BLANK_UNBLANK || ./drivers/video/backlight/pm8941-wled.c: bl->props.fb_blank != FB_BLANK_UNBLANK || ./drivers/video/backlight/pm8941-wled.c- bl->props.state & BL_CORE_FBBLANK) ./drivers/video/backlight/pm8941-wled.c-                val = 0; -- ./drivers/video/backlight/adp8870_bl.c- if (bl->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/adp8870_bl.c-         brightness = 0; ./drivers/video/backlight/adp8870_bl.c- ./drivers/video/backlight/adp8870_bl.c: if (bl->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/adp8870_bl.c-         brightness = 0; -- ./drivers/video/backlight/as3711_bl.c-  if (bl->props.power != FB_BLANK_UNBLANK || ./drivers/video/backlight/as3711_bl.c:      bl->props.fb_blank != FB_BLANK_UNBLANK || ./drivers/video/backlight/as3711_bl.c-      bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) ./drivers/video/backlight/as3711_bl.c-          brightness = 0; -- ./drivers/video/backlight/88pm860x_bl.c-        if (bl->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/88pm860x_bl.c-                brightness = 0; ./drivers/video/backlight/88pm860x_bl.c- ./drivers/video/backlight/88pm860x_bl.c:        if (bl->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/88pm860x_bl.c-                brightness = 0; ./drivers/video/backlight/88pm860x_bl.c- ./drivers/video/backlight/88pm860x_bl.c-        if (bl->props.state & BL_CORE_SUSPENDED) ./drivers/video/backlight/88pm860x_bl.c-                brightness = 0; -- ./drivers/video/backlight/tps65217_bl.c-        if (bl->props.state & BL_CORE_SUSPENDED) ./drivers/video/backlight/tps65217_bl.c-                brightness = 0; ./drivers/video/backlight/tps65217_bl.c- ./drivers/video/backlight/tps65217_bl.c-        if ((bl->props.power != FB_BLANK_UNBLANK) || ./drivers/video/backlight/tps65217_bl.c: (bl->props.fb_blank != FB_BLANK_UNBLANK)) ./drivers/video/backlight/tps65217_bl.c-                /* framebuffer in low power mode or blanking active */ ./drivers/video/backlight/tps65217_bl.c-                brightness = 0; -- ./drivers/video/backlight/adp5520_bl.c- if (bl->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/adp5520_bl.c-         brightness = 0; ./drivers/video/backlight/adp5520_bl.c- ./drivers/video/backlight/adp5520_bl.c: if (bl->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/adp5520_bl.c-         brightness = 0; -- ./drivers/video/backlight/wm831x_bl.c-  if (bl->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/wm831x_bl.c-          brightness = 0; ./drivers/video/backlight/wm831x_bl.c- ./drivers/video/backlight/wm831x_bl.c:  if (bl->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/wm831x_bl.c-          brightness = 0; ./drivers/video/backlight/wm831x_bl.c- ./drivers/video/backlight/wm831x_bl.c-  if (bl->props.state & BL_CORE_SUSPENDED) ./drivers/video/backlight/wm831x_bl.c-          brightness = 0; -- ./drivers/video/backlight/gpio_backlight.c-     if (bl->props.power != FB_BLANK_UNBLANK || ./drivers/video/backlight/gpio_backlight.c: bl->props.fb_blank != FB_BLANK_UNBLANK || ./drivers/video/backlight/gpio_backlight.c- bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) ./drivers/video/backlight/gpio_backlight.c-             brightness = 0; -- ./drivers/video/backlight/da903x_bl.c-  if (bl->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/da903x_bl.c-          brightness = 0; ./drivers/video/backlight/da903x_bl.c- ./drivers/video/backlight/da903x_bl.c:  if (bl->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/da903x_bl.c-          brightness = 0; ./drivers/video/backlight/da903x_bl.c- ./drivers/video/backlight/da903x_bl.c-  if (bl->props.state & BL_CORE_SUSPENDED) ./drivers/video/backlight/da903x_bl.c-          brightness = 0; -- ./drivers/video/backlight/locomolcd.c-  if (bd->props.power != FB_BLANK_UNBLANK) ./drivers/video/backlight/locomolcd.c-          intensity = 0; ./drivers/video/backlight/locomolcd.c:  if (bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/locomolcd.c-          intensity = 0; -- ./drivers/video/backlight/bd6107.c-     if (backlight->props.power != FB_BLANK_UNBLANK || ./drivers/video/backlight/bd6107.c: backlight->props.fb_blank != FB_BLANK_UNBLANK || ./drivers/video/backlight/bd6107.c- backlight->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) ./drivers/video/backlight/bd6107.c-             brightness = 0; -- ./drivers/video/backlight/backlight.c-                  if (fb_blank == FB_BLANK_UNBLANK && ./drivers/video/backlight/backlight.c- !bd->fb_bl_on[node]) { ./drivers/video/backlight/backlight.c- bd->fb_bl_on[node] = true; ./drivers/video/backlight/backlight.c-                          if (!bd->use_count++) { ./drivers/video/backlight/backlight.c- bd->props.state &= ~BL_CORE_FBBLANK; ./drivers/video/backlight/backlight.c: bd->props.fb_blank = FB_BLANK_UNBLANK; ./drivers/video/backlight/backlight.c- backlight_update_status(bd); ./drivers/video/backlight/backlight.c-                          } ./drivers/video/backlight/backlight.c-                  } else if (fb_blank != FB_BLANK_UNBLANK && ./drivers/video/backlight/backlight.c- bd->fb_bl_on[node]) { ./drivers/video/backlight/backlight.c- bd->fb_bl_on[node] = false; ./drivers/video/backlight/backlight.c-                          if (!(--bd->use_count)) { ./drivers/video/backlight/backlight.c- bd->props.state |= BL_CORE_FBBLANK; ./drivers/video/backlight/backlight.c: bd->props.fb_blank = fb_blank; ./drivers/video/backlight/backlight.c- backlight_update_status(bd); -- ./drivers/video/backlight/ep93xx_bl.c-  if (bl->props.power != FB_BLANK_UNBLANK || ./drivers/video/backlight/ep93xx_bl.c:      bl->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/backlight/ep93xx_bl.c-          brightness = 0; -- ./drivers/video/backlight/jornada720_bl.c:      if ((bd->props.power != FB_BLANK_UNBLANK) || (bd->props.fb_blank != FB_BLANK_UNBLANK)) { -- ./drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c:     if (dev->props.fb_blank == FB_BLANK_UNBLANK && ./drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c- dev->props.power == FB_BLANK_UNBLANK) ./drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c- level = dev->props.brightness; ./drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c-     else ./drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c- level = 0; -- ./drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c: if (dev->props.fb_blank == FB_BLANK_UNBLANK && ./drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c- dev->props.power == FB_BLANK_UNBLANK) ./drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c- level = dev->props.brightness; ./drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c- else ./drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c- level = 0; -- ./drivers/video/fbdev/aty/atyfb_base.c- if (bd->props.power != FB_BLANK_UNBLANK || ./drivers/video/fbdev/aty/atyfb_base.c:     bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/fbdev/aty/atyfb_base.c-         level = 0; ./drivers/video/fbdev/aty/atyfb_base.c- else ./drivers/video/fbdev/aty/atyfb_base.c-         level = bd->props.brightness; -- ./drivers/video/fbdev/aty/aty128fb.c-   if (bd->props.power != FB_BLANK_UNBLANK || ./drivers/video/fbdev/aty/aty128fb.c:       bd->props.fb_blank != FB_BLANK_UNBLANK || ./drivers/video/fbdev/aty/aty128fb.c-       !par->lcd_on) ./drivers/video/fbdev/aty/aty128fb.c-           level = 0; ./drivers/video/fbdev/aty/aty128fb.c-   else ./drivers/video/fbdev/aty/aty128fb.c-           level = bd->props.brightness; -- ./drivers/video/fbdev/aty/radeon_backlight.c-        if (bd->props.power != FB_BLANK_UNBLANK || ./drivers/video/fbdev/aty/radeon_backlight.c: bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/fbdev/aty/radeon_backlight.c-           level = 0; ./drivers/video/fbdev/aty/radeon_backlight.c-   else ./drivers/video/fbdev/aty/radeon_backlight.c-           level = bd->props.brightness; -- ./drivers/video/fbdev/mx3fb.c-  if (bl->props.power != FB_BLANK_UNBLANK) ./drivers/video/fbdev/mx3fb.c-          brightness = 0; ./drivers/video/fbdev/mx3fb.c:  if (bl->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/fbdev/mx3fb.c-          brightness = 0; -- ./drivers/video/fbdev/riva/fbdev.c-     if (bd->props.power != FB_BLANK_UNBLANK || ./drivers/video/fbdev/riva/fbdev.c:         bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/fbdev/riva/fbdev.c-             level = 0; ./drivers/video/fbdev/riva/fbdev.c-     else ./drivers/video/fbdev/riva/fbdev.c-             level = bd->props.brightness; -- ./drivers/video/fbdev/atmel_lcdfb.c:    if (bl->props.fb_blank != sinfo->bl_power) ./drivers/video/fbdev/atmel_lcdfb.c:            power = bl->props.fb_blank; ./drivers/video/fbdev/atmel_lcdfb.c-    else if (bl->props.power != sinfo->bl_power) ./drivers/video/fbdev/atmel_lcdfb.c-            power = bl->props.power; -- ./drivers/video/fbdev/nvidia/nv_backlight.c-    if (bd->props.power != FB_BLANK_UNBLANK || ./drivers/video/fbdev/nvidia/nv_backlight.c: bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/video/fbdev/nvidia/nv_backlight.c-            level = 0; ./drivers/video/fbdev/nvidia/nv_backlight.c-    else ./drivers/video/fbdev/nvidia/nv_backlight.c-            level = bd->props.brightness; -- ./drivers/macintosh/via-pmu-backlight.c-        if (bd->props.power != FB_BLANK_UNBLANK || ./drivers/macintosh/via-pmu-backlight.c: bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/macintosh/via-pmu-backlight.c-                level = 0; -- ./drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c:      if (dev->props.fb_blank == FB_BLANK_UNBLANK && ./drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c- dev->props.power == FB_BLANK_UNBLANK) ./drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c- level = dev->props.brightness; ./drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c-      else ./drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c- level = 0; -- ./drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c:      if (dev->props.fb_blank == FB_BLANK_UNBLANK && ./drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c- dev->props.power == FB_BLANK_UNBLANK) ./drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c- level = dev->props.brightness; ./drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c-      else ./drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c- level = 0; -- ./drivers/staging/fbtft/fb_ssd1351.c-   on = (bd->props.power == FB_BLANK_UNBLANK) && ./drivers/staging/fbtft/fb_ssd1351.c:        (bd->props.fb_blank == FB_BLANK_UNBLANK); -- ./drivers/staging/fbtft/fbtft-core.c-   if ((bd->props.power == FB_BLANK_UNBLANK) && ./drivers/staging/fbtft/fbtft-core.c:       (bd->props.fb_blank == FB_BLANK_UNBLANK)) -- ./drivers/staging/fbtft/fb_watterott.c- if (bd->props.power != FB_BLANK_UNBLANK) ./drivers/staging/fbtft/fb_watterott.c-         brightness = 0; ./drivers/staging/fbtft/fb_watterott.c- ./drivers/staging/fbtft/fb_watterott.c: if (bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/staging/fbtft/fb_watterott.c-         brightness = 0; -- ./drivers/auxdisplay/ht16k33.c- if (bl->props.power != FB_BLANK_UNBLANK || ./drivers/auxdisplay/ht16k33.c:     bl->props.fb_blank != FB_BLANK_UNBLANK || ./drivers/auxdisplay/ht16k33.c-     bl->props.state & BL_CORE_FBBLANK || brightness == 0) { ./drivers/auxdisplay/ht16k33.c-         return ht16k33_display_off(priv); -- ./drivers/platform/x86/thinkpad_acpi.c: (bd->props.fb_blank == FB_BLANK_UNBLANK && ./drivers/platform/x86/thinkpad_acpi.c-          bd->props.power == FB_BLANK_UNBLANK) ? ./drivers/platform/x86/thinkpad_acpi.c- bd->props.brightness : 0; -- ./drivers/platform/x86/acer-wmi.c-      if (bd->props.power != FB_BLANK_UNBLANK) ./drivers/platform/x86/acer-wmi.c-              intensity = 0; ./drivers/platform/x86/acer-wmi.c:      if (bd->props.fb_blank != FB_BLANK_UNBLANK) ./drivers/platform/x86/acer-wmi.c-              intensity = 0; > > Daniel. > > >> --- >>   include/linux/backlight.h | 30 ++++++++++++++++++++++++++++++ >>   1 file changed, 30 insertions(+) >> >> diff --git a/include/linux/backlight.h b/include/linux/backlight.h >> index af7003548..7b6a9a2a3 100644 >> --- a/include/linux/backlight.h >> +++ b/include/linux/backlight.h >> @@ -130,6 +130,36 @@ static inline int backlight_update_status(struct >> backlight_device *bd) >>       return ret; >>   } >>   +/** >> +  * backlight_enable - Enable backlight >> +  * @bd: the backlight device to enable >> +  */ >> +static inline int backlight_enable(struct backlight_device *bd) >> +{ >> +    if (!bd) >> +        return 0; >> + >> +    bd->props.power = FB_BLANK_UNBLANK; >> +    bd->props.state &= ~BL_CORE_FBBLANK; >> + >> +    return backlight_update_status(bd); >> +} >> + >> +/** >> +  * backlight_disable - Disable backlight >> +  * @bd: the backlight device to disable >> +  */ >> +static inline int backlight_disable(struct backlight_device *bd) >> +{ >> +    if (!bd) >> +        return 0; >> + >> +    bd->props.power = FB_BLANK_POWERDOWN; >> +    bd->props.state |= BL_CORE_FBBLANK; >> + >> +    return backlight_update_status(bd); >> +} >> + >>   extern struct backlight_device *backlight_device_register(const >> char *name, >>       struct device *dev, void *devdata, const struct backlight_ops >> *ops, >>       const struct backlight_properties *props); >>