From nobody Fri Apr 17 21:04:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A227DC433EF for ; Thu, 21 Jul 2022 19:16:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232634AbiGUTQa (ORCPT ); Thu, 21 Jul 2022 15:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232490AbiGUTQJ (ORCPT ); Thu, 21 Jul 2022 15:16:09 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD37F88E22; Thu, 21 Jul 2022 12:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1658430934; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xLBaXOfpO4qyAy7Jvs3CDBcjV0wCVjhwgyi0HxwjqVY=; b=iKxXW9LVarH8R+m9bHd1XF8FZt8OoF4phsTTDiBPEKk6EzeIzlGU7CSKGakZxx0ZFywwn4 7ipeetzNKzACpn+O5wHjzfAueMyZ2MOu3CKZDwxlqomPF1WnChiACCv9gowP2RP4HIIigu yvXX2N+Ux3MnMbmsUKzD1AbmdTNhn3w= From: Paul Cercueil To: Jonathan Cameron , Peter Rosin Cc: Lars-Peter Clausen , list@opendingux.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 1/4] iio: inkern: Remove useless argument to iio_channel_read_max() Date: Thu, 21 Jul 2022 20:15:23 +0100 Message-Id: <20220721191526.374152-2-paul@crapouillou.net> In-Reply-To: <20220721191526.374152-1-paul@crapouillou.net> References: <20220721191526.374152-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The 'type' argument was passed by the only caller of the iio_channel_read_max() function as a pointer to return an extra value, but the value of the variable passed by the caller was never read afterwards. Signed-off-by: Paul Cercueil --- drivers/iio/inkern.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index df74765d33dc..e8a25852f0df 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -813,21 +813,22 @@ int iio_read_avail_channel_raw(struct iio_channel *ch= an, EXPORT_SYMBOL_GPL(iio_read_avail_channel_raw); =20 static int iio_channel_read_max(struct iio_channel *chan, - int *val, int *val2, int *type, + int *val, int *val2, enum iio_chan_info_enum info) { int unused; const int *vals; int length; int ret; + int type; =20 if (!val2) val2 =3D &unused; =20 - ret =3D iio_channel_read_avail(chan, &vals, type, &length, info); + ret =3D iio_channel_read_avail(chan, &vals, &type, &length, info); switch (ret) { case IIO_AVAIL_RANGE: - switch (*type) { + switch (type) { case IIO_VAL_INT: *val =3D vals[2]; break; @@ -840,7 +841,7 @@ static int iio_channel_read_max(struct iio_channel *cha= n, case IIO_AVAIL_LIST: if (length <=3D 0) return -EINVAL; - switch (*type) { + switch (type) { case IIO_VAL_INT: *val =3D vals[--length]; while (length) { @@ -863,7 +864,6 @@ int iio_read_max_channel_raw(struct iio_channel *chan, = int *val) { struct iio_dev_opaque *iio_dev_opaque =3D to_iio_dev_opaque(chan->indio_d= ev); int ret; - int type; =20 mutex_lock(&iio_dev_opaque->info_exist_lock); if (!chan->indio_dev->info) { @@ -871,7 +871,7 @@ int iio_read_max_channel_raw(struct iio_channel *chan, = int *val) goto err_unlock; } =20 - ret =3D iio_channel_read_max(chan, val, NULL, &type, IIO_CHAN_INFO_RAW); + ret =3D iio_channel_read_max(chan, val, NULL, IIO_CHAN_INFO_RAW); err_unlock: mutex_unlock(&iio_dev_opaque->info_exist_lock); =20 --=20 2.35.1 From nobody Fri Apr 17 21:04:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B05DAC43334 for ; Thu, 21 Jul 2022 19:16:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233673AbiGUTQd (ORCPT ); Thu, 21 Jul 2022 15:16:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233501AbiGUTQL (ORCPT ); Thu, 21 Jul 2022 15:16:11 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C135281; Thu, 21 Jul 2022 12:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1658430935; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LREkjgo/OLUP8VZvhRzR1bR2iChWZ8LSMmvhzG4e+xA=; b=Rq13j/a0og8OKoNapQcUcTC6HDoz6hyVYgWFEX6rmoIMoMYv3/wBrvuwc033Neo4pN2Z58 5PRFieWuiGZE3w08SVyuqXCbMSOD2J/Ny/q8D8I0qKkvqD5oUkEXJpjv789tyzSqPKsJk5 jvNiSw+VtHse775vvuX0fJFYXmKEBlk= From: Paul Cercueil To: Jonathan Cameron , Peter Rosin Cc: Lars-Peter Clausen , list@opendingux.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 2/4] iio: core: Add support for IIO_AVAIL_LIST_WITH_TYPE Date: Thu, 21 Jul 2022 20:15:24 +0100 Message-Id: <20220721191526.374152-3-paul@crapouillou.net> In-Reply-To: <20220721191526.374152-1-paul@crapouillou.net> References: <20220721191526.374152-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The IIO_AVAIL_LIST_WITH_TYPE specifies that the array that corresponds to the available values is composed by cells of 3 integers, the first two representing the value itself (similar to what you would have with IIO_AVAIL_LIST), and the third integer representing the encoding type of the value. This can be used for instance when a driver's .read_avail() callback returns values which cannot be represented with an unique encoding type. Signed-off-by: Paul Cercueil --- drivers/iio/industrialio-core.c | 25 +++++++++++++++++++++++++ drivers/iio/inkern.c | 23 +++++++++++++++++++++++ include/linux/iio/consumer.h | 6 ++++-- include/linux/iio/types.h | 1 + 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-cor= e.c index adf054c7a75e..99ced9eab069 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -838,6 +838,29 @@ static ssize_t iio_format_avail_range(char *buf, const= int *vals, int type) return iio_format_list(buf, vals, type, 3, "[", "]"); } =20 +static ssize_t iio_format_avail_list_with_type(char *buf, const int *vals, + int length) +{ + ssize_t len =3D 0; + int i; + + for (i =3D 0; i < length; i +=3D 3) { + if (i !=3D 0) { + len +=3D sysfs_emit_at(buf, len, " "); + if (len >=3D PAGE_SIZE) + return -EFBIG; + } + + len +=3D __iio_format_value(buf, len, vals[i + 2], 2, &vals[i]); + if (len >=3D PAGE_SIZE) + return -EFBIG; + } + + len +=3D sysfs_emit_at(buf, len, "\n"); + + return len; +} + static ssize_t iio_read_channel_info_avail(struct device *dev, struct device_attribute *attr, char *buf) @@ -860,6 +883,8 @@ static ssize_t iio_read_channel_info_avail(struct devic= e *dev, return iio_format_avail_list(buf, vals, type, length); case IIO_AVAIL_RANGE: return iio_format_avail_range(buf, vals, type); + case IIO_AVAIL_LIST_WITH_TYPE: + return iio_format_avail_list_with_type(buf, vals, length); default: return -EINVAL; } diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index e8a25852f0df..92d225f1ddd5 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -855,6 +855,29 @@ static int iio_channel_read_max(struct iio_channel *ch= an, } return 0; =20 + case IIO_AVAIL_LIST_WITH_TYPE: + if (length <=3D 0 || length % 3 !=3D 0) + return -EINVAL; + + if (vals[length - 1] !=3D IIO_VAL_INT) { + /* FIXME: learn about max for other iio values */ + return -EINVAL; + } + + *val =3D vals[length - 3]; + length -=3D 3; + + for (; length; length -=3D 3) { + if (vals[length - 1] !=3D IIO_VAL_INT) { + /* FIXME: learn about max for other iio values */ + return -EINVAL; + } + + if (vals[length - 3] > *val) + *val =3D vals[length - 3]; + } + return 0; + default: return ret; } diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index 5fa5957586cf..99dd12e10fb6 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h @@ -309,7 +309,8 @@ int iio_read_max_channel_raw(struct iio_channel *chan, = int *val); * @vals: Available values read back. * @length: Number of entries in vals. * - * Returns an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST. + * Returns an error code, IIO_AVAIL_RANGE, IIO_AVAIL_LIST or + * IIO_AVAIL_LIST_WITH_TYPE. * * For ranges, three vals are always returned; min, step and max. * For lists, all the possible values are enumerated. @@ -328,7 +329,8 @@ int iio_read_avail_channel_raw(struct iio_channel *chan, * @length: Number of entries in vals. * @attribute: info attribute to be read back. * - * Returns an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST. + * Returns an error code, IIO_AVAIL_RANGE, IIO_AVAIL_LIST or + * IIO_AVAIL_LIST_WITH_TYPE. */ int iio_read_avail_channel_attribute(struct iio_channel *chan, const int **vals, int *type, int *length, diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index a7aa91f3a8dc..9777d1357080 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -32,6 +32,7 @@ enum iio_event_info { enum iio_available_type { IIO_AVAIL_LIST, IIO_AVAIL_RANGE, + IIO_AVAIL_LIST_WITH_TYPE, }; =20 enum iio_chan_info_enum { --=20 2.35.1 From nobody Fri Apr 17 21:04:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF0DAC43334 for ; Thu, 21 Jul 2022 19:16:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231953AbiGUTQq (ORCPT ); Thu, 21 Jul 2022 15:16:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232521AbiGUTQT (ORCPT ); Thu, 21 Jul 2022 15:16:19 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DB5688F31; Thu, 21 Jul 2022 12:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1658430935; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4deDKaInTPPI431B2aFwgBdfpUrMgmqvd/2POX4jGg8=; b=N0a4h7r90Owsb3XFhJyLBauhbzyBIY7yIH+CAlbl8I7enq6xqFbIOddTmpi+wF8Jq+cmr2 jDVG8ute2ilHNHCBquyQZ/QVEWPOZb3cA9PviiNb4iB6V+UjaFUdJclwWkMpoT2eiv/HwQ S7XILqM6j9Zag6Y9km8er7mT/MmL3YM= From: Paul Cercueil To: Jonathan Cameron , Peter Rosin Cc: Lars-Peter Clausen , list@opendingux.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 3/4] iio: afe/rescale: Add support for converting scale avail table Date: Thu, 21 Jul 2022 20:15:25 +0100 Message-Id: <20220721191526.374152-4-paul@crapouillou.net> In-Reply-To: <20220721191526.374152-1-paul@crapouillou.net> References: <20220721191526.374152-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When the IIO channel has a scale_available attribute, we want the values contained to be properly converted the same way the scale value is. Since rescale_process_scale() may change the encoding type, we must convert the IIO_AVAIL_LIST to a IIO_AVAIL_LIST_WITH_TYPE. Signed-off-by: Paul Cercueil --- drivers/iio/afe/iio-rescale.c | 85 +++++++++++++++++++++++++++++++++ include/linux/iio/afe/rescale.h | 2 + 2 files changed, 87 insertions(+) diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c index 6949d2151025..5c9970b93384 100644 --- a/drivers/iio/afe/iio-rescale.c +++ b/drivers/iio/afe/iio-rescale.c @@ -232,6 +232,18 @@ static int rescale_read_avail(struct iio_dev *indio_de= v, *type =3D IIO_VAL_INT; return iio_read_avail_channel_raw(rescale->source, vals, length); + case IIO_CHAN_INFO_SCALE: + if (rescale->chan_processed) { + return iio_read_avail_channel_attribute(rescale->source, + vals, type, + length, + IIO_CHAN_INFO_SCALE); + } else if (rescale->scale_len) { + *length =3D rescale->scale_len; + *vals =3D rescale->scale_data; + return IIO_AVAIL_LIST_WITH_TYPE; + } + fallthrough; default: return -EINVAL; } @@ -266,11 +278,74 @@ static ssize_t rescale_write_ext_info(struct iio_dev = *indio_dev, buf, len); } =20 +static int rescale_init_scale_avail(struct device *dev, struct rescale *re= scale) +{ + int ret, type, length, *data; + const int *scale_raw; + unsigned int i; + size_t out_len; + + ret =3D iio_read_avail_channel_attribute(rescale->source, &scale_raw, + &type, &length, + IIO_CHAN_INFO_SCALE); + if (ret < 0) + return ret; + + switch (ret) { + case IIO_AVAIL_LIST_WITH_TYPE: + out_len =3D length; + break; + case IIO_AVAIL_LIST: + if (type =3D=3D IIO_VAL_INT) + out_len =3D length * 3 / 1; + else + out_len =3D length * 3 / 2; + break; + default: + /* TODO: Support IIO_AVAIL_RANGE */ + return -EOPNOTSUPP; + } + + data =3D devm_kzalloc(dev, sizeof(*data) * out_len, GFP_KERNEL); + if (!data) + return -ENOMEM; + + if (ret =3D=3D IIO_AVAIL_LIST_WITH_TYPE) { + memcpy(data, scale_raw, sizeof(*scale_raw) * length); + } else if (type =3D=3D IIO_VAL_INT) { + for (i =3D 0; i < length; i++) { + data[i * 3 + 0] =3D scale_raw[i]; + data[i * 3 + 2] =3D IIO_VAL_INT; + } + } else { + for (i =3D 0; i < length / 2; i++) { + data[i * 3 + 0] =3D scale_raw[i * 2]; + data[i * 3 + 1] =3D scale_raw[i * 2 + 1]; + data[i * 3 + 2] =3D type; + } + } + + for (i =3D 0; i < out_len; i +=3D 3) { + ret =3D rescale_process_scale(rescale, data[i + 2], + &data[i], &data[i + 1]); + if (ret < 0) + return ret; + + data[i + 2] =3D ret; + } + + rescale->scale_len =3D out_len; + rescale->scale_data =3D data; + + return 0; +} + static int rescale_configure_channel(struct device *dev, struct rescale *rescale) { struct iio_chan_spec *chan =3D &rescale->chan; struct iio_chan_spec const *schan =3D rescale->source->channel; + int ret; =20 chan->indexed =3D 1; chan->output =3D schan->output; @@ -303,6 +378,16 @@ static int rescale_configure_channel(struct device *de= v, !rescale->chan_processed) chan->info_mask_separate_available |=3D BIT(IIO_CHAN_INFO_RAW); =20 + if (iio_channel_has_available(schan, IIO_CHAN_INFO_SCALE)) { + chan->info_mask_separate_available |=3D BIT(IIO_CHAN_INFO_SCALE); + + if (!rescale->chan_processed) { + ret =3D rescale_init_scale_avail(dev, rescale); + if (ret) + return ret; + } + } + return 0; } =20 diff --git a/include/linux/iio/afe/rescale.h b/include/linux/iio/afe/rescal= e.h index 6eecb435488f..74de2962f864 100644 --- a/include/linux/iio/afe/rescale.h +++ b/include/linux/iio/afe/rescale.h @@ -26,6 +26,8 @@ struct rescale { s32 numerator; s32 denominator; s32 offset; + int scale_len; + int *scale_data; }; =20 int rescale_process_scale(struct rescale *rescale, int scale_type, --=20 2.35.1 From nobody Fri Apr 17 21:04:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60A42C433EF for ; Thu, 21 Jul 2022 19:16:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231504AbiGUTQu (ORCPT ); Thu, 21 Jul 2022 15:16:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiGUTQX (ORCPT ); Thu, 21 Jul 2022 15:16:23 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41F4A8CCB6; Thu, 21 Jul 2022 12:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1658430936; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TpEIrkLg+RjeEMsJEobFd+We3zuNbgRhORtJwFe7tLo=; b=bxnjjU7WPFUAxSxikQTXmPCNzA1fAgt26b0E6uUpzMunNZ/fDl4LU9xzq4vrInKEr/Pn1k vio8/kSsjlAy99y7jhf6P6GkDRWP/v45euOEg9Im5xKhWoVD66isfNMCNE18/cDsnYwHY1 F6wO1Kg5nNbieDMoMR/09y/QH06DVdo= From: Paul Cercueil To: Jonathan Cameron , Peter Rosin Cc: Lars-Peter Clausen , list@opendingux.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 4/4] iio: afe/rescale: Implement write_raw Date: Thu, 21 Jul 2022 20:15:26 +0100 Message-Id: <20220721191526.374152-5-paul@crapouillou.net> In-Reply-To: <20220721191526.374152-1-paul@crapouillou.net> References: <20220721191526.374152-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Implement write_raw by converting the value if writing the scale, or just calling the managed channel driver's write_raw otherwise. Signed-off-by: Paul Cercueil --- drivers/iio/afe/iio-rescale.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c index 5c9970b93384..0edb62ee4508 100644 --- a/drivers/iio/afe/iio-rescale.c +++ b/drivers/iio/afe/iio-rescale.c @@ -141,6 +141,27 @@ int rescale_process_offset(struct rescale *rescale, in= t scale_type, } } =20 +static int rescale_write_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int val, int val2, long mask) +{ + struct rescale *rescale =3D iio_priv(indio_dev); + unsigned long long tmp; + + switch (mask) { + case IIO_CHAN_INFO_SCALE: + tmp =3D val * 1000000000LL; + do_div(tmp, rescale->numerator); + tmp *=3D rescale->denominator; + do_div(tmp, 1000000000LL); + return iio_write_channel_attribute(rescale->source, tmp, 0, + IIO_CHAN_INFO_SCALE); + default: + return iio_write_channel_attribute(rescale->source, + val, val2, mask); + } +} + static int rescale_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, long mask) @@ -250,6 +271,7 @@ static int rescale_read_avail(struct iio_dev *indio_dev, } =20 static const struct iio_info rescale_info =3D { + .write_raw =3D rescale_write_raw, .read_raw =3D rescale_read_raw, .read_avail =3D rescale_read_avail, }; --=20 2.35.1