Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4756460rwd; Sun, 4 Jun 2023 12:05:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uzeph+UYvYWcqUGsf0PBauKBOQHZkNXrwvhi4Z6n+GgB2EN0IEkjV9EcbOR3tGa6wF5RJ X-Received: by 2002:a05:6a20:230c:b0:110:9210:f6ac with SMTP id n12-20020a056a20230c00b001109210f6acmr1370304pzc.37.1685905515239; Sun, 04 Jun 2023 12:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685905515; cv=none; d=google.com; s=arc-20160816; b=rCpAByuzVvUemRPxw6uwio+B/LWoOUIkf4AhekMV2+8Eqp7RgqoY1Lmd3j1//8go0H kXegqURaoCUCeFeH01bGqHIodkpZav9EaWVCFYdHOFpx+22crO4j2nuzg7bRvljZqBuC pefYArm+YOhC/7OffWQlPEklcdg12eryLjD4N6FI8ucm8tlu3p3mmileNqEkgceczbb6 vmxBHVRuDMIGNvkWJGGGmsr1otFi1O25Ji0EhWSffepKqp9A4Px5hoN7cxtyEb3QWoNM 4wE85jIahkT/TWEeaWJW7y3WdXNjAB7UTRmlHwEg8yk1YeOi+AAFIvlPOi4pgiscbh7G EKFg== 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=VJAnB3wQ7FughqK6LyFwMtJAGYslbkQgDXV0PukOLCU=; b=HDBz+XVRc0K7CtCQfL2IteJmqVQSP+lnPfIyrNs2TDJcy6W0KB96Afcv6Eg9E9JQBQ 27WnD6xlnPZ0K+jyhvV+vC84KIHRT70LqDBbjtuMcB3/Y0m3A/XDF0Qq0Oug5B6KvAiA 3H+w+A9mn8VRnNd4uXeBXBJnJNOM62BdyOKcpecs5acgtmDu4Jd4SI/hEBR7zH0DGr2n 2DVeyMzI/9ZqnBwioKxl8GTUOf25m3vQlqc/KCnuYeFW2JzfQQYbjP17LasAg91oc2+c Ig6koJJfsaygtVK8Q2ZQ1dq4aRNDhXUS836++iNxjqjSmRAnQZiptor5xyhaI9FdwjbL tUOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=EgzyQTrW; 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 jd9-20020a170903260900b001b02390367fsi4243500plb.595.2023.06.04.12.05.02; Sun, 04 Jun 2023 12:05:15 -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=EgzyQTrW; 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 S231840AbjFDSyV (ORCPT + 99 others); Sun, 4 Jun 2023 14:54:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbjFDSyT (ORCPT ); Sun, 4 Jun 2023 14:54:19 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C27CCD; Sun, 4 Jun 2023 11:54:18 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-30af159b433so4052912f8f.3; Sun, 04 Jun 2023 11:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685904856; x=1688496856; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VJAnB3wQ7FughqK6LyFwMtJAGYslbkQgDXV0PukOLCU=; b=EgzyQTrWj7L7nc4HbbBrWc0/LVWQucNLLiAwomp7bWUNMM+oS/yk4bE6+Avc9WS49x aGbNZrxVxFL7aKpwZetTHFXq/R7q/UQa7rkfgDG09UNazrXKBxx7BMZ6tm0FrIS0fSWh mDQfKtmojwJmsXEK1EZRrWtDlgadDkEIrxcZMNdlb/U3WAKEKf5U9ugU1bvppA+Okso+ lHKbigH4XJTo2CoRkaloxmCMqVUx5CEIYysWejnUaNc7kM73PEDqGDyey61jQHHknFN2 Co2YxtihUNmTVuAkjCuAMQwNFDW1oH2aXjZue9P2n6aNmpe1nbIbZwspYdss3RhPJYLN hZjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685904856; x=1688496856; 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=VJAnB3wQ7FughqK6LyFwMtJAGYslbkQgDXV0PukOLCU=; b=UOrQsAovhqmDLXv7LnllfXqmfOp442C1Gf0bZGC/1pQzjov+3GmmuNR60fQcV+qsei 3PMJmNNnq38ej2+6r33XG3aMD7u77BDcmhbHpHSvafNO8akx27VlUCQGLsi3mGsexQFc Z6NLbHQfROfVpmq9gR84b/HmAxvl4+AjzuH7seqDCx9hM8nl+TywV3u6dD8pw3TDcPZQ tjkYYPvQuJ/0/X/LL2ZA7AZ07PXDL8qg0yciTiQxTiFlaF1hOAxmqKcId/3dPMdCdThS 9QdgHjrmch8Bv4Py3LooC+js0zjyyHr9Ppbg1sC1jd8ddbr2udXyMsJj7jjh0WTNjEh+ Fhng== X-Gm-Message-State: AC+VfDxRUWkvG2YQzCSlqUTQtOHnbac7RVAG3Y6psUBhL1BtR2EjRbeS yL2WeBt308uAvPw3BMCInh08VLcJUg//JcKi X-Received: by 2002:a5d:468d:0:b0:307:9194:9a94 with SMTP id u13-20020a5d468d000000b0030791949a94mr4923534wrq.17.1685904855997; Sun, 04 Jun 2023 11:54:15 -0700 (PDT) Received: from user-PC.. ([178.134.198.138]) by smtp.gmail.com with ESMTPSA id l8-20020a5d4108000000b00304adbeeabbsm7636433wrp.99.2023.06.04.11.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jun 2023 11:54:15 -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 , Ulf Hansson , Marcus Folkesson , Arnd Bergmann , Mike Looijmans , ChiYuan Huang , Ramona Bolboaca , Ibrahim Tilki , ChiaEn Wu , William Breathitt Gray , Haibo Chen , =?UTF-8?q?Leonard=20G=C3=B6hrs?= , Hugo Villeneuve , 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 v3 0/3] Add support for Allwinner GPADC on D1/T113s/R329/T507 SoCs Date: Sun, 4 Jun 2023 21:53:13 +0300 Message-Id: <20230604185336.1943889-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: 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 | 90 ++++++ .../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 | 296 ++++++++++++++++++ 5 files changed, 407 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