From patchwork Tue Nov 14 13:48:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 743778 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp2177091wrw; Tue, 14 Nov 2023 05:49:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGA/ZzKqOs8YcJoK7bxLKBH2DhE2xgvzUiVuyg0QIbTc3qSwMB9hGhJbgqW5fk8MlRP0mRi X-Received: by 2002:a50:c050:0:b0:540:9d0c:75fc with SMTP id u16-20020a50c050000000b005409d0c75fcmr6628614edd.26.1699969784852; Tue, 14 Nov 2023 05:49:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699969784; cv=none; d=google.com; s=arc-20160816; b=hbdlhHjcijDjYWScssNlJKiepPovK0zujMsncIVCsaADsibf+vPLoWtE2ezis85CUs uKHXVQdJpF70K4P9bweiTfQyWL/2OvHeOsMCKLCuwkd3BmqIh+erKRPNAGyE12ip3+sL Vin6TAfeMKHCyNXC9adQqWxbnfquJ3mS10t7s6AIHpwV2fyADAIEFiJT/nTHWPDSC2hA 8mbM00XGEesYDhllMVIYxRZjWTFLXXdejnPyAjB4mX1lofOXVfVUbZMYqv/Kky3XdUEd i7+nnHzczsPLhB/+Yykzy3NZdHsu1lc5sPboHVlMKtlpzEYaTrHHkgtZgm01HZfquQz9 ERNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=YJfp5QS/eefmKujbF78pe1VSO00cljqoNnqX74yAIow=; fh=57wjcTC2B872pbvvKlxFgwzI1s9QKuSBoEg/SeZNaxI=; b=Z91F29nktiwjGh9D6MJ6HQ0zwEfy7JQ8GfgFgsDfDHGZRCb9HodSmVDjs6nx3e+3W9 mJnfmOL3Bh72G/KY6oy6AjRcHuGs9ubmACKNoShBsZclihQ38+B4wWbZiyN4slhVmUUP atGXyhY/D6Y7SUBFiu5n7n5NJQ63nZUtJtK3kIQuSYGId0NHCmzdSgzUfnpK0kDyZCjG USrroneTTkaYGMjHa8ElJN9Wk6wic288H50E1H6G5Nr6LwYa4a36JEeRbCQ4nS1W1feF Uwqh/b4yBrUucOXrSq78Brm59e92tJcc9zifPkFVytGIomac0WKEIWPycfaM0hRFu9gO NZaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xH8iJeTn; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id p24-20020aa7d318000000b0054340fa19d5si3896535edq.589.2023.11.14.05.49.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 05:49:44 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xH8iJeTn; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 09322874B1; Tue, 14 Nov 2023 14:48:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="xH8iJeTn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AF54F87499; Tue, 14 Nov 2023 14:48:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DD5318744F for ; Tue, 14 Nov 2023 14:48:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40a48775c58so33704925e9.3 for ; Tue, 14 Nov 2023 05:48:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699969734; x=1700574534; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YJfp5QS/eefmKujbF78pe1VSO00cljqoNnqX74yAIow=; b=xH8iJeTna2sICgwfkk9LK7pfAOdpdmlc4VrTq5QuMBqvmGibLD6Gi0noBxE5JrWFOp kVL4y5iD8uJXbX2v+gNRM7o4AQer1a1l58kKeQ+E+Fmogq2EUeBbwjLF88hVTQdepJDn DJ6z4oyMq4QkkFEt1lrIJ6lHBDuqCpKbmkMbTasYP51gClmeeFQ6cBDo/wZOD2gsivYu ImQNJWqd9FDc+W0nMHnA54xw+hEAUKcMa+UMLOl4zS48Yyvt1NNJq/MksvgHcilBbLq4 13bLVOMDo7UVLXbQmF2BjBmFacZzyZd4Hict0rTwTV3uXvM3FPl3DGkw6RLIwppm+URP DwfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699969734; x=1700574534; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YJfp5QS/eefmKujbF78pe1VSO00cljqoNnqX74yAIow=; b=VBjffOitM/cFRDLLI/NcGV2vqewOfQZiVLkk4riwWccVgWndddZfhK5PX+y0h9MJag 53bAYZJVls7jJ8HcBczxRY0Aa4Yjqs2wfPEaini9k8uRCoXXN5t+et6UKlSj9Pxv5Ywy LeRVrzN2ZBXpoiu3dzXWqWGIDy+Dr1qwy94mdZ4ORlZin5bHEBJmwsOfNuLuxpcAfzP5 r0xUf1b05S6aUZnGUf+fJ/e6x1WV421hrrDQ01rYCgdXqqQraNrmtETsn1vOexDosaKI EhsiytvxYDMU8PYDsTQiTQbwC/OQX2fts/AXgT/tvMQfK5LayNV7nc/HxS7Dn0F0XHEj W9uQ== X-Gm-Message-State: AOJu0YzS89R4dvhh8y//5XXwNZSzcR57uIvaDl2qzQseCFngjBbxxFL8 w3zDZNS+4EmE90TUEHWEqGXgsg== X-Received: by 2002:a05:600c:231a:b0:40a:3e13:22b0 with SMTP id 26-20020a05600c231a00b0040a3e1322b0mr7425000wmo.41.1699969734438; Tue, 14 Nov 2023 05:48:54 -0800 (PST) Received: from lion.localdomain ([79.79.179.141]) by smtp.gmail.com with ESMTPSA id w10-20020a5d4b4a000000b003313426f136sm7804220wrs.39.2023.11.14.05.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 05:48:53 -0800 (PST) From: Caleb Connolly Date: Tue, 14 Nov 2023 13:48:51 +0000 Subject: [PATCH v3 5/5] pmic: qcom: dont use dev_read_addr to get USID MIME-Version: 1.0 Message-Id: <20231114-b4-qcom-dt-compat-v3-5-88a92f8f00ba@linaro.org> References: <20231114-b4-qcom-dt-compat-v3-0-88a92f8f00ba@linaro.org> In-Reply-To: <20231114-b4-qcom-dt-compat-v3-0-88a92f8f00ba@linaro.org> To: Ramon Fried , Jorge Ramirez-Ortiz , Neil Armstrong , Sumit Garg , Mateusz Kulikowski , Jaehoon Chung , Dzmitry Sankouski , Stephan Gerhold , Caleb Connolly Cc: u-boot@lists.denx.de X-Mailer: b4 0.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=1388; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=pJOwgwuqESk9m96peXOf3uui++e6fZBT/bur0vD18ic=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtTgqgOLdW023unRL97xtvXZ71NVV5fWlZY03W3p3ijfM 1f+evafjlIWBkEOBlkxRRbxE8ssm9ZettfYvuACzBxWJpAhDFycAjCRzZcYGTbcbvUUD3QQ85RY YTdjmmRg0pS13bPN7p65w6Td/eDKaTaG/7lJje9XvJqosXTbokM2K47/t7w2d6Xlk/ld0iKZjnE /TwUBAA== X-Developer-Key: i=caleb.connolly@linaro.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Linux DTs stuff a value indicating if the USID is a USID or a GSID in the reg property, the Linux SPMI driver then reads the two address cells separately. U-boot's dev_read_addr() doesn't know how to handle this, so use ofnode_read_u32_index() to get just the USID. The Qcom pmic driver doesn't have support for GSID handling, so just ignore the second value for now. Signed-off-by: Caleb Connolly --- drivers/power/pmic/pmic_qcom.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/power/pmic/pmic_qcom.c b/drivers/power/pmic/pmic_qcom.c index ad8daf43f06f..f2ac6494811d 100644 --- a/drivers/power/pmic/pmic_qcom.c +++ b/drivers/power/pmic/pmic_qcom.c @@ -66,12 +66,19 @@ static const struct udevice_id pmic_qcom_ids[] = { static int pmic_qcom_probe(struct udevice *dev) { struct pmic_qcom_priv *priv = dev_get_priv(dev); + int ret; - priv->usid = dev_read_addr(dev); - - if (priv->usid == FDT_ADDR_T_NONE) + /* + * dev_read_addr() can't be used here because the reg property actually + * contains two discrete values, not a single 64-bit address. + * The address is the first value. + */ + ret = ofnode_read_u32_index(dev_ofnode(dev), "reg", 0, &priv->usid); + if (ret < 0) return -EINVAL; + debug("usid: %d\n", priv->usid); + return 0; }