Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3308045rwd; Sat, 10 Jun 2023 05:35:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41/3joE04moFUzqH53TEnqBppxG2Ho9KRHr+L4qLADBxDpviBunKiZkHzf2tYeRyqtQ0W0 X-Received: by 2002:a17:907:3607:b0:973:ff8d:2a46 with SMTP id bk7-20020a170907360700b00973ff8d2a46mr4622845ejc.3.1686400507763; Sat, 10 Jun 2023 05:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686400507; cv=none; d=google.com; s=arc-20160816; b=iFYY1I2N6JHKGkmiutlwJIoLmkHAg4eHRZMu9lOHlY7SJE9/ysO618ge4A9k5pDLVi oUJpoVxXmKefnz3/7UqM9A04PPbKJYRUzyvc0SYJF9zu+R7MyFL1XqHacohKsCipu6xf hdoh2Wh8Y2XqricglSVV2sZfNc7xg48jYEzix0fOgeVFiE72tkVt8oeUTa1Y0Oaj1wxw IBUDeLw04DKbuBSWm7+5U/2/Y7NMK2cOATJjz9AgWQROj5yXtzMYgVvBivPbbLQZbV6H Jw+WiVDRVooMF3m410CILPMGPOjuc78J6jRG6IWPRxEvDGAR+iUZEaozdnHf71cs4blt 3b6A== 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=FK/BTEpi1h8QPadFMEPE8CQ/83P2AbocLoI9C/+A1BY=; b=dKQOg4OYYvdzmsMTopDy0x8HePUe4Jt89UegD++4s/O1Kfi3XHvMAPCfV1JmnYS7Sl VMNFCPF29v6gJFYR8S6UcLV9Glw8V4S0Xo18mwB8An3/P7oF5F5tYvTVTMnBWbbHc6vE B06ygkZr8bjvym6fhRZyrMcnFJ7fAubpLnpWBShB/rIPJdmZa5TrYRQEv03cPP+t4oWY tQJh40AWeL209Kz2QnuVxgjzLIWfr/Rb67Ci+bKpywEb/cRAmWZx/htNvCagcnq2ejB7 q/YP1gO7DHiKWKr5lsqRjNV7/me8WIgl0aVzPe7Y1ozq0UT9dGVQcOCNVNwdw3B4pDqN AMfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=aJ3Eu++P; 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 y13-20020a1709064b0d00b009788a112566si2498719eju.116.2023.06.10.05.34.41; Sat, 10 Jun 2023 05:35:07 -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=aJ3Eu++P; 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 S232069AbjFJM36 (ORCPT + 99 others); Sat, 10 Jun 2023 08:29:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjFJM35 (ORCPT ); Sat, 10 Jun 2023 08:29:57 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0AB93596; Sat, 10 Jun 2023 05:29:55 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f7378a74faso19768285e9.0; Sat, 10 Jun 2023 05:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686400194; x=1688992194; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FK/BTEpi1h8QPadFMEPE8CQ/83P2AbocLoI9C/+A1BY=; b=aJ3Eu++PfSnISHhhC4Q9T0cjluUXnOgJlp+cWSALsVAq71T+rU638SgsRY2kiQEj9d f0TAdOKcCsLDrd4Rnd5sOT4a47vnhgRFCjJHDrcJQIP1QBb6XPTgg/ORktEKw7iSDB4K 4/0Ra9AOFtPYJ900Czi/VUG9qsUDSRvGX6PeNqbcrzmodR14eQAx1SOkRTIPTfe+podw +njDm/lqk1AKUMMc40PrK5OaWFTo8+QxyX7Sq05SDDJqqbax/PUaN+0K18IIejnSG5jA OdLXFzGP78gBuVVeM40uhP4PyWlaFet1+OHmZ8/ynTj4ysc4z4zexGyPmfwA7jGg42RS vC+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686400194; x=1688992194; 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=FK/BTEpi1h8QPadFMEPE8CQ/83P2AbocLoI9C/+A1BY=; b=Lq0IVJQfmx6QGOWQQmoHR4N2wmuY3ZUT4r+wtAhT48I0DuK1cQ9QLlTKZAAbg02MS6 fnhfzjT6nWXuOgQg9Pc/MGwndOfm0dzd0S9ZPvTsPsgkQJDA2+bmdx+oRIUNQWkDsEXz CSj54iHNCj2YzeXbU5aHZhHExfyncpZbFg+kDQ3Njpko6degiEAaYY5EQA2CRBB90Ulp XHdsLXXK7YZb7J6eZfJXOwqF6KwLpKQcsXxA3jaXQBvGoNnkYhgSb0qGwYpHYvspxJkp ys+YUHrCjw1gOFo/vimL4oM6HbX6Fq3+Mk/v5wGCxxL7zrYebX3RrUTSO/ordw1w03FP MwuQ== X-Gm-Message-State: AC+VfDx2c9d1xK00L/kfmtbzDSXsiykTNylAo/IuupYScnmYkRSBQWPI J4xF6PxuLN6+lg2mxKIy5L+rUOl78SctiH34 X-Received: by 2002:a7b:c4c8:0:b0:3f4:239c:f19 with SMTP id g8-20020a7bc4c8000000b003f4239c0f19mr2492715wmk.36.1686400193609; Sat, 10 Jun 2023 05:29:53 -0700 (PDT) Received: from user-PC.. ([178.134.198.138]) by smtp.gmail.com with ESMTPSA id v26-20020a1cf71a000000b003f80e81705asm2310487wmh.45.2023.06.10.05.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jun 2023 05:29:53 -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 , Andy Shevchenko , Cosmin Tanislav , Ramona Bolboaca , Marcus Folkesson , Hugo Villeneuve , William Breathitt Gray , ChiYuan Huang , Ibrahim Tilki , ChiaEn Wu , Arnd Bergmann , Haibo Chen , Caleb Connolly , Mike Looijmans , =?UTF-8?q?Leonard=20G=C3=B6hrs?= , 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 v4 0/3] Add support for Allwinner GPADC on D1/T113s/R329/T507 SoCs Date: Sat, 10 Jun 2023 15:29:06 +0300 Message-Id: <20230610122934.953106-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: 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 Maxim 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 | 281 ++++++++++++++++++ 5 files changed, 393 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