Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1676985rwd; Thu, 15 Jun 2023 14:06:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45mbkG0UdEnl0oksvKWEDoxUyTrEzvi5XePZFpXYUBRrLblMNZkCiV4yPyN8IN1oa1tAzG X-Received: by 2002:a05:6870:9445:b0:1a2:fd06:9f93 with SMTP id e5-20020a056870944500b001a2fd069f93mr276798oal.7.1686863168639; Thu, 15 Jun 2023 14:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686863168; cv=none; d=google.com; s=arc-20160816; b=sUbR+zWIFt8Hc3eGcCeVQxqSG4BRj+aH5nQ905i6nT2OiZeaGQKsvxEcgMVa2q5Wre m2t9A5KSC4wPPyicyYNQW8XCc5+4UeJ5xFeXOlCjZePl7GSVBv5h/mdeDjxe7TgAJzjg ciqfw8CjqRxtkQ2Y0Z/quX+E2AFvoiapKNYMTvbNbrrxB0dDsJniVsFUSJqvQebQ22Y9 ju1D7NrwWbyT91EYgHLBNLHPYLk2Y6I+9+WkTZ03DG77ECvcRgU6XUBPHa67aWSv2odk WELJAZK+/sNMdVGT4cWDu2EvjdNiwbthO2SQZkzP/1ayhHVdVyOUA8vtETUXFr+8sknd 5EOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=dgV1It5yzYqbMebPqzMnKIWLU3rEcZIgopMZAjPAt2g=; b=fvAHGyLnPl2GGkLAcMfkDTJ4eUJR4nHvUdQiAz4w5Y3DS2z+Ux5FA1KgYbQ7gO5Q2H 9NYt/pSZYzLnhMYephz1ym9dDEoy/x8aNvo+ehkWOE8KIVIO+i91qvE7KrGHaEA2Zrm2 jfnIIjs0zrp4d/jOEcwatDCJuah46VLdcSZtLcNDuweZb0AGCUVUSUfJ/KLw5dxskYrj hyjkTBNqZMfWd8J2V5CfsbeP5Or+C4ErHhisK8YZWcrzLzPGEjxTkE6ZMSb/XwNYEd0E nxMkl7gm+xeE1vMUvXPnUCl67ECOHjUzNGibWmViEyOSYDTOyTnxLNy0ZXOmgToJDDu0 lPnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=DfQBDDXz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a17090a694f00b0025378b5495bsi179986pjm.33.2023.06.15.14.05.52; Thu, 15 Jun 2023 14:06:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=DfQBDDXz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232035AbjFOU4i (ORCPT + 99 others); Thu, 15 Jun 2023 16:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbjFOU4g (ORCPT ); Thu, 15 Jun 2023 16:56:36 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC212270B; Thu, 15 Jun 2023 13:56:35 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f8d0d684f3so22697335e9.2; Thu, 15 Jun 2023 13:56:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686862594; x=1689454594; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dgV1It5yzYqbMebPqzMnKIWLU3rEcZIgopMZAjPAt2g=; b=DfQBDDXzeQsp+dF++eEaRIp0slv3S+MuToAvwrWA4o8RaqsNOPU3dO12qNVpNiMUZd w/AbZyCDBx9VkQmkBqIAW43KrUvKMG/5HcAogWc3WIuZoh92crMTJkg424oVNhStKJhs /36r0RC7bjsil2vjJL0ew8kyY+ODbPuQeAoznYGUXWM6PQ8iw7/OeKdW1QKucxLmWfO0 /DTVek8mtZuPrKZeRuceiS9OMTvn4W1XHTZGCIo9Jjs4ZDycqwzKpJh4tEl1yWeQ3ch3 42/XrViLVuinuhSuXMGc4ADjsNR1lpf7Bv4d8JvUf3xfYl+9xZmiy9c0rvpFge6L+tRi x+cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686862594; x=1689454594; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dgV1It5yzYqbMebPqzMnKIWLU3rEcZIgopMZAjPAt2g=; b=VinO9yTjN7eNhGJjJOvOZMrET/ayG1GaYEbXTAuwWWRqI3jHxoU6D0Sqe6Datm3yfv bPk+9Jk139n1w61HobGzsUNn3HuKcyuYY2j9oLHMVHqcu8VvnWJ+P/ifIw7vS/hpvDwS TMoBSA7+B/PRuJoNc+RCkBOAfjDDp6lB6Vlu3VMJd3K9AmIvjIcHepmeFeUGK1qcnGrG YBAORB72zFBNpBtStNmnCZLtxvFWRItT4GLqjoDfnn+tSAnwLWqDzStepUeQaqOo8+yR zP/9A/0NWIzYknNTKuk0kKpIrS0zUuWmU+5//Q3n/bz9JYo4iMF/MRrE1bh3KiZCcSrg O3OA== X-Gm-Message-State: AC+VfDzGpu5GsTyk81+bQscwemj8BR1oT+vYfrvrGY2Svm0TNZodYXrf Y8f/tJLKlmr2iZMoKwD2e0rFBiEfT8EL103X X-Received: by 2002:a7b:ce92:0:b0:3f7:3074:d2f2 with SMTP id q18-20020a7bce92000000b003f73074d2f2mr213658wmj.34.1686862593604; Thu, 15 Jun 2023 13:56:33 -0700 (PDT) Received: from user-PC.. ([92.51.95.194]) by smtp.gmail.com with ESMTPSA id k24-20020a7bc318000000b003f733c1129fsm176372wmj.33.2023.06.15.13.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 13:56:33 -0700 (PDT) From: Maksim Kiselev To: linux-iio@vger.kernel.org Cc: Maksim Kiselev , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Cristian Ciocaltea , Heiko Stuebner , Andy Shevchenko , Cosmin Tanislav , ChiaEn Wu , Arnd Bergmann , Hugo Villeneuve , =?UTF-8?q?Leonard=20G=C3=B6hrs?= , William Breathitt Gray , ChiYuan Huang , Ramona Bolboaca , Ibrahim Tilki , Caleb Connolly , Haibo Chen , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v7 0/3] Add support for Allwinner GPADC on D1/T113s/R329/T507 SoCs Date: Thu, 15 Jun 2023 23:55:19 +0300 Message-Id: <20230615205540.1803975-1-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds support for general purpose ADC (GPADC) on new Allwinner's SoCs, such as D1, T113s, T507 and R329. The implemented driver provides basic functionality for getting ADC channels data. Change History: v7: - Fixed typo in DT bindings property v6: - Fixed DT bindings regexp for channel properties - Dropped checking the max number of channels from the drivers code (This is redundant as we raly on DT bindings check) v5: - Fixed DT bindings properties for child nodes v4: - Fixed DT bindings warnings - Used GENMASK to clear the irq register - Minor formatting fixes v3: - Added DT bindings dual license, fixed property order and example formatting - Added explanations comments for timeout and mutex - Dropped unnecessary regmap and used readl/writel instead - Added error message about getting channel number - Renamed labels and variables to make them self-explanatory v2: - Added lastch flag to avoid addition work for already selected channel - Added reset assertion on module remove - Added dynamic channel allocation and dropped iio_chan_spec arrays - Changed IIO_CHAN_INFO_SCALE type to FRACTIONAL_LOG2 - Dropped separate compatible strings and configs for T113s and R329 - Fixed includes - Fixed Kconfig description - Removed duplicate probe error messages - Used FIELD_PREP for bit setup v1: - Initial version Maksim Kiselev (3): iio: adc: Add Allwinner D1/T113s/R329/T507 SoCs GPADC dt-bindings: iio: adc: Add Allwinner D1/T113s/R329/T507 SoCs GPADC riscv: dts: allwinner: d1: Add GPADC node .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 91 ++++++ .../boot/dts/allwinner/sunxi-d1s-t113.dtsi | 10 + drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/sun20i-gpadc-iio.c | 276 ++++++++++++++++++ 5 files changed, 388 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml create mode 100644 drivers/iio/adc/sun20i-gpadc-iio.c -- 2.39.2