From patchwork Wed May 24 08:27:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 13253464 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BCAF5C77B73 for ; Wed, 24 May 2023 08:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BY3PJ6UMsdqZgz8Kn/rUUGN2DJVtV9/rugxe1He5PA8=; b=thPOwgK5LR55Bh ZLFD37m8cDQqSf4a2M13Av4CGt9yx+3IaGbsIBoLZP5PRTI5JEe5moEzALQOc4ypNtGN+KKHucF7e yqPz8I+j/i6mBzkQ3nlJTOV0eiI98NpEFlYaFLuWDHaZPfSreWgN71WP44B4sZtsslqngSzGDU7/o 98rBl5xM1/U6oUMjfgYvHlM+oX0l9a5Ywhd7DbUMOgbwGyjD4W4qpkO8omD5+avlq9WEQl2Oryx1H rGpIfrBkrkb+jnjTatl1nKNX6cpTBYLsTZlgKXxjZ71cvVR0AapJhPN5kIGX860zp2R4GQhvY9X/y OgtU+FCSz7Vm0CHBAaIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1jqy-00ClgV-2V; Wed, 24 May 2023 08:28:16 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1jqv-00Cldq-1Z; Wed, 24 May 2023 08:28:15 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f00d41df22so538502e87.1; Wed, 24 May 2023 01:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684916889; x=1687508889; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=osnOavSsk98TUDjHTJwPWXq2uSv8s7QQTLJ3OkNyh0I=; b=nj5uJPaEmivMiNT5VmRx00/kGtbggoQPnWlbVh9M+cowFSkxReKMNXY2f9a/kkau/5 ejFKhW1g4w1DFlFSrDyEqfHB6CCYG1YO0aH7q75S1Z5ffKUm7D5jU6cYuuirke5d/Wa7 g5zokwlTfIbjJHThnUZwA6iITh5Z1TcWSWcrA12VdgTzFzMDjNnu36zBli75zhZbBBWQ oime7R+W5rIg//TZMr77QelF7K5LyMFGMRTXU7oBKUsji4HuE+LodkewQChoA2o160w3 fRPhEtKNQqP2FITjHfDm+jq6vH7t/GEY0OymzMTyalB/e/v3biyrL5XY55nVNI2sQalU GBaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684916889; x=1687508889; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=osnOavSsk98TUDjHTJwPWXq2uSv8s7QQTLJ3OkNyh0I=; b=kmUQ9nrDYyUuCNVeDQOZiyQKpVd9IuRWbG2IOMpNXUqH30/+V2eDgPsNpx5zi/Zi37 FPLmx0q/jsHMSysLMqMb7EdXY+09oOTKq8/xIVVEE4KuVZExxXg3GCCr5kVvDtZQMbm8 GNVXbDxiaZ99DHgDCTC5YTINcejNMGSMipULosLxG2NBzu7yGKhe3rlv6nCIdOPTCwve +gXdcoF9woEOGdhsSXncNr6g5tM76X0IHL3WMOQlr7HG+7taeQAerIuXzv4fRnKkV6EZ i3TwVlwMJcThnYX/DUClibLJ6KXVwLPZmNUNo/zu//qFjxykiY71ZYqc+yhtLI5UPLaK fGkA== X-Gm-Message-State: AC+VfDzi84vSbeLVEb4U1W/M8FOwKQdOZn0lT8yjZYP+gmgYgAD1kNZ9 6QKNANsWVe7roTxlczTm3rc= X-Google-Smtp-Source: ACHHUZ7znBMI2spbfm42agpR8faVqbUxwRZ03QsQcarwcNlEBuuhE1Q7UjE9YBW3PEPL+huDJUV6pQ== X-Received: by 2002:a05:6512:210:b0:4f3:b9c8:5da with SMTP id a16-20020a056512021000b004f3b9c805damr3370373lfo.33.1684916888890; Wed, 24 May 2023 01:28:08 -0700 (PDT) Received: from pc.. (mail.pulsar-telecom.ru. [94.181.180.60]) by smtp.googlemail.com with ESMTPSA id c18-20020a197612000000b004f378fbb358sm1614049lff.112.2023.05.24.01.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 01:28:08 -0700 (PDT) From: Maxim Kiselev To: linux-iio@vger.kernel.org Cc: Maxim Kiselev , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Andre Przywara , Andy Shevchenko , Cosmin Tanislav , Haibo Chen , ChiYuan Huang , Ramona Bolboaca , Ibrahim Tilki , ChiaEn Wu , William Breathitt Gray , Arnd Bergmann , AngeloGioacchino Del Regno , Caleb Connolly , 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: [RFC PATCH v1 1/4] iio: adc: Add Allwinner D1/T113s/R329 SoCs GPADC Date: Wed, 24 May 2023 11:27:30 +0300 Message-Id: <20230524082744.3215427-2-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524082744.3215427-1-bigunclemax@gmail.com> References: <20230524082744.3215427-1-bigunclemax@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230524_012813_524726_11B1ABB3 X-CRM114-Status: GOOD ( 26.38 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The General Purpose ADC (GPADC) can convert the external signal into a certain proportion of digital value, to realize the measurement of analog signal, which can be applied to power detection and key detection. D1, T113s and R329 contain this GPADC IP. The only difference between this SoCs is the number of available channels: T113 - 1 channel D1 - 2 channels R329 - 4 channels Signed-off-by: Maxim Kiselev --- drivers/iio/adc/Kconfig | 10 ++ drivers/iio/adc/Makefile | 1 + drivers/iio/adc/sun20i-gpadc-iio.c | 275 +++++++++++++++++++++++++++++ 3 files changed, 286 insertions(+) create mode 100644 drivers/iio/adc/sun20i-gpadc-iio.c diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index eb2b09ef5d5b..988804f46bf6 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -1123,6 +1123,16 @@ config SUN4I_GPADC To compile this driver as a module, choose M here: the module will be called sun4i-gpadc-iio. +config SUN20I_GPADC + tristate "Support for the Allwinner SoCs GPADC" + depends on ARCH_SUNXI || COMPILE_TEST + help + Say yes here to build support for Allwinner (D1, T113 and R329) SoCs + GPADC. This ADC provides up to 4 channels. + + To compile this driver as a module, choose M here: the module will be + called sun20i-gpadc-iio. + config TI_ADC081C tristate "Texas Instruments ADC081C/ADC101C/ADC121C family" depends on I2C diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index e07e4a3e6237..fc4ef71d5f8f 100644 --- a/drivers/iio/adc/Makefile +++ b/drivers/iio/adc/Makefile @@ -95,6 +95,7 @@ obj-$(CONFIG_RZG2L_ADC) += rzg2l_adc.o obj-$(CONFIG_SC27XX_ADC) += sc27xx_adc.o obj-$(CONFIG_SPEAR_ADC) += spear_adc.o obj-$(CONFIG_SUN4I_GPADC) += sun4i-gpadc-iio.o +obj-$(CONFIG_SUN20I_GPADC) += sun20i-gpadc-iio.o obj-$(CONFIG_STM32_ADC_CORE) += stm32-adc-core.o obj-$(CONFIG_STM32_ADC) += stm32-adc.o obj-$(CONFIG_STM32_DFSDM_CORE) += stm32-dfsdm-core.o diff --git a/drivers/iio/adc/sun20i-gpadc-iio.c b/drivers/iio/adc/sun20i-gpadc-iio.c new file mode 100644 index 000000000000..90f3bb2e41cd --- /dev/null +++ b/drivers/iio/adc/sun20i-gpadc-iio.c @@ -0,0 +1,275 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * GPADC driver for sunxi platforms (D1, T113-S3 and R329) + * Copyright (c) 2023 Maksim Kiselev + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SUN20I_GPADC_SR 0x00 + +#define SUN20I_GPADC_CTRL 0x04 +#define SUN20I_GPADC_CTRL_ADC_FIRST_DLY ((GENMASK(7, 0) & (x)) << 24) +#define SUN20I_GPADC_CTRL_ADC_AUTOCALI_EN BIT(23) +#define SUN20I_GPADC_CTRL_ADC_OP_BIAS ((GENMASK(1, 0) & (x)) << 20) +#define SUN20I_GPADC_CTRL_WORK_MODE_SELECT(x) ((GENMASK(1, 0) & (x)) << 18) +#define SUN20I_GPADC_CTRL_ADC_CALI_EN BIT(17) +#define SUN20I_GPADC_CTRL_ADC_EN BIT(16) + +#define SUN20I_GPADC_CS_EN 0x08 +#define SUN20I_GPADC_CS_EN_ADC_CHAN_CMP_EN(x) ((GENMASK(16, 0) & BIT(x)) << 16) +#define SUN20I_GPADC_CS_EN_ADC_CHAN_SELECT(x) (GENMASK(16, 0) & BIT(x)) + +#define SUN20I_GPADC_DATA_INTC 0x28 +#define SUN20I_GPADC_DATA_INTC_CHAN_DATA_IRQ_EN(x) (GENMASK(16, 0) & BIT(x)) + +#define SUN20I_GPADC_DATA_INTS 0x38 +#define SUN20I_GPADC_DATA_INTS_DATA_PENDING(x) (GENMASK(16, 0) & BIT(x)) +#define SUN20I_GPADC_DATA_INTS_DATA_PENDING_MASK GENMASK(16, 0) + +#define SUN20I_GPADC_CHAN_DATA(x) (0x80 + (x) * 4) + +#define SUN20I_GPADC_TIMEOUT msecs_to_jiffies(100) +#define SUN20I_GPADC_MAX_CHANNELS 16 + +struct sun20i_gpadc_configuration { + const struct iio_chan_spec *channels; + u8 num_channels; +}; + +struct sun20i_gpadc_iio { + struct iio_dev *indio_dev; + struct regmap *regmap; + struct completion completion; + struct mutex lock; +}; + +#define SUN20I_GPADC_ADC_CHANNEL(_channel) { \ + .type = IIO_VOLTAGE, \ + .indexed = 1, \ + .channel = _channel, \ + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ +} + +static const struct iio_chan_spec sun8i_t113_gpadc_channels[] = { + SUN20I_GPADC_ADC_CHANNEL(0), +}; + +static const struct iio_chan_spec sun20i_d1_gpadc_channels[] = { + SUN20I_GPADC_ADC_CHANNEL(0), + SUN20I_GPADC_ADC_CHANNEL(1), +}; + +static const struct iio_chan_spec sun50i_r329_gpadc_channels[] = { + SUN20I_GPADC_ADC_CHANNEL(0), + SUN20I_GPADC_ADC_CHANNEL(1), + SUN20I_GPADC_ADC_CHANNEL(2), + SUN20I_GPADC_ADC_CHANNEL(3), +}; + +static const struct sun20i_gpadc_configuration sun20i_gpadc_config[] = { + { sun8i_t113_gpadc_channels, ARRAY_SIZE(sun8i_t113_gpadc_channels) }, + { sun20i_d1_gpadc_channels, ARRAY_SIZE(sun20i_d1_gpadc_channels) }, + { sun50i_r329_gpadc_channels, ARRAY_SIZE(sun50i_r329_gpadc_channels) }, +}; + +static const struct regmap_config sun20i_gpadc_regmap_config = { + .reg_bits = 32, + .val_bits = 32, + .reg_stride = 4, + .fast_io = true, +}; + +static int sun20i_gpadc_adc_read(struct sun20i_gpadc_iio *info, + struct iio_chan_spec const *chan, int *val) +{ + reinit_completion(&info->completion); + + /* enable the analog input channel */ + regmap_write(info->regmap, SUN20I_GPADC_CS_EN, + SUN20I_GPADC_CS_EN_ADC_CHAN_SELECT(chan->channel)); + + /* enable the data irq for input channel */ + regmap_write(info->regmap, SUN20I_GPADC_DATA_INTC, + SUN20I_GPADC_DATA_INTC_CHAN_DATA_IRQ_EN(chan->channel)); + + /* enable the ADC function */ + regmap_update_bits(info->regmap, SUN20I_GPADC_CTRL, + SUN20I_GPADC_CTRL_ADC_EN, SUN20I_GPADC_CTRL_ADC_EN); + + if (!wait_for_completion_timeout(&info->completion, + SUN20I_GPADC_TIMEOUT)) + return -ETIMEDOUT; + + /* read the ADC data */ + regmap_read(info->regmap, SUN20I_GPADC_CHAN_DATA(chan->channel), val); + + return IIO_VAL_INT; +} + +static int sun20i_gpadc_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int *val, + int *val2, long mask) +{ + struct sun20i_gpadc_iio *info = iio_priv(indio_dev); + int ret; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + mutex_lock(&info->lock); + ret = sun20i_gpadc_adc_read(info, chan, val); + mutex_unlock(&info->lock); + return ret; + case IIO_CHAN_INFO_SCALE: + /* 1800mV / 4096 * raw */ + *val = 0; + *val2 = 439453125; + return IIO_VAL_INT_PLUS_NANO; + default: + return -EINVAL; + } +} + +static irqreturn_t sun20i_gpadc_irq_handler(int irq, void *data) +{ + struct sun20i_gpadc_iio *info = data; + u32 reg; + + /* clear data interrupt status register */ + regmap_read(info->regmap, SUN20I_GPADC_DATA_INTS, ®); + regmap_write(info->regmap, SUN20I_GPADC_DATA_INTS, reg); + + complete(&info->completion); + + return IRQ_HANDLED; +} + +static const struct iio_info sun20i_gpadc_iio_info = { + .read_raw = sun20i_gpadc_read_raw, +}; + +static int sun20i_gpadc_probe(struct platform_device *pdev) +{ + const struct sun20i_gpadc_configuration *config; + struct iio_dev *indio_dev; + struct sun20i_gpadc_iio *info; + struct reset_control *rst; + void __iomem *base; + struct clk *clk; + int irq; + int ret; + + indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*info)); + if (!indio_dev) + return -ENOMEM; + + info = iio_priv(indio_dev); + platform_set_drvdata(pdev, indio_dev); + + mutex_init(&info->lock); + init_completion(&info->completion); + + info->indio_dev = indio_dev; + indio_dev->info = &sun20i_gpadc_iio_info; + indio_dev->name = dev_name(&pdev->dev); + + config = of_device_get_match_data(&pdev->dev); + if (!config) + return -ENODEV; + + /* Sanity check for possible later IP variants with more channels */ + if (config->num_channels > SUN20I_GPADC_MAX_CHANNELS) + return dev_err_probe(&pdev->dev, -EINVAL, + "max channels exceeded\n"); + + indio_dev->channels = config->channels; + indio_dev->num_channels = config->num_channels; + + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + info->regmap = devm_regmap_init_mmio(&pdev->dev, base, + &sun20i_gpadc_regmap_config); + if (IS_ERR(info->regmap)) + return dev_err_probe(&pdev->dev, PTR_ERR(info->regmap), + "failed to init regmap\n"); + + clk = devm_clk_get_enabled(&pdev->dev, NULL); + if (IS_ERR(clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(clk), + "failed to enable bus clock\n"); + + rst = devm_reset_control_get_exclusive(&pdev->dev, NULL); + if (IS_ERR(rst)) + return dev_err_probe(&pdev->dev, PTR_ERR(rst), + "failed to get reset control\n"); + + ret = reset_control_deassert(rst); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to deassert reset\n"); + + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return dev_err_probe(&pdev->dev, irq, "failed to get irq\n"); + + ret = devm_request_irq(&pdev->dev, irq, sun20i_gpadc_irq_handler, + 0, dev_name(&pdev->dev), info); + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, + "failed requesting irq %d\n", irq); + + /* set the single conversion mode and enable auto calibration*/ + regmap_write(info->regmap, SUN20I_GPADC_CTRL, + SUN20I_GPADC_CTRL_ADC_AUTOCALI_EN | + SUN20I_GPADC_CTRL_WORK_MODE_SELECT(0)); + + ret = devm_iio_device_register(&pdev->dev, indio_dev); + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, + "could not register the device\n"); + + return 0; +} + +static const struct of_device_id sun20i_gpadc_of_id[] = { + { + .compatible = "allwinner,sun8i-t113-gpadc", + .data = &sun20i_gpadc_config[0], + }, + { + .compatible = "allwinner,sun20i-d1-gpadc", + .data = &sun20i_d1_gpadc_channels[1] + }, + { + .compatible = "allwinner,sun50i-r329-gpadc", + .data = &sun50i_r329_gpadc_channels[2] + }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, sun20i_gpadc_of_id); + +static struct platform_driver sun20i_gpadc_driver = { + .driver = { + .name = "sun20i-gpadc-iio", + .of_match_table = sun20i_gpadc_of_id, + }, + .probe = sun20i_gpadc_probe, +}; +module_platform_driver(sun20i_gpadc_driver); + +MODULE_DESCRIPTION("ADC driver for sunxi platforms"); +MODULE_AUTHOR("Maksim Kiselev "); +MODULE_LICENSE("GPL"); From patchwork Wed May 24 08:27:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 13253465 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5FCF1C7EE31 for ; Wed, 24 May 2023 08:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bk6O5+zTBNYtPaLiYYN0Dh9GwkUaOPbfTjBxvwd0I/k=; b=YMcOCvGUxy8Rt6 ohXxlkEMEWq4rzvCiLQ2Mrq1tnlUIhI+TkJ+4T2IttafmtMTiGPGkxzNLhm0/+LwQehmzjjM9yhMS HREDMKYXiRYiv0zQFdRUGAAk/jnylb39XOA8/g46X8Ow4FtPVLRb+V/0ZmL2VtwEj61qHN4zWOt2u 4p/fuRB5pjD0kafAVr/1gsS6KFriGQk+AiPwjguPD7pw4qw5X0jVcXj2CldQTuYBtgC/ewwg8J0vH yqHL0HROjQ2i/9l7EGPwYCyUFY8SRW3+dSDEFjkf3Fvj9+riQyUenB5lOPqSEe6jzspBCJoFS2Yvu MLx2d1UrcA2FJ0/tDg8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1jrB-00Clmc-00; Wed, 24 May 2023 08:28:29 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1jr8-00Clji-0Z; Wed, 24 May 2023 08:28:27 +0000 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f3b9e54338so556270e87.0; Wed, 24 May 2023 01:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684916902; x=1687508902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hrS6J4pV0coQ+gQom7MH+SioGRxETEVrxo2OAGKB9UE=; b=Wp45ILdc8S9OXc+cImPVKO27PSEBOIBByFPbuQB7O2vpLLXzhnD9uRNuBXLRTxwGpU cNT4FJ+s53khsy2HEeuSuEDFVYXN5wsdg4bWxBQjrkJhK8olA725Ka1ugjODmTtI99D5 YlGn/dBPtbTwzaXM6gGBRr8W3k5vg6R1fTz3K36/IMf37xY/x2yyZXt7aCHIqyGEa1X7 fN24oiLlCoD3MuID/phya/rxexQ+buuEhUUXW8F5NBrm4m5V3yYB0sx8blcbnBMuaHMU QvKNEhoQs3clyU0/DxjEPVxWSZfGuAPiE35aZDWLb4jIBRALN9+cND3rdi/ljl1xKxQD TPdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684916902; x=1687508902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hrS6J4pV0coQ+gQom7MH+SioGRxETEVrxo2OAGKB9UE=; b=Y5Axjb6bNJki2QZ3pE2qcg3wbRQyXRdhEAv9OPTWrCdEKaV4xr2cqgwezoigS3OODF UyCZ69z3Sd5+v0qvdEzh0g+/UA5em3aTkXIxiEJhHIY72R3NCKo2AyCAX78sSDZIwX2d mWYGVaXu/fsTkEFndecHF+Y/V2NZPcf6UGxyeChpxJkzO8+zSx9wt0ieO14da+7CKsXY A6EFW/xZVHpO2DMVsdWcLr5UW48PqyxBsg1cCUt2r6WWC42vrSzPT1qrOTLAjcIemF2v meYPYdMJRzk3SAJ7KY47+auqUN+3sKc5vUm1eHV7eN0kkE+QXYHU3zYCHo/96EcqRkVj bEdg== X-Gm-Message-State: AC+VfDx80nVluLkrqDwMnxwnrMHQmHnPzVe9tYidnKiPG+eb4lTTY2jd XeldpdXZl0opH1fP3DdKdiE= X-Google-Smtp-Source: ACHHUZ7axExQO5CjwKA+zfRpIGZMvtRy9svKqMaQMYLrRELvYOecD6DCbAVtj4XXyKwrnSyPU4uzBg== X-Received: by 2002:ac2:5298:0:b0:4f3:b1dc:b46b with SMTP id q24-20020ac25298000000b004f3b1dcb46bmr4567055lfm.1.1684916902079; Wed, 24 May 2023 01:28:22 -0700 (PDT) Received: from pc.. (mail.pulsar-telecom.ru. [94.181.180.60]) by smtp.googlemail.com with ESMTPSA id c18-20020a197612000000b004f378fbb358sm1614049lff.112.2023.05.24.01.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 01:28:21 -0700 (PDT) From: Maxim Kiselev To: linux-iio@vger.kernel.org Cc: Maxim Kiselev , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Andre Przywara , Heiko Stuebner , Andy Shevchenko , Cosmin Tanislav , Miquel Raynal , Alexander Sverdlin , Ramona Bolboaca , William Breathitt Gray , ChiYuan Huang , Ibrahim Tilki , Caleb Connolly , Arnd Bergmann , Mike Looijmans , ChiaEn Wu , Haibo Chen , 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: [RFC PATCH v1 2/4] dt-bindings: iio: adc: Add Allwinner D1/T113s/R329 SoCs GPADC Date: Wed, 24 May 2023 11:27:31 +0300 Message-Id: <20230524082744.3215427-3-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524082744.3215427-1-bigunclemax@gmail.com> References: <20230524082744.3215427-1-bigunclemax@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230524_012826_212963_7C2C22C9 X-CRM114-Status: GOOD ( 13.54 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Allwinner's D1, T113s and R329 SoCs have a new general purpose ADC. This ADC is the same for all of this SoCs. The only difference is the number of available channels. Signed-off-by: Maxim Kiselev --- .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml new file mode 100644 index 000000000000..a79b874750dd --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/allwinner,sun20i-d1-gpadc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner D1 General Purpose ADC + +properties: + "#io-channel-cells": + const: 0 + + clocks: + maxItems: 1 + + compatible: + enum: + - allwinner,sun20i-d1-gpadc + - allwinner,sun8i-t113-gpadc + - allwinner,sun50i-r329-gpadc + + interrupts: + maxItems: 1 + + reg: + maxItems: 1 + + resets: + maxItems: 1 + +required: + - "#io-channel-cells" + - clocks + - compatible + - interrupts + - reg + - resets + +additionalProperties: false + +examples: + - | + gpadc: adc@2009000 { + compatible = "allwinner,sun20i-d1-gpadc"; + reg = <0x2009000 0x1000>; + clocks = <&ccu CLK_BUS_GPADC>; + resets = <&ccu RST_BUS_GPADC>; + interrupts = ; + #io-channel-cells = <0>; + }; + +... From patchwork Wed May 24 08:27:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 13253466 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A855C7EE2C for ; Wed, 24 May 2023 08:28:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f5Puv2JyVKtFKN4r7Gv7g0yg/84vmCJCZmFIPObpbWY=; b=WZ/fM7r8OKwJZC +wG5sdcJlNtRCsPFhbmOKJpnpXnzW6CC6esRySHyVbmUN4XvMCufzSs0ExhYDA1ql66FAIQKDiRwj ZPodbML32DdhWHtkJawPPnIxqXjhcEzuRqsFx6RaSZqaqVwHn+CZBmy4Ez6yBKtubvC13rGjwyuYK YHfincH6C2pA53eysuWHqMpqnFoEfV1xJ7ZnmtzCnLdIRfMe/9aBuzh/MUAw21DnYysvo8rgVVPth f/EzSJaykLupi6Thn5YSVsYvk84I4ZrFaHZsK3Zd+hg/LnRNNGOwZpA2SQSViNVQL3FHilzCDe09T BcQqesTblvwiJLwTqaIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1jrR-00ClvD-0l; Wed, 24 May 2023 08:28:45 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1jrI-00ClqB-2R; Wed, 24 May 2023 08:28:39 +0000 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f004cc54f4so571353e87.3; Wed, 24 May 2023 01:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684916915; x=1687508915; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j3ShG8niWENBdEZ1rwxaaLlhweWqDlNMQKSkikRPmcw=; b=YSChDKRWS6Imw1L0SeB0IN6ZuM+a/H/oZ9Dr2NBh8Z3CYULLmn3sKhuyvZ4Tq1uXiB zeCRhi/rmvG0Cy3xXJru0pCR9BDM1JpS7dakQIrY+ocdIHdWwLJMTRbKdo+cXDdcA0vA 8Y160G8RlYOxsUBYwoSDVLppHrG8SJ+BQFb1Lk5amAtVRzIFEhNcyR8EIApjB5qnwx92 2zqb2AZeLegtoXywRVYy4nZnklQ7BXaotneUPeAHSJGjeJyOnsP0JvyI15xaXkOKSF1J 4T76Cj6EKqyHICQzEJJNwU7Il+vyNyd/7lZWvWQ+ig7xb9TFEzjRhmw3KpU7uqAvxLA+ dgHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684916915; x=1687508915; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j3ShG8niWENBdEZ1rwxaaLlhweWqDlNMQKSkikRPmcw=; b=TUztJ5r619F+OHOSOmdQLEFlhACVyhIeMcpKmNP7sZj3cBqj05OR5S55qwS3DIKDNS Y1kD40shYcKpjX5qiyg66++BjbvdKuWD9mSd5h2lu8KrGddx+ZJ/0HxKDPNgAsbQ7f42 iP4N0zmr4OGDF4VuNgTEpX+pAxDFbwSsVihc1xY4wWsn/VI+AhKe/htTTi7TN/Pyd64J 9QqzlgUr9K5/OJiT56MLkWjMvpa+/PSF2D1bdrxR17m2VFzHXA/28BiuyBUxW5LPZTPB G1qDRXRMZxRJmo99G6Nb/97Y4aj5wV+7899ljHyLNyRNWrIjDklWdk1MPY6FeE7UJ7jt 3GHQ== X-Gm-Message-State: AC+VfDzHIEbZDieHRcYmE4kIC02vFZKAprjRI7WFk5JcqUewtpQkeeUh IVqrz1e7F0r/qAaWwurWEjo= X-Google-Smtp-Source: ACHHUZ7ERw8MQIwxgY0PwdFaFK9FxBnMmNFE63p+EPeuqhKlwikM0km3o8U8SsH82QTzyVLrEzpGCw== X-Received: by 2002:ac2:4a68:0:b0:4f4:b378:469d with SMTP id q8-20020ac24a68000000b004f4b378469dmr2500468lfp.41.1684916915157; Wed, 24 May 2023 01:28:35 -0700 (PDT) Received: from pc.. (mail.pulsar-telecom.ru. [94.181.180.60]) by smtp.googlemail.com with ESMTPSA id c18-20020a197612000000b004f378fbb358sm1614049lff.112.2023.05.24.01.28.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 01:28:34 -0700 (PDT) From: Maxim Kiselev To: linux-iio@vger.kernel.org Cc: Maxim Kiselev , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Andre Przywara , Andy Shevchenko , Cosmin Tanislav , ChiaEn Wu , Ramona Bolboaca , ChiYuan Huang , Ibrahim Tilki , Caleb Connolly , William Breathitt Gray , Arnd Bergmann , Mike Looijmans , =?utf-8?q?Leonard_G=C3=B6hrs?= , 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: [RFC PATCH v1 3/4] ARM: dts: sun8i: t113s: Add GPADC node Date: Wed, 24 May 2023 11:27:32 +0300 Message-Id: <20230524082744.3215427-4-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524082744.3215427-1-bigunclemax@gmail.com> References: <20230524082744.3215427-1-bigunclemax@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230524_012836_793297_3017C68E X-CRM114-Status: GOOD ( 10.60 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This patch adds declaration of the general purpose ADC with one channel for T113s SoC. Signed-off-by: Maxim Kiselev --- arch/arm/boot/dts/sun8i-t113s.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-t113s.dtsi b/arch/arm/boot/dts/sun8i-t113s.dtsi index 804aa197a24f..d269fdde330d 100644 --- a/arch/arm/boot/dts/sun8i-t113s.dtsi +++ b/arch/arm/boot/dts/sun8i-t113s.dtsi @@ -42,6 +42,18 @@ gic: interrupt-controller@1c81000 { #interrupt-cells = <3>; }; + soc { + gpadc: adc@2009000 { + compatible = "allwinner,sun8i-t113-gpadc"; + reg = <0x2009000 0x1000>; + clocks = <&ccu CLK_BUS_GPADC>; + resets = <&ccu RST_BUS_GPADC>; + interrupts = ; + status = "disabled"; + #io-channel-cells = <0>; + }; + }; + timer { compatible = "arm,armv7-timer"; interrupts = , From patchwork Wed May 24 08:27:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 13253467 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C070C77B7A for ; Wed, 24 May 2023 08:29:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Z/cKxRklTEG1WfHzL+8fBQ+IiaGgm1v0hxWxDj1+Usg=; b=gNREUzfBrR/lLB c0vM0+evYZoEIwfSqSYNPm8yS4BsyAAtLsEsaaFYBtWJU+Ll996bPlXaZMAaJnERhai8xkhU6q/zG W0X8BbibIFV8Hr4yX9O+UJ/3KJ3iMrfpyA8N+dYCHxroypAvZnTcxAFs058XJUDuB43nuFMbn3knh dQP2LhMW179hlrHaVUO6gV+Y+G/OBQu+xL/h1I4+574ickw2vWfwqJR+D1d1ZIr53IkyzXHC5h12o ihezfV6WxDnyhKqAX8DHxvdFApNK5Dgum7AgqaCjNlYByaJ7sZuRvzBcTt82TtOR8jNHaAMmIQFds S+t/UDEBXJpat6TLkXHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1jrc-00Cm1f-03; Wed, 24 May 2023 08:28:56 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1jrX-00Clxc-2m; Wed, 24 May 2023 08:28:53 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f3b39cea1eso556888e87.3; Wed, 24 May 2023 01:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684916928; x=1687508928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=odFoqtaACFFyMrXmxlrRHYMZnaIGXqlcjA/Yeo/eMSM=; b=Mvd/veDyjuxX8uDcTR8PI4Xqf4ovhcjx5jyKNU3IYsLv4K4TWPiwQuH7PXLRUsd1lc FyfsPiUqwOq7sGQfZ10bL3H78meCp0oJsj12w7ytR5d0mG3wDlkzIA9amxl0LHWmdIa0 nXTGfbb9SYE29Q/mKKsF9fX2N4Xee3qGLqoiTf3mpGpaRyyJf2VzepfVXB0Fj6tjE84u Wre8p0Iu75GJoNJ32N0Rhj8avsw8FRrCTbcV0NFk4oNtz1jQj3MslC3Ps8lUxtC0cQd/ 6c9GVZxKAzA3NmOekitk+/TRT6AuwtmWI3YkDMpKlpGigNvSnPkbhU9lCm7b0LEp42gX ThBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684916928; x=1687508928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=odFoqtaACFFyMrXmxlrRHYMZnaIGXqlcjA/Yeo/eMSM=; b=iLwTiD6eBFy5jP1ubDSlLXTT1+QLbYGEkqXYlBbAZRihlhCKIf6xLURObHAkmuum+n LBgcAw/hEX7tbvvUh72JfQyZjwgNwVkGlD0D49CW0BEpmMUBmfLX2wCdcsCNfAhBC9/n X1tqRei9FMu+eea+c2RPse1qYkApURXE8NKWq1xDs0HlLfScKfe6HMZyKbfYxr3LgNjp zVkHzZMHJkWjuL/rnvGJYw47AVbw3+hBM1AUsMsPoAx0nsXAPtq0Du4WRfLk8XrgYhrZ uM4oqYhKNOhYlBpwZdhzntbEBu38CwFvBZZYo2qVT1EZzIzAJXJ9TYvlYDAN89jaX0Ds CrbQ== X-Gm-Message-State: AC+VfDwJz132kXjAS2QQ1RXm9rBPV6BETZTbKtZ2n699Szd1/PWOmDb0 BoRVrYQkf/7hf15Apk+zHn4= X-Google-Smtp-Source: ACHHUZ7nTj6ZzaR2KWD9boDc/9z2PyjWBCXVB7avQ4mYjB8ldUrHEw92byKyfbq/IsC5bWV5bsz3dQ== X-Received: by 2002:ac2:596a:0:b0:4f1:3ae6:20bf with SMTP id h10-20020ac2596a000000b004f13ae620bfmr5776396lfp.1.1684916928480; Wed, 24 May 2023 01:28:48 -0700 (PDT) Received: from pc.. (mail.pulsar-telecom.ru. [94.181.180.60]) by smtp.googlemail.com with ESMTPSA id c18-20020a197612000000b004f378fbb358sm1614049lff.112.2023.05.24.01.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 01:28:48 -0700 (PDT) From: Maxim Kiselev To: linux-iio@vger.kernel.org Cc: Maxim Kiselev , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Heiko Stuebner , Andre Przywara , Andy Shevchenko , Cosmin Tanislav , Marcus Folkesson , Alexander Sverdlin , Arnd Bergmann , Hugo Villeneuve , Mike Looijmans , ChiYuan Huang , Ramona Bolboaca , Ibrahim Tilki , ChiaEn Wu , William Breathitt Gray , Caleb Connolly , Haibo Chen , =?utf-8?q?Leonard_G=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: [RFC PATCH v1 4/4] riscv: dts: allwinner: d1: Add GPADC node Date: Wed, 24 May 2023 11:27:33 +0300 Message-Id: <20230524082744.3215427-5-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524082744.3215427-1-bigunclemax@gmail.com> References: <20230524082744.3215427-1-bigunclemax@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230524_012851_906734_3F5F29FA X-CRM114-Status: GOOD ( 10.36 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This patch adds declaration of the general purpose ADC with two channel for D1 SoC. Signed-off-by: Maxim Kiselev --- arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi b/arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi index 97e7cbb32597..b21825429cca 100644 --- a/arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi @@ -6,6 +6,16 @@ / { soc { + gpadc: adc@2009000 { + compatible = "allwinner,sun20i-d1-gpadc"; + reg = <0x2009000 0x1000>; + clocks = <&ccu CLK_BUS_GPADC>; + resets = <&ccu RST_BUS_GPADC>; + interrupts = ; + status = "disabled"; + #io-channel-cells = <0>; + }; + lradc: keys@2009800 { compatible = "allwinner,sun20i-d1-lradc", "allwinner,sun50i-r329-lradc";