Received: by 10.223.148.5 with SMTP id 5csp6416260wrq; Wed, 17 Jan 2018 13:26:14 -0800 (PST) X-Google-Smtp-Source: ACJfBovNT+I1H3/DE/0qkznF0ejaEeRwUdJctGpQjdFEm3El6uCDQMH4BjVJ7z7WFNBfoU89O5V7 X-Received: by 10.84.238.136 with SMTP id v8mr39091758plk.374.1516224374573; Wed, 17 Jan 2018 13:26:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516224374; cv=none; d=google.com; s=arc-20160816; b=aEfflIXZCu0KQztMBh1YnQmOijwdf3Y5C35nGGMCeKMZgMCUtCDDHDOS/gbc4cLVTG JPSNeH3rU5YTno4YG3AQDJwpZDnNhQQugrlVI22qQ6vCIWHlBZ98B04HzhpI/QWQvrrt BABK3u1f3Ks+7i+WEIVK+DPYpE6S4y2PtKT96btZYjQTowbkiBCqZ8DRCwdhSXO1Qem8 B0aqSshE3N2jwujMoAVxcWUC/R5dEQip4Iex3pVKM3pdQQ140IYO+J9ZKozC3TeQ1RtU FiGtwQqRNU7PP4iS+xDzlspbcqBbkuG+NrGWqGqtQOl9Hv/HN0jNirEIjTuDt8WMQyKc 8LAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Ezc8mzzpuzAZQiiBG3QpTXnvd8VvBALv2qvaKwFvQrg=; b=uZzHXd0ag3URnT5BMM80WUqGHVxtANIbbENZf2nnhj4kjmNQ47Rd+fl3L5pXwxpkyz YBTsUq/sjHVZPbYaRXPHKeP2E5MBxZm7pFFQfsB2yD5X6j//Xx+HDXSs4/IE1UzxYPgf h7rBBYYCZvlmdGX3ElrKhWcU6MgYrg42eYo7n3xbi1gMZ7Jl6b+JASJrfTtNe3UIUuDD uoUDkxN0LMh84qa2n5pFzWsIEowFWpiiTlM4VkuUAE61J0Vtg7X1YM06xQ3V6qlBEJa0 kk5CYdx8gXCXVeM3iZWoxoQbTOpJrzZR16nk7ZRxnA3K71Zn7N5IT+MfPiuEmSOZINc1 bjNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=OZGuow5I; 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 p184si5038747pfg.371.2018.01.17.13.25.59; Wed, 17 Jan 2018 13:26:14 -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=fail header.i=@ffwll.ch header.s=google header.b=OZGuow5I; 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 S1753296AbeAQVYq (ORCPT + 99 others); Wed, 17 Jan 2018 16:24:46 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:34327 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752100AbeAQVYo (ORCPT ); Wed, 17 Jan 2018 16:24:44 -0500 Received: by mail-it0-f65.google.com with SMTP id m11so16011517iti.1 for ; Wed, 17 Jan 2018 13:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Ezc8mzzpuzAZQiiBG3QpTXnvd8VvBALv2qvaKwFvQrg=; b=OZGuow5ILRfW7CnpeA45Va7/xpggS6moa3trcCqdJNT3jiI3aLINN/qD/8Qw911/hd TogPy+bl3kc1sY7Lrhtn43qQwhfZyQFbgxJM2Td0gDv7CRx0K4EFh0FyRlXjj0NsGzki jclsQnL+c88NMS/+HQgibeV7EKRL2gzLAE7ls= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Ezc8mzzpuzAZQiiBG3QpTXnvd8VvBALv2qvaKwFvQrg=; b=WXDiUGjmgedYjYNfOtz/8lJX45+JyFEsAcV+QzUNCR3MvIsG49ORHljpx5PHcFKWqW xmWAlp13b8RH3FopvQ3k2uFthVmNtvaZX/tSJ40lCo60Uuwf8f+hyFxFUuQ2WSRLFD8U 9O/YnrOZI9ueRIcRRZ4XtsTB8l91n68y5vyXhoe3b5LgvymplJjusVJXHawedTIB2hal NSws7c5tphtArWZUy1ikBnXEZ9hT1FBYA1CJi1VRiSsmhIPHJ/bPsqFx/yd2ncOrMXc9 F1nr+JhbbpEbXatT44dlQ1O/+h99k3HGsbfjq2hVQUalasVDppL6SS5sSw0c2ZsXVGMO xdRg== X-Gm-Message-State: AKwxytcKl0MY1l7E9Sij+1/PpjDoEXDSp4sTTK8UkLkry7kSg7mh+heS PwONnFusXB5ySRDWYXDIL7LhSoHsrOKT7CZhGx6UgA== X-Received: by 10.36.135.5 with SMTP id f5mr25451769ite.80.1516224284238; Wed, 17 Jan 2018 13:24:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.141.199 with HTTP; Wed, 17 Jan 2018 13:24:43 -0800 (PST) X-Originating-IP: [2a02:168:56e6:0:e4bc:76a0:8042:669e] In-Reply-To: <84821d63-edc4-9a9a-db54-a180bf5fe9f6@linaro.org> References: <0ef2305477e69efdf61a378079fb7404a40c909f.1516098341.git.meghana.madhyastha@gmail.com> <84821d63-edc4-9a9a-db54-a180bf5fe9f6@linaro.org> From: Daniel Vetter Date: Wed, 17 Jan 2018 22:24:43 +0100 X-Google-Sender-Auth: f9uNMXDQ19iBQXVG-mhFGRYL90E Message-ID: Subject: Re: [PATCH v16 01/10] video: backlight: Add helpers to enable and disable backlight To: Daniel Thompson Cc: Meghana Madhyastha , Lee Jones , Jingoo Han , Thierry Reding , =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" 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 6:00 PM, Daniel Thompson wrote: > 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 think also adjusting the fb_blank bits in these new helpers is a reasonable thing to do. Maybe with add a huge TODO comment that this is all a bit sad ... -Daniel > 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); >> > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch