From patchwork Mon Jan 23 15:11:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2655 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 33B883F046 for ; Mon, 23 Jan 2023 16:12:40 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id x8-20020a17090a8a8800b0022941842cc0sf9572650pjn.3 for ; Mon, 23 Jan 2023 07:12:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486759; cv=pass; d=google.com; s=arc-20160816; b=J0XO69VEf/QetOqg94b/Clyg5gzce/4oJ4mnV+IPgcuAsvTwWvElpyYb859AbCwF5X vdP1uLvjH0Pcf0jxtATU9+0izQ7aA0qGRsvbZtRQpBq3r6s6qkrtHZChL5rVEytPXNQy Q7ukL89g68LQuuj0ZBlmiy1SVrwXJQFImqCHeyjiRyieuVJ3FMlP7ZHKIrZk+Ml6yilO f/7tN0FhvO3BJhuBfwVKT4ZR59N4brSUfD2X5RmPMrZTXhzgQqMbBwgTtMbAYlDwuS8h c1+3nw9ZSzgjOSlRej9hxRJGEzL26eieHudVd34nVUm1KVHR0JCBrQ9K60cuaihiaKWX rbrw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=3Y7s/ulxHFSGawNxIH6V1omksNFZCAlQ3JqaXKlMUBI=; b=l0FEGuRO2QYaZZT+H0Uy9XWrVcbnVqh/RR43Yuc0e4eg/QlVsuCOZiiX1nnxrtrJl3 lM2KHzpckOx4deXhMA5RaDD+wz3QaKyGQELIFgGYS5Rt4biMWufg0coRuQ53ZzaZQeJH gKaopFQRyxS3aNT6L+j22g7sFSjQArl7bphJ+si/weTS5L74AdFFBBg7vsRLw7Q1MI/H tblOQQoKruz/MXEIwULtjdbc3gyjBl7rvQ//ETfadEQUjMZ3LFVJmrwBaCqsrbmRizjX DuDf6fZ48vnHnYUNk6ERfVrUJmuQ0ObUVvXkL6EsxefBmgdvRzv6p8dk3++c5SmtU1zz IhVg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QrWykG4K; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=3Y7s/ulxHFSGawNxIH6V1omksNFZCAlQ3JqaXKlMUBI=; b=Bjf6AvqlSFyNWIxlSZy9tdi2MojP4Nfey5cGmdBNrOEqU80rLv9KDNn9cMI6OkLvSC gB+TwKb2RfhjThgJLSYYp4nEjjKzso0rhmdw+yhSdSRDIkDkKNiQo6sQWyvZM6Wev7w+ cDetEWNQRQERmsbt41ah4VLVdD7Al0pJlBTik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3Y7s/ulxHFSGawNxIH6V1omksNFZCAlQ3JqaXKlMUBI=; b=dFnwK8LswSo4ga1MN/kgx6CW/fdoaKLeFeTBev0Z8pgWk5msZRepurrF9bIlZbY4Md uUFqRte8wu0XgyfXbotOThQvnKqOxLp/TE3nI0Z7wG7VGyQNCV72skTmJyfmeTDzerPN Q+M/cKDrsZ2yAXWnxWG3mjZrLlP6/EL0KpnRxseR90fohFzIYzYhno1TnZgDP85zUz6f 9/Ke/x6vKrZsJO+kJg0K5pVipILiAQ5P/mBXEd8QJcpiOyCcegVEJPw7wUPlGPGHAteG 27Ao+gjkVS3ah8/AQ4S0KPsrJkHboDjFyBdEoz1ivpHmUHzMRFGwlmvNxAF909ylr9Wa u2dQ== X-Gm-Message-State: AFqh2kqUnFQQfOLqJeRs/vjkDqLTKCZR+OROxqxvQLssgseu7Qt2tG3Z 6Ogo/Df3G1PhuS+9kRsSLTYT5qpS X-Google-Smtp-Source: AMrXdXuOQ63lXSNZCrddr8BsTE2P3K5mB7irSYCYl31R1eiDoX7+r2OnxFA+EPqrj61ZYD+Gpz4jVA== X-Received: by 2002:a17:902:6908:b0:194:ca6b:4422 with SMTP id j8-20020a170902690800b00194ca6b4422mr1591114plk.3.1674486758864; Mon, 23 Jan 2023 07:12:38 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ecc4:b0:194:d87a:ffa6 with SMTP id a4-20020a170902ecc400b00194d87affa6ls11555534plh.1.-pod-prod-gmail; Mon, 23 Jan 2023 07:12:38 -0800 (PST) X-Received: by 2002:a17:902:db01:b0:195:efb2:6c6d with SMTP id m1-20020a170902db0100b00195efb26c6dmr13999275plx.45.1674486757775; Mon, 23 Jan 2023 07:12:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486757; cv=none; d=google.com; s=arc-20160816; b=07zzFx6TBeQaaOcxVZ1kJiyob4pVfpwSchZnzO4tT2e8LMGg0ZCFn72rV5rewPioqd jsxJyGsAIBsrxPyTnfQyJJ3Fag6KxYESe7zNN3MJinu9rWjDBv+9gO1LjhlXjeWr6ZKY GYoJCy1l5c9lNhMMkqUypeRcZ5VFAlf6I0rTLj8nwKZGLSP3CP023OYWIVPmKYW6NMY7 s2oZmpxbWc82W+iUADLzm3uSlcDR3FP2/CDmybU5aFSIhuRvQSmySSr6Uw75EwdM5x3Z gKzaE9zcyE36aqzZ9TreJKoo+WPd65LlnX4rS97XQZU+uVn2PLeVSSlN4x6mLRLSKsj2 Ep+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=MmdIsQUt1eQ5Mg1zNk3b8g7tN9qiVqUYt0El2a9KJYU=; b=GcgirwGWM1CwqJNCNhRCZt8UrN/pjnYfVfycPSZeoP44M/zVL9DHnheNFYLbljnCpn l+QknEapqOfgFyALga6Q4GskBn4k/ZVF0yOUM/NfvcH8WQm2Iyg7/5bb7JlgCtyWksIq mPKSw9knxIhhMvdM2pFKldLJUjQha7R8/6tppNuHDL4zNWzg/e/5LjFzvrdvBpU/uumc ZDI9d03wKyM6ewPPB3GpCSwWDXufau/eGQ9skps8b5K1DWJEzSxzSxFwq/2F5VggwYkO BAGYCUjJcikrIhvJ68ouH41oOFbA6+0Qhnc+IuhyImCT8Ub/gHqA5XXmWTM55F4wNouk 9wzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QrWykG4K; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id j12-20020a170902c3cc00b00189e9256a07sor801676plj.56.2023.01.23.07.12.37 for (Google Transport Security); Mon, 23 Jan 2023 07:12:37 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:ab50:b0:194:d5ed:b9ea with SMTP id ij16-20020a170902ab5000b00194d5edb9eamr13099534plb.57.1674486757426; Mon, 23 Jan 2023 07:12:37 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:12:36 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki , Maxime Ripard , Linus Walleij , Maarten Lankhorst Subject: [RESEND PATCH v11 01/18] drm: of: Lookup if child node has DSI panel or bridge Date: Mon, 23 Jan 2023 20:41:55 +0530 Message-Id: <20230123151212.269082-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QrWykG4K; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Devices can also be child nodes when we also control that device through the upstream device (ie, MIPI-DCS for a MIPI-DSI device). Unlike the drm_of_find_panel_or_bridge helper it requires a special case to lookup a child node of the given parent that isn't either port or ports. Lookup for a child DSI node of the given parent that isn't either port or ports. If it is found then it will directly find the panel or bridge otherwise lookup for the child node with a given port and endpoint number as drm_of_find_panel_or_bridge does. Supporting this feature via existing drm_of_find_panel_or_bridge found several issues while handling usecases. Here is the previously failed attempt of similar and the same has been reverted later. commit <80253168dbfd> ("drm: of: Lookup if child node has panel or bridge") So, add a separate helper to handle this DSI use case. Example OF graph representation of DSI host, which has port but not has ports and has child panel node. dsi { compatible = "allwinner,sun6i-a31-mipi-dsi"; #address-cells = <1>; #size-cells = <0>; port { dsi_in_tcon0: endpoint { remote-endpoint = ; }; panel@0 { reg = <0>; }; }; Example OF graph representation of DSI host, which has ports but not has port and has child panel node. dsi { compatible = "samsung,exynos5433-mipi-dsi"; #address-cells = <1>; #size-cells = <0>; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; dsi_to_mic: endpoint { remote-endpoint = <&mic_to_dsi>; }; }; }; panel@0 { reg = <0>; }; }; Example OF graph representation of DSI host, which has neither a port nor a ports but has child panel node. dsi0 { compatible = "ste,mcde-dsi"; #address-cells = <1>; #size-cells = <0>; panel@0 { reg = <0>; }; }; Cc: Maxime Ripard Cc: Laurent Pinchart Cc: Linus Walleij Cc: Maarten Lankhorst Signed-off-by: Jagan Teki --- Changes for v11: - drop extra line Changes for v10: - new patch drivers/gpu/drm/drm_of.c | 112 ++++++++++++++++++++++++++++++++------- include/drm/drm_of.h | 12 +++++ 2 files changed, 104 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 7bbcb999bb75..e165951e3545 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -216,6 +216,35 @@ int drm_of_encoder_active_endpoint(struct device_node *node, } EXPORT_SYMBOL_GPL(drm_of_encoder_active_endpoint); +static int of_drm_find_panel_or_bridge(struct device_node *remote, + struct drm_panel **panel, + struct drm_bridge **bridge) +{ + int ret = -EPROBE_DEFER; + + if (panel) { + *panel = of_drm_find_panel(remote); + if (!IS_ERR(*panel)) + ret = 0; + else + *panel = NULL; + } + + /* No panel found yet, check for a bridge next. */ + if (bridge) { + if (ret) { + *bridge = of_drm_find_bridge(remote); + if (*bridge) + ret = 0; + } else { + *bridge = NULL; + } + } + + of_node_put(remote); + return ret; +} + /** * drm_of_find_panel_or_bridge - return connected panel or bridge device * @np: device tree node containing encoder output ports @@ -238,7 +267,6 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, struct drm_panel **panel, struct drm_bridge **bridge) { - int ret = -EPROBE_DEFER; struct device_node *remote; if (!panel && !bridge) @@ -259,30 +287,74 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, if (!remote) return -ENODEV; - if (panel) { - *panel = of_drm_find_panel(remote); - if (!IS_ERR(*panel)) - ret = 0; - else - *panel = NULL; - } + return of_drm_find_panel_or_bridge(remote, panel, bridge); +} +EXPORT_SYMBOL_GPL(drm_of_find_panel_or_bridge); - /* No panel found yet, check for a bridge next. */ - if (bridge) { - if (ret) { - *bridge = of_drm_find_bridge(remote); - if (*bridge) - ret = 0; - } else { - *bridge = NULL; - } +/** + * drm_of_dsi_find_panel_or_bridge - return connected DSI panel or bridge device + * @np: device tree node containing encoder output ports + * @port: port in the device tree node + * @endpoint: endpoint in the device tree node + * @panel: pointer to hold returned drm_panel + * @bridge: pointer to hold returned drm_bridge + * + * Lookup for a child DSI node of the given parent that isn't either port + * or ports. If it is found then it will directly find the panel or bridge + * otherwise lookup for the child node with a given port and endpoint number + * as drm_of_find_panel_or_bridge does. + * + * Lookup a given child DSI node or a DT node's port and endpoint number, + * find the connected node and return either the associated struct drm_panel + * or drm_bridge device. Either @panel or @bridge must not be NULL. + * + * Returns zero if successful, or one of the standard error codes if it fails. + */ +int drm_of_dsi_find_panel_or_bridge(const struct device_node *np, + int port, int endpoint, + struct drm_panel **panel, + struct drm_bridge **bridge) +{ + struct device_node *remote; + + if (!panel && !bridge) + return -EINVAL; + if (panel) + *panel = NULL; + /** + * Devices can also be child nodes when we also control that device + * through the upstream device (ie, MIPI-DCS for a MIPI-DSI device). + * + * Lookup for a child node of the given parent that isn't either port + * or ports. + */ + for_each_available_child_of_node(np, remote) { + if (of_node_name_eq(remote, "port") || + of_node_name_eq(remote, "ports")) + continue; + + goto of_find_panel_or_bridge; } - of_node_put(remote); - return ret; + /* + * of_graph_get_remote_node() produces a noisy error message if port + * node isn't found and the absence of the port is a legit case here, + * so at first we silently check whether graph presents in the + * device-tree node. + */ + if (!of_graph_is_present(np)) + return -ENODEV; + + remote = of_graph_get_remote_node(np, port, endpoint); + +of_find_panel_or_bridge: + if (!remote) + return -ENODEV; + + return of_drm_find_panel_or_bridge(remote, panel, bridge); } -EXPORT_SYMBOL_GPL(drm_of_find_panel_or_bridge); +EXPORT_SYMBOL_GPL(drm_of_dsi_find_panel_or_bridge); enum drm_of_lvds_pixels { DRM_OF_LVDS_EVEN = BIT(0), diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h index 10ab58c40746..7a97157c1fa0 100644 --- a/include/drm/drm_of.h +++ b/include/drm/drm_of.h @@ -47,6 +47,10 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, int port, int endpoint, struct drm_panel **panel, struct drm_bridge **bridge); +int drm_of_dsi_find_panel_or_bridge(const struct device_node *np, + int port, int endpoint, + struct drm_panel **panel, + struct drm_bridge **bridge); int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1, const struct device_node *port2); int drm_of_lvds_get_data_mapping(const struct device_node *port); @@ -99,6 +103,14 @@ static inline int drm_of_find_panel_or_bridge(const struct device_node *np, return -EINVAL; } +static inline int drm_of_dsi_find_panel_or_bridge(const struct device_node *np, + int port, int endpoint, + struct drm_panel **panel, + struct drm_bridge **bridge) +{ + return -EINVAL; +} + static inline int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1, const struct device_node *port2) From patchwork Mon Jan 23 15:11:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2656 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 19B413F046 for ; Mon, 23 Jan 2023 16:12:48 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id dc11-20020a056a0035cb00b00589a6a97519sf5366779pfb.8 for ; Mon, 23 Jan 2023 07:12:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486766; cv=pass; d=google.com; s=arc-20160816; b=TWM9FdX5DH1HTjP2C3l9rTmV0UoHD/dcRN2MW7q1EP4dL7qlFT8T2l0H0Tu+6Dqsxs drd/gbnfMRpcYlZQa6w9zCv6pBvDmP/dud6BiscJtJY7GGW5HW9/QDpFYthUPVvzX5VD C9pZDSFGGrIm6zYGvGGJh5uL6ufzG0j2R3CnKKkVnZFp73i0gOfkMI/c+ELlBnuyuetK eOYVvvoEMruLIlNYpxcOIDMW013jH8AWl7e6lvJos5OKroo16F0+UIowoUVcac2nWPMR cfPnbmrKtijJMqzh9OnaO2k6LEzAehpom0kwFWrLNfN1f1RYh2bYYzCfncKDGTMlshy8 6npw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=jwuk9rSWQ8k8RLMJbV9PvQBNt+q4cA55Uql6eCk+MiI=; b=Ne70DcHuvtek86dD+nM8BgxBjhzXR4Y6wI18X+Prh1uFGwa+r0OZZVFJfjLlaMo2um BMXtmhI3tKbNSKX9msIRNeqCWNyOBM4L7R2J6ESZZzwGUGJ9B0KK9bFoObPf6VaOOfeB X7dwBJSFH13vEMqEJ+HzQHl8RwwMVGGhg+WVtKJzT64vGEqnncb83Oo1qsK2B+HIa6e0 B4TyjiVoJgH5xqREw0XAmP9yP+uZHfEaLyvop+V7g+gumT5TxAE/uDK6pqlS7H9QbZGS P30bdBiy++3pD1Uy1UhF5v2+aEM1HdfxbDuRMPIe8MONStJpLuVapsPSe/ACsmy7k06X Gl1Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kjwzEN1J; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=jwuk9rSWQ8k8RLMJbV9PvQBNt+q4cA55Uql6eCk+MiI=; b=eKKhnS1wb+F7LsueM9K3FbDJcJQ8DWQk2HOJ5ScUiK5cH8r0PMMJvPPMJwoOSPLsh7 itv2C39x4aUngbavjjuPaia3ESwezZa3mPk/I81TqrBHdRnxQpqLKW1kPSzt8+WtDbxc RZ4Z25Sm3nr83bB9r6JyHZkCb6fL7seZYpeSY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jwuk9rSWQ8k8RLMJbV9PvQBNt+q4cA55Uql6eCk+MiI=; b=A4Q+aex/O8gfGy99WAXUR20ZRjbJaIk7rqEokQ1f7T7oyHVKxLmDxflz7dh2K6Y32B XO3du7YIvTPldBsqam+TUacByeXbpkm2BrgHdkCINw7r2KRQwTIjiey84rAGdjhYJyQa do9u2cfgEg2o4aDJrtUifvQsy+sRDQUA2YsX9aLGXf8oTCcRNZhF1mDy8r98/qPGuUKM d0CCQAzZFm4k6wBToJ6AMarSCjCY1bqQL84ffdO3/buSAzH4xIgQlZbY8x3dnFbT5IbT YtDZznbIk/7zl6Rsran3KsOJZ3hMf/PXyfiGGWrKtOcui0Fm+KeIEnVAUx04g+aVkZWe ZhMg== X-Gm-Message-State: AFqh2kpcw1WXML2zGf1Q4BLJeS2Yeebd4+YUBu95DBv4dmuztVNKIbya K7WhDQLxBjyqcBGQ+EtRAWoQto+X X-Google-Smtp-Source: AMrXdXvHtDtkrjgv5Ld5nru3l2BZXPk5WZOnd0cDkTUG5fxG5IV29wRR9AIUHkZHm8oYKIY4+Dyxmg== X-Received: by 2002:a62:7b10:0:b0:588:fea7:15bb with SMTP id w16-20020a627b10000000b00588fea715bbmr2276525pfc.76.1674486766742; Mon, 23 Jan 2023 07:12:46 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3801:b0:227:1b53:908c with SMTP id w1-20020a17090a380100b002271b53908cls16960483pjb.1.-pod-canary-gmail; Mon, 23 Jan 2023 07:12:46 -0800 (PST) X-Received: by 2002:a17:902:8541:b0:194:d3df:a9d1 with SMTP id d1-20020a170902854100b00194d3dfa9d1mr15053527plo.4.1674486765733; Mon, 23 Jan 2023 07:12:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486765; cv=none; d=google.com; s=arc-20160816; b=Z3pn2fEP7HDBftMm0q+vi02OtBgPLL2dsvqk6L2q6tiZW983plKMhmwV5MomBZlQHl TFfBdgfCuRfIqmGo0v9fLJwrNL5uDl8WQAbbxjJFsMiGKlaZFiNi/pC7TN0LB3cHOARl 2KrvWnO6F9KyiWa93IJUplgORZCF1Rbc4XWPhgk06KloomGIocPqpwrbKg9j3xpRpPWM 5YyXcLOKzlgRj9gdubgGV6n+fQVvqOAVpjr+GUdItyac0+/2oc+Ycn0Gpk2C5ikBrYEX 7r19ypcjoIJvcZGUtHHL87f44o+uygLwxy2or/Yvou0bS5kpO7TOTr57JtwTTjqpOvPD Enew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=tSTOOV1UI3u7LdjXOPnQjVzALAHz+1al5IvaQmAe3co=; b=h46fV5hRdZGboJFIaY7bkNbQaikxMly+ZqDou/5S2sHsKqB+ySDhuVHWhIzMh3sn9+ wpNHcP8YM4IwqfuC1aZ3p2ofLzUELrqHrHOZt18pD43SA6oRb8NoqGQ48cJHzhhszd+h QXhClUFJHFNepaBSJcdjHGnie/bOTInIdJN/dK4dWWRhzhf8RUqJpVNyLObtoCjePr2k Fw0lg1VunsMbMfgSqCsqwKVdwqzMWI8xRRzFnUPNl62+XsywlXf+H1kDnE6tShpmPd9y zEoYx3tky6oUThXVsiqGJjuYz1km2W3GjzTw6VQfyai6J03vnDc1Fpk/wjwFYO66YYmx Ztbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kjwzEN1J; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id o8-20020a1709026b0800b0019304d850bbsor1943593plk.118.2023.01.23.07.12.45 for (Google Transport Security); Mon, 23 Jan 2023 07:12:45 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:c24c:b0:194:7696:b0f9 with SMTP id 12-20020a170902c24c00b001947696b0f9mr38420938plg.66.1674486765410; Mon, 23 Jan 2023 07:12:45 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:12:44 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki , Maxime Ripard , Linus Walleij , Maarten Lankhorst Subject: [RESEND PATCH v11 02/18] drm: bridge: panel: Add devm_drm_of_dsi_get_bridge helper Date: Mon, 23 Jan 2023 20:41:56 +0530 Message-Id: <20230123151212.269082-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kjwzEN1J; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add devm OF helper to return the next DSI bridge in the chain. Unlike general bridge return helper devm_drm_of_get_bridge, this helper uses the dsi specific panel_or_bridge helper to find the next DSI device in the pipeline. Helper lookup a given child DSI node or a DT node's port and endpoint number, find the connected node and return either the associated struct drm_panel or drm_bridge device. Cc: Maxime Ripard Cc: Laurent Pinchart Cc: Linus Walleij Cc: Maarten Lankhorst Signed-off-by: Jagan Teki --- Changes for v11: - none Changes for v10: - new patch drivers/gpu/drm/bridge/panel.c | 34 ++++++++++++++++++++++++++++++++++ include/drm/drm_bridge.h | 2 ++ 2 files changed, 36 insertions(+) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index e8aae3cdc73d..be281eb26356 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -499,4 +499,38 @@ struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm, } EXPORT_SYMBOL(drmm_of_get_bridge); +/** + * devm_drm_of_dsi_get_bridge - Return next DSI bridge in the chain + * @dev: device to tie the bridge lifetime to + * @np: device tree node containing encoder output ports + * @port: port in the device tree node + * @endpoint: endpoint in the device tree node + * + * Lookup a given child DSI node or a DT node's port and endpoint number, + * find the connected node and return either the associated struct drm_panel + * or drm_bridge device. Either @panel or @bridge must not be NULL. + * + * Returns a pointer to the bridge if successful, or an error pointer + * otherwise. + */ +struct drm_bridge *devm_drm_of_dsi_get_bridge(struct device *dev, + struct device_node *np, + u32 port, u32 endpoint) +{ + struct drm_bridge *bridge; + struct drm_panel *panel; + int ret; + + ret = drm_of_dsi_find_panel_or_bridge(np, port, endpoint, + &panel, &bridge); + if (ret) + return ERR_PTR(ret); + + if (panel) + bridge = devm_drm_panel_bridge_add(dev, panel); + + return bridge; +} +EXPORT_SYMBOL(devm_drm_of_dsi_get_bridge); + #endif diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 42f86327b40a..ccb14e361d3f 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -931,6 +931,8 @@ struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, struct device_node u32 port, u32 endpoint); struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm, struct device_node *node, u32 port, u32 endpoint); +struct drm_bridge *devm_drm_of_dsi_get_bridge(struct device *dev, struct device_node *node, + u32 port, u32 endpoint); #else static inline struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, struct device_node *node, From patchwork Mon Jan 23 15:11:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2657 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id E87503F039 for ; Mon, 23 Jan 2023 16:12:53 +0100 (CET) Received: by mail-pf1-f198.google.com with SMTP id 74-20020a62184d000000b0058b9f769609sf5410657pfy.3 for ; Mon, 23 Jan 2023 07:12:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486773; cv=pass; d=google.com; s=arc-20160816; b=w+PI3r355Q/MtnRYnLeFmZQUefuUljKOUWUMEaAF0a39MfEphFvR7Bb5xFVX7NSXk9 Pjkg6RAY45rNnPnyKU/RwmzYHcaDQWaFl5JUNEneHtjE5WllbE63SBDcIpy0Tb0m4GXj w+7ehhr37ZP1zZ2ktk8PCK70XxsFaH8gVvAmVbC5zQxXQ+CA5X0ydtzMo5EvdOVq27Wd 0SQ4mZh/75V2Ym3QMn7Y4v7l0Rb+gp/dav3xbZRGKVWxxaItlNIufNGHoSYVWKAdgaVX h9Aa/AdUJPidz8wqm1R0Zdrv6P4N2jMuHqBXaRlPiXjgw86n3SnNLQDVyhd0Lv7Vou2r GUOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9iEo7O+81Ev1b9b7SMq35uGd3Evtt+cPFsdXjc/DcyY=; b=quXLY1ZjYQm4mLTdTdUHyhRyRZp5nv0aDHyvkBH6YaVfgq200xT4/9uonXy2wWkBwp 0fKjlStZPKuhoVFEX/MQ+U7KdZj5TAA4EK/Ohhg2cBMz81MUERRsEmt30KCNr+TpV1zJ n9u/V56QYjgOYVhVJKYzXjTGp70MeMWP5IEwVutOaa/g652gUSglz7rBnFub1rUabdAT UkkVLLlTUJyZOZFVMIeUl5Pyk8dmHIvYYK0B3YLrQok8oXGKWRxRBOKMHNEfFh9AnXo2 gPR6MSJFctlXZJc1YDCBiQmjtt/arKt0PsbUsNHZ81LffAyvdJ2bud6WWvOu76F9ZEYX kIOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WsEQ7ZNa; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=9iEo7O+81Ev1b9b7SMq35uGd3Evtt+cPFsdXjc/DcyY=; b=h8Ef7as9GQJpG8nr3TAW7eGKrdlKSRyzBzo1z5S/9C4p90snYc7koti58T0ZraOBm+ l8kXRJiSVbbOrIf0HnEca7jx5NQcFJytun9SeOF8xD0FRLvQyun5h64XXySMs7TqcGFU ei5hbcLaNJQeuE3U2QEH81k8lU8IuofSPTcbU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9iEo7O+81Ev1b9b7SMq35uGd3Evtt+cPFsdXjc/DcyY=; b=MY0WNypr9ZnbilvbjdxQtfoOc9qbmT08Nmq9MJt/zb3BFYcL1dfOosh6JBedsx1nSn RiO5wvuvuWQEyASqaB4t60AN2W3oWs94yI1+GB8llPSg1JIiBVXspc3mzrMZW3a7cbGG p9HwOiCBVaSJfP21JsAoeY2QSW2pkfChWteJi7kFe8ygDJFp0tFplGU6TgOUZS0ouX6l sTtyrqQ19ZU7WT7CrUL1HLDK/7YlpfS4MqnDgKn9Ix5AARjaNW6J1XInLfx28FQLZuCC qKRENgSF5jkzNDlOYCFi0v2PL8YPA8SHvfLKPDNJnad/qxi2E2DRyAtRn2xLIL9Yc/oU uMTA== X-Gm-Message-State: AFqh2krLHY72OgOAL7G+NUh9GbnxYuVN2a8d9Wkfu/psndaT0zZP1lSl rdeGyyIXb+BKxhOexO5LUxnm3qjN X-Google-Smtp-Source: AMrXdXugt/DoigPaK9kq+T0N6fxgAV+i/Kjm4flHxVq/mjBg2nNCid2HTgIMwO5FVAdskz26vgeTVw== X-Received: by 2002:a17:902:bb87:b0:189:90ba:e78f with SMTP id m7-20020a170902bb8700b0018990bae78fmr2470014pls.29.1674486773427; Mon, 23 Jan 2023 07:12:53 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:eb8b:b0:186:9fc5:6c01 with SMTP id q11-20020a170902eb8b00b001869fc56c01ls13110468plg.6.-pod-prod-gmail; Mon, 23 Jan 2023 07:12:52 -0800 (PST) X-Received: by 2002:a17:902:b285:b0:193:17b7:7909 with SMTP id u5-20020a170902b28500b0019317b77909mr26870757plr.5.1674486772485; Mon, 23 Jan 2023 07:12:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486772; cv=none; d=google.com; s=arc-20160816; b=KHGiArfZ2Zf+SIvqjsmBGdzPAloMflkgvaSUgYOqMcxc20sgpqfToxAhAbW1S798n1 R0juHPZ+Kf+ySh36XNL1vzBs0eNDerzJ+Idfr5T7TLFF+/XVqy/Z3Vsc29YvZBW0TcSa AdKI9X8lX9BxbbSz2j3D3Brphp5ntshZvYAwyJ4UCQV0sOuUqlPVUlFWeHL5GWIQ3EN/ ZiShGCohl11+27cPjjCdaXef+Jguu22tF9L443j6y/cWHUmLiXFoHE4lAkhCt+0am0uk IyXUcSqO0zNHqUyooZqUWssz6T2f6a1IX0Lemmm8N/5+y4zauno90CepKq7hXgKoPhNQ G5RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=hzZAbpiEnBNpm8Oq4UXR0GXlgPppEqEywsWppVlOZ3Q=; b=qw9h3u01RXRq9l14OEq+b8IatHsfZJElA76/PkF0MeL06Ghv3QUvh5wF1lTnCDYjO8 3R1vntwPoJRZzqjqubh7hY4alSoAaFenfKZX2wBUmr2oGeSGiQY4MVohF4979zfG015c RhsOyLMNFhKcRCJSnFk4gRrCZeZZzoGcIWzphNmBF82uLZnBSQGIB5CjMU6laRj5Bo+l ltzlzbsLv6Zg8p6T5fc8ACsNHOO+/ftzZUAS14QgwV82EDXu8tGNW7uhWTn5szIfZ/ks 9f3lDOIeAPhUiKRHpdhi5DumLPXuzLIwmdolh7VUB6VBd94HNoNTflVEM9V/Kv6ueAit bCBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WsEQ7ZNa; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id iw4-20020a170903044400b0019607b0d9bbsor847881plb.80.2023.01.23.07.12.52 for (Google Transport Security); Mon, 23 Jan 2023 07:12:52 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:8f82:b0:194:5116:c3e1 with SMTP id z2-20020a1709028f8200b001945116c3e1mr23105664plo.24.1674486772176; Mon, 23 Jan 2023 07:12:52 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:12:51 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 03/18] drm: exynos: dsi: Drop explicit call to bridge detach Date: Mon, 23 Jan 2023 20:41:57 +0530 Message-Id: <20230123151212.269082-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WsEQ7ZNa; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Exynos DSI already converted into a bridge driver, so bridge detach will supposeĀ happened during bridge chain removal done by the bridge core. Drop the explicit call chain to detach the bridge. Signed-off-by: Jagan Teki --- Changes for v11: - none Changes for v10: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 06d6513ddaae..df15501b1075 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1531,8 +1531,6 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct exynos_dsi *dsi = host_to_dsi(host); struct drm_device *drm = dsi->encoder.dev; - if (dsi->out_bridge->funcs->detach) - dsi->out_bridge->funcs->detach(dsi->out_bridge); dsi->out_bridge = NULL; if (drm->mode_config.poll_enabled) From patchwork Mon Jan 23 15:11:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2658 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DB6B93F039 for ; Mon, 23 Jan 2023 16:13:01 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id e11-20020a17090a77cb00b0022925dd66d3sf9568544pjs.4 for ; Mon, 23 Jan 2023 07:13:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486780; cv=pass; d=google.com; s=arc-20160816; b=xAjuxgIy42oJssSojE79cGcl3kZp5jdZPyHl9mwkQMC8O5gAR5N6folNkbF2lEv6gO hhLxEfQ3of1bzKS0Z6VpH2hyv+Hvw9SPKZn1C2UKyJlqn6JUABmqeEDu9F2+ZT34ucmR JgCxnv1uGqacwxPqeC6oivLExRlMaGN9yo3dz36aqr89DngCktVjs5Uc7q9rRv7VqmK/ pUBYa6kqadXC0jhYAzQ8SMXmzBhSjc8cki/firAemgd724AqJq+4fjAsP8gnbDDrS/XA DWfalgWbmC2a9CjnbUugToDEvjazmRA+b9sjzuJiVWydN6W3L4XDIxjrNMlBS7VnrWhi 0vDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=wlRQ7g1hfLilQYMH3kKtPdXm+8f9QQje/2pG9r40bIg=; b=dNRDHBEZWfO83CArYzddR9dn2juEUAx9UhVom2vMzBqg/cOX+XyxVVtEUxZT8d+WF/ SGj8eCf8RHExKfYmCi629XAnryUOcmRt3bYwrMmiTgKKQ8i8BuR88B+yvmSR9PmnzEAo 8CjxPr2dRy0Ux6AVU3G2FUsHA6toICFOFZ5Q1bMTHPi9w/LQufJF+AJbGq55YlEMqHJ2 A20sHuscZgXHmxv7R5/bznOMLc/W69h2cMxpvBu8ftU/UYv3Bb/zcN5PG/uQqzfY/atU 3YzMr4TeFv6vnA/S7BKMNYDQAjN472DQhYMIc99XxMWhf18FnyRKtGYoDfomQ1YQeKsu pEGw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UwPu6XfW; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=wlRQ7g1hfLilQYMH3kKtPdXm+8f9QQje/2pG9r40bIg=; b=obExheR4HI+euPPSE2U5BdL7j3Bex4UMTWL2CLBlzsrOHwj3LExTVxKhLi6itScZLW AmGIgvjx4BXZkYJQo4Z/hpSmUaj2JhproQ0yNzsN+FvobfvOtrfCwcxouz4ytayAyYJ/ bzvLFrCBP0BmMN84vk7q/WfSdoHOALBaAKU9I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wlRQ7g1hfLilQYMH3kKtPdXm+8f9QQje/2pG9r40bIg=; b=jgCo51EsGh6CauDW04PSNYBoOYmKt3yxL7y2bdCBF0AcRvmzcc8V7Id0fr88XNfwLd /khEN1Yhfhh652faQdXY5ta0zVYgw6ml9iL9SaWSBfsupf7mgZ/l1O3P9fV99m1nzCrf MsOLu/6IPi9ro15aBhaCOyV7zS7Tcb+UnKzF+2L8cCWRv2l7iNsbZP9qv4JkU9Q4+q33 ZMYxEq71ZeEwZVW01yf0bJ1SKlRiPr0JuvZHPdGdLTDraPSwBdlkpL2yvJKW/dUGdp/b aj3BnNb8nYYdPI7djPn7QAjLhHVP4HNFjUQNBbvybyBfNxXMh+oiEXV65P2czb/4UJC0 OG5w== X-Gm-Message-State: AFqh2krPm96us6lsfQiJbaAczTtDG5MxQynJodfVqqm9XqSILzy7jXC8 wkEGk6+Lc1NGzzqx0QQPuB23lrfl X-Google-Smtp-Source: AMrXdXvmj5qXSLfJF1UttFEmufqG5GZPbM+y9c/N6b+Wx4lKEQvbaDuoVmDhqg52kjY5d4G6FM4oEA== X-Received: by 2002:a17:90a:43a1:b0:22b:aaab:4f10 with SMTP id r30-20020a17090a43a100b0022baaab4f10mr1834063pjg.203.1674486780585; Mon, 23 Jan 2023 07:13:00 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:d507:b0:22b:b830:313 with SMTP id t7-20020a17090ad50700b0022bb8300313ls8529148pju.3.-pod-control-gmail; Mon, 23 Jan 2023 07:13:00 -0800 (PST) X-Received: by 2002:a17:902:ee51:b0:194:87e5:8fa2 with SMTP id 17-20020a170902ee5100b0019487e58fa2mr26080431plo.6.1674486779670; Mon, 23 Jan 2023 07:12:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486779; cv=none; d=google.com; s=arc-20160816; b=Mr7EOC4ltde1t2weTs9Alp3MuPkITtSLuHyvI0hjNgmPQhpjoV5khAwgHvuDbKgDTB wsLs9oOqySyUU0f/a+5s/zgPH71nR9LTIppNlYjkNm2dADvxzUxZ5O9CTeBFz8UzapMb c3PQnUIcvKrWRwB8FDsP+PcTe2sjQ90Z/SUBzwSkIUEMHh2+WXqV0gxGvlnlpb453Rlp mdOumGYxc9H9RYPcsgt1W6JfyPYNP/8YOR3j/DgZ7E9vstxxuzFDuRSlTjwM+Jo1Cjlu kEfeOFUjrrtfa1417Gsdqpjgj1Uxco3HFNlvDpWHioSnwegDLq8EUv1Hy5OWIjUNfibl cu6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=mGTDxW/0FHkTpFMtVsyR5B6P9WvJldck4Y7e8f4Ze3U=; b=ntTno0qnmw7nQMylmbtSXcumxp2eJndgxpPw+7ZcHEwpP6zdcOp2N4VxkrkyKm7z1i uo2L85oXcSx11md6nbb3W4tJbOM+DktHtGCx8FhagJYvsysqAwofyVjppR44mjpbadpG Z8FNgGR7lccBO1WDFkyXun7PtAlZTIE6KJ0GIaweyzl5Au2i4+FM2P44NH1zKySGs4eL KM10PTy4dL8yqpoU9pmqM+H1kOWNGT5TNdtoosfoNW02CkUHi3oVF340eK9EVMM1OuOz eF9r9ZwOb8rnRbZt4WNn9Ce+b7oB1dZO8pZbMlMXulQjM5gIRZ2NjSidTMrSYPDLhLS3 YlpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UwPu6XfW; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id y4-20020a170902ed4400b001948c66c431sor9839325plb.149.2023.01.23.07.12.59 for (Google Transport Security); Mon, 23 Jan 2023 07:12:59 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:8493:b0:194:3dce:deb5 with SMTP id c19-20020a170902849300b001943dcedeb5mr26778292plo.27.1674486779349; Mon, 23 Jan 2023 07:12:59 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:12:58 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 04/18] drm: exynos: dsi: Switch to devm_drm_of_dsi_get_bridge Date: Mon, 23 Jan 2023 20:41:58 +0530 Message-Id: <20230123151212.269082-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UwPu6XfW; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , devm_drm_of_dsi_get_bridge is capable of looking up the downstream DSI bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_dsi_get_bridge. Signed-off-by: Jagan Teki --- Changes for v11: - none Changes for v10: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index df15501b1075..4a165764121d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1470,18 +1470,9 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct device *dev = dsi->dev; struct drm_encoder *encoder = &dsi->encoder; struct drm_device *drm = encoder->dev; - struct drm_panel *panel; int ret; - panel = of_drm_find_panel(device->dev.of_node); - if (!IS_ERR(panel)) { - dsi->out_bridge = devm_drm_panel_bridge_add(dev, panel); - } else { - dsi->out_bridge = of_drm_find_bridge(device->dev.of_node); - if (!dsi->out_bridge) - dsi->out_bridge = ERR_PTR(-EINVAL); - } - + dsi->out_bridge = devm_drm_of_dsi_get_bridge(dev, dev->of_node, 1, 0); if (IS_ERR(dsi->out_bridge)) { ret = PTR_ERR(dsi->out_bridge); DRM_DEV_ERROR(dev, "failed to find the bridge: %d\n", ret); @@ -1531,8 +1522,6 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct exynos_dsi *dsi = host_to_dsi(host); struct drm_device *drm = dsi->encoder.dev; - dsi->out_bridge = NULL; - if (drm->mode_config.poll_enabled) drm_kms_helper_hotplug_event(drm); From patchwork Mon Jan 23 15:11:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2659 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C57213F039 for ; Mon, 23 Jan 2023 16:13:08 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id s5-20020a170903214500b00195e3b26848sf5203298ple.7 for ; Mon, 23 Jan 2023 07:13:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486787; cv=pass; d=google.com; s=arc-20160816; b=RgFxmlG06LXrco/8q7a/wOIUZY/SrJekERkNgK4v6omveT46AYut/6eqgMqH8zmn+M 8mN9xuPZLjVWitZ2cvo1nqWC6A4HBPZXm+7evlPfcr/oC564e9hSbvvO56mmpelYv5Bq gE+6Wahq3b0UvOfk5RAR1ooCtzgNYM7pTu9kRQCVjCA1WLlrokNte8wmfSItfEx0eBUc o3KQw3mB8R0wl+TIcj4Lw8ukjj4yvBUSr15Eygq86ZCl77u271FX8bgrRtpG1ovlhUhV smoXjVUkf7+mLGT0F2XDwdkG2S5d4x7W3obI5i54tAGzLWf6JXX7iD7clhUCgkCY7k4L ebRQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=rj29TvV1Fy0o+cQdQBRqNIaKoF4khkYbLPwRdk6ZmD8=; b=nIvQ+ATYxeynR31aPq6+pFemRedTvsfzOaa8K0nw9OAOZ162ccUF+v+u6j40rHpfJT uEU4rURHmIEpEpRUASAdPTctbvXmaH77Zr+Hjnj7oFdtxu/WO1mZ2UDnaO8BFlK5DkD2 VLTib5VzvndnZbyqGe5ChSKs+5iF4zlvAoHa36sD+9fekQo7cWnnd2aAOo669noRRTne WH1nS1tTrJxs/4lF5LjR5aroYIGBX3ffT7mLZUFnKwVmmeXie1Bm91TEdy/clwv2Bn1F RToIQMI7XXezoDgW2/MpPmYWA98FNcUBjA4Wmli6W5Cm1Ta1xr2DZjnq8hIhxfMZTk7I g3KA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l5+Ef8r4; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=rj29TvV1Fy0o+cQdQBRqNIaKoF4khkYbLPwRdk6ZmD8=; b=bCSTV+53LB/D7RfwHHgw9QY5dlzpcUOk7KqTp0phsFdrQXB2rG3nTSCJjeP4MsoAa3 CB1YSWF9FJ3dUGnwqytBRrzZFJLv+/RBDcGkPvumytL3qLJ1PzGwIlTRKJ10K0Bcb/U5 FPkH7q5N1+lRsZXoqtxdvwcLqECRP7EH472Vo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rj29TvV1Fy0o+cQdQBRqNIaKoF4khkYbLPwRdk6ZmD8=; b=f8/FQk7QqLSxteEIWy00OLrnAKHY5MMDSa8jxeuH1sWSj04c+vr/nduqd42UbknIKa LTAKj3TRWzCceTxznI8OOGvcivAgwor4L6lU/ty+PxUDoCvGriMNvK8zHHLw9NQesJyl 79r0+D3eobFGG7BlIPi8bqazxgfVllFz+oKoB/TSnusyx0eG8gxQ5Gfz08Mv7w1ZT0b+ /DuiyCVmv4T882ncH+dVHvB4whlaZCJqwTucCjrsELEk/ZUvF3EcWnE61HYZiRir2oUE ZVRLvivPzs5TlqKcxgC0XmoMO38hhMof0IxgBadbKyOWfmnAf+nfcU9zCTRc2m/whGHZ 3rLg== X-Gm-Message-State: AFqh2kpSIRC6ZGVcE9QqKlHvLNlE/VS6lanlj/nZ+KqyWbvsbhjSg2EI WGSQXUAa1xEYl458P02j86bB01Lu X-Google-Smtp-Source: AMrXdXvejBNd+/mfuPlUU3Ldt5HgoH9zXdogsdWBLMJ9/08+wbNORcrzn+Ehb01SsYd6clPfyENlLA== X-Received: by 2002:a63:a514:0:b0:4cf:8d6b:94ca with SMTP id n20-20020a63a514000000b004cf8d6b94camr2159248pgf.144.1674486787515; Mon, 23 Jan 2023 07:13:07 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8c8e:b0:178:35a3:84d9 with SMTP id t14-20020a1709028c8e00b0017835a384d9ls13080456plo.10.-pod-prod-gmail; Mon, 23 Jan 2023 07:13:06 -0800 (PST) X-Received: by 2002:a17:902:b111:b0:194:65fa:c354 with SMTP id q17-20020a170902b11100b0019465fac354mr23216985plr.20.1674486786649; Mon, 23 Jan 2023 07:13:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486786; cv=none; d=google.com; s=arc-20160816; b=M+/Y6ApgfhyQwPePOuyseh8eocR9/Q0YpcBt0Dc4cJsl+jk9E3FSOLXhK6KV7MR9oD SthS/WYfPFPfJu0OQuGhzOeY/eqbMq53PzSOmP7sUGF2qhQMQ/l1LLZ/p/5CtKaPw/4l UzzZdcoWUGMwm5HiuU5HiT8zVbJhFniEAkLp7EhGxDNROpuMnUZkbnrPZjREaRa5Dzx/ BMl49PFg0gPvtSczXfklcvAdJ1Uc4lvk99jJ5ds5aQ/zqVAD+lnEKWxFnrBS6zKDR/sL BeASk0NpDoeNLpDi6woC8pXbV+nbWkMgRgCwz7nQjkXHkSig1+iTEbyburlLYBlX1WvN RD9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=OP7Jau0/ejAFJB5Wx1RIrnmlhV/a7KNNElWN91vRccI=; b=PMBJjsGFww1nAoztF6+KoIpVY4LP/9OG4TYoAg3g0BIBPHAtB3eAw7o8BJWeyKN8SB 0FGrSpqvde69oPKX/jaeWEgBtfypxxm7xgJhH5IfuCIR00GLjDbQepLfqEw/e3ww7kKx a5iigZFntfO8VAJ1SiDuN8KehhBwIuycR+HhBUGYMhzrYoU7g0ZiIrUPGbb0GQlg+2nV wcauNlLHZeVYFdtGUIedEvXAWk3/1FAbbYxU5Cb4f7MmT29Nv1GWf78stmj3phRzSvEF vb4V14g7Vi2wTWDlnA4JahIfcOkzOJArVz5IykI8Qy4z0mpB4AzygPmwUPKg48gku3Wj UXGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l5+Ef8r4; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id u12-20020a170902b28c00b001930cece136sor1314549plr.28.2023.01.23.07.13.06 for (Google Transport Security); Mon, 23 Jan 2023 07:13:06 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:a408:b0:194:98ef:db00 with SMTP id p8-20020a170902a40800b0019498efdb00mr24530354plq.19.1674486786305; Mon, 23 Jan 2023 07:13:06 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.12.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:13:05 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 05/18] drm: exynos: dsi: Mark PHY as optional Date: Mon, 23 Jan 2023 20:41:59 +0530 Message-Id: <20230123151212.269082-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l5+Ef8r4; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The same Samsung MIPI DSIM master can also be used in NXP's i.MX8M Mini/Nano/Plus SoC. In i.MX8M Mini/Nano/Plus SoC the DSI Phy requires a MIPI DPHY bit to reset in order to activate the PHY and that can be done via upstream i.MX8M blk-ctrl driver. So, mark the phy get as optional. Reviewed-by: Frieder Schrempf Reviewed-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v11: - collect Frieder RB Changes for v10: - add Plus in commit message - collect Marek RB Changes for v9, v8, v7, v6, v5, v4, v3, v2: - none Changes for v1: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 4a165764121d..5918d31127aa 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1687,7 +1687,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) if (IS_ERR(dsi->reg_base)) return PTR_ERR(dsi->reg_base); - dsi->phy = devm_phy_get(dev, "dsim"); + dsi->phy = devm_phy_optional_get(dev, "dsim"); if (IS_ERR(dsi->phy)) { dev_info(dev, "failed to get dsim phy\n"); return PTR_ERR(dsi->phy); From patchwork Mon Jan 23 15:12:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2660 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id E4BC63F039 for ; Mon, 23 Jan 2023 16:13:15 +0100 (CET) Received: by mail-pl1-f199.google.com with SMTP id z10-20020a170902ccca00b001898329db72sf7358549ple.21 for ; Mon, 23 Jan 2023 07:13:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486794; cv=pass; d=google.com; s=arc-20160816; b=rndHBfLSxDusRsQ/Qz4GQKCdHJAqugxoHB+KzJM568rrAIIQ/cLyihjNQHA+9AxLeh dFsvtBPZwf8mEGqw+yJJLA/wJ2+hEzga/yu7aBIOkFhQQTdVjJCzH2SAuOS2uPvm+Ozy vwxZoJlimy1FBbHo3D7jp/3gnGShiYgK7EfHuX4mB1/H1nsNQZeIHuMmUGmBEFskgGA0 SIJm6v0lbm05SrJe59T34X3GZtYKpgMegEtn5pI4EXNobe0CTgvHOhJ2/EXtq4JsKvL0 Di4tig2XjZOtCnXKkNDAb6WhyCsUbR0iNu4Bp7TrAVyMYbHk7JUNoSFngLozQ3XSLdEC ANfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=XqSpdrri+fiCeYn6ib5UNY9VKQ9PiJqW/JTVZ4J7k5A=; b=hNEnOCdBEDWdH7glTcfcnafO+ajFoDl+Fn7ELXsvVzzgY/RRUYGk/9HrRfNZqb5P7s kAr4/gndgVQFbJc1RvK/2+NxiikekHGyMfrgEQ7BCbIjh2Z3Xekh/y/LN5o18gaiHXpw LbfC9DFSfOGIiw0x0ALkE3bYcThsJljHekcz0iIyZyPU/snc4DoEwgSb/bSAhMMMVbGm 2D9SStWFcDs0DgLJGQex3MeWOVAAGyXN1/UXKGpiPdujc2lI4K/ZPruwMjrwV051dYso GTpSq77YGJ0iq/hjcc/S6FM34+nhyzp7K+9dX1a9smrYWLy2NEAwOY4SMj2MJ9yEMW7h Eeug== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RzKYLDoY; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=XqSpdrri+fiCeYn6ib5UNY9VKQ9PiJqW/JTVZ4J7k5A=; b=UifQjjfqpkGzG5GOFuMlYa0+eeS6xomhYnlk9Duji/FMGDm2Khi7dXznbcg5IbuNIo OLoyalGyNgOUUnH33oA+7UU488kwU4RvLjYveZIGHTNebKc0T3yQga7mq6f3nSiHVJ8Q 9472sk5yls4UESM3FzxqFccWBbuC9bSytrmjA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XqSpdrri+fiCeYn6ib5UNY9VKQ9PiJqW/JTVZ4J7k5A=; b=mU0c6U512qROfl7C0fsHxbiySOEEoAIohJ86E75zJPBMiwvsOEWcLDM15FLikwXwfn FvPTuuJqtjkiv3SeZgE0ZQS5mtJ7h3M6QRwTBfZIWG+Fmx9ADswuYhoqcGUZy9J0I9Id V5k20FeeO5NCGGw7FSjYwEgOngapjKuB2hSua+LZjLmlk+UeRaDhoIwNsrOkxQ0vtpNa E0Qd2mhJnq7lqdCKSuG4A1VAW6vhnIog3bywckU5tdbWDBZAJ8Gs6kvJxz4j9s7z7gW6 DI+mYdHKI6xPZHWzJfjgtCtYMWxTffEi6WgHokl9AspMKEi0vUYh8UtMtXBoTHpHBx7i SNOA== X-Gm-Message-State: AFqh2krxc/sNj7FZTaMuq19LPCLz+vbsSNRLfprz3PXWPR8qhPr+DObD HTKqDGr456QEGnwt/xZT4lGqwoUV X-Google-Smtp-Source: AMrXdXuOjq2B1eV+hEezyISC48W7LjRB9vKtz+ByMGe++DO5ucGg93NeTy7ieLgMqhyXbWkfay6YPA== X-Received: by 2002:a17:90b:11d6:b0:22b:bcc8:4eba with SMTP id gv22-20020a17090b11d600b0022bbcc84ebamr1343447pjb.243.1674486794653; Mon, 23 Jan 2023 07:13:14 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:8a90:b0:22b:b854:cc44 with SMTP id x16-20020a17090a8a9000b0022bb854cc44ls2396427pjn.0.-pod-preprod-gmail; Mon, 23 Jan 2023 07:13:14 -0800 (PST) X-Received: by 2002:a17:903:244f:b0:194:6400:cd37 with SMTP id l15-20020a170903244f00b001946400cd37mr35116581pls.14.1674486793732; Mon, 23 Jan 2023 07:13:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486793; cv=none; d=google.com; s=arc-20160816; b=Z9PKHfB8B/Jv9tfqCKZOIPPlte3P+DXN5etVv3t2eMLFM2K1mc82BKkMkZ8HDEIsf5 H9GUkLxDLWMbktTuniCAE2qIdyjFN963QRNvMK+nNPpO8nA061Vq/dGMqYdLGDMa62O3 vKpEk2SFofAGNYVInyARUAGlOxEgpnMaqWdYhXRUcK5GDUq0rP4SS7pCw6yI6RRAnHue cmcGT3o2gr45Q+HLXj5g1HnuZFWKs3d2em4eY7783BGZpqmpUC1hajoaf2BC+r1jGMzO 1+cWzxODBATH5AhevsdBHp3AuM6IayQtThbbgDjOPH9JRf9ByhXlJnTuZ4vdv8+uyKMc nWlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=U9Y+6AYElVzmPLEEE0cyqelpoYne/+Yj3ASyLzLLBEM=; b=HlDDIaizTgz0z/+UePnuOHqgLLyykQXTcBaexnb4mx0rjrDYSDrpiDhmcfLLVos9fb 5+g6skZKy9RuD9U6/oeWIXze3dK3lIZCBi8Yf3QukSk469GmlVmZIii6yjk9uzB3fqkj kLR71zNhymo8xnJuhJ1oI4S1ckF1BbHJ0YZUArxMARL72pDHfW6xTOXDbre7LZcmLpYP UN+1s/caTX/HJaytjkmFaSKomKzBvkOI8/WBZYsPpHOloxLPqH+iWCk9M0Z11n5uLDEL 83px4C1mX5we6d0AP1nGwv6yyJ0TsfIVD2ONUhJ1PRlTeorY/Ur56HMtf4guePRane5b rxOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RzKYLDoY; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id y17-20020a17090322d100b0019606b11723sor974524plg.29.2023.01.23.07.13.13 for (Google Transport Security); Mon, 23 Jan 2023 07:13:13 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:9688:b0:192:55ab:88fe with SMTP id n8-20020a170902968800b0019255ab88femr24360923plp.56.1674486793408; Mon, 23 Jan 2023 07:13:13 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:13:12 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 06/18] drm: exynos: dsi: Add platform PLL_P (PMS_P) offset Date: Mon, 23 Jan 2023 20:42:00 +0530 Message-Id: <20230123151212.269082-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RzKYLDoY; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Look like PLL PMS_P offset value varies between platforms that have Samsung DSIM IP. However, there is no clear evidence for it as both Exynos and i.MX 8M Mini Application Processor Reference Manual is still referring the PMS_P offset as 13. The offset 13 is not working for i.MX8M Mini SoCs but the downstream NXP sec-dsim.c driver is using offset 14 for i.MX8M Mini SoC platforms [1] [2]. PMS_P value set in sec_mipi_dsim_check_pll_out using PLLCTRL_SET_P() with offset 13 and then an additional offset of one bit added in sec_mipi_dsim_config_pll via PLLCTRL_SET_PMS(). Not sure whether it is reference manual documentation or something else but this patch trusts the downstream code and handle PLL_P offset via platform driver data so-that imx8mm driver data shall use pll_p_offset to 14. Similar to Mini the i.MX8M Nano/Plus also has P=14, unlike Exynos. [1] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/sec-dsim.c?h=imx_5.4.47_2.2.0#n210 [2] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/sec-dsim.c?h=imx_5.4.47_2.2.0#n211 Reviewed-by: Marek Vasut Signed-off-by: Frieder Schrempf Signed-off-by: Jagan Teki --- Changes for v11, v10, v9: - none Changes for v8: - updated commit message for 8M Nano/Plus Changes for v7, v6: - none Changes for v5: - updated clear commit message Changes for v4, v3, v2: - none Changes for v1: - updated commit message - add downstream driver link drivers/gpu/drm/exynos/exynos_drm_dsi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 5918d31127aa..7a845badb1b2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -194,7 +194,7 @@ /* DSIM_PLLCTRL */ #define DSIM_FREQ_BAND(x) ((x) << 24) #define DSIM_PLL_EN (1 << 23) -#define DSIM_PLL_P(x) ((x) << 13) +#define DSIM_PLL_P(x, offset) ((x) << (offset)) #define DSIM_PLL_M(x) ((x) << 4) #define DSIM_PLL_S(x) ((x) << 1) @@ -263,6 +263,7 @@ struct exynos_dsi_driver_data { unsigned int max_freq; unsigned int wait_for_reset; unsigned int num_bits_resol; + unsigned int pll_p_offset; const unsigned int *reg_values; }; @@ -471,6 +472,7 @@ static const struct exynos_dsi_driver_data exynos3_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -483,6 +485,7 @@ static const struct exynos_dsi_driver_data exynos4_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -493,6 +496,7 @@ static const struct exynos_dsi_driver_data exynos5_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -504,6 +508,7 @@ static const struct exynos_dsi_driver_data exynos5433_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 0, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5433_reg_values, }; @@ -515,6 +520,7 @@ static const struct exynos_dsi_driver_data exynos5422_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 1, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5422_reg_values, }; @@ -628,7 +634,8 @@ static unsigned long exynos_dsi_set_pll(struct exynos_dsi *dsi, writel(driver_data->reg_values[PLL_TIMER], dsi->reg_base + driver_data->plltmr_reg); - reg = DSIM_PLL_EN | DSIM_PLL_P(p) | DSIM_PLL_M(m) | DSIM_PLL_S(s); + reg = DSIM_PLL_EN | DSIM_PLL_P(p, driver_data->pll_p_offset) | + DSIM_PLL_M(m) | DSIM_PLL_S(s); if (driver_data->has_freqband) { static const unsigned long freq_bands[] = { From patchwork Mon Jan 23 15:12:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2661 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5135F3F039 for ; Mon, 23 Jan 2023 16:13:22 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id s5-20020a170903214500b00195e3b26848sf5203631ple.7 for ; Mon, 23 Jan 2023 07:13:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486802; cv=pass; d=google.com; s=arc-20160816; b=HO0xSsBlkkHRlAQAQG/9XczRAG6yfSyqEtoTNl6UdIsVo8yA2gYvZwHXNoqLuSJQfB j3oFmes3nbIJMQx7cDmvldeWpVyXQgqIvVtfk6hjC8QRje8A4jjAbQO+nvBPgJOK1ybc fUzkkHm08OgSYSQUxsgXqgjIH5l4mVww+/dpgBqJHTQaypMR8RXjGuBUpO6TfedoxbeB wTViy8Ac6TMMW/wWhQvx+MbpJoZPNbJSy3fgAxT+tWnNrZGK5OkUnlgM0VOFkGoSL8sD nIDEHGK2vk9FRrLzABvdrbSVFx0PhUuIPXoAncJUJMqg3gs45XI8Ae2bnIifQrV+Pkr8 N8WQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=lSzeO6hBSceBA8RS5jVGAPZfCtVU/53KSfg1EUbTTzY=; b=d4bfE6lYKReG3TKYurgl3q/pvTXTdtnR6aaXcUzjJNgZiV64MRV6gdJcgw3s5g/+wI k6LDVpxGvpXdx5/VZc+6jkDsP8wER1v0VlIzklsKx/0jhKbzfBSX0Ccg8OS8EuaYhcXJ bEpQ1POzT4l8d9ZYpILQblMEYXqt7TQZDRlr1tL9rEI0E9xBHfiDfFjcbb7p0NX04wRc WNaf/DMm8ipDJnoNQ/WVRpQEPTcOxEiH+kV+ndNDQ7UdVZB18rFxV+JjWyS2JB7aDcK7 yJJstuQCIZtj+Ls7Gc58urvAUD/ceX41XgVrAUgEpig21BnivEtimwKxpq/2VdlQW9rp twFg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rNYUxj7H; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=lSzeO6hBSceBA8RS5jVGAPZfCtVU/53KSfg1EUbTTzY=; b=G6OVDBZnye80mYX8oNODSUb6cjeWKp2OpJRp0RkSxUpO1odhw1hk3V210IXBHnKJ8O 4UowqwC6e09dTY8KNZ/PIx0u2PlqVazrac/BOwOZA5ilzcADYYctZtZ6AivjtTyszoHV t0LAwMxekrMlBr1J9oVnMvxXL5DLOjUGbGnOs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lSzeO6hBSceBA8RS5jVGAPZfCtVU/53KSfg1EUbTTzY=; b=MTkusreg8Dz7PoA1QN7V1b9e15CwWJTZcgQQ047GT2+NPA3IG9D+eBjqd5gYfIIA68 gqzzr3v3WATDFeUsqXziVdGDvFzHXyF8ACAynkP28tCI3DaHe0rbG/4WZm9/IsnmTyS3 mQUx0swYltUpVxlKyaOWgqssUhl4cg6vHX420EHPeEIG58C06NT/kg2F1Pcp7sO0ROFy 75qFMiH9pdZMIuvQL3OP9ZoqIXX7VACTOFyALJsGMd8X+98g1KsrCMGopg7einEMcr3w cXyY1bMr5xQEADKobZD8q19hcp5rhJ5h4864M+TO4le9976SMzbR8j1t0kHoBJv4Pxfs TiHA== X-Gm-Message-State: AFqh2kq/0VGSGKzow5hL8584A5MwRcxbN3kADmluN3kK8XgJ7awwYlLW q1UXo67L9dgX54F1HWMbKbqQqDGP X-Google-Smtp-Source: AMrXdXugeqjW3OUF4lGEZ/Joo9aDattWUNcPQ9Xzts01FoREsiYIuxkOPxs0w9rhSzxSP+97ZgzZwA== X-Received: by 2002:a63:4e57:0:b0:4cf:977f:6eb1 with SMTP id o23-20020a634e57000000b004cf977f6eb1mr2164088pgl.216.1674486801927; Mon, 23 Jan 2023 07:13:21 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:b406:b0:189:b2b2:56d5 with SMTP id x6-20020a170902b40600b00189b2b256d5ls13175202plr.0.-pod-prod-gmail; Mon, 23 Jan 2023 07:13:21 -0800 (PST) X-Received: by 2002:a17:902:cec4:b0:195:f3d5:bead with SMTP id d4-20020a170902cec400b00195f3d5beadmr12107675plg.36.1674486800837; Mon, 23 Jan 2023 07:13:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486800; cv=none; d=google.com; s=arc-20160816; b=xK9N1LNCbrRS3qXTu4fRSJTx9ebo1wTtpJkYuHtjKaZdsipJ2bqPCJC9mckTl3nFRo sSPqyHj8JYJ7rUAtXeGzBuXBRlOsUL57QFKsSU8ZiFBBoTiPXYmdcxKCvQaTPlM670PQ nm5NFjBAi4p7nY29q9GR+KBtr45uggtck/FATtGlA0Ey1LXrdcQFtPPPOiykv5xhad3T m4UAR3ljJv8ZXtOSM9DCWBi8r0YhlCNV7KMxSKFfby8dfain2XdFJW7pSTsBt0rIt5YC UcKOrO5UiylmIHqUYVOexO6x3p+xOzca6vCJK2Pfo6gGIrQVh6/cyNlc/bwO/aNNAOl6 Bj2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=JAvQp2V3Vm1L1L/g4jdQdxESIHHdfq30+cBP/7icSHY=; b=lMGVE21U8928XSd0x+P3nNSSvmwYfq4/zfiDymyFJKDz3R5DHQ6v9hfaEA0ExF/Zqg 57e2iMTChqWVI6M9P/ncz4tEuBqTWplrqOTogfCbsjkHEETd9hXk9HqgU6HaB5ob/4xv JHkuw600ORwSx9Pi+rOYxfKQ/aAYCsLzunrTQB8k4FVLslKH+eChjJrX4jCT/NFWsJG0 CYP1gPfVvVFYOGdntcwjob/ve0mcs+HmI3PvgL1rtLPNP2kYKpJALbcFhnGfAvhmH8pU YBxR7SwJVQ39URbr17f7MyJJC+cyjLC5UUkHyYrdLGcSmf8kU8ky2n8L3aGmcmIg3/Kt iV1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rNYUxj7H; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id o18-20020a170902779200b001949e879626sor8606918pll.75.2023.01.23.07.13.20 for (Google Transport Security); Mon, 23 Jan 2023 07:13:20 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:8304:b0:194:9de0:bed1 with SMTP id bd4-20020a170902830400b001949de0bed1mr22176414plb.32.1674486800519; Mon, 23 Jan 2023 07:13:20 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:13:19 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 07/18] drm: exynos: dsi: Introduce hw_type platform data Date: Mon, 23 Jan 2023 20:42:01 +0530 Message-Id: <20230123151212.269082-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rNYUxj7H; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano/Plus. Add hw_type enum via platform_data so that accessing the different controller data between various platforms becomes easy and meaningful. Reviewed-by: Frieder Schrempf Suggested-by: Marek Szyprowski Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v11: - collect RB from Frieder - drop extra line Changes for v10: - split from previous series patch "drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge" - update enum type names drivers/gpu/drm/exynos/exynos_drm_dsi.c | 83 ++++++++++++++++++++----- 1 file changed, 68 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 7a845badb1b2..902bd46964cb 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -254,6 +254,15 @@ struct exynos_dsi_transfer { #define DSIM_STATE_CMD_LPM BIT(2) #define DSIM_STATE_VIDOUT_AVAILABLE BIT(3) +enum exynos_dsi_type { + DSIM_TYPE_EXYNOS3250, + DSIM_TYPE_EXYNOS4210, + DSIM_TYPE_EXYNOS5410, + DSIM_TYPE_EXYNOS5422, + DSIM_TYPE_EXYNOS5433, + DSIM_TYPE_COUNT, +}; + struct exynos_dsi_driver_data { const unsigned int *reg_ofs; unsigned int plltmr_reg; @@ -267,6 +276,10 @@ struct exynos_dsi_driver_data { const unsigned int *reg_values; }; +struct exynos_dsi_plat_data { + enum exynos_dsi_type hw_type; +}; + struct exynos_dsi { struct drm_encoder encoder; struct mipi_dsi_host dsi_host; @@ -297,6 +310,7 @@ struct exynos_dsi { struct list_head transfer_list; const struct exynos_dsi_driver_data *driver_data; + const struct exynos_dsi_plat_data *plat_data; }; #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) @@ -524,18 +538,13 @@ static const struct exynos_dsi_driver_data exynos5422_dsi_driver_data = { .reg_values = exynos5422_reg_values, }; -static const struct of_device_id exynos_dsi_of_match[] = { - { .compatible = "samsung,exynos3250-mipi-dsi", - .data = &exynos3_dsi_driver_data }, - { .compatible = "samsung,exynos4210-mipi-dsi", - .data = &exynos4_dsi_driver_data }, - { .compatible = "samsung,exynos5410-mipi-dsi", - .data = &exynos5_dsi_driver_data }, - { .compatible = "samsung,exynos5422-mipi-dsi", - .data = &exynos5422_dsi_driver_data }, - { .compatible = "samsung,exynos5433-mipi-dsi", - .data = &exynos5433_dsi_driver_data }, - { } +static const struct exynos_dsi_driver_data * +exynos_dsi_types[DSIM_TYPE_COUNT] = { + [DSIM_TYPE_EXYNOS3250] = &exynos3_dsi_driver_data, + [DSIM_TYPE_EXYNOS4210] = &exynos4_dsi_driver_data, + [DSIM_TYPE_EXYNOS5410] = &exynos5_dsi_driver_data, + [DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, + [DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, }; static void exynos_dsi_wait_for_reset(struct exynos_dsi *dsi) @@ -1468,8 +1477,6 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .attach = exynos_dsi_attach, }; -MODULE_DEVICE_TABLE(of, exynos_dsi_of_match); - static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { @@ -1659,7 +1666,8 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->dsi_host.dev = dev; dsi->dev = dev; - dsi->driver_data = of_device_get_match_data(dev); + dsi->plat_data = of_device_get_match_data(dev); + dsi->driver_data = exynos_dsi_types[dsi->plat_data->hw_type]; dsi->supplies[0].supply = "vddcore"; dsi->supplies[1].supply = "vddio"; @@ -1817,6 +1825,51 @@ static const struct dev_pm_ops exynos_dsi_pm_ops = { pm_runtime_force_resume) }; +static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS3250, +}; + +static const struct exynos_dsi_plat_data exynos4210_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS4210, +}; + +static const struct exynos_dsi_plat_data exynos5410_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5410, +}; + +static const struct exynos_dsi_plat_data exynos5422_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5422, +}; + +static const struct exynos_dsi_plat_data exynos5433_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5433, +}; + +static const struct of_device_id exynos_dsi_of_match[] = { + { + .compatible = "samsung,exynos3250-mipi-dsi", + .data = &exynos3250_dsi_pdata, + }, + { + .compatible = "samsung,exynos4210-mipi-dsi", + .data = &exynos4210_dsi_pdata, + }, + { + .compatible = "samsung,exynos5410-mipi-dsi", + .data = &exynos5410_dsi_pdata, + }, + { + .compatible = "samsung,exynos5422-mipi-dsi", + .data = &exynos5422_dsi_pdata, + }, + { + .compatible = "samsung,exynos5433-mipi-dsi", + .data = &exynos5433_dsi_pdata, + }, + { /* sentinel. */ } +}; +MODULE_DEVICE_TABLE(of, exynos_dsi_of_match); + struct platform_driver dsi_driver = { .probe = exynos_dsi_probe, .remove = exynos_dsi_remove, From patchwork Mon Jan 23 15:12:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2662 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0E08A3F039 for ; Mon, 23 Jan 2023 16:13:30 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id u2-20020a17090341c200b00192bc565119sf7340618ple.16 for ; Mon, 23 Jan 2023 07:13:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486808; cv=pass; d=google.com; s=arc-20160816; b=W05FT4crGN/2cFwNV6swZleQ6oVo2gnShmWghmLavufjd1bQdT5CALbbTDNLIQ/1UP oXPmI2izG1firOc46or2n3E4/pKR1SFq2330qhK/RG60wwOzJSplAzZ0xVaVk3D7b79Z EsEw1WGG1wYqGWvAD39FUh9Mjuva7bq7PIchF+OfWclYK2HqA7pR02SDDoNTpOmWgdeC DNFChzef2qJgpE0q1JoDpL78ifPxLMiOH2U6ZTy77qS/HNvhv4k34/m+4Qs8urUrIdfn wwHULzxq8g2RkZna6auGFuBZ3mVlVgkUNmA/GlaT2c2u0KcJQDlDl4z83wTBFmM7Vx75 ipUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=0GG6gqWjkvQmY2OXSJkql+DSD7iwAmtuXj7/VyxUPII=; b=A4CTY4YeIw+FrAK9VrAMjYxW3wMNNcQpcOyj+9m1+XHGc6bYl8Esg9vT1rEsiKEa6D 4v4HcBQpi5KSSlpiH5P4IUcXGFoMJZcGzRlFAQFkmPiKF4655/gc3vSRHXj7Y/tEzVrv Kj9vfNtJAtTfodoikXb1NM8o9dJOr4UZktKiDBBiqPz+NCTimBAc19UDl3c2yybjW85Y id91UnPzfirRC66aSsr/Q/rPgkhqDwoz2AouIfRH8wRBj3ot5xdoYgENO2tzJ81dELqh Fu8HHAy4FXop69fLsaTgHCI3gXmWrSI0p2iJ3VerflgcB5ZfFmIqzQchkCQROOpnwxU/ jZzg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GTAGiMWT; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=0GG6gqWjkvQmY2OXSJkql+DSD7iwAmtuXj7/VyxUPII=; b=ffJjSjWxxphIRaAUs+Cy5c+f9HEbIg04vCFrzc1Wr5Q1XTkwo+P93Ou6lOl8jzvI2H nv1bu8E7lItHDSVh21o61pRA2N8DjAC/+zNVVtXIBvBjQbtKAOOQkvmvVDlvqfSyMFAy qXpQQ4imYq/0XY95miE88S594fVFipFlkez8Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0GG6gqWjkvQmY2OXSJkql+DSD7iwAmtuXj7/VyxUPII=; b=40t0Pw1JAu3Vbrijip3kMVmsXClnPQoh1wo6wBlMAfHS4EdtZdQBGcLUtHgp2J1HKN kFCB6YK+EwLaLeQQTvQnTDgRaDBxbRMVDguvvBXbh4Vnt7I0xlvfpfGGxymIi1AiDIzk ykuyo0LPWzLjlmjEXRwicpbURSzvq7zL8n31yvHKSGRvL6WOx9xfcReEGEFFHqWEDAf+ v0yGzRkU4iahVXupVC0IZLrs8hYnF+tFsQZfH294jfXsCjQRcphXfwT3S/VPILrDf/7D /b6t0rOqTmM7aLQYWczEHPs9C0D0jgmX5jl+7+Gj/zgWvDg28s0scFwij7jT/KcmNBiJ q5Ig== X-Gm-Message-State: AO0yUKUcxCXbHowXqboGzKsnDWXRIjRiROLAT/YdKgrqwvm7tUF4geRY fHbMGTT7Ohw+p7rGetnXl0w+roxm X-Google-Smtp-Source: AK7set9+ScMOziHW6sqVYFtmVxj2b9lUJyxlNMzM50BdyeVGuCDDFHXrPv3VbWQpJ8f9JqLbtp0HxQ== X-Received: by 2002:a17:90a:2ce1:b0:22b:e36a:6ca1 with SMTP id n88-20020a17090a2ce100b0022be36a6ca1mr68012pjd.55.1674486808817; Mon, 23 Jan 2023 07:13:28 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:d507:b0:22b:b830:313 with SMTP id t7-20020a17090ad50700b0022bb8300313ls8530064pju.3.-pod-control-gmail; Mon, 23 Jan 2023 07:13:28 -0800 (PST) X-Received: by 2002:a17:902:b711:b0:185:50e4:f59c with SMTP id d17-20020a170902b71100b0018550e4f59cmr22411656pls.8.1674486808038; Mon, 23 Jan 2023 07:13:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486808; cv=none; d=google.com; s=arc-20160816; b=GIFCExNX89gr9bAN9WQTw56nV8KCEOS3e5liHb5Dge70+5RxN35hLBHvIAIM2o6Tmt zVkr0CES4wqp5dxv+BbbgQOQlD32URiXCLIoatl9hmqJwhXo+ozEAKQhM9ZZJnQs+gQ1 k21zo5D33JFsxC1dst+kB8vzQDZtTItHu8LHqO189kMu8oAZpb2wahyifbwtxqkn1XLB RPTmn5knzORjDY6T90+O7HN0FBgl8FtCfY04gkQx3tutpJFOwAFy/6OJsWejmkJxL+Zk YZLkcrgQLSg5OipP7YKyEbLZXlM4HhSjcZewcRyJVOMSMStL8LMqUVWK+4arF9o15kr0 OwcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ye7rK8XP7CKFg3FA4ZUZc/27br4/mG8uE4vofYp7eK4=; b=MehhlvYjMoPDqWUSUONX5neAiuIfnlbF67TdflKbDz2LryQ8lUzY/d+mM6oG4TwMwR 9nibs7S0dg29aiZxRfcYwclb8Lorx1h9LzYJVNX6zzrviP4ZlswzwWbAW+lHxOOKCG6/ 264UfpzJmI0wOeBIAKCn3MG0+x0ocJ0jEfLC+bnRqyaPRoYpdsLYZRgWCyGzSap4mCiQ rZkXMlQ5arW/pIx9nP+QnRbEfMDRdpKIb+i6hOQ7vFNBINfffZRJqYdspVO3pW55PW1k DL/mCeoG+n1YREkbSpFd3FR8W8cwoRdwBONNWEgOWsIPcsRU5AQpRiTlM1tEzN9SI8Jj Bg3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GTAGiMWT; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id x4-20020a1709027c0400b001896a603e17sor2096889pll.44.2023.01.23.07.13.28 for (Google Transport Security); Mon, 23 Jan 2023 07:13:28 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:903:11c7:b0:194:58c7:ab79 with SMTP id q7-20020a17090311c700b0019458c7ab79mr32632612plh.63.1674486807702; Mon, 23 Jan 2023 07:13:27 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:13:27 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 08/18] drm: exynos: dsi: Handle proper host initialization Date: Mon, 23 Jan 2023 20:42:02 +0530 Message-Id: <20230123151212.269082-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GTAGiMWT; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Marek Szyprowski Host transfer() in the DSI master will invoke only when the DSI commands are sent from DSI devices like DSI Panel or DSI bridges and this host the transfer wouldn't invoke for I2C-based-DSI bridge drivers. Handling DSI host initialization in transfer calls misses the controller setup for I2C configured DSI bridges. This patch updates the DSI host initialization by calling host to init from bridge pre_enable as the bridge pre_enable API is invoked by core as it is common across all classes of DSI device drivers. The host init during pre_enable is conditional and not invoked for Exynos as existing downstream drm panels and bridges in Exynos are expecting the host initialization during DSI transfer. Reviewed-by: Frieder Schrempf Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v11: - collect RB from Frieder Changes for v10: - update the to simple logic to handle all platforms Changs for v9 - v8: - none Changes for v2: - check initialized state in samsung_dsim_init Changes for v1: - keep DSI init in host transfer drivers/gpu/drm/exynos/exynos_drm_dsi.c | 27 +++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 902bd46964cb..d4a976d86f08 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -254,6 +254,9 @@ struct exynos_dsi_transfer { #define DSIM_STATE_CMD_LPM BIT(2) #define DSIM_STATE_VIDOUT_AVAILABLE BIT(3) +#define exynos_dsi_hw_is_exynos(hw) \ + ((hw) >= DSIM_TYPE_EXYNOS3250 && (hw) <= DSIM_TYPE_EXYNOS5433) + enum exynos_dsi_type { DSIM_TYPE_EXYNOS3250, DSIM_TYPE_EXYNOS4210, @@ -1343,6 +1346,9 @@ static int exynos_dsi_init(struct exynos_dsi *dsi) { const struct exynos_dsi_driver_data *driver_data = dsi->driver_data; + if (dsi->state & DSIM_STATE_INITIALIZED) + return 0; + exynos_dsi_reset(dsi); exynos_dsi_enable_irq(dsi); @@ -1355,6 +1361,8 @@ static int exynos_dsi_init(struct exynos_dsi *dsi) exynos_dsi_set_phy_ctrl(dsi); exynos_dsi_init_link(dsi); + dsi->state |= DSIM_STATE_INITIALIZED; + return 0; } @@ -1410,6 +1418,16 @@ static void exynos_dsi_atomic_pre_enable(struct drm_bridge *bridge, } dsi->state |= DSIM_STATE_ENABLED; + + /* + * For Exynos-DSIM the downstream bridge, or panel are expecting + * the host initialization during DSI transfer. + */ + if (!exynos_dsi_hw_is_exynos(dsi->plat_data->hw_type)) { + ret = exynos_dsi_init(dsi); + if (ret) + return; + } } static void exynos_dsi_atomic_enable(struct drm_bridge *bridge, @@ -1556,12 +1574,9 @@ static ssize_t exynos_dsi_host_transfer(struct mipi_dsi_host *host, if (!(dsi->state & DSIM_STATE_ENABLED)) return -EINVAL; - if (!(dsi->state & DSIM_STATE_INITIALIZED)) { - ret = exynos_dsi_init(dsi); - if (ret) - return ret; - dsi->state |= DSIM_STATE_INITIALIZED; - } + ret = exynos_dsi_init(dsi); + if (ret) + return ret; ret = mipi_dsi_create_packet(&xfer.packet, msg); if (ret < 0) From patchwork Mon Jan 23 15:12:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2663 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4AF3F3F039 for ; Mon, 23 Jan 2023 16:13:37 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id x12-20020a17090abc8c00b00229f8cb27a5sf4083192pjr.1 for ; Mon, 23 Jan 2023 07:13:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486816; cv=pass; d=google.com; s=arc-20160816; b=QLkfQa9kOliD8NlvLlKmMNO78zzC9LWYa04OzUHGuf8+bulbmt5aEETr8ISdjHhkGn KQF92Py/eNmh7RLEKp0VYfvRzCDUmPjP4FJ1QlRZf240MMYHc3rCaJrkwqoT3sI645tb 24ELIem7H+dPPZf2INuszbk+jBY0RuNgnke87OxqQ6yHAHATz5olqkTMzPWDPvxNWonG iocds+xlnhEtm5g7mNvUbj9kYFxbCfjiXhkUBZC91fkzxsnR4NO5IsrePq0GN46RXeic +OXs6u43WdtHmNH1QOWjqeEmPFtmOh/W2FgYIFbjQ6v/nj1Y7IUCEaUrHz6e5uGcb7L1 AvRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=/r+Rp44y/rADMooKmX9HI+58ggoF1KouygHlGrmsMAI=; b=xv6KHumFd1JrPR88/9OVmuP4QGPwCldMxBtEhtzGxFiyNl1/cTJcwNRgC1b0hKI7nT AnqA8A8+RGmDmp0SROKKEaTYDzlbzdN8RYhTSl/M6NHZ5+HiZv+aAwpReHhird+PCe2i QH2lygAadncWrd8cCdzVG3Nn0zejttipivxDRAe8PUZwA/57QMYqXS2G6JJkOtDD+cvU Gm5AGdXrGSrXErrbED0QJSYgbxi18izgCZJvLBWF8DLImra6M5VWKC7BTJUdjONsIq38 JBETfxSOrE+fDLMDXtvK1tIQelDnXuRBnIbMoXyIfaz/GlNBnr4rpX0EudLLZ8mkQK8p WrsA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZQqEnbOC; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=/r+Rp44y/rADMooKmX9HI+58ggoF1KouygHlGrmsMAI=; b=cZEoU0EFnyOh7tPcUVQfYseQLBfIQICQHjCJfi7iMc3t/7R0el9MofUqOlyB+J934+ oc5x066kcn7cNDf/RZA12WEISEWh9wU4xiVFVIINN2PUPUVgNFNEMcb55fkl5jfrnixN nbv61CIzW2Q9bVF3cWURfzKvmDZ7ZHmmQA3E0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/r+Rp44y/rADMooKmX9HI+58ggoF1KouygHlGrmsMAI=; b=JzSvpTfkLvEy3O3SqyRf9nZW2EU+YzM3lNeo6+IaGrLH6Kcs5D19h98qljrXONbRXu 63sOBbdacFyMTq2gAMO2fAa70swg0RGz7XPIm50mjcWwx7oabKswFkvEBOjRSDBIdrS1 KDI8uTiV/q0nvpuFcxGX8ufKHjLZVSDNnDq+pEG+fsXG52sWavMeQxVWPFLm6s60LITH 2yQFzAwO1FJha47jrWzS9qBkJ319/N/yaK8DVO28H9N6VhcupGPV78y4OAyAsWMGbMTJ rk6y8HbJBFYyelT31qftOURQtEkV4x+g7AqAV98uhkWsLzX4XDnU8+j0zUIB340xjEmR MM4Q== X-Gm-Message-State: AFqh2kou4eOq+4zfVd94u0HIwr4Q2EsGNvMYJI1kIg2vy7aafj4i1Ynq 16j6kF2wjP8N2JygHB6EY94Z6/f2 X-Google-Smtp-Source: AMrXdXt8hMcX9/YK+EJmfvbsqx4X6w2qo9dJV3txRD9PQYIU2A3WZ+EQaphU7DoS7I77u8ooRUddMg== X-Received: by 2002:a63:ff4e:0:b0:4ad:1c64:54c2 with SMTP id s14-20020a63ff4e000000b004ad1c6454c2mr2432254pgk.233.1674486816063; Mon, 23 Jan 2023 07:13:36 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ab8c:b0:191:1e85:3329 with SMTP id f12-20020a170902ab8c00b001911e853329ls13130636plr.3.-pod-prod-gmail; Mon, 23 Jan 2023 07:13:35 -0800 (PST) X-Received: by 2002:a17:902:a408:b0:194:98ef:db00 with SMTP id p8-20020a170902a40800b0019498efdb00mr24531892plq.19.1674486815211; Mon, 23 Jan 2023 07:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486815; cv=none; d=google.com; s=arc-20160816; b=le7S6Zk+C6E8fpGQjfElCbUMv7sgteRcQxIb6Zygw8OkTTuPlD5HoVXfprNY2yY2sp RLFm2J3bVUxRSw6ko9UIbRM3Nga0KdU/j5TpwpgGqRcdHLrb4elGfLRZtZlp8j2QQFv1 vjOO2McDxjAJXNKMifh+fEnoHrtnxwVS43SIaVBRqlZGaf4AIeLfsxoAmo3M0fUWv+o7 wqY8oV2b7Ga6DhymA8ZqF9S6RQO7qrz7PW1PTGJkmD6yokuGx1Tky2ITxLxbcJGVDX13 Je9Vfvzia5BhoUy1ebTorCrgM8XvoYFaY61MCz39MR+MxflspGGgQNHQnXwZcrBehI1s 9LTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ZmqEZ1iXO1eGhLfnNAeBU9ZBQZ2NXFn8ddY5s0UykPQ=; b=k3Rg1jvrV5zR7LvaK6SfWI+w3XYXA724nvAIxhSOvIZGbkch3Zh9sFFOWG8S3cmMV4 GuQcWTk3CjIcSoQ4DsSTcp6nFYQM8cTe8dMGVlTUUhT7yyJMLQ1TAKEb8Qp//gd5Szdd +4ne1QSySAG4rTaEiRzS/F3XzM+cDdMvXj7FzD7h4YY565yWmQh/zGh5bL12rYRp6y+b CPJDA/bTeC6MPMVtHdnpaLncRuiNm7k9i0o2/4nCh/65WXlVnn9Y34RQkJdR1syt6+R9 6ZPBW63F5aPTJO6vOF1R8D8TfQTDrTOUJzfSuVEuXS5dmqBEjuvMiMDeXsfjI37gIR81 BEmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZQqEnbOC; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id q3-20020a170902dac300b00192c0d359b4sor1802576plx.105.2023.01.23.07.13.35 for (Google Transport Security); Mon, 23 Jan 2023 07:13:35 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:cecd:b0:192:816c:8c31 with SMTP id d13-20020a170902cecd00b00192816c8c31mr20532623plg.35.1674486814831; Mon, 23 Jan 2023 07:13:34 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:13:34 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 09/18] drm: exynos: dsi: Add atomic check Date: Mon, 23 Jan 2023 20:42:03 +0530 Message-Id: <20230123151212.269082-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZQqEnbOC; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Look like an explicit fixing up of mode_flags is required for DSIM IP present in i.MX8M Mini/Nano SoCs. At least the LCDIF + DSIM needs active low sync polarities in order to correlate the correct sync flags of the surrounding components in the chain to make sure the whole pipeline can work properly. On the other hand the i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020 says. "13.6.3.5.2 RGB interface Vsync, Hsync, and VDEN are active high signals." i.MX 8M Mini Applications Processor Reference Manual Rev. 3, 11/2020 3.6.3.5.2 RGB interface i.MX 8M Nano Applications Processor Reference Manual Rev. 2, 07/2022 13.6.2.7.2 RGB interface both claim "Vsync, Hsync, and VDEN are active high signals.", the LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. No clear evidence about whether it can be documentation issues or something, so added proper comments on the code. Comments are suggested by Marek Vasut. Reviewed-by: Frieder Schrempf Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v11: - collect RB from Frieder - fix commit message Changes for v10, v9: - none Changes for v8: - update the comments about sync signals polarities - added clear commit message by including i.MX8M Nano details Changes for v7: - fix the hw_type checking logic Changes for v6: - none Changes for v5: - rebase based new bridge changes [mszyprow] - remove DSIM_QUIRK_FIXUP_SYNC_POL - add hw_type check for sync polarities change. Changes for v4: - none Changes for v3: - add DSIM_QUIRK_FIXUP_SYNC_POL to handle mode_flasg fixup Changes for v2: - none Changes for v1: - fix mode flags in atomic_check instead of mode_fixup drivers/gpu/drm/exynos/exynos_drm_dsi.c | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index d4a976d86f08..d8958838ab7b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -263,6 +263,7 @@ enum exynos_dsi_type { DSIM_TYPE_EXYNOS5410, DSIM_TYPE_EXYNOS5422, DSIM_TYPE_EXYNOS5433, + DSIM_TYPE_IMX8MM, DSIM_TYPE_COUNT, }; @@ -1465,6 +1466,32 @@ static void exynos_dsi_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +static int exynos_dsi_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct exynos_dsi *dsi = bridge_to_dsi(bridge); + struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; + + /* + * The i.MX8M Mini/Nano glue logic between LCDIF and DSIM + * inverts HS/VS/DE sync signals polarity, therefore, while + * i.MX 8M Mini Applications Processor Reference Manual Rev. 3, 11/2020 + * 13.6.3.5.2 RGB interface + * i.MX 8M Nano Applications Processor Reference Manual Rev. 2, 07/2022 + * 13.6.2.7.2 RGB interface + * both claim "Vsync, Hsync, and VDEN are active high signals.", the + * LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. + */ + if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) { + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); + } + + return 0; +} + static void exynos_dsi_mode_set(struct drm_bridge *bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode) @@ -1487,6 +1514,7 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_check = exynos_dsi_atomic_check, .atomic_pre_enable = exynos_dsi_atomic_pre_enable, .atomic_enable = exynos_dsi_atomic_enable, .atomic_disable = exynos_dsi_atomic_disable, From patchwork Mon Jan 23 15:12:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2664 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6E1ED3F039 for ; Mon, 23 Jan 2023 16:13:44 +0100 (CET) Received: by mail-pf1-f197.google.com with SMTP id u3-20020a056a00124300b0056d4ab0c7cbsf5375783pfi.7 for ; Mon, 23 Jan 2023 07:13:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486823; cv=pass; d=google.com; s=arc-20160816; b=xMJ/9chyqKnO5R8Dd4kNeT9GFisnm5ZMLCVmxxi5hAnFteRg3K3mPR9YMjyOsoBOgq 9uff2nrRqH0axZPxu16HMR8rbiRin4yA/QA9AUE7F9hAMZUiDuzWBXHoQA2aTk2lE1/x 4BxN+5F3SA3QrHE+LRn5DeaaXcVKVgbyMh7XUnpNrHCVqWf8ccE94UGH0cUV5vaH+cWV y5f4wI2pgnP5UqwM7DQJDX/jxSJH5B99XTDY7Dj/u5LqAZ8LRNYZw3HSul11IhZyOLIe CL6oTnVrPgCJNqmFD+28wl+5ptfdx88LJ73RK370IQSalQr7sRshviA0GNLY6UR6QgmA cZkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=TOHScWrBcXF2/h4rNTxkI6FzDK25kXGkvOvwcpOnPX8=; b=Ok5gh7D6zfr/qLUTp5iTfMNDpnbn9oyddqH9Bs5/ESeufYnKNOWOfnlI3fguDo6kHr INm3e2rYttzu9+OI4s9nXidBi77joIe9MCFQpPT3uwvOdgANdIiQ/2Ghty0AQRlM9Gjm EWrDuD/Nstnwuia/ZpLddGt2MYFNSaw0hXPE1gk1cegD5iW3rZtGPYi+T/ALpHQYzKJY Uaehi9cYJaB+SsxaiMVZkhyfOfTzxPs3qOOIeffxymmD+XJ/BKhOKLxnZqjQaF5J2Z9r xR/yeFiaIrSjFsEBiGvL6bUMFnqtf4Z/KmN0qiwAWg7/N7Fdif3vk7Ufh72L786JZ27T NILA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y9rWx+WX; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=TOHScWrBcXF2/h4rNTxkI6FzDK25kXGkvOvwcpOnPX8=; b=J2TJsprDju4Hpun/GGj2bmFO+1XofvG/L+3mw4t1nCAYNtB7zvnud2+4jc+x3NMQPI CQPhpGQAwGcIAov9fyE2wxcV2i5cBr7ry/zma+HosZmoixwdTfT/BbDRXGCquIC/ccpI YUWic1XIr2wRKc3CpU1vvhOSF/C1uMg1nxkew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TOHScWrBcXF2/h4rNTxkI6FzDK25kXGkvOvwcpOnPX8=; b=xNaL6/nEFb8qi8Nc9yqMbKOFbPBsa4OV9ORwLOAgKscgDLHl29ofFrFu4Thg4Ifm7+ +Sf5YIWQRUnOM6EcJlbDbf3PFeJIpn2CsFprH/FzcgycqAW1wpJ6OW9VO1Y8RwW8Cv4b Gr2JffjcXjgR2H3TXqaXyUvfLIhMnjLgL+FgqyhoGs3mQa1chi2SDX8uJqA9FjeYrqcd U9804oiE8Opzw1bnOv7v7Et0QO9AFVy2LsVSE5GTiIEaff/RC6lBwLpx/SocHa9oz7GV YJcFwGIsJX7BthQgqKfoRRfyVCVODP0uLn5jIuhsiuWcJbTcggeMxwgVUffNT0fjBpuW w63Q== X-Gm-Message-State: AO0yUKXMq2nKJWfauKXX4O9fxhtnTurU8TIwD0awUdiEXMHR1OKraHCF w/lXQJBSbVB9uErBEm0UyAobSuTd X-Google-Smtp-Source: AK7set/r3NOMFvHJc4NG6hzzW6cfEyMq2ozNGbIJwlNpnJmtrcDRQyBXw0sEN9LbSbu2yDB561alIQ== X-Received: by 2002:a17:90a:e394:b0:22b:e5c5:7e46 with SMTP id b20-20020a17090ae39400b0022be5c57e46mr23091pjz.26.1674486823209; Mon, 23 Jan 2023 07:13:43 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:eb8b:b0:186:9fc5:6c01 with SMTP id q11-20020a170902eb8b00b001869fc56c01ls13112165plg.6.-pod-prod-gmail; Mon, 23 Jan 2023 07:13:42 -0800 (PST) X-Received: by 2002:a17:902:8f82:b0:194:5116:c3e1 with SMTP id z2-20020a1709028f8200b001945116c3e1mr23108533plo.24.1674486822369; Mon, 23 Jan 2023 07:13:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486822; cv=none; d=google.com; s=arc-20160816; b=tMKl5xwS5PZ8QpZFZyOslsbqKyuRq55eDYn+x9kY886p807vf2vsPERZsOX9lgEQKn RIvhCleHpu/msyaXpL4ke2PBTa19nGFQ/oM0LeSKKpOWn4wDPnYJr4qWfCPrmcQ1yX/7 g/a1ptfxaGtZdJQvQ93VaZzEsfOhPyUA3MLGJOg3g3FEaTFBupk5Lo0w6Kf06tOcR1E3 08trHwYYFIxJcAayxyPYyQCcn8zdVIC3eobR34WVjTuQ3vRDm0t/+nOc7xvOF1hBbXD5 cDyy/zA1dzZsyJElmPFlMHbZd7SmJGv5TN8d8RoRJmGX8fALr3NnTLFyVKE4uqHkFYmt WTXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=cD1qAiqhfd1q1+yXxcnzmuelB54aAtoGJRwcpOhnRjA=; b=s7AdOmqLbxE/EulpIr7mO4zGZ+981z2AiB7TLHkNCq+ZyIQVVx0XKdAH0I+ITqCQNZ r/V2anD34YSU6Zf9GpCHjsJNiYByOSX4F36lnZ0rh9uRM2w7IqCcdWHSpEIp8OZ9aJUj rGQXjoxowkn6HOhP7XDZ6/Jn8G5vzE6ceRWF8i12cZCKrErad/633EqzYuqLru8qKOTm P4afcCcrO+FR315p3OBHd5oDBfJYHt/lmhnxNlI8X9/Iosx0CzUsNJP5mKIwkYqjbnk4 IlmPw+V/Flt2AnpHuK2ITYPATUj0kxR9xQsPjWPvzWla6tXoQJkFkp8ZOhRm5nR4DXwC xn8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y9rWx+WX; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id y21-20020a170902e19500b00194a0ec46b2sor8825256pla.151.2023.01.23.07.13.42 for (Google Transport Security); Mon, 23 Jan 2023 07:13:42 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:eccf:b0:194:dd88:ea13 with SMTP id a15-20020a170902eccf00b00194dd88ea13mr18887694plh.55.1674486822037; Mon, 23 Jan 2023 07:13:42 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:13:41 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 10/18] drm: exynos: dsi: Add input_bus_flags Date: Mon, 23 Jan 2023 20:42:04 +0530 Message-Id: <20230123151212.269082-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y9rWx+WX; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , LCDIF-DSIM glue logic inverts the HS/VS/DE signals and expecting the i.MX8M Mini/Nano DSI host to add additional Data Enable signal active low (DE_LOW). This makes the valid data transfer on each horizontal line. So, add additional bus flags DE_LOW setting via input_bus_flags for i.MX8M Mini/Nano platforms. Reviewed-by: Frieder Schrempf Suggested-by: Marek Vasut Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v11: - collect RB from Frieder Changes for v10, v9: - none Changes for v8: - add DE_LOW for i.MX8M Mini/Nano platforms. Changes for v7, v6: - none Changes for v5: - rebased based on updated bridge changes Changes for v4 - v1: - none drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index d8958838ab7b..5518d92c8455 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1691,6 +1691,10 @@ static const struct component_ops exynos_dsi_component_ops = { .unbind = exynos_dsi_unbind, }; +static const struct drm_bridge_timings dsim_bridge_timings_de_low = { + .input_bus_flags = DRM_BUS_FLAG_DE_LOW, +}; + static int exynos_dsi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1777,6 +1781,10 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; dsi->bridge.pre_enable_prev_first = true; + /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ + if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) + dsi->bridge.timings = &dsim_bridge_timings_de_low; + ret = component_add(dev, &exynos_dsi_component_ops); if (ret) goto err_disable_runtime; From patchwork Mon Jan 23 15:12:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2665 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B266A3F039 for ; Mon, 23 Jan 2023 16:13:51 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id a18-20020a62bd12000000b0056e7b61ec78sf5423321pff.17 for ; Mon, 23 Jan 2023 07:13:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486830; cv=pass; d=google.com; s=arc-20160816; b=UaeltjOfTtF65a9ds7IczYtpaEZK9jpt9WHij5NokZ37l3MjDasAnIEgcxRza7tCdA YMMhjjujNeMSwk3+1f34C79vDOPS3ov8BSSaV0bDqz1D87gVVFYtTtmXeDFj/WZZW4dv 9nyxtkHzJxvT9Mz3Ud8OBNVuTxolbU03/PVhb2fzxQPqXqklYfVScf///LhoZ0Py89/c VnMN1QqxnCVXjzsA+bFEuIsQuH4Vrr0MpQ4558ybd8CqByLThsf3WzkgNXtBrQD0SCiD Sj7d9c5D1VENeCpXu77IQWh3ABJKnnCsKmDGmS1g8thRY0e9F7izE5FaSgmHk3xY59wu QJOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=9KULKvxG5QfbZfARng7acmuae2mw/zm7CjEtASY3JtQ=; b=ZslMR/B4YLTeXVWiVIOz3ZE44z4XacN0uxX/OoAXPN1OKBnf7wtWPvlMr+4L3tyFry /+nwDRzJnnRGFeBCkqhosMu738K5fOJBPM6i0ExUapkQ9Dt7kjf1p7yQpO6xskStG6g2 BGK2OnF7cDFzP/WhV/42Wt7VGasMogz5HgJ+D3ySFRwU7wpPTQQUyFzIaz30EfWSzj8j HlJ8assJUtDRU7VHcWQxQHRVDlZ9U4iYByuOpZBB1lpqGR9hAECn+BMFtfy5Q8quzhH4 GWY4FliS5qU5cJSzeSjdF3JLp3Fw19BA5ODqy2NRX7wNQPgJOhHwhliHq6IMiiRvHvgU iRJw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hQUCk+G8; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=9KULKvxG5QfbZfARng7acmuae2mw/zm7CjEtASY3JtQ=; b=rda4U77D4MSr/zk301uuBw4LAcDAxUBPgfkfycoQWnjiVNvHVd2PNY0UuN5L2qRpLX F1Rr6OjVvECmJrWXkxpaMi5nprhXzQslJBNfeGA6wPyf4iPhJS4I9lMmm/sa57D6WdUE D7bYAArm++wjuKKtOrHqfv7Z1DKKvaKgciUpQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9KULKvxG5QfbZfARng7acmuae2mw/zm7CjEtASY3JtQ=; b=5NBnkBKSbCWLtLADbBk6VcRqjIvfNoC/5x+a1atHGMNsPuK3BwKaasfMvuvdDQ/PYy OS2TZsRn69NxVRRH3cr9JNwQrbCFJyeZgqjuaqnn1naMmZ2vcxeDhqA6EP/nWfr4K0Ne kTALftHO6U8emESNEUXiBq5vPC/EQQkXp460whU88cE8Q5LiKUWw11WprlWebQveW654 jF0pQk3Wmqt9ng8wDfbFBeOQhIrvW4tl4yuvJ6OrD3TBy3B4hWvglUjoDVzPWn0FW420 ndcbFTtJSbNI2p61GKvGRC50HgxnPFAyQAnc+xIjdWONQo5GmriWVWQgMuRUmWwh57yV z1Wg== X-Gm-Message-State: AFqh2krre/WI9WzAYgIQcf1cT6Dx8QUOPteRxua08r/YfIgisAglesgY 216XBZtmwgc0pMN06GDAO8PFaOL5 X-Google-Smtp-Source: AMrXdXuZ0beSa9GGaxFyoTRellh7OiFkeca+euL7fwgNOVKBQV8z/GbMUUbA/cqMYUnBsV2JZDS3Fg== X-Received: by 2002:a17:90a:74c2:b0:228:fcdb:43a1 with SMTP id p2-20020a17090a74c200b00228fcdb43a1mr2768186pjl.143.1674486830318; Mon, 23 Jan 2023 07:13:50 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:6b44:b0:194:6afa:c3 with SMTP id g4-20020a1709026b4400b001946afa00c3ls13127281plt.4.-pod-prod-gmail; Mon, 23 Jan 2023 07:13:49 -0800 (PST) X-Received: by 2002:a17:902:9b8b:b0:189:d8fb:152d with SMTP id y11-20020a1709029b8b00b00189d8fb152dmr25206740plp.25.1674486829436; Mon, 23 Jan 2023 07:13:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486829; cv=none; d=google.com; s=arc-20160816; b=HNObAk0426yTLiw6OjlMJhTflwGnhiaNr96PRk9q0TkLijru2OJujsTLo7ZAFrm2Yf WhoWrMGqyqKG50Vi0EZGUWqGDj+InHvxVEG1kLD6O1UwOGVPJwBYRrjAwa0RBwOuC8WX Fjy7X3QsYidZvNFdbbnYtHlJDFteiCBuy3/j9z1P9RnVnY/VX/BTXAhFwlBIqF4N1m9S qsl9rVqyGCzVm/dFfmO4XU+97nqee3fRVfBK21xelbGQfdtbWBriPbtQyQb41psi3ujU tOS9pzV5VPFBVybVX3loXVNACa6XSBKNPCPNPKMv37s50SnWtJ/SzUgfpukCTpevpcbb +syQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Do3dhCYjC50CYA+L4s1clteIXcoOQ2GW8nVaTGD414U=; b=USd+9SNVJvy+0gMAJb8rX6ltrhsZu1RnL7cCcpXRVL57lQECodA25XR/qcRD5An3Yl 1n1J1wBBMQxtsN408FmxDjW3RerH2quxy5AIx8HpD4y5mNgruN+WKxBCvKSCKesHh0kN jgBvWdhlvJ5JDHNADuVIa2h16Cqpp0YRZi9Kxn/8LuVk2l9uK2dalWmKS1paZIoDY+na 1ozrvQyg4PZZckB/ryCMsQLf9/6SXh/m9IuVGUFnfCrjOI03L5UX6ZaJK5Wmh7kOOtcK 7WsJkH/KbELBtwbMyllOixATF94ajaqXm8AzkKVjZUL0UOpjm5VVr4+tujylpjvmOq/0 wn0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hQUCk+G8; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id p1-20020a170902a40100b00192fd37a18dsor1398006plq.164.2023.01.23.07.13.49 for (Google Transport Security); Mon, 23 Jan 2023 07:13:49 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:eaca:b0:189:cbf6:9534 with SMTP id p10-20020a170902eaca00b00189cbf69534mr24224608pld.0.1674486829087; Mon, 23 Jan 2023 07:13:49 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:13:48 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 11/18] drm: exynos: dsi: Add atomic_get_input_bus_fmts Date: Mon, 23 Jan 2023 20:42:05 +0530 Message-Id: <20230123151212.269082-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hQUCk+G8; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Finding the right input bus format throughout the pipeline is hard so add atomic_get_input_bus_fmts callback and initialize with the proper input format from list of supported output formats. This format can be used in pipeline for negotiating bus format between the DSI-end of this bridge and the other component closer to pipeline components. List of Pixel formats are taken from, AN13573 i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 3.7.4 Pixel formats Table 14. DSI pixel packing formats Reviewed-by: Frieder Schrempf Tested-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v11: - collect RB from Frieder - drop extra line Changes for v10: - none Changes for v9: - added MEDIA_BUS_FMT_FIXED - return MEDIA_BUS_FMT_RGB888_1X24 output_fmt if supported output_fmt list is unsupported. - added MEDIA_BUS_FMT_YUYV10_1X20, MEDIA_BUS_FMT_YUYV12_1X24 Changes for v8: - added pixel formats supported by NXP AN13573 i.MX 8/RT MIPI DSI/CSI-2 Changes for v7 - v4: - none Changes for v3: - include media-bus-format.h Changes for v2: - none Changes for v1: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 68 +++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 5518d92c8455..7afbbe30d1d3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -1466,6 +1467,72 @@ static void exynos_dsi_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +/* + * This pixel output formats list referenced from, + * AN13573 i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 + * 3.7.4 Pixel formats + * Table 14. DSI pixel packing formats + */ +static const u32 exynos_dsi_pixel_output_fmts[] = { + MEDIA_BUS_FMT_YUYV10_1X20, + MEDIA_BUS_FMT_YUYV12_1X24, + MEDIA_BUS_FMT_UYVY8_1X16, + MEDIA_BUS_FMT_RGB101010_1X30, + MEDIA_BUS_FMT_RGB121212_1X36, + MEDIA_BUS_FMT_RGB565_1X16, + MEDIA_BUS_FMT_RGB666_1X18, + MEDIA_BUS_FMT_RGB888_1X24, + MEDIA_BUS_FMT_FIXED, +}; + +static bool exynos_dsi_pixel_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(exynos_dsi_pixel_output_fmts); i++) { + if (exynos_dsi_pixel_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +exynos_dsi_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + u32 *input_fmts; + + if (!exynos_dsi_pixel_output_fmt_supported(output_fmt)) + /* + * Some bridge/display drivers are still not able to pass the + * correct format, so handle those pipelines by falling back + * to the default format till the supported formats finalized. + */ + output_fmt = MEDIA_BUS_FMT_RGB888_1X24; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_FIXED: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + break; + default: + input_fmts[0] = output_fmt; + break; + } + + *num_input_fmts = 1; + + return input_fmts; +} + static int exynos_dsi_atomic_check(struct drm_bridge *bridge, struct drm_bridge_state *bridge_state, struct drm_crtc_state *crtc_state, @@ -1514,6 +1581,7 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_get_input_bus_fmts = exynos_dsi_atomic_get_input_bus_fmts, .atomic_check = exynos_dsi_atomic_check, .atomic_pre_enable = exynos_dsi_atomic_pre_enable, .atomic_enable = exynos_dsi_atomic_enable, From patchwork Mon Jan 23 15:12:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2666 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AC1B53F039 for ; Mon, 23 Jan 2023 16:13:57 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id a18-20020a62bd12000000b0056e7b61ec78sf5423453pff.17 for ; Mon, 23 Jan 2023 07:13:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486837; cv=pass; d=google.com; s=arc-20160816; b=k2f8s4BS78yahNENMWJtc7u0R7nBwyiYUqnm9b1UrTLml0NGIlViw2T3nowCVfF/PD x5/BmVzq7CJ+H/2spc87nYCv4u9g/4dvvIdAW4ssm0x1yWjcV4gDQ5hN3yD096oRIaOo zJcxN0iPEwkUX9ZLAQih/xXBFqwu7//oD6vMKAbb3rORDVGCHbIN6EgtrVY675vIpxBY UwE125W573hwbzmhiMoIG2EmryrAlf5XkvB0UVjs/If2evv0X47ojeC3tDYNTKct+YWn 0nvRwNYeSJaaTSftIDWx/5RejOcfjrl58fiGTGw6yOyIwFDYU0wAmLyxf2Fc3o6rhUpe h4KA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ge7MJxAutVJgWNessVyjzICG2mii8Eo/s8AbZCdboXg=; b=WfmOM+Fexw+hoey7MIYb2IX52ySjjZ5ynLPGMw9nTkMDL1BLYEeFGzZyGAuejgK7nx Ut0AoUkYLE/ZYGFcpz6dQxxnHhFTD2YKYSfZ9yj9WLaY0SMLRxal9hvQvrkOOleHX7SL R789m/t1GgiwAge4mbUZm3WCmNwVTO6cyzQjQ4AyywWwKP79atuglJ716lju5G610W86 zMrLJKYgbQthgIjyALKNaptIJCA17fd/BG7AXg2zZPX9+IJZyPnfz8vrPpNtRfbR+x58 wf/IorR/aFgFX+OJEDZUKXT1+YLJ0kASbtPK5oaCsnTRlQ5Od37pY4qsZBwoxj++rWcA t1bQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=O3tW1Izw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=Ge7MJxAutVJgWNessVyjzICG2mii8Eo/s8AbZCdboXg=; b=FyX7kpgB16pqR3T3hu0VCMnxgPS0fz26yjTrMcWWLyI7tu/zP+lSE1R90R60JQOEBG mweQ58kV6kKX6vC8BNMLe2d3VkVPt0IsBtxBN5pMm/u9ZrfLKW4T06LK/9hBI4QV628r Yt/GqiddEeG39Zi245Q66NJCoEQF+rrhL0sAo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ge7MJxAutVJgWNessVyjzICG2mii8Eo/s8AbZCdboXg=; b=coIq2tf3C/rGyipSwwCsSYkV9Rl89afvmgn2cATSewXDjv9/Zxj2yb2eByOYvfhmo7 ejYbuEMVMGHC0+GypAtcBvCGRyOLpv2BqzWRhaHIvG8JhxOB3U3DpDAQ+0FPCwwtwPcd 5YBfb8XfClAAkdoK/nmWJ7EBATqJ+l9BuWoACs3eEx8BZZB3ee2XlGZYHgxLuQScV7U1 PWtakI2HaEvBmDCwFmn1f6rSadaFjlZH+f7gatTIwYS04FJnuySePSEzAUwk+eEfBKbN ANgdAy59e68uTKemcXNeO5rhGBCATXwQWJqqSWkThf3Vnr2emdsb/EyUICe+u83xGG5k 507Q== X-Gm-Message-State: AFqh2kpLjORmgMwht+b8qY26smCNWtj5F2+eA1i6SKalZqIkMKDPQes0 qXwh2oe9xWAioCdBetM4D3vuvbRN X-Google-Smtp-Source: AMrXdXsuVyh4dnh6XPfmxbZk7qiTc142Gupf60cLAxJRE46TC36xxFk/dnzWiKM+4GK3hDSTOkrNhg== X-Received: by 2002:a65:4d4b:0:b0:4d4:18ad:b6b9 with SMTP id j11-20020a654d4b000000b004d418adb6b9mr897486pgt.51.1674486837293; Mon, 23 Jan 2023 07:13:57 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:e5c3:b0:192:62df:a3e7 with SMTP id u3-20020a170902e5c300b0019262dfa3e7ls13087664plf.9.-pod-prod-gmail; Mon, 23 Jan 2023 07:13:56 -0800 (PST) X-Received: by 2002:a17:902:8f86:b0:194:5c63:364c with SMTP id z6-20020a1709028f8600b001945c63364cmr25735956plo.62.1674486836398; Mon, 23 Jan 2023 07:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486836; cv=none; d=google.com; s=arc-20160816; b=DddcdEUbJxuEWxQ5cgqJrov2M5AEeF3ccTGGOg1tV0Zw/5r7eprOZ4/vP7Kd7QxmsN kkIFWbLx47O7sO32tXYK5ygPz9BfV58ri0HYEdwZWVrQyVHMFVde21t32MVmTV8MlW8Y ZTfK5ApPaWQ+YTsYY1h4fRE+hNtmzwrRmozYcrB7RNHjrYS6898SP0dpVRK4pkcnVmsG zV/PK2OeSqVMl6TCLlZisi29lYKQ6Wc3fjNAOjJjSHXNqwiOZpqA6uOUC+/L9egPqURK MrUZ/UMlGoI0KxjS4aVT1cL8pNIS347B2p7kfeRLpKe4MF4bfqv5JhxyRlrEuP1YEd3m mlMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=M1hJXJQdt5ZCT1mSKIuiHURptg88R24MKTm4kRNQiUQ=; b=iCaZTZdtsk0ps2Xz5BcQKBzcGJsgGy1m3bFPIrc58xZHWy8nqiyENsSeUoOEpWj8dl G0f7JOyvkJ9zDTaTATvHbJFHkY2G47C7H84KQgQVQgsYdJu/oogEYm0oCG3ArElX99YK //Ps+PBL3H8xEb+TpyNmBiriFWHpjuXV7algupFQSIlw7H+/y5oI2Vk/O4rF9ceoTGqN aLF3sP42TSji/5R46fxBbm5zz8wRJJcrnP9zVulrXikrtNvBnwPQOJfbposn8I3uSEDN eVEA/dZq3sPqhrRIlJ2QlN/ajuAXizy11mEnejVwsfM7rZQIrnI5P0vs9czdDgxDzJJq B8PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=O3tW1Izw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id r10-20020a1709028bca00b0019482352535sor1386256plo.1.2023.01.23.07.13.56 for (Google Transport Security); Mon, 23 Jan 2023 07:13:56 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:c3c6:b0:192:c014:f6ba with SMTP id j6-20020a170902c3c600b00192c014f6bamr24929553plj.33.1674486836050; Mon, 23 Jan 2023 07:13:56 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:13:55 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 12/18] drm: exynos: dsi: Consolidate component and bridge Date: Mon, 23 Jan 2023 20:42:06 +0530 Message-Id: <20230123151212.269082-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=O3tW1Izw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , DSI host registration, attach and detach operations are quite different for the component and bridge-based DRM drivers.Ā  Supporting generic bridge driver to use both componentĀ and bridge based DRM drivers can be tricky and would require additional host related operation hooks. Add host operation hooks for registering and unregistering Exynos and generic drivers, where Exynos hooks are used in existing Exynos componentĀ based DRM drivers and generic hooks are used in i.MX8M bridge based DRM drivers.Ā  Add host attach and detach operation hooks for Exynos component DRM drivers and those get invoked while DSI core host attach and detach gets called. Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v11: - none Changes for v10: - split from previous series patch "drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge" drivers/gpu/drm/exynos/exynos_drm_dsi.c | 179 ++++++++++++++++++------ 1 file changed, 140 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 7afbbe30d1d3..fc7f00ab01b4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -250,6 +250,8 @@ struct exynos_dsi_transfer { u16 rx_done; }; +struct exynos_dsi; + #define DSIM_STATE_ENABLED BIT(0) #define DSIM_STATE_INITIALIZED BIT(1) #define DSIM_STATE_CMD_LPM BIT(2) @@ -281,12 +283,19 @@ struct exynos_dsi_driver_data { const unsigned int *reg_values; }; +struct exynos_dsim_host_ops { + int (*register_host)(struct exynos_dsi *dsim); + void (*unregister_host)(struct exynos_dsi *dsim); + int (*attach)(struct exynos_dsi *dsim, struct mipi_dsi_device *device); + int (*detach)(struct exynos_dsi *dsim, struct mipi_dsi_device *device); +}; + struct exynos_dsi_plat_data { enum exynos_dsi_type hw_type; + const struct exynos_dsim_host_ops *host_ops; }; struct exynos_dsi { - struct drm_encoder encoder; struct mipi_dsi_host dsi_host; struct drm_bridge bridge; struct drm_bridge *out_bridge; @@ -316,6 +325,12 @@ struct exynos_dsi { const struct exynos_dsi_driver_data *driver_data; const struct exynos_dsi_plat_data *plat_data; + + void *priv; +}; + +struct exynos_dsi_enc { + struct drm_encoder encoder; }; #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) @@ -1319,10 +1334,11 @@ static irqreturn_t exynos_dsi_irq(int irq, void *dev_id) static irqreturn_t exynos_dsi_te_irq_handler(int irq, void *dev_id) { - struct exynos_dsi *dsi = (struct exynos_dsi *)dev_id; + struct exynos_dsi *dsim = (struct exynos_dsi *)dev_id; + struct exynos_dsi_enc *dsi = dsim->priv; struct drm_encoder *encoder = &dsi->encoder; - if (dsi->state & DSIM_STATE_VIDOUT_AVAILABLE) + if (dsim->state & DSIM_STATE_VIDOUT_AVAILABLE) exynos_drm_crtc_te_handler(encoder->crtc); return IRQ_HANDLED; @@ -1595,9 +1611,8 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct exynos_dsi *dsi = host_to_dsi(host); + const struct exynos_dsi_plat_data *pdata = dsi->plat_data; struct device *dev = dsi->dev; - struct drm_encoder *encoder = &dsi->encoder; - struct drm_device *drm = encoder->dev; int ret; dsi->out_bridge = devm_drm_of_dsi_get_bridge(dev, dev->of_node, 1, 0); @@ -1611,35 +1626,15 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, drm_bridge_add(&dsi->bridge); - drm_bridge_attach(encoder, &dsi->bridge, - list_first_entry_or_null(&encoder->bridge_chain, - struct drm_bridge, - chain_node), 0); - - /* - * This is a temporary solution and should be made by more generic way. - * - * If attached panel device is for command mode one, dsi should register - * TE interrupt handler. - */ - if (!(device->mode_flags & MIPI_DSI_MODE_VIDEO)) { - ret = exynos_dsi_register_te_irq(dsi, &device->dev); - if (ret) + if (pdata->host_ops && pdata->host_ops->attach) { + ret = pdata->host_ops->attach(dsi, device); + if (ret < 0) return ret; } - mutex_lock(&drm->mode_config.mutex); - dsi->lanes = device->lanes; dsi->format = device->format; dsi->mode_flags = device->mode_flags; - exynos_drm_crtc_get_by_type(drm, EXYNOS_DISPLAY_TYPE_LCD)->i80_mode = - !(dsi->mode_flags & MIPI_DSI_MODE_VIDEO); - - mutex_unlock(&drm->mode_config.mutex); - - if (drm->mode_config.poll_enabled) - drm_kms_helper_hotplug_event(drm); return 0; } @@ -1648,12 +1643,14 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct exynos_dsi *dsi = host_to_dsi(host); - struct drm_device *drm = dsi->encoder.dev; - - if (drm->mode_config.poll_enabled) - drm_kms_helper_hotplug_event(drm); + const struct exynos_dsi_plat_data *pdata = dsi->plat_data; + int ret; - exynos_dsi_unregister_te_irq(dsi); + if (pdata->host_ops && pdata->host_ops->detach) { + ret = pdata->host_ops->detach(dsi, device); + if (ret < 0) + return ret; + } drm_bridge_remove(&dsi->bridge); @@ -1727,10 +1724,66 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) return 0; } +static int _exynos_dsi_host_attach(struct exynos_dsi *dsim, + struct mipi_dsi_device *device) +{ + struct exynos_dsi_enc *dsi = dsim->priv; + struct drm_encoder *encoder = &dsi->encoder; + struct drm_device *drm = encoder->dev; + int ret; + + drm_bridge_attach(encoder, &dsim->bridge, + list_first_entry_or_null(&encoder->bridge_chain, + struct drm_bridge, + chain_node), 0); + + /* + * This is a temporary solution and should be made by more generic way. + * + * If attached panel device is for command mode one, dsi should register + * TE interrupt handler. + */ + if (!(device->mode_flags & MIPI_DSI_MODE_VIDEO)) { + ret = exynos_dsi_register_te_irq(dsim, &device->dev); + if (ret) + return ret; + } + + mutex_lock(&drm->mode_config.mutex); + + dsim->lanes = device->lanes; + dsim->format = device->format; + dsim->mode_flags = device->mode_flags; + exynos_drm_crtc_get_by_type(drm, EXYNOS_DISPLAY_TYPE_LCD)->i80_mode = + !(dsim->mode_flags & MIPI_DSI_MODE_VIDEO); + + mutex_unlock(&drm->mode_config.mutex); + + if (drm->mode_config.poll_enabled) + drm_kms_helper_hotplug_event(drm); + + return 0; +} + +static int _exynos_dsi_host_detach(struct exynos_dsi *dsim, + struct mipi_dsi_device *device) +{ + struct exynos_dsi_enc *dsi = dsim->priv; + struct drm_device *drm = dsi->encoder.dev; + + if (drm->mode_config.poll_enabled) + drm_kms_helper_hotplug_event(drm); + + exynos_dsi_unregister_te_irq(dsim); + + return 0; +} + static int exynos_dsi_bind(struct device *dev, struct device *master, void *data) { - struct exynos_dsi *dsi = dev_get_drvdata(dev); + struct exynos_dsi *dsim = dev_get_drvdata(dev); + struct exynos_dsi_enc *dsi = dsim->priv; struct drm_encoder *encoder = &dsi->encoder; struct drm_device *drm_dev = data; int ret; @@ -1741,17 +1794,17 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, if (ret < 0) return ret; - return mipi_dsi_host_register(&dsi->dsi_host); + return mipi_dsi_host_register(&dsim->dsi_host); } static void exynos_dsi_unbind(struct device *dev, struct device *master, void *data) { - struct exynos_dsi *dsi = dev_get_drvdata(dev); + struct exynos_dsi *dsim = dev_get_drvdata(dev); - exynos_dsi_atomic_disable(&dsi->bridge, NULL); + dsim->bridge.funcs->atomic_disable(&dsim->bridge, NULL); - mipi_dsi_host_unregister(&dsi->dsi_host); + mipi_dsi_host_unregister(&dsim->dsi_host); } static const struct component_ops exynos_dsi_component_ops = { @@ -1759,6 +1812,40 @@ static const struct component_ops exynos_dsi_component_ops = { .unbind = exynos_dsi_unbind, }; +static int exynos_dsi_register_host(struct exynos_dsi *dsim) +{ + struct exynos_dsi_enc *dsi; + + dsi = devm_kzalloc(dsim->dev, sizeof(*dsi), GFP_KERNEL); + if (!dsi) + return -ENOMEM; + + dsim->priv = dsi; + dsim->bridge.pre_enable_prev_first = true; + + return component_add(dsim->dev, &exynos_dsi_component_ops); +} + +static void exynos_dsi_unregister_host(struct exynos_dsi *dsim) +{ + component_del(dsim->dev, &exynos_dsi_component_ops); +} + +static int generic_dsim_register_host(struct exynos_dsi *dsim) +{ + return mipi_dsi_host_register(&dsim->dsi_host); +} + +static void generic_dsim_unregister_host(struct exynos_dsi *dsim) +{ + mipi_dsi_host_unregister(&dsim->dsi_host); +} + +static const struct exynos_dsim_host_ops generic_dsim_host_ops = { + .register_host = generic_dsim_register_host, + .unregister_host = generic_dsim_unregister_host, +}; + static const struct drm_bridge_timings dsim_bridge_timings_de_low = { .input_bus_flags = DRM_BUS_FLAG_DE_LOW, }; @@ -1853,7 +1940,9 @@ static int exynos_dsi_probe(struct platform_device *pdev) if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) dsi->bridge.timings = &dsim_bridge_timings_de_low; - ret = component_add(dev, &exynos_dsi_component_ops); + if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) + ret = dsi->plat_data->host_ops->register_host(dsi); + if (ret) goto err_disable_runtime; @@ -1944,24 +2033,36 @@ static const struct dev_pm_ops exynos_dsi_pm_ops = { pm_runtime_force_resume) }; +static const struct exynos_dsim_host_ops exynos_dsi_host_ops = { + .register_host = exynos_dsi_register_host, + .unregister_host = exynos_dsi_unregister_host, + .attach = _exynos_dsi_host_attach, + .detach = _exynos_dsi_host_detach, +}; + static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS3250, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos4210_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS4210, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos5410_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5410, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos5422_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5422, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos5433_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5433, + .host_ops = &exynos_dsi_host_ops, }; static const struct of_device_id exynos_dsi_of_match[] = { From patchwork Mon Jan 23 15:12:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2667 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B74333F039 for ; Mon, 23 Jan 2023 16:14:05 +0100 (CET) Received: by mail-pl1-f197.google.com with SMTP id z10-20020a170902ccca00b001898329db72sf7359660ple.21 for ; Mon, 23 Jan 2023 07:14:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486844; cv=pass; d=google.com; s=arc-20160816; b=xln3x+m5IF5UL4qhP7mh3t8NaKNc4TKs2tXjZAi1iv4mZWgAYkLDKmLiwm9RGP7j/w Q9mavGUzWv2CPSCxluiXMBuwv5FITZVrqmqSsBHqZPpEubDz+lZz5H8UBbDUiFV2C/zT 7vmcawVtQeYVMQEHAxoDMcGsN1JqKRnTZFB03658F4GhGGwJIWuHWp/Bq33fOvXE+Hpx obC2i0+zsGSu7AGnDXtAoqh9eYYF02PPPeFmPyUQ1Xfu7aSxLRq2WdCFL1gTqYYJYfQw S70LgT+zjrOVYJCxgQp5Rl+GPU14KEQiG3MJA8moGshmv47wMezjKOLOvARuHv/MEEG/ rK9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=yjUjd/+zZiBR1jYnWcbv0DNt0lGn7PKBS3ru7C4XiLQ=; b=pPkt8U5HTRpRIwzQbgG6ND5U1qwPw/7JwyN/Fp8wAlx9VTtdKb2O/HD26bC8VZdNS3 ik1AutXYyHEdpLGAFkhjz0S9OkJNzeiNwwhmBfu1lpVqBzUNdDskq8rTW6DDI0QozTmM IZ5JuGOZyh/ySlrzYsWPq+2uclk1gr0ePws/bVAqeXlqJ6trdo+5j7HJwYjCqRrvPK+c yZz8bXBFTA9wHvr3YAod/Wi6BHPchYjNokwctUFdGaiR01wn6Z7pu/avvR35Z4zvZ46Z EjTB2A0Ha0b38M0WhRambaVxwAFEyhMp408ZwzOlGf4DvePFRoEPlXedZ0lsqHPg9R/5 oKSg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="bzEq6n/w"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=yjUjd/+zZiBR1jYnWcbv0DNt0lGn7PKBS3ru7C4XiLQ=; b=JaxEKtfDWFQ1PyCsZlCSJZR6buj3dJOVxqGDzigurcz/gRSV+xBW7ZZYHI4Wep1z1w niVACucaPkza5LoBw7cDpbP8CZw1TszN7Ve59xMgzuRx4RhgAkhM9dmxjS1EvveeUcWY dpz/KJecNrt9gEkNXqT6TOfuJWv4APjToc9Nk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yjUjd/+zZiBR1jYnWcbv0DNt0lGn7PKBS3ru7C4XiLQ=; b=HpIO+XLesvZo5vnnN+WHmhtkvmXqnBPzSUS8949vNraVp0A8GKcY6fkkDpZh2P3dYn xitzrDitLZhbWLpNT29rZwa72npk27zEwcPO3GB3IZtCIf2t9m5Wnf2GGp15W/l6YXgo mk7k0lWf0LtBzUs1YN53LK5kCDpn/bC2aNkYEUUo8R580CXqzI8P6bgA8WIDHN5OxCrq OGh3KSZxBhb+PSaQpfM/+bSV9QH+KlDhZ2JgAMNhX68kib/sSPoiRR6Pz2vtK/h/0YKh DUB39x1tpt32z4K+/6VcCu+PmabpVt9NRkEFyml+S8K7LQXmN3x02piwVPwyu7Qec7A2 ZjGw== X-Gm-Message-State: AFqh2kpGwV8zSg6q/+jH1rAiCJ8to2UsLvHUJqqeQG3MEML3Q2Eyn+uY 76624Nps8+E4HekSlaiC/TjFnX/v X-Google-Smtp-Source: AMrXdXveKCduJKPynxI23lUWq3ABvzmCvGt8qjD0wS3S6XmjmpC/wR+nyjcm38SVD1EF30SBWUT1Og== X-Received: by 2002:a17:90a:c004:b0:227:1f55:158d with SMTP id p4-20020a17090ac00400b002271f55158dmr2797682pjt.92.1674486844462; Mon, 23 Jan 2023 07:14:04 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:8c06:b0:210:6f33:e22d with SMTP id a6-20020a17090a8c0600b002106f33e22dls13313957pjo.2.-pod-control-gmail; Mon, 23 Jan 2023 07:14:03 -0800 (PST) X-Received: by 2002:a17:903:210d:b0:193:3a92:f4bd with SMTP id o13-20020a170903210d00b001933a92f4bdmr22491319ple.47.1674486843650; Mon, 23 Jan 2023 07:14:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486843; cv=none; d=google.com; s=arc-20160816; b=bqRm574agZ5WsQKV7h556rurRl+ik5LAlGbh24Hl1rYu6NSZxyizmzmNM3AY1i7ICm c06Wf0kWqzPLTc6/zKPLtCl0fRiaeoqHTIrjWdz7h7j6OKLNUGbt7ezemDOTYsoVOEnv j+RcYH2qPp1YjFoZ5bzmQ6SmuJESppoVSHph1u+hMjrUbEgOOXS1oIWdzDiPw4n6i11U 74NWR0UMryqAs1opLDOntv3MdjGXMMnOSkQv42mVvj9GOrJtwmFgM1UEeBO0cS+H40wv IHSiPjjCy/S0/CMh2ilGZ56RXKpt0rhv7Hd9r8dy7PRPnKZkvisWoTsascIjTU1x0+dE Fb3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=F6pfGP8F/CZnmySkaMhl1te7xx0K6up+05928JeSO18=; b=V+ij4BbSQqZnKIzDlKh1Rnm2bIwhL4PNkod479gOwLf/W1a++Z+Q3VvSvucvL85qeG hjw2kY0TGSkljdqV9THf+HIHcDRMpL/Cfbhso/98Fit2uSFjfIUjB3Xq19OUOVBRonsy h7TijviYdYteZ/uc/OfRHgyaJz7CQ/fQUaXoQce79/vX9QPUHUvJNKUc3v8+iQWVzvMp gGkvlCzBLJYyl8x90Lix/81Labq6JeCQghtblpNwcBJl2b6fYyVttMxSOymSl4qP75dp Fx3t16JZyHrvwTKJRKY2/PPcO7805AflA07gWIKzgvC8Jz58xWjjcLNxBvPMOUhD95X7 sIug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="bzEq6n/w"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id u1-20020a170902e5c100b00188bc622106sor11962759plf.91.2023.01.23.07.14.03 for (Google Transport Security); Mon, 23 Jan 2023 07:14:03 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:903:32d1:b0:195:e86f:ff18 with SMTP id i17-20020a17090332d100b00195e86fff18mr15065335plr.42.1674486843206; Mon, 23 Jan 2023 07:14:03 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.13.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:14:02 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 13/18] drm: exynos: dsi: Add Exynos based host irq hooks Date: Mon, 23 Jan 2023 20:42:07 +0530 Message-Id: <20230123151212.269082-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="bzEq6n/w"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Enable and disable of te_gpio's are Exynos platform specific irq handling, so add the exynos based irq operations and hook them for exynos plat_data. Signed-off-by: Jagan Teki --- Changes for v11: - none Changes for v10: - split from previous series patch "drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge" drivers/gpu/drm/exynos/exynos_drm_dsi.c | 55 +++++++++++++++++++++---- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index fc7f00ab01b4..5e672209ed5f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -290,9 +290,15 @@ struct exynos_dsim_host_ops { int (*detach)(struct exynos_dsi *dsim, struct mipi_dsi_device *device); }; +struct exynos_dsim_irq_ops { + void (*enable)(struct exynos_dsi *dsim); + void (*disable)(struct exynos_dsi *dsim); +}; + struct exynos_dsi_plat_data { enum exynos_dsi_type hw_type; const struct exynos_dsim_host_ops *host_ops; + const struct exynos_dsim_irq_ops *irq_ops; }; struct exynos_dsi { @@ -307,7 +313,6 @@ struct exynos_dsi { struct clk **clks; struct regulator_bulk_data supplies[2]; int irq; - struct gpio_desc *te_gpio; u32 pll_clk_rate; u32 burst_clk_rate; @@ -331,6 +336,7 @@ struct exynos_dsi { struct exynos_dsi_enc { struct drm_encoder encoder; + struct gpio_desc *te_gpio; }; #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) @@ -1344,18 +1350,38 @@ static irqreturn_t exynos_dsi_te_irq_handler(int irq, void *dev_id) return IRQ_HANDLED; } -static void exynos_dsi_enable_irq(struct exynos_dsi *dsi) +static void _exynos_dsi_enable_irq(struct exynos_dsi *dsim) { - enable_irq(dsi->irq); + struct _exynos_dsi *dsi = dsim->priv; if (dsi->te_gpio) enable_irq(gpiod_to_irq(dsi->te_gpio)); } -static void exynos_dsi_disable_irq(struct exynos_dsi *dsi) +static void _exynos_dsi_disable_irq(struct exynos_dsi *dsim) { + struct _exynos_dsi *dsi = dsim->priv; + if (dsi->te_gpio) disable_irq(gpiod_to_irq(dsi->te_gpio)); +} + +static void exynos_dsi_enable_irq(struct exynos_dsi *dsi) +{ + const struct exynos_dsi_plat_data *pdata = dsi->plat_data; + + enable_irq(dsi->irq); + + if (pdata->irq_ops && pdata->irq_ops->enable) + pdata->irq_ops->enable(dsi); +} + +static void exynos_dsi_disable_irq(struct exynos_dsi *dsi) +{ + const struct exynos_dsi_plat_data *pdata = dsi->plat_data; + + if (pdata->irq_ops && pdata->irq_ops->disable) + pdata->irq_ops->disable(dsi); disable_irq(dsi->irq); } @@ -1384,9 +1410,10 @@ static int exynos_dsi_init(struct exynos_dsi *dsi) return 0; } -static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi, +static int exynos_dsi_register_te_irq(struct exynos_dsi *dsim, struct device *panel) { + struct _exynos_dsi *dsi = dsim->priv; int ret; int te_gpio_irq; @@ -1394,7 +1421,7 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi, if (!dsi->te_gpio) { return 0; } else if (IS_ERR(dsi->te_gpio)) { - dev_err(dsi->dev, "gpio request failed with %ld\n", + dev_err(dsim->dev, "gpio request failed with %ld\n", PTR_ERR(dsi->te_gpio)); return PTR_ERR(dsi->te_gpio); } @@ -1404,7 +1431,7 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi, ret = request_threaded_irq(te_gpio_irq, exynos_dsi_te_irq_handler, NULL, IRQF_TRIGGER_RISING | IRQF_NO_AUTOEN, "TE", dsi); if (ret) { - dev_err(dsi->dev, "request interrupt failed with %d\n", ret); + dev_err(dsim->dev, "request interrupt failed with %d\n", ret); gpiod_put(dsi->te_gpio); return ret; } @@ -1412,8 +1439,10 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi, return 0; } -static void exynos_dsi_unregister_te_irq(struct exynos_dsi *dsi) +static void exynos_dsi_unregister_te_irq(struct exynos_dsi *dsim) { + struct _exynos_dsi *dsi = dsim->priv; + if (dsi->te_gpio) { free_irq(gpiod_to_irq(dsi->te_gpio), dsi); gpiod_put(dsi->te_gpio); @@ -2033,6 +2062,11 @@ static const struct dev_pm_ops exynos_dsi_pm_ops = { pm_runtime_force_resume) }; +static const struct exynos_dsim_irq_ops exynos_dsi_irq_ops = { + .enable = _exynos_dsi_enable_irq, + .disable = _exynos_dsi_disable_irq, +}; + static const struct exynos_dsim_host_ops exynos_dsi_host_ops = { .register_host = exynos_dsi_register_host, .unregister_host = exynos_dsi_unregister_host, @@ -2043,26 +2077,31 @@ static const struct exynos_dsim_host_ops exynos_dsi_host_ops = { static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS3250, .host_ops = &exynos_dsi_host_ops, + .irq_ops = &exynos_dsi_irq_ops, }; static const struct exynos_dsi_plat_data exynos4210_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS4210, .host_ops = &exynos_dsi_host_ops, + .irq_ops = &exynos_dsi_irq_ops, }; static const struct exynos_dsi_plat_data exynos5410_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5410, .host_ops = &exynos_dsi_host_ops, + .irq_ops = &exynos_dsi_irq_ops, }; static const struct exynos_dsi_plat_data exynos5422_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5422, .host_ops = &exynos_dsi_host_ops, + .irq_ops = &exynos_dsi_irq_ops, }; static const struct exynos_dsi_plat_data exynos5433_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5433, .host_ops = &exynos_dsi_host_ops, + .irq_ops = &exynos_dsi_irq_ops, }; static const struct of_device_id exynos_dsi_of_match[] = { From patchwork Mon Jan 23 15:12:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2668 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id ED9793F039 for ; Mon, 23 Jan 2023 16:14:14 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id a33-20020a630b61000000b00429d91cc649sf5492425pgl.8 for ; Mon, 23 Jan 2023 07:14:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486853; cv=pass; d=google.com; s=arc-20160816; b=Y5YAGbPdQH+o+vOwdt3lIardTbGTQYIPtIiG3C9nandhJqKvwqn23f8u709kwXPoT0 GsQm4FsKvhEyJ77YxZ0LB0LZFD+4+hjqmZtjoj2fEiF5fE87Je1qmb5h+b72W2jpnlqD WT53E9/SYlpAOn5pLHeZk6hVr2i6jrNudFTUnsLGcRVWXaWCWUb8EyQW70xvSJ/etUHi qVH4RJNqkgCeyZzeaDYf+fRl+sDD5Es6BdJaHF7gpvpZhKyNf+ZvVQRCi4Imm9WEGMjI iB2EiKnJdBVU/e+wjczA+4nClaUOQ7bvYmQwStmajCCfXZNO8ADoVT3Hyp6lmBB7oAs9 JGmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=G17i0U39SI3JLRv6TACIgUJLbF0D2H1XTRPOT31ndAQ=; b=tzLSCwi3kkSr4IVjG3mq9N5Ghzc/qOFUHxri2l+9Ko4r/4R2B0U+beU1JrgcF0nQ3z zbCDt0cYJw8H5PotXngEIEZvDVC9LIg4gDRYG1gypWo7Oos/lmfrs+qSR3NaoOp2g/ON ewZcwWU5Pg18KpXPmEzKurl1DEeEFNv80h4MeXcUh1bHH0A80TWIDCYrRCW0uUhFMoSV R7dX2dAIEFnH5qMpGb5mQl0ICz8bdThFr+2JE3gnpScnAjhD7QCYN6hY135M+Tk585np pY+TVpoRmG7DszooFi7eUV04+CwuNLMQvGM3Xw2S0loTQi8gUTfDRnNVz69ZeU1g9l31 Fwzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kwls0BZ6; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=G17i0U39SI3JLRv6TACIgUJLbF0D2H1XTRPOT31ndAQ=; b=lxFab8ncIUjzPwG1xvFqdugIe31NUJ+FdH04prWiwrg64dv13KkW0D8kQHOJvdBogW jAgM5yPxLvv0VyobVanyVatp+driUfLfRSOxJBxbLxwfvyywbeDw4sdT9PfaEWY2zaW/ j99bopfPFkzV7bgAELALEWM7OszgYx7VWodsA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G17i0U39SI3JLRv6TACIgUJLbF0D2H1XTRPOT31ndAQ=; b=acTn2gfZeHoE16ENxsKQcRmq7XAFBgi5bPdEjn5ELcEo16sEIUVaymhtNaIy4lIa6f wTRXF/FPHTqBeOCalY/QdzY0qXRHAL7urHu2BPmqxyqKRTryfWcU+kGd2x/GhJ31xm8W yAGpZblQqskk6SZyNZ8I/K6xDD6pyyet/1nrkYZNrkUBL+DSkwvMdBO9Dr+B5OCpCK/Q DzVAdTNy9pvUcpFk7gMqBY/Vf+MVQj5Pmwdr+d4TVupmfqSCz0gpRAk2mdjsg3Px829r c2zS+lOjH5YRI0FwnZkjEx/Wv+ywbbVqdG9PFDxEsOkxRLGnBTUo2JBToBs2D/eNiGH/ ioFQ== X-Gm-Message-State: AFqh2kr2uLJyXCavnq2u95F3mJd0WHXhUox7QMcTmbJ/MQFuBRaYZG3W +jw1GzqZdsmqRlfmXsNgMBH7AeV2 X-Google-Smtp-Source: AMrXdXt2tNXJlsaPiMgrMx8k1iBR2tGDQr+q898ngRy20f3BA+sjcJU9PEvvslGaioH0faUMYBE3RA== X-Received: by 2002:a17:90a:e2d4:b0:22b:b41d:979a with SMTP id fr20-20020a17090ae2d400b0022bb41d979amr1560000pjb.231.1674486853345; Mon, 23 Jan 2023 07:14:13 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:fd96:b0:214:246b:918a with SMTP id cx22-20020a17090afd9600b00214246b918als9647596pjb.2.-pod-canary-gmail; Mon, 23 Jan 2023 07:14:12 -0800 (PST) X-Received: by 2002:a17:902:f312:b0:193:678:df13 with SMTP id c18-20020a170902f31200b001930678df13mr19627567ple.36.1674486852232; Mon, 23 Jan 2023 07:14:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486852; cv=none; d=google.com; s=arc-20160816; b=wt6/iqiYw3H/WLn0MxSGFSsULi1ASY9AwXRczmeWtkbHJ72gGYEJxmUA+EhGpcYsXl lKpPLPuYy9xDmbJSieRlWgdaRo00EFUsnEq7YOzzNxuCu1fkENkAIH2UHKD3Q5ILUebX HntHSp6J9oaT7ORG+pkZSJFLPrvre+Dylc4ebuD6mB6D6Z0ssHLg5vOcr3LNPNaFFvsM 4+5G3lKbAcbkk8Vjpj947FxoswxnAejF62f/N3Os7pUg0hE4adIiCyBjyJCl0cYegXI4 d7Wpzmzwi1CpL4LaKnQIBnCtXUoIdV5h3kDgL9KjRhXYTarzL8riRiOwp2GjoOk0zqlf acNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=1FH764tlB3M7/h0AyMeuxdZl7Qja8D2bL5oyB9vThzQ=; b=K6HwQG2KcfCXjOBR+GGfAicfRk6KWTS2dpPKK1haBVlw+ABR2z2RHxaOin4VYSX9Vb 7bR7OjjHVlyO1YhKOYJVK6Vee72+HJTOGqupu7ytrpeIxciz+ax+Tcno2F0iXJvkmDzM 5mEw8Fboqy3PtosHnTzOQjrtV5X3iCehmJ6xmU3FVcynH+Le+yKCnWwq4gqnRq7+G1B2 uYrXVdyMrRtrJvzoT5sHGnkvA7yrGFqbUeDemcbBC1EpamFlNYfk6wJKGPhe4nY8aYXd CsiumpKcrLW3DGlQUe4Hd3Qd0piKYPTI/Rhmm5Qh9hH0GqzQdvtcEhbuwc7FZE8z4vIf wz7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kwls0BZ6; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id p8-20020a1709026b8800b001931004fe80sor822652plk.114.2023.01.23.07.14.12 for (Google Transport Security); Mon, 23 Jan 2023 07:14:12 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:d48a:b0:194:d872:667b with SMTP id c10-20020a170902d48a00b00194d872667bmr19700553plg.49.1674486851211; Mon, 23 Jan 2023 07:14:11 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:14:10 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RESEND PATCH v11 14/18] drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge Date: Mon, 23 Jan 2023 20:42:08 +0530 Message-Id: <20230123151212.269082-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kwls0BZ6; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano. In order to access this DSI controller between various platform SoCs, the ideal way to incorporate this in the drm stack is via the drm bridge driver. We already have a consolidated code for supporting component and bridge based DRM drivers, so keep the exynos component based code in existing exynos_drm_dsi.c and move generic bridge code as part of samsung-dsim.c Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v11: - fix BIT macro replacements - fix checkpatch --strict warnings Changes for v10: - don't add new code - move the files and update samsung_dsim names - update commit message Changes for v9: - drop the bridge attach fix for Exynos Changes for v8: - update the commit message head Changes for v7: - fix the drm bridge attach chain for exynos drm dsi driver - fix the hw_type checking logic Changes for v6: - handle previous bridge pointer for exynos dsi Changes for v5: - [mszyprow] reworked driver initialization using the same approach as in drivers/gpu/drm/{exynos/exynos_dp.c, bridge/analogix/analogix_dp_core.c}, removed weak functions, moved exynos_dsi_driver back to exynos_drm_dsi.c and restored integration with exynos_drm custom initialization. - updated the commit message [Jagan] Changes for v4: - include Inki Dae in MAINTAINERS - remove dsi_driver probe in exynos_drm_drv to support multi-arch build Changes for v3: - restore gpio related fixes - restore proper bridge chain - rework initialization issue - fix header includes in proper way Changes for v2: - fixed exynos dsi driver conversion (Marek Szyprowski) - updated commit message - updated MAINTAINERS file Changes for v1: - don't maintain component_ops in bridge driver - don't maintain platform glue code in bridge driver - add platform-specific glue code and make a common bridge MAINTAINERS | 9 + drivers/gpu/drm/bridge/Kconfig | 12 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/samsung-dsim.c | 1817 ++++++++++++++++++++ drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2001 +---------------------- include/drm/bridge/samsung-dsim.h | 117 ++ 7 files changed, 2025 insertions(+), 1933 deletions(-) create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c create mode 100644 include/drm/bridge/samsung-dsim.h diff --git a/MAINTAINERS b/MAINTAINERS index 2758e7a64fa5..b67569e484b2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6738,6 +6738,15 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/panel/samsung,lms397kf04.yaml F: drivers/gpu/drm/panel/panel-samsung-db7430.c +DRM DRIVER FOR SAMSUNG MIPI DSIM BRIDGE +M: Jagan Teki +M: Marek Szyprowski +M: Inki Dae S: Maintained diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 8b2226f72b24..e9d00bcf2d5c 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -220,6 +220,18 @@ config DRM_PARADE_PS8640 The PS8640 is a high-performance and low-power MIPI DSI to eDP converter +config DRM_SAMSUNG_DSIM + tristate "Samsung MIPI DSIM bridge driver" + depends on COMMON_CLK + depends on OF && HAS_IOMEM + select DRM_KMS_HELPER + select DRM_MIPI_DSI + select DRM_PANEL_BRIDGE + help + The Samsung MIPI DSIM bridge controller driver. + This MIPI DSIM bridge can be found it on Exynos SoCs and + NXP's i.MX8M Mini/Nano. + config DRM_SIL_SII8620 tristate "Silicon Image SII8620 HDMI/MHL bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 52f6e8b4a821..2b892b7ed59e 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o +obj-$(CONFIG_DRM_SAMSUNG_DSIM) += samsung-dsim.o obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o obj-$(CONFIG_DRM_SII902X) += sii902x.o obj-$(CONFIG_DRM_SII9234) += sii9234.o diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c new file mode 100644 index 000000000000..645071745760 --- /dev/null +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -0,0 +1,1817 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Samsung MIPI DSIM bridge driver. + * + * Copyright (C) 2021 Amarula Solutions(India) + * Copyright (c) 2014 Samsung Electronics Co., Ltd + * Author: Jagan Teki + * + * Based on exynos_drm_dsi from + * Tomasz Figa + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include