Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp130170lqp; Sat, 8 Jun 2024 08:58:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDSwPpyMVbNkQh55E3th7vZQWsLjBEOTCRtWQxw6sw7Z03YXP9TXxgpFZXglonTrdIX93tu2+K6Xy2RZN35EFwQZ6rNy8pxqPWf9h0bw== X-Google-Smtp-Source: AGHT+IHuQftMVfu8KO25tOnTutVEX/G9hb9jsFV9aoPGWoJdimHUcA2rXXc42P1wioh+u93N3XKD X-Received: by 2002:a17:902:d2d2:b0:1f7:2ba:4c15 with SMTP id d9443c01a7336-1f702ba4de5mr1751605ad.2.1717862290301; Sat, 08 Jun 2024 08:58:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717862290; cv=pass; d=google.com; s=arc-20160816; b=vg41xTt0BIw8M00JlqAo2QhCQ50ivgU2azQ4YvivBRB3NrVlCm/kcHqmQfRLpo2Lgk NGagJ7HB0CcYC66H1zJV1qkHR7yENGlxw+HGEGM8fiT9EfuXF0JOZfYRNCOS0Gna5irj Yja570Ki3TN9WpIBXYGjkLgDl993PKvvheNPBPLh5mEs2RYxk/rtt9sFe0OkdVtbjymS QoPolGeW1BJKgaXSNHt+K9vguhdKdX2f3//i7oIMtTf/Gh2xc3x1jfGZuGx6rOBfd0NU 6oo1hcIys7XgkxnP4xh0zIQUQC2pPqH3YlZo5aIxcFbRsTGY12ydpn3VJ2phQzaeBzPG GQUA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=IVKqTlCVDKm/3bTxNkZpkRh6OFUALM8OJSvMts24Gvs=; fh=QhgSg1Zbhg0k1Y3sexI0DeQQQskTWRSzxoSuuRe9W3s=; b=LUPS//u1/xNV8WK9OG1jKogtKBfl/UEOepk5MFmtIMCanEZwtWHU61uikffzHlOY2T lhRDn7ToZq18OjEnmLLr1p1snxxkRrN+FBmmfi9TWpU2KAW07egzyYdtLzUbtPOQozbn ShnzrJFh4e5KD+i45occnh9Tl0FR3WOebJEMogzvhBjvEqFi781tTv7ch4hkY097+xyj TzARb1LL45pTsdZDs8JzdPiyl9fpT0P0KO7i1c1x5KN36aqyelNpxvON/t119oZwMiYo EJ2B5m1dzzFuKH5yTyaAhBAAOannJpw8CkXblTFtlZlrB1cUwkzkE376I+DS8DB9cCxT If6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZAHGxkhn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-207110-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207110-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd827019si49833965ad.612.2024.06.08.08.58.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 08:58:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207110-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZAHGxkhn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-207110-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207110-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E44C1282E0E for ; Sat, 8 Jun 2024 15:58:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 234F017C218; Sat, 8 Jun 2024 15:57:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZAHGxkhn" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21807179663; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; cv=none; b=Eyb+cUd9AbzXPffvTHOyAWShyoxl/71e16xPnItmWGtzcUT9npYM18e6DF/TKZB6bwsD4rbMQFa0nwdqbhWJELVfNvIkSyml+BTaHZR/9FJ/ccZThDgUx8l1PEHhe8UWYb0HRcI4A90yuYgHsuxUkrNpeVnEBTdyosPZZ3glbkY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717862241; c=relaxed/simple; bh=CMzX95BYhopK+WIO+dnov/qG98VPRvKcCjXdO2f6tTU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bizGzGa+IiLIB9AysUnZoQzEwFUqCKhebBO8OezqO/XG7TKjhgSfs1q9y1g+YnC7pluX+aTyQi67S9yfcx1TC9qSb5OkHkfVS3h3tIgdH0VM1eY6mjAB1kn/JuHQu3exPtPADT0YaJk3hCCRequgARUG/LRWoZ3JNsN9noceAZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZAHGxkhn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D50DC4AF07; Sat, 8 Jun 2024 15:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717862240; bh=CMzX95BYhopK+WIO+dnov/qG98VPRvKcCjXdO2f6tTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZAHGxkhnaz6McvoQMyLgF7EMrucsNM73Mrfr4cQ2cXDikxh67LPzsbD8B9kcTma2U EvZ4OvkC2wAt84R1/nxJQOAxF1ms19erPKxdjnFVwgVqCudQ1BK765qEkh8+s+U5fX OGTk9IR0stsTNj0sqG1wxbI+F/RItQH0K0N93CqbeXMKJ4QVwX5IzR9kn0r5yVvsB2 xYqOZsHMwo5dq1f591c3kQWgYSzieOMKXLnNJi7y8K1K36+A0X+X80LVyOpduqOdx8 ARiu3gAGm/Lfqaf5dgmuWdIR44ftlwhloj02D8pQ8kMh07BWrB15f9U0USB9KE6a5F R5hvifBMX4uxw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sFyRT-000000003Px-37vN; Sat, 08 Jun 2024 17:57:19 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Linus Walleij , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 03/12] mfd: pm8008: Deassert reset on probe Date: Sat, 8 Jun 2024 17:55:17 +0200 Message-ID: <20240608155526.12996-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org> References: <20240608155526.12996-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Request and deassert any (optional) reset gpio during probe in case it has been left asserted by the boot firmware. Note the reset line is not asserted to avoid reverting to the default I2C address in case the firmware has configured an alternate address. Tested-by: Bryan O'Donoghue Reviewed-by: Linus Walleij Signed-off-by: Johan Hovold --- drivers/mfd/qcom-pm8008.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c index f71c490f25c8..5a77155a63d7 100644 --- a/drivers/mfd/qcom-pm8008.c +++ b/drivers/mfd/qcom-pm8008.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -156,6 +157,7 @@ static struct regmap_config qcom_mfd_regmap_cfg = { static int pm8008_probe(struct i2c_client *client) { struct regmap_irq_chip_data *irq_data; + struct gpio_desc *reset; int rc; struct device *dev; struct regmap *regmap; @@ -167,6 +169,16 @@ static int pm8008_probe(struct i2c_client *client) i2c_set_clientdata(client, regmap); + reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(reset)) + return PTR_ERR(reset); + + /* + * The PMIC does not appear to require a post-reset delay, but wait + * for a millisecond for now anyway. + */ + usleep_range(1000, 2000); + if (of_property_read_bool(dev->of_node, "interrupt-controller")) { rc = devm_regmap_add_irq_chip(dev, regmap, client->irq, IRQF_SHARED, 0, &pm8008_irq_chip, &irq_data); -- 2.44.1