From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84CA5C4167B for ; Mon, 21 Feb 2022 22:08:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235168AbiBUWI0 (ORCPT ); Mon, 21 Feb 2022 17:08:26 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235159AbiBUWIZ (ORCPT ); Mon, 21 Feb 2022 17:08:25 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 923DA22BE9 for ; Mon, 21 Feb 2022 14:08:01 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id k1so29347101wrd.8 for ; Mon, 21 Feb 2022 14:08:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bwN53YHoJ1opVHwpPbkOWG0HPkiJRyBRi2Alm7N6S5M=; b=K6PLqWNi78md6WDHB3AVIRNDPTjYFcoljhSFKi/ZiPJWVGQOvd1jxPg/RF2t3UROFp Vm4MVTD1irJ6SGuusqlbgyIR7C9W6u4P5sgM40gamct5IyfeTFDNcw8iH5815pbDrh6U Jdj4CjLgjSy3lq8Rn+xlR9/TfnXwBg1bSfqBAxoT/lnlXqycGEApVOWbDKjcEtwINT7Q VKiPohZVXjWojIZfdaKGGQiFWCUveGEKDHhzUyaald31WDQdGgTEW7jUk/Ltj2nfIS5n mAqNN0GoblGxU4dPHPkISL3PgEzgd9ubk/I6kLNB120mqn2jbhCZLsJdRCZIzEeVHVIq zJCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bwN53YHoJ1opVHwpPbkOWG0HPkiJRyBRi2Alm7N6S5M=; b=XHSe5/PgDADPPgVPox+q8JjAT4PEg7w0vNlQ7BI1vljFMb3xt+4vroQaG7rLrZ/xDY 0Eh8VG5Rca0vLIe4y7wDFq/4UH/tInZjJHYID+nKUqQyYB9mv+z/p41wg8MdOqXXe8oZ cqtCEGjnGSpm/GJwalK2U4zsUHnYjueW5DsbW54qXdEneEd3bQhNVlot5G9NL+vD/mhU XPXZacPfYR4/3+/pg6MW/vabWIcBk1Y8IRoyEXZ6iDtin5+lCncUNjQDjhjEp/Uk1wNV B2bE0gP+SdIW4dLEVRiXD0GZnIZ0souxkc7vd78WYtKyK1/3OP01ibaMINwDz5F9Uand lXpA== X-Gm-Message-State: AOAM533DgaWj4vvPdo3XZEVuwy6nLi3V2Ln0YjyaHJuxqg//DNWwnXWN 1Rf7AKlMW/D4D/wJuFsQPiPX6fhARE80Hw== X-Google-Smtp-Source: ABdhPJxm3WKYqTKnR9kmdvBJmF0hspSjIA2J3Yj0N/VQGscdgV51DReP+vs8JzdEskHv2e+8Ag5g/A== X-Received: by 2002:a05:6000:188b:b0:1e3:1cfa:5851 with SMTP id a11-20020a056000188b00b001e31cfa5851mr17952965wri.510.1645481280244; Mon, 21 Feb 2022 14:08:00 -0800 (PST) Received: from localhost.localdomain (cpc78119-cwma10-2-0-cust590.7-3.cable.virginm.net. [81.96.50.79]) by smtp.gmail.com with ESMTPSA id w8sm51626093wre.83.2022.02.21.14.07.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 14:07:59 -0800 (PST) From: Caleb Connolly To: caleb.connolly@linaro.org, Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Andy Gross , Bjorn Andersson , Lee Jones , Stephen Boyd , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: sumit.semwal@linaro.org, amit.pundir@linaro.org, john.stultz@linaro.org Subject: [PATCH v8 3/9] mfd: qcom-spmi-pmic: read fab id on supported PMICs Date: Mon, 21 Feb 2022 22:07:37 +0000 Message-Id: <20220221220743.541704-4-caleb.connolly@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221220743.541704-1-caleb.connolly@linaro.org> References: <20220221220743.541704-1-caleb.connolly@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The PMI8998 and PM660 expose the fab_id, this is needed by drivers like the RRADC to calibrate ADC values. Signed-off-by: Caleb Connolly --- drivers/mfd/qcom-spmi-pmic.c | 7 +++++++ include/soc/qcom/qcom-spmi-pmic.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c index 1ef426a1513b..89e10b32fccb 100644 --- a/drivers/mfd/qcom-spmi-pmic.c +++ b/drivers/mfd/qcom-spmi-pmic.c @@ -19,6 +19,7 @@ #define PMIC_REV4 0x103 #define PMIC_TYPE 0x104 #define PMIC_SUBTYPE 0x105 +#define PMIC_FAB_ID 0x1f2 #define PMIC_TYPE_VALUE 0x51 @@ -168,6 +169,12 @@ static int pmic_spmi_load_revid(struct regmap *map, struct device *dev, if (ret < 0) return ret; + if (pmic->subtype == PMI8998_SUBTYPE || pmic->subtype == PM660_SUBTYPE) { + ret = regmap_read(map, PMIC_FAB_ID, &pmic->fab_id); + if (ret < 0) + return ret; + } + /* * In early versions of PM8941 and PM8226, the major revision number * started incrementing from 0 (eg 0 = v1.0, 1 = v2.0). diff --git a/include/soc/qcom/qcom-spmi-pmic.h b/include/soc/qcom/qcom-spmi-pmic.h index a8a77be22cfc..c821f6c6c8a8 100644 --- a/include/soc/qcom/qcom-spmi-pmic.h +++ b/include/soc/qcom/qcom-spmi-pmic.h @@ -50,6 +50,7 @@ struct qcom_spmi_pmic { unsigned int major; unsigned int minor; unsigned int rev2; + unsigned int fab_id; const char *name; }; -- 2.35.1