From mboxrd@z Thu Jan 1 00:00:00 1970 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 BF3FB22D7A3; Fri, 16 May 2025 08:26:53 +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=1747384015; cv=none; b=pDt1vxKLsZQnZLd5ZrUCU4gLSgO6G+lO1iaBYD+cW8pn58zuKvz+EzRhL4XDN8FEBXECyZ5yz6eFLeT99fjTU8oTkvmwEuj7r0RFySFJ3vNI6CqcAMf/ZhVeItGA5HWxFVYT0NHTlknb2XsO3PAkO+zSEuRC6cBJMiEIHCX2l0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747384015; c=relaxed/simple; bh=zTgUJp3yfRh24aQRxQ7JpregeB2lmVHnk2oL69bOIfE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KUl40q/OgmhO/hAVIXn65Ha5JDZV4IsT1oIzyCwAQF/IUQ9A3gFCx/xOiqAWXzdTtNMVC9S66I2j/9gJmYGLqPfQMeJDEaviLogs76tvDhnl4hlftJSq2xTi2VnuR/A62KOckrQVXiqgPOyqRbzrZK40rnISYgS0qPVK6J5z7o8= 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=HcQNOFbo; 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="HcQNOFbo" Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54G8Ce19016372; Fri, 16 May 2025 04:26:51 -0400 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=qi1MZ dhtpkjqfPalS3GM0DLpRKCm0ghOFvcuAV7JYPc=; b=HcQNOFboZuNtgNltPu2D4 QquMWycAZLCAZ68+Tu/TP2b5gosYBLcr6DzXFVWSCXkw2y+Nc4N80LQxL1eltv2m YYuaZRzKaAGerRzG7AlTXQMDbzN9UQkLdKI9n5NEw+ixfR/0S/T0gzaU525Fxfpi xvolNaCMHrg7ZeB/XBfXXxBs3KI8OaSs9bxaCZDXf5wPB1IgQVNdAsB2e+/oJFDd 2EnXQoYUwOMP8M5gVlM3uKxi2bCQR5rBO8OfZQK5UzOBD/trkM0bCwk/o3jD1+jp niUu/9rwekkW1syIRS7NIQQM0XlDJgtek+kO9J5ZwARBHhZJHe41MNz209cRQWnk g== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 46mn654vff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 May 2025 04:26:51 -0400 (EDT) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 54G8QoYN033614 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 16 May 2025 04:26:50 -0400 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) 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.986.14; Fri, 16 May 2025 04:26:50 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Fri, 16 May 2025 04:26:49 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Fri, 16 May 2025 04:26:49 -0400 Received: from amiclaus-VirtualBox.ad.analog.com (AMICLAUS-L02.ad.analog.com [10.48.65.120]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 54G8QZwh031549; Fri, 16 May 2025 04:26:44 -0400 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus , =?UTF-8?q?Nuno=20S=C3=A1?= Subject: [PATCH v6 03/10] iio: backend: add support for number of lanes Date: Fri, 16 May 2025 11:26:23 +0300 Message-ID: <20250516082630.8236-4-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250516082630.8236-1-antoniu.miclaus@analog.com> References: <20250516082630.8236-1-antoniu.miclaus@analog.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: 5QdY2yX3sOi9U51_Y-YoQ0EUXhDqvAck X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTE2MDA3OSBTYWx0ZWRfX30OvPaReHpU0 BRWnMjkSsoY9AZCKYjkCWzhgtcSPspTjLx+vAAkHxNfr4VQPzTLetx0vBcRF10BK5dMTajlSyaY NrjcB/UvflhP5en9yGMkzPhmjuZBnce1drVMXeOGb2TzhyR1gGSg7TUVOiRuXQ/S8u4FYag8OKK porxf55yqmeotQfqe55crPZq3MX7z7O0ghYLroyE7zeHGK8G1UeCx/fYf8fhfG//2zZkBm0GxWh rT2Lqa61OsWsFD3s37RA+fTE7gL+twPLaignhxzjwPkLcEBtTN3XBVLQStse0kSD4PMjMU5gRfW E86XTECBo2lCXJHMCiaYnol4Y0uYbQJ/a+yGu37j5edxjKYKgMBb/fOH725Bvi/+EZnd93Sob0d jV/8ybVkif7QdunLlU9jPuaO/IVUY32rYX+s7b4aG3/7ZRRCHAHBRAnnEecPHo1FRX/IR9hV X-Authority-Analysis: v=2.4 cv=SZL3duRu c=1 sm=1 tr=0 ts=6826f6cb cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=gAnH3GRIAAAA:8 a=Ge_Sr372ckFWHCXdfyYA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: 5QdY2yX3sOi9U51_Y-YoQ0EUXhDqvAck 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-16_03,2025-05-15_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 malwarescore=0 spamscore=0 clxscore=1015 phishscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505070000 definitions=main-2505160079 Add iio backend support for number of lanes to be enabled. Reviewed-by: Nuno Sá Signed-off-by: Antoniu Miclaus --- no changes in v6. drivers/iio/industrialio-backend.c | 17 +++++++++++++++++ include/linux/iio/backend.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c index 545923310f1f..537fb3202783 100644 --- a/drivers/iio/industrialio-backend.c +++ b/drivers/iio/industrialio-backend.c @@ -819,6 +819,23 @@ int iio_backend_interface_data_align(struct iio_backend *back, u32 timeout_us) } EXPORT_SYMBOL_NS_GPL(iio_backend_interface_data_align, "IIO_BACKEND"); +/** + * iio_backend_num_lanes_set - Number of lanes enabled. + * @back: Backend device + * @num_lanes: Number of lanes. + * + * RETURNS: + * 0 on success, negative error number on failure. + */ +int iio_backend_num_lanes_set(struct iio_backend *back, unsigned int num_lanes) +{ + if (!num_lanes) + return -EINVAL; + + return iio_backend_op_call(back, num_lanes_set, num_lanes); +} +EXPORT_SYMBOL_NS_GPL(iio_backend_num_lanes_set, "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 a971a83121b7..1be4671c8c07 100644 --- a/include/linux/iio/backend.h +++ b/include/linux/iio/backend.h @@ -110,6 +110,7 @@ enum iio_backend_filter_type { * @debugfs_reg_access: Read or write register value of backend. * @filter_type_set: Set filter type. * @interface_data_align: Perform the data alignment process. + * @num_lanes_set: Set the number of lanes enabled. * @ddr_enable: Enable interface DDR (Double Data Rate) mode. * @ddr_disable: Disable interface DDR (Double Data Rate) mode. * @data_stream_enable: Enable data stream. @@ -163,6 +164,7 @@ struct iio_backend_ops { int (*filter_type_set)(struct iio_backend *back, enum iio_backend_filter_type type); int (*interface_data_align)(struct iio_backend *back, u32 timeout_us); + int (*num_lanes_set)(struct iio_backend *back, unsigned int num_lanes); int (*ddr_enable)(struct iio_backend *back); int (*ddr_disable)(struct iio_backend *back); int (*data_stream_enable)(struct iio_backend *back); @@ -206,6 +208,7 @@ int devm_iio_backend_request_buffer(struct device *dev, int iio_backend_filter_type_set(struct iio_backend *back, enum iio_backend_filter_type type); int iio_backend_interface_data_align(struct iio_backend *back, u32 timeout_us); +int iio_backend_num_lanes_set(struct iio_backend *back, unsigned int num_lanes); 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); -- 2.49.0