From patchwork Tue Aug 20 15:58:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13770430 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (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 5B7F0194129 for ; Tue, 20 Aug 2024 15:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724169537; cv=none; b=OzsVknABTFCduyDtu6PVBCGf6L1f9Gl6rh+C+ua5PHkxv49sk9Yrn37DsNB54Zow/DowOA59f2X0Bl5McGKiS61MBa0HzvyEw7MdLt5z2pHs1ShKvht8WM5EUbZxd0UTeFqrPnECi43ywBXM1cJJnn8ICCj2tGNQukZ8Kp+PjdI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724169537; c=relaxed/simple; bh=T2uW+9PyixgbUtWpXjoj/knW40tAhHFwdFvL2UuJfK4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pUOeEO+sVHt7GyhRBxeapwDl/8d0Xqye71e7Tzf14O3MeBRW4K6A5oWcrYp1caaOeIbiCbsmTDD5KpOiTM4++Y2CHQHmhi/YH7eMCyDtUY6df103PkhsYQHIi8XKoNIrQFFzYzWrbKO6eNiKf0gorK5JmnuNetAv4oWmxvptBoQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=ael4jJVT; arc=none smtp.client-ip=209.85.167.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="ael4jJVT" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3db1d0fca58so3403569b6e.3 for ; Tue, 20 Aug 2024 08:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1724169533; x=1724774333; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=z8r3jcTfoo6qehw9myoqpknk+mT1kpzg79vaDmFe51U=; b=ael4jJVTaF16e4/5ceLQ78FNbFohPooyWGJzuOU4Uif3PBVlTC+06Ll1qgBSgzn2z/ NeqJq+10Y3UOvKpJmCyAEC693q9hXW6FLKAeG/80fZ18HfBYTQrbgWaNuusdfl0o9QCq KxD6muz3Hl8mpoIV58Pf/bYrKN8GPMQ3O79DD4L5zD0DlGd96EFqGOk1s9dfRHwsfyZZ vlfa06359DqoAaDc6cbN6XwHCR7Ywh8VxG/+vSBLwaLoj1ULtbOX7YaCSwSNEeSZXgtG Gaytuka1eh+FcaXnd4sKpI2vAI19d/c2qJ6sZpfirFt1usC4HgoScw3H/i0QrBqqdmCC 8v2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724169533; x=1724774333; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z8r3jcTfoo6qehw9myoqpknk+mT1kpzg79vaDmFe51U=; b=CKAzQ7jKuMFQMhfN5t8OPpbkE5AWnNMV9gDqLjrg8v/IIFR9NpjO18yW7Pvd3a++yD 7BjqLPMg0enyxEIjdvkFYXYyVsK58buw0A5se3cGCcwADiF60pnXOL9mU5Dmn21Ax95B PqcnLKlLl6v0BGnU9QJqdMXz6LczqnNVTaSKZA7UqlXG9BcRttt+itZygRF5ell3dOB/ FzgkUX1HZTVCR8+eOhQ7ZWwOJufO51rcMqknNLWxGAEOwGUaMMzMswtD7fwe7wN1yy4h bOo8k0ZU69T53L556lggKJTeDtLL388phqj1ukWYyFYyIh+asZbYccLDipPNmzKj/4Iv 7Gaw== X-Forwarded-Encrypted: i=1; AJvYcCWUlZfh65g5uITNPqIECEP8S+nLC99QZp8tg5Mx9rp3R8+Xs22TU4wXZDVLHBIL73aEPav8fGoDM3U=@vger.kernel.org X-Gm-Message-State: AOJu0Yzs2OhlimRhQz1K5FX1rtPKzH1LJO3uz1unp+cv8upM0A3YrX1c l0TL+OL1RBrX+n7cCkVr3wI/ocsJYa3eWcTw+OljVLE7Yf+1KSjBywUdQReXxlI= X-Google-Smtp-Source: AGHT+IHY9wEuslBOuA+07pv4kLyKmUKmBvx9lJ6KeF5DAR20Dmo8DuJoCoB0Nvw1kx6Q5jEcJFPEAA== X-Received: by 2002:a05:6808:14c6:b0:3d6:3050:7ce7 with SMTP id 5614622812f47-3dd3af8210fmr16554650b6e.44.1724169533411; Tue, 20 Aug 2024 08:58:53 -0700 (PDT) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dd33d5a3efsm2872718b6e.17.2024.08.20.08.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 08:58:53 -0700 (PDT) From: David Lechner Date: Tue, 20 Aug 2024 10:58:35 -0500 Subject: [PATCH 1/4] iio: adc: ad4695: add 2nd regmap for 16-bit registers Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240820-ad4695-gain-offset-v1-1-c8f6e3b47551@baylibre.com> References: <20240820-ad4695-gain-offset-v1-0-c8f6e3b47551@baylibre.com> In-Reply-To: <20240820-ad4695-gain-offset-v1-0-c8f6e3b47551@baylibre.com> To: Jonathan Cameron Cc: Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Corbet , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, David Lechner X-Mailer: b4 0.14.1 The AD4695 and similar chips have some multibyte registers that have to be read/written in a single operation. So we need to add a 2nd regmap for these registers. These registers are removed from the 8-bit regmap allowable ranges and AD4695_MAX_REG is dropped since it would be ambiguous now. debugfs register access is also updated to automatically use the correct regmap depending on the register address. Signed-off-by: David Lechner --- drivers/iio/adc/ad4695.c | 83 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 68 insertions(+), 15 deletions(-) diff --git a/drivers/iio/adc/ad4695.c b/drivers/iio/adc/ad4695.c index b8547914f00f..63d816ad2d1f 100644 --- a/drivers/iio/adc/ad4695.c +++ b/drivers/iio/adc/ad4695.c @@ -34,6 +34,7 @@ /* AD4695 registers */ #define AD4695_REG_SPI_CONFIG_A 0x0000 #define AD4695_REG_SPI_CONFIG_A_SW_RST (BIT(7) | BIT(0)) +#define AD4695_REG_SPI_CONFIG_A_ADDR_DIR BIT(5) #define AD4695_REG_SPI_CONFIG_B 0x0001 #define AD4695_REG_SPI_CONFIG_B_INST_MODE BIT(7) #define AD4695_REG_DEVICE_TYPE 0x0003 @@ -77,7 +78,6 @@ #define AD4695_REG_GAIN_IN(n) (0x00C0 | (2 * (n))) #define AD4695_REG_AS_SLOT(n) (0x0100 | (n)) #define AD4695_REG_AS_SLOT_INX GENMASK(3, 0) -#define AD4695_MAX_REG 0x017F /* Conversion mode commands */ #define AD4695_CMD_EXIT_CNV_MODE 0x0A @@ -121,6 +121,7 @@ struct ad4695_channel_config { struct ad4695_state { struct spi_device *spi; struct regmap *regmap; + struct regmap *regmap16; struct gpio_desc *reset_gpio; /* voltages channels plus temperature and timestamp */ struct iio_chan_spec iio_chan[AD4695_MAX_CHANNELS + 2]; @@ -150,8 +151,10 @@ static const struct regmap_range ad4695_regmap_rd_ranges[] = { regmap_reg_range(AD4695_REG_SPI_CONFIG_C, AD4695_REG_SPI_STATUS), regmap_reg_range(AD4695_REG_STATUS, AD4695_REG_ALERT_STATUS2), regmap_reg_range(AD4695_REG_CLAMP_STATUS, AD4695_REG_CLAMP_STATUS), - regmap_reg_range(AD4695_REG_SETUP, AD4695_REG_TEMP_CTRL), - regmap_reg_range(AD4695_REG_CONFIG_IN(0), AD4695_MAX_REG), + regmap_reg_range(AD4695_REG_SETUP, AD4695_REG_AC_CTRL), + regmap_reg_range(AD4695_REG_GPIO_CTRL, AD4695_REG_TEMP_CTRL), + regmap_reg_range(AD4695_REG_CONFIG_IN(0), AD4695_REG_CONFIG_IN(15)), + regmap_reg_range(AD4695_REG_AS_SLOT(0), AD4695_REG_AS_SLOT(127)), }; static const struct regmap_access_table ad4695_regmap_rd_table = { @@ -164,8 +167,10 @@ static const struct regmap_range ad4695_regmap_wr_ranges[] = { regmap_reg_range(AD4695_REG_SCRATCH_PAD, AD4695_REG_SCRATCH_PAD), regmap_reg_range(AD4695_REG_LOOP_MODE, AD4695_REG_LOOP_MODE), regmap_reg_range(AD4695_REG_SPI_CONFIG_C, AD4695_REG_SPI_STATUS), - regmap_reg_range(AD4695_REG_SETUP, AD4695_REG_TEMP_CTRL), - regmap_reg_range(AD4695_REG_CONFIG_IN(0), AD4695_MAX_REG), + regmap_reg_range(AD4695_REG_SETUP, AD4695_REG_AC_CTRL), + regmap_reg_range(AD4695_REG_GPIO_CTRL, AD4695_REG_TEMP_CTRL), + regmap_reg_range(AD4695_REG_CONFIG_IN(0), AD4695_REG_CONFIG_IN(15)), + regmap_reg_range(AD4695_REG_AS_SLOT(0), AD4695_REG_AS_SLOT(127)), }; static const struct regmap_access_table ad4695_regmap_wr_table = { @@ -174,15 +179,47 @@ static const struct regmap_access_table ad4695_regmap_wr_table = { }; static const struct regmap_config ad4695_regmap_config = { - .name = "ad4695", + .name = "ad4695-8", .reg_bits = 16, .val_bits = 8, - .max_register = AD4695_MAX_REG, + .max_register = AD4695_REG_AS_SLOT(127), .rd_table = &ad4695_regmap_rd_table, .wr_table = &ad4695_regmap_wr_table, .can_multi_write = true, }; +static const struct regmap_range ad4695_regmap16_rd_ranges[] = { + regmap_reg_range(AD4695_REG_STD_SEQ_CONFIG, AD4695_REG_STD_SEQ_CONFIG), + regmap_reg_range(AD4695_REG_UPPER_IN(0), AD4695_REG_GAIN_IN(15)), +}; + +static const struct regmap_access_table ad4695_regmap16_rd_table = { + .yes_ranges = ad4695_regmap16_rd_ranges, + .n_yes_ranges = ARRAY_SIZE(ad4695_regmap16_rd_ranges), +}; + +static const struct regmap_range ad4695_regmap16_wr_ranges[] = { + regmap_reg_range(AD4695_REG_STD_SEQ_CONFIG, AD4695_REG_STD_SEQ_CONFIG), + regmap_reg_range(AD4695_REG_UPPER_IN(0), AD4695_REG_GAIN_IN(15)), +}; + +static const struct regmap_access_table ad4695_regmap16_wr_table = { + .yes_ranges = ad4695_regmap16_wr_ranges, + .n_yes_ranges = ARRAY_SIZE(ad4695_regmap16_wr_ranges), +}; + +static const struct regmap_config ad4695_regmap16_config = { + .name = "ad4695-16", + .reg_bits = 16, + .reg_stride = 2, + .val_bits = 16, + .val_format_endian = REGMAP_ENDIAN_LITTLE, + .max_register = AD4695_REG_GAIN_IN(15), + .rd_table = &ad4695_regmap16_rd_table, + .wr_table = &ad4695_regmap16_wr_table, + .can_multi_write = true, +}; + static const struct iio_chan_spec ad4695_channel_template = { .type = IIO_VOLTAGE, .indexed = 1, @@ -646,13 +683,24 @@ static int ad4695_debugfs_reg_access(struct iio_dev *indio_dev, struct ad4695_state *st = iio_priv(indio_dev); iio_device_claim_direct_scoped(return -EBUSY, indio_dev) { - if (readval) - return regmap_read(st->regmap, reg, readval); - - return regmap_write(st->regmap, reg, writeval); + if (readval) { + if (regmap_check_range_table(st->regmap, reg, + &ad4695_regmap_rd_table)) + return regmap_read(st->regmap, reg, readval); + if (regmap_check_range_table(st->regmap16, reg, + &ad4695_regmap16_rd_table)) + return regmap_read(st->regmap16, reg, readval); + } else { + if (regmap_check_range_table(st->regmap, reg, + &ad4695_regmap_wr_table)) + return regmap_write(st->regmap, reg, writeval); + if (regmap_check_range_table(st->regmap16, reg, + &ad4695_regmap16_wr_table)) + return regmap_write(st->regmap16, reg, writeval); + } } - unreachable(); + return -EINVAL; } static const struct iio_info ad4695_info = { @@ -807,6 +855,11 @@ static int ad4695_probe(struct spi_device *spi) return dev_err_probe(dev, PTR_ERR(st->regmap), "Failed to initialize regmap\n"); + st->regmap16 = devm_regmap_init_spi(spi, &ad4695_regmap16_config); + if (IS_ERR(st->regmap16)) + return dev_err_probe(dev, PTR_ERR(st->regmap16), + "Failed to initialize regmap16\n"); + ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(ad4695_power_supplies), ad4695_power_supplies); @@ -876,9 +929,9 @@ static int ad4695_probe(struct spi_device *spi) msleep(AD4695_T_WAKEUP_SW_MS); } - /* Needed for debugfs since it only access registers 1 byte at a time. */ - ret = regmap_set_bits(st->regmap, AD4695_REG_SPI_CONFIG_C, - AD4695_REG_SPI_CONFIG_C_MB_STRICT); + /* Needed for regmap16 to be able to work correctly. */ + ret = regmap_set_bits(st->regmap, AD4695_REG_SPI_CONFIG_A, + AD4695_REG_SPI_CONFIG_A_ADDR_DIR); if (ret) return ret; From patchwork Tue Aug 20 15:58:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13770432 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (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 15AA6194ADB for ; Tue, 20 Aug 2024 15:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724169538; cv=none; b=d8em1aVivoRE+XhN+JZ44+3nWLLndqRASOSybsC/LUureWfp2VteMEgx4SbTcqIzZnhJ2p93xLwvhdgSvbMFNIOweQNfQdFFkPMh7KA1/yrY/5KmezraaJjF2wFLSt+umVg58jM1JotkgeD9IlcS+UdpK2EGbHl+l/6G3GmHBOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724169538; c=relaxed/simple; bh=oaJmi/ZJxtUimFsdNU5rkHVdgv/yFGZx1cME/QQcQl0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pbdwTQlJfnhwg37+ySCQWK8HVtq2qSdpkqSRu/z8x/IbOQpeP2A7WrMchq4mVtMt96khdWn372h0VXk21MScki1mWqt00APFq/FX3jM6IZw21aENJvpc8cd37U5fz0+1i4A9IIYUEc5i0V4QCjGseG/Wqov+kKHRap2Xy4rc8z4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=gDBZaDyx; arc=none smtp.client-ip=209.85.167.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="gDBZaDyx" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3db1d0fca58so3403578b6e.3 for ; Tue, 20 Aug 2024 08:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1724169534; x=1724774334; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=HECI8r7T3u0JJ5Sp0TIQJdhUl6oQitYnZhldhbcQNd4=; b=gDBZaDyx/B8rLKbArX27DDnjyZuPyQlWPxhjVduEZO8pVGLu8xEtkHiF1t6M/USsfA I41M3NoJewibYYsop7nCwS84z56g8DTlwrv04grKTibOorqXIZ/LqRIOJ/rSz3tg/QI2 MfVHTcDn2++E5xHOtv172unTGk2eqgWA1UY1rDGTMQUtwN0OjmUnyd69GGlsvXCO9oZ0 KpTySUBaxlyLq7YtN0k88Sz+i3jxTyF4mgylvG08w/o3RKeFudvHehXXn1SVNap/ywqt 3Yu0HZzB4VkW80M8zdoAtowl6abRiTTttnLcawI1flzrh76lBuC/3Xi3WSHg6GOnJGMB Khig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724169534; x=1724774334; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HECI8r7T3u0JJ5Sp0TIQJdhUl6oQitYnZhldhbcQNd4=; b=jUDn9mYd6y3Fw+Xoz8imjTvJ62q9duxxqcjr+h5zwYFeuf78sppdAy6BVHwPa05ol5 KC0lfiC2TmY+F9yx7/IYxKfDrMS7mBaxIGRFjI3FO+NMnCfwHWivkQcDSauAxfaNA/Gm ELG2wb6Vj3l78LPzjH4HzDRL8Tn8yiGezdKsVXCda6QB2zIHbgECFznU6JULdIviv7C1 YZj69XpXRRUrLFyOH7dRf2MdWyMZXvsxM4lMzt26QnXuD8uuGxGAbmDQZHoN9B0xA9KU tzLlwvkrb0I2RyTJxO9s9bbnxd/0C1mzeTIWtYb2WFZ6nTPt1gU2OKVHX+WCE0UjHJkH 7l4A== X-Forwarded-Encrypted: i=1; AJvYcCXgo02dTsqA1m3xQ9r8x4AFmCXEWMEbf/mEqBXF9ALYlRs2RfKwtNAqGzB09Q7v6A1nhTsXiz8QdZ8=@vger.kernel.org X-Gm-Message-State: AOJu0Yzhot/ei87MMQkeLWj31TOcZEmBAhQjKYwQTpiEFUKPl4GPQcFZ BuPEc1dET9VsAX1gtfWJISfJh4J8y7GRuFUlscusMOd882u2upRwCzHFgi/L4/Q= X-Google-Smtp-Source: AGHT+IHIkAhI9bCg/czmhOwJ00jGYFHqeuQAh3GUl0mP8FSSaKUHPiSl0FgDu1UYYUa+B/YzS+e4WQ== X-Received: by 2002:a05:6808:238f:b0:3dc:1b05:73fd with SMTP id 5614622812f47-3dd3acf921dmr18073312b6e.10.1724169534171; Tue, 20 Aug 2024 08:58:54 -0700 (PDT) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dd33d5a3efsm2872718b6e.17.2024.08.20.08.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 08:58:53 -0700 (PDT) From: David Lechner Date: Tue, 20 Aug 2024 10:58:36 -0500 Subject: [PATCH 2/4] iio: adc: ad4695: implement calibration support Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240820-ad4695-gain-offset-v1-2-c8f6e3b47551@baylibre.com> References: <20240820-ad4695-gain-offset-v1-0-c8f6e3b47551@baylibre.com> In-Reply-To: <20240820-ad4695-gain-offset-v1-0-c8f6e3b47551@baylibre.com> To: Jonathan Cameron Cc: Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Corbet , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, David Lechner X-Mailer: b4 0.14.1 The AD4695 has a calibration feature that allows the user to compensate for variations in the analog front end. This implements this feature in the driver using the standard `calibgain` and `calibbias` attributes. Signed-off-by: David Lechner --- drivers/iio/adc/ad4695.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 157 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ad4695.c b/drivers/iio/adc/ad4695.c index 63d816ad2d1f..181c4146188c 100644 --- a/drivers/iio/adc/ad4695.c +++ b/drivers/iio/adc/ad4695.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -225,7 +226,11 @@ static const struct iio_chan_spec ad4695_channel_template = { .indexed = 1, .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE) | - BIT(IIO_CHAN_INFO_OFFSET), + BIT(IIO_CHAN_INFO_OFFSET) | + BIT(IIO_CHAN_INFO_CALIBSCALE) | + BIT(IIO_CHAN_INFO_CALIBBIAS), + .info_mask_separate_available = BIT(IIO_CHAN_INFO_CALIBSCALE) | + BIT(IIO_CHAN_INFO_CALIBBIAS), .scan_type = { .sign = 'u', .realbits = 16, @@ -619,7 +624,8 @@ static int ad4695_read_raw(struct iio_dev *indio_dev, struct ad4695_state *st = iio_priv(indio_dev); struct ad4695_channel_config *cfg = &st->channels_cfg[chan->scan_index]; u8 realbits = chan->scan_type.realbits; - int ret; + unsigned int reg_val; + int ret, tmp; switch (mask) { case IIO_CHAN_INFO_RAW: @@ -670,6 +676,153 @@ static int ad4695_read_raw(struct iio_dev *indio_dev, default: return -EINVAL; } + case IIO_CHAN_INFO_CALIBSCALE: + switch (chan->type) { + case IIO_VOLTAGE: + iio_device_claim_direct_scoped(return -EBUSY, indio_dev) { + ret = regmap_read(st->regmap16, + AD4695_REG_GAIN_IN(chan->scan_index), + ®_val); + if (ret) + return ret; + + *val = reg_val; + *val2 = 15; + + return IIO_VAL_FRACTIONAL_LOG2; + } + unreachable(); + default: + return -EINVAL; + } + case IIO_CHAN_INFO_CALIBBIAS: + switch (chan->type) { + case IIO_VOLTAGE: + iio_device_claim_direct_scoped(return -EBUSY, indio_dev) { + ret = regmap_read(st->regmap16, + AD4695_REG_OFFSET_IN(chan->scan_index), + ®_val); + if (ret) + return ret; + + tmp = sign_extend32(reg_val, 15); + + *val = tmp / 4; + *val2 = abs(tmp) % 4 * MICRO / 4; + + if (tmp < 0 && *val2) { + *val *= -1; + *val2 *= -1; + } + + return IIO_VAL_INT_PLUS_MICRO; + } + unreachable(); + default: + return -EINVAL; + } + default: + return -EINVAL; + } +} + +static int ad4695_write_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int val, int val2, long mask) +{ + struct ad4695_state *st = iio_priv(indio_dev); + unsigned int reg_val; + int ret; + + iio_device_claim_direct_scoped(return -EBUSY, indio_dev) { + switch (mask) { + case IIO_CHAN_INFO_CALIBSCALE: + switch (chan->type) { + case IIO_VOLTAGE: + if (val < 0 || val2 < 0) + reg_val = 0; + else if (val > 1) + reg_val = U16_MAX; + else + reg_val = (val * (1 << 16) + + mul_u64_u32_div(val2, 1 << 16, + MICRO)) / 2; + + return regmap_write(st->regmap16, + AD4695_REG_GAIN_IN(chan->scan_index), + reg_val); + default: + return -EINVAL; + } + case IIO_CHAN_INFO_CALIBBIAS: + switch (chan->type) { + case IIO_VOLTAGE: + if (val2 >= 0 && val > S16_MAX / 4) + reg_val = S16_MAX; + else if ((val2 < 0 ? -val : val) < S16_MIN / 4) + reg_val = S16_MIN; + else if (val2 < 0) + reg_val = clamp_t(int, + -(val * 4 + -val2 * 4 / MICRO), + S16_MIN, S16_MAX); + else if (val < 0) + reg_val = clamp_t(int, + val * 4 - val2 * 4 / MICRO, + S16_MIN, S16_MAX); + else + reg_val = clamp_t(int, + val * 4 + val2 * 4 / MICRO, + S16_MIN, S16_MAX); + + return regmap_write(st->regmap16, + AD4695_REG_OFFSET_IN(chan->scan_index), + reg_val); + default: + return -EINVAL; + } + default: + return -EINVAL; + } + } + unreachable(); +} + +static int ad4695_read_avail(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + const int **vals, int *type, int *length, + long mask) +{ + static const int ad4695_calibscale_available[6] = { + /* Range of 0 (inclusive) to 2 (exclusive) */ + 0, 15, 1, 15, U16_MAX, 15 + }; + static const int ad4695_calibbias_available[6] = { + /* + * Datasheet says FSR/8 which translates to signed/4. The step + * depends on oversampling ratio which is always 1 for now. + */ + S16_MIN / 4, 0, 0, MICRO / 4, S16_MAX / 4, S16_MAX % 4 * MICRO / 4 + }; + + switch (mask) { + case IIO_CHAN_INFO_CALIBSCALE: + switch (chan->type) { + case IIO_VOLTAGE: + *vals = ad4695_calibscale_available; + *type = IIO_VAL_FRACTIONAL_LOG2; + return IIO_AVAIL_RANGE; + default: + return -EINVAL; + } + case IIO_CHAN_INFO_CALIBBIAS: + switch (chan->type) { + case IIO_VOLTAGE: + *vals = ad4695_calibbias_available; + *type = IIO_VAL_INT_PLUS_MICRO; + return IIO_AVAIL_RANGE; + default: + return -EINVAL; + } default: return -EINVAL; } @@ -705,6 +858,8 @@ static int ad4695_debugfs_reg_access(struct iio_dev *indio_dev, static const struct iio_info ad4695_info = { .read_raw = &ad4695_read_raw, + .write_raw = &ad4695_write_raw, + .read_avail = &ad4695_read_avail, .debugfs_reg_access = &ad4695_debugfs_reg_access, }; From patchwork Tue Aug 20 15:58:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13770431 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (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 EBAFD195B37 for ; Tue, 20 Aug 2024 15:58:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724169537; cv=none; b=gtJmZHcx6sTXfdDz9bFx6trkQBxJWKAufsBmWae2Uvd3URMB2qPlzvUA5Ob0EbJ8z6PI9+YPDqDEykywwWxxdoxcpwL8Ygnwt1xdY+DbvNXT6CeFEiaxEBaiNH5LP9D7SXofLYTP5JHZKiNzxOvP5EQ9UKTjDpHBo15zb+dQmDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724169537; c=relaxed/simple; bh=WGhbcSyIIr/fQOdxh9+s+geW6Hei0Wbkpns6twCPCAg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cLcZRmA3TaDPOFTGUII7MpEJR1AcYLrhuJwnOzFMeI4XGeeRi68hJKyH3ZDZFyOZ63HtfcOxhH0aDzNfe+aafUvxZduwaYrx/WNVQCVOv7tqxtAZny62gphxyE/VfNRjs8d1pta7h9gYlovXAqTlKz9gZ5eHzgs78onkbcGS8jY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=BMMLy95M; arc=none smtp.client-ip=209.85.167.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="BMMLy95M" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-3db1bc36bc2so2773102b6e.0 for ; Tue, 20 Aug 2024 08:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1724169535; x=1724774335; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qDlT04LNCgm2mSm4ARTKoN0QbMcB1grVRpO0j/iJMDE=; b=BMMLy95M5bEYGtMOHV/WAFw1QuJ9n5cWA0VJs+WPP8WHwRnumLzZdoyFUWr9+CVAsg cDNrEb+z1I0PwQcUFrfRaWCJva7ZcbIwZFgEcfBG2bSwQ9M+TGnFVvNSX9thJ9XnNXAt vErUtaRBRgmbbnNZziJRwt/WTys9x6csmy569bnN0y68H4fJGAzZh9e7qDIrooztkI9e x/dIQ5ferjxZJN7CRdOenygj8MTvTOfHacHTPODQAEk+T4Z5EmM45IgZRD1JX9QEglUv Baa3BP1iyjgK9S76AE1SsIejYcUCwcZ2A/hsd1kIP6yMbJiJjaq/pIS6n6ZjWb6ISNK+ AZNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724169535; x=1724774335; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qDlT04LNCgm2mSm4ARTKoN0QbMcB1grVRpO0j/iJMDE=; b=obK/dNEq0DqhQscen/N8YG5J7oqNzKah5eJboPfeglTGF/AqXwtp/v0HoorVCMjCV3 AK+h23G9N4CgmTUE2Y3a6VWBEQlqLABeFx1xKm60P2z/vvNrQqW1s3O1PX/Dn8NaXasN Pq3mY91J+e1iF7F5CxqTNCfz7/9hEIM8oUhy02T1E2Vig0Re0rRR1jcOoRQIyXAQAOUj WTLEI0UvxHyWVnISOicTuMCvj2+E6e8X0Ruah5fazS8lmVmkngr4YMSi45DgyqVtzBS5 mTFKyjj4512eQJyNNvAie9SavDgvAvXChDRdEbSRpQFiuv3SXU0XCl9MAJwG0WUUiiNi bBHQ== X-Forwarded-Encrypted: i=1; AJvYcCW61/HMZPEIUnys2Ym7Go/xEctzb0dzeVFX9rvy6JQWOfid6WMz+tBiWu3p7gLhV91gIgx+qTzNr+c=@vger.kernel.org X-Gm-Message-State: AOJu0Yx78kWoW8mG/wbYVQEJ0HDF1a591OM6y2i7H5yV0MrkjJz4+5ZY n1gaecYC7o82PV6w4QHaTxlRaF58KCG/Pcv0H/nagRd2hNS3zeWIigDH5P1BhyE= X-Google-Smtp-Source: AGHT+IHkutffJWZQ/q5tRdDMPF0l50eePnYWl7D4EWVgBKv1fTppJhXqO9viedy+cV6Oir8LahGePQ== X-Received: by 2002:a05:6808:302a:b0:3db:32c6:a7cb with SMTP id 5614622812f47-3ddb9cbf40dmr1472297b6e.9.1724169534926; Tue, 20 Aug 2024 08:58:54 -0700 (PDT) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dd33d5a3efsm2872718b6e.17.2024.08.20.08.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 08:58:54 -0700 (PDT) From: David Lechner Date: Tue, 20 Aug 2024 10:58:37 -0500 Subject: [PATCH 3/4] doc: iio: ad4695: update for calibration support Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240820-ad4695-gain-offset-v1-3-c8f6e3b47551@baylibre.com> References: <20240820-ad4695-gain-offset-v1-0-c8f6e3b47551@baylibre.com> In-Reply-To: <20240820-ad4695-gain-offset-v1-0-c8f6e3b47551@baylibre.com> To: Jonathan Cameron Cc: Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Corbet , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, David Lechner X-Mailer: b4 0.14.1 Calibration support has been added to the ad4695 driver, so update the documentation to reflect this. Signed-off-by: David Lechner --- Documentation/iio/ad4695.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/iio/ad4695.rst b/Documentation/iio/ad4695.rst index 7612596bb6e9..33ed29b7c98a 100644 --- a/Documentation/iio/ad4695.rst +++ b/Documentation/iio/ad4695.rst @@ -143,13 +143,18 @@ present, then the external reference voltage is used and the internal buffer is disabled. If ``refin-supply`` is present, then the internal buffered reference voltage is used. +Gain/offset calibration +----------------------- + +System calibration is supported using the channel gain and offset registers via +the ``calibscale`` and ``calibbias`` attributes respectively. + Unimplemented features ---------------------- - Additional wiring modes - Threshold events - Oversampling -- Gain/offset calibration - GPIO support - CRC support From patchwork Tue Aug 20 15:58:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13770433 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (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 A0417196C67 for ; Tue, 20 Aug 2024 15:58:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724169538; cv=none; b=Rv2d3YDOHefCKUUnpEezD18dfLpVaFsXRVOcNMxi73lpawzVealW/EdLvD19JO37jAAAzOxoaWzA7izY79Y8k3aV4ID9BTf5VuOoxeTWKZWeW6FUH39lyAyDV2msDiFfVSNp6N1CzwXi4fehSynoXpTcgnU48kqtgYGNb6EmpoI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724169538; c=relaxed/simple; bh=plzPScmSdjLox3OYdz9t2P7i8g4UtSg4NyCpXW7I1m4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tsgZFZM/BCR9UAmA5zEKWK0uOrvId2zuuFi5K8kVg4Ctz+O0/Xnu7s2VPt6Re0B082xEMX618f6J7soFIpKg91qnkl6lhC+ipCsAjRnGD1h3jBVXaWqb2Xu6/hxLy+ye8u9+4/PnaUcP6zVebKg9Q9Ah/ojcUzooBDnq5fbZ/e4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=z3GAUfFB; arc=none smtp.client-ip=209.85.167.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="z3GAUfFB" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3db18842a4dso3401303b6e.0 for ; Tue, 20 Aug 2024 08:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1724169536; x=1724774336; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rfB87M+ajklff9IR1StKsGavCV4e8E2kBLAYS9A+WSE=; b=z3GAUfFBJb9Fr9y5ct6dqH57lQtBem4fP09z9PPB3juPZdXZ3vKuVq1cyArYpChE7s ReuskLcI3i0+xiEqEjiPIS1Ko2dAzc3WQiF+ez993HRqzOWaWrSt1n4C/SGX/tQUSiWQ VaRiIfewuTLRnWMPz+PGz/BBQ1qZisFx+rR6KtDBkyieUxYHH3lhC7xDmzJIhgwBROAa jhxf5R8hmmYm828bakmtbL6OEiuT51mPyUXiF9j9qd7VAbyeLIxmkZrF0WrNzPJWDHNF thM2DBmBwn6F7PPtAJvuHbAydhEzJ+n14yIbyLCj2sjqEyrXr3JovDl7w1p0Le8g4mGw K4zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724169536; x=1724774336; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rfB87M+ajklff9IR1StKsGavCV4e8E2kBLAYS9A+WSE=; b=a5PrSFOx+4CJ9FUbHR9gyQb/96bwWssUB4HvFqZp6Pe0HTpwdUkM8zbdMJuM9KRfq2 uK85JzyL1Z/FOZFr4RGC0cAZTs/fpjD7DRkk4FsDkIWllU1ykK7kuhi+F6TpZkKBx7Ta 8s+Z0yooOsMHPhz0OxIV0trzDc7fbizEDMx7qte/rc3CRyFpK6rdEt6artpwYJDZ31Vh l6+9TZ2X9JtqpUb2hfC5z83kesM1I+e2mk/nYS5GnPTLyvpFuPJqB7eneFR6p16Cyllg WT5HiZvAelo1IrY9BaYtVOHljJygnPKD/nD5ArN8WOwEgNLiyYCQyJZO3WEZnvgS7ZR1 qtPA== X-Forwarded-Encrypted: i=1; AJvYcCVgF4ixTpG3ulMWK7f3eQ7NBxC9WAinFeeUWE8+KK5Fp+yQ3gun9MLafy/jES0tv4eTxgH5GOP4ETjM4KgQVnMBiRbaJd7pv8i7 X-Gm-Message-State: AOJu0YzVjtqADFqFg/NA3/lSBvMvnG9TTrnAb4Y4Behkp1cGpQYpMkR4 VGylZBVNHz6UkKoe7/8CFy9SRV8vebLlWJEDmARR1yacwT0yhKni6QIzVmwgD9Q= X-Google-Smtp-Source: AGHT+IEeoSdOkv8tmbc7KwjQ9tuFv/ugArVpvf2FmLeUfmeuA5fXqNWShnl4Dr6Ie3etUsR24flJvw== X-Received: by 2002:a05:6808:15a3:b0:3d9:dbe9:7cee with SMTP id 5614622812f47-3ddb9cbf10emr1211638b6e.14.1724169535714; Tue, 20 Aug 2024 08:58:55 -0700 (PDT) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dd33d5a3efsm2872718b6e.17.2024.08.20.08.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 08:58:55 -0700 (PDT) From: David Lechner Date: Tue, 20 Aug 2024 10:58:38 -0500 Subject: [PATCH 4/4] iio: ABI: document ad4695 new attributes Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240820-ad4695-gain-offset-v1-4-c8f6e3b47551@baylibre.com> References: <20240820-ad4695-gain-offset-v1-0-c8f6e3b47551@baylibre.com> In-Reply-To: <20240820-ad4695-gain-offset-v1-0-c8f6e3b47551@baylibre.com> To: Jonathan Cameron Cc: Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Corbet , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, David Lechner X-Mailer: b4 0.14.1 The ad4695 driver now supports calibration using the in_voltageY_calib{scale,bias}[_available] attributes. Only one of these was documented before. This adds rest. Signed-off-by: David Lechner --- Documentation/ABI/testing/sysfs-bus-iio | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 345d58535dc9..89943c2d54e8 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -541,6 +541,7 @@ What: /sys/bus/iio/devices/iio:deviceX/in_proximity_calibbias What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calibbias What: /sys/bus/iio/devices/iio:deviceX/in_resistance_calibbias What: /sys/bus/iio/devices/iio:deviceX/in_temp_calibbias +What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_calibbias What: /sys/bus/iio/devices/iio:deviceX/out_currentY_calibbias What: /sys/bus/iio/devices/iio:deviceX/out_voltageY_calibbias KernelVersion: 2.6.35 @@ -556,6 +557,7 @@ What: /sys/bus/iio/devices/iio:deviceX/in_accel_calibbias_available What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_calibbias_available What: /sys/bus/iio/devices/iio:deviceX/in_temp_calibbias_available What: /sys/bus/iio/devices/iio:deviceX/in_proximity_calibbias_available +What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_calibbias_available What: /sys/bus/iio/devices/iio:deviceX/out_voltageY_calibbias_available KernelVersion: 5.8 Contact: linux-iio@vger.kernel.org @@ -603,6 +605,7 @@ Description: What: /sys/bus/iio/devices/iio:deviceX/in_illuminanceY_calibscale_available What: /sys/bus/iio/devices/iio:deviceX/in_intensityY_calibscale_available What: /sys/bus/iio/devices/iio:deviceX/in_proximityY_calibscale_available +What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_calibscale_available KernelVersion: 4.8 Contact: linux-iio@vger.kernel.org Description: