From nobody Fri Dec 19 17:18:01 2025 Received: from mx0b-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2A63281366; Mon, 19 May 2025 14:03:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747663430; cv=none; b=M/jGF7yl/lNVnL/h862mZqbLLfuIt+bj4DHPsnIhgoutj5IBHHZ28WrGFAmOCfhp1nrDtNnh3ZymDcoo2jrAtdWZIaXEzBmKTGCo5X9+TyLtZUzU0yawIzQpq0R/oVtSIq0jjJYXgyEo6wPYa5kCrDaLxHeGXYg9jEBPN5xVCwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747663430; c=relaxed/simple; bh=1zDM1PgNvtQwT4WhfyLGPv1x/7cmDJLAjgJyUfe9lkc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QeNK3Cm46rsVnarIpj09u7poGkH/aAxSrs4XlUpM27bKFsNlJ/YzDkpCXj7pBCo7z3pFQLYsBc2A4Oogb0rf1AmGIzy6ySlCT5yeDrUOi/QqmgGCv9uY1UWysel5ax6W64AB0RmuxaiOW7Q0LwdjeQLFBObnwk44A7ZjVu17c4s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=sxhZILo8; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="sxhZILo8" Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54JCKmTO024220; Mon, 19 May 2025 10:03:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=p4uO/ wSrNmyPZWU43/Bu9snkfrCLBZrGqVYFDKLMt7w=; b=sxhZILo88rx2mcz3nXuKi tNDrNCJ/dafOPv1QOscN0kugZrn4YyMH7/a83MyLz0R1vlUf19WfYX9tM6fK6Qet udU4tS/UEwYRPHRV2itoXsNQ/s5B5pkdeMr5rmRIQrZQNRjj4mmxHFvx/0V9pXSe ZLpGMRk1Fav7DadsI3NStMuWXXRVoL9FnTnYs81uBzJx1i+pEM7tCOHTbWfRCV6V bXjOKSwhiYmLXZeqnv1p/L9achqfopiEgiq/PtNLJlylSLzGLMLJGHOHX38lDu2d X9iPY0K7gxIiIlf1c/0jdhrkUSAOrs2xZuJDTzv4OI8nxb68ye/PFvSmMcEfVI99 g== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 46q8sfwjfr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 May 2025 10:03:18 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 54JE3HGX026729 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 19 May 2025 10:03:17 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Mon, 19 May 2025 10:03:17 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Mon, 19 May 2025 10:03:17 -0400 Received: from romlx5.adlk.analog.com ([10.48.65.73]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 54JE2bPE016713; Mon, 19 May 2025 10:03:09 -0400 From: Pop Ioan Daniel To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sergiu Cuciurean , Dragos Bogdan , Antoniu Miclaus , Olivier Moysan , Javier Carrasco , Matti Vaittinen , Tobias Sperling , Alisa-Dariana Roman , Marcelo Schmitt , Herve Codina , Trevor Gamblin , Thomas Bonnefille , Ioan Daniel , , , Subject: [PATCH v4 2/6] iio: backend: update iio_backend_oversampling_ratio_set Date: Mon, 19 May 2025 17:02:10 +0300 Message-ID: <20250519140220.81489-3-pop.ioan-daniel@analog.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250519140220.81489-1-pop.ioan-daniel@analog.com> References: <20250519140220.81489-1-pop.ioan-daniel@analog.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 X-ADIRuleOP-NewSCL: Rule Triggered X-Authority-Analysis: v=2.4 cv=FusF/3rq c=1 sm=1 tr=0 ts=682b3a26 cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=dt9VzEwgFbYA:10 a=gAnH3GRIAAAA:8 a=lxCnnINleEiMd-tkFrgA:9 X-Proofpoint-GUID: 7eUZO-5NBB5H757vVwDwiIDHDTDfJhcy X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTE5MDEzMCBTYWx0ZWRfXw9hpGXkyqn1R QIWMA6nNRgZOc6OgUwRqkecfXc7BkgSds0Zsk9pN3b/l1Xxxt98A1zgHLs+r27PXufupTtUV5DF 2mc3Y+qn2D6fb64UkMoucbrV+9eXH73tV9MQ9mj+Ej4wFUnJcYr+l6ct3By6ba3r6TJwjfq97aI nmDEi+XaYM7hvgrq0ysZuZhdeM3s9cESNzhB82stKnjPptQAL75NhESDMC/E8HWDdTkSXxpMG70 h/0m83D08ERAW/BeXaHLTx08JQ05Mh70DXC5mUwCjw/M7LcqZB3Y3ZQ8gHX/A+82FioY0RjyHNv gvfkFdrQy+yI/6E9vZQDisThEXrajVOCqtXTDhgUoq7JVQiB9jN+OszSBsP5+3yfPu8x0O7qPXR PlNgh1PHYYCN33zSHgTKgCrgLgT5yXBIG14+rvoKOQLTRhxl/QeXs2dKUxr5+IhrfKTz4Jo3 X-Proofpoint-ORIG-GUID: 7eUZO-5NBB5H757vVwDwiIDHDTDfJhcy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-19_06,2025-05-16_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 clxscore=1015 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505070000 definitions=main-2505190130 Content-Type: text/plain; charset="utf-8" Add chan parameter to iio_backed_oversampling_ration_set() to allow for contexts where the channel must be specified. Modify all existing users. Signed-off-by: Pop Ioan Daniel Reviewed-by: David Lechner Reviewed-by: Nuno S=C3=A1 --- changes in v4: - pass 0 in the list of parameters instead of chan drivers/iio/adc/ad4851.c | 4 ++-- drivers/iio/industrialio-backend.c | 3 ++- include/linux/iio/backend.h | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/ad4851.c b/drivers/iio/adc/ad4851.c index 12f90aa3a156..1f975858c496 100644 --- a/drivers/iio/adc/ad4851.c +++ b/drivers/iio/adc/ad4851.c @@ -319,8 +319,8 @@ static int ad4851_set_oversampling_ratio(struct iio_dev= *indio_dev, if (ret) return ret; } - - ret =3D iio_backend_oversampling_ratio_set(st->back, osr); + /* Channel is ignored by the backend being used here */ + ret =3D iio_backend_oversampling_ratio_set(st->back, 0, osr); if (ret) return ret; =20 diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-= backend.c index c1eb9ef9db08..a4e3e54fecb1 100644 --- a/drivers/iio/industrialio-backend.c +++ b/drivers/iio/industrialio-backend.c @@ -720,9 +720,10 @@ EXPORT_SYMBOL_NS_GPL(iio_backend_data_size_set, "IIO_B= ACKEND"); * 0 on success, negative error number on failure. */ int iio_backend_oversampling_ratio_set(struct iio_backend *back, + unsigned int chan, unsigned int ratio) { - return iio_backend_op_call(back, oversampling_ratio_set, ratio); + return iio_backend_op_call(back, oversampling_ratio_set, chan, ratio); } EXPORT_SYMBOL_NS_GPL(iio_backend_oversampling_ratio_set, "IIO_BACKEND"); =20 diff --git a/include/linux/iio/backend.h b/include/linux/iio/backend.h index e59d909cb659..dbf4e4a5f4b1 100644 --- a/include/linux/iio/backend.h +++ b/include/linux/iio/backend.h @@ -144,7 +144,7 @@ struct iio_backend_ops { enum iio_backend_interface_type *type); int (*data_size_set)(struct iio_backend *back, unsigned int size); int (*oversampling_ratio_set)(struct iio_backend *back, - unsigned int ratio); + unsigned int chan, unsigned int ratio); int (*read_raw)(struct iio_backend *back, struct iio_chan_spec const *chan, int *val, int *val2, long mask); @@ -209,6 +209,7 @@ int iio_backend_interface_type_get(struct iio_backend *= back, enum iio_backend_interface_type *type); int iio_backend_data_size_set(struct iio_backend *back, unsigned int size); int iio_backend_oversampling_ratio_set(struct iio_backend *back, + unsigned int chan, unsigned int ratio); int iio_backend_read_raw(struct iio_backend *back, struct iio_chan_spec const *chan, int *val, int *val2, --=20 2.34.1