From patchwork Tue Feb 20 22:50:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13564691 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF71C15442B for ; Tue, 20 Feb 2024 22:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708469447; cv=none; b=JwB0HcmE6wDxlIKrLH1hFNKQhkUEt/cmZWEzUgRHY9o8u0LYRDFJcRf+9sCFpz/Z60tl03DQO9B9p5KHB0PK3VlN9cgLh44XCUfN9mL/8JeJspY1vNc4M+3VSHSn7PaHFpcHUtjWXIOxl1KxEJU0truT6+2wVS7CxsGIF71u/8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708469447; c=relaxed/simple; bh=ZcRh/iRQY2q3Fj/sfpbDNBd/2gcxPVTg7LyLYjpCUEY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GL4FpS1rK5Yn+LhnGmksp3Ut/wEiPbiTmrJwuBT2GwjbuvmiHRspNPG9Lvo0vkBztKf4gqNDdBz//sYo/5pAnyTJLpuYCCtUUFm/4rKIB/ywvuQ6qRs+SKPXQvNIfQnkT2laGeKctAogYeQhAV+FUc33aSA4nCmq0/paZn6d0+8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=EfnhDTKN; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EfnhDTKN" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a3e75e30d36so505046266b.1 for ; Tue, 20 Feb 2024 14:50:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708469444; x=1709074244; 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=ct5Ne1tMeLUfljWIYAQa013IeOBu49T2Q91/xNCEgqg=; b=EfnhDTKN4FGndt8wHsyMATxYU30m3VporzPADwIx1LejGlz9JYO7pJiwU6N0DN4oaZ 3DCJ6NYqcmXdubkpb+1K073tubdgNllNz3n9EO/STBOIOdyvi+tksl8FEt9R1r4lMRu4 oyFMVB+pRqX7lTtHRSlidr/JucRPvCL2lR0gBTvC5+GLR7zf4400rAXFnlmqFLbkgR03 TlaHJhPI1Iro8zdLk8ImqxmscJ11RTy7D0kFNsGqXoM2609CgwyuEDv35loAXp0WkIQ9 2BQn9CnoIO9xuRTy3FzUYtDGmEacMtQKEZEmfoDg16J6Nl0Hm5DtZ0f/vYpXwg74ZiXx 0v1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708469444; x=1709074244; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ct5Ne1tMeLUfljWIYAQa013IeOBu49T2Q91/xNCEgqg=; b=WFqAfPCYbvg7JCn5o/pTycOIkA3Llkjs4p8ux1knhxAG2Azom6BFU9RQC8tSubLf3G WJt9jqr88BhXyafxV2l2Fx4+qh2x7wX3TdWiWNxbucSv5cVIwEjr1JdvE3MKZ2INDk9C IrEEN8VpFw/WyTUTsnx5+2B7H+lDlEIY1A0N55MNihC/Vs1RIdrd5KpFy2DVcSmH2FyN UzILQffbgrPaEOsoT28WYBhVHixUckHdIVOJBhNP+gLz2qDRxCSMe3iiCDJ3ciH7k4tD eciwCWjB1lWVvDK2YckCXHpmPHZ58/N06HfwEPXpgeKQnLyjI2dAv/XKKsDGg9It94BL 3cCQ== X-Gm-Message-State: AOJu0YyFx6Ssug6TBwL50Y6svH+oybXPUx5M/+HfWRZ3uXTA1i/4QTWy wy3AVoIeMJ+s87KC35aGVA5xbfhj6JVXDjsPil1JKjDINV4934nL2nlfp2QFKkU= X-Google-Smtp-Source: AGHT+IEPbjEuAMs3AWdNr9qrKRwN3dFaeag375cc7XhNIhuiL0+iZxVkSGS3I4IiNQG5WZQU1Pjs0w== X-Received: by 2002:a17:906:2844:b0:a3c:4b73:e3c9 with SMTP id s4-20020a170906284400b00a3c4b73e3c9mr15646194ejc.4.1708469444059; Tue, 20 Feb 2024 14:50:44 -0800 (PST) Received: from [127.0.1.1] ([188.24.162.93]) by smtp.gmail.com with ESMTPSA id g3-20020a170906c18300b00a3ed811cff9sm1601977ejz.154.2024.02.20.14.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 14:50:43 -0800 (PST) From: Abel Vesa Date: Wed, 21 Feb 2024 00:50:31 +0200 Subject: [PATCH RFC 1/3] dt-bindings: display: msm: dp-controller: document X1E80100 compatible Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-x1e80100-display-refactor-connector-v1-1-86c0e1ebd5ec@linaro.org> References: <20240221-x1e80100-display-refactor-connector-v1-0-86c0e1ebd5ec@linaro.org> In-Reply-To: <20240221-x1e80100-display-refactor-connector-v1-0-86c0e1ebd5ec@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kuogee Hsieh , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , Johan Hovold Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Vesa X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1216; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=ZcRh/iRQY2q3Fj/sfpbDNBd/2gcxPVTg7LyLYjpCUEY=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBl1Sy9cQTI8SFd8K/MoqX2osnfbl6r6IB5mn4lQ jBzDis6KwWJAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZdUsvQAKCRAbX0TJAJUV VmM0EACrw90/As2dkDCOvnZebzmr6cjgxftMv7dtx2aw9nd7bWhYS/BIWxoIS6PP8lf0YdJOBwA zLx8E8B0ybX/OCxg7YCkndmk7DuN4vXRJJP0rtX1pFBEAjvBJcH0PtOxAuK5YlNLFMWGlxBAERb XVwWIjPNw94CCtwVZw2Hrq7GETIMGU5Dq553HW9NGuFMdUMMDcE+gJHFem7KRH8nBi0UDuuXrWC sVX7TWVka383d7dVF+PJeyz8PoDTIMwzkJ7Qhkirfxgp0EJlUzO8e/Xb3KU60Q9Yyvj2BUNn2LA IVpbOfz13Nh8qqGEnxjGoy9qJTgZzAtMMHxxByo080kp3+h/+2Qzi3D9+2I5qJcYFdgS0k1B/Zl cE0lAe0gO4gowp4O2MfZFjYu2lwh7DP27K/JtCNHK6QoVGS57EKYqLczzJKEWpPegcyXkSonQke lQPuaMNWB1ERFaWnkfDSm7vBer7cOkgnSj85BJUUxLgC01ZHwrHmHaJBdfOoi/4HVnnZzPjIaRP AQKkkmFaMwTbAkK4Mm4pxiSlzTSgON7cXVGVcZB47LUhi3yaf1am/lCvXpoSODgcOmTv5old7i7 yUp+H0o/iaoh1tuaF7QN1GsuogtyGglMrH1zmHR5db+4ZVAJ3yYMqSQfAbRKYVY8sCtgqLHg/DY o1eGOK+ecF/DK5A== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE Add the X1E80100 to the list of compatibles and docoment the is-edp flag. This new flag will be used from now on to dictate the mode from devicetree, instead of having separate compatibles for eDP and DP. Signed-off-by: Abel Vesa --- Documentation/devicetree/bindings/display/msm/dp-controller.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/display/msm/dp-controller.yaml b/Documentation/devicetree/bindings/display/msm/dp-controller.yaml index ae53cbfb2193..ed11852e403d 100644 --- a/Documentation/devicetree/bindings/display/msm/dp-controller.yaml +++ b/Documentation/devicetree/bindings/display/msm/dp-controller.yaml @@ -27,6 +27,7 @@ properties: - qcom,sdm845-dp - qcom,sm8350-dp - qcom,sm8650-dp + - qcom,x1e80100-dp - items: - enum: - qcom,sm8150-dp @@ -73,6 +74,11 @@ properties: - description: phy 0 parent - description: phy 1 parent + is-edp: + $ref: /schemas/types.yaml#/definitions/flag + description: + Tells the controller to switch to eDP mode + phys: maxItems: 1 From patchwork Tue Feb 20 22:50:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13564692 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AA42154434 for ; Tue, 20 Feb 2024 22:50:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708469449; cv=none; b=ufX2rxB8mA1kpLwHzy+mnpKCPCoZZqcpdZWAkoL3/jqxLMy6IdnOUThDRbS3W9yAbIg3EpUM3OECsLE6OcQX4Uc7L3D5dwd47pTlRkEHgWQs54h3LBR7plbRglfZKh4UhNl6rYLaAe1AqFhdarksSUlUV0qlkdknVu/I8s7YS+8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708469449; c=relaxed/simple; bh=xokivPWqt+OPrUy3qaqKvKtZ107TpFIVR/LoscCcyTU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FoJ/vJoYkFwU7BWhZVjsVUrLcG/OwhjEPIM4mGfc7Rx6KjxynGCEm+acmGy1kXzE5cnIHVTl2C8uAYM2nhLsZoJkwO32IUWWial1O2TLM8dWnZwp+24Kz580v1XEokH6EA+jbu2CnPPWPbz8SXOM81Y/g3WKyjqPg+fkSqsS37s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=eZqhGiNI; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eZqhGiNI" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-564e4df00f3so812908a12.3 for ; Tue, 20 Feb 2024 14:50:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708469445; x=1709074245; 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=UAclynvLiJs4xc4X+n+IF6izOuxUCTeBxe7d9onfU9o=; b=eZqhGiNI3GLeNjqn5J3rsAzWvPZSJkuNmgw0PDB34LNiESTfsJ8iqoT+1iVXLy5P8g NwZEVkCHkhpPeDLFAD7UlSvH/L7w3tdE8h47L2heHxqhZtm8nRcMW4S+2k7JFGexEbzR DwH6HKV6gTe8u0UxUcBW8/oz91WxojjPoSSLUoC943vV02STARfBpHlw6LX1gAAvxkmJ MHrxXis3QMcmislpPFFqMKICqfNCO5JAtcHYQCnBTM06LhBk4FZLDpKTu1dLh6SqG4NG l1jP8dr1J/SY1YUDRuPMyBJUNzlqOLigtUErBUELrnx+o2npj8Ebr5RwIbDAYZP7e2iw nmqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708469445; x=1709074245; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UAclynvLiJs4xc4X+n+IF6izOuxUCTeBxe7d9onfU9o=; b=g1jk1HdE25s4VrYTeX5z54v3qkj/GaHCGG+yr2C0tjo/WDl6aZL8xccwAM5HbxVYdc j2Jup0qweauVq+JPyVYAOWL9xigvCjNeJm5uX+6Y0XCaFGIdj/Spk/Cu8QdqNJ/tkWsz BSEEif2U8X54qeaLuNRoy6tTCJHj8y952aUcLyxOHKXGr8LNfHOcJ1t3zS1w3DvUSVGU QZN7f9lt53QbBzx/0bE/Zw5yNDM0Fg7vOjiTMIcTnYL58GPkligffLm+qlEF1liN3wgD PLLaW8V51R9svO/uI5QdJkHvq596N0sPn/w3wwoXZoNsjqxOPwNQ4G3bsW6E4zrk9yyg iipg== X-Gm-Message-State: AOJu0YyRIIJPjzPk/6HsjIbv1sRvbrXw9L7E11vphn6cWNuyZLJS+BQw T6Cgro1zHCRQhqHSkdIhKVSA1ii/1CEqWyMqv5FlKlu8UNAbfjGOIkh73GfYXHY= X-Google-Smtp-Source: AGHT+IGtp0ljYvl5+RLa6/+qPwzEM9IDl282QnpAQGsoIKzGC77aR/4ftcoFDAa2yPikOtd4CbjY7Q== X-Received: by 2002:a17:906:4544:b0:a3e:71fb:348e with SMTP id s4-20020a170906454400b00a3e71fb348emr5267043ejq.63.1708469445643; Tue, 20 Feb 2024 14:50:45 -0800 (PST) Received: from [127.0.1.1] ([188.24.162.93]) by smtp.gmail.com with ESMTPSA id g3-20020a170906c18300b00a3ed811cff9sm1601977ejz.154.2024.02.20.14.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 14:50:45 -0800 (PST) From: Abel Vesa Date: Wed, 21 Feb 2024 00:50:32 +0200 Subject: [PATCH RFC 2/3] drm/msm/dp: Add support for setting the eDP mode from devicetree Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-x1e80100-display-refactor-connector-v1-2-86c0e1ebd5ec@linaro.org> References: <20240221-x1e80100-display-refactor-connector-v1-0-86c0e1ebd5ec@linaro.org> In-Reply-To: <20240221-x1e80100-display-refactor-connector-v1-0-86c0e1ebd5ec@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kuogee Hsieh , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , Johan Hovold Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Vesa X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3313; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=xokivPWqt+OPrUy3qaqKvKtZ107TpFIVR/LoscCcyTU=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBl1Sy+36STHspnFcIKJqXRYK9pPMBNFXIGIP+1/ MxB9l2APl+JAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZdUsvgAKCRAbX0TJAJUV VrQzD/9TWhF8Cm+XOQatc5eOGqEMLDijupKbH+5yJAXa0+SjGXbltXHyJpU3H5HgljlqnreFIUA zJzgtspF3aAFY2EiTIuTkEGwnNC7Wjzd44H63+eMO0ml8/ncRTODjqn3hcIUPdN3e3+0CrDHQNv IN/k4SPTpjGy94WufMiCYDwoop9dNBpkOTkk8+qasUsAjSUBM+iZ3NKIC9aG5Ns7I/NRRfIY1vs AJXySPU9SEndP+Cl12ZeBwixyWDWi4yAjvmIqOIWhAeWGxcerHv6l8iFZYN+LbHtOae/6MofMS2 0EXFoM2XbpVIageIxJ+LCrkkC/ocD785ukY0il7aSsA1OE3YXPkqMaBOhvfyPQ2HHuMsoTqdazu qml1fdH58bvkvPvqwykJui2pGF4pqvHxEwOqQYcdZLMKUWkGD72Aq+v6+TWI6x3y/Tcq7scoZnT LY9945Fx8rF1aNWGVkliJx5jjgo6d1Ll0x8iM+Zms8nD90/CKmvkT0ltMkFfNH9K35iVxoaYFXH Tnd72VrK10hS7oKaQVf3TazP6aUXjSrr19LeC6LoTgJ+jYYtnbLU+F8oskievQHZeCbjlKfziDo cc4AMrCSaX09jC7bdtMaFmKFD0cPKX1xPBTisWXPGa9ENV45TkqsjoQY7Sk5BbAakGkoG3DRmrA b3CxU0M6AJb4+vw== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE Instead of relying on different compatibles for eDP and DP, use the is-edp property from DT to figure out the connector type and then pass on that information to the PHY. Signed-off-by: Abel Vesa Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_ctrl.c | 11 +++++++++++ drivers/gpu/drm/msm/dp/dp_ctrl.h | 1 + drivers/gpu/drm/msm/dp/dp_display.c | 19 ++++++++++++++++--- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c index 320f17fce9a6..bd81cc6bd5e3 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c @@ -1533,6 +1533,17 @@ void dp_ctrl_set_psr(struct dp_ctrl *dp_ctrl, bool enter) } } +int dp_ctrl_phy_set_mode(struct dp_ctrl *dp_ctrl, int submode) +{ + struct dp_ctrl_private *ctrl; + struct phy *phy; + + ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl); + phy = ctrl->phy; + + return phy_set_mode_ext(phy, PHY_MODE_DP, submode); +} + void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl) { struct dp_ctrl_private *ctrl; diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.h b/drivers/gpu/drm/msm/dp/dp_ctrl.h index fa014cee7e21..a10d1b19d172 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.h +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.h @@ -32,6 +32,7 @@ struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link, struct phy *phy); void dp_ctrl_reset_irq_ctrl(struct dp_ctrl *dp_ctrl, bool enable); +int dp_ctrl_phy_set_mode(struct dp_ctrl *dp_ctrl, int mode); void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl); void dp_ctrl_phy_exit(struct dp_ctrl *dp_ctrl); void dp_ctrl_irq_phy_exit(struct dp_ctrl *dp_ctrl); diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index e4433891becb..9e58285d4ec6 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1229,6 +1229,7 @@ static int dp_display_probe(struct platform_device *pdev) int rc = 0; struct dp_display_private *dp; const struct msm_dp_desc *desc; + bool is_edp = false; if (!pdev || !pdev->dev.of_node) { DRM_ERROR("pdev not found\n"); @@ -1243,13 +1244,19 @@ static int dp_display_probe(struct platform_device *pdev) if (!desc) return -EINVAL; + if (dp->dp_display.connector_type == DRM_MODE_CONNECTOR_eDP || + of_property_read_bool(pdev->dev.of_node, "is-edp")) + is_edp = true; + + dp->dp_display.is_edp = is_edp; dp->dp_display.pdev = pdev; dp->name = "drm_dp"; dp->id = desc->id; - dp->dp_display.connector_type = desc->connector_type; dp->wide_bus_en = desc->wide_bus_en; - dp->dp_display.is_edp = - (dp->dp_display.connector_type == DRM_MODE_CONNECTOR_eDP); + + dp->dp_display.connector_type = is_edp ? + DRM_MODE_CONNECTOR_eDP : + DRM_MODE_CONNECTOR_DisplayPort; rc = dp_init_sub_modules(dp); if (rc) { @@ -1257,6 +1264,12 @@ static int dp_display_probe(struct platform_device *pdev) return -EPROBE_DEFER; } + rc = dp_ctrl_phy_set_mode(dp->ctrl, is_edp ? PHY_SUBMODE_EDP : PHY_SUBMODE_DP); + if (rc) { + DRM_ERROR("setting PHY submode failed\n"); + goto err; + } + /* setup event q */ mutex_init(&dp->event_mutex); init_waitqueue_head(&dp->event_q); From patchwork Tue Feb 20 22:50:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13564693 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9184154459 for ; Tue, 20 Feb 2024 22:50:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708469451; cv=none; b=ZCft5i4O3U5n9GgPg+DaFf1YFVU+dUZ4kaIyHylaCttIzwRjgiGqsi+HitywcTt9OG58pmcElx0nMhtcg1TToLvMHp569ASc5ekOXr6pW7SYVqrYdvSDXT+olL/htbTl01Ww3IiFjv1YiSjb2iyZ5Thq/EwuPicTbzAm8Y443bI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708469451; c=relaxed/simple; bh=Bg+64ybndxfDs6b6x4LD2hmPzSVNqo/QK+11IhNoFjQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cHcXpH3udvRH44Igjm+spYMJ2Gx5OqJVssVoq6AEzsHt6qkT/L1ZZDczbeHnvvWe81dZ8WA3dHIWi5Ovtk1Rcm7p07+ZN/QDAjgcn7yj0Lnp3ScRSawNegl5haWcoRLNJ7orMbVmlVpnhU/AQd6PFJ+7Czn/cXzW9OsrnxhPfqo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=HFNdD+1m; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HFNdD+1m" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a36126ee41eso798435166b.2 for ; Tue, 20 Feb 2024 14:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708469447; x=1709074247; 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=DaiHKOatnN3Icf8gwgiK0T0n2HRv8NzGbPdfVNxfS4k=; b=HFNdD+1m6rErkIqiYIsNftkVY9r2zhWkLSMQqb2USR8r0IBLllRj3LHk3tiNtHswTF 2Sq6JQmOJXHbBf80ksGZFh2IGpxwukA+Y13MFjLRkX5wwIigZE7G2LaSRK4LAumX6Jia rZmg3m8wZRGFuLPzo8q/f3g00xl6Tt61QJBj8KExAj/tcTeZOoUu+/wHc+1Xwb9NEq9c VeUMB6O1RqWmLJ4ZNIf5t3o4kxbfPbuLM02PRD7LoDJ5vjq6fRXZIKmI6UOKVG+zyFGy hzeyIDARpFw51DZoiHT8u8k/Z7iTD/OS48FdE1DSy3epGMjer3BbAyMO3KhM1Ug45zFK kV/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708469447; x=1709074247; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DaiHKOatnN3Icf8gwgiK0T0n2HRv8NzGbPdfVNxfS4k=; b=Edc2n5EA2PygnbtEc+IGXeRnyLrUqs2nYfSzfouP+Jilc5XFT0EIvhAqQtEKop1Uwk 3SRq5G7HJT4iTuk2s9jH4IjZJeiKJo1lTheWw/Dh91M892xQASeG/Y4CPlLNskCuyDne x3YhJMCd9tb4MLsbkfXPHgCwoIITnWxYCyEk9riECdjxBpz8Mh7toQtBUrRNRVIjYDQv ioGYa4RdpFywp0g4pOyEoSmOiadofudPc5TLZW+C7q0XvaAPyX2k2dNv8dVYfjOhX/Wy +H65xksnTkQ8LxaYTXqY21oeKTOLz66PJfhipkPgyucgzcsC5r3wFYO/H0VHE5EygSoH 21pw== X-Gm-Message-State: AOJu0YwGI2j89LzcF4i3xLmgOREoc6hGCnCSemxJpZE4phXejqNlaD3Q 7WmUComcNYffJGsIhJAnikILlZhe/j7iw6+JtrkubvY566ekljwjGSpP6LMQxV4= X-Google-Smtp-Source: AGHT+IGKYFLq9n74LH641A+5aXYbvLwZ/7XrnLC2ffc52710JhYABnciYA9kLk++qgZ1K9d8iIvTtQ== X-Received: by 2002:a17:906:504d:b0:a3e:1225:2d7d with SMTP id e13-20020a170906504d00b00a3e12252d7dmr6954762ejk.38.1708469447175; Tue, 20 Feb 2024 14:50:47 -0800 (PST) Received: from [127.0.1.1] ([188.24.162.93]) by smtp.gmail.com with ESMTPSA id g3-20020a170906c18300b00a3ed811cff9sm1601977ejz.154.2024.02.20.14.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 14:50:46 -0800 (PST) From: Abel Vesa Date: Wed, 21 Feb 2024 00:50:33 +0200 Subject: [PATCH RFC 3/3] drm/msm/dp: Add support for the X1E80100 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-x1e80100-display-refactor-connector-v1-3-86c0e1ebd5ec@linaro.org> References: <20240221-x1e80100-display-refactor-connector-v1-0-86c0e1ebd5ec@linaro.org> In-Reply-To: <20240221-x1e80100-display-refactor-connector-v1-0-86c0e1ebd5ec@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kuogee Hsieh , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , Johan Hovold Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Vesa X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1757; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=Bg+64ybndxfDs6b6x4LD2hmPzSVNqo/QK+11IhNoFjQ=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBl1Sy/SY/Li7l08xMJ7M+mWv/uESkmaPF0NsvaC dpCRX6qGoOJAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZdUsvwAKCRAbX0TJAJUV Vgn6EACmcH3wtom1eKfkJzuGchzrI103o2ht9z1QwN/8SbMuJseRPCeWyeeikKSw+Po4gGZ/G3D 0yoTOTAK9JW4c703Yi9C25hqmPQWsoBGvsbRjFVs/twSZQ1NEbVxhUL6f6BFuutOZVfw08UYU89 tBa3qjivZque5i9drKIn4aC7FifFsZBOQQI/bhqR+ZMOL4Y3vLdlK6i2QHKp+WtAqGRRFXbMgpy wAVuWMEvlikjtpGTKq1OiplVqZQJoRhnT06zeeapu7UOSPLYIvar+xRpMSgNZ3uiWypOv95QkEF km0lOHe1Z2pdrQIc3LP+ic3fJSYZrUFT4tcuOTagiTFqVNlstMXfoXQ80xe5vf23nQt1tSW17fU jbh4JQRTjVGXfeX92p0NkZL/Q24BOYlvADOwNY2dB3FYPyPrLIT14vSbQRG91RPPfTWgWGjuu9M qTyQi5g9EINuFMtx8944XfOAMQozkqQbqGl61lxVBRD4egoukK57vxtTVTGKTGFJ90S25n5EfRZ HJesuuXKHlyqu6btq67skJmmUpaOjO5ngZBSns/QX3u9/bcJnKF9CQCarp/5ROFEfsFr/B4R7e5 hS2V+HVKFaG7bWp3lOk8NH6NETTt4/y0HjvnQqGJrzvSmFCZLK8egouw1MQ2b7ulVDeA4sTJeFg OpYr4j0j2VYNZXw== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE Add the X1E80100 DP descs and compatible. This platform will be using a single compatible for both eDP and DP mode. The actual mode will be set in devicetree via is-edp flag. Signed-off-by: Abel Vesa Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 9e58285d4ec6..7b8c695d521a 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -171,6 +171,14 @@ static const struct msm_dp_desc sm8650_dp_descs[] = { {} }; +static const struct msm_dp_desc x1e80100_dp_descs[] = { + { .io_start = 0x0ae90000, .id = MSM_DP_CONTROLLER_0, .wide_bus_en = true }, + { .io_start = 0x0ae98000, .id = MSM_DP_CONTROLLER_1, .wide_bus_en = true }, + { .io_start = 0x0ae9a000, .id = MSM_DP_CONTROLLER_2, .wide_bus_en = true }, + { .io_start = 0x0aea0000, .id = MSM_DP_CONTROLLER_3, .wide_bus_en = true }, + {} +}; + static const struct of_device_id dp_dt_match[] = { { .compatible = "qcom,sc7180-dp", .data = &sc7180_dp_descs }, { .compatible = "qcom,sc7280-dp", .data = &sc7280_dp_descs }, @@ -179,6 +187,7 @@ static const struct of_device_id dp_dt_match[] = { { .compatible = "qcom,sc8180x-edp", .data = &sc8180x_dp_descs }, { .compatible = "qcom,sc8280xp-dp", .data = &sc8280xp_dp_descs }, { .compatible = "qcom,sc8280xp-edp", .data = &sc8280xp_edp_descs }, + { .compatible = "qcom,x1e80100-dp", .data = &x1e80100_dp_descs }, { .compatible = "qcom,sdm845-dp", .data = &sc7180_dp_descs }, { .compatible = "qcom,sm8350-dp", .data = &sm8350_dp_descs }, { .compatible = "qcom,sm8650-dp", .data = &sm8650_dp_descs },