Received: by 10.223.176.46 with SMTP id f43csp3967891wra; Tue, 23 Jan 2018 02:01:15 -0800 (PST) X-Google-Smtp-Source: AH8x227shqCvh95xfQ8FRzFmM2IRO8L6eTEziuR9C4qUzQFldTXV/RQAaFDFBoQFy7xjOy2MPKsZ X-Received: by 10.101.100.132 with SMTP id e4mr6715114pgv.398.1516701674932; Tue, 23 Jan 2018 02:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516701674; cv=none; d=google.com; s=arc-20160816; b=gzt78tdozYdAM8JfM+RtDZfdlF+MzhGsXkFpg+vxu5Q+Nu+nYd1W9krdz7rysSOO2B y7QqghvrxLWcbGzu2qursCTLmFA5zL7jed8KgaqS1skVzycu4DnJzYbkhsx/RNNiM/u+ VioEauEBo+1jO9EPj3Y41noaEOJ68JQXWhHampukZRL6n4VYhKnf0dqj0PnxlacjJTJ2 qK7vnvAu4D1TddxUZy2tftMmJPLcg9biK7JmoZriT6ARCNlGff4hAMSUnxyTBDOashi5 tWzBzpl/tkW463RUO/Zx4QlK3WgCoM3ravpDc61I/qQ+VpcqSaeaj/iMlViR6FYK8gJ/ A4yA== 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=0WxY66yUlo92XngyADuq4/zB4/+L7/s3ILli+b3jotM=; b=s2z73D44t+ocX9DkqWTG1nHp3LuxXYKHObdwCY5bvk8JuHBHnVbyIklieIPNbQUaQl 3iJJklZN2OoTuy+V3vn59Wqxzp4YR0Vgp6NLISMUACVJRGNUUU9PdY9qo2wV9bELpazD zD2YPOrlCub1RVtls8tCZ9+2xWkOqaPLAGBsyhH8Hmlarjq3bD20JfOwPdL/oimdPpVp R4AAwLNsQHRrPd7wvNsL9C59lxeGeOiwm2eS4WUGQO9GpFJ4Ych3oF4Duh+hNKltoqo/ VD7Z6CeSS+v7mblsUlDVCleCcs7qyn6scl5A8EmPXf77Z4BGbjICu7Y5YpMNXWpf8gDN 5Qsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cV/clv2L; 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 c41-v6si2910881plj.682.2018.01.23.02.01.00; Tue, 23 Jan 2018 02:01: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=pass header.i=@linaro.org header.s=google header.b=cV/clv2L; 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 S1751249AbeAWKAf (ORCPT + 99 others); Tue, 23 Jan 2018 05:00:35 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:42176 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751154AbeAWKAe (ORCPT ); Tue, 23 Jan 2018 05:00:34 -0500 Received: by mail-wr0-f196.google.com with SMTP id e41so11808556wre.9 for ; Tue, 23 Jan 2018 02:00:33 -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=0WxY66yUlo92XngyADuq4/zB4/+L7/s3ILli+b3jotM=; b=cV/clv2LFuM1xwRO/JZrpDXzd5xXoYDnHTruGSL69NcbGa57Tgrs2IGh+LrcpIrjx9 UUDnP+mQwWdJ6NKMeHgrmttuyfQlsfUvkg0Cu/zYN0bjHsPTopLLxA9ehPyZ3NwROD9M Lnvo/abXJS/pwvoosN/vEG40sQUGB9+e4tguw= 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=0WxY66yUlo92XngyADuq4/zB4/+L7/s3ILli+b3jotM=; b=dR/KlrmKw3+DJKLtJEz4myj/V4npSzvotJzL0ZK1mU+qr95C5R8uyzCAuclDkDKHkW bu33KPLm6MGdOL2t3ru6sJZY1pcciS+Plk81/1wo/C6+Noyhwb8A/15s8pz3AiDvfF77 u0X3Yh04uMkkPmBkMSnU8TjcbYcHBwre3rPz7i7FebvQ33GcRDTHQKPNi6isvq2IP0ne zigKDYm/EFCmgsEDBso05z4iGSpnnpnx7AXINceJIlKf6h/DVxVLAShQfeTBprTSWYHp UCyOdQji8VjKxuYqoY+d6zsDr54QX+lE8qzjDtDREJcEPc5KqGf7yNhF4GMAatiOqx0A BI+g== X-Gm-Message-State: AKwxytd4Ho8yflAEu6WMjOUI49SWae7KtcSfD1WE+ayEmdtjdW6wbErw 5/qqi2MN2rlXaP4DmYA1nAxgIR8HOic= X-Received: by 10.223.132.68 with SMTP id 62mr1636851wrf.173.1516701633043; Tue, 23 Jan 2018 02:00:33 -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 n62sm7157576wma.40.2018.01.23.02.00.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2018 02:00:31 -0800 (PST) Date: Tue, 23 Jan 2018 10:00:29 +0000 From: Daniel Thompson To: Meghana Madhyastha Cc: Lee Jones , Jingoo Han , Thierry Reding , Noralf =?iso-8859-1?Q?Tr=F8nnes?= , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v18 01/10] video: backlight: Add helpers to enable and disable backlight Message-ID: <20180123100029.fr42yezfw2rp6sss@oak.lan> References: <39b5bf0a02008a8072d910bdf8231c431e9ef504.1516632387.git.meghana.madhyastha@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <39b5bf0a02008a8072d910bdf8231c431e9ef504.1516632387.git.meghana.madhyastha@gmail.com> 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 Mon, Jan 22, 2018 at 02:49:28PM +0000, 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 > --- > Acked-by: Daniel Thompson > Reviewed-by: Noralf Tr?nnes > Reviewed-by: Sean Paul Just in case there's another spin... the additional tags are normally presented above the --- (otherwise they are unlikely to be copied into the git history when they are applied). Daniel. > > include/linux/backlight.h | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/include/linux/backlight.h b/include/linux/backlight.h > index af7003548..ace825e2c 100644 > --- a/include/linux/backlight.h > +++ b/include/linux/backlight.h > @@ -130,6 +130,38 @@ 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.fb_blank = 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.fb_blank = 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); > -- > 2.11.0 >