From nobody Wed Apr 1 23:46:39 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 68AA137FF79 for ; Wed, 1 Apr 2026 07:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775028417; cv=none; b=Mcu02cQImIN6Z5neAdvWexE9rIxrQPhCTQwNJ11jOJM6dJj4Ve3bgGVNRi98zjyqlqrn2AQGQ+cabQ4d9BGf2svxDTxRLGWssgPXOx+CiLFwDKx9WU3JyORFpdTyPk/ihQ+iMfc3ty/uSrZqFUYhhhivFBQVZfTkHvdRXkfdZsU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775028417; c=relaxed/simple; bh=HHcarmRqwtUT/YnQfaZxOlaXpKjrD/Y/4QHeex8uzNo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JzHcHVbYRDbwoX3n5bYBRkUh41zA1uw2WbkyDeOXsUIdvfNStNAqDXaftzI966ZaYGhFlgB0japlCxTzGteItq/3sowV+FqAP2FFKcICL/KtWvdb8or0miSRz9QvsrQe0dustfSM0M1t4CfsDw0qw4lrZUrnq0G7TfaqgYDxAN8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=HO2i+Brb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=j7LiSgN9; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="HO2i+Brb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="j7LiSgN9" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63172qVq3103854 for ; Wed, 1 Apr 2026 07:26:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Fp6DewLgWhkxTtOGAF8HtbyDZ+xvVZUBiujky/Sm5BA=; b=HO2i+BrbJS3aiPtj v4kPGZNKYHHM86EH38RuVw7cei4j+KVK6xNRer833xxTv2tlTElZSKpgU5sPejLM BDip6oXrnV1PlK75RYJp6ugchKetW7zmQXWq7WWw9yDBj75EFaSvcQ8nlzmicbyu QLwpltl59LvbAJoqGZUIQwfizh/BK+55T8sSDdHSEky4cM3TuGiOg/bnI570NV9o kqDnzVKejNQ+/I8cTI+CSQdBiBd0Nz/v29xbuu55PrDUqyTrXnLJLH6cAgHgUsif pqiAYs6MWezMRqVjscd1Mv/Ey7o4icaZjcmQeSJgy9PQIFT4E5fVE25FUCzHr8v4 veB8QQ== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d8js233ew-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 01 Apr 2026 07:26:54 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-50b4076dc16so88092471cf.2 for ; Wed, 01 Apr 2026 00:26:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1775028413; x=1775633213; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Fp6DewLgWhkxTtOGAF8HtbyDZ+xvVZUBiujky/Sm5BA=; b=j7LiSgN9nSwJy0BMvsgoT4QLN7iXN/qhqMrjFH4EM5+s/Dx21/7OzR8SfoUrnm6gY+ SoOU6oSubcwN2WdMJI4qgWXIuIM1XoCARvKDtNTVzOSkHvIBDfwstNklle8eCcs1TIr6 PZhlFC00lO5IZkW8Ni3McWdxf3EHWcWMWCgMhcdiniyrEJ8YxFLm/tYg3O1mXdVjOdNP XJGBV/S30RbFr6ZpkQ0Yp6uaKEZ0H+ey43er0hakkFYpVKh4uCs7w7RrZPna8UzgojhD o/KJuOs+cvj5InkiBIpv8RvzeiXDL5WAMwPmPrmI6kQBt57Fl0QxBkFgTlqM9ZiFb+OT 5s3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775028413; x=1775633213; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Fp6DewLgWhkxTtOGAF8HtbyDZ+xvVZUBiujky/Sm5BA=; b=gxZJ5sa7WbPjqk5HkW/g01ewU2F2IhqU9W7NsMcc9DbRv2A+htjQ7bKAE846qmSYYA 5CGjBjCK5VFsj00CTh2TNq4KUG3h2ZD8Ep3gZUzPrtcuNWqzPSXtI+QR1gGWHPn6ZghM PVGudahtMN0Wzf1luS+UAk2YXDlxfPlAqXs5W0QEmJLj5yY4QB9cc3jLLTvNjxX+oHQ5 NmUORKBqJNp10iMXZHVcUtD3QRa14BJqMTnoTgclJ6bUfG14qsQChVZMwg7ahkuVu3pE HajPojR+tpthSrgVMATCBFIuZs5Kphlo6fkLWeBgdOTAhnO7+o8ZpLVqaVYp4sV4gCbq XZyA== X-Forwarded-Encrypted: i=1; AJvYcCVXYBJotA1NUIsimY4sw1G68VN7CiABYxLO7IDtjJyEcW8mhfe69IGyx3YmnkJjJZYneaqeFSrAWbvCeG0=@vger.kernel.org X-Gm-Message-State: AOJu0YytxfbfVXyLmbPx57JgPwopH+tho82pZ5cQ8MRRIr3fcB0QVRrG 1HoU07U9IlOm9nvyvy6vz4ohEFQYHoFQkHu9pXthSPBtGu7RmBKpTP7O5mqzLO+xvEvZyLYXrra v4r9DHVNQv7L2Mm8ZDaZ3SEqN5sOzTynqv/8nxQ8TIelLabEknPADPNA0SAfFieR7F/s= X-Gm-Gg: ATEYQzzT0tTAmjOuffLtaUEi8xJ3SiU+U0WeN1A2sIM9QMyhj8wet0Tr8L6mnOc4YvA kON3kGewgSXGck6Vlo1EGYwPxiAi5u6STxNLOd0FnTUVNqqv6OiYji4yrae+SZvvzIM9OrkJ8Ld elK85l0Z8EZ699FqZFX/qsaJCpQ6wlOXcCgycnX0uAEuxvV6gyogwIAe11fMEy4YscWbKNUpcQO 3ZtNFjHxTEmPubq6g7ZQAXfY3pX3NM8h5S2P8LvgRXIZuR8Fw3z7vDehi5gs96Q/pE3QAi6sowe zhi/sIaSUGRsi42xl5daksF58lfpC3EwRqbCCsNJtEo8k3JiRqVpUxSMiGSnGzkb14Yp5RtqmVR RQauOelBRJC+tGGptylkzlut2QZKkuBST9aQS7PNLeEyuqNcp5efV1HplAL8hAfax+p+rSPabsY Tafo3pS61qonZmBfrFU+RkGSWm3p794xRi8iU= X-Received: by 2002:a05:622a:60c:b0:50b:3a6d:db64 with SMTP id d75a77b69052e-50d3bd40f98mr34192171cf.48.1775028413485; Wed, 01 Apr 2026 00:26:53 -0700 (PDT) X-Received: by 2002:a05:622a:60c:b0:50b:3a6d:db64 with SMTP id d75a77b69052e-50d3bd40f98mr34191931cf.48.1775028413026; Wed, 01 Apr 2026 00:26:53 -0700 (PDT) Received: from umbar.lan (2001-14ba-a073-af00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a073:af00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-38cb9f31972sm8638421fa.12.2026.04.01.00.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2026 00:26:51 -0700 (PDT) From: Dmitry Baryshkov Date: Wed, 01 Apr 2026 10:26:25 +0300 Subject: [PATCH 06/19] drm/of: add helper to count data-lanes on a remote endpoint 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 Message-Id: <20260401-waveshare-dsi-touch-v1-6-5e9119b5a014@oss.qualcomm.com> References: <20260401-waveshare-dsi-touch-v1-0-5e9119b5a014@oss.qualcomm.com> In-Reply-To: <20260401-waveshare-dsi-touch-v1-0-5e9119b5a014@oss.qualcomm.com> To: Neil Armstrong , Jessica Zhang , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Cong Yang , Ondrej Jirman , Javier Martinez Canillas , Jagan Teki , Liam Girdwood , Mark Brown , Linus Walleij , Bartosz Golaszewski Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3274; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=HHcarmRqwtUT/YnQfaZxOlaXpKjrD/Y/4QHeex8uzNo=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBpzMirf/D5V8Y5hyL+Zg63UnoU5G3+GGFvPWTA3 7U5rYhghZ2JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCaczIqwAKCRCLPIo+Aiko 1RVtB/4wGDo7gJsEJlTeeGYm6xCRzzyNAlOtSsGBTzAqQjHPPxemPBNkIIjpDpEz3WAVxdAhg9A z3CJpRTKg2RDGPZjsDcfkwEhklLBd+HYehWEO+wPo9AbfvKZA8sAW51n5xjPOHuoVtuc/sLzp+I S7V8xpBqtx+0B3QlWtjtT4wT+V3nM8h9gJ97rUPvUMnOpeutrDFhB3puaTciW2MnLmCaEHJfveV nuRAV3XJkr5oFj01gfqI08tlheFfBvnTt0HdEk+KLBZREem9VRaSYf+rk+ZnBa2Hdgm6yecZZ7h 8ytRBoa6UKtwFtSYKd+y7TpqPuKaoroauh6BtknYEVstJS5Q X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Proofpoint-ORIG-GUID: ez-BAxp9QcmXrJPwqgUrVPzeScpo9W-3 X-Authority-Analysis: v=2.4 cv=XfqEDY55 c=1 sm=1 tr=0 ts=69ccc8be cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=O3ifdCkKFGgQ8ueZnWQA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDAxMDA2NCBTYWx0ZWRfX+y7tnr21CI1R l64gn0tw8RwDywy32uEmQUrU1U/ePUOabSZ2ER6U6u7BY0ivZF+FfofqM4sYZ58zwQXBBgL1GeV aVp9nb0ExdsPQYERiy83rZCxEbrIIE2AODcQGc0DJl71YdM1Vrcv14FlJeVWpiFI78IeymJiRQi 5AxzpsvRLTbOp4dUWlEjc8UDuQr153l8gA11Q91nu2lRQBsMpvqnQnmmQxIsvU/skjGygmHNfUG d9mGeMyl7l7VRPkRF22Stt/whXJZFZ1Rl++Xm7SEbOHJL5Hgi0hrW98wAFhiWTdlWhPKMwXvk3Q gx8ofKsFq0dlChTLwdWrgCzUJnVAKIohq+tXTdR8D9yBO1gWruB4aKfeUOtFNtGYrOb8asUqbQb 1+0Q7teL3JstAMCTM0bJK5dyvduQXX/C372QT8FhnBke/IwqTd/qpkU9TmQ1EQu7c0+1FjFgzPU 9YibqJx6aIL5e8q8Qng== X-Proofpoint-GUID: ez-BAxp9QcmXrJPwqgUrVPzeScpo9W-3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-01_02,2026-04-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 clxscore=1015 bulkscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2604010064 If the DSI panel supports versatile lanes configuration, its driver might require determining the number of DSI data lanes, which is usually specified on the DSI host side of the OF graph. Add new helper as a pair to drm_of_get_data_lanes_count_ep() that lets callers determine number of data-lanes on the remote side of the OF graph. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_of.c | 34 ++++++++++++++++++++++++++++++++++ include/drm/drm_of.h | 13 +++++++++++++ 2 files changed, 47 insertions(+) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 4f65ce729a47..ef6b09316963 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -558,6 +558,40 @@ int drm_of_get_data_lanes_count_ep(const struct device= _node *port, } EXPORT_SYMBOL_GPL(drm_of_get_data_lanes_count_ep); =20 +/** + * drm_of_get_data_lanes_count_remote - Get DSI/(e)DP data lane count by e= ndpoint + * @port: DT port node of the DSI/(e)DP source or sink + * @port_reg: identifier (value of reg property) of the parent port node + * @reg: identifier (value of reg property) of the endpoint node + * @min: minimum supported number of data lanes + * @max: maximum supported number of data lanes + * + * Count DT "data-lanes" property elements in the remote endpoint and chec= k for + * validity. This variant uses endpoint specifier. + * + * Return: + * * min..max - positive integer count of "data-lanes" elements + * * -EINVAL - the "data-lanes" property is unsupported + * * -ENODEV - the "data-lanes" property is missing + */ +int drm_of_get_data_lanes_count_remote(const struct device_node *port, + int port_reg, int reg, + const unsigned int min, + const unsigned int max) +{ + struct device_node *endpoint, *remote; + int ret; + + endpoint =3D of_graph_get_endpoint_by_regs(port, port_reg, reg); + remote =3D of_graph_get_remote_endpoint(endpoint); + of_node_put(endpoint); + ret =3D drm_of_get_data_lanes_count(remote, min, max); + of_node_put(remote); + + return ret; +} +EXPORT_SYMBOL_GPL(drm_of_get_data_lanes_count_remote); + #if IS_ENABLED(CONFIG_DRM_MIPI_DSI) =20 /** diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h index f2f2bf82eff9..7bcc0ccfe0f4 100644 --- a/include/drm/drm_of.h +++ b/include/drm/drm_of.h @@ -62,6 +62,10 @@ int drm_of_get_data_lanes_count_ep(const struct device_n= ode *port, int port_reg, int reg, const unsigned int min, const unsigned int max); +int drm_of_get_data_lanes_count_remote(const struct device_node *port, + int port_reg, int reg, + const unsigned int min, + const unsigned int max); #else static inline uint32_t drm_of_crtc_port_mask(struct drm_device *dev, struct device_node *port) @@ -140,6 +144,15 @@ drm_of_get_data_lanes_count_ep(const struct device_nod= e *port, { return -EINVAL; } + +static inline int +drm_of_get_data_lanes_count_remote(const struct device_node *port, + int port_reg, int reg, + const unsigned int min, + const unsigned int max) +{ + return -EINVAL; +} #endif =20 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_MIPI_DSI) --=20 2.47.3