From patchwork Thu Jun 1 22:30:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 687859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 213E9C77B7A for ; Thu, 1 Jun 2023 22:31:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbjFAWbf (ORCPT ); Thu, 1 Jun 2023 18:31:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjFAWbe (ORCPT ); Thu, 1 Jun 2023 18:31:34 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06D8B12C; Thu, 1 Jun 2023 15:31:33 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-30aea656e36so1351355f8f.1; Thu, 01 Jun 2023 15:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685658691; x=1688250691; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=osoH9NCUgVkUT2GWNEII1U4b/cNjTB8p6KRKoRqNDT8=; b=naj2UO5gI1HpInnq8r9brslsJi6aK6GHpQ+JlqqQEu8p5t/EllUoZ9IIo+UBfEVF2W tdBt9KF7gLnRoKqjeKOf272ogLec2lO9xM+U1BLL8Bv/8rDKrVUCLYz8GZVgmi3tWRjO vmDqslEbw6nIqWRTObo4r6hIabmWrkBhvA4+sLaE9y0rpwPqTLIapgQhwpMaMEyGFxxh t40jUKAuLCSIu8szr30DhvYUJVMKl2P26TP8NgE2uyybCroHZr2YkUcz45aZhRzkURD9 7LCRmm9IYb17YxdsCzs9EcSwzns8mxTK5etW+friu5lsxH1+9QCgnvJw6sM5ldfk0koe gQIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685658691; x=1688250691; 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=osoH9NCUgVkUT2GWNEII1U4b/cNjTB8p6KRKoRqNDT8=; b=ORa9ZTNUHeOS5Rpa58e8XOsLFGcrwTQG0KBpdkDj3nsEEH7QMLbjqH30pRWMq07nGl ZslEnGWroN8ONY+ee+V00Ax6dppOGZE0gJDYVmJeTy+QBG642wT86j8tASiOu+kJhkK7 w6yOGh/Hpy4o5GaIvR3ulEuwfrlhvTl+fL2GkqRtSCHPvEMwopZ+30u3qpVUdXdU8WxP 61B/h2d4ZHNP2BOrG19Ks8PPl0kSbt0k+F2hOp6Z4JgdVS2VzTMztTLEGnfzQQkQLukE dON5cVhGgvqceswc8ue6VLvUml/73dPAsl2plwHFBPv45tfgxs8/izGMOnq6ulGxoZvn pj+w== X-Gm-Message-State: AC+VfDzf48KYIlR7O+EQWxwhjq9wj+WwWy7pwr/K5/WBVxzOydFBMMV8 aX/0wvxKW983F0HN962Zcc5X3uB0PzvvR1Cz X-Google-Smtp-Source: ACHHUZ4ORFM0ZTf9TzhKeprt3bYgADAf/+yqvqGV4ek3VhH5dOxGcnauozS9O5zvjkrLTY1DpL0VFA== X-Received: by 2002:adf:e810:0:b0:306:31e0:958 with SMTP id o16-20020adfe810000000b0030631e00958mr2445035wrm.15.1685658690884; Thu, 01 Jun 2023 15:31:30 -0700 (PDT) Received: from user-PC.. ([178.134.198.138]) by smtp.gmail.com with ESMTPSA id b7-20020a5d4d87000000b0030af8da022dsm8619149wru.44.2023.06.01.15.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 15:31:30 -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 , Andre Przywara , Andy Shevchenko , Cosmin Tanislav , AngeloGioacchino Del Regno , Ulf Hansson , ChiaEn Wu , William Breathitt Gray , ChiYuan Huang , Ramona Bolboaca , Ibrahim Tilki , Arnd Bergmann , Mike Looijmans , =?utf-8?q?Leonard_G=C3=B6hrs?= , 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 v2 0/3] Add support for Allwinner GPADC on D1/T113s/R329/T507 SoCs Date: Fri, 2 Jun 2023 01:30:38 +0300 Message-Id: <20230601223104.1243871-1-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@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: 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 | 79 +++++ .../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, 396 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml create mode 100644 drivers/iio/adc/sun20i-gpadc-iio.c