Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp756910lqb; Wed, 29 May 2024 09:35:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiXf/5AOkmkVyIIStSu1GQMupKZrmIujGAftZdWMCewd/I94gyA+ObUtyTpgoyG17MrLAXJwmYfy7530EwDN/fLulrWSWdzCEN1aVW8w== X-Google-Smtp-Source: AGHT+IHynoaBCfq6BHBVL7Hp3lBf+VJzimbFC85Gmt1ZSNYMzbbjKI2myb4G4FDJ4QiTKJGZw85r X-Received: by 2002:a05:6a20:12d1:b0:1ac:3d3c:c1e7 with SMTP id adf61e73a8af0-1b259a2964cmr4211129637.12.1717000535755; Wed, 29 May 2024 09:35:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717000535; cv=pass; d=google.com; s=arc-20160816; b=VAr1jTn4He7+OEHivVI8BXZDSV236/Qje8GuovGKNy0txV1ltMPxM91CifBfIY+mvF 7jIxqxn2ivre1pjiZGRrXFGbX1aTAftpsbK8nBU8is9FZuXEl1J1PUENinZoXbcLByXm pervN5hC3isDbMHlbBPsA/dhymWw2wRncs5Xc1E83di+sbxtfmwvMH5vuctDDw/C8l0t M2+6lHb/ucSwDZ+8z7XkIB8UsRcG1012i3E6J7haxlOdq1O9s4y5ciLzq4DeKaiTfMI3 eJQ4c4pI+cnbhDBMf5LwbKQx0CLATQ+4To8A5EP8MLQloUuS0Aehtj6/ZeCSCidAYo0F sWgg== 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=x+Zd7UvMx2t8tXw5ng9M6xK/nnIPEHXRKsUbNBmr8uk=; b=BmMnoaYqf8UMN3LPjCj7SF583MOj+nPfTCT+dqVknt6RP6Rg4uSmdl9uFJJiUrD8jE 7EH/AcsWCpTc/NaC2moAfi0P1mH5KPB2aABpnSzwDcGJdxVCJSU0cc7+EPQPYLMsw+Qu +Klhfo3Vq+0hLNHDjn8fvCGCFI7ebSUh4CVejQPbt/PgptTGUzx1FatWMCuZ9EmTxAnd vtAbJukWed2Hw/Ulqn5VDBXz+w/JRfJiBbHE9d+S4mzCk9eaZDHl4qjDT6gJJWGoup/L uJnIcNcCpLGrEhqoTLjNq8eG33ew3Mj0ZBjL60IYa1sIG+gIWhDm+cgtB7dtwkD7oMDE SOCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k1VZZ7iS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-194463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194463-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 41be03b00d2f7-68221b73b13si10942611a12.8.2024.05.29.09.35.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 09:35:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194463-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=k1VZZ7iS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-194463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194463-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 623172870AF for ; Wed, 29 May 2024 16:35:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 197B21CB331; Wed, 29 May 2024 16:30:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k1VZZ7iS" 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 0642A18735B; Wed, 29 May 2024 16:30:35 +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=1717000236; cv=none; b=ARsHhCw9lrfsTD5cBOWxP1g4XF8LCNa4ian1GIM2B4DapG+O+6apGPceSDEGiTaVCTY9CMH8zdV1feO5F5lqkFi//gvk8YmyCl19zbuLTs+cDdX/Oieax3FpSgilrTV9nOj+K5wm0T4rRX3wgUyrRWGw//x+ktQGb+LijJ54qqM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717000236; c=relaxed/simple; bh=CMzX95BYhopK+WIO+dnov/qG98VPRvKcCjXdO2f6tTU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ly6DCO5coq85Ohrtry2YR3IupUR8hxWT0CAin7WITfP9ALxuv2JDTBeMhhK9o40ppvmazEYSeBWI/7ck4Y12+CHdCv+qzs9XWo/TBZ9EeFDwwDyL9A2hbChVxRSc1DiydhcnGHhf3gsd0rs1s5dJkyxoOIhY3XVkVcn1k4H4yjM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k1VZZ7iS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FC04C2BD10; Wed, 29 May 2024 16:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717000235; bh=CMzX95BYhopK+WIO+dnov/qG98VPRvKcCjXdO2f6tTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k1VZZ7iS25A6L58/8A5UPrXW995EwZJL/51lKKigJs+U+3d1lS6EqyycE/kndywVK l48+qG9wTxrquvUYQpuoBecH9SXQoeJXk+iEBQ76xf8gmFcxq1/0pfqdj78ctCJKT/ cVV9tK9TJGdngKhv5tbSla1ogzZPfSEs+lBAUze57/EmEc+GLeMCPtnFTzkx9AsdWM aQs2FBo3LGVrqwmZhqNrbNr3tp39SlR6a3zwLN03sogDzX8dqFuBd9XhVeA6q1HtQf K0n/mIFRMf4zKWddIcA30l3inGSeQVzu4ordJNkzPZ8mffOcPhhgv3SWetw2gScTEf +jOP+XvQNWduw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sCMCB-000000004im-28x3; Wed, 29 May 2024 18:30:35 +0200 From: Johan Hovold To: Lee Jones , Mark Brown , Linus Walleij , Bjorn Andersson Cc: Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Stephen Boyd , Bryan O'Donoghue , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Johan Hovold Subject: [PATCH v2 03/14] mfd: pm8008: deassert reset on probe Date: Wed, 29 May 2024 18:29:47 +0200 Message-ID: <20240529162958.18081-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240529162958.18081-1-johan+linaro@kernel.org> References: <20240529162958.18081-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