Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2812159rwd; Wed, 14 Jun 2023 07:39:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bkbiYWLBEnjaKhdEm6+JE6eIJ5tdeAlS3gbpEqus0ODuJd94yOE0YzYUuxiNhWwVib1cH X-Received: by 2002:a05:6a20:4325:b0:105:6d0e:c046 with SMTP id h37-20020a056a20432500b001056d0ec046mr2633206pzk.26.1686753546570; Wed, 14 Jun 2023 07:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686753546; cv=none; d=google.com; s=arc-20160816; b=04T15T00EF9+DnpNVaZ5uNkwKqOStjAs5j+9pizKmTiprj+WxC5Z8bVCNC6+WNY8iv dbvHrvq05qgB2F9BFsPie3D3SSFd5TvDx49SKLDARt0IDyD1xoG2S2w42CAkZTj5JHbP Alb7/4oKU77S+OT854Ud5pMCsV1Td79hwsgxy60R4i8xDwlZmL1W6f1JAt8xV4P+I6Z+ KwNGXhaYQobwtb2F6/XlCN+KBU/38ymBnDvW+dJu07ALbeiiRM+fVC4FLLJfIro6gSBt eekVcbCeqgzkbGZ8tEbQa1/MzxkG+ZY96ClIr7p9HnnRJiOYABVgEUY/D/O90jry16bp OHeA== 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=0JybOUC/usbiCh45KPFPiAH4HAFzWlMk/CzyDoXTHvw=; b=OhjhDuY06CqA63lQuTNeUfZW9/CE4UquYptFjrIqzHH1cFAdgh3Lr4B4c/XoTvyvvI ypW0RlmVWzDVw6lja/gGesYWrKZsd5zd/UxMmWYiIT/mynnWSrJze1f6+3FhU9Gq7DTl Wn76BlM3Vi4dEZYldij7ejen7WXSA5+RhXFU6XYI2qqLlG75JKobx2DtbrDWLJ0u9/eG myeZ3SLdm8+1M7xv0+KxVqDt+Xr4YqavwMxyg91rEXQADIaak1Bt/qWkeptVrdCDKfZS 94mAeKQkyKoafO/IZVpzsLMkz8XGE53L8oupHZM4oYu4+xyrbRMft82LJA8mVTGac3QI ZbHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=CG5wzZzF; 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 v2-20020aa799c2000000b00661ff0293a6si10988654pfi.41.2023.06.14.07.38.53; Wed, 14 Jun 2023 07:39:06 -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=CG5wzZzF; 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 S241078AbjFNN1r (ORCPT + 99 others); Wed, 14 Jun 2023 09:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240617AbjFNN1q (ORCPT ); Wed, 14 Jun 2023 09:27:46 -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 9BF6F1981; Wed, 14 Jun 2023 06:27:44 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-30aebe2602fso4750163f8f.3; Wed, 14 Jun 2023 06:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686749263; x=1689341263; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0JybOUC/usbiCh45KPFPiAH4HAFzWlMk/CzyDoXTHvw=; b=CG5wzZzFulGLaWBywnh8vLcrY5OVo7hkm5vSWNCEWtnOD85u9HtIENjHgSX00MLAsH qa1qB3iNLBrezxUoLMEdmxxjmvmTlHXnEeQfYsfR83kLYB2+oCUgJg2Z2BIgmtCG0h7S 1M0jGBwIjGFly8IEGPyYxAdpHVZKtKkZToP1z1C7o/2wJsWtA+elysJk6qCbeFMDGq4X +XNPjuFC4FIKWTLS3ssWD0VM+EX5hsnxHB2aMBTPgXZkFccBUFr6hQqEIoXgmqDIHQC/ LPrDBYesH7bx47sKqMk6NTLxytV0TYoMEi36NLiH4w+xUkQewjU/2VuXYRo2vaEdmPXh x1BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686749263; x=1689341263; 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=0JybOUC/usbiCh45KPFPiAH4HAFzWlMk/CzyDoXTHvw=; b=Bl4jbcpeplPgomDiGNxhzCLGlyd5S1NuczZ20nLjaKv6Np6wnlbMP8H6n/afHvnJSc N7S827PNsnm72UYiLelaTI9j4hdcb9m7ozr1LpEl5bbXXQ6GRZSiX5WRDtabISZVIW4/ 02XuuWtsyA6ua98FRLH/GrHbAiwtsXVrOxkJn7siV2k7attv/ZwlN05/2UOiT5o6EqUo XBVGGURW4Ha8E8YP44tgIT/KyMEQevApAO30Qo8Bnuu/eJQW13YhU22KtwrnbUY+Gb9g z4yGFILOULkclN0b/aWL6tHavnADd4el1MLhyCM0mTAv6ftGxTjAVTuSrn5sl1U/2310 XATA== X-Gm-Message-State: AC+VfDyP5MPC+ADe7v5XF3ghepPgJxI/Bg+htTyGC24S4/+93ptV7x8O 07uHIH5tk3Vrn/n/PrAuixs0GqOUXFqxI4G+ X-Received: by 2002:a05:6000:51:b0:30a:f3ca:17bb with SMTP id k17-20020a056000005100b0030af3ca17bbmr7486540wrx.35.1686749262663; Wed, 14 Jun 2023 06:27:42 -0700 (PDT) Received: from user-PC.. ([92.51.95.194]) by smtp.gmail.com with ESMTPSA id l6-20020a5d4bc6000000b003047ae72b14sm18295017wrt.82.2023.06.14.06.27.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 06:27:42 -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 , Arnd Bergmann , ChiYuan Huang , Marcus Folkesson , Ibrahim Tilki , Ramona Bolboaca , Caleb Connolly , William Breathitt Gray , AngeloGioacchino Del Regno , Hugo Villeneuve , 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 v6 0/3] Add support for Allwinner GPADC on D1/T113s/R329/T507 SoCs Date: Wed, 14 Jun 2023 16:26:24 +0300 Message-Id: <20230614132644.699425-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: 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