Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1257067ybe; Wed, 11 Sep 2019 11:54:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRE5zVUXfl60NZDGBjnHKvmRHxG2jSYb3dO3l/WxuCU03zXnuzJ1rlP5xtkMQfSdP6q9no X-Received: by 2002:a17:906:d7b5:: with SMTP id pk21mr31119695ejb.174.1568228071485; Wed, 11 Sep 2019 11:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568228071; cv=none; d=google.com; s=arc-20160816; b=B6FkjjIbq2nvKv0vOVXtyUEDELKIUMtXqfR2mLTGvORNUlVRHRUdgJ/bK9LPXhsR0C ZAsyqd6cmMdZXuPr0ff51kIDxFiHgHffHjaOY6LXDBH9u2y62bqHgNsHtmfClqO6Vz06 NymYdDIMZXDarZKxUh/OKcsDspQFOG8/FhCxV9uB4pVErcO24fPKsBWvWxaQr3l081Xd OLeaBYUQYIrJGSd7pmyK7b0jCbsMsQ4EwdDurMFS8o9f6T/b+agVn0zthJ3j3wiQcTGR 8NbJcjbaiubyNaDbxcRRwQT+Gg8kcQNh86euaZoS1OJjzhR3ZPTQqWknLbroky3Ygm27 g7rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=1xSERSqIkAtP/bLDu3RUnmyzW6/XzR17kn4wt0JSzQE=; b=YDFjPZdKwRCBLFlm1ex8h6spaPgTUSGQ/1j6DmcjFn6MLLKxdiKmsZdT4UQBcmSiW4 IrLg5zxL++wli4P5oD3kTapHmyfYbrkM5humQQ5S4J33KYeztYYSFMQSMm/eWfBwDbfM /YC2ZjEHjjHl4tMWs82Vx9TiCvP2JK5EdmD+JLzPpwHUzD9CDSd5pX5XbXqK08R1h5OC cJXbtU+GuTu5DkfanJl5bIbDZmtDhukA1oO17dwCFvSA/o8+bYCI8I+jtlpM1D44k6rL 2H+TQMEI08/PCDeoOrSJASRCXKfjnmM2HkeR/C155wzqhzEc6aCxIs2a+fy5NjjHl6Z4 l6Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=LdwUSNv6; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s20si11154521ejq.340.2019.09.11.11.54.07; Wed, 11 Sep 2019 11:54:31 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=LdwUSNv6; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730189AbfIKStG (ORCPT + 99 others); Wed, 11 Sep 2019 14:49:06 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:41896 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730069AbfIKStF (ORCPT ); Wed, 11 Sep 2019 14:49:05 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x8BImcY7051732; Wed, 11 Sep 2019 13:48:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1568227718; bh=1xSERSqIkAtP/bLDu3RUnmyzW6/XzR17kn4wt0JSzQE=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=LdwUSNv6ZbXANbfxNoJYEDv5rETOOMt04lMlvG8RYbaxYrQHBgvNg3m/RdnpG5lq2 Yjj10rCiVfbF39DafaKdYQ1v6fluk0Bw4dMFmGqNwMCLhe7HBe0KyxPFnkmi3pGYvI 6TMFbQLtFu+VsK3BApMVojHliBROeOnBpSjZJAI4= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x8BImbgv068137 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 11 Sep 2019 13:48:37 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 11 Sep 2019 13:48:37 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 11 Sep 2019 13:48:37 -0500 Received: from [10.250.65.13] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8BImaxV119829; Wed, 11 Sep 2019 13:48:36 -0500 Subject: Re: [PATCH v2 2/2] backlight: lm3630a: add an enable gpio for the HWEN pin To: Daniel Thompson , Andreas Kemnade CC: , , , , , , , , , , , , "H. Nikolaus Schaller" References: <20190910212909.18095-1-andreas@kemnade.info> <20190910212909.18095-3-andreas@kemnade.info> <20190911102533.not4ta3xwgm6bhjo@holly.lan> From: Dan Murphy Message-ID: Date: Wed, 11 Sep 2019 13:48:36 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190911102533.not4ta3xwgm6bhjo@holly.lan> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/11/19 5:25 AM, Daniel Thompson wrote: > On Tue, Sep 10, 2019 at 11:29:09PM +0200, Andreas Kemnade wrote: >> For now just enable it in the probe function to allow i2c >> access. Disabling also means resetting the register values >> to default and according to the datasheet does not give >> power savings >> >> Tested on Kobo Clara HD. >> >> Signed-off-by: Andreas Kemnade >> --- >> changes in v2: >> - simplification >> - correct gpio direction initialisation >> >> drivers/video/backlight/lm3630a_bl.c | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c >> index 8f84f3684f04..9d0639d4202d 100644 >> --- a/drivers/video/backlight/lm3630a_bl.c >> +++ b/drivers/video/backlight/lm3630a_bl.c >> @@ -12,6 +12,8 @@ >> #include >> #include >> #include >> +#include >> +#include > Nitpicking... but I don't think linux/gpio.h is used anymore. > > >> #include >> #include >> >> @@ -48,6 +50,7 @@ struct lm3630a_chip { >> struct lm3630a_platform_data *pdata; >> struct backlight_device *bleda; >> struct backlight_device *bledb; >> + struct gpio_desc *enable_gpio; >> struct regmap *regmap; >> struct pwm_device *pwmd; >> }; >> @@ -535,6 +538,13 @@ static int lm3630a_probe(struct i2c_client *client, >> } >> pchip->pdata = pdata; >> >> + pchip->enable_gpio = devm_gpiod_get_optional(&client->dev, "enable", >> + GPIOD_OUT_HIGH); >> + if (IS_ERR(pchip->enable_gpio)) { >> + rval = PTR_ERR(pchip->enable_gpio); >> + return rval; the enable gpio is optional so if it fails you log the error and move on Also on driver removal did you want to set the GPIO to low to disable the device to save power? Dan >> + } >> + >> /* chip initialize */ >> rval = lm3630a_chip_init(pchip); >> if (rval < 0) { >> -- >> 2.20.1 >>