From nobody Tue Dec 16 13:45:58 2025 Received: from mx0a-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 5E2981E500C; Thu, 5 Jun 2025 15:11:18 +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=1749136285; cv=none; b=O96d7T7auLVVuRdF9RR2tWq3fSWgRLlfUcH/4s0K1K5YWumTHTpNQEF3evXLbSbN5aw3vy64Mt9rda/0/bh0mlf/jVQEiTy1Coz6jV77rl1y8MsBdw4/otZcsPHurkL/KdRaaTzZSb3BFaqWChfBmFB+4dx56lBOyNWnfW8Rrww= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749136285; c=relaxed/simple; bh=2JyA02+J17gKDs3P6bAfJ+EgQIB2HUiMcEmOaQpzOZc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GiraqAEmKEkcd9MnQMT34m2/Lj74bfR7UhcP2gRniUx9ONALYdkeE3lnHSH1ZGDc8Fovl9fkQDuYMCOysCs/EC+2WxHW9TVkRw92Q7COWbzKPNbaATHU39552zrWdRrUQ/eZz76L25rI3FgwKngqdBpn133YeyaTnEjAz68QOPE= 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=VPvDNEWN; 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="VPvDNEWN" Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 555CUEv5028860; Thu, 5 Jun 2025 11:10:53 -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=SoRsU e701uAXtwjzKmJ7ZwX9X02mhtHa6W5vXKxvKe0=; b=VPvDNEWNDvjDdbnf12xbA M8yIG3ux9ZFgk/KlgIyYueXV/SpX2yxt/gbafOPwkkVlD73XZhqDCnEO5CYDPU1g /Be3RAbZLb07xcSU0L/2AMtPsbfXyFrsJXBWcPH4rdPMh4QAnGQs9Zn0Dvl2zClx Rffhionu8Tkxh5JnrmKq3i1oVxsAFB8r2K4LGbowEqy9RpjVYERiwdtUpCPBd4xh ZR0C/gg5Z1LGSF8FvdfOsnAXQgpt1NzgInJHCU9Va6jfPOWOCcG2ZbT6iN1jCiRM 2cnw5WouUZJr66rNwYaJoKfGjckicA8+vwHcVrSDbZP10eIsrS8bdTU/baysXGbv g== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 471g9j8jes-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Jun 2025 11:10:53 -0400 (EDT) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 555FApaS004157 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 5 Jun 2025 11:10:51 -0400 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Thu, 5 Jun 2025 11:10:51 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Thu, 5 Jun 2025 11:10:51 -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; Thu, 5 Jun 2025 11:10:51 -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 555FA1us027831; Thu, 5 Jun 2025 11:10:43 -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 , Guillaume Stols , "Tobias Sperling" , Marcelo Schmitt , Trevor Gamblin , "Esteban Blanc" , =?UTF-8?q?Jo=C3=A3o=20Paulo=20Gon=C3=A7alves?= , Ioan Daniel , , , Subject: [PATCH v7 3/5] iio: adc: adi-axi-adc: add axi_adc_oversampling_ratio_set Date: Thu, 5 Jun 2025 18:09:41 +0300 Message-ID: <20250605150948.3091827-4-pop.ioan-daniel@analog.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250605150948.3091827-1-pop.ioan-daniel@analog.com> References: <20250605150948.3091827-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: 4Uyu86V5lcmuTryf4k9WIQPrjTysNjXN X-Authority-Analysis: v=2.4 cv=DfIXqutW c=1 sm=1 tr=0 ts=6841b37d cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=6IFa9wvqVegA:10 a=IpJZQVW2AAAA:8 a=gAnH3GRIAAAA:8 a=hj20C08OGkFrgq5-ZMUA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=IawgGOuG5U0WyFbmm1f5:22 X-Proofpoint-ORIG-GUID: 4Uyu86V5lcmuTryf4k9WIQPrjTysNjXN X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjA1MDEzMiBTYWx0ZWRfX0LGj/hnlDvkA 65cb7c90R1clvbInQXjZ2oXmhClH8sP7W2FZV9bKSA+43l7GVOVhO3lqNtj76onw7uZ7SyxtWhI b7A4j6bYmr4Lf4flrFTalBx9b4IK4enTMehOqlRb+LdGE6dLfSkYA4heqds31aK5HuSAjWQEx0X EIYWnNILqr8l6ypkpyC9Xj2B3Kqz3e6OTd9XYMWrZlH0tPj3QMueCzg+fi7wuIPxy9J9VtND2iz xK1niCkm8vprkWslFFooSS/dQzEQ6ohv3oH/GM8z2DwGkoslALa/yZJ6WGWmEi9McerG+NOnpMg 1TmiJKxucgA6ld6xE4n6qU0u539T5vZWf72BA7tYrTsnXxA0Zhpm5Lu67Y0Hz6rr5J926IafZ4h H5ksAEGtxUn88sv/pi5udETWZYC/cegCiWMcGD4ygFMdrbXSmPg2K4W+Pr5BKyqnAQAqIO+d 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-06-05_03,2025-06-05_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 suspectscore=0 adultscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506050132 Add support for setting decimation rate. Reviewed-by: David Lechner Reviewed-by: Nuno S=C3=A1 Signed-off-by: Pop Ioan Daniel --- no changes in v7. drivers/iio/adc/adi-axi-adc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c index 9e8c30230791..0b8673668745 100644 --- a/drivers/iio/adc/adi-axi-adc.c +++ b/drivers/iio/adc/adi-axi-adc.c @@ -80,6 +80,9 @@ #define ADI_AXI_ADC_REG_CHAN_CTRL_3(c) (0x0418 + (c) * 0x40) #define ADI_AXI_ADC_CHAN_PN_SEL_MASK GENMASK(19, 16) =20 +#define ADI_AXI_ADC_REG_CHAN_USR_CTRL_2(c) (0x0424 + (c) * 0x40) +#define ADI_AXI_ADC_CHAN_USR_CTRL_2_DEC_RATE_N_MASK GENMASK(15, 0) + /* IO Delays */ #define ADI_AXI_ADC_REG_DELAY(l) (0x0800 + (l) * 0x4) #define AXI_ADC_DELAY_CTRL_MASK GENMASK(4, 0) @@ -242,6 +245,19 @@ static int axi_adc_test_pattern_set(struct iio_backend= *back, } } =20 +static int axi_adc_oversampling_ratio_set(struct iio_backend *back, + unsigned int chan, + unsigned int rate) +{ + struct adi_axi_adc_state *st =3D iio_backend_get_priv(back); + + return regmap_update_bits(st->regmap, + ADI_AXI_ADC_REG_CHAN_USR_CTRL_2(chan), + ADI_AXI_ADC_CHAN_USR_CTRL_2_DEC_RATE_N_MASK, + FIELD_PREP(ADI_AXI_ADC_CHAN_USR_CTRL_2_DEC_RATE_N_MASK, + rate)); +} + static int axi_adc_read_chan_status(struct adi_axi_adc_state *st, unsigned= int chan, unsigned int *status) { @@ -550,6 +566,7 @@ static const struct iio_backend_ops adi_axi_adc_ops =3D= { .test_pattern_set =3D axi_adc_test_pattern_set, .chan_status =3D axi_adc_chan_status, .interface_type_get =3D axi_adc_interface_type_get, + .oversampling_ratio_set =3D axi_adc_oversampling_ratio_set, .debugfs_reg_access =3D iio_backend_debugfs_ptr(axi_adc_reg_access), .debugfs_print_chan_status =3D iio_backend_debugfs_ptr(axi_adc_debugfs_pr= int_chan_status), }; --=20 2.34.1