From nobody Sun Feb 8 13:40:13 2026 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A173421422B; Thu, 1 May 2025 10:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746093700; cv=none; b=K5yhoSfWEAaCy1+3ULoCEicBEigpmpxImWSrP7uKvQopdvvZieS/BxnQKUsWOROynTrnwtbskBrgGvMzxe2xZE4LfZrA2MDettVuh4XITF+oaePG/AkZcLpjnZ//s27ppSUHHnhRpEyn8CeGZB73ppY87R9L5dNkHkvLwhZOvFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746093700; c=relaxed/simple; bh=j3UiZr5I0BZ0R0iZxPPxb6ntqJ2vhywnYgSy7Jt1j9w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=p90AVryGaDGdDR05QM+xgDKGxqqXRyZWLd2JWW/UMCK5Om693hL0nvBHe01MFhZnw3dQnROxXMWVctZfBGrlGUIvrk7+roOEIWxr1tWQ7XJfVsTk0pOJb+O+IGrY7IhTDSn9tB4GGJaD+m8hrg7mmCbhRVlFmidHANHKkXu1NA8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ndzVYNdZ; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ndzVYNdZ" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-30155bbbed9so711259a91.1; Thu, 01 May 2025 03:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746093698; x=1746698498; darn=vger.kernel.org; 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=mc8onLY2LGr4PGgeqQsnCbETY9vwRghe23s2uHPKPqY=; b=ndzVYNdZH2CzexCwj2keHER27t0tmkdz2zJnJCYe7KtveReSw+khI0WgpoakeAGiBI MuVebHuceqmegEY/8obqgala40ONPGOHkLcMqN631Cen4M6ZHtyEt98RvYPPNu+6DOag G9SmG2NohuXTvvBoW2Kfqu697+j8Ihunp28CJCEqpxPR2TVGh66dbscVQLpYT5OapWZE tIeZinmgasQL6ctLgL0wK+734H8g4NpVXfATE9Hn1ewjQVQOsXT+7EXqnzLe9d35jgk3 xlxJv6CNIsdPnMaLeUAgALocPyZbCEkCm1k8iY9BNigJCVbDXxQEgE34Q6t8HF9+zsGJ k4UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746093698; x=1746698498; 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=mc8onLY2LGr4PGgeqQsnCbETY9vwRghe23s2uHPKPqY=; b=sohKVRWH43Yt1/T+cV18ge+70Frvb6LKFlFUmlQb289CmTKSHAtckqpVvsxQwH0apU +UW30swxGRS+zVuE945LiBD21Eia9wM+JvWpnQnHw63cpEM32I3BUjEXGtEbXI5+xpS6 A0cvjxsSfZ5N6fO4IiMCNxxX9q/4mFTKMd+5Flkmk/feLJnp+hex8J3FJV/UwCJZFI3a j2NLMSW23rFNMQwC0u9i2eVlwe3bJFfuF0opJLHPGeWCDKgqCeO/ri0tcXR7oSEG9nJY kRgKpov2nqc3xu14pZPKI/JFSU70FLuPUVeO+EQHX9bke0gdV2dJNmP4TC5762KchhCL cfOw== X-Forwarded-Encrypted: i=1; AJvYcCUUBKJyWuq1HKQfgGw724oOZbeGzMO9c76Yc5YgIRHE0JvZ8B9jOPrSTMvS6LJhWihv9/FCCPTwxooj@vger.kernel.org, AJvYcCUviYPdRT8UwX0PE+kvwqBuyF8BCy8iw5dUlH6dXV5sfu3z/INNlnusoh9T4b5L09iLWPG+ePwdOGL5gVt4@vger.kernel.org X-Gm-Message-State: AOJu0YwSG2ThT9k7RVeq3j2YTSnuVkdDm2fj+j2MIThlqzhmfEmaIME4 j5MWsaIyJD0YegtdQ8snVbDhdgd7X+RoGIcEjjl9dW+4feGDRqFPs3+2Ta5GIg4= X-Gm-Gg: ASbGnctVdGciFmhhTCCXhTocJwW+wlRya2LhnwVOUgaZgklBreWpKwLPb02Rhdhb3/T L0+e5wwGK6udvvaI1zKhhVhoTKJTZOnIafNfKxLy1Bfh+oAkHpdd4R+9p9EAQ0rb9qn0CFZc8B0 YMs+lHpx297AdR+UMn90QDhxTtX+MxC7x43z7GrEzpYse4Hg0+35W3Ae3P/umYm2PscInOkLg3C k1pZrFkDno8btuMSNIBCOtWl8pi5oIIay4lkxOT1pnVqy7ZSGXlALrHVjtrRaPCOHqV+9HvVvwx 9ZYaXM2yRecF89KPVMXtmlBZRnkdpO3Ij9gU5LfYUmuEsMq635xZVY3Djw== X-Google-Smtp-Source: AGHT+IEc6/ZLCTHaQJM/Rf7ILcdaECorVl4Hil2NyKSwXu5ZnaHkUirlV97JK1Xc5FUNMHL+bW8vXA== X-Received: by 2002:a17:90b:53c7:b0:2fc:3264:3666 with SMTP id 98e67ed59e1d1-30a4337bcedmr2879302a91.30.1746093697661; Thu, 01 May 2025 03:01:37 -0700 (PDT) Received: from debian.domain.name ([2401:4900:1c45:13dc:af05:2012:1f6c:ed34]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30a47476120sm472477a91.13.2025.05.01.03.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 May 2025 03:01:37 -0700 (PDT) From: Sayyad Abid To: linux-iio@vger.kernel.org Cc: sayyad.abid16@gmail.com, jic23@kernel.org, lars@metafoo.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, javier.carrasco.cruz@gmail.com, olivier.moysan@foss.st.com, gstols@baylibre.com, tgamblin@baylibre.com, alisadariana@gmail.com, eblanc@baylibre.com, antoniu.miclaus@analog.com, andriy.shevchenko@linux.intel.com, stefan.popa@analog.com, ramona.gradinariu@analog.com, herve.codina@bootlin.com, tobias.sperling@softing.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/5] iio: adc: ti-ads1262.c: add initial driver for TI ADS1262 ADC Date: Thu, 1 May 2025 15:30:39 +0530 Message-Id: <20250501100043.325423-2-sayyad.abid16@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250501100043.325423-1-sayyad.abid16@gmail.com> References: <20250501100043.325423-1-sayyad.abid16@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add the core driver file `ti-ads1262.c` for the TI ADS1262 ADC. This initial version implements basic IIO functionality for device probe via SPI and reading raw voltage samples from input channels. Signed-off-by: Sayyad Abid --- drivers/iio/adc/ti-ads1262.c | 438 +++++++++++++++++++++++++++++++++++ 1 file changed, 438 insertions(+) create mode 100644 drivers/iio/adc/ti-ads1262.c diff --git a/drivers/iio/adc/ti-ads1262.c b/drivers/iio/adc/ti-ads1262.c new file mode 100644 index 000000000000..ef34c528ffeb --- /dev/null +++ b/drivers/iio/adc/ti-ads1262.c @@ -0,0 +1,438 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * IIO driver for Texas Instruments ADS1662 32-bit ADC + * + * Datasheet: https://www.ti.com/product/ADS1262 + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/* Commands */ +#define ADS1262_CMD_RESET 0x06 +#define ADS1262_CMD_START1 0x08 +#define ADS1262_CMD_STOP1 0x0A +#define ADS1262_CMD_RDATA1 0x12 +#define ADS1262_CMD_RREG 0x20 +#define ADS1262_CMD_WREG 0x40 + +/* Registers */ +#define ADS1262_REG_ID 0x00 +#define ADS1262_REG_POWER 0x01 +#define ADS1262_REG_INTERFACE 0x02 +#define ADS1262_REG_MODE0 0x03 +#define ADS1262_REG_MODE1 0x04 +#define ADS1262_REG_MODE2 0x05 +#define ADS1262_REG_INPMUX 0x06 + +/* Configurations */ +#define ADS1262_INTREF_ENABLE 0x01 +#define ADS1262_MODE0_ONE_SHOT 0x40 +#define ADS1262_MODE2_PGA_EN 0x00 +#define ADS1262_MODE2_PGA_BYPASS BIT(7) + +/* Masks */ +#define ADS1262_MASK_MODE2_DR GENMASK(4, 0) + +/* ADS1262_SPECS */ +#define ADS1262_MAX_CHANNELS 11 +#define ADS1262_BITS_PER_SAMPLE 32 +#define ADS1262_CLK_RATE_HZ 7372800 +#define ADS1262_CLOCKS_TO_USECS(x) \ + (DIV_ROUND_UP((x) * MICROHZ_PER_HZ, ADS1262_CLK_RATE_HZ)) +#define ADS1262_VOLTAGE_INT_REF_uV 2500000 +#define ADS1262_TEMP_SENSITIVITY_uV_per_C 420 + +#define ADS1262_SETTLE_TIME_USECS 10000 + +/* The Read/Write commands require 4 tCLK to encode and decode, for speeds + * 2x the clock rate, these commands would require extra time between the + * command byte and the data. A simple way to tacke this issue is by + * limiting the SPI bus transfer speed while accessing registers. + */ +#define ADS1262_SPI_BUS_SPEED_SLOW ADS1262_CLK_RATE_HZ + +/* For reading and writing we need a buffer of size 3bytes*/ +#define ADS1262_SPI_CMD_BUFFER_SIZE 3 + +/* Read data buffer size for + * 1 status byte - 4 byte data (32 bit) - 1 byte checksum / CRC + */ +#define ADS1262_SPI_RDATA_BUFFER_SIZE 6 + +#define MILLI 1000 + +/** + * struct ads1262_private - ADS1262 ADC private data structure + * @spi: SPI device structure + * @reset_gpio: GPIO descriptor for reset pin + * @prev_channel: Previously selected channel for MUX configuration + * @cmd_buffer: Buffer for SPI command transfers + * @rx_buffer: Buffer for SPI data reception + */ +struct ads1262_private { + struct spi_device *spi; + struct gpio_desc *reset_gpio; + u8 prev_channel; + u8 cmd_buffer[ADS1262_SPI_CMD_BUFFER_SIZE]; + u8 rx_buffer[ADS1262_SPI_RDATA_BUFFER_SIZE] __aligned(IIO_DMA_MINALIGN); +}; + +#define ADS1262_CHAN(index) \ +{ \ + .type =3D IIO_VOLTAGE, \ + .indexed =3D 1, \ + .channel =3D index, \ + .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW), \ + .scan_index =3D index, \ + .scan_type =3D { \ + .sign =3D 's', \ + .realbits =3D ADS1262_BITS_PER_SAMPLE, \ + .storagebits =3D 32, \ + .endianness =3D IIO_CPU \ + }, \ +} + +#define ADS1262_DIFF_CHAN(index, pos_channel, neg_channel) \ +{ \ + .type =3D IIO_VOLTAGE, \ + .indexed =3D 1, \ + .channel =3D pos_channel, \ + .channel2 =3D neg_channel, \ + .differential =3D 1, \ + .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW), \ + .scan_index =3D index, \ + .scan_type =3D { \ + .sign =3D 's', \ + .realbits =3D ADS1262_BITS_PER_SAMPLE, \ + .storagebits =3D 32, \ + .endianness =3D IIO_CPU \ + }, \ +} + +#define ADS1262_TEMP_CHAN(index) \ +{ \ + .type =3D IIO_TEMP, \ + .indexed =3D 1, \ + .channel =3D index, \ + .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW) | \ + BIT(IIO_CHAN_INFO_SCALE) | \ + BIT(IIO_CHAN_INFO_SAMP_FREQ), \ + .scan_index =3D index, \ + .scan_type =3D { \ + .sign =3D 's', \ + .realbits =3D ADS1262_BITS_PER_SAMPLE, \ + .storagebits =3D 32, \ + .endianness =3D IIO_BE, \ + }, \ +} + +static const struct iio_chan_spec ads1262_channels[] =3D { + /* Single ended channels*/ + ADS1262_CHAN(0), + ADS1262_CHAN(1), + ADS1262_CHAN(2), + ADS1262_CHAN(3), + ADS1262_CHAN(4), + ADS1262_CHAN(5), + ADS1262_CHAN(6), + ADS1262_CHAN(7), + ADS1262_CHAN(8), + ADS1262_CHAN(9), + /* The channel at index 10 is AINCOM, which is the common ground + * of the ADC. It is not a valid channel for the user. + */ + + /* Temperature and Monitor channels */ + ADS1262_TEMP_CHAN(11), /* TEMP SENSOR */ + ADS1262_CHAN(12), /* AVDD MON */ + ADS1262_CHAN(13), /* DVDD MON */ + ADS1262_CHAN(14), /* TDAC TEST */ + /* Differential channels */ + ADS1262_DIFF_CHAN(15, 0, 1), /* AIN0 - AIN1 */ + ADS1262_DIFF_CHAN(16, 2, 3), /* AIN2 - AIN3 */ + ADS1262_DIFF_CHAN(17, 4, 5), /* AIN4 - AIN5 */ + ADS1262_DIFF_CHAN(18, 6, 7), /* AIN6 - AIN7 */ + ADS1262_DIFF_CHAN(19, 8, 9), /* AIN8 - AIN9 */ +}; + +static int ads1262_write_cmd(struct ads1262_private *priv, u8 command) +{ + struct spi_transfer xfer =3D { + .tx_buf =3D priv->cmd_buffer, + .rx_buf =3D priv->rx_buffer, + .len =3D ADS1262_SPI_RDATA_BUFFER_SIZE, + .speed_hz =3D ADS1262_CLK_RATE_HZ, + }; + + priv->cmd_buffer[0] =3D command; + + return spi_sync_transfer(priv->spi, &xfer, 1); +} + +static int ads1262_reg_write(void *context, unsigned int reg, unsigned int= val) +{ + struct ads1262_private *priv =3D context; + + priv->cmd_buffer[0] =3D ADS1262_CMD_WREG | reg; + priv->cmd_buffer[1] =3D 0; + priv->cmd_buffer[2] =3D val; + + return spi_write(priv->spi, &priv->cmd_buffer[0], 3); +} + +static int ads1262_reg_read(void *context, unsigned int reg) +{ + struct ads1262_private *priv =3D context; + struct spi_transfer reg_read_xfer =3D { + .tx_buf =3D priv->cmd_buffer, + .rx_buf =3D priv->cmd_buffer, + .len =3D 3, + .speed_hz =3D ADS1262_CLK_RATE_HZ, + }; + int ret; + + priv->cmd_buffer[0] =3D ADS1262_CMD_RREG | reg; + priv->cmd_buffer[1] =3D 0; + priv->cmd_buffer[2] =3D 0; + + ret =3D spi_sync_transfer(priv->spi, ®_read_xfer, 1); + if (ret) + return ret; + + return 0; +} + +static int ads1262_reset(struct iio_dev *indio_dev) +{ + struct ads1262_private *priv =3D iio_priv(indio_dev); + + if (priv->reset_gpio) { + gpiod_set_value(priv->reset_gpio, 0); + usleep_range(200, 300); + gpiod_set_value(priv->reset_gpio, 1); + } else { + return ads1262_write_cmd(priv, ADS1262_CMD_RESET); + } + return 0; +} + +static int ads1262_init(struct iio_dev *indio_dev) +{ + struct ads1262_private *priv =3D iio_priv(indio_dev); + int ret =3D 0; + + ret =3D ads1262_reset(indio_dev); + if (ret) + return ret; + + /* 10 milliseconds settling time for the ADC to stabilize */ + fsleep(ADS1262_SETTLE_TIME_USECS); + + /* Clearing the RESET bit in the power register to detect ADC reset */ + ret =3D ads1262_reg_write(priv, ADS1262_REG_POWER, ADS1262_INTREF_ENABLE); + if (ret) + return ret; + + /* Setting the ADC to one-shot conversion mode */ + ret =3D ads1262_reg_write(priv, ADS1262_REG_MODE0, ADS1262_MODE0_ONE_SHOT= ); + if (ret) + return ret; + + ret =3D ads1262_reg_read(priv, ADS1262_REG_INPMUX); + if (ret) + return ret; + + priv->prev_channel =3D priv->cmd_buffer[2]; + + return ret; +} + +static int ads1262_get_samp_freq(struct ads1262_private *priv, int *val) +{ + unsigned long samp_freq; + int ret; + + ret =3D ads1262_reg_read(priv, ADS1262_REG_MODE2); + if (ret) + return ret; + + samp_freq =3D priv->cmd_buffer[2]; + + *val =3D (samp_freq & ADS1262_MASK_MODE2_DR); + + return IIO_VAL_INT; +} + +/** + * ads1262_read - Read a single sample from the ADC + * @priv: Pointer to the ADS1262 private data structure + * @chan: Pointer to the IIO channel specification + * @val: Pointer to store the read value + * + * Reads a single sample from the specified ADC channel. For differential + * channels, it sets up the MUX with both channels. For single-ended chann= els, + * it uses the channel number and AINCOM (0x0A). + * + * Return: 0 on success, negative error code on failure + */ +static int ads1262_read(struct ads1262_private *priv, + struct iio_chan_spec const *chan, int *val) +{ + u8 mux_value; + int ret; + + if (chan->differential) { + mux_value =3D (chan->channel << 4) | chan->channel2; + } else { + /* For single-ended channels, use the channel number on one end + * and AINCOM (0x0A) on the other end + */ + mux_value =3D (chan->channel << 4) | 0x0A; + } + + if (mux_value !=3D priv->prev_channel) { + ret =3D ads1262_write_cmd(priv, ADS1262_CMD_STOP1); + if (ret) + return ret; + + ret =3D ads1262_reg_write(priv, ADS1262_REG_INPMUX, mux_value); + if (ret) + return ret; + + priv->prev_channel =3D mux_value; + } + + ret =3D ads1262_write_cmd(priv, ADS1262_CMD_START1); + if (ret) + return ret; + + usleep_range(1000, 2000); + + *val =3D sign_extend64(get_unaligned_be32(priv->rx_buffer + 1), + ADS1262_BITS_PER_SAMPLE - 1); + + return 0; +} + +static int ads1262_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int *val, int *val2, long mask) +{ + struct ads1262_private *spi =3D iio_priv(indio_dev); + s64 temp; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + ads1262_read(spi, chan, val); + return IIO_VAL_INT; + case IIO_CHAN_INFO_SCALE: + switch (chan->type) { + case IIO_VOLTAGE: + *val =3D ADS1262_VOLTAGE_INT_REF_uV; + *val2 =3D chan->scan_type.realbits; + return IIO_VAL_FRACTIONAL_LOG2; + case IIO_TEMP: + temp =3D (s64)ADS1262_VOLTAGE_INT_REF_uV * MILLI; + temp /=3D ADS1262_TEMP_SENSITIVITY_uV_per_C; + *val =3D temp; + *val2 =3D chan->scan_type.realbits; + return IIO_VAL_FRACTIONAL_LOG2; + default: + return -EINVAL; + } + case IIO_CHAN_INFO_SAMP_FREQ: + return ads1262_get_samp_freq(spi, val); + default: + return -EINVAL; + } +} + +static const struct iio_info ads1262_info =3D { + .read_raw =3D ads1262_read_raw, +}; + +static void ads1262_stop(void *ptr) +{ + struct ads1262_private *adc =3D ptr; + + ads1262_write_cmd(adc, ADS1262_CMD_STOP1); +} + +static int ads1262_probe(struct spi_device *spi) +{ + struct ads1262_private *adc; + struct iio_dev *indio_dev; + int ret; + + indio_dev =3D devm_iio_device_alloc(&spi->dev, sizeof(*adc)); + if (!indio_dev) + return -ENOMEM; + + adc =3D iio_priv(indio_dev); + adc->spi =3D spi; + + spi->mode =3D SPI_MODE_1; + spi->max_speed_hz =3D ADS1262_SPI_BUS_SPEED_SLOW; + spi_set_drvdata(spi, indio_dev); + + indio_dev->dev.parent =3D &spi->dev; + indio_dev->name =3D spi_get_device_id(spi)->name; + indio_dev->modes =3D INDIO_DIRECT_MODE; + indio_dev->channels =3D ads1262_channels; + indio_dev->num_channels =3D ARRAY_SIZE(ads1262_channels); + indio_dev->info =3D &ads1262_info; + + ret =3D ads1262_reg_read(adc, ADS1262_REG_ID); + if (ret) + return ret; + + if (adc->rx_buffer[2] !=3D ADS1262_REG_ID) + dev_err_probe(&spi->dev, -EINVAL, "Wrong device ID 0x%x\n", + adc->rx_buffer[2]); + + ret =3D devm_add_action_or_reset(&spi->dev, ads1262_stop, adc); + if (ret) + return ret; + + ret =3D ads1262_init(indio_dev); + if (ret) + return ret; + + return devm_iio_device_register(&spi->dev, indio_dev); +} + +static struct spi_device_id ads1262_id_table[] =3D { + { "ads1262" }, + {} +}; +MODULE_DEVICE_TABLE(spi, ads1262_id_table); + +static const struct of_device_id ads1262_of_match[] =3D { + { .compatible =3D "ti,ads1262" }, + {}, +}; +MODULE_DEVICE_TABLE(of, ads1262_of_match); + +static struct spi_driver ads1262_driver =3D { + .driver =3D { + .name =3D "ads1262", + .of_match_table =3D ads1262_of_match, + }, + .probe =3D ads1262_probe, + .id_table =3D ads1262_id_table, +}; +module_spi_driver(ads1262_driver); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Sayyad Abid "); +MODULE_DESCRIPTION("TI ADS1262 ADC"); --=20 2.39.5 From nobody Sun Feb 8 13:40:13 2026 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04D1A22D4E5; Thu, 1 May 2025 10:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746093708; cv=none; b=kkI0k0NqZHzJWIQu9H3jlMEa8DY8k2vIUepwUOGISfUI8y8koNZaBLCwFyY9EXMF0PN4wj6WZLKf5Emysiwooy7sRl6FPAHTEvgQXQ0aSQej+PMoFey0Dvf4jCsnSM6PuUDkMS5mU2DwQXjyDvEjqm74Jja5VTUjN8dHVWnFqHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746093708; c=relaxed/simple; bh=fnjJRK7dKGNHwa+6im6+vrEvIGPmCZaYX5I73+ZQbYw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UsQ1PSO4gf+Jg+nggddxy26rdnmJFjaSdRWBB/a6NdkQw+RQKAmgMxE8DTqAguw427ERt+WIZNH238QU9poSzijJeZcPvwvJv5U+K4FcmfEsWDQWVzsUUAiD8Isr9bMXyfrvkhw1bb081diXmanZF8iAAdVEPDLYlff/oA7skQA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Kqm3t0lT; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Kqm3t0lT" Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-b170c99aa49so481355a12.1; Thu, 01 May 2025 03:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746093706; x=1746698506; darn=vger.kernel.org; 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=64OaKxqowdBU6Fw377DtS5LOQKwZbC0Ed3tdK/AAu2g=; b=Kqm3t0lTyOrHH2hmrxvjRdjPGWHISa3AqNZkK7/phCB1NJcRGr684qqqtnaRgvw68a LQAxsM8BprtrwikxjAEEaST5fzL8y7DjZIyUN18pUA2aq4cLkhBn11gbCq09S/WACGgi 5buiN50U1sqzJqHlkSzpAztGMazrwIAJ/bqHxLprKH5iDoHKuSpQVP0sWZW33Xqwihwa okkIcNMm8zohPYCL9fz+Kh5hF8H3eOuAfO7J0+uBfGp6lPTgnTll8zPbPqvczBt1PST7 iacJz9kx6KbL0bmDhehubBPype0QmNb59uj7RcpCBDM3y1UHhU1M4JV9qgYxXmYci8e+ J9vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746093706; x=1746698506; 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=64OaKxqowdBU6Fw377DtS5LOQKwZbC0Ed3tdK/AAu2g=; b=mNdfNBnZkI+9xo4srlTeVMKe5ng+ZcHDUvhfyT+0yz+JqTiecW/bPToxVSHGsH2qAJ +NBBdEpbdBeWRFoB045863i5mjsp22aObWTb8SJp1cGs/9CdOxLdg+LIEp2nD8tZxmT0 cXuHgxLCwrZ9tA6fxa5pgyG16J5m0QTy4fGycgicn+8kCUowIJ0SdHPcbhzlZstzIXSC x18fgEeKEoKF7XUUhAs/635hAwAWQwuEDcJ8f3QJ3ROr64+UtU7ltTfKVnLmXcgalHf3 XT1zWFiTfm6OoLfn0G6r9ERYU6LNwfD8kWmQwDsUHZ8bILscLsMdLqAFpAqXb1yDK+jT wVGg== X-Forwarded-Encrypted: i=1; AJvYcCUPVRONU6V4iw30HmOOslm9QSicc+/dAQUBuMCAc9KNDYkeI/Q4iCOfDJgK6aagoKlRA03CBajFvS5W@vger.kernel.org, AJvYcCXn5Fqelo+P+Tr+eVlSWdd8eJ26MobJAs32ust39xQzJPPRY/KBMYYUgT3CA6vO7zed+TD32FyfblTBepv5@vger.kernel.org X-Gm-Message-State: AOJu0YzOr06YCzcgqTVIKESGkIn5wk9FZazh7sUaj7sciaadwcqIGTh2 4uzpPKwsk6b8ztL32LegJ2kGl3O0/h2OTM0Hc6Z6tRNXVNws/oVdDzepbwPRbxw= X-Gm-Gg: ASbGncvc80H/qeFdaJ8oDB7VAu/paBedViVLr2rQo0vlTs0ETUtOdsB1hN7E7Svag8o nvnkzhCii8CZ3WxTzWQOM/LGiAJJeycHM4P0s5iUk9Dw8EjftsHadh8kHyv8W+UTmerCyQtCYrX +XVVoB//XhdTeymciHmRtJGlKk9bMttoCuDOBhQnpdTCBputqpAPKMP0IbTOln6GyJxJ8KPYbGV VOUwUtlOKrb07Y6ZQFKiiuHLBTP48YEqjMaxNQ6wpuIZbBwjvDskqURs+3U2NjHQX/1LvwszQFF S0bTQLy3gpzoOQ8/J52DZd3agxPMxIjiUjyAbtHS7ktqr3sRTGQkhDpvXg== X-Google-Smtp-Source: AGHT+IEwUzMN4VgYM9hj1LaWJ1cxE4doyeT0GVJ1Ly/tNx5vHTEHlFh8Y8cIwp4KvDsG5KS7tgKgqw== X-Received: by 2002:a17:90a:da83:b0:305:2d27:7c9f with SMTP id 98e67ed59e1d1-30a3331eebbmr11229024a91.16.1746093705733; Thu, 01 May 2025 03:01:45 -0700 (PDT) Received: from debian.domain.name ([2401:4900:1c45:13dc:af05:2012:1f6c:ed34]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30a47476120sm472477a91.13.2025.05.01.03.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 May 2025 03:01:45 -0700 (PDT) From: Sayyad Abid To: linux-iio@vger.kernel.org Cc: sayyad.abid16@gmail.com, jic23@kernel.org, lars@metafoo.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, javier.carrasco.cruz@gmail.com, olivier.moysan@foss.st.com, gstols@baylibre.com, tgamblin@baylibre.com, alisadariana@gmail.com, eblanc@baylibre.com, antoniu.miclaus@analog.com, andriy.shevchenko@linux.intel.com, stefan.popa@analog.com, ramona.gradinariu@analog.com, herve.codina@bootlin.com, tobias.sperling@softing.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/5] iio: adc: Kconfig: add Kconfig entry for TI ADS1262 driver Date: Thu, 1 May 2025 15:30:40 +0530 Message-Id: <20250501100043.325423-3-sayyad.abid16@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250501100043.325423-1-sayyad.abid16@gmail.com> References: <20250501100043.325423-1-sayyad.abid16@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Adds the Kconfig option `CONFIG_TI_ADS1262` under the IIO ADC menu. This allows users to select the TI ADS1262 driver for compilation during kernel configuration. Signed-off-by: Sayyad Abid --- drivers/iio/adc/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 6529df1a498c..f3f8a8cf5f89 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -1542,6 +1542,18 @@ config TI_ADS1100 This driver can also be built as a module. If so, the module will be called ti-ads1100. =20 +config TI_ADS1262 + tristate "Texas Instruments ADS1262" + depends on SPI + select IIO_BUFFER + help + If you say yes here you get support for Texas Instruments ADS1262 + 32-bit precision ADC with programmable gain amplifier and internal + voltage reference. + + This driver can also be built as a module. If so, the module will be + called ti-ads1262. + config TI_ADS1298 tristate "Texas Instruments ADS1298" depends on SPI --=20 2.39.5 From nobody Sun Feb 8 13:40:13 2026 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 261F6205AD7; Thu, 1 May 2025 10:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746093716; cv=none; b=oRQSsfGz8hu/Yev/oCsJn7T3bxBE2vuFi9pwrn6DHah6/ur8mZC3utwaGp6Vq9AvnjSA0Rp9V1D/UhIPp0DMNrYdssRNEFTH6qm7ziC56q6RNixcC9pRnA+poOVwl/21g88V+hKVaPhUBXORZB8MXyIgVaI0aJIeLM7XS/cD7QY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746093716; c=relaxed/simple; bh=bsFADKzCsBPFRFVZGLm+HaF9sAzzeX36q6ZLD2+qCEM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GojBmUhGFF6wYToN6OrH03mncho0sVFdfqZfZ6ptYm37aTQTPk4dr3pzWVxtI7f46O7B6e0ORFf0osGKV1KSicCl+dSz/XU0dMWWlxJsQdkERC1MAlxdjHvv/g5fhGIepQ1MsgyyTs8K6lFbZH0r16WF8tmrQaGy5GgXpdviskk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=egKBVfra; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="egKBVfra" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-301e05b90caso847923a91.2; Thu, 01 May 2025 03:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746093714; x=1746698514; darn=vger.kernel.org; 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=5fTjcDNUoJQ/2EOekR9ouneUx2gFRLpQvcgox59bA3Q=; b=egKBVfra1RtSJSS5t90La1LQHdy2xvOKt2/2h5DqqqX5jrYMMVMex5Nmr/qlv2bFbJ CWelQaWnyO8i9Rw7zOhVJb6iM9/GkSLHAe8piv5H5QjWNZCRPOVBZOtHaJd74MEfoyeN NwoGoMZ5z18U3IxbrIfWgfjGcVsGZ1xE5Ers8YcyFmHfq4omi5G7duqO+JVQIx5svkqM wVZRc6bG8dt37FgLPuhb2fA3ftTizhuEERgDTfoEcOfS3EHd+cLtz7b63FsTckQBrEQT VzpRIvcc9IkKAc5g5YkCwqSCOwifPWq/MMr2TO6grbRMUkWs0rKTjazK1LlT7++Mv0n6 rCwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746093714; x=1746698514; 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=5fTjcDNUoJQ/2EOekR9ouneUx2gFRLpQvcgox59bA3Q=; b=hpkjOOkMKN8fgIyqc7Xvy64oJUyeWkRoexh3c7QCRXMeb1PitTzkj2shobUAnX+Ptq E627YBAx8h1zh9hpmZUZ634/C4CSBCpNV31Mt3OJynvXdW4ZwfrhUbztQFc9Z1ybAnOR erKmmgnvQ//QW/yHDLFt7yp083SMsAuiqRaVmXy+VzgAFZWWrElnSlovbDZFTMb9VbRM eDytbCcWZ1s40kE3baFrZ1DnbRDGFEPNjsHWMWJ7eG33LP1c6R59q5ACyc6ZuD52RTpA FxLtZyCNQdMiGTH0mbonuvmSKPC0/bpiRmyyWT+vsZexM3PREL2jbtb1DhEAtO6Eq7NX /v/A== X-Forwarded-Encrypted: i=1; AJvYcCXU+6aPazj8DsPAPiw/a7qZfVzn707FsimbHTp7H+iKRV1nsQ0eYhlLRaKofLR2wb5PBMqDsmnlLfXs/X7j@vger.kernel.org, AJvYcCXaIYkuHWQ59jx+YFLHtkSIL1cuRiJPS29umqGOqjMeLY5/hD2Yv3XcWXyjYv+oXSJuGu6U5RAfTZdJ@vger.kernel.org X-Gm-Message-State: AOJu0YxCB4cQJCWrHlSUAOBLKXSFL4zlqBPMfSdSb2pU0kofLsfBUNft zbRkbNmjeOR3aFbHkjtAzYHu8+PEiuDX0SNSGmAPm6sKvIdHx5IPS0+4WFs0VwE= X-Gm-Gg: ASbGnctvBMHz2XdHlXEbYYPguCWrtwGICwEI2MW0t6wzyNLtyDorPeaBbkRFx5Yezqt /OhDKs8JP/yTFlHjpLsAOeS+SrVtGReA0A0N5+iiH5gNpKCHVQWxr7Uscjoq0LMLILAdZRbhcUx BRWDOj/KDsclnwdbks2GJl98kGD0uPIWZjWAq7zr2S/vARx8Daz4ckpcpTa+v09gA4h1MmK1zNF pxBvxRYhjCWrCpCQkw1//vpv5lqsRtMgY1Ny/ZEgR2wcuAbfiko9AOMai6b5JlCNcy9rgmafVQu OT/7eAMqBQGvANkJPyDOuMDPRNyXG5UeOcJllqyOuikQlEsTXM0d+aC+/A== X-Google-Smtp-Source: AGHT+IG8opicxQ27hu0i6sd/nOnUNADQYiucjyDpKm4LGBctaQJQll5RbOTmLNPD2DWHEy8x1B/CWA== X-Received: by 2002:a17:90b:3806:b0:2f2:a664:df20 with SMTP id 98e67ed59e1d1-30a343e80afmr9939843a91.7.1746093714052; Thu, 01 May 2025 03:01:54 -0700 (PDT) Received: from debian.domain.name ([2401:4900:1c45:13dc:af05:2012:1f6c:ed34]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30a47476120sm472477a91.13.2025.05.01.03.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 May 2025 03:01:53 -0700 (PDT) From: Sayyad Abid To: linux-iio@vger.kernel.org Cc: sayyad.abid16@gmail.com, jic23@kernel.org, lars@metafoo.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, javier.carrasco.cruz@gmail.com, olivier.moysan@foss.st.com, gstols@baylibre.com, tgamblin@baylibre.com, alisadariana@gmail.com, eblanc@baylibre.com, antoniu.miclaus@analog.com, andriy.shevchenko@linux.intel.com, stefan.popa@analog.com, ramona.gradinariu@analog.com, herve.codina@bootlin.com, tobias.sperling@softing.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 3/5] iio: adc: Makefile: add compile support for TI ADS1262 driver Date: Thu, 1 May 2025 15:30:41 +0530 Message-Id: <20250501100043.325423-4-sayyad.abid16@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250501100043.325423-1-sayyad.abid16@gmail.com> References: <20250501100043.325423-1-sayyad.abid16@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This ensures the driver object file (`ti-ads1262.o`) is built and linked into the kernel when the corresponding Kconfig option (`CONFIG_TI_ADS1262`) is enabled. Signed-off-by: Sayyad Abid --- drivers/iio/adc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index 3e918c3eec69..14192944c225 100644 --- a/drivers/iio/adc/Makefile +++ b/drivers/iio/adc/Makefile @@ -134,6 +134,7 @@ obj-$(CONFIG_TI_ADS1015) +=3D ti-ads1015.o obj-$(CONFIG_TI_ADS1100) +=3D ti-ads1100.o obj-$(CONFIG_TI_ADS1119) +=3D ti-ads1119.o obj-$(CONFIG_TI_ADS124S08) +=3D ti-ads124s08.o +obj-$(CONFIG_TI_ADS1262) +=3D ti-ads1262.o obj-$(CONFIG_TI_ADS1298) +=3D ti-ads1298.o obj-$(CONFIG_TI_ADS131E08) +=3D ti-ads131e08.o obj-$(CONFIG_TI_ADS7138) +=3D ti-ads7138.o --=20 2.39.5 From nobody Sun Feb 8 13:40:13 2026 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E150944F; Thu, 1 May 2025 10:02:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746093724; cv=none; b=GWikWBu8bj3LyzMc5R2xIr7G6EEtngmRMijVZaPTq5Mf8/IODJS4v0SYsyPmYfktF5MugmeyPco0OTa1md7m4SXRMEdPk1Ffe+sAaECcVzvefL843AWp5KjnLDC8bYy/XQSI312Cl3lfM7HyAVAXa1iCnriMPYF1RifHzl9Ttw8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746093724; c=relaxed/simple; bh=/TtrDcnI3jGwmYe99ghaQbY6F5wrZGqA98bdnfjCyNA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H0dkGRRCsXaR//6T1iRPqlhoqYRQJ6k8giDAGkmNo2YRV3O90j4h9sN3g9fqD/Rvda4L+NBQyN628QpqxcHHKkw475/LtUzj/twGynTnFfBKFqb2LF+Jw/Ig5sWrYR7O7BzrsSwW1krzbhXysv3nSDXJbeBnacF2k0/brJxweWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E5J1kff1; arc=none smtp.client-ip=209.85.215.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E5J1kff1" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-b0db0b6a677so718397a12.2; Thu, 01 May 2025 03:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746093722; x=1746698522; darn=vger.kernel.org; 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=1+yshCywKiuZ4tPT9Q/qTWdnzUIcRTdbJjvFlNDsvV4=; b=E5J1kff1zjR4Ol3H6Pc/6S/wbXI6I40ZwTHl4B67DfQ3hL3D+Owift4iELye1wnvJK rjaWR44minLLq8wd/1Gnpnvdxf5aNWQBEqAJQO54JgpddNJsK/e1h2ujD+TmSvUwJ0x2 TmWJ1LCF1R/ZNCZfnC93pObaeOR8dfXggwinkf8O1uSdPKbZCzDGNRKQUSOF5dyhVZMB /mzStx/gKcgb7uolYxWDtmWzFot/jRpXVxB8ACH8E3cOvoMEu9NaTWLkPVlOV13d5W+3 a2AceabraDUdpHI21d8nlnnzT0+jLrgoKvJX064Vz3uuG8K+qDBMCS5TvA3sA+fBtoho dlFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746093722; x=1746698522; 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=1+yshCywKiuZ4tPT9Q/qTWdnzUIcRTdbJjvFlNDsvV4=; b=GhQ4byyUwBA2o/LkdBGpZEz5EskPNp1c0F+OCWOoerS08QBDgBpYdGPXr0aKVE+nfI HBKhhisdgwBoXupNpOPTOaTkAjimK5Kn0/hzWWUCNReNF34S+NE5A3eHsNzpRtryuuOu EYPHpFycVymyLpOLpX1FG6Q9TXmdFutAUYSpdqte/0kxxCm3ZOmk4Rkclp0ZfLl9QZyv YVoJp106JEaAol5h8/rLQbJlOdjoprg09eU69u6uripByHLH4hAtBSUOlF3mizYHFJhJ Q+0pjvkFQxcQXLHQqXGjCgqprJpruM4ICLEoAOuSsWLQ+8K8fswfdpd8n6yWBNI6MpKy E8zA== X-Forwarded-Encrypted: i=1; AJvYcCWUnLUv5VwL10S+hgUmQjZ3RgIEI/GJViMWOjxl6Dph3WARnT5ZtUt8jvKyI/4DBYsOmnqTJez6XpOhg5rJ@vger.kernel.org, AJvYcCXsRYKKfVbStnok/8tzowvxMdUMN6pvgczp7r8ZO+/wC7PAch/LTvZFwBjB9bv8EQrmLuYj+O/R3ZTE@vger.kernel.org X-Gm-Message-State: AOJu0YwSn3cEB+hEv/1bhpd/1RM6vDqOIyC/rlkLCIQPaSDD0oLy0nP4 Kdv+/sg+vR3IERW1DCYzgClSv9be9ph2WGxgz8jzgI1QHZA5LwQ07Det7oNPRTI= X-Gm-Gg: ASbGncswhW7G/DaxFnIt/c04aUQeGtcsgOpbNUrNpOcYXHjP7pFrUlCLYOo7+Go9fGf adtcQbNs6V8L4qatqb4AroQe8tzSHqcer0Sjlca12KL+uOOPOWnkr7tqXbRk2IkzbJPoY9fxynW BDZ/ExGxcEXGcLk8k1YTR6TaYAiNrGTq8Y1v/y6GK7/+9dI3ILbm/1lacq/IhQZwLi0E97e8WeS IxZ0Zql+naOyfBbDWhDtxo4aha+4PZDIKBD+ypKbMzUnSfhJpGpAvCNcd9XW9uj0MkyxcG7Tnyg wUSUdiSKXZ0M0ScuOkgNtBCi23wfJ545oSrZlIMjl2MJ+9+xqf22nh6tUw== X-Google-Smtp-Source: AGHT+IFu5AO8aNSqxiixa8qxvLmhOycEFHviXNKuVoxC5raQFq7tT19VVYCPESFTZIqnVbPDXN9fDw== X-Received: by 2002:a17:90b:51c1:b0:2fe:b735:87da with SMTP id 98e67ed59e1d1-30a3f908513mr4201362a91.0.1746093722467; Thu, 01 May 2025 03:02:02 -0700 (PDT) Received: from debian.domain.name ([2401:4900:1c45:13dc:af05:2012:1f6c:ed34]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30a47476120sm472477a91.13.2025.05.01.03.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 May 2025 03:02:02 -0700 (PDT) From: Sayyad Abid To: linux-iio@vger.kernel.org Cc: sayyad.abid16@gmail.com, jic23@kernel.org, lars@metafoo.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, javier.carrasco.cruz@gmail.com, olivier.moysan@foss.st.com, gstols@baylibre.com, tgamblin@baylibre.com, alisadariana@gmail.com, eblanc@baylibre.com, antoniu.miclaus@analog.com, andriy.shevchenko@linux.intel.com, stefan.popa@analog.com, ramona.gradinariu@analog.com, herve.codina@bootlin.com, tobias.sperling@softing.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 4/5] MAINTAINERS: add entry for TI ADS1262 ADC driver Date: Thu, 1 May 2025 15:30:42 +0530 Message-Id: <20250501100043.325423-5-sayyad.abid16@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250501100043.325423-1-sayyad.abid16@gmail.com> References: <20250501100043.325423-1-sayyad.abid16@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a new MAINTAINERS section for the TI ADS1262 ADC driver, which includes the main source file and the device tree binding documentation. Signed-off-by: Sayyad Abid --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3cbf9ac0d83f..10b2e9293a99 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -24187,6 +24187,13 @@ S: Supported F: Documentation/devicetree/bindings/iio/adc/ti,ads7924.yaml F: drivers/iio/adc/ti-ads7924.c =20 +TI ADS1262 ADC DRIVER +M: Sayyad Abid +L: linux-iio@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/iio/adc/ti,ads1262.yaml +F: drivers/iio/adc/ads1262.c + TI AM437X VPFE DRIVER M: "Lad, Prabhakar" L: linux-media@vger.kernel.org --=20 2.39.5 From nobody Sun Feb 8 13:40:13 2026 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8449624E4BF; Thu, 1 May 2025 10:02:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746093733; cv=none; b=QSN5VbPDjs0i9jVpg05Dd/bhFEL5b/2kGlTDXHXtP2mbYUPFjLr+CU7XxUkK4XHPrxnTSMbUBPKNiZFn7XX9l775DqXwrYr78V7hqiHXfbX4JKy8dHn0rLc4cQKXUHJGul8iY+r5bxPI57xKyn5S4GR3yRbfZuMjBU91A3qWkhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746093733; c=relaxed/simple; bh=Se5ban1HaotZFiAJL4wpB/iOS9aHv+cFYzyyHNfd/+0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ig32tDzKyIcclfZcCIfKytcm9IZoddh3+w8CS4GM6x2GYuVxVfDx9AxG7S04jU2EV28UCm/1/1yz9NX56o7Vq149itPl8bkSsRJtsmr6LT4q/dHmwVOuWkHf9reewpUqzXLSBQ4f/RQQw2BoozTwFQY48SHMGvJhwxXyAmjTsQM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kHgYJjgN; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kHgYJjgN" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-af908bb32fdso696378a12.1; Thu, 01 May 2025 03:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746093730; x=1746698530; darn=vger.kernel.org; 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=bIrQBi534yWG846WKR3hztDYNRifTQdAuywGpEqDRS0=; b=kHgYJjgN/8LzehZvdIUiinvaFh47WytlgOBNVMzOILUg+TCLj7X1VYWHrgmtex+vYt dM0x3Pf/j2TfmWxedRzuVK5tTKS7WI5Ot6RZuNiIt+g01SaTmaXuuubu8nGZCyr+wze0 Xtt5HJ1nbCXfC+kL7Q/UQMNqxigfmXxRARSbYkVcn5WRCtqMY2sWLsNXFUD/Y9xCvIj+ oEs4YwkwcmPeJqQf04J52IhJwnu05+8FwgmII4l9/okMp5TVSTNZg76PFBb8qnTo4Xkw dLtwmqEQ7aUkKXIz9WbTlqxYaWJsnZMbwSD4VqFB5UQt0O4hy35pjuD9m3MVGKnb9oAZ QC8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746093730; x=1746698530; 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=bIrQBi534yWG846WKR3hztDYNRifTQdAuywGpEqDRS0=; b=bJL8YYjaPKApRLVjQaM1Zs8Cn7BW9Gg1CPDex2ZBtGntLn037CTg6vBWRutsZZUl0+ 40eKv2JjEfP3/D8pwi+R5b0tkX9jVaq0ceB+nYz8cxMdpVAn8lXIPhqN6XXzecXjHc32 D/5mSDNMWrSyfvtmzAMNKfQMLsfiKufnO/f35aW8XjWlc6UcHo57kN7jq0AAZM7dT0vj Kc7xLZ1ls892Fb9amB0DsODW30wvYj0O31fiPLWyp7UhtLhDB8k/m4jDQaxNMOhw+mtx DfbqpieQ369gs26uENOoPjhPO+33ODAbrNngLjX3rp/jVxgqhs6L9iD5MZFtoxbIRZZI CZ3g== X-Forwarded-Encrypted: i=1; AJvYcCUCdEZArLeMAjrWWp1RyIyhP+omyOEsRY9r3C1IuQQDT//8O01gkCalLIh6oXeeXAmOY17dDnwYKFZG@vger.kernel.org, AJvYcCXkeAFJ1kApiytuXtWdlPvcwYSaGx/uaeIzODOFEFYxJYlBeAZOLIzSlrUHFgk+eRVnIySi/Nt4dh+kHRP3@vger.kernel.org X-Gm-Message-State: AOJu0YySaz3zEveF45KcsxdYaWDSHjBBPL2oSStXaM9iTotSlv3Fdyxm jHkg6HLjgYmVFlx4BUmJR3RlfgkX6l5ONzLaJKZffEXrfijM25qgUvgUBckJ6N8= X-Gm-Gg: ASbGnct0doejDFD+5wp8KNeVs/HWxXrYJ98N8WKg88moZwnd076luoU9awMgBwZcV+v adXCaNR8PnmIKg1HqTDSK58fSLh2sN/MxEmmW22iBOEkEZYm6+0RbouI8sPUXIswNOVePmZa5tJ fYN4f6GKp64PExORqUZ+wh+xv9oKFXFdQJJyjN+tGh+Pks8bQJ/oVzt/FJPXS9CiVOCSIUNhDGh EYkBjLoeBfT7CnyF014dTjqoLFMAiRjQXGwT+w5pvmt1HedDWO2ItMon1c17vjpj3KRynpR4Z/5 ELW8aq/VZ77wWFm+DseGy4Heuh0cxOglDVxuWjtYwU4bI2ffCEND5+P9XQ== X-Google-Smtp-Source: AGHT+IFykikG05A6FIfUfj6dC5zqXw1kDM+wSIizc/FZisl7WKKVtJFV/fgamnXt7DR6w1KSHIAoxA== X-Received: by 2002:a17:90b:57d0:b0:2fa:17e4:b1cf with SMTP id 98e67ed59e1d1-30a4312b904mr3036583a91.2.1746093730247; Thu, 01 May 2025 03:02:10 -0700 (PDT) Received: from debian.domain.name ([2401:4900:1c45:13dc:af05:2012:1f6c:ed34]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30a47476120sm472477a91.13.2025.05.01.03.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 May 2025 03:02:10 -0700 (PDT) From: Sayyad Abid To: linux-iio@vger.kernel.org Cc: sayyad.abid16@gmail.com, jic23@kernel.org, lars@metafoo.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, javier.carrasco.cruz@gmail.com, olivier.moysan@foss.st.com, gstols@baylibre.com, tgamblin@baylibre.com, alisadariana@gmail.com, eblanc@baylibre.com, antoniu.miclaus@analog.com, andriy.shevchenko@linux.intel.com, stefan.popa@analog.com, ramona.gradinariu@analog.com, herve.codina@bootlin.com, tobias.sperling@softing.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 5/5] dt-bindings: iio: adc: add bindings for TI ADS1262 Date: Thu, 1 May 2025 15:30:43 +0530 Message-Id: <20250501100043.325423-6-sayyad.abid16@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250501100043.325423-1-sayyad.abid16@gmail.com> References: <20250501100043.325423-1-sayyad.abid16@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add the Device Tree binding documentation for the Texas Instruments ADS1262= ADC. Signed-off-by: Sayyad Abid --- .../bindings/iio/adc/ti,ads1262.yaml | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads1262.ya= ml diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads1262.yaml b/Do= cumentation/devicetree/bindings/iio/adc/ti,ads1262.yaml new file mode 100644 index 000000000000..8c4cc2cf6467 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads1262.yaml @@ -0,0 +1,189 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/ti,ads1262.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments' ADS1262 32-Bit Analog to Digital Converter + +maintainers: + - Sayyad Abid + +description: | + Texas Instruments ADS1262 32-Bit Analog to Digital Converter with, + internal temperature sensor, GPIOs and PGAs + + The ADS1262 is a 32-bit, 38-kSPS, precision ADC with a programmable gain + amplifier (PGA) and internal voltage reference. It features: + - 11 single-ended or 5 differential input channels + - Internal temperature sensor + - Programmable gain amplifier (PGA) with gains from 1 to 32 + - Internal voltage reference + - GPIO pins for control and monitoring + - SPI interface + + Specifications about the part can be found at: + https://www.ti.com/product/ADS1262 + +properties: + compatible: + enum: + - ti,ads1262 + + reg: + maxItems: 1 + description: SPI chip select number + + spi-max-frequency: + maximum: 7372800 + description: Maximum SPI clock frequency in Hz (7.3728 MHz) + + spi-cpha: + type: boolean + description: Required for SPI mode 1 operation + + reset-gpios: + maxItems: 1 + description: GPIO specifier for the reset pin (active low) + + vref-supply: + description: | + The regulator supply for ADC reference voltage. If not specified, + the internal 2.5V reference will be used. + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + '#io-channel-cells': + const: 1 + + ti,pga-bypass: + type: boolean + description: | + If true, bypass the PGA. If false or not specified, PGA is enabled. + + ti,data-rate: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 15 + description: | + Data acquisition rate in samples per second + 0: 2.5 + 1: 5 + 2: 10 + 3: 16.6 + 4: 20 + 5: 50 + 6: 60 + 7: 100 + 8: 400 + 9: 1200 + 10: 2400 + 11: 4800 + 12: 7200 + 13: 14400 + 14: 19200 + 15: 38400 + +required: + - compatible + - reg + - spi-cpha + - '#address-cells' + - '#size-cells' + - '#io-channel-cells' + +additionalProperties: false + +patternProperties: + "^channel@([0-9]|1[0-1])$": + type: object + additionalProperties: false + description: | + Represents the external channels which are connected to the ADC. + Channels 0-9 are available for external signals, channel 10 is AINCO= M, + and channel 11 is the internal temperature sensor. + + properties: + reg: + description: | + Channel number. It can have up to 10 channels numbered from 0 to= 9, + channel 10 is AINCOM, and channel 11 is the internal temperature= sensor. + items: + - minimum: 0 + maximum: 11 + + diff-channels: + description: | + List of two channel numbers for differential measurement. + First number is positive input, second is negative input. + Not applicable for temperature sensor (channel 11). + items: + - minimum: 0 + maximum: 9 + - minimum: 0 + maximum: 9 + + ti,gain: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 5 + description: | + PGA gain setting. Not applicable for temperature sensor (channel= 11). + 0: 1 (default) + 1: 2 + 2: 4 + 3: 8 + 4: 16 + 5: 32 + + required: + - reg + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +examples: + - | + #include + + spi { + #address-cells =3D <1>; + #size-cells =3D <0>; + + ads1262: adc@0 { + compatible =3D "ti,ads1262"; + reg =3D <0>; + spi-max-frequency =3D <7372800>; + vref-supply =3D <&adc_vref>; + spi-cpha; + reset-gpios =3D <&gpio1 16 GPIO_ACTIVE_LOW>; + ti,pga-bypass; + ti,data-rate =3D <15>; /* 38400 SPS */ + + #address-cells =3D <1>; + #size-cells =3D <0>; + #io-channel-cells =3D <1>; + + /* Single-ended channel */ + channel@0 { + reg =3D <0>; + }; + + /* Differential channel */ + channel@1 { + reg =3D <1>; + diff-channels =3D <1 2>; + ti,gain =3D <2>; /* Gain of 4 */ + }; + + /* Temperature sensor */ + channel@11 { + reg =3D <11>; + }; + }; + }; +... --=20 2.39.5