Received: by 10.223.148.5 with SMTP id 5csp6073590wrq; Wed, 17 Jan 2018 09:01:34 -0800 (PST) X-Google-Smtp-Source: ACJfBotdzUeTdNblY3j080voBamHZtLX3zwpdX9Y3aoXt9XuBC7wzSnecEPuj4TtljjM2FqG+HUI X-Received: by 10.98.163.131 with SMTP id q3mr29200853pfl.87.1516208494748; Wed, 17 Jan 2018 09:01:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516208494; cv=none; d=google.com; s=arc-20160816; b=KLNBbGeqmmczG1SzONsHikBPa+/UEznjEVfVLqUqJbQZQXNvpwmmeDRgslvcSAccsv QfPzHBBus6kPhYzBma1oHfCtyToV21oX8FEcOL7xSdyr2K5z7dPC1Wnkdw+Z/9oti7md C9lH0BsWdT60/u+/KTkPGwVFsztTW7CdCDR9WYLho7k4yoHItUMP4dS3CGZE4Z42i2L9 w1k+7jP16vjkGpQYYvufidgqVvBSuKhuS/mrE+27Ea4p3ieO4XCpowKPuauZpFISVAgx LLhNZif/7ToW+Deq4lKwLfyQ5UPlP4BY/S/5JT3ro71Bal642xuJWgxLnez6z7v8Wr2I dwfw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature :arc-authentication-results; bh=StlPNGEJaCTQsakFc2EidhP6irDnAGyQ7JbiqWmGIgI=; b=wRO1oTR3Ievmi2wLpNxvONZj+zp1A2QfcbpE6hVDxIH99iYjhHoEW9E57Nqbaq0fOC joOiXjBDulGj2WJo+y1AmZD2/Dr9XCXwjEOmVIsnL32adYQzQgcrOGdjDlSFdemRwgGj NyknwuJcWkpdol9YUZrEIxI2A2zj/64SDPq3fGifC6W4r+bYx4xaln2iyYInEMHj5NEA pZeOH9KQ0VOHg+72PaV9OcMTHJ1oMMDjE26gKtzYOiaCpNfb0nIYGXewMQbifcJcePNl e9hNJtANg5e6rluf6JYdRRB4wzotyO+HnK5tqcXKVc60/gm/gXMNNdbY7lHiTM+WLLKX 2GzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HeHY3Myr; 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 b130si4254677pga.61.2018.01.17.09.01.18; Wed, 17 Jan 2018 09:01:34 -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=HeHY3Myr; 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 S1754551AbeAQRAg (ORCPT + 99 others); Wed, 17 Jan 2018 12:00:36 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37933 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754480AbeAQRAc (ORCPT ); Wed, 17 Jan 2018 12:00:32 -0500 Received: by mail-wm0-f66.google.com with SMTP id 141so17067918wme.3 for ; Wed, 17 Jan 2018 09:00:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=StlPNGEJaCTQsakFc2EidhP6irDnAGyQ7JbiqWmGIgI=; b=HeHY3MyrGrupF/pnRM7tEvZxqUDEweKrW1zPeBdZKC2G6Zy2QSKkB8mLk8c/mNxXY7 JZPF0Mc3rmRvNP+XDdQ1xV1xWBKPH0rg4Laoi94B+waOTgi/wA+2vkln8Eo5CB5cSNo1 YLt5ppbFiapYLndDiNgEng9owid/tm6vu/C74= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=StlPNGEJaCTQsakFc2EidhP6irDnAGyQ7JbiqWmGIgI=; b=iQvLSPlIirgPhqiqb/XiUd5Hlcq/ZbQcJ+CVnSSiOcIM/LERJZ4Tb2enL1SO2qEo8J WUsvTUbUK2dZxCFzK+D/moSB7gbG67cGrvq+3f7OuWE8hV/VBtu3tJevBHNNwpW48tXl 41csxk9L9JA6VxYmu8LRLD1tNFtsQ1h9QOjrHkCKo4yg8A16ZQl5s030fQODxw4F4Jk8 f0AFT0JnkZMeAHwhlHv9tTbFNbERd7SkDwuxdsGEN6Np7yyOOfLvPT99pFWqHloUP/Uw CL06z3e9CR56AEiqiECxW/+u6mIeGz00nb3nZRnr3Mm1Xr5JxsNMME7/Rr7VVn5CSvOs MAwA== X-Gm-Message-State: AKwxytexBKsNkI8/dNECLX2zIXudyORlyx4viTjsqSO663/O+ADRaxx/ xrrsDBzUwx50RCsobwdhfYTfPjSYSJk= X-Received: by 10.28.129.212 with SMTP id c203mr2602384wmd.98.1516208430723; Wed, 17 Jan 2018 09:00:30 -0800 (PST) Received: from [192.168.1.24] (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id s86sm4515343wma.29.2018.01.17.09.00.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 09:00:29 -0800 (PST) Subject: Re: [PATCH v16 01/10] video: backlight: Add helpers to enable and disable backlight To: Meghana Madhyastha , Lee Jones , Jingoo Han , Thierry Reding , =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <0ef2305477e69efdf61a378079fb7404a40c909f.1516098341.git.meghana.madhyastha@gmail.com> From: Daniel Thompson Message-ID: <84821d63-edc4-9a9a-db54-a180bf5fe9f6@linaro.org> Date: Wed, 17 Jan 2018 17:00:27 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <0ef2305477e69efdf61a378079fb7404a40c909f.1516098341.git.meghana.madhyastha@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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); >