Received: by 10.223.148.5 with SMTP id 5csp7256278wrq; Thu, 18 Jan 2018 03:07:03 -0800 (PST) X-Google-Smtp-Source: ACJfBovNWzGgZrtbQh4A0klIl8DacXoKP6DPNxoLdrdvAhlPk2i9MCkPCg9DT0suD8aRjX9vLCBG X-Received: by 10.84.248.139 with SMTP id q11mr26849097pll.236.1516273623805; Thu, 18 Jan 2018 03:07:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516273623; cv=none; d=google.com; s=arc-20160816; b=Rxb57VL2uBzavYaiLYaqjp+4IUpsH0nxn/Vqf2l+rSJOZvdK9U4mj+PF1gRgrBRZiR R6yHnn2lgytBsw+ov2fLZm/hWX47COCzw+9rBsn1s4jWRzePo9Djf36FZvYfGgZxin6o elm6HvKeaLsjFwe1MJITOwGuNUXHBE0gWrCDC/7x9WEnjm6hRBJQMercBYISaO1Grn6E 6Tn0i+pWObMPdP50+O8CtI8rSe3aWWWGuEBhPHlSsY9YERSgT147MarcFw60RVdsYmLd QSWsUIWSSC5rCpNP8Ku0uKpxJe/AuRG2cmmphKZuU1IaoUtCL/R3bqHrwO6GamU3Jkar wZPw== 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:to:from:date:dkim-signature :arc-authentication-results; bh=u/+9fV8e213KvbZQ3fHgRbWd9sGKyZgVJPB9B6XgOUw=; b=DYzYPJXqBeRnXVbVvgkemckVK51NufnWIi6pbLnLmY39IdESwr6OIXQl673+K/NgpT LUoRiIPOxwCNdpPsDC2IOhHN7kBjL4DPl+kCELgveCQSdgct3imDNKEcBVfNRYmuHHUX xF7fS7JDl4fkRzXrOylLZXkkD0295+LZ7B9HqNGDsh3i7Ov0lWyzTsMo/RA81NbXN1YV MVOUgF5h2Bw4SRpUfATXglDHhSYp7CATqunfa9ZHP8dR5WJ7C3sL5dBMSMozaTkn609U YomL91Ls20OcSLjr6mY0YJNLn72mXcBggQQk2Th8XEYvsPKq9Ak+NZUSjlhIEH3yZ0nr ktYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UNKZByMq; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r64si6545300pfk.217.2018.01.18.03.06.48; Thu, 18 Jan 2018 03:07:03 -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=@gmail.com header.s=20161025 header.b=UNKZByMq; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755126AbeARK7f (ORCPT + 99 others); Thu, 18 Jan 2018 05:59:35 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:36992 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754671AbeARK7c (ORCPT ); Thu, 18 Jan 2018 05:59:32 -0500 Received: by mail-io0-f196.google.com with SMTP id f89so16338530ioj.4 for ; Thu, 18 Jan 2018 02:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=u/+9fV8e213KvbZQ3fHgRbWd9sGKyZgVJPB9B6XgOUw=; b=UNKZByMq3at9/WT8Tm9qroQF3N1vSoiOkTxgiJ2RWM0PLeP2Hnj/GwoZmf0wQktSVX 3IlaaSu18YRsqHRajqjC2hEl7Ves3+UJexV9FYwi1daKT9/luJ0tachi+6lIuj4MUGQZ jttDgbJcuQZ2BZiEnp4fPG24gM4iZSK8pghvAFniTX+K2xz5xoHI7SzXT2M/UdIf5LGf EabxXy0zVaxAsOfsuOGdHZs+3q/40UJ7ZaKWpqz9pYWsqQQqaY6c9ovmCb3OxTNJs0ac b0gLfsz09iMg4dtWwwA+koJmmLsja1H8I/F2Q7QptsWYZCtphyXdmbrFqqzoB614uBu/ 4SmQ== 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:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=u/+9fV8e213KvbZQ3fHgRbWd9sGKyZgVJPB9B6XgOUw=; b=FO1hxZDVO9k8LU2lMwzUwIQcm3DaeLTMuIVtmhwfdeLTVwE+gDU+uNifGYwIH8q8Wk cZEvBOnLc/n/fWdx2LqiR29FDf4639AHSNp1T/AWCvO5whp8evQsKwM9w1ZsXDaCY+FZ bUDmU3zL7tJlpMlfsTK6YBkmfNsV/7WeRlmAYRGzSdWCyW1e97D1BlCuL/m9Xy7/2w1G aMbdNG0MYwWTwbcKH5iYK/MIRoYFu0RhWALjl5XHI93kC9llWjdBqsSl/m2pYbY6stpl zPYgnw/wedRWkHWVHX9ZOYmoG54B4HftDr3hwfCL1o/843aldDJGF3SiYepoCNKACPwt To2g== X-Gm-Message-State: AKwxytfzVZ8Otr+Fj41zPd6866uRJkfaI+W5IbtwIWQ+rhJbVf7e3PVB fwOssZh+xM8SqfkeLL17dOc= X-Received: by 10.107.47.137 with SMTP id v9mr6562986iov.217.1516273171301; Thu, 18 Jan 2018 02:59:31 -0800 (PST) Received: from meghana-HP-Pavilion-Notebook ([122.171.87.79]) by smtp.gmail.com with ESMTPSA id j3sm2787645iob.14.2018.01.18.02.59.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 02:59:30 -0800 (PST) Date: Thu, 18 Jan 2018 16:29:23 +0530 From: Meghana Madhyastha To: Noralf =?iso-8859-1?Q?Tr=F8nnes?= , Lee Jones , Daniel Thompson , 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: <20180118105922.GA4864@meghana-HP-Pavilion-Notebook> References: <0ef2305477e69efdf61a378079fb7404a40c909f.1516098341.git.meghana.madhyastha@gmail.com> <84821d63-edc4-9a9a-db54-a180bf5fe9f6@linaro.org> <7fe263d8-7b4a-68f1-2799-4b29d45dac89@tronnes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7fe263d8-7b4a-68f1-2799-4b29d45dac89@tronnes.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? 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); > >> >