Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4836080imm; Tue, 26 Jun 2018 01:06:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJCUQnIJoMGZGKpQ+Ep7Us5aGpyZP9jEA0jWdqDtpwmqjOYnjDvYpKzqq8XzhdpKhAF7RM+ X-Received: by 2002:a17:902:728a:: with SMTP id d10-v6mr554088pll.192.1530000419147; Tue, 26 Jun 2018 01:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530000419; cv=none; d=google.com; s=arc-20160816; b=Y6oUpMVhb0vR6FKSHi1gY0Iu9zJxQFjSyR+4fr3hTW2U9wkL3ySoh4S3MVCj8vzBEm kpnAHbfBG7mQ6496pJFS2nHZND6Z4D/9h/AL/z7WN3DP+FHnDbWFTHLFWA1mCSa0JltH GdnJLPC/r7XLICeWFQwEpioee9DxYIoVJs2tgqOp9Oq/cHg9hpTgCWDFdKAe3Dz43Vyw f8zZ48wbisVe2Aqnabb3J4cIHlf7ZmKSCrEuCt4XEY7ebdMmkaXxIP2HzRmMq3XZe4jp EMa4BkIMhYByhPxIDvVFCsde6qDFgdX0xuAXqj0otiveryojJMsLQLXKzNlcMlUwSnQn /81w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=B73mcBAp8rkfHCkK9qPM7vDCuOQnoQ+bFm3aVC/Ub7k=; b=d7/7kTo9XV1K/cRH3QVZeyZrxmu9gyeGpOiZNeo/+GE0FThjMyDxwtgjtrpExaM2tV w3yLshoUtHOAiPSrwUCNZ51w9UC/1Oktpk/GNhr+EgkU/tFuhwzKPofA1Gcc+NxQFWsM IVxbHhbKIRTTJKGpzZjOBYXhbDK41yl4vHhJqJihszfkDgN0QGpWyGOh54keg6oRWzLt fvqu3TtlGtZujwhhbnlkFiAns2zBlQ8Q7DlrCQiuBYli14MlEdhgQHa5fAB7H0XVDeiv 6DbBdqOnGuOdBlPDIIW5QJArGPizTthiK+UwCW89nIGs8ni1OMG2uOWKZdNikInGV7za 7NnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=Gde6x2bf; 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 q20-v6si961139pgb.394.2018.06.26.01.06.44; Tue, 26 Jun 2018 01:06:59 -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=@agner.ch header.s=dkim header.b=Gde6x2bf; 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 S1752846AbeFZIEu (ORCPT + 99 others); Tue, 26 Jun 2018 04:04:50 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:54204 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752711AbeFZIEn (ORCPT ); Tue, 26 Jun 2018 04:04:43 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id B6FC45C015F; Tue, 26 Jun 2018 10:04:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1530000281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B73mcBAp8rkfHCkK9qPM7vDCuOQnoQ+bFm3aVC/Ub7k=; b=Gde6x2bf+YfSTI1uam6VjN8YNJzU6wp5YrN7bYEiLHSkXNOFJGa6G2tw8fBJ0qvpG6khqv FOsKt0m5F3lUvRVHNBFUwpH72zigIMa5H8F3CBKC9PZ7KNOieqx7pcwJ3p0rksjthhRnBz S++EY1MxWhYo2Fs0FfVD4ThGwj/5xfc= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Tue, 26 Jun 2018 10:04:41 +0200 From: Stefan Agner To: Marcel Ziswiler Cc: linux-tegra@vger.kernel.org, Marcel Ziswiler , Laxman Dewangan , linux-kernel@vger.kernel.org, Lee Jones , linux-tegra-owner@vger.kernel.org Subject: Re: [PATCH] mfd: as3722: disable auto power on when AC OK In-Reply-To: <20180625080013.32157-1-marcel@ziswiler.com> References: <20180625080013.32157-1-marcel@ziswiler.com> Message-ID: <9502dfa3fae42471ddedf05499876177@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 X-Spamd-Result: default: False [-1.60 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SUSPICIOUS_RECIPS(1.50)[]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:29691, ipnet:2a02:418::/29, country:CH]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.06.2018 10:00, Marcel Ziswiler wrote: > From: Marcel Ziswiler > > On ams AS3722, power on when AC OK is enabled by default. > Making this option as disable by default and enable only > when platform need this explicitly. > > Signed-off-by: Laxman Dewangan > Reviewed-by: Bibek Basu > Tested-by: Bibek Basu > Downsteam commit 09cd706fecb9 ("mfd: as3722: disable auto power on when > AC OK"). > > Signed-off-by: Marcel Ziswiler > > --- > > drivers/mfd/as3722.c | 12 ++++++++++++ > include/linux/mfd/as3722.h | 3 +++ > 2 files changed, 15 insertions(+) > > diff --git a/drivers/mfd/as3722.c b/drivers/mfd/as3722.c > index f87342c211bc..215465c97759 100644 > --- a/drivers/mfd/as3722.c > +++ b/drivers/mfd/as3722.c > @@ -349,6 +349,8 @@ static int as3722_i2c_of_probe(struct i2c_client *i2c, > "ams,enable-internal-int-pullup"); > as3722->en_intern_i2c_pullup = of_property_read_bool(np, > "ams,enable-internal-i2c-pullup"); > + as3722->en_ac_ok_pwr_on = of_property_read_bool(np, > + "ams,enable-ac-ok-power-on"); This property should be added to Documentation/devicetree/bindings/mfd/as3722.txt. > as3722->irq_flags = irqd_get_trigger_type(irq_data); > dev_dbg(&i2c->dev, "IRQ flags are 0x%08lx\n", as3722->irq_flags); > return 0; > @@ -360,6 +362,7 @@ static int as3722_i2c_probe(struct i2c_client *i2c, > struct as3722 *as3722; > unsigned long irq_flags; > int ret; > + u8 val = 0; > > as3722 = devm_kzalloc(&i2c->dev, sizeof(struct as3722), GFP_KERNEL); > if (!as3722) > @@ -398,6 +401,15 @@ static int as3722_i2c_probe(struct i2c_client *i2c, > if (ret < 0) > return ret; > > + if (as3722->en_ac_ok_pwr_on) > + val = AS3722_CTRL_SEQ1_AC_OK_PWR_ON; Nit: Use SEQU1 instead of SEQ1 since that is how the register is named. -- Stefan > + ret = as3722_update_bits(as3722, AS3722_CTRL_SEQU1_REG, > + AS3722_CTRL_SEQ1_AC_OK_PWR_ON, val); > + if (ret < 0) { > + dev_err(as3722->dev, "CTRL_SEQ1 update failed: %d\n", ret); > + return ret; > + } > + > ret = devm_mfd_add_devices(&i2c->dev, -1, as3722_devs, > ARRAY_SIZE(as3722_devs), NULL, 0, > regmap_irq_get_domain(as3722->irq_data)); > diff --git a/include/linux/mfd/as3722.h b/include/linux/mfd/as3722.h > index 51e6f9414575..8841b9896033 100644 > --- a/include/linux/mfd/as3722.h > +++ b/include/linux/mfd/as3722.h > @@ -296,6 +296,8 @@ > #define AS3722_ADC1_CONV_NOTREADY BIT(7) > #define AS3722_ADC1_SOURCE_SELECT_MASK 0x1F > > +#define AS3722_CTRL_SEQ1_AC_OK_PWR_ON BIT(0) > + > /* GPIO modes */ > #define AS3722_GPIO_MODE_MASK 0x07 > #define AS3722_GPIO_MODE_INPUT 0x00 > @@ -391,6 +393,7 @@ struct as3722 { > unsigned long irq_flags; > bool en_intern_int_pullup; > bool en_intern_i2c_pullup; > + bool en_ac_ok_pwr_on; > struct regmap_irq_chip_data *irq_data; > };