From patchwork Mon Jan 23 12:23: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: 2636 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 67FC73F039 for ; Mon, 23 Jan 2023 13:23:45 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id d10-20020a631d4a000000b00491da16dc44sf5358979pgm.16 for ; Mon, 23 Jan 2023 04:23:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476624; cv=pass; d=google.com; s=arc-20160816; b=L1xdoCzCx2201XFdHp1oYCcNxaEtAGh9Kvq2WlSpOPK7y6spoXF+4cl0U69FtNEkYU 32t/h17ZSkiQKHKtw48GBJSLZfARfOSERJXRI5yz/Dc4cVZPAHTUHSpKcKaAJT5RlDjn fR0HFaVjIrML/7u9YoWDmB93vWAr9h2yejAeU452MJlI+7Zd4J+FjErFDynppRkGt5QX qc0eRtFZPFlT8Yw4Gx45B8zsu+s6qQIVMn63R3RKmVQsNkVSWuq68mMVmfRAu7UjJVoL bD3Tm5z4jAuaBvOgZtwKaDmDNZL1IW9bB4sSPZOlxTtAjS9QY5bjD9qmV9ZcJKf6JzQV 6Bpg== 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=IR7qNDQkMTJ2Nms3p8wxEl+oEPG6CP4ygnQNUIRJNl7pp4JjYTa6vJSeverJ94ciIn ekAbkHog/B34ABPWqJZ6NO2tzZTDwGXNUB0dx1dpUSM3v7fyb7oai2FZ+Je2QHGAxdj1 8cbxGn/qhsqFDPkt165an09G9YENGJzBc/q3R5TeNz1wMl+VR+DAgRl1lBpEMD4MDRhM 6EuV6J2sktExX1Xdh/8Hrcps//f/1ke94H3HQmIt2lcAykKlbyqbtFVx5Gj9kpghVKb4 4/UYSX5qPqX7skyWlAAWUzfSByBKg/C8BzabsvYYNFB/EF5axE+981WDjemKqid8Cgyu w0ig== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ryMoHDS3; 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=eX+4viCkoOQ82HuvH2lm73PoEzIuiMzHsIKSUQYvn+FZJAyqkeQHlLpC3S+dW7diNr d3Oz979SSfyZnsKR5KVlP1AQvL/yZn36VqKY8HS6eojCCNtaxKwzpf33tD2C1zLrT9eh igJVfq2B5vCspPGp12lhPRg/QXLI/7cuq6csc= 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=VSrtagBpJJz12gob89rRyBLd7uRWHGJ4Z5fLoqi+3uZspmD40j+D32WdNbqGVu59/+ J1TWgpSun5TKS8xaE3SdyS5Usdnffzd6pBXDs5MF5Oa8WIobsYFbjtqw4RBgjT/7O/As 4kOzdEl50XFizTYZ2ZlAEuTH0QixPOyYhR078SKeIXFgsGs4Bhf0H9tfLGQ3OjyLtfk8 BpARhTHuCYTGl44Qt+5kfSCi30P37ufBEqpzndhbs8WflN6mBly3laX1zCBWEvN+t7zM 8yKKawUfjqrel/MZ8mlTrjZkR7h9RzVXh0huDvU5h61tQNbQLTsMQsVbT2hqFFlQrHna v2Eg== X-Gm-Message-State: AFqh2kraO0SBHpp1fGyud/v1gkBLcHdsRyEu5NMi8Rjv5lowt4EneLFB yQM44cmkjIWsXKCmFRIhb9cdO5uI X-Google-Smtp-Source: AMrXdXtiG0kXokyOoAl2s+TNkmiaA9XhE717Hb0fY8ypY3mKjOFo0OEcvk7YuMcUjE4UDf5iAD4woA== X-Received: by 2002:a17:90a:2849:b0:229:b7c:e55e with SMTP id p9-20020a17090a284900b002290b7ce55emr2291300pjf.179.1674476623984; Mon, 23 Jan 2023 04:23:43 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:4283:b0:178:3881:c7e3 with SMTP id ju3-20020a170903428300b001783881c7e3ls12693402plb.11.-pod-prod-gmail; Mon, 23 Jan 2023 04:23:43 -0800 (PST) X-Received: by 2002:a17:902:b282:b0:194:810a:d69b with SMTP id u2-20020a170902b28200b00194810ad69bmr24815112plr.3.1674476623086; Mon, 23 Jan 2023 04:23:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476623; cv=none; d=google.com; s=arc-20160816; b=ju729XnX14H41bT75y4gW5uqdR9+xOHX+HJ+7fjTu35J4LPjoPG33+78a9FI6EzZkY /ucJlQx24EHBgmsxg1pVK8g1YKLHoiRQ7C7JGgobhe17cANLAHtD16uMxXsihnGYogbz WHq3Qf9SOdYucjBSch05ezPHL3Tf/bh9AK0466Jw2Au7jjMW26KSYHQ9fmySL9+xs9UX hPhe1cYN27iRzZw+8OYLlVdAyub2xdnRg4sIGNLyVteMwHiYlYXDAET++bpP4WJU3I8u 2JlmbfD2my2XLbxLvzQrxOG9dcLu9ff0jdsy9su3QU0d1P3RXdF4SJPrzKceSGByuYfv mJQA== 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=oDayWAlFvXNpUU17D4aDggg/xFYCK0rrZORewlcwsf+WhQrgsN5cuZHNBtfZ6S/Hr7 ea0f5urno/+oEQHj7HYOZvSsYjhZkmVvGeTQ9YDue8CTUUE/caHWyb5Y3YKmUSxFFzul 9o39nbZGaFF57HQ85JElXEtqfTyavFnWvOhO8Zy1OrsqrvfYAaDy3/GFeOhCgAWOFYBA aNSmLNUNOtNIO1FFOunqUuqPOIOfwZSXEjAsTOOiaiBF9j43+OLtG98dfqGaXF6R4j83 bIqoNLsdWcGtRgS3HCq8bm5RDZKJdtg71da4riQTVprEYdJlG3AKINQQupDIrAXMtiXZ dm1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ryMoHDS3; 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 k4-20020a170902694400b0019607a9c7bfsor646337plt.20.2023.01.23.04.23.43 for (Google Transport Security); Mon, 23 Jan 2023 04:23:43 -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:b209:b0:194:7aae:f272 with SMTP id t9-20020a170902b20900b001947aaef272mr24074654plr.30.1674476622742; Mon, 23 Jan 2023 04:23:42 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:23:42 -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: [PATCH v11 01/18] drm: of: Lookup if child node has DSI panel or bridge Date: Mon, 23 Jan 2023 17:53:02 +0530 Message-Id: <20230123122319.261341-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=ryMoHDS3; 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 12:23: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: 2637 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 3EAC63F039 for ; Mon, 23 Jan 2023 13:23:53 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id ca13-20020a17090af30d00b00229ed7b1c82sf4314702pjb.4 for ; Mon, 23 Jan 2023 04:23:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476632; cv=pass; d=google.com; s=arc-20160816; b=0GyrI5/+H4ORrc3zk8SOnUMZhO6pfNYZyArQPstTVUx35C/STm6YiJVLPXZiCuuvW+ jiAMnFeqrP+kK59R3lFD0nIgBMC7KyetHz8tk9463d741+Y78F1pUV1jJMGCuTJcJOfA sta49arz4iY3S20d+bW0aTuu/uVgxh+s04yov6f5hSNFwBS188WAr0GJAvfd8703jDqX B41JimRDuvKr0OWgeUILDEUCZ50laPtOrpsCgJ3dfKg+P4Oj5HDzOyM2MpPOeYoxtSTi TbQbM2j/D24zxROJVOOExLYejMYWLFJsnT69ZWE2EoEMi9YHBurJhKs+dFacIbqe0cRA gu9Q== 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=ILl1WB9uHZvxSF3kx1e5zDH5Un2KxSQR1tRbGCt04hFt4RT23JipqTGcuwaXQFMV5t jShyw3uGP2oP7Wi8PJO8xvOvGlYi9pPnjr0MADr61YeRuthGc02fQnJq/Aey6TsHNF0o nTtIvDu1Ffx5jjVhx7Lw2T1z4/lBMyFkW22nGBqvfgWF+QUFdzrwcBl8EVn2rTToaA/k mFUodVBPJ9VxMVI2xp48hcK5X+o+WVig8JLum/lONVUSuPHbePx29D7HVFs/DNaWx1nX wBkU9iRbVXLFP8dsGAm1dtAIkDx1Blz2vzdTQzgGljdDMpU1nyOSSUXKxwEYT/xZEMMU XR0g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PqkuNaJe; 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=aB2qi0CymMgzD8fmIS4fgfqS0wFhc8Uf7buzT/iDXyM/KzmoeF39EF7qQp4e11cfnN w2gVJb0p7YwjZUtZkhBRGWflXewKn+qCbBHPvGcjspQSiKEkRzlYJ5+fjKYlD+VCyLDb AxXyjcx2rLYcZbuvSzCBJCLyN6/1JSJF13sNs= 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=g7UN3O+8hrGnZYP7f5dg6IrP8tFw07Z6vHlw5bZk/8yvNhYr1/i89EUWbTnSGzZ2UI qOqE9DS+IiOhBanbdByzfDVU+/wxlsSCWng2kQM/lSQuFL7IlRr6IazpLZ6z38euDbmo zoFJ3f1xitBnFO5QHwo0cwghADVV4vp2qZAHnnvfPXBtVJb7s4ep788q9JqPdkRezxu5 JHBgulcwPNweveesnfQKUa3tHOESZbadBx38ZLZW6Z3D12gtRBdGearsIIHWF7Kv2NVV e+ARkh+Ej6uJe7/9w0d/ePnQ+W0hJEEW/q7kFEGcqRKxDKNncZ+ysXvj8V7ys3e8YQNg ILvQ== X-Gm-Message-State: AFqh2kp0oUX2A5Rfx/MfVrkneDDs3ve275XGWG57vePiSNEx2XeJz5FE bGuUL6X0iVEEuqctHMuRyDXzABas X-Google-Smtp-Source: AMrXdXu1Co9fAwO9SqOfBJYRErrl9bMSjJiFOR347beXXWMCYYcNvAJAbsdahh+8A/VLEyADzjGaQA== X-Received: by 2002:a17:90a:640d:b0:227:2469:27ed with SMTP id g13-20020a17090a640d00b00227246927edmr3099486pjj.140.1674476631948; Mon, 23 Jan 2023 04:23:51 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:d507:b0:22b:b830:313 with SMTP id t7-20020a17090ad50700b0022bb8300313ls8130855pju.3.-pod-control-gmail; Mon, 23 Jan 2023 04:23:51 -0800 (PST) X-Received: by 2002:a17:902:ce0b:b0:194:586a:77ba with SMTP id k11-20020a170902ce0b00b00194586a77bamr28239109plg.52.1674476631081; Mon, 23 Jan 2023 04:23:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476631; cv=none; d=google.com; s=arc-20160816; b=gEj0ClvnmYESyu1uRh0+zvj7LayIFB2YxnXDxsqVJERbS9L2CALoYsRdnSo3LFhfxt Ip/FlS+35kEqLJxApU55+o4OBW07LXNB/fQB1iyKb/94dZcPT/n77wNFziLA88NHHoBR c2OjdXhRlpdiLKSVwD49tqt9UkGo8nM6Ot6iFiKQiuCAtxoGpbGoujoUsmMMB7NKjh3L qDgBdegIdnS87LUDqfeQn0BRHjoHgKfEcg/vXjb/xBJAcIwH01/N+Q9wCgqeDa4G3zJq K3AOUkA0kQ/NlaZ1gynEEP6aV6s+e6xIq/hgZPvkE5LGD0NRwJgeAgr/vSx6jX95wjBb VZGA== 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=u2/NkKveTo7j0Ouw9Z9hkP/xqt2lZKE5NXICzrVDogVy8IOhhnPEXjtCisV4YbJ0tW WYCpd1yEjqjHNtQcRfV3ugJgiUnSbuTZiVSnXwmX8CxhsQw2eAEkzORM4tDrSy47uHCo zkaAlwflffKmdH0U6UfUpwZ1Pgx82S2UQaL66eA5viRuMx1tY3rjpX2sgNiWb1ETAhXE /C82TyyJ44bZH9PSKWKsST4nkW8AY03hejZl7OfReLztiJqarUQ4U+Eu6WN1zn1xAqid JVqD44j2uHEjF25fbqoOKBQQBWOopYB8/8zwLRbdqM2AiNlYFKBPykjjOcfxw4qndmjI SkDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PqkuNaJe; 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 q9-20020a170902bd8900b00195fe5a566csor1509212pls.97.2023.01.23.04.23.51 for (Google Transport Security); Mon, 23 Jan 2023 04:23:51 -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:da90:b0:194:43e2:dcd9 with SMTP id j16-20020a170902da9000b0019443e2dcd9mr34549302plx.2.1674476630792; Mon, 23 Jan 2023 04:23:50 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.23.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:23:50 -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: [PATCH v11 02/18] drm: bridge: panel: Add devm_drm_of_dsi_get_bridge helper Date: Mon, 23 Jan 2023 17:53:03 +0530 Message-Id: <20230123122319.261341-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=PqkuNaJe; 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 12:23:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2638 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 4699D3F039 for ; Mon, 23 Jan 2023 13:24:01 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id h69-20020a638348000000b004d08330e922sf5328940pge.5 for ; Mon, 23 Jan 2023 04:24:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476640; cv=pass; d=google.com; s=arc-20160816; b=a9HemX18U2JO2oNAq0tG130h6SgzaEv3FxKil8M9qAEPfFT44Lu2qfWntBOXGkHjzB G+rOIN9r5zFnNq5dnen4fqShsuaELpELsdSOaW41qxqkquYlK/7PA1SQS336+5sv7Jyp 8Cy5QpIRFAx7NowmVvm7KleK9mQnbXLsmHjyKt5DNLORY6a43b8+1fMXDrcRbAD5IZU1 CH8ndRijBAUW6kUK+tUB0Ykjs1ZDtVnBno/Z1wE5LQr4wVUhhFSfHlra8dX4fMwlnC42 o+KjQHJBcYY3plr/KMUAr1Ku6fsJmSH2vF7FjDXvUhE+kBfuE0mhW8w8Wz46XPIXdL5H VjdA== 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=HE8I/06YLEJgF87JnyTGmeYV2Y1LWYJ3v98ZBwRJjAEoNnKNE6vq/w6YDDE8jBdPZ0 2DnZrZaxOMrKcSwrCORWsRsfgxwQGn1rHUiudwVu1Qv9quChsFyzFSxYIO0biUTfjzuv 7esEFENoNlahWNsB+eniTXanakRuc00VFb7miZf0TVkm8h+KbS44zstLEJ23IZ8V0R2C Xeytrl6KHJ+TZH/O+f5jBaGOckJqYt9lOH5Ly9a0uVS3gTcsR9ybEDFx9Oed4vxk1Dwa RaiHOStG/fFHYSf7cyd7LWamXgdL4OvC4VcSzYp853o6Fnf7ybNjJg9LMBod1zn5LosQ /MiQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="U7Z/TTCI"; 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=nnXTN/18ZkuRoWcogz7ErpQN2rHzgK1j19VpXiRGFd2sn9YRdqpo7ggSYc6Tc2gsCj 8qIrllPc/ZopoFiPTNLDyQFpVX0LVrTIDemG753xSERuGhTD+K+/6cHMiZqOQ8IoApCT LW+dyLRqZGovOxzRBE8/x6ijkl5bNusjavv5Q= 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=XqtC/AW2Lot/+W+QqfktnqBWR3Ob6uFPJVNYHWS9djD+WCsVcma+xseL2CI3Tq/P/G 43A35xP/O1QflQBnEQd+2AHEvIABYvsTRLem7GXD/I5C8bXP8tnldKUvziHG/85fTO/k /aH6Es3XFnw7EJOlu5JPKA/cPFJ9YRkD6H76fy1vPTh2KUF49DcHiIlDVkcsE1JAd0WY 4iKYx/BAYzXv3MsWGuAzlwlt9rjRY/DBsbdBC49jVtgHJ6JsSrYHXG0yf8A9But9OILO EGCDTWbtdmw4cj7kwxxj+Pi3nqP9NY2wQGqMHwQww6/A7Jc5EaXNO+PJa+G7vM+tSDaG yJsw== X-Gm-Message-State: AFqh2kp6bFvztD6WObWSS3kuSed7u1/6l5DL0Hdnm8TdcR8tz2nJNyM/ A9F+16NysEqtA8/Y/Q4vEwn9zi6y X-Google-Smtp-Source: AMrXdXuLLQcNLx0vMAY82jvxDwTvYMbF4ipjT2wcPOGAKE2sgWBHWMhwLSntjLjXWW7L6wdAGdDt7A== X-Received: by 2002:a63:1f53:0:b0:4a3:1e73:c29e with SMTP id q19-20020a631f53000000b004a31e73c29emr2366784pgm.239.1674476639686; Mon, 23 Jan 2023 04:23:59 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:e5c3:b0:192:62df:a3e7 with SMTP id u3-20020a170902e5c300b0019262dfa3e7ls12700553plf.9.-pod-prod-gmail; Mon, 23 Jan 2023 04:23:59 -0800 (PST) X-Received: by 2002:a17:902:a614:b0:188:d434:9c67 with SMTP id u20-20020a170902a61400b00188d4349c67mr24054693plq.32.1674476638538; Mon, 23 Jan 2023 04:23:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476638; cv=none; d=google.com; s=arc-20160816; b=epBz0K0rzVHRT+EprBAgCKm9uNSG9gM8j1Nrt04D75zdI3XXC6khJcI67AdaWcQiqS 3VytuBywK/gIXK/ARiwCZK0tfuQXSIs5q8Pdu71IB9OWigscjLcxaLNT6b1GV4MWnuXu GDklrm47IHkDzhs/pwkWW6AP73RxfZAQiOvjWXNbQ8/8YhauxYouFHM+VqL9phA+5yJ9 2/nTdwxez8p/zT8ZT2v72X2T4EMuzqq10vhlDlEgJL1WbPHAlznMCzAfKGLbrCoYQG7O fGfC4EjFSFjHHR59ewWOJd8L9tNRCX0pLKkuWEHcNzFRKBmQiKEHuibGQ03nhrEhCeWA uyXA== 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=xlT6DRRIGm5anjcuwUjibiZb7gafr7BFsfzE6+DH0koa9NG5CKj16uZB0b9rlB/JSi s0fJHrUW5qsnLHMmTeygSX/bNDELQbzy73jT8qXtB8kIrriYyjdOVNZksuy1nJ7EVKhp zGKQcvXNEx5EopGzjCwhnI1BqvXtNOIo8ZvnBsykk9fIwvn+8Uo/6aqyYetqcDHmSHDI ZyqHKWt9cEendkQGP454EZVDvzHHtNSSF5HPcijSrT314CoNPAwSaQIAPSyE3pDxRMzY kIr0bBPlGGGXrdy1khAhXC6vPDR6H9rlk9HD14c69kqZy4E8xLAMK1ch+LQydPpgy74f YXsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="U7Z/TTCI"; 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 y15-20020a170902b48f00b00194b1879f44sor6858355plr.180.2023.01.23.04.23.58 for (Google Transport Security); Mon, 23 Jan 2023 04:23:58 -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:7889:b0:189:5ef4:6ae9 with SMTP id q9-20020a170902788900b001895ef46ae9mr22040224pll.45.1674476638215; Mon, 23 Jan 2023 04:23:58 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.23.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:23:57 -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: [PATCH v11 03/18] drm: exynos: dsi: Drop explicit call to bridge detach Date: Mon, 23 Jan 2023 17:53:04 +0530 Message-Id: <20230123122319.261341-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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="U7Z/TTCI"; 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 12:23: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: 2639 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EBBEB3F039 for ; Mon, 23 Jan 2023 13:24:07 +0100 (CET) Received: by mail-pj1-f69.google.com with SMTP id u7-20020a17090a410700b002291f69fbb5sf4694557pjf.2 for ; Mon, 23 Jan 2023 04:24:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476646; cv=pass; d=google.com; s=arc-20160816; b=w/wMmsLDjnkMOernxZRvFdrQhw7b3JIVlzYIbjJFlQG/2HFDnDhNvRIsLL5VRNaiHM 6U4nV0cGjyVseJlv4Hg5WPoE+oGUnBU0WhPq6Sp0xBHn3UpqEYO4TND8zsrpn6YBv4rb tGTEgZt7arDQIVTm7W+we9FthsLxWmxtVlGQoVVSSsTzLjdXf+TYG/Nh06GfoEgJape/ dMEZyr6SVMaeIr1ZtX0LJ8lMviGJJRDrNbn9ejP6VxCo4tZugQR5bzfkZS8MCmfpwYQc ZWg56ykc4S6Qh1DZXBeDAvDvvqeylbtqKzQGzk2NFAum2h/HXWf5Zq4L+ZChrIGczK/n /yPA== 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=je6hzypG8oh/sR2f8T9UwN6tXLQz7xmGN9RoF1fi6WhFjIwsmOs8nwfYZK7fwhV7nD 4QWjOrypsFq6oMLzUammIIL+CVlbv1o9vb1Vz8dKIdEoMQL7M0k88v68qci2nnOc1yJj P84FxFNl1ZXp6FLa0depooVgDg+1DmdAkT9c4haIxpzrJ7P2+sVdj1P/snuX0SqG3uqq ZMxiyPhrZZ0N1+r/q+eIqzdVSvZ+rudWV3kTYkuwfs5rIJ7+64OGFo23zLXHFaVKm5hB t2Pg33mzVij3KR5UcPgAiiPPqXb3i7Eeb9I3D1h74bLBn1SoiekYyEvGoNTxWLeEznVh rpiw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Bs0TV7ER; 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=VhD9ezB3OW7Ap4gzFLYiADY+gYaXW8x5Gc8wqZG+vZbbARWhDm/6m39KdO0LZuqTuv /MNDMDl5IVSlp7ZdjtiUkRcJWciRm1AP7DHfcCa74aoO8pl08GFCoAjjsuxlG5NTVloy UzKmroMakB+pxe7bh9WgxbD5eMLYRWXs0hELU= 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=8KesXsi7YQbVny0srmUS5zj4Ko0h6Cje9PQPNZie50OYmnOqofHgIVkzo9vU3USJfb 3NAO4GAaHvN2srBRJieWjxiyOzqGBih3Wc6JeQdMiM7RzWAHce4d2R4OZYrvWWi7Zmrp tDP4eLQK+kisnIa/ht6jl6tTe4y0tUJZGdLENfrvP3CfXQ+e0oIfZZEpBzPTiIO36n2k FGYseZR65JABOSixjB1jZa5R9jeUcRMOMR0UGyU+txnA7Facj/GM0UkXyLbgtZ/QeU5S HtXotRyqj1FHTdUgaUPYc6LcGYn+vLpDuecuPI5qsHVgZB7cwBalQnVFDL+N8nYczg5h pHEA== X-Gm-Message-State: AFqh2kp5zBmvP/6XCJCyFcrC/f18UfOvFD/UCROa582sa0CbUjBhBXPu wpgiBfbtv2HFx8RKOdmyUS7ctjk3 X-Google-Smtp-Source: AMrXdXuwOVx9s56KAtp7D3v4h7CME8bo7QbFXn9SH4QM5GP14V1zOejq9ZfhA8/F1MLu1yDGi7m3Bg== X-Received: by 2002:a62:64c5:0:b0:58d:af8c:feb7 with SMTP id y188-20020a6264c5000000b0058daf8cfeb7mr2815708pfb.1.1674476646538; Mon, 23 Jan 2023 04:24:06 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:3c8d:b0:226:e7:18f9 with SMTP id pv13-20020a17090b3c8d00b0022600e718f9ls11105624pjb.0.-pod-canary-gmail; Mon, 23 Jan 2023 04:24:06 -0800 (PST) X-Received: by 2002:a17:902:d4c3:b0:194:d7d1:4c10 with SMTP id o3-20020a170902d4c300b00194d7d14c10mr15984446plg.66.1674476645696; Mon, 23 Jan 2023 04:24:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476645; cv=none; d=google.com; s=arc-20160816; b=QGlsVsYkchHlarIYoTMUV6ZlBNlGYEYM2llpfjLM1OKJKUnJ2RJNKPAzkLuODhWzCf AnfxvDpxFTP97Up+OeSLygwbQwme/I3EYNLh80PHURRDWvZXf8jjvY1HhAyMMpXRjqKB nWMWNj09G4usCU+3HuaYLfKFWCvByTf2cuPsKe/o0fAZnMrkFngoICeE8leLREka/2dB H2GU0p9rMDg8CCVIXsjNOUgIDaC5JQcCTBOqia3cN5IgaZGHNsl8wNh2KH/SNeAfHm/G q96uDp4+MteiFJHUpKLij4MwW4oYMVykjHJeLlxDMAiLJoHCbXwGZw8mwu4DfQNpzU9X GPIg== 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=nRXDz7ghvYWO0+2W/JLNl4mwqfeM6xvhbOx3e8XnWBLjqe1bae+IDfYj1DdL01IYuy W1jLeRcfs6laqqLXJEfbWeRagfppUNG8NabULaKlb3nhQVKgJqOEETeCLEGp7YQn/SKY 3paUf1m5+SOOXS2KL2WaiKLw1q9pLcKg9k9DY9AKuLYBB8379rx52YdG/ug4N56EngSh FtvSLME+yPCtlmuuOcNLZSrT5e1Zqy4Nf05JBEuxCt03+tMos7Mew8Ap1SN27TKKaVUk KKjvncOb73TIWqVhzfR1DFmV/5DkRvG9j/rS7KkNMj5gaqBRWx9EovdFiuOM533kw5Sk VdQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Bs0TV7ER; 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-20020a170902c3cc00b00189e9256a07sor622423plj.56.2023.01.23.04.24.05 for (Google Transport Security); Mon, 23 Jan 2023 04:24:05 -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:a05:6a20:a00d:b0:9d:efbf:6623 with SMTP id p13-20020a056a20a00d00b0009defbf6623mr28597401pzj.49.1674476645425; Mon, 23 Jan 2023 04:24:05 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:24:04 -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: [PATCH v11 04/18] drm: exynos: dsi: Switch to devm_drm_of_dsi_get_bridge Date: Mon, 23 Jan 2023 17:53:05 +0530 Message-Id: <20230123122319.261341-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=Bs0TV7ER; 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 12:23:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2640 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A4BB63F039 for ; Mon, 23 Jan 2023 13:24:14 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id t185-20020a6381c2000000b004d2570e675bsf4817567pgd.9 for ; Mon, 23 Jan 2023 04:24:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476653; cv=pass; d=google.com; s=arc-20160816; b=uTe52oYUUOEuq+MRRyKf/uVo0DJKl99xux9q1XFAMDpWJRv3Gq2843yWIZc28+qiZH dk6tkjDVq6/AsEKqZWaVgfFBiqx3HEq8pTjO1uKoPI31REs0kccgP8G1yi4seXU7k35a BXuOpArUg7v8yZVBZlWSsV84W/63HWtPyjHncO91LwVtQT6BM8g2NHeZrJiEavmOyxzl qGpdcaMJz4K/9CMjJDkLobWQS6TVOpNKSnt2xZw6WTO/oiOwJTlT4rDzWZhH2mipY0Q7 SmK8mKOZaTy7U8sS3YM9uoatroxvLmvUajv6oezo0EtL/LcAYFIPHmm7ofYEm039/Or8 hhwA== 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=lI/z5INW24A/TeXJv4Mx2sUEInEM6hk8Sv8hJz/j5vom9kqA59LekEiWTMZLyiR/RT fNRPKzwKJmDPjbStKP1K1/lhyzViVDPh/bLtmOYFRFCXztPcH5mj+7nZRxOj91lnYYtT Y+nTAlk+o60kmfC+ZfI8TO2zusdNR2KTvabPzJ2fbEnZlueoOuI+9L2NrCdUp8XcHHza xAh5bS+hBN7C5MaGTYHgA+Uh5Y6Ow0CzGFygUNZDh5WO/XqN1lwqs02u/ePgNFIHeQJM w9rk2z1DPyohBgBtmcbtqTG5h2Nt4FzvGGWtiDhGAZ166Ho4wA1Mt2webw0jcE3uaum0 IesA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FF4S3dKs; 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=bkaJWoMZ6+wLRIaRjwso/fde5kkTDO9bsjy1zVF1ehMHZSeB3hR9yVUN/ooAuVLaK+ mMttz8SV9Qq1IVIhvKqSd4oWZCCyiaun+4YuKjzzCJF31lAbeK8tRghp6CL5nY0c8PzW 7h7NwgzOpt5LvD55zQSUiXwtnCyoivYeHhLcc= 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=g+U6RNlRYvVdtsN5xha+uLQHzoWi/FZdJvpynZ4V6hi5jh3uG56iBjMp61Ie/wH9mf LserEVnCROHCwjTRbAZDygjyW7UZJt4gPoiaOctGZHyR3HbuyEr2buoYXfGsrsv/ovFG X+6Xqv81uZmneGPFF9oXimlAY6Tb/OFgVgPnjCnQirCt6KojB+hNIjgTSHAAgkBwEDjD mOMW7m74dvW+tg5qQm2jEc+tItxuyQkamrRHVYVeV2mNUGl8h+SulAR91ToniM1zPQDG u5G46wbWBHZKgsYU6QByM/7hwIshPo2d9lDJW5Qv5erCS1YyebOoh6LM2AhF2ANkxXqd vTWg== X-Gm-Message-State: AFqh2krN8GYrDWhhEIzNwg9ovz4R7y2CGMgxozNUNrrGpKNB2L9bbnVR iZKLZXJtF7PjN5I6iqClfFR8ZO8s X-Google-Smtp-Source: AMrXdXtAqPrPAdZlrlPdo4bZXlN0XxaSAslEKkVCa2tgniN31fjxxdgUkeOk365ja3w99cGuLRSE5w== X-Received: by 2002:a17:902:b20c:b0:194:7cb3:2527 with SMTP id t12-20020a170902b20c00b001947cb32527mr2467716plr.4.1674476653431; Mon, 23 Jan 2023 04:24:13 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ecc4:b0:194:d87a:ffa6 with SMTP id a4-20020a170902ecc400b00194d87affa6ls11171900plh.1.-pod-prod-gmail; Mon, 23 Jan 2023 04:24:12 -0800 (PST) X-Received: by 2002:a17:902:7c8d:b0:194:9c02:6ea1 with SMTP id y13-20020a1709027c8d00b001949c026ea1mr23664834pll.0.1674476652616; Mon, 23 Jan 2023 04:24:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476652; cv=none; d=google.com; s=arc-20160816; b=lGXRdiMwsa11dW+hl9boJPemkWpbEFjqVENzjx0i2TD2GGOt//c9XItf+vHKEWDdFm 1tS4UmiUUR3kr6wzlfqpXL0NvsHO0eHnDeUvzIy9vz1s2ljgSBqfNoR0XrwvZheP+Clz qjsm9OJcRAu27v/BoUfBf2aRKFyqCY/XHGYz7UFuaeLNaq7e1bq6mfxngOICuQRNPAXC Qe8QzNPij4bil/4tWR6Bkc+YWetJzjFziSxI2yjeJAwGCOQJysgfdHlzeDqMcvNaabSn E7MQBt/zZCRIVqfyjJXsPkpL7i9jcSi3TskETPh2ind21AotlZT7KCclV/4WCGzw8TyS uQwg== 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=WRPiiHm0VTJWA789sCVkzeV4s4WIXZi0N3IHBBy7XdsH8jOClMLzBgeoN6qc8y9M7w k0xrkY2QvjQPdmC0TXDndJTIkktooGt4zIxehlXByw2rDoBmgvpVgEobfDXqDIkT/waH +ps2h1A6TxhJDeS7Zw7LiHKQl3UotBVJ70E6naglETgaJU1QwKqD/S8hhUqifbT5XnRG nRtD5dIuo/pXQibnd33yKsUCqpdRga+Ix2Dce4pTZXT8TocrGKZoDTHJw9vahuNekDPr U9o+x14RDKKse5Yy9XHvkvUTHldNDsLnGeXAAHmu704/Xrt0KdLQ4woNHf/iwhf4QPjU d6dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FF4S3dKs; 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 ix12-20020a170902f80c00b00192fc80edc5sor1239546plb.63.2023.01.23.04.24.12 for (Google Transport Security); Mon, 23 Jan 2023 04:24: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:903:234e:b0:194:d67b:491f with SMTP id c14-20020a170903234e00b00194d67b491fmr19321183plh.13.1674476652311; Mon, 23 Jan 2023 04:24:12 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:24:11 -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: [PATCH v11 05/18] drm: exynos: dsi: Mark PHY as optional Date: Mon, 23 Jan 2023 17:53:06 +0530 Message-Id: <20230123122319.261341-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=FF4S3dKs; 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 12:23: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: 2641 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 336D43F039 for ; Mon, 23 Jan 2023 13:24:22 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id u15-20020a170902a60f00b00194d7d89168sf5991760plq.10 for ; Mon, 23 Jan 2023 04:24:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476661; cv=pass; d=google.com; s=arc-20160816; b=PTeLDgNrp5ofRaiMV0/DE3x7kUDye/kIacpXrTcqlJ6rcXtRW9WJPzZIYWbebTRsPo xgyAA7++25snYyMmQSLZSNiWibXC5w0cwHRQJh8uZV+rrXOGqzY8Jo4EIr7SKNeiUqLx a0AyEsh9pXpDaZ6Sh4iWYQbOBgO6LElN6TImp2Pi9CjLOUSdNNaNOllW0lYdllN6DAl7 8wGDIO0kZv4w4myE+1H66VULAxi1pW64/xtHi1+8T72dWXZ6hOfduEIFZtBix93C+Dzz 99c6adG96kBuIJmoZeDc3xETpdA/Q8/dwIX52fbaC6ypg7+JyxA2P5AKlyaAE3GvN0cB QvZQ== 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=jVB3aUOPzt02UEZOwzKFkbOT3WMQ7ADi5kCjwKgsLfK77NcnIdy2YC0pWuwnoG96et fR2RKGQsJbEWgWk99/irlggob76rlNmVpyVaT1ssCIOV7je9Dct6kwtlb4MZtM14Zv2i OdS7OMFR0e24Y0pXse7gz2aFixCXXHCWS9CfFWWnyKZG0lZRm4sDsphGzfmXzv9/1LL+ aCC4Kx4qaIDzyvBdymxnNIXxbdipZMI2Qxo+5IMA1o0gzq74CAfmKqumo3C7h8PWTVPw RLi/Dmw3fRcZtEFsE+7KwwzWUSzJ6z8c5UjpyebK/Y08C8K3woKTmVRnldc/PRy9s0Mr YNzQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I4JqfJ1d; 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=rXMKrlFBc1x53TaPMyJjnZDq/o1A9R/SXSOEGD4AHu8cZvouAgDu6f1BeYkDMQJZgr WSL/Bm0QRJMJSy9xiGSicuQm7bq8iRtAn8AQJ1XHWTFfQcgIlZgLjziDCeW52sgcIdEg /+i13WtzsiP3XoicP5tirlwB6F4bDtE1VgRag= 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=14GCGUiptu4ZORcZGsMujrTIBB8MJgyiIxDcW/lkShlj4TA7MLU54xLHiTpqfH9QiY Kp2e0cCqAtLN0auE1uI4gvGU1vFZWRLt2wcHnXPJWogeAyZx/888hklI409X6NYoIbqs zdCEo/CnNOWmPhnDphJ0k1O+kIQ+AHlvoRiqSzt1nckGARHiFoLNxTWiyOYusSNcHcdt p4d8XksneZajS37/D4TYJ/URxySR/MbEqxUso7KXdJguTjUZiqlAHuDAppA08NoSyZed 3rnDB9J4xnXjO62nmg+TJ2dAl0wpTL/Roe4EcHqkPZw+SWHCaeuBqmiHckISNAiuMBll IXew== X-Gm-Message-State: AFqh2kpdSqQh8fshKvQXJTEl26pXlATj5Lio1wlG/MYWO/KMfs7+baA/ cJ+wyubHb3iQUnVOt+Wcu5gT4Rvy X-Google-Smtp-Source: AMrXdXvlk7+AuDWcxK4zP5yA8IiRf6RxsFaBNV/QhuOfdzv7vG7eZ2Ug/GFPAC2yN8E3jHREyH7Qww== X-Received: by 2002:a63:4a5b:0:b0:477:1a2:390e with SMTP id j27-20020a634a5b000000b0047701a2390emr2553998pgl.83.1674476660811; Mon, 23 Jan 2023 04:24:20 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d34a:b0:178:5938:29de with SMTP id l10-20020a170902d34a00b00178593829dels12750649plk.2.-pod-prod-gmail; Mon, 23 Jan 2023 04:24:20 -0800 (PST) X-Received: by 2002:a17:903:200a:b0:194:60c3:48bc with SMTP id s10-20020a170903200a00b0019460c348bcmr21945885pla.27.1674476659969; Mon, 23 Jan 2023 04:24:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476659; cv=none; d=google.com; s=arc-20160816; b=dNFLcATALd2NQZ7bc20U/3ZLGyajp7vSAZ6nLN61axQPySEP+nB5VAZgC9cdP9WrjG kweI8ZqQTKFATyG35FlS7VLT+YEefMOs2c4CLaK7JizR9o4+wjPH+kPSOGNed+da3Rke MBb/7ZWxwodcpknJErkbDtJXLqJZ8GYyj9swdVHLD3GeJ3VQJhxqaAeA/D3EuHDACaG6 QEaiE3SPbWDUFWDf5uFYBnnkTAbn8Im+EC+6RioDkDgfv41HdSEkc64FemlT7ZfYMkGa BNljmehRYAarJQQ2NtBAznTpfqSQ7w7RgwzzDv0QzDNDYToKPY64wpDbjfxJ4hY2SKyt hESA== 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=BBLGUEjiDh7pEKg1VOuJMt5zt+FA7DbzT9G66gFDc1/BBLgPmep+NwgSoF+uyfIepE JsVUu8pa81hg0pxmcGMJoegZfZjEAZs/Fnzdi2D50BdwRIuitTp/3+ql0stkzsAVKlnd dPUEB2ZAmUEqRZrH4SstbxQlq1PCmNfnlI20Ij5rvK6vJ01wt2P3hnTYz9g+qB/QEpQk DtK0jBWaS9ucfG/KzzR1TFoTc26f8OOfZINo3AVWC81Kh5nQ2ApU9+vO97KMrktiCSDE 42fd+8mte/f40mTDZQg55oqmH/o1Fhg/6d3ezXAicOCUluMT3s0Nc95krjj9jRbDrbmE c6kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I4JqfJ1d; 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 u11-20020a17090282cb00b00189bf5e03a6sor626427plz.77.2023.01.23.04.24.19 for (Google Transport Security); Mon, 23 Jan 2023 04:24:19 -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:1c7:b0:194:ddea:2ebf with SMTP id e7-20020a17090301c700b00194ddea2ebfmr17540876plh.17.1674476659631; Mon, 23 Jan 2023 04:24:19 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:24:18 -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: [PATCH v11 06/18] drm: exynos: dsi: Add platform PLL_P (PMS_P) offset Date: Mon, 23 Jan 2023 17:53:07 +0530 Message-Id: <20230123122319.261341-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=I4JqfJ1d; 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 12:23: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: 2642 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 AB1BB3F039 for ; Mon, 23 Jan 2023 13:24:29 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id l7-20020a62be07000000b0058de3976793sf5225106pff.18 for ; Mon, 23 Jan 2023 04:24:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476668; cv=pass; d=google.com; s=arc-20160816; b=ByEzHP6wuABkR9ovEY3bcswrjgJOk0Iic+29FdvC4ghb5F19oVBwYWPFptVmP7oEfX vThdoe+ePcWTnK0qp1jz7edfAOZ4ziPJSj7EVQwBvPnjgt8zIZpOjAAjT180FWc7Fx0L WgkiP62mu7avBgWRKqiwaGbXIUS7l3X07+vZeR1OfcknNJE+Z4/rxyzHV5Z5ftf9A+i0 kbPK1s4Ax/HOUWAeKVZp4gZWJHaA7ScxAdYtP78JUcGhsP506tVKSg5mMqX9Z+vAHWc1 fq4uEpUeCvom8I7px9fjaUsbtQ9dTrt2mwgn6lJlIijqI6n6st+9V6ZU5ww4+pnEGFkC 3kTw== 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=alX+FqxGTpcLcybuW5l65KZcZ7JYKoEOW2OEOVDualRnlMmt/eUcfdXJcGbW08CpIJ 53xNApIBO9cxeR8i7WGcIDyRGpbir/TZy6v8UBi2BPbFhJGYxLLs6NdeYIhe51G5VQNZ ruteCEzdIAAjiuHiAUad6Qv7c2EdjNfB6EHhCVbs3LgsvveGbVE2VTLSFd6FKveUYGSw o/He7zGDpWh8hnr51wdn1noGt06pEN4RFQtsdD9m7d4M3/Z6QwL71qziHxQbRrOD9451 tMDlLCjco10IpU0VHYdakp0ctUAYs8t8AjkclrQaxuV3uCu11xwKAQzjCaggPHE3y6Ki nVsQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eNjD6AW8; 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=M58PJxJ0Q6docYN+ioNZGxKouSCCxZbh1XavFnUFf2e7bZquwz3/YuhK7OuJViBxRq v1vIvIALLcmFUd2sTZl/HcQz1gMZeLNrLJZw+tmfktWq6JwseuokzzjWFdNzwlbxTC4P 6u5YcPlgRAd7W6L/NDvd498T4mv4q9ai1BxWQ= 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=UEqsLeirWpV4wEjITwQyZhwqZ3Ryo8thCRlX8hnA7E4DiQqLiBJJvfx8nYa11NW+cA 3e2I+z4itOB6HehwCqfCBPIH+XuzHhefEquTNvZjdwbpDJs5Z5jyOh/zCcANorpn4oOj YUeqpETcPx7lpwNmY3yfsefrxVAAKQpT+5RKZ+GINYJUyJJHI6tXB2sB6UkS3k+Tmzyu D+YGWQzBzY9R9UToGUhiBhx32y725T6dmMfJW6u3FiOyYp/WDP6/J81eleEC0LyeQx8Y EHwl2U1Ox4fhWJt4VmStG/bole+4PtsrG/4HEIj9/096ORcoYyuIdUWn2y6pPH6RU0tJ 19zA== X-Gm-Message-State: AFqh2kp/8qkPS0xlrLmf7JJ1lsHj1MYoBH9mYBd3dGxNmocF9MQWiAz4 jMcNAhvvV7PhSBzdwbi5la75txd+ X-Google-Smtp-Source: AMrXdXuEX5FQa17SidnI/Tpwb8CsR6pSDptt+5KuhnJFeu5u2yOa0t3l7tFdgmawwHIbxpQyu1zrdA== X-Received: by 2002:a62:e118:0:b0:581:8b72:35db with SMTP id q24-20020a62e118000000b005818b7235dbmr2660990pfh.5.1674476668462; Mon, 23 Jan 2023 04:24:28 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:d507:b0:22b:b830:313 with SMTP id t7-20020a17090ad50700b0022bb8300313ls8132634pju.3.-pod-control-gmail; Mon, 23 Jan 2023 04:24:27 -0800 (PST) X-Received: by 2002:a17:903:244f:b0:194:6400:cd37 with SMTP id l15-20020a170903244f00b001946400cd37mr34399274pls.14.1674476667439; Mon, 23 Jan 2023 04:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476667; cv=none; d=google.com; s=arc-20160816; b=jnNSMHHlYKHVv7i9Wcfz+dWKBhwx2vxEMkR0sml8hvNJ+8m09Bf2s/xVXc/bA5/4tL m43qyyHvveJjr6W1uhDxC7NVncLQzYr6VF+ocuhEG5TpuqaiK/JF+IIowaBx5iyaiQNX gtFWSihhJn6INTTkMuULXf8zuQYwuG/9OynasTkYVVGPkRfZI2Y01ATb1gTbsA/kH6rU jSYestMOM1g4POw+JOkS5hsw3TKUE8fiCL9XbWcj/Og0BCSnFEzifvkXBgdksUfwCl6S /9eyPY7bqzrL+eJuf5+YajvnyB4XLGhK1h4Hyz47oPNZXYsKmryPXnpCi3UMARR5vEXP /q6w== 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=K9k/5ezQSlVoaguFH5zofO5VUfVDrJJeArv61GD2apzA89oTHf2xcrDgRnIYET0EHk gp4MwKbV1oQMgGpJ85Gc/NE7+p+9J0bCsg0+Xj6b/XLSHDUQrBIUpf/TOQIXqToegrak Hxo06Httma1ds7P0SQeKcIHG4EFXEupWq6aRJ8Cp48YR+HeiXbAo1w0lzBJQQMj+SSE6 G4Or8MaGwyWLA2vbnBKAzf6xLAV55vc9VSHvh5oD/0ktwS9NzDu0/20+oCyPa0zUyzL8 DDe6RcdcR/duDzlDUr52PuggsYGmTojPGZYBCMIUSLWjH4+P6t+XUDV63TcDjBivzX2Q z/6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eNjD6AW8; 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 e8-20020a170902744800b00194768d4461sor2812281plt.148.2023.01.23.04.24.27 for (Google Transport Security); Mon, 23 Jan 2023 04:24:27 -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:7889:b0:192:b5a8:3eb6 with SMTP id q9-20020a170902788900b00192b5a83eb6mr20874074pll.44.1674476667125; Mon, 23 Jan 2023 04:24:27 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:24:26 -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: [PATCH v11 07/18] drm: exynos: dsi: Introduce hw_type platform data Date: Mon, 23 Jan 2023 17:53:08 +0530 Message-Id: <20230123122319.261341-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=eNjD6AW8; 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 --- 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 12:23:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2643 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 9F4113F039 for ; Mon, 23 Jan 2023 13:24:36 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id dc11-20020a056a0035cb00b00589a6a97519sf5166250pfb.8 for ; Mon, 23 Jan 2023 04:24:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476675; cv=pass; d=google.com; s=arc-20160816; b=qRnjoooBrn/E/eZ2jwZyCDjYyZwVI6DA2HWua+ROibLsIn06MfjbZr9vv3dB9o8XCm xioRJ2SaC//L6OK4eAJU9yp2dRgqhvMzXBlBu3btsJlNR/NxVL/cxxEZU2jSkU45iY57 oJmwiRT6X1WYOvokj8eUamROI6+zPQ1Yubdyppzy6p+MiJMNJ4KHIKPtqRFgAnCEA1ju womdA7J/9xi+0A01bKRunZoqaqbL1DjH6Z37jnKqgyvRCWwpn95zDqhHmp8D/vrXvB8a a/nHYY3ALG9TtxWTNuAVvjxjnCpWO75fb0ty4KXdlMzAI6+vsFjqO/Q5eX1NItxQCxNH N1cw== 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=TRFIrGDFcZwSgclwfs3AwmfP154FC0pf0TeaK+tamNpRB6QGgqRm1DX/nKOiSmnkH5 Cd7Ryqxj44T03F+TYIEwtx1UjEzH3YqBljotTiyRfQr1wRt4672edYTDCnjeMpMsMqmc Fa2j2RmdLd7FVx9SOMh0pVYESKuoNWdunipn1LmjKFMyoacJOxvPnnUVHa++7qHCP/FC /bI7vPHz+gcA0z4hPR+2CEo51ENwP6LmUsMsLT2XhOqtvoS/k6ocvqQeOvkQ9bbqbgUl 5G8IB/i7GC7S4gtC0j01qaChoo/iAMri5YRXx2zcdDXd3NMg8TK1AU+wHNJi9rf2IVSO NIXw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="QQR+NJ/p"; 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=PS47IHhuRsQPE6vUWkm087REsLw24uGhG1pEVx+EJFUoL7v2Ih/uSgEkCkDtKXCi/z Qp+Ql6QW4Tb0kNm+xzzkt2nQbOb3J5eO8C3Vclf/3NZx1zvATFgajXvepS6Gs2vs/3b3 xIKKClMUxZe35EtFHWYc6iwusSFCtqsFfLuJw= 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=pFyZY5HCMoDPzYEtaE0q4UkYub+T2XettvaLBVghtE5RMKCXJ1hFT42Pj9sqg9csOp LlOFoeFphplmG6k97BBEvh4cbDAMzuN3zLnr96TpbC0+rr7qeFnCDFsLF27uRJx4dweZ WUoL6pegDJYBiqZpur5Elm+W7STPN0zgzvs4DqYS/3c6LC358WTHpSFUhPpW9CvyT0cB o3B9o8LW94ygZiMqDsNtPMVxNpOTCPYjSoHLuW6V3LL9aymC+53P6S76g+MICUp0BOGr Dt8P7lEz/2UcaR99rOLkaC0rhE9TRAmS37l1ULCWlrcsBGg6k+rS5mLvPjbW4xhc2xB8 Nthg== X-Gm-Message-State: AFqh2kpnpS86Jvw6zpHhMJDlstysGajuJZoDTGtAxsUyLXynR1wUlULl sC8/AufoUwPhLjLWtHx8CObGwvat X-Google-Smtp-Source: AMrXdXsosamCdQsq1nu1rcbUMMxNAKWYg2JPU18Ar9AnhsiPqhTo90xFwXIWR+c7Itqc++KOv04GFg== X-Received: by 2002:aa7:880a:0:b0:577:5db0:93f1 with SMTP id c10-20020aa7880a000000b005775db093f1mr2744942pfo.82.1674476675383; Mon, 23 Jan 2023 04:24:35 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:c392:b0:22b:b65d:b10d with SMTP id h18-20020a17090ac39200b0022bb65db10dls8512208pjt.0.-pod-control-gmail; Mon, 23 Jan 2023 04:24:34 -0800 (PST) X-Received: by 2002:a17:902:ca13:b0:195:f265:66dc with SMTP id w19-20020a170902ca1300b00195f26566dcmr8327656pld.68.1674476674467; Mon, 23 Jan 2023 04:24:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476674; cv=none; d=google.com; s=arc-20160816; b=El0xAUH4YihAT7K32Dqvn7uU9pCaycjQDo473a0SvKPmuRpuVqVhYzlbu6x6K+4CGR NtzDEqBowiOeybd18QpbZlrvomK1P7xeBY+zV/w/hfOptfE1qk8TT1nLMMjwgmlrpwrr n/b9l1LGN9cENq+fqVMfKGltszdVp6hb/lZHPZeiVfTdezJ8TJscG9QssziaZtW9GLh2 VAz5s4n2v9f5Tp8SVOly/6GOraU6qgkyI/0arGXOnmzYo1cKT5EhAKzEOj4vHcEyD/jE W//iZYjGZwufn1GFTkSM/sE/hsJo1QocGHuNHH0byO9Ewy+ytNDXHzbXOQmp9xbJ0kMQ dVPw== 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=ZFSImHgeCxTzSRecxeOPgmBkWO3PQZsCBTHSec7GDYgVvEz/0uCKWnvI0Xtf5vE4OR 5UziPje4WIQ/wMOLMy74GkYDgp6kFueleTxN3Iz+gJNiFOi9QfJbdmkifj7cZEoQwqAR okKVuTlYbBIYCYmB3/ZAOfQUYvtXSOA2cJ2gSf9llOIDLECViRcp32Q76H1RmXdSYLug ZMNBnjg2SL/wdNgcYz7GYQzUYK/fyrrftfaizLOOv9gLJZYCZryUwCxwwcKP/yLrqyMj br3/2F490oxn3uajE+gL7typJcGhBppWnaQEr633QUmMg7EwER6YQuD3RGufJyE6fBlj 1aDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="QQR+NJ/p"; 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 q14-20020a170902eb8e00b00194ab28325fsor7444817plg.168.2023.01.23.04.24.34 for (Google Transport Security); Mon, 23 Jan 2023 04:24:34 -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:8602:b0:189:e55d:ec72 with SMTP id f2-20020a170902860200b00189e55dec72mr22405412plo.20.1674476674144; Mon, 23 Jan 2023 04:24:34 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:24:33 -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: [PATCH v11 08/18] drm: exynos: dsi: Handle proper host initialization Date: Mon, 23 Jan 2023 17:53:09 +0530 Message-Id: <20230123122319.261341-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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="QQR+NJ/p"; 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 --- 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 12:23:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2644 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D2CF13F039 for ; Mon, 23 Jan 2023 13:24:43 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id i16-20020a17090332d000b00194a7b146b2sf7149878plr.20 for ; Mon, 23 Jan 2023 04:24:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476682; cv=pass; d=google.com; s=arc-20160816; b=S3s1LPUbH9+dU2Ta6AP2STkDeRdCSnv+NUGsFcHjbkGW+GQnoAEUjrG/J4MPH+QO3B Nf1tjgXnI1NvnwTxwZ5Ofl/jNsIFaisTLLd8Af2D/mkdCOJUZzjFPGI36Ia8KjQZnP2s 5iswGYneC3hKHw8f6cG16NLEGUpdfPU8WI0wzk3/A+S0SUcYDUv0VCGTIDlM82XJHKZP BURW5NIgdPrcmotcPFciZptUEz9k4X41NxJPMFnyBs2PU19GEBzDj5bGNJPZjPoH999Z KUcKsc19vy11LicQK5uzDtODG5s/E/siAIwDCSlyqflxfFY8RiRPASXaJdJk6hWakttq ozyQ== 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=JaLAiVNlOReVVKVot34k6NAwQBYXVr5xdkQfdEn9ttRp40chTJmM8cCX0o97b1wW4h jE+1gj9u3aGAD6Sdqpndp4r14lTqoQMp8utyKf7kktZpOBbQBF3JgU+HybyxuIjyrsx3 vE+1Jrgk8wx0itexHnsixGkQn/IuJWtWOoNqX7SJsVMRUtHaKwEgAWC1IQroQzLw5dnk 4WhDM6KItdEW1p6wpky6fXrJ4JnnF7RAB0xnc9BJD6CCFkvLeoAy6ru0/jhnVUEJFVwh xvLyCRTjzb2rzyvHXp6JN12PYbrUWlwtAWHGs/Oi86cxN99CEvEqp++YVqrUuyAj2ed3 ErsA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LHsaZXrF; 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=Aoo3CS7CVPuQT9SCa7nb/tTQEF5ge1iAJJHUYTgQzgCaOoOws3ZYq0hTxbMbpt90WX ey0/wAzvPIzl8xgLfHOveT4EQpqM9owe4hEh9LtnH+eREVojmJyyo8W5FfHbytQvB0gr KVdTJLI2ow/oRFZqVLVA+IH5f2Nue9cCkM+AE= 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=lMKq+Vexo40wZ+wrSRfCssSeHcEuVgAh3uI+qUKikMGai+FitOM8WybSu78gUkYIYZ 0OPzemOUnjKBRQJttEOuGR18T7AcNywgtMfyqaPJ9fCaAjLn+331jwN/3SDWzxTzcQ1B phmZ8oEg8O4hioJ3x7QLeztxeysizCGCyVqgeGmCGYex0nHcScCSnc7H6RsgicyDKT6n HtpatDT059N45ViSEswxPjPDKIr2CJkqsHFgyubb0H9mFRbhdRcT//RNYB3Clj5s7yLS ugFMg3bmTTDPBqwNXHVIHsfH5DnuG0i52LrJq9cTby/rURCcptmq1nwL4g3xhmaaaNqI Yt7w== X-Gm-Message-State: AFqh2ko+woR762oGQ2NUWikzldb5FnqYmVwjoGvgHiX8pCyDjzAQamAz unuYXsFphIBq91bJHHgLyPUs5hWU X-Google-Smtp-Source: AMrXdXuyr99Ajmo2X4zE6nIlH1OhsdPJ80dG+k4uA9ncFfhJ7w/QWi07VgSASdMqRH8TafNkAWIikg== X-Received: by 2002:a05:6a00:15d5:b0:58e:61e:fe3 with SMTP id o21-20020a056a0015d500b0058e061e0fe3mr1685606pfu.46.1674476682611; Mon, 23 Jan 2023 04:24:42 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d34a:b0:178:5938:29de with SMTP id l10-20020a170902d34a00b00178593829dels12751496plk.2.-pod-prod-gmail; Mon, 23 Jan 2023 04:24:42 -0800 (PST) X-Received: by 2002:a17:902:ce08:b0:193:3594:82e4 with SMTP id k8-20020a170902ce0800b00193359482e4mr28855684plg.18.1674476681729; Mon, 23 Jan 2023 04:24:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476681; cv=none; d=google.com; s=arc-20160816; b=iVQMX2d+TYfNFaCHdHxbE1dekl3pM1pJ7+mSgosL4WeRLi1s795mCA0Tx35aqXiIlC 3u/WBveS2X/ggErhea1Z61DrOiRUXaM4LK8de8XcD+YrZi+ENcigCF4mVFYpbeNRVyXl fkvM7bsqcxEjPTbW+vCmtO43GkLlZTr2Raj1n/3mcvofPrcPJBy5VCVV3BzOZ8dIal/7 LjRcPFMX63TCGNhjzh7q+t4hr88BI7LcxpDHhQpNNs+f+BsOZQaO1d0gKxVm5Xi2adeV nlaZMXra4HH0McT7DHYMtSs/s0ZgORf53snV+3CvxxMwLnuY0DKOYmGVJboURxtCE4Ki JIdQ== 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=UPXo5Dy0RSWijJQeqh213T4mODJXV9N8PbBjOKG38ts8BJdekW4PsirYequm9/Btl5 pEpnrPgejwatyTQnD26YLmYg6lCfOJx8mSKGTOAC44t/aOO4SwHKO3yHxYjlbCyC+ILz /9FXSAjlc6zGfpnsLYaD8HWlCCF5pOtUBiRtQLynu8pUPzbaW/L2EhjhouGR7C4dX47e zU1cxYVV/4EtIgQtDITBmSBXzshd5++YhsSGHvJQvzez5tXKK6g7lswGQT8aXGyfR1c3 Bjn+VBSsQEPIV5+wuWKq3MX01yCIiMB4q5XScT5OhB5asEycFR06ZlTUaSpfwuJhggxv Fnsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LHsaZXrF; 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 12-20020a170902ee4c00b00195fc76aef8sor1843924plo.50.2023.01.23.04.24.41 for (Google Transport Security); Mon, 23 Jan 2023 04:24:41 -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:e892:b0:194:d2c7:ea46 with SMTP id w18-20020a170902e89200b00194d2c7ea46mr19308910plg.68.1674476681355; Mon, 23 Jan 2023 04:24:41 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:24:40 -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: [PATCH v11 09/18] drm: exynos: dsi: Add atomic check Date: Mon, 23 Jan 2023 17:53:10 +0530 Message-Id: <20230123122319.261341-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=LHsaZXrF; 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 --- 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 12:23:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2645 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8F2EF3F039 for ; Mon, 23 Jan 2023 13:24:51 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id y187-20020a638ac4000000b004cf52d8bb9bsf5377400pgd.21 for ; Mon, 23 Jan 2023 04:24:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476690; cv=pass; d=google.com; s=arc-20160816; b=hqPmgyc4G9Z63dHx81mIz+gcHSjoIT0/e1A6f17DUG9cKFsPO499enQmd37xoMkotM H8l6da2c5l2mvthqOZP4yKBUtwIBCOB/ypdX8j2cBbQKybf1rgq411A8VADnqPmOh7RL p2MEzJ5i90TzhfzGmMQWiFgbquaeWOiMGWTeO5sSq5P7W1JC93i+gqvrsvv14thgOxPo DdqHsUAHW9ecnK1tudtU8e9L2IJdprpSHkqKdVzm8/Aqtp6l12zpOlSRyi//4t5LM+3a 1lhz2mAKGuWbWG+zQrSfCz96qRVyY6OX/Y/p7fDaRM7MLpbsHYrFNFyPTEHngFOspnqD 9g+g== 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=gYhZZUyCqlxx95HRYR7TO7ywDIdZqpi54uHJf81zKaPdQDMxpcDuhYaXSFEFM2vNfR sEgzc80hSEEPDlR5bOL44ae9BCv8h/UBEyui76C1jJleys1AE1ujnXqryxKeZSyd+/rF IVeLH7xNZdtVXxTCujco8nqQqnjVPR4dGdwAizBRtYJrriyrsq9mJD2qKO09j4TTqu+D uhxzg0Rbd5Xq+rUElwF0hOP/I6IOP7I6BWzMW5iMt6kwW627hvKksdeKzwnVIZRj6HuW 9r7THFFiKHEyKlQEbPnslf5vc1hOQfjz3654ZUag/rOTnLS1jD03uWd8Tdm6i6+6sAjf tvuw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nLSc4UWw; 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=EoSz0QJsnvET8FhhGsRhvc67HsXqUeEQFjJSWi8gREmT5ekfIRzn89CXsPbOwFikxz h7youhDk7QcktGgVYbLk1UCHojxgJKlcPGZYQjQMsn85rs/dhSZG8T+rNh3FlsOGBEMd 8Iw9KVvuO/b/Z/2cUOKkC0JSDcI6p0nxTLtV4= 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=iH7Xdy8t0Wyz2eRxfgA3nIaAh6BU/kgNOjjONR6CxNUCZLWNFJyHZIXPdB0RBjziC8 9O9OitH/6K1PQCkdmvP2+5+P0ks8tQurogXz5g3QVj37VHZKCwwn155/9fyyam5W2tVj TrYjWi9iYz06hgUp14M1y58i6GcR6lKY+C5JKYhCcMwmz+AoyIUiQDaN/P+8krZhnkfl /YpEDgUOstnZfHTBzK6VSUrPXLym/VKPDdpwn6oURQzd1PuFG2OR/9HxMza5lw5fhnlj 4/rmeuZqJJipqbJMn/OX/FnlHgg//KslT/VKwNK3rpJYd37t9T/s6RvnGn0BlrjHf+XC GpdA== X-Gm-Message-State: AFqh2krf+1tigPt8P3414qi04AL8x38vnEcylL0dhjE9FRCWUiVONrO1 SIYqBzlOnDq9OnSPa98GnFWiPSIr X-Google-Smtp-Source: AMrXdXtEgaDAkh6XjmebvG8+89SKd9PpaxBkQ8d+S9iR62Gyxx7BDCL6ri3jj2ywseYgk0G8KUxsnw== X-Received: by 2002:a17:90a:7d05:b0:229:1cb8:8f1c with SMTP id g5-20020a17090a7d0500b002291cb88f1cmr2470289pjl.65.1674476690278; Mon, 23 Jan 2023 04:24:50 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:1343:b0:192:4b3b:ba41 with SMTP id jl3-20020a170903134300b001924b3bba41ls12707379plb.8.-pod-prod-gmail; Mon, 23 Jan 2023 04:24:49 -0800 (PST) X-Received: by 2002:a17:902:d4c3:b0:194:d7d1:4c10 with SMTP id o3-20020a170902d4c300b00194d7d14c10mr15986689plg.66.1674476689414; Mon, 23 Jan 2023 04:24:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476689; cv=none; d=google.com; s=arc-20160816; b=hyIAHphqfoYJZBPFg9yLwDSUqwtKpnKaYll1vI7jurBfPGIx2KxrGouc8lxHKj7BD+ o1s8jxo5DeDP37TwcI/t8jqpxmuJ28/fxDXb3LKSA69v5lsv8KwFN5bwFy0A+8iD6nZx MLFI8bXNDrJL1K5Iqa3e+7lt6enbYpH42VuPd9JHCBn/i2xuBG7SyXhRtY4F50U5vZg7 fpk6Iyk6AVkv1JCdLSpz3TvbK74IhCrzvaLE1ygnV17ralU4XxgHLhErNMzFwm4yJ8cd wMO1c6d3mm7ok/norcFdnXXedWIbapwTRlLFChD4DEgdLVZNt82mkdoKVotzfkwQJx8U zc2w== 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=QpsqZtlgmis/IpoCWnYrm5yI63WGFTSJt4vk9rJSSU+iMdCtJ8ouWp4mfYQUx65N7r rdMZZDCOWPNHERGCiKswyV8/k3xoqjgMSV0kfWqtEpDA82whRc5fII2rskbJWzyXNUL0 xqxCg5x8hR9wp4Qvh1KZh8GZEh0JvSQfjA4wQ8gKdr3m3Zgt7EQwPpcLExtrrgEJE9pr 3LVA9oGlwedzRCR2DIzc0LipT+WE5pKHr0wHM9D9QrCON1Z4jTfaTh44NPUNcRV+sLCA ROBOE3OAyRzoGxf53LW+/EnrQeS+qhdUsJCyilxNrZ1UQirnF4uWxuiSKid4ZazU91zQ Qs9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nLSc4UWw; 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 c8-20020a170903234800b001890052b48asor1676079plh.87.2023.01.23.04.24.49 for (Google Transport Security); Mon, 23 Jan 2023 04:24: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:e5d2:b0:191:3808:14b0 with SMTP id u18-20020a170902e5d200b00191380814b0mr33659343plf.4.1674476689065; Mon, 23 Jan 2023 04:24:49 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:24: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: [PATCH v11 10/18] drm: exynos: dsi: Add input_bus_flags Date: Mon, 23 Jan 2023 17:53:11 +0530 Message-Id: <20230123122319.261341-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=nLSc4UWw; 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 --- 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 12:23:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2646 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 C34253F039 for ; Mon, 23 Jan 2023 13:24:58 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id h6-20020a17090aa88600b00223fccff2efsf9339962pjq.6 for ; Mon, 23 Jan 2023 04:24:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476697; cv=pass; d=google.com; s=arc-20160816; b=jMK2VUXqYBlFEjUCpcZBsvyl9pAr1+xGwZdXSMsmYi97ppgcB9K3haAVdlOgjiuv7w GhPHzLwaS8A4zhysmMxrs0dPFEiipvQAFTfbwdzDQgf6xgsfkd72z2q07vvmk2gTlxDj aDajAnemIhfwMxMkxDSbk0YBn6XftpI00dVnIOsEfg6it3Mq7xuJSjYfIIqpgm67K7HY 3MSdNLc5zfqx2oSwnHvoplDe6ojyOTwiFqUfnGDJcAlxmKN1tj81eo9Nj7LwZ4JajQCZ RVL0MFUgDlgQHd7nkgvGboP1O0ULataxfCLoplAuRJmnSMEHnChOxK5WyfePpiI9/Js9 a9CQ== 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=YxVy3Hgb+6xlmcG3oV4Y3ACvKbo6knX4J2RRzU0QQneIOzsiLafdXt9behBXm52n5l LHzWJoiaDBeSnEJFFxoANr76LTppZ/yXcsozRJ5kaaQFTNbd7qaXDJKg2cDd2AjqLAvZ Wd6wfAEf2Jl/pZXfbSuabIi6tTVh2W1dpyz3Pds6MVflENusSytLMAYQVgU9Aaf2SfHy YDYtB9VJ7tAzSSt9LXt1ryHx5vdit//jQ9pbVutr9ndTEWv4I8FK1g71ZC1qO5YxvKcZ OApXeRWqlNygXmOFZFW59kDJ7VQzNxjeqbmFL0cRQPPCxNC2MpOObXjHimBciVO7G1vS 51Bw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nojSeomH; 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=VXxwEfZlcYjJx3edBsLjqfA/sBopMBQp6hNPsczFoe7nJ7zrkWaajILOOeqfqDR5FI /3RkMpCd70oVKqeWoj2/za01uZcLvpOA0n26igJRxpavSPm23OV5GxPaDELqyXHmYaxu Qk+6VryqSl5XnnClV9rkSj5kwOegJArNWdxBM= 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=pF8JArb7FqYCc5cbI6nPkUUAGge9vvfFl/rCgUmFKnokoyR88TLNkUPNkvwcsQCQjU F3/ybcvlEGVUIHu7lO1P3ReA5WkQDnX25TDmYIMetkYe8XI+0uIjTWwcHrqQn5fCV2GW JY7WiNDgNZ5LBcCMBghNBLRat4Xc407wjyTIPWKY+6oA6rPh5JnXMOq6EB2EK8fIwCDw g9q3HER6/c9+gMxY63qqP27gU/iWe+xugZAKE0P7TEykqWoDF45Y3/A1TFqUcBFghSdV dSEVQG4n3UN/tKsXnwSPu91GU0kPhIJAmLxTQLtCkdGabfFRMHNpNisuAwrsynicAW1p wLoQ== X-Gm-Message-State: AFqh2kqDdZkHI55tN0Gn3ewZ9NGIO41HkulcbmrrBZmfwfsaHJ2KRVpY 6A3LEE327z5QCunt2TrHvgvk2ZGz X-Google-Smtp-Source: AMrXdXvo8O0jYwE1JvA7yTDORyfezCMQUZvgF1K8d7+xhe0O64OVVPh6BlBV4jZt79gifmXhFfwfMA== X-Received: by 2002:a65:5548:0:b0:4cd:830b:240c with SMTP id t8-20020a655548000000b004cd830b240cmr1079839pgr.135.1674476697556; Mon, 23 Jan 2023 04:24:57 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ab8c:b0:191:1e85:3329 with SMTP id f12-20020a170902ab8c00b001911e853329ls12746664plr.3.-pod-prod-gmail; Mon, 23 Jan 2023 04:24:57 -0800 (PST) X-Received: by 2002:a17:902:9688:b0:192:55ab:88fe with SMTP id n8-20020a170902968800b0019255ab88femr23854209plp.56.1674476696652; Mon, 23 Jan 2023 04:24:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476696; cv=none; d=google.com; s=arc-20160816; b=wZzf/HXAwTi8vQCs9fjuv7PjVg+PMU35jO1b6sTV++J7Pn8fqNY3JLP1qh2n/fRaRg tvHHCCoNVCGyYGgCkL25kiCOoPCtJl5RCW7lge++UJo00O0UDW788BqssALPUF7uugtx pWyyEehA7r3Hoc4XPuBReXPHrGur1EyQGVk0pBKhLPgkj9g2H4mq+xQK+YTz+5qXBG3G HBIm/vKCBZjI0hAt7c4cpNjb62adl6R+lvejqpjk+K4jVwt8OdYWpnZlIQwHxfiIp4Wx jySRVdNClJyUdWDXdvij/2j4u6WkCzGNaOEM4B+btkPA/hswt0XY1AbEQa9xyqx2VYY2 YNLw== 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=zDkbsG36ITrIXwS8Ijp+7gC8ddGRwwUkSzlzMEBbOY6KPA1bRTQ+E+ZsQBqmXOkqUp 2FiI7zt+VPx+e4NXF9VGbJuy6cOZbVjsYPHJkmVOA4BJNryPn/NxDDGU0wW7qGjL5wlM MtWu5T+ib/KJUyPyhuuDPswHp2ZyptKZZAslBKGqnJDzvHIevL7w3hFH1z9szroAaL6D 0glhBq5h/ANWu1F0OgAxfC8CoGc5vxSkE5/4ns4vgdJ/NoQYRHSiWNFufFSjwFOjRhwB 9bsPtKrc/lBnbXp1DazVMyYoXg4oT4cGTJfl2rf3LipNQkXvRZa+rItW+dAhqrnjSPLU yd0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nojSeomH; 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 d9-20020a170902854900b00189b41c1b5fsor1171342plo.138.2023.01.23.04.24.56 for (Google Transport Security); Mon, 23 Jan 2023 04:24: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:f54c:b0:192:fc9c:a238 with SMTP id h12-20020a170902f54c00b00192fc9ca238mr30487972plf.66.1674476696345; Mon, 23 Jan 2023 04:24:56 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:24: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: [PATCH v11 11/18] drm: exynos: dsi: Add atomic_get_input_bus_fmts Date: Mon, 23 Jan 2023 17:53:12 +0530 Message-Id: <20230123122319.261341-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=nojSeomH; 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 12:23:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2647 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A18813F039 for ; Mon, 23 Jan 2023 13:25:06 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id g32-20020a635660000000b00478c21b8095sf5367910pgm.10 for ; Mon, 23 Jan 2023 04:25:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476705; cv=pass; d=google.com; s=arc-20160816; b=boLF/bxDZKb2/CtnaB5TOTuPeFG/xF72HygnjDjbqNOaDBeor0NTfn99mzrNd5H45s qrIuBVhNGNK6wo+AJFLr3IM4a/elh9sK/HWXI3HbueDiqH8aPLiA9U8nFR7BAg47ZGgJ Hg+eI2a6KVQCg2dEbw8iUWYmjmDWmw3DTQtH6wl7JMOPw1gJWa8wfot8vDSFaDXqZIHc ItVQrzZlVs0XDU+2ZLQbn2mp4BfdiHZAi6TGiIuaex1svM+2isy56fzSxFnajlXoGtAi E+FYvuo9O9fbWbzFSz9m+XRJjJNo7xa25otRn+5Vht3/H5hUgqj+t+4kkMDH00oCW+Mn cxgg== 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=uhl/LtQdsTKDY3cBO5aURm0smMYOULE9GBDzV/WG0KAHKQg54iGMsK+UBVEvj8UA6I 7R/WjIZI004K8nZIlOovk5p8tK3PO72z8HDkxoJy65LizpzWBeVtHQ9PYXsZwqzHRMSZ 5AKFBfIiCt5o+33/3WOOpUG0zVtrD7bLzpWaO3Qdl2IMKliAGBUOyEvwW2QyNN/1spjd 7FzuFWLKf5b+OqSjIhCLqlkf+QLnM74PQcflt5/v0N2HWY4Pg0LhYY/7wwT5wVg8jHCF lg7jdzi25u1bKVZ9o2EeMk9UMOaHqGlFr5TAzxA6Uuc4lhwkOBbMKUvI17g2vPbUGGo4 PC5A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="eWKdZbI/"; 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=M+rP3PF2TzLqzC1CXMYRWfkCQfU1MDcR5Flz1/ibLKusTn/La76EPPIJSiPovX7fS6 2nrsvdA5SSiqAkfrZR3JLWGEiyChbQuG2X3pHRdB1Ewq0aLvrNnXM24fVEJuWa5LMxV1 FnnHp8LhI87/AH2mEeQjcD3Ig+TOnGyY1lsUM= 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=MFdEy7huQGIwTuMFA3geVDSN6lj+iAOhFJ0vVQWSana/5NdH9yvCjpA4/w1NV5/gk0 1S8EzZy1a2Pts1Cz8yR2HCIBNaDg7JvEjQi9DLJApZsmXun3L4hf7BLjioMCSAz+K1hO DV9bRUXRj/IAMGwHLnoDVdHMN2Ij23T2r9CuJFqXJG0MkQZpf5O5bl10nuzukHpUJe+w p2gk0Bf9PW0uwoDEBuhFZf/4MPHw9LY1JEgawcMXEN6t1zjsTSiaV/P9DDnx33sakDNh +D675ra7is/AThR5/oQdz8lm/WeAdIfsV7L7qbWSz0bSWOUWNtjmlePL0d6HkJHqHBXC UsfA== X-Gm-Message-State: AFqh2krSrRQNErEGN0XhuOQltlkEXPfD6Ka4OjtoFjFjYHglprLJRpF9 jBN+iNu3bdAx220/zfX1RQS+Z/Pp X-Google-Smtp-Source: AMrXdXuByNcpJBeasMo8RpTYOrWxarndMBZfmrT7cCLTrQdg/puJ9uqwwUsCVxQagmrCC3xWf033OA== X-Received: by 2002:a17:90a:a0a:b0:229:5448:6e12 with SMTP id o10-20020a17090a0a0a00b0022954486e12mr3439282pjo.162.1674476705389; Mon, 23 Jan 2023 04:25:05 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d34a:b0:178:5938:29de with SMTP id l10-20020a170902d34a00b00178593829dels12752559plk.2.-pod-prod-gmail; Mon, 23 Jan 2023 04:25:04 -0800 (PST) X-Received: by 2002:a17:902:8b83:b0:194:ab28:3268 with SMTP id ay3-20020a1709028b8300b00194ab283268mr20612613plb.34.1674476704403; Mon, 23 Jan 2023 04:25:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476704; cv=none; d=google.com; s=arc-20160816; b=FBpk+iKKuMHA4dIVc+4LYKnShRZr39CexXETR9iRDwB/tugatJfUVQLcBYl2dr8ngX Bpz41zQznUhYG7V6ncLPQL++iBdZklrvMR00bFWW59qetqAlFMF8DiYwD8MSr0VBCkZm VTmcXXvsqm+3rk7SnI4HwNbog2SZGkWZd/j5qBGGgWxpuerQu8vy1A5cdXT2yrsHRZaP b9lwFC4aHeNNhXxNBSfwJjSptemaCgJIBClVPzJs16seh8t5xz3s0CRiuj5+Cq2mQper sUOmVfat8YqmF2BBo04WO7CzllM3bJnuxc85LZHHXHFvEVg3JWclbu+pOd2ZH7Y7QeR7 QFTw== 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=eDtyBPTvb8BPAEVYdex5iKvLG2WYc6I+vK3DSqgqhtez+SmkjjBv3j+98OZGEQL4iG soOI3ii+GjX77TNkAzGk/ZE94WSSQg94hmJBE9FTVseBARE2i4YQY4tvT83IYrst46tg TDhyV4ZqQ+lxcx+difYSDbI/PiM6kQKwX+JSfR0iRYoWuAT2HruHX6RlzfCgA33LleEB TSMSkNsTqrnX9UFVgQysYfE4GRTvEaCHtQN2bfeNhXOzPRodXQAxjmIBpQaP7v16vSG2 xGSkmlfwTAPfQ6jdbJDBlAYWFGjZ6DG4KCALDG5lHR8jJp5bVWaYEunk+cW/pV1oVeS4 6c7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="eWKdZbI/"; 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 h6-20020a170902f54600b0019600d8d3ddsor1264041plf.187.2023.01.23.04.25.04 for (Google Transport Security); Mon, 23 Jan 2023 04:25:04 -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:428a:b0:193:1557:457c with SMTP id ju10-20020a170903428a00b001931557457cmr21834283plb.62.1674476704052; Mon, 23 Jan 2023 04:25:04 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:25:03 -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: [PATCH v11 12/18] drm: exynos: dsi: Consolidate component and bridge Date: Mon, 23 Jan 2023 17:53:13 +0530 Message-Id: <20230123122319.261341-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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="eWKdZbI/"; 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 --- 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 12:23:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2648 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 AABAE3F039 for ; Mon, 23 Jan 2023 13:25:13 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id 74-20020a62184d000000b0058b9f769609sf5210119pfy.3 for ; Mon, 23 Jan 2023 04:25:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476712; cv=pass; d=google.com; s=arc-20160816; b=SOJzCUVm4LOiuLnw6FhrwxDUarCUy4VTWEKYGpwuSEE6ESNmOsgRbl2hEGCzq43rLC Wb9iISSxsbtf+yEgHmmkGg10+aEH7XltTdYPwqQ2FZRxcRWsjna6Fo9h9vW6IIitonuS Agc+hPpu9k1ht+kWwDDtd1It/vE3HQuB1JoBd2Wre3ZIkd+UFcmLEeFHoa/KD2TZF9Us x/stXz8WpVEwfAEHCILEjMzpi7c2SxfoeeDZfotIoC26I+TiN5L/HdsmafcrfAx2uGaE SNtyzmmZE/+gSyP2o0q5csvkp0lH6GEHVntCXRZTbvnSx9VXLcmBQq4VZK+692KsgQKe Z5GA== 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=p76ST8jj0XRAzRYZR3A3+Rc3pf0oMa8wwUk9bPjjlBgXNoDw2BZrIxYByl1EBV4Yx9 BpquuRh9MlCBuOpWTx7+hA3ebHhRyLjTVY8tcLrZQIAKHE4jUtOiViH4lJcvJMrwAfeb 4Dk5Nz89BQHvIxgkUHgHAeOD52wu9VzzDe9dV9ZYoEUF0DGRIbCip/niP4WuMuSi9y0G f3BfEOzMxl0XPY5NYZjCatYNfL31kTLJXTO7atUI6u/BQqCobqXN4BBlCMJ4+ZrLpC7g XcaiJnXMnJrrw8e6YYI5emcD0tUVOi1/bzlwBEDwaiZRlEctC1rjJNELUyniALxvCmwh 6eyw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kZ23uLBa; 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=d4d8bIGOZi/TukMMPKRkjya2cg/EFlf3HzZMYEmxc6WXDJEzpXAT/yGZ9BIUtNM9jR Jg4Py6D+KDwZFnxI8NrmD+HDDjIIUclPmhD+BbtehFztRMeQOht3CElUpCQI8nJd2hjN uztSHSK/0Udlb2y6+2o2Yavn7fn/SedcPj3NI= 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=Zz1s9OrLcKhX0Q6VJqdqhU87ddqNQFLDy7UsQPyQFrXekgR2pfhU/a6vkj/6I9M4zV Xqs2dtlCdzcPQDTVWanth5nHO8xEyKU3DUm4MmrmdKNQms+wGgd4MOmayctnmUfsJZKs pXA0DRtHyXmYwNuI4JAwN+oYRz24eZuIu7Vj6O7nl5VmOuVXKZlpFZQrL4qlaQGzVe0B 4KONXU3JqwG3cz/Cbh0y+GvFgxQ6GKNhPCC13RVCJ1x3HNU9a1+CtMnzYp5dhbTA3BeH M+8DWgjJmYA0upe0+9V0kBfujACfcI7Dxc6darErCRDQhrll910XPYFilyK4og+JHWr3 rWQg== X-Gm-Message-State: AFqh2kpizY3mBxNFKJbFJSC/88j9++BHkgXr3+4PxFVJNEKfvYzPyV/b 9bGEZ8sprJTFyhP2xKHw3ExzUVo0 X-Google-Smtp-Source: AMrXdXuHFbaMhOD7qCYN32XYwXVcsQUcJKm9BOB6kiKdn7vR0zhW4RxGwIThK+bj1aYTct/6rai+ag== X-Received: by 2002:a17:90a:9911:b0:22b:bc69:fbc4 with SMTP id b17-20020a17090a991100b0022bbc69fbc4mr1284293pjp.141.1674476712361; Mon, 23 Jan 2023 04:25:12 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:8a81:b0:229:24a8:b4c9 with SMTP id x1-20020a17090a8a8100b0022924a8b4c9ls12940129pjn.1.-pod-control-gmail; Mon, 23 Jan 2023 04:25:11 -0800 (PST) X-Received: by 2002:a17:902:8c94:b0:193:ab5:39c7 with SMTP id t20-20020a1709028c9400b001930ab539c7mr24753505plo.11.1674476711473; Mon, 23 Jan 2023 04:25:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476711; cv=none; d=google.com; s=arc-20160816; b=f9HPfMAy1gkP9IjLd9oosl2cJBJeED6HFKNEIUYV2fwBFSkK7fpbeIcJXrSXcBuG1O ZHW5JDJq23LoRDkvgySB+RiOlmF/aGhJFTdQlFl0TlrHQ1bYKx4K2Cwt0MdxE9J6/94i LkXS0dByuacZ0HcN7WxfVD8pIt5Yi4rltXcZTwde/iDFEeBzneI1pCMhR8L+85I35YBc c5RgcEVHtbY1XARe50gzzpF7IW1SNoVFslqPsgSk61zDfaa8MELLoe4LqOqta6qKO5MS jVHR7VDjq9dwW+vy3Cx/2InIsybaOziAgCvTU5ynuVeC8BGT10iFoqfbv/Nd59c5nVAw 9cfA== 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=q2oEQqrpeyh1yOtUEx5i+snfpAIx8a7iTjtfmPTxyaPRmeBOE9fArnRKFh5FiJaQdf DnZL3uStnZ64jbrJOQi6xOJJqLPCV0nE2KMMAYS9bk0/Hv/mkxMegBHCJ4cpBrCgn5mv ywwPHSKRn8B3zb4wVtMnrhI4rSJsyozv9BTKux6DFQJdWc5se5E+5DyOFNmIcfw+NRx5 nOvn+o/NeijoIiwj42gqoUrSe6aBudnitVCL4a21ccmer0PcQA6HQN72k73EoMwIzuZK ViLzNjdqCMDwGlaMDAvVJs8tAvdZp/N4SEMUxpcCXbH5MQtLt9jMPLHuB+NL9L6P+G8B xH2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kZ23uLBa; 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-20020a170902779200b001949e879626sor8423775pll.75.2023.01.23.04.25.11 for (Google Transport Security); Mon, 23 Jan 2023 04:25:11 -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:a05:6a21:3982:b0:af:f1d1:6f7f with SMTP id ad2-20020a056a21398200b000aff1d16f7fmr27734000pzc.31.1674476711141; Mon, 23 Jan 2023 04:25:11 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:25: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: [PATCH v11 13/18] drm: exynos: dsi: Add Exynos based host irq hooks Date: Mon, 23 Jan 2023 17:53:14 +0530 Message-Id: <20230123122319.261341-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=kZ23uLBa; 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 12:23:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2649 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 96EA53F039 for ; Mon, 23 Jan 2023 13:25:22 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id nb8-20020a17090b35c800b0022bb3fd0718sf2754970pjb.4 for ; Mon, 23 Jan 2023 04:25:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674476721; cv=pass; d=google.com; s=arc-20160816; b=PahyD/uMZVNXkohrJADz/i1CIZIHlWqLGNL/zbCQZQzFzlJ3ApNk3m9agdqKr4TT9i jhyyR85ceuwX1naN5TNnnu5EYwFWWkZPa8EGwIwdo1z+Pef4SrCCgMcqzNoISLfFvqG5 zeOZ6B+HbH85eGC6i86BHwzhwXivFK8pbltlM+t4vrWFKziegnyzHyJ5XkB3A210j7bX wzXaaOg9eg0hwvKW3pugAhAO75IG7CriMqF/3lAZPx1/eS2mxdcMhsojX3zYtpML3aQH Hm7Lm3lq3I8cgFZrxWhN3JYUl0gwY3Q5+Jsg9cEnbGTg32Da1IfqJDKVQkyf68kUjuit wFHQ== 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=SS4T9anKcBPof2Y59qv4gWH4WzMAq6K0FWHTzx6xN2d/wo/yTdKCqrfnpDWtqFqlu0 JS32D7MWsK/8kuVTL2hyuDt9JaoMIvSVtaaEeXt7S29RgSy2tdlCSl5rGAprQxEeLzJz ZVWiKEhyPcS3D8cQO8BcZqIMSD9jeysSLLyXmFyj6BhRHZR/BWsokc0d7QQJhOX6VYaM X15WQVN6I3UycDU+pUfN21ye+BnoPKIS8ohMqyjxS8EyxMWG16njxkcJEveQq0bdtVxo JJro8/YyB8Dxbhs3ak2bNwIXI1IObn0ZCuqI6/bWYCBdM+Z9W23zdrsS7d85vl5kYr2e d4Sw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MuwzpemS; 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=T9kpztbKpzATmUTR5ghm24Dm+4VOqlKze+i/XZoopu+TEUT67wDAGs6jXDh5ngauvb acERV/dxgzLo05y4souLB4GQSeGZPpqaFJrRKE2u6bDScFSwzJD3B3ZgYX8lk2Vd1Yh6 p7HxjW26Q21BzFlpmS9yanTNJDfdNpf9VHJok= 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=43Kk7WUP5bbkbq/t9RVwr/onb1QKsmb9WRuXocSh30alD5DRuh5T6YPS91VXORX4qY vB9SbQdVGkdnHgT1fFmSyE2pYzUXNlXqfgiysPQSOhNZTfi2UEAcimbKqfQ0BrmknNVV 8ZvVcdyH0SoKH8mP0PXtP2QL8/Y5jAcvjFSQ47cgMNumCrn8u9GQvGCkSwSlSBPRy8NX 4FAvCgnRe2rgO8oEboXFcS1CpRR7u875s17Qfu2xaTTiQ3M7pSK+OxCNOLdFz821kk5l TWkM4B+rBejmfWcuBoBgFenZCXx8A0mZhCfFj+HRYBRwFxO9IaH3M+Jj/7qYI7eMFKWN lk0A== X-Gm-Message-State: AFqh2kpeepOSHGAKwwtdkxgPY5lEeQ31zdHw+aRBmNesG07IXZrBa/zU VbMUOR7peDy/HZQe66sqIShsiUpM X-Google-Smtp-Source: AMrXdXv08jhRAYauyp6d/nrlMLZ3DhhwEcxiDxJFJtqj6V+IjXjGMD3ALPHifF1wFJqdbhIIHgKsyw== X-Received: by 2002:a63:34c2:0:b0:476:e0fc:8d8a with SMTP id b185-20020a6334c2000000b00476e0fc8d8amr2071015pga.145.1674476721300; Mon, 23 Jan 2023 04:25:21 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3801:b0:227:1b53:908c with SMTP id w1-20020a17090a380100b002271b53908cls16566635pjb.1.-pod-canary-gmail; Mon, 23 Jan 2023 04:25:20 -0800 (PST) X-Received: by 2002:a17:902:b598:b0:194:645a:fa9a with SMTP id a24-20020a170902b59800b00194645afa9amr24034562pls.8.1674476720095; Mon, 23 Jan 2023 04:25:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674476720; cv=none; d=google.com; s=arc-20160816; b=ydmGfYQfodL32IMbVPV0CuNeLIrOgg4owYfGxxeY8l7MBmm0MWIwUtMbKfXvjw7RbX 4J9WWU1RpXZ8lm6VRTY6sv4L1ShQSUoZpYfCEsIEloAYS00PlTm+NhBC4SqEZfz5lQSH UgdupqS+/9FNsc262rKfgpv1nHbHty9DcAUTHqYI6yXz7otvuezSz6Md/4qiwpYRYbwV 2NERl8in00t8KmuAOusX8cf6c6hhhpoOmyN4fGs3NfzBA65+RwsSJnlOjYOzbVhxcS62 aPXw/OJCtyc7IeBPHYlZwVowoEbEnJmTbDhy5/eu2CNxQx0Mf+0NKIomqmfmuBe/hnMq O8HQ== 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=lg+/xlAreJwmPnuLr/HWdBUWjbIO76HUKXSA2AU8+JOW5G2plFYK/DoXnW1UqEpqLM Y08RY9UpoWUx+42BV396wloZpuZB3bpynaQXfK70GkLlO9Ia6LDrc2yi0GVck2REvQeO i5eXE5zg2fPf9kXOkoR+x34R44/onrOw9S3ur0sGHmJBLPo4tfmRYzg3Hkgz7HX9P9WO l4xlGTizTRYwoVTsv/Yb6mrQYkTNxV5z20PH0HOvWrTJ249NOX1oP7qHWbiFX/3LRiGu k/XXf9oH4V6zKOypuba57BLoYF3jI494FdSjhiLHFSrpYWaA0GZwU6gL6CEa9RzEP+7b 4HDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MuwzpemS; 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-20020a1709026b0800b0019304d850bbsor1754884plk.118.2023.01.23.04.25.20 for (Google Transport Security); Mon, 23 Jan 2023 04:25: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:988f:b0:194:9b5d:2887 with SMTP id s15-20020a170902988f00b001949b5d2887mr22353608plp.64.1674476719039; Mon, 23 Jan 2023 04:25:19 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id w10-20020a170902e88a00b001960806728asm1291811plg.88.2023.01.23.04.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 04:25:18 -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: [PATCH v11 14/18] drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge Date: Mon, 23 Jan 2023 17:53:15 +0530 Message-Id: <20230123122319.261341-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123122319.261341-1-jagan@amarulasolutions.com> References: <20230123122319.261341-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=MuwzpemS; 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 --- 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