Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3721857rwd; Sat, 10 Jun 2023 13:22:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WGMZFH7wUC6zc+1tJMkGoc/hgLd6htJwvvs42FRzDamnohYy6z9TqEXbgjExhgN4pLqmv X-Received: by 2002:a17:902:d389:b0:1b3:b84b:9017 with SMTP id e9-20020a170902d38900b001b3b84b9017mr1110063pld.14.1686428537396; Sat, 10 Jun 2023 13:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686428537; cv=none; d=google.com; s=arc-20160816; b=GBEaFqWTuLVPkZTJAKWFVIZgDDD1C//BZJClBg2eiG5cJkjSrtJAZzo1suA8hpdU7N Jmgyx78dY6pckpQIIK28PFyvW+yRCztvGn4FGa99o6ylSLu8lF0vmpxq/bkSP01M8iow 0Mom4dh9nwyMzKnMHaS7Mbzn0TWeU3M8mhz5d4MM251FfAfkrYTUpGFyuO8YZaRYqT3R YzIQuViI1AaOy89/SBqcAh05eBdcI1RRAR3nXiM2BEnUs0c7TcwZT3b35MYTMlF6fzoT 3EodfveFIkQIBcBR3d2JI0rNMcWJT0u8l3AovG63XqsidKLjt8+kU2zVJ6jV8bm9Swqx AU5w== 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=6veMoFRMw+mrtF1yxzC2ify8pEornOAoyuTz8mJA8NA=; b=Py2zSzd6aeeV58TPPo57Irpiy2S30x77274XRcAHmDtEaaMH2PBrV7witz6agZiRd3 /oANcdVfnvvUwF/vdp7VgE3w6pathxYhkx3Wf+t+0Fg48bdbki5Q3aNmJx3++D85suvv oj4oRQqNOyB7neT/kOGdndRsh+G/D7HJgnlJQFrpBlO5di39lVy3wyYukMHc6IS2DSQJ FUjJfvVUICjTg3qdjolxZeAICs5z45AHOLh5XSicBxAW2Q9JV62AJOGPtyAHJd9Tx70R zV3W8TTW3Zwwn6eWOz2Xx59VHaKf++VOKY46FAKrM5/rmzbZxCHRHfYxJcrifmaK2RO6 BSWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=NIwhRaJB; 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 k10-20020a170902c40a00b001a691f376e8si1313329plk.415.2023.06.10.13.22.05; Sat, 10 Jun 2023 13:22:17 -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=NIwhRaJB; 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 S231156AbjFJUUX (ORCPT + 99 others); Sat, 10 Jun 2023 16:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjFJUUU (ORCPT ); Sat, 10 Jun 2023 16:20:20 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C3F235B1; Sat, 10 Jun 2023 13:20:19 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-30e56fc9fd2so2812310f8f.0; Sat, 10 Jun 2023 13:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686428417; x=1689020417; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6veMoFRMw+mrtF1yxzC2ify8pEornOAoyuTz8mJA8NA=; b=NIwhRaJBODeG4Qvt2HvUBSbczoan8yUd+0/a7dPs36Uzylxst6dy2ceUgNZiez34V4 n6b1zbsUYxULpcZ+fJN3mzNMZiazljZH9srZ8n63t/4J5xc7scokh2Jl0b+qqZx0M8pB kRsVPbMh6IPxsIVV5Jz8CfwFzRgJ08TwjecfcByfFrV/iHUGPJXZ0iUJh2PnLmwzZ0yU CS8IhoD/hgJ6qzn65ieuVIal1HmBX7uu3KIJpWGEBVSNnjNHDiJfr9J6Lhq/kvvmIHFS GPQSDWN7PdeqOR01L+HExe1TtkBovvlpOFX8Tu0jtHXUYJ4+RsECddaf+eNkYUnM5Owe Ndjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686428417; x=1689020417; 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=6veMoFRMw+mrtF1yxzC2ify8pEornOAoyuTz8mJA8NA=; b=dQ12xf6KiSwWE638ll33fCNFIsW7dmAkz+snn+W/sBnevaYco4YOHYjAwKHi0FQ0P0 xLMEM0+mXbkwf2jDuWh+splu58glWrIgxE/OvxwE8yQGnYkoWJPr6/HxOmpE+PNmiqo3 XRdGmIY0/AnfTaCKbrT633Kyrfq6GLp9aDy9AEI/npSoXLD3XEn1vXw0H2hrN77V7MUW 8lafRMSwJ/jzN89Bw93m7Zu9y/xeRcDrqwXmlmc1nVwIJvfSRgwtA6cNcUuFm/1PFaFc f9l9XXDVMmvHeRKU7uiSt68+5/x4uiIsmXEo7qaedR5epYohHqujRg9g6h+OsKYqR6Cm H94g== X-Gm-Message-State: AC+VfDylFlOmlJPj0xI+TRCbi6026jMs3JiU5C2TAY2eS1H8FFLhHTG1 o9/haaIJFlkSHcn9vk9lgYB5CiOLxCAoPjWg X-Received: by 2002:adf:ed4f:0:b0:30f:b425:a2d9 with SMTP id u15-20020adfed4f000000b0030fb425a2d9mr1669324wro.27.1686428417234; Sat, 10 Jun 2023 13:20:17 -0700 (PDT) Received: from user-PC.. ([92.51.95.194]) by smtp.gmail.com with ESMTPSA id m11-20020a5d6a0b000000b0030b5d203e7esm7878116wru.97.2023.06.10.13.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jun 2023 13:20:16 -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 , Hugo Villeneuve , Miquel Raynal , Caleb Connolly , ChiYuan Huang , Ramona Bolboaca , Ibrahim Tilki , ChiaEn Wu , William Breathitt Gray , Arnd Bergmann , =?UTF-8?q?Leonard=20G=C3=B6hrs?= , Haibo Chen , Mike Looijmans , 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 v5 0/3] Add support for Allwinner GPADC on D1/T113s/R329/T507 SoCs Date: Sat, 10 Jun 2023 23:19:47 +0300 Message-Id: <20230610202005.1118049-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: 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 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