From patchwork Thu Feb 20 13:54:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoniu Miclaus X-Patchwork-Id: 13984009 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 EA7581FBC85; Thu, 20 Feb 2025 13:56:16 +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=1740059778; cv=none; b=KBorKoA/6zE1njdKA43UJXkwnG/F07k8LLnMKfjW9iS6KecyzfHzXWz2n2F9sDa4p9pHuji5Ac95U0oH9lhE4uvA20wmqT1QLt0zRlK1aQry61e7gqfK5+7C3Co9hyfaRLY+ySpT2d/EBrr6/88eOhKTsHBodXt9W+Lc5hpTUy0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740059778; c=relaxed/simple; bh=3RSjOqe9NzsnKL0q/4g5Yp8ChrpsBxqRzoJ/T2vxrG8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=raSXmkyWqhiNVB7hWM1e1pne3NeS31LxgHUICNfycNEeuQlZU51H/o3iq1+Z4pkghnefOr0ZBDMkajXfKO6fSPg70ePZDV0Mq7kurJFmx9aliuokK8x0zkfyecm+CRHSe91c6cUlh7IXed3YzyaItZxXnxtXOObBOSUqTTG097A= 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=dwPptpPY; 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="dwPptpPY" 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 51KBM5B3023829; Thu, 20 Feb 2025 08:56:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=BHoA6 psNTXxJ95H0GiKmkfas2kwmnAkfhq+8b0sA+e0=; b=dwPptpPYdvjTF5WgQTibc AaHJ0u3WTgXOBtsmso7VESeXWspZhZZE/A1J0TX73sgy7NfBM0N0jhu8BXWIEznc XVYX4m8N23JooosABViwni/i5NxgUQcEPQKvRRJMT8n+Txzymcnlvu891mGMAGvZ d3run+4yxvKQzu9wQGe1eH1fKrFfmsFq09j0cFEU3HFEmkncC6hnmLmsOiNL7f0b h9beLTIBj2kM7IWgMd356ozSZDhz+kERxWLrqzQfv/ac+jTRzQ36WzjaQC5ZB6zj a6sT/vZmWg5uJxp7mEP9u3c6vgy5/nIONzGvi39JAIrqQcOGRxMxOTxBSolVOpP5 Q== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 44x3f40hds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Feb 2025 08:56:13 -0500 (EST) 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 51KDuCZJ054127 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 20 Feb 2025 08:56:12 -0500 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.986.14; Thu, 20 Feb 2025 08:56:12 -0500 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.986.14 via Frontend Transport; Thu, 20 Feb 2025 08:56:12 -0500 Received: from amiclaus-VirtualBox.ad.analog.com (AMICLAUS-L02.ad.analog.com [10.48.65.155]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 51KDtxqo008409; Thu, 20 Feb 2025 08:56:05 -0500 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus Subject: [PATCH 01/14] iio: backend: add support for filter config Date: Thu, 20 Feb 2025 15:54:11 +0200 Message-ID: <20250220135429.8615-2-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250220135429.8615-1-antoniu.miclaus@analog.com> References: <20250220135429.8615-1-antoniu.miclaus@analog.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: v7yYeNm9mPdys8K6Y8x1HI3QOD7Mh6gy X-Proofpoint-GUID: v7yYeNm9mPdys8K6Y8x1HI3QOD7Mh6gy X-Authority-Analysis: v=2.4 cv=DuKs+H/+ c=1 sm=1 tr=0 ts=67b7347d cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=T2h4t0Lz3GQA:10 a=gAnH3GRIAAAA:8 a=Xg0NEK-fME6xxJ4ObzQA:9 a=oVHKYsEdi7-vN-J5QA_j:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-20_05,2025-02-20_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2502200101 Add backend support for filter enable/disable. This setting can be adjusted within the IP cores interfacing devices. Signed-off-by: Antoniu Miclaus --- drivers/iio/industrialio-backend.c | 26 ++++++++++++++++++++++++++ include/linux/iio/backend.h | 6 ++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c index d4ad36f54090..ffafe7c73508 100644 --- a/drivers/iio/industrialio-backend.c +++ b/drivers/iio/industrialio-backend.c @@ -778,6 +778,32 @@ static int __devm_iio_backend_get(struct device *dev, struct iio_backend *back) return 0; } +/** + * iio_backend_filter_enable - Enable filter + * @back: Backend device + * + * RETURNS: + * 0 on success, negative error number on failure. + */ +int iio_backend_filter_enable(struct iio_backend *back) +{ + return iio_backend_op_call(back, filter_enable); +} +EXPORT_SYMBOL_NS_GPL(iio_backend_filter_enable, "IIO_BACKEND"); + +/** + * iio_backend_filter_disable - Disable filter + * @back: Backend device + * + * RETURNS: + * 0 on success, negative error number on failure. + */ +int iio_backend_filter_disable(struct iio_backend *back) +{ + return iio_backend_op_call(back, filter_disable); +} +EXPORT_SYMBOL_NS_GPL(iio_backend_filter_disable, "IIO_BACKEND"); + /** * iio_backend_ddr_enable - Enable interface DDR (Double Data Rate) mode * @back: Backend device diff --git a/include/linux/iio/backend.h b/include/linux/iio/backend.h index e45b7dfbec35..7987d9f1cdb3 100644 --- a/include/linux/iio/backend.h +++ b/include/linux/iio/backend.h @@ -100,6 +100,8 @@ enum iio_backend_interface_type { * @read_raw: Read a channel attribute from a backend device * @debugfs_print_chan_status: Print channel status into a buffer. * @debugfs_reg_access: Read or write register value of backend. + * @filter_enable: Enable filter. + * @filter_disable: Disable filter. * @ddr_enable: Enable interface DDR (Double Data Rate) mode. * @ddr_disable: Disable interface DDR (Double Data Rate) mode. * @data_stream_enable: Enable data stream. @@ -150,6 +152,8 @@ struct iio_backend_ops { size_t len); int (*debugfs_reg_access)(struct iio_backend *back, unsigned int reg, unsigned int writeval, unsigned int *readval); + int (*filter_enable)(struct iio_backend *back); + int (*filter_disable)(struct iio_backend *back); int (*ddr_enable)(struct iio_backend *back); int (*ddr_disable)(struct iio_backend *back); int (*data_stream_enable)(struct iio_backend *back); @@ -190,6 +194,8 @@ int iio_backend_data_sample_trigger(struct iio_backend *back, int devm_iio_backend_request_buffer(struct device *dev, struct iio_backend *back, struct iio_dev *indio_dev); +int iio_backend_filter_enable(struct iio_backend *back); +int iio_backend_filter_disable(struct iio_backend *back); int iio_backend_ddr_enable(struct iio_backend *back); int iio_backend_ddr_disable(struct iio_backend *back); int iio_backend_data_stream_enable(struct iio_backend *back);