Received: by 10.223.148.5 with SMTP id 5csp7315393wrq; Thu, 18 Jan 2018 04:04:23 -0800 (PST) X-Google-Smtp-Source: ACJfBosGCtqP9KH3FQePu0yZmmodrLAUhaSGxvbkWAKNx1wXixyj+hWZu5jGHsjaAVa8FoQ6juX6 X-Received: by 10.101.87.132 with SMTP id b4mr21455513pgr.332.1516277063076; Thu, 18 Jan 2018 04:04:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516277063; cv=none; d=google.com; s=arc-20160816; b=mJ0EkyfZASr9eqjgIoIjkBM563HWKfhuGhpUlDBVsbFBVkM01T+YaPM9mIH858OeX6 cQGnwk40Af3UI4bgSfXHLitO44cqeHdatv1EwbcE2G1+EY25uQTsd/59jFwTuuVBrmny akX+7xV+x53r8a4ja83NkpgW8NulIjVxgtstbeNSG1GGQvgTPzWiFLuWrlGuxH2Y87iu MIIBoEmq/ObBdmtDfkKYNeC/nnaOllffTo85LsHztKxBMjNtrrDrVNXXoLJz/NyEAXSe LCeT9mWD+pBA4YiZDVonMYQtnrsCQsYLdf+pCUaNKqM8Pwr+2TqbJ9YOZVzeANmN5GLL 6JEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=1eG75zHfNwOW1scGNOBuG3iWgcShnc267caDULNPEC8=; b=GBxGUPDtcelDX+V/M7AF83DfW6LogxC58SrRcGGeKVtO8rj7LiHZcybKqHendZCKKX JD30t6fS6NTQuGTRk1dyNE3dfpmxwbUHujRY46ESYIjZRVxR0sJtkAuPFOhTv9yYWto8 IKBY/5Z5K8HmChA6702eU93A98fNddGkDlK4mFRkZQK3Zxb9kBi2DsTJnX/7vslAryWm wX3XFM/eakPVvr76ibpr/SNgfrD8YYH5213xIGk8McO01QaX2cUSCd7mXQLTHHa0huwU pQgkF+ibep84X/cbYS0YVAryEQNMJc/DGqhjRYRDcCwPsZ2MvqUv79bo5+Gwbf/6vkCz aZag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ipglK7ZR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8si7100495pll.421.2018.01.18.04.04.08; Thu, 18 Jan 2018 04:04:23 -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; dkim=pass header.i=@linaro.org header.s=google header.b=ipglK7ZR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932377AbeARMCS (ORCPT + 99 others); Thu, 18 Jan 2018 07:02:18 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33204 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932326AbeARMCP (ORCPT ); Thu, 18 Jan 2018 07:02:15 -0500 Received: by mail-wm0-f68.google.com with SMTP id x4so2416420wmc.0 for ; Thu, 18 Jan 2018 04:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=1eG75zHfNwOW1scGNOBuG3iWgcShnc267caDULNPEC8=; b=ipglK7ZRwwClcAGPBhV+ze6Tn7x6cKsQjcCsgCqZAjCEAbt7oCV0wvwhHCMtWvajMa LD8zzzNO+Bq0GEZEtb5ZKIYKhgeo8aGIEayK4b8pAfBCg4Xu8Bs8ROZi4o5hPKcyTBv0 Vh3FxncQtFMooJrQDFSL6e7hLc977rZdWBbVk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=1eG75zHfNwOW1scGNOBuG3iWgcShnc267caDULNPEC8=; b=TBmFkfkfe7wpqwFsNi4ofXFo4inDfnLTiEe1MQW2ToKKbFN/x1Q9GXc0PLWpp7L8ZG w3XFDt5GID0CwgF/SOEm1evPbDTIMgXW9DmZWJGd1OcL78pqV9FOeS6yqJAA7ShV3FqH hPrslmqan3ZCIoGKL7S7YjIy8KZky8GPXIvq5FDWmF0IayLRNscletKUZP7odfbDiJap ZxqWpOA0Zg6W9wSiet6AvuWJfL54c/qhxORyYDEybNO4lKQku5Hfm69qwq2MSduElKJS AsNus7h0M86oqAFRgTFTQbqS1sS73waEeLEZl60Oe4jAcB4LXuuoCvCzuMk4ZQAfwdxp EN/A== X-Gm-Message-State: AKwxytfxiAs6yPFj+CqeJke5MhQGUympeRO4i2hJqUUEcWdQK0j1xDS5 9ykCTlsWZ3Rs083yPfNkA0dQ+A== X-Received: by 10.28.130.84 with SMTP id e81mr4563577wmd.15.1516276933417; Thu, 18 Jan 2018 04:02:13 -0800 (PST) Received: from oak.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id u33sm10708599wrc.83.2018.01.18.04.02.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 04:02:12 -0800 (PST) Date: Thu, 18 Jan 2018 12:02:10 +0000 From: Daniel Thompson To: Meghana Madhyastha Cc: Noralf =?iso-8859-1?Q?Tr=F8nnes?= , Lee Jones , Jingoo Han , Thierry Reding , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v16 01/10] video: backlight: Add helpers to enable and disable backlight Message-ID: <20180118120210.7hyufn6r3776eggj@oak.lan> References: <0ef2305477e69efdf61a378079fb7404a40c909f.1516098341.git.meghana.madhyastha@gmail.com> <84821d63-edc4-9a9a-db54-a180bf5fe9f6@linaro.org> <7fe263d8-7b4a-68f1-2799-4b29d45dac89@tronnes.org> <20180118105922.GA4864@meghana-HP-Pavilion-Notebook> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180118105922.GA4864@meghana-HP-Pavilion-Notebook> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 18, 2018 at 04:29:23PM +0530, Meghana Madhyastha wrote: > On Wed, Jan 17, 2018 at 11:03:24PM +0100, Noralf Tr?nnes wrote: > > > > 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. > > So if I understood correctly, the suggestion is to set fb_blank along > with power i.e something like this in backlight_enable. > bd->props.power = FB_BLANK_UNBLANK; > + bd->props.fb_blank = FB_BLANK_UNBLANK; > bd->props.state &= ~BL_CORE_FBBLANK; > > and set it to FB_BLANK_POWERDOWN in backlight_disable ? Yes please. Note that strictly speaking it is not "along with power" it is "along with clearing the BL_CORE_FBBLANK bit" since that is what fb_blank must be consistent with. Daniel. > > Thanks and regards, > Meghana > > > 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); > > >> > >