From patchwork Thu Feb 22 15:55:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13567536 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 56F1015530B for ; Thu, 22 Feb 2024 15:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708617327; cv=none; b=HD/rLY70O4sYKkRr8zFmqE9xtmKMGdvraNHORdNy85/5Fm5jKhas6xfVT37/Sxylse6gMl/9XqFTrApohkn57toGJHns2tI5D4bHFLTz1PxKgR29oLwR181ZMgMFdVYTzB1nQFVGL497fiI2V4ljLw8xZIH6EeuIWZyIW8mNGmQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708617327; c=relaxed/simple; bh=Dgy4bpUuD1DREK8e21cUFvAnpbWONI5ldnxfYKMR5OM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oE2+s6EAe0KqukxZGR3cXKDAlsupl3i7R4xRyX49lRzYFDqR7KSUxlOIzsLmHXGAbVe4lqQQQ/1eZue+4y9Q8afhQnJSGPx1EHEvXlPAgyOVg0NqZuQtLcmztTPfznA0KzWnAvPXt4kPiyB34sR/ZTEVWRplMJlcdwZcXcMSpZ4= 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=DY0XJ066; arc=none smtp.client-ip=209.85.208.49 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="DY0XJ066" Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-56454c695e6so1915119a12.0 for ; Thu, 22 Feb 2024 07:55:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708617322; x=1709222122; 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=E/qRBGuntVpmUEzLsJY9ZgDe9uMSJ+xK+pvUdRKBs80=; b=DY0XJ066AfvRj3f1eMJAXQcCxwcKgjOtNikrLXir1UFMYpBEWxvBsDYpBelSmii40b SYE6jfOuNq8NMN5H2W2Q6m4kmMND4C61eWA4ehYmeWVGnYiGZz0+oHmHDsWuAJ9jBudX DyY1wv05QTFHw9KxcmYzu4v0zBFrUHYJOwltx6HGhSf7db+Y5OcZHgz/sIEXTxLBX4bH uLAaxiymOeiP921f8zBDVXGv6kC7GpFrGJjGWvk4id4bdWsuYEKIf2uA8vPRM+bo++Xx MwRK1A0v/N2WYi4OwZUF8U4T1e/rzbs9U4HZplcISABxrCfCAQJRfZ1CEak2slesLTrn Fsfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708617322; x=1709222122; 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=E/qRBGuntVpmUEzLsJY9ZgDe9uMSJ+xK+pvUdRKBs80=; b=tRvp4ZCSHmcNOMyfzsGGLNYqv/hwe1tQY4ObTsqjugofwW8AI/jo15bTo2s3OHfxI3 qQtwfJJC06ZBzJasO8WRfVHJeceg+tXc02Bi5sR4TVAlM82DcjR9kvOeHS+ArGY+HF7M QGRVFjDkxAeeHSR2GnaGc754Oz2p9OQDVGipyeCJK4isOQH6ABOwkG908uZpVhU78Rah 7KxAlIbtSG9k7mT2gQZJmF+jwJ/MGTTYsP7jA6VS4bLU0HmfJ2ecOv0Ix4R5GWwckJOu hPfafr2+A0y7RK6Uc1wCfuv6yRZovOWITeIyBQIGEgfcccOmEboGayyImgcAADHhuUse 7uoA== X-Gm-Message-State: AOJu0YwEQk6nbkEed8Tmu51kqdyb9/E9NmrZAlTqCHqV8+IADADE9q3a YAq516fj88BoxMVVxGRDOJS2kjpbz8WmclnaGrBQ0OzQe3dihYbopIZ/bSOo2cw= X-Google-Smtp-Source: AGHT+IEM79QWygSavS7FLc1eJs7WoqOaYvTeCTfGxzrVhMHQlzTgnwR6V3UoG0G+3SBVTMXxL/v3qA== X-Received: by 2002:a05:6402:2021:b0:565:2e3d:d019 with SMTP id ay1-20020a056402202100b005652e3dd019mr2162738edb.4.1708617322526; Thu, 22 Feb 2024 07:55:22 -0800 (PST) Received: from [127.0.1.1] ([188.24.162.93]) by smtp.gmail.com with ESMTPSA id v7-20020aa7dbc7000000b00564e489ce9asm1924247edt.12.2024.02.22.07.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:55:22 -0800 (PST) From: Abel Vesa Date: Thu, 22 Feb 2024 17:55:06 +0200 Subject: [PATCH v2 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: <20240222-x1e80100-display-refactor-connector-v2-1-bd4197dfceab@linaro.org> References: <20240222-x1e80100-display-refactor-connector-v2-0-bd4197dfceab@linaro.org> In-Reply-To: <20240222-x1e80100-display-refactor-connector-v2-0-bd4197dfceab@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=1194; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=Dgy4bpUuD1DREK8e21cUFvAnpbWONI5ldnxfYKMR5OM=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBl125jCxw4MKZFiUZh/ZMZdfvjY3Y2ijItoeR8X VZAumqDoGKJAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZdduYwAKCRAbX0TJAJUV VlncD/9HrYnh9zrnKbDIebEbauG+1baUus8l4qSrbAb3Ntl5fGjkgkHqpD0pJVXqSEEjIfuopAk OLIagSfkQ190FupimhKKkBGDvpAVfTolpJufGbLXwcfaZ424E6QMJX4oaCklqX8b06EfyGF9aMN We96I77voVT4JkfrOyCAT8G/sCjah2cpGEO9nYywBm1XvKB5wFwa4hqHxgiqG/XjHCDPhIIrQei Mqp8WclHbx4jmx+jQc8ylDL9ojoPcBaqsRF870nfQl8kSRDE/BUhI+E0Rt+eX4hDu0o9ILclAzT pyDbEm4VkcYK6hQaK8Juz7+tAM7ysu9C2FGghCehIutP6NCafWW9JYuMBdZ3EV4Ha+Ia7QDI6Vt CLGQesCQwn6fXf9L5rjPvbbGKj1CpB/dJDB6yE33Ox0+6VyQeQ6V8Unds3DZ7eY7LKWnhvqqVb6 kAiBZ0mtQYB3b44nQ9Gq+gQbcfsXCQAZj/anTDfqncIblK4rWG/jIegTi23oZTK33r6UjD3Pl2T 39Wy/JhacD0bK8ACs4kXk0nIcR2/lNLiTUh9N3rRhT5wt8NUJoj0tB+wVf2Yk5Urs8EBYvRj1Ne XhniW6npGnqpE5q60USEHV7Cgd+R/i/xrSGqCgnd3fR5ZAWsL810t0lsC2RdK7OAap+JgQuHxbn tt1FGK0P8RVK+Qw== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE Add the X1E80100 to the list of compatibles and document the is-edp flag. The controllers are expected to operate in DP mode by default, and this flag can be used to select eDP mode. 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 Thu Feb 22 15:55:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13567537 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 DACC7155312 for ; Thu, 22 Feb 2024 15:55:25 +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=1708617327; cv=none; b=flR5OHQCANGLI8N0tJtb2Suxl2FN/MW6FaE9YREos2U4OEG2QiZ5ni0dm1M4z0/R2i/Gs6114sH1Neb76bxdBqIXZ2QhN5RgBqJMh6hOu8h+t0r4RZnowNZlQJIDeq7b1UCqZ56X+7GDpiUc2S8o4p+W7N9jwnUkcwxbA35N4lg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708617327; c=relaxed/simple; bh=UBQowZOtoIlmpAQUKT2yKb1EZAisbZQw+a7N5Tk7DL4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mZas4NJg2rfK0j7pbZhb6XcnhAFoXauHXHoa7u4bfLcs3fTvEvJuTgU70M405ulTQbUUOq4jwfciNNbgXeaBXcfHpTdVxC+D7wjzxW+N+2pmnp8h9qUP4EHnGExaPWGiqmSIUW/lplwGn2sTRfu6En8RBJyoPYzdMz84MXOZ+c8= 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=dZwtsRVU; 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="dZwtsRVU" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-563bb51c36eso9061380a12.2 for ; Thu, 22 Feb 2024 07:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708617324; x=1709222124; 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=nFX079yF3c+/HXrlMKNqGcWR46bajyGBbF6fcN4VZDk=; b=dZwtsRVUaBKmmbeO2JKoCGwppygmmUs0d8NC0bSW0Gq1g10fJSpb5pORlLJS9DWErA yqkjUHBD2CW2WWHWRz1oUCA9c7sEYsmJS4L33+7numu117YKwJQD/+TkF6QFQyZfTKgM G5Gjg6hysl6DgHkSRZZ9uWY2dXipNtQYl3uvqnQ1AIdeh8aFSPuc4TpBql9Lz+izGOeb mn4Oo8/9xdgdb3E5gdJFfQQCWPVrSnADLaa0s5vU6CpbBT+xG5rzYfX+2nbkXAMnBoR6 bxxBL41gcFmYoY344y9wdrdQfG3AFwyaxcR2/bTkS6VRAOK8hp2fe+WW44aYBsRdn8Ux Bcrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708617324; x=1709222124; 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=nFX079yF3c+/HXrlMKNqGcWR46bajyGBbF6fcN4VZDk=; b=gNiOK/CHI712jTIsRqpxN4Mjc5LyJadO/ewqFX22X2BRHdF8hZOJNzzjAEx6JowpnT z8fa7x/jDfuMPA1OF7EEgdhB334KSUPf74siJ9uv/L+W6XE8EwmVNdei85QZdZO6VZre qq31WgqeW99YUNMpFXCHV2BBUtvqGWMQKuGkaMgaXcKqnEx99MWrs11QwHsW6SfttS9k SDjFWJUSHvK4Oc6QBQOvLNXgZndhTvi3bOX+FGfrNfgBfszQnR5RHjsFO/mKZN34qs8L Ptfhewjv44p6f+A4/qnLhambI9PjKzRx3DMVjtgwhc8Rk3JG6TJ2lYGS2ZBRo9TjgW01 jVjQ== X-Gm-Message-State: AOJu0YxRqlCqC6BYJYqHKHDWL2TPIQjCVhk/iNC1aJ36P/DxrVfpEvMF Me+KvFryCT0Vmbg7ioxCoN0Nob5rlKG2DknEaJ7EmUvl57u8kH91bvB3/Y8wp8I= X-Google-Smtp-Source: AGHT+IFpGNh6zq1lLSoBE5N/ejAxjG1/XkYZMx3Zmhjnzdt7yMjL718LXZpcG82z+uN7+glWDmVDJw== X-Received: by 2002:a05:6402:214a:b0:563:bd95:4e8b with SMTP id bq10-20020a056402214a00b00563bd954e8bmr11582201edb.11.1708617324203; Thu, 22 Feb 2024 07:55:24 -0800 (PST) Received: from [127.0.1.1] ([188.24.162.93]) by smtp.gmail.com with ESMTPSA id v7-20020aa7dbc7000000b00564e489ce9asm1924247edt.12.2024.02.22.07.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:55:23 -0800 (PST) From: Abel Vesa Date: Thu, 22 Feb 2024 17:55:07 +0200 Subject: [PATCH v2 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: <20240222-x1e80100-display-refactor-connector-v2-2-bd4197dfceab@linaro.org> References: <20240222-x1e80100-display-refactor-connector-v2-0-bd4197dfceab@linaro.org> In-Reply-To: <20240222-x1e80100-display-refactor-connector-v2-0-bd4197dfceab@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=3338; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=UBQowZOtoIlmpAQUKT2yKb1EZAisbZQw+a7N5Tk7DL4=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBl125kDIga6LgKuVlvBAhJKhR/bqzkA4C7j1dj4 o+8TFq5zH6JAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZdduZAAKCRAbX0TJAJUV VjFmD/0S2j+eq/rgvUGx98nW2KSv+7jUIOpbdGokBAj/5B3LlEASwGyRnzW5rS4PMK0HDROFuNz Ijt0hn4kPeCLLcjl41UZBmFmIKn8m3+/lj2l1U8A+dYI75x1Mk5mhuuE8BF6zYfIxLEDF8eR09b hheJJvcmamKbMpvOu/0LVpe+PFaHdkRcxX30aEsmwMcfWI7MQwRrUAp3Q02RdGv8+oi09HJGg1/ 27328sgTy7Cq+Mf4NLMtIAusJMLobdbAibSVNtRRLDUcTNywpkcIzYp9c/gm7B8el9/Nts7iQOV 4coOiozAcbNP5Z139pNFJtNLUTpxduzWLjTXIvq5vJRe8ZXB+jjTdZevorgfwHVX50ghy16Rh2Z gtGftQyGDnuFKEviPj/hs0FZD5DbyHqe9BTQW9GQcZ9okDjrOVWeuiJh8PKXWkT56oNURI0uS73 IM2dMewWtM7UKjYE7dMMvrkPETD3aB+1TFPNRmaCyY/a9X001s6MhdeUXmay6QJXuT9NQLnT6iN Km6S9q9eTCTYD4+i6hvrHVjo5m45vOPcwHqwKMUvv2y++ZDGuYZSTYWZLxftGUbtdkuPnw4OgzZ AvbHiXqCaGGDcPUtDz73IM9H0F/CW1JI1Wux7OUC6Dzh4gKxaquETfEYgl3QOjd9evR4OJIqEnx ftzXSHXB3BphXLA== 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. Reviewed-by: Dmitry Baryshkov Signed-off-by: Abel Vesa Reviewed-by: Bjorn Andersson --- 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 | 17 ++++++++++++++--- 3 files changed, 26 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..e01b41ad2e2a 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; if (!pdev || !pdev->dev.of_node) { DRM_ERROR("pdev not found\n"); @@ -1243,13 +1244,17 @@ static int dp_display_probe(struct platform_device *pdev) if (!desc) return -EINVAL; + is_edp = (desc->connector_type == DRM_MODE_CONNECTOR_eDP) || + of_property_read_bool(pdev->dev.of_node, "is-edp"); + dp->dp_display.pdev = pdev; dp->name = "drm_dp"; dp->id = desc->id; - dp->dp_display.connector_type = desc->connector_type; + dp->dp_display.connector_type = is_edp ? + DRM_MODE_CONNECTOR_eDP : + DRM_MODE_CONNECTOR_DisplayPort; 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.is_edp = is_edp; rc = dp_init_sub_modules(dp); if (rc) { @@ -1257,6 +1262,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 Thu Feb 22 15:55:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13567538 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (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 8A84515530B for ; Thu, 22 Feb 2024 15:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708617329; cv=none; b=dD3IctHg1hhn8qQU2f2nH22KG/sh01NvKc4DIxObxnZ39jwFKU12kFDdgut+3hmZxYxmgpNIVpTwOk2hcO1O1T8BoCgmwXZnAGBBxrugnv9mLA/mEb+Hl8un09IaLhR42F4h1Xpujl3Xvx8eFhiRXTbN13bqe8THXuLlYFkJ8uk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708617329; c=relaxed/simple; bh=Igx0dc8kyT7O4TGZsOtKQnB+6acRvpeqzdoVuoVCK4E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fJuo6Qp+0XB7o16/ya1vb5L64CZRCTP8VkfCVkrINazZB4u9mq0gNGWkKFhylA2WeVQU0zGk5FUoV2Hv7sCl7VA05gmtsD6EewlJOi3UVNlLqwo3/5DHQ3PAOZvf8hubAsbJqpfCFGvXBA4JBnO01fD2U5jrOW2chc2CbgV+S68= 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=Qyk76q2l; arc=none smtp.client-ip=209.85.208.51 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="Qyk76q2l" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-55a179f5fa1so10811170a12.0 for ; Thu, 22 Feb 2024 07:55:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708617326; x=1709222126; 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=qJjRNIUqnXrTF9bzdEi2VC9ooQUEnRbmpw6uyhCO978=; b=Qyk76q2lbn5Wc4XX5HD0pfQSa3JVRjcL3qU24FU2CtceN1syPnriGrlCaxq2AT7s7I bhV6PuP5WHBpZFb8G6GwlmjDwgvVa/SjdDDgRa0hEErNnRVwO44LHMAwir6RUMgO7xIU FBQM+rRyIPTo7f5y+8VoMkQpuLuuS7PqSSILxlTptFb6Or1kiHo7oBdCkjR5n9fb4sBl T97LnHUU3SKjBNEshAL7omOkmSTId41tY5+HA44lMFOnt0yGnZgpZvtgzFmTvrmMYwvz cogNutj9/TM3cL9ZIW4RD7znVdKHWWFFmRZ1Bohl8sdz4Sf+XduCMRvgaoqpqMmD6r1t L9xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708617326; x=1709222126; 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=qJjRNIUqnXrTF9bzdEi2VC9ooQUEnRbmpw6uyhCO978=; b=wG6P37JYLqpp+KlKGvyHCi7F77CfjFI22gntIxIKG3K/WA51fgmT7EjmqVGWIWUAge nz8xkd84iTuDHkmlB4TQ3f/vIdXQZimIItLkGCUVQNe0hsEq6f+LJqY42Hd6wTBaB5gO x7Z0Yyc2KtlBmRUCFQVLQ5TWLsJpigISj1Zj8AyDMq8VrF4UWJM6THN+3ykmxbvRAz+R 1wlWidEYjTi8JLhSlYNcEG7q1h+srqIitjmcLQWgrmfDDpQ7XR0fcor44WUmk+UX+pY4 mVNvfuPzoBjkNEwj1pAyR3WPXpBzI3e5M/g9SUI7Svj8AIpwtnTOW8PnfdBByOQnmZlH rUqA== X-Gm-Message-State: AOJu0YwykpHFbTOHB53JtVXzKD6UYFzupepFkm4V4LeuJHk020MbBYED Npm7MjwT2D1RItJ0V9cNUkP1gG5AUUi1moFzEfoQeUFiN4tnTDD0fQbiUA/T/1g= X-Google-Smtp-Source: AGHT+IHx8wUrxZAoY0QTpZfuPEXHwmLiOc0Tnk3az8nxpMMl9wTbjHf3g0uq86KA89J0Eq+x6oS1Kw== X-Received: by 2002:aa7:c44d:0:b0:564:7bed:b836 with SMTP id n13-20020aa7c44d000000b005647bedb836mr7778452edr.3.1708617325938; Thu, 22 Feb 2024 07:55:25 -0800 (PST) Received: from [127.0.1.1] ([188.24.162.93]) by smtp.gmail.com with ESMTPSA id v7-20020aa7dbc7000000b00564e489ce9asm1924247edt.12.2024.02.22.07.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:55:25 -0800 (PST) From: Abel Vesa Date: Thu, 22 Feb 2024 17:55:08 +0200 Subject: [PATCH v2 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: <20240222-x1e80100-display-refactor-connector-v2-3-bd4197dfceab@linaro.org> References: <20240222-x1e80100-display-refactor-connector-v2-0-bd4197dfceab@linaro.org> In-Reply-To: <20240222-x1e80100-display-refactor-connector-v2-0-bd4197dfceab@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=1624; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=Igx0dc8kyT7O4TGZsOtKQnB+6acRvpeqzdoVuoVCK4E=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBl125mmmA1uULH1SHqNXIODPJZhjtL5J4xyD3J0 gjgi12m37yJAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZdduZgAKCRAbX0TJAJUV VoDVEACr6Dk0tJq9ePeNm+CmSWomyrFLd+GFTUs6dPPc+1N7ayp6jdKgOVxEG1HP2FHS+md0AlP XUB5CLUHyU3SvwdcRKz2vvWKreVn6w9dtP4fzvygYfOiRCMuJYT4zdczFwVSPUawfLjgKErA4Hh xqtADZ2EKatT8TIDNtt6AEMSWot5NtWCWgN+CWCNbZEIiRcKKva1In+HUjEL7PuSAPzzpxKITJd QyxENlkIzdAvT+q9i/XTKnZoeWU+W2YmJRTJUiFk+VeJgiz1DsKfzgfS06PpUTubNY+L4vD5LLZ Y9mOusYFlbNI05+o58j8ChNahPZeh6lCvH5K3Hcy5oMlG8leVbOMSFglkuSFDTwRH07UG05CbW3 ROh8d5D2m4kHzhGtvuQ7GHryrdFmG+8ZplsFZvkaNRk2uEdATvWVTvlM2flsFHDriNF/en9skzE 488eIKHDYWDsDgdhJyOkpfXlVW6WZY0a7glCER7TlcuDS5j+tVKXgHVMg5b87lKIkqeSzTShwy2 CASdhiX7aL+6DFbvYvEACkLgQl50sztW7aZlTnnbFf/rQFGP6aaT7v3bdXTIUfw4wV38IqvcWEl 1qSN37cQVXCM5ViNBwUoqG8XQUnbqnaVFIodFGh5PlEMYryOdB2GbfeHO5Dh129rhkmOM3HpSuA knU3z19i1BermYA== 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. Reviewed-by: Dmitry Baryshkov Signed-off-by: Abel Vesa --- 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 e01b41ad2e2a..fb1969617617 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 }, @@ -182,6 +190,7 @@ static const struct of_device_id dp_dt_match[] = { { .compatible = "qcom,sdm845-dp", .data = &sc7180_dp_descs }, { .compatible = "qcom,sm8350-dp", .data = &sm8350_dp_descs }, { .compatible = "qcom,sm8650-dp", .data = &sm8650_dp_descs }, + { .compatible = "qcom,x1e80100-dp", .data = &x1e80100_dp_descs }, {} };