Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3601124imm; Mon, 25 Jun 2018 01:06:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIRqXXn0RMOEg8qCQ8PbiZPlzxqZDNs5BdP7VVGVYgixwDmY7UztWr8Y6FotDkAZ1mPWgms X-Received: by 2002:a17:902:112b:: with SMTP id d40-v6mr11567471pla.123.1529913996740; Mon, 25 Jun 2018 01:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529913996; cv=none; d=google.com; s=arc-20160816; b=LWjsL0x593uAnNQ6fZO7tCFijEgp1cYGG9jtWgZYLvwwlcoMzIfK+C60q6DF8TsnTd BFUQs3q/AFIp4h36oIVxnJFj4XQ9jKV0OBTUMCDDW2z3mbFjjTKDpdLNI1bNNApEuOcV Fs2RsfrZrqkbRs0WihjSEZZtmuZb7n7agiAPypd8N0B7akedoPjHjhJjzyTmRjNeioTJ DCZBK4a7GiDTXfoV0TT/ZwArmcjizakXjxynAgot2eH0ULQLe2RbJKF313QrrRzzBV6Q 6Nd34j6FO5dN38VdM+061bf0cRBNTYTa4wimtcSM4BOPhsZaTvI0m10GrKqB3kYsFp85 Ubog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ZUk6Yq0+MOayVZHdGa4A6u904bjyuX3UMuGYEnrT/yU=; b=hP4JZLHTH7cLCUUwupiWVDOd1GZ8FiMEJ/7sCUZl9S2KbDl2NLD5LbSOmyvajz8GwM /4pQj6m07pinVtjDHGSAO8SOXp6si9sp5L6o7DD3iXVAjfjt2JULvchVTA5eqNtUybYV 81ah4jYzGBU0AfoHbLKX2OBWPtMaCZZ7bNNtqkzg92PUOPBIg0VZTS5APaQM7qnLupAh kY7GGxuXNjcIJmIOphP4/RAmeEvOV/c7M4hOYTDA80sH401ujfImLKXwDYWJAPeuyFBS E30cO8m+6yJ3DMXsIrNXKHiuXVS5FSpPsnHfvFV/lCZgM2qhXMDtBQfByzsW3VNquI8G p2YA== ARC-Authentication-Results: i=1; mx.google.com; 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 t14-v6si11102780pgr.275.2018.06.25.01.06.22; Mon, 25 Jun 2018 01:06:36 -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; 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 S1752585AbeFYIFn (ORCPT + 99 others); Mon, 25 Jun 2018 04:05:43 -0400 Received: from mout.perfora.net ([74.208.4.197]:54855 "EHLO mout.perfora.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752237AbeFYIFk (ORCPT ); Mon, 25 Jun 2018 04:05:40 -0400 Received: from localhost.localdomain.toradex.int ([46.140.72.82]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPA (Nemesis) id 0M1HiQ-1gQIWT277A-00t6cn; Mon, 25 Jun 2018 10:00:30 +0200 From: Marcel Ziswiler To: linux-tegra@vger.kernel.org Cc: Marcel Ziswiler , Laxman Dewangan , linux-kernel@vger.kernel.org, Lee Jones Subject: [PATCH] mfd: as3722: disable auto power on when AC OK Date: Mon, 25 Jun 2018 10:00:13 +0200 Message-Id: <20180625080013.32157-1-marcel@ziswiler.com> X-Mailer: git-send-email 2.14.4 X-Provags-ID: V03:K1:dyWuBbByBhrY5zyCaCL6D6U4n3s+cywk0AQVRH7HFZqdRj+yVRr HEdS98DZIWaLHtS/UQs4zb4uK5hOVuTNrH7D1d5hg+0+O7Rynac3CztHXrJz/hMH7xy7wSf jeTogXU+oED/tSoh2Lq7hDoQtlNSAA8KpWFhhH3qgJ0u03oIdU3HxgvLZpM1hbPjnuOdnt8 k5scT8IvEZIwAzWuRDExQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:UaY2MjKuQ70=:yDAOf5iydZ7a7xtlUMHEmn vcyz1130yCiUETOmaIuFEbYaibWhYCsRLxbYJhrwpzQlB0KwR4SPSHT1lmZbjAc54g8OABN1v gZO2cbqkbqgiVFlfM328+vrC62nGIMHbRVkdIjuv5jAX6ifemnV7vppMCLazBTxiy4LKvvE4T j0GgfAcVlxQ2r7PMIfAO8Whv5Ww127WwPM2xj4fICz7XXgeYKL5YsRCA5LxX+wwXBm0tLvIex qcQtCjvyBrDIBqSGVlUaahim/MCWLcnOMCSFqQe6k+5BJTzdiclWdV6CUB0TJmkuYsRsrC6YK dafsjzRFujqYzpyfSw2PNa6dv6zc4dOzJnyk2xf8SK98P/btTIEIpZnMRuVeaNFXbZjExT/Sk 8ta9ZerOInGEa2xTIWBlzBYtsUL66PRuUdDsn8wZbWmiErxb+ejVUk02UWLBklcIVAvr5pN8L q/5p02aPr41SqjTBz3eNk4TNalOlsialFYHk9TG9R7RiFl6U4joZEAkMDzHy4BPxHF9RAehUW dfzfmT0qNc9iGOHAL20tB+fvRPfumCzDyMfhIJ6Pu/i4SiVd9oJ6tqUfgBYRjPUk3+m66EAZa /RG3K4vh9ViTQn/bPzzH1TgZknJxbgXJ64JHytz3xEhHYNsoTUJsePEjpcJSg3fj6mfnHWxeN VVF5bU2nPyzdCIYbof9/OQr48Qzk5y+XEmCs60VOoY/e4XqkuQgzxZMxV8SDBJQ7YcSc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"); 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; + 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; }; -- 2.14.4