Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1170822ybe; Wed, 11 Sep 2019 10:25:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKeUjxSYChyLB/xqONuYhZqQtKPdD5Sigz35PUz2YkTGzrTkc/TQ86vMdyeZzMebaCBzVU X-Received: by 2002:a17:906:f1cf:: with SMTP id gx15mr30857396ejb.157.1568222742206; Wed, 11 Sep 2019 10:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568222742; cv=none; d=google.com; s=arc-20160816; b=XVkCRC9sN3ni/MAki4XostKzIYq42miwrZoFmFNmzlmMpDiWHR9O5Tl1rZbKYphxGe x2rUWGuv6ZzieRhua4AOEZ809ePtkqxTyiP5iNV2AgGsl3IfIOU09Dsqg6Li4KYs1AJu yXKATLIzjQBoS5fE3vWGsmLrruxrcutRpFCrIHmDkjdmUN3efDueUdiJGwcmtZe60aKX hGX/i6vLq862ekbeSzffViqv8PYprn36GzZlBPlT6T1aeblXVofPhszMB4A7hmly+H5F FYu3IJiWxwisoWjrbvvK1LAy59DGL/hWzhkytfEUoxBI3FhREbjxJFzRZN7Yty00hEqg 2oaQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sPMO8vcrRK/jL3rN+4QkorWNycje82WGvrWvZkHcz44=; b=hzUDzysVrWK5QsAiY6p2fPESsyw+mMhlEnCpCvm8Zm0nwIe+Nzmg3YjleghXVjp2n/ QjPgAHjupIIweW1Ny+nciIrnw6xeCIdw3IE2QixaURDM2kp9qSJ4hixsHrq5BxnJ2QTQ jAkWHR4OS4G6U//MBtAojCbeQGj9n3D+Arh14Ml8fZyHwvUkBI78vC+zVLzOwMnNTUMU oiliagj1/oWIr1OLNQSmmVlwumDICShtD4+b7sOsPbCAIzaGLyVQ7m9lOy6Gw1FTYNev a1AMieP5JvakUQk9gdSUvxsH7nTjxXfLRaOt7hAw/ulamCtmPpuOJHhYgc1REHxDwIEa IG8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=nQIeaSRK; 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 f45si13231932eda.345.2019.09.11.10.25.18; Wed, 11 Sep 2019 10:25:42 -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=fail header.i=@kemnade.info header.s=20180802 header.b=nQIeaSRK; 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 S1729629AbfIKRVi (ORCPT + 99 others); Wed, 11 Sep 2019 13:21:38 -0400 Received: from mail.andi.de1.cc ([85.214.55.253]:45738 "EHLO mail.andi.de1.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729130AbfIKRVi (ORCPT ); Wed, 11 Sep 2019 13:21:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sPMO8vcrRK/jL3rN+4QkorWNycje82WGvrWvZkHcz44=; b=nQIeaSRKdjHALYED3UM4qdoZaj ay1z5xTneTJmZeyPryoIfinTJ7Wa2z7azMYWQHLs4Sq+6Xoh9/zr8lMELMLwGMA8HD1OnMEmmvnsv Am+q25RuMlzHUpmF3HDg0AFOx+q4GjftewUadKNHpwEsJKVgMGEkex/C99DpuZ78XkSk=; Received: from p200300ccff0b59001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:ff0b:5900:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i86J7-0006kp-9U; Wed, 11 Sep 2019 19:21:29 +0200 Received: from andi by aktux with local (Exim 4.92) (envelope-from ) id 1i86J7-0003M5-0o; Wed, 11 Sep 2019 19:21:29 +0200 From: Andreas Kemnade To: lee.jones@linaro.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, jacek.anaszewski@gmail.com, pavel@ucw.cz, dmurphy@ti.com, robh+dt@kernel.org, mark.rutland@arm.com, b.zolnierkie@samsung.com, dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, "H. Nikolaus Schaller" Cc: Andreas Kemnade Subject: [PATCH v3 2/2] backlight: lm3630a: add an enable gpio for the HWEN pin Date: Wed, 11 Sep 2019 19:21:06 +0200 Message-Id: <20190911172106.12843-3-andreas@kemnade.info> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190911172106.12843-1-andreas@kemnade.info> References: <20190911172106.12843-1-andreas@kemnade.info> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.0 (-) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 changes in v3: - removed legacy include drivers/video/backlight/lm3630a_bl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index 8f84f3684f04..d9e67b9b2571 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,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 +537,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; + } + /* chip initialize */ rval = lm3630a_chip_init(pchip); if (rval < 0) { -- 2.20.1