From patchwork Sat Dec 11 02:22:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 1566782 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=OlOB76TD; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4J9s4G5B5yz9t4b for ; Sat, 11 Dec 2021 13:22:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244046AbhLKC0L (ORCPT ); Fri, 10 Dec 2021 21:26:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233583AbhLKC0L (ORCPT ); Fri, 10 Dec 2021 21:26:11 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 241B7C061746 for ; Fri, 10 Dec 2021 18:22:35 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id w1so35118752edc.6 for ; Fri, 10 Dec 2021 18:22:35 -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:mime-version :content-transfer-encoding; bh=BN1rqnmoBfuCzzscvm3YOnK3Hq7APTJunkR2e6AyI44=; b=OlOB76TD4cnwKGMSNsqhD27bIGeNBDINaYaPIW606KZgbr4YcpmhVQpRZ5i7HoU25f /gI0gVIIVCFayaXW5CeZBZo5k+GtXYQ2D/y3h5WAD9MrExseetqHU1+3zGzcOlQoLR0P zanBl3z97aC2zyy9oQ3rUdTV9mxpR9uZ4NGcGgkGRM9vDAvtYb+f4gHC4adV+Bdo8ZF1 m9LAsszA/U6mjYJH2ySLjicW6cGh+3w8wLo/IiHWpKvQL1zmu7tabwkuHSt4zKfCorhr Fq9JUc3griRTifpQN93SZEkgnsObl1CFUXqoeWhXQ0nB868+o4DL30s3RXlVGjVz6xKS vh2g== 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:mime-version :content-transfer-encoding; bh=BN1rqnmoBfuCzzscvm3YOnK3Hq7APTJunkR2e6AyI44=; b=6gQ17GWRxAx+pP4Rbk0AVSYkKTsYKFtM7mzDgUGNqoWBXIBQnQeEVG4inMrHchh/vu rTUR+tEtSk96IaKgRJS1+srZFBDmrt+NkOYmkKNWjFwvQAigEGRcYR4rNwuXLtsrmyUs tHEWtujlI8HFF8H1GuQPqs06wu9Bztkk8bRAsu6UH7BmkZAwdQ1S2hpdFEFgWmNmLnVu 8mAx8Fs/FK8FqGJ2akl3eyHL6rkDAln0vi22eyitHbf2JrArBPkfzT2h4pt+D6YrSJp0 MS20Poq/UYsds0TazR9IuQvUP+3s2/DUfuhZRNCnv2yZoEnv4B9eXS3j86PtAOxagHRo +LFQ== X-Gm-Message-State: AOAM531xoMUe4gLuPWVq1M+2ekX0XuhuHtTrxSWFT55kx7qrkATpCtp+ pXayTOkH6nzKt443+0uuCWuuJw== X-Google-Smtp-Source: ABdhPJyIY1FSnIyvZJddEk0bFdLO16sKK4IFXhAd18ZGe1ELTgmf+D8v0J1Iu5Q7EEzNY4Q7QN5HPQ== X-Received: by 2002:a17:907:2bd0:: with SMTP id gv16mr27304054ejc.121.1639189353667; Fri, 10 Dec 2021 18:22:33 -0800 (PST) Received: from lion.localdomain (cpc78119-cwma10-2-0-cust590.7-3.cable.virginm.net. [81.96.50.79]) by smtp.gmail.com with ESMTPSA id s2sm2449424ejn.96.2021.12.10.18.22.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 18:22:33 -0800 (PST) From: Caleb Connolly X-Google-Original-From: Caleb Connolly To: caleb.connolly@linaro.org, sumit.semwal@linaro.org, amit.pundir@linaro.org, john.stultz@linaro.org Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Andy Gross , Bjorn Andersson , Lee Jones , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Caleb Connolly Subject: [PATCH 0/7] iio: adc: introduce Qualcomm SPMI Round Robin ADC Date: Sat, 11 Dec 2021 02:22:17 +0000 Message-Id: <20211211022224.3488860-1-caleb@connolly.tech> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The RRADC is responsible for reading data about the current and voltage from the USB or DC in jacks, it can also read the battery ID (resistence) and some temperatures. It is found on the PMI8998 and PM660 Qualcomm PMICs. The RRADC has to calibrate some ADC values based on which chip fab the PMIC was produced in, to facilitate this the patch ("mfd: qcom-spmi-pmic: expose the PMIC revid information to clients") exposes the PMIC revision information as a struct and registers it as driver data in the Qualcomm SPMI PMIC driver so that it can be read by the RRADC. Caleb Connolly (7): mfd: qcom-spmi-pmic: expose the PMIC revid information to clients dt-bindings: iio: adc: document qcom-spmi-rradc iio: adc: qcom-spmi-rradc: introduce round robin adc arm64: dts: qcom: pmi8998: add rradc node arm64: dts: qcom: sdm845-oneplus: enable rradc arm64: dts: qcom: sdm845-db845c: enable rradc arm64: dts: qcom: sdm845-xiaomi-beryllium: enable RRADC .../bindings/iio/adc/qcom,spmi-rradc.yaml | 54 + arch/arm64/boot/dts/qcom/pmi8998.dtsi | 8 + arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 4 + .../boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 + .../boot/dts/qcom/sdm845-xiaomi-beryllium.dts | 4 + drivers/iio/adc/Kconfig | 13 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/qcom-spmi-rradc.c | 1020 +++++++++++++++++ drivers/mfd/qcom-spmi-pmic.c | 103 +- include/soc/qcom/qcom-pmic.h | 58 + 10 files changed, 1216 insertions(+), 53 deletions(-) create mode 100644 Documentation/devicetree/bindings/iio/adc/qcom,spmi-rradc.yaml create mode 100644 drivers/iio/adc/qcom-spmi-rradc.c create mode 100644 include/soc/qcom/qcom-pmic.h