From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBD62ECDE20 for ; Wed, 11 Sep 2019 18:49:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B597C2084D for ; Wed, 11 Sep 2019 18:49:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="LdwUSNv6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730203AbfIKStG (ORCPT ); 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 >>