From patchwork Wed Dec 14 12:58:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2552 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 F2A633F0FB for ; Wed, 14 Dec 2022 13:59:39 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id 7-20020a631547000000b00478959ba320sf1770105pgv.19 for ; Wed, 14 Dec 2022 04:59:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022778; cv=pass; d=google.com; s=arc-20160816; b=eS9GJ1v38o/krz2M5WeH0WupMYSlNLLJyRDRJyWR5E5qiaTAJHT6+NXwCWjUpMiOip BJbNfWjAiWb5FYZ7N7etZa5cTdWN7IQR4LUV1KdpSsp8Dz3bVbiUJruZeIE2227VFw6/ ib2taba3NWTNjfPmNl2eDShSO64qBxpQS0nI9w3F3Mixu4A5o9DaWXO7byvAp/4UVVzz KFd/V7iZgo26QrAhNgbtMVMCfR1Yr15d5mpoqgejkMsKPv97x0NpByDb7alJDe7XORch fAWl59rebZctZrfqFjdIo+UZfVgInor3xMHigM0AC8YaKSnzmBNFUNCLd+HH5apK2BMk x3Uw== 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=GpdH6IiKQVcGCXPPgrfylAYaua98vTMacq4Xy8UCW3o=; b=mGNxItVSpUg+9auag8UQ0ZOwutWdEA+vci9X8lMsGjkoI5XQ+jphjGREaZIdkPM95M mhtd0/eRtp3sArLLbgrllVvgIuPlhrdmzbH8BDrN+j1UfwT0hQQXQHJR9Gi6HgkxzeD5 EBoqVrnMGuI5wlIdJaF1/Zd0Rosi6VRjNOVqqFJp6p04opn5yumwRswnlnV7Tgdy6vD3 U2W+I8HdUVEObl4TRXakhq28OfbHJ/tESMTLNF5no/eGnjqin+MVlZRKd+hY3BqMB94/ b9ZsVXmGQZ4kmMfuWkAgngyQptsq3IBJpHTfc3muKuV72rk56k+6XBbxgb2A2UEv2Ci+ VUSg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XF6NiO27; 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=GpdH6IiKQVcGCXPPgrfylAYaua98vTMacq4Xy8UCW3o=; b=YeyiG4UZjMYXPisMI71hUCv+LBi61D9amTSTU28HqwrOTgajj5FALBqt2BXsWCpHnD qICwH35N4eznTPXo6XiCwiHqDHOWyig5lRvWzRQ/BSEHlVRtapvhJC6LkuGIsfGlZ/O1 /pM3urp0z9DVfG6xT6ylnCMFIUabKdKZ8FyVE= 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=GpdH6IiKQVcGCXPPgrfylAYaua98vTMacq4Xy8UCW3o=; b=w80Pa+hYtPYblo1PPgf/qWIPswmBmx8ABXvbsfLB2VUMNOOCvjUfwQsSvI+FAF0Eql QEhKZAHKPge4opITYvzUB3AvJ0xEb6EKVaSKKuaMnjoJtIagrGWWho9z5UMrKD6/gXa5 6SJUTjc8dBj1UzOQH5+DSs4TAeNoAITbOpBs8FQKziZ1NgPEinW+xVEtAwmMxrhwrq2j 3n8yEX1CxDlX3/IKeiwvfdPhqa5rxWuiFNalSBjw5eem9Hr37yr41BVr6Efc1aRErw1/ ldEAw8Ev4SsufpmWvVVNnZSu9OrZCk9eF021N6Q/h9AtjI3eLEq35pjeQOdaNmDsKyO3 4ZEg== X-Gm-Message-State: ANoB5pnig2L3OC5lcbmjOPb9dRbqhxzA7ftAjEiyRmxO/5b0LwAACf8y OLrviJ/T58xuvf9SInM6kFlKQzYZ X-Google-Smtp-Source: AA0mqf7CyARbgOVIRyENmsRx8FQN70y1EqbgT/FFJHy4yjOEAMxAdC73Pxzy420YMg362N62wygsqA== X-Received: by 2002:a05:6a00:2403:b0:572:698b:5f69 with SMTP id z3-20020a056a00240300b00572698b5f69mr83395831pfh.54.1671022778453; Wed, 14 Dec 2022 04:59:38 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7b86:b0:188:62b8:814f with SMTP id w6-20020a1709027b8600b0018862b8814fls22270271pll.1.-pod-prod-gmail; Wed, 14 Dec 2022 04:59:37 -0800 (PST) X-Received: by 2002:a17:902:b08b:b0:188:6ab3:20c with SMTP id p11-20020a170902b08b00b001886ab3020cmr24614426plr.34.1671022777484; Wed, 14 Dec 2022 04:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022777; cv=none; d=google.com; s=arc-20160816; b=mbZAjshu1ip5jnGES2E+H/ZQzB/hcT8LJNua1CnkET0pAhGqawIcNZypUTb5aC6Enj oCc6vTgOf7fyHuwd8kN5tRaVbG3zf3YplrDkUdvU10ntm9MLHuY2E5HfL6hz3DsQSGED H8obBxYWY9oi7sn4woNEfeRhCMdZQ8BHCOjL+/LchWrPx0RA6ZPtYBpO52AAQKPV5LPu WXgMeMex7i0Nh/2On6CSI+PiyFt9Ia9tSh4X/9UFtzutEjP7a+6z/AwqLKeChYz2QDUZ 0vjqKxLIgvdBqNDzHKWNAby0+6i+JxGrdUrqdv6E3fkdc8Hmn7LnN4T8B7OJnXPdJe6M V7ug== 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=8ndEKJEU9XRDwvy5hojvuVFbU65Mj9YqYATSCh2JuDY=; b=RAAYmZeWVu0Cdq50ryoiVqq9MV4rJDGy+IO8eaTOYYMPAk7OdGSOvpD3Md5jdH7FA1 /hZ0sY59Dfe+FoPwVTM8qgCm4LFFdbqO8kbK2uwBNZ2rTFk8wwgcudtStHdF9CIA3CVQ TAEvgNuKCZF+VzvERwpr5DZqbetnEN3yVV9b5lhkoLOAn2YqBOIMoA3g/wUAIFltgIHW YeAmzE6J8X4YIb04xLqYODHjC1xo5mncM4TSpJ3+QEiMfprV6Qj7B29/4a0luAPbiAMo Hk3nL15SfhH/8+jZvwiGAFcS1i3hGjACeXtoNQy7+aXLnQPxaVrzlsX/DHyuPR3kMr6a JAlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XF6NiO27; 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 e7-20020a170902b78700b001865ef88280sor1527786pls.3.2022.12.14.04.59.37 for (Google Transport Security); Wed, 14 Dec 2022 04:59:37 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:bf49:b0:189:e360:ce5 with SMTP id u9-20020a170902bf4900b00189e3600ce5mr24920364pls.12.1671022777128; Wed, 14 Dec 2022 04:59:37 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.04.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 04:59:36 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki , Maxime Ripard , Linus Walleij , Maarten Lankhorst Subject: [PATCH v10 01/18] drm: of: Lookup if child node has DSI panel or bridge Date: Wed, 14 Dec 2022 18:28:50 +0530 Message-Id: <20221214125907.376148-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=XF6NiO27; 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 v10: - new patch drivers/gpu/drm/drm_of.c | 113 ++++++++++++++++++++++++++++++++------- include/drm/drm_of.h | 12 +++++ 2 files changed, 105 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 7bbcb999bb75..020457444dfe 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -216,6 +216,36 @@ 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 +268,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 +288,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 Wed Dec 14 12:58:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2553 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 6B9163F0FB for ; Wed, 14 Dec 2022 13:59:47 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id hg4-20020a17090b300400b002215a3c02c3sf3906010pjb.4 for ; Wed, 14 Dec 2022 04:59:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022786; cv=pass; d=google.com; s=arc-20160816; b=rUjnGgZzNSSuHmOWv1T4J2g6ah0V7H+Rm0rP7TqXQUiIXbn7JlgoimDWvfsq2BckO+ xeAwcmxEwtOxvso+vTTJk1zYrNuXEvi9DyG3x3EIu1ML9K0Gt+Y9g1rVQW3yooa3c57J ATRJT5akwZpzjnrr3X9AF6OBsC73kyuVvnwsSSzGK7QpHtScfAEslC5m84QqscYH2Dlv bDxzpvzAe8/QWNQAzSwt6gGipbI5Y2re3TOc3PgYpokNt6AyRDVWKCwni/pYJLTVym6i ADnYAJB5zxdw1QIYm1MXmabdbouGp04qcihoTA6Kwqps3lB40h4lw39Z60rwgsVd/rPv F9Ig== 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=5uj+SBx1o4biC765IgT+bcCbZmjeuirCOp0NnfM8yhw=; b=sMMQTztanV48WVvMn3DJEdSD7MjC6rkKgYyhwgISga6orhOmmTk+rZDI9+rP5tZxE1 4X5Hw+4c2sIxBiBNFHnMA8AMp3zkA469AAvQjuINsZ/hdiHNf4x3ubSmHJBa4a+BDWZN Iv7be7Ecsrq3E/E5t4kFU8aQ1/tkYWiQ0/to63L4UVFDtfMOZHOmGw9rfgMG8nUnHNQk JgAGv6iXCHMVRt8FyHOBRvlBZ1pwNI6vGLtvyWiq4iehZ0p/SESYBRZkpY/DPJF6w3lq T+1BWmy3fzm5hu77Oe58H9TzmxA8CMIRdigFVkEkHAL2/rA5ToSCX22cs9E0mXJEZ4L1 avHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Gl9PUd97; 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=5uj+SBx1o4biC765IgT+bcCbZmjeuirCOp0NnfM8yhw=; b=hwspvwGf89oAm7p5obPENLMzqj3VeYffcHKNO4pMzQn7dv1PB/Au1B4xFIITfvDj2b 19e+R5AfWsQ2kLnzwbjLpZeLzE04UYh6hyaCwuLSHj8hzl6UspvOmdE9Z4PQ6LUK4RMq HG0QVx1lsHJ4+eidrAwKkRrnUlFppX2N7MV9A= 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=5uj+SBx1o4biC765IgT+bcCbZmjeuirCOp0NnfM8yhw=; b=sLbR1coQtuQNLw/brNx2tuHpAC6MhTm2/GEo+KXtIRAcmMV59gD9tna1S3PQajKF1K flhgENVczJW0/u52TTJHVJt4Z+iu32tcqk61z2vdu7/agT2H3MAljBkUQsKAbpFctkEZ 3OFvehQQS4xqg4ijKBfkUNf3bFL+sxFHPCdp+glzbbEcmuOi1cRw/l64iqDvhq785pF3 RzGfhcjI7eoyx5O1TIeYDrtRJg8/CUr36dmctzSKUbJKs1C2qTdMUZ6TRqKiMe2goE+e 3WEOc94kf/I88XlAnJbebJlGaRzieutqKvq64qJG8NXZtbpIsYVNifH+ropv8zuL7C8s Q8Ww== X-Gm-Message-State: ANoB5pnuo+Vtr2O6u4DTldXOTxMp9HA8eGkcdJGKMwZeGua/Z2T3qWDb ov4rd7ZNDgyq/HaVxh7DFnq7yvzl X-Google-Smtp-Source: AA0mqf7sVfY5cZR5SMlXEON5IuQ6X/SeWU+Z9GGkn9y+337qkHIng7BA9flGmQVoGFkeR4K4JYMviw== X-Received: by 2002:a17:902:aa43:b0:17f:52af:d022 with SMTP id c3-20020a170902aa4300b0017f52afd022mr93285124plr.122.1671022786081; Wed, 14 Dec 2022 04:59:46 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:8a94:b0:218:a5af:5c43 with SMTP id x20-20020a17090a8a9400b00218a5af5c43ls24227653pjn.3.-pod-control-gmail; Wed, 14 Dec 2022 04:59:45 -0800 (PST) X-Received: by 2002:a17:902:aa8b:b0:186:fb90:573d with SMTP id d11-20020a170902aa8b00b00186fb90573dmr27653067plr.3.1671022785188; Wed, 14 Dec 2022 04:59:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022785; cv=none; d=google.com; s=arc-20160816; b=EXKzpFASnW9jqRPVefP/zDWUczJBg9BiLcKzpDfYM9DkfkVK8xjCa64c46pxMCYKQI mOujiRPMJDCLz1peq5p/Okx63hZeElMdA4vGD+LageOghfJ0xp5cf+zyDFoqiB/UQZrR oB6NLw/3BrVdMPP1tFRGNR4dtNqoE1RhqDa6pkqUyuX9OlH+YTygVUQ/Fe2serJEOOcX SNlITSpzmvNgRdmDNjYwHckV1STF3vcMYy1z27TlKx7iOZKNExSHutHKE4VRRLQ67aIj esANGole+33bufg17MlMATqVinN/80pOzjXNcOtU/VuVuZDK11k4aPBn2Ed1mEX4fAy+ 4Fzw== 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=j5Cg+w7Af9e5w0oCEb7RkXl27zloxkjJ1KXCIn5jcp0=; b=iKg0Q8hXxgudzaLqRKnF0IjGjNF92Xd3bZFRakBq3p3MBfH4/Lxr6PeruIOaBslzDR Tl22ewXyiSp+BjQDZyxp6gBw5/DTE+/F7hDpqG+ASHXm51ad1ckJqSX3FWI2G4E2av9t pXBNJk2CSIbpFiTVMKGtHOwcntDrMsPOHDlT3hsJYD8TPxFOTa6lf+xX831ClOsX4ZZt wSEEFr4xaK1N6j/yIaBo7xe/YySPu1TF6aZ/WDWNH8MfF4YNe9I1sFjm4niAqXIrIl+q fQJhq/aHsRU2WFzmVMvpmEEJ9lu/n+9JVDlTxp+uuucfvHoe/xrsvk/TXhjbL+mDD96d Z5yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Gl9PUd97; 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 13-20020a170902ee4d00b001895afb6979sor1437131plo.182.2022.12.14.04.59.45 for (Google Transport Security); Wed, 14 Dec 2022 04:59:45 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:903:189:b0:18c:1bc5:bd58 with SMTP id z9-20020a170903018900b0018c1bc5bd58mr39744815plg.9.1671022784870; Wed, 14 Dec 2022 04:59:44 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.04.59.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 04:59:43 -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 v10 02/18] drm: bridge: panel: Add devm_drm_of_dsi_get_bridge helper Date: Wed, 14 Dec 2022 18:28:51 +0530 Message-Id: <20221214125907.376148-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=Gl9PUd97; 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 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 03c3274dc3d9..50ea5de45197 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -496,4 +496,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 Wed Dec 14 12:58:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2554 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 18E763F0FB for ; Wed, 14 Dec 2022 13:59:54 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id r126-20020a632b84000000b004393806c06esf1802953pgr.4 for ; Wed, 14 Dec 2022 04:59:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022793; cv=pass; d=google.com; s=arc-20160816; b=ss+syhMRUu+uWrxDUkTtRpvHpNHavZQqpGU5cyYq0OSe8x/GsSz+sQijS/SyB7aS6s MkwZ7OZOopze4yA6orHRPnBCORSYhQgXcO/SwXxDc+vksYxH5AKq8IZAbIs3F9R0EJvG F+pIxn5M9rMKnJJZQGwB6B5tF0cEAEwzKY4rgAC6m2O94Izf383jfPnH8IRBKCIa49+s O4uua/RWFaNOpd5H6MuiS4sQBoWasGQ2UHxNSPukZ8uHSonO7G5mo0P02lVH+LHGblIl p/pO9CuxkRD4Kb3v4FFUXtmT0lCJQAbHhfbZYk9eEpsEfHfZL02XW2IlcrbBuu4zy1Gu GXog== 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=x3+IQwexGP3pZyOT/w94XJmTrJe7zpLwgCmiQsfY2MQ=; b=s1byWsz5Zq3DFQj7xC5bws/bwojc3KDY3PNQUwpU7ncPh5r00vcRTxUdZUcI7vV3As HBqR4fUxJbRb91fyykLVCnDuUNPs6DuseG8yysnZm+NOnjzOFwWSh/Gh2MYNsRXxsmKT 81FAXlJ/qvLkdU5asLHXaecxt0VIdcM9+4RT4bXWi9NB/23hVGHdoqoSu5063G9EVDg8 4EgL0IkPA+MYNlEsHtkreMePT/5+nCnBC7ry+NvUc4E21h1RPmnGeb8kibvdUFbwZYQJ G+Rk1UpcAbcR94chbNJ53kGdYchHRlLnaakIJC8vqiRpZfApv0oEEk+vBXy4K1KMA4iQ HWjQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IJWEwMAR; 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=x3+IQwexGP3pZyOT/w94XJmTrJe7zpLwgCmiQsfY2MQ=; b=CfLQ/fRtTr1r6nnsbplJqInyW7XD+QWskTgn3RvNBJTfvwLiYCFzoYXbUuNvKravtg aEKVf72onW2HKTScwvLjbOKnyhdtJTacvJc/MsMVGaTxzLNcBN67ZszoRV+F7zv8fSgA jF/Xu/I5//S5fh5eg/+mdZo7d/n32UlTUwWoQ= 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=x3+IQwexGP3pZyOT/w94XJmTrJe7zpLwgCmiQsfY2MQ=; b=TdwXLgdxne2gG04ztSL7NcIISK8/5FbqD/4E2XD3rnm0QvGwaigmgfDBrqdfPWzNRB JFpqBxsLYtRLtzjG//Ccujc+6Hyeynoi5jctIoYin+cTYgHhG44hEgRCjJeR8y6r9uBc KwjFLNHk0g5kcm2tmSokFOM3nRGd4dajG55M4X5TkWT6foXP9xQFpq0Q1MSGnkIXhcZ5 obRFBn6CeXkdp2kPp+3kEISc1ZN1i7uhpTmUZd1hzBWnFHv3qss2EYy118egkNWgnIyl gsPiVrC74jnjACYo/G8u0oPp1MULm+898ix7sHXMHBxMcKweyzayGwNK0ryxoZeTEEXo 9tOQ== X-Gm-Message-State: AFqh2kq9wD8fUkyP5sHq3e/kkJmRfz7Xzq2OtN/gbI4XsxTRDI/YZuAN LLJZetn+WMrGVbG+YnA5QxSPrAPp X-Google-Smtp-Source: AMrXdXu5bcPrLMswM8Vo+p/FqJM4AhRljd+5BuqLoYAV3R2fMgvmZ4wiCWAukatXIud2JJQsmKg4aw== X-Received: by 2002:a17:90a:af89:b0:212:fa9a:12df with SMTP id w9-20020a17090aaf8900b00212fa9a12dfmr322976pjq.231.1671022792757; Wed, 14 Dec 2022 04:59:52 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:1d4a:b0:214:246b:918a with SMTP id u10-20020a17090a1d4a00b00214246b918als26201020pju.2.-pod-canary-gmail; Wed, 14 Dec 2022 04:59:52 -0800 (PST) X-Received: by 2002:a17:902:b083:b0:18c:d9df:a4b5 with SMTP id p3-20020a170902b08300b0018cd9dfa4b5mr21980756plr.7.1671022791851; Wed, 14 Dec 2022 04:59:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022791; cv=none; d=google.com; s=arc-20160816; b=Gsw/hirUCMyMy/69k2Wbw3cVNIYRbN1lc6IX2yp4miWX0qfFgvGIlZZJZk8afkolI1 TcerUOqOHcm5vT1SfvVCOUnvSdXyY68zAXM+JwKiKKj6twczgMF8sgAYhlt4HYPB0Q6P gApjGGHiIPqivyxPdK85YqDiF/807w16SzK9WNa4eU1cv45dmMEJte1zWVu0ayKpzO0I c6Ws2XorxAwAuIIsKZnozOGrBUhTqg41i/9YjD4WbQMo/UUBJP9XUdr6c/rPhtJJ8DW9 rdLayAEumxwUtkdk7Ier1Vkf1V1bUMLeffwVqVmOeud2OKtpcBSMulCwJKMd79vUw/gL 1kJg== 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=lRA4g7zBULv9cktOq5gSiTnCBz1g3lpTo4+Og/fOWPw=; b=vWDnregOTBiyBwj/kk12BbZgdGV5EjcuzJOetTz+2ky8ylHRRVdlG/XRZFqS+Jby6t Isz+ySYbVmp8p3bVk1vNNEQ1oSFxhiw77VZ7xxzapWYQWNMThkkVEC7piZ53CdZjheD3 Fy3B9DwH1piNAuOPlMI/EnXwxyoctqCVnKETG9cuQU5mD+Jijijnaw+EIWzSd/i4+ySH ICPUa79UWHGQ/PMo0V2WuO7z5vK3kEAupwYCzIoY1cvXeBQ5AndatjYEV/+e2ibhcHmy ihRFKAC1yi8EXbZgbLRPzeb4ZcRGKftq7xj4vdM+z0mypdbp96Y9j0o6XmvGOu4Fdt25 Eu1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IJWEwMAR; 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 x20-20020a170902ea9400b00189b1684921sor1494045plb.173.2022.12.14.04.59.51 for (Google Transport Security); Wed, 14 Dec 2022 04:59: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:903:2412:b0:188:f47f:ac06 with SMTP id e18-20020a170903241200b00188f47fac06mr22560240plo.19.1671022791593; Wed, 14 Dec 2022 04:59:51 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.04.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 04:59:51 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v10 03/18] drm: exynos: dsi: Drop explicit call to bridge detach Date: Wed, 14 Dec 2022 18:28:52 +0530 Message-Id: <20221214125907.376148-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=IJWEwMAR; 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 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 Wed Dec 14 12:58:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2555 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 653003F0FB for ; Wed, 14 Dec 2022 14:00:01 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id e6-20020aa78c46000000b005772151d489sf4084016pfd.15 for ; Wed, 14 Dec 2022 05:00:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022800; cv=pass; d=google.com; s=arc-20160816; b=uXFrq6PXDCdPbFjiGTxCiDGl+2YkCXn5rSXU/chVsUKOJADVTv+v6fck/EK1Q8t29z Y54E7GHNBSDw+MjGFbb2KJNBNPx3Yq30EC3dPc1V7Tf0Mnw3473RQBeiLluNmJyfEz5Q Vd3CEMyMRVvQdEMkm6gJKra02eO7zCB6i96uVk0LBNStyJMgJx2jmJICBIeipf6QfKdP eKheBSSSevPPOSxN4yCsllcPp9e0+jfZ+XQis8yGoODXNyz+0rHTilUTJYH1Q8h/twcy 2cWbBAdfEZDNb/lw6Plme0Q7XGA2PzUi3v51AERg/UtFju/kh7cNEkYGIAg1lfjZpmtO esbA== 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=KjjTYPuHPN4kdeL89ciXy6DfmZqnCWIYVToDQJLvqPU=; b=gUdcu2rJEhk5JagToyZ/5xq3aR/tKF0OqKjM1USsg38Kc9L3NsG5alhBX7VUHptMJW YJI/yaaD8tOFh5ns/maE7QXsy1NE+vYtWf1g1mdWH0LzWUvscmNQBD1dvDPvsEv2pM9R EPOanldJ3hGVut66S85WnHW+S9iAvaxmwMnb+fA3lTtnoGmfnc8gkZmugL8Ho9Kqyzfi fK/4zdxupFq5l+VXf8lCOA6TQMpMz0ouA1eh8ImNEzhfTnBLfs6H4roQ0AxD/3ERgMf1 y4AF/Utg6hw32ThsRhee+noYup90oosuBWGuvvtvcBCPeekc4V5t5zVgZ4/vsIY5Xqu2 GPFg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MS2PaqXT; 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=KjjTYPuHPN4kdeL89ciXy6DfmZqnCWIYVToDQJLvqPU=; b=HZpLirb1W1651Nsmyu494kEEmfBX0h00BU4sV0OxPjHspH97muX8GS2KCMGeENLhSE UdFYTd49D5JtTtzxVBrZ9wsoWscMtdmBmNZ0KeJJOZR5MnxUT14512FDQstMHVfgzmIL R9Avd9lPSDxuIEsmU89i9dDniVox9i1XiroAc= 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=KjjTYPuHPN4kdeL89ciXy6DfmZqnCWIYVToDQJLvqPU=; b=A6nabmVdL8QIM93RMYtHdlc+sGsOVm37LLrBZ0Y8MMQ+6kZndIbSFU0uF1MC2IwLB2 vu+0lXL3N/7d6tXSA8yH+e6Lm1z2+ZE0WM0+2tgCIZj5FB3IlI+A3/D2MFARbYYjFjEj gZXWHFSLCoJ/DvZ4IVA/btR4enzyPBon6c7aVZ0BDpWhNU/TKqpvA7JFgPieNPWjovRP 8PNuBuP/aUYhiCFTo+HpGcponssBk2rXFi/68EPi2N7/1l+ioGYLAeMl4tYfRo25yW0D zL697QSCdLfgjj5ac4djRIUNCivPq/YAd9Yg35q+X2t1qUOvCxl2wk/OFsGwOmizDQIt oe4w== X-Gm-Message-State: ANoB5pna48zVbbvHcw51PfcTwz/UMsG1GqgO7iJpuNQCZIgNSr7p6F61 0dk9tchxaI8kvajW1RWbW0sEvbn6 X-Google-Smtp-Source: AA0mqf5a+lym9Yib4TxwkfOamJS43qwpt7myR3aLQoGPqnT6+0USmuLsGF7GkOUM41CJI6nfsuqrMw== X-Received: by 2002:aa7:85d6:0:b0:57a:92f7:8f1 with SMTP id z22-20020aa785d6000000b0057a92f708f1mr343714pfn.6.1671022800166; Wed, 14 Dec 2022 05:00:00 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:8a94:b0:218:a5af:5c43 with SMTP id x20-20020a17090a8a9400b00218a5af5c43ls24228216pjn.3.-pod-control-gmail; Wed, 14 Dec 2022 04:59:59 -0800 (PST) X-Received: by 2002:a17:902:cf06:b0:187:261a:8441 with SMTP id i6-20020a170902cf0600b00187261a8441mr27782177plg.16.1671022799309; Wed, 14 Dec 2022 04:59:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022799; cv=none; d=google.com; s=arc-20160816; b=M9mfljMDb9grKwGbjPyTQ88z+66jWV8bTGILqe4FAIg4JT/x/TQMzRkAxc+aAT75oI w//Oi619uT3QmF2gFAi+t7VyXis3R481HwRou/iVAvTsqReoCcvPRTrm9Ctt/mf1Hd7b p5MmJ274WH0BKYv5SbDTYgrZLA6Qmas2sEo7oDHgiMp7nUwZsrZAVRIPEx6DtLjLYigU yntmB36vZGxhkcVfBD/TQ6VZOdggit5Xq7Sb3C1gHgsA5RHr4wkW68sTDKXx78oPVkuz dLJXQY+wJkO70GyU2PmvRhfDZ8cL8ha6UrHlZAc3g1afHBY6lPI3M8EsCeqVjyB5Tx8K DSzw== 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=5XV0iT2+anlnzNFxB8gtw/95iQZwlim72SiDndwZJCQ=; b=otGQWUBiyuqcbSII5vQgdkZQd64DwFmer/vZ+vFKIjGE2+E78mrMgoROgavo24fIjF zxz5f6LQbquQqhkG8Z4FZlCfabtdG3yg/FSUY1QbXWp1f2Uf0PKvkLgQyiKNV3GnmEVt b0NsZXishHgGI+bRlZ2bNNO3fm4/2e+8kyFXn6ubhN9iNo8tIqBNAghrXNsIf6KU1+kK MjImcHM/9Ay2GbpvIdEUVEOg0A4Daq1sm+/i0avqcZKpRvAR0hEjbmkbEHgza2zDQLJQ 2PdyCaY/SVMxC5qQoy55xJDpSsv+lKjjiovh9dm1WBb6T8c7dwBp4TUdUNleP8XfOrHH psEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MS2PaqXT; 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 d6-20020a170902aa8600b0018969b4a162sor1531332plr.43.2022.12.14.04.59.59 for (Google Transport Security); Wed, 14 Dec 2022 04:59:59 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:d68b:b0:9d:efbf:6604 with SMTP id it11-20020a056a20d68b00b0009defbf6604mr30432564pzb.18.1671022799002; Wed, 14 Dec 2022 04:59:59 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.04.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 04:59:58 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v10 04/18] drm: exynos: dsi: Switch to devm_drm_of_dsi_get_bridge Date: Wed, 14 Dec 2022 18:28:53 +0530 Message-Id: <20221214125907.376148-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=MS2PaqXT; 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 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 Wed Dec 14 12:58:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2556 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 11C9A3F0FB for ; Wed, 14 Dec 2022 14:00:17 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id p6-20020a170902e74600b001896ba6837bsf2493905plf.17 for ; Wed, 14 Dec 2022 05:00:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022816; cv=pass; d=google.com; s=arc-20160816; b=eMyWYtrp2+5Xn5CDZzfja2nAyUQmgukQRLFTAPCaS6l6TJt/ewxGWw5PmQeh3pjYaD M8TyGR9KuFUcOWEJHrvg0OYc/TYaasKZ922jgb7VY8IpOAcZFj/fxUH/8g+X0cmIbwL/ wbg1KZTIlWHUbflPO2MW6+d8sCl9Ke9NTZHhFdo3FFIVm0YjQRl/theWVumudujgGEjT wdKOofeEeT+xpGWXx/A29dtPFAnhZtAFPeb1jLNb21famJSmqvmu0Fxf7M0Z1JOuUDN4 EhMvWQ5Jtj9UK8ERiwfguSs703YFF7RxJ0KkquCyb63o9ko7PybsRW7jxbRc5dh4eb7Y +D6g== 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=ZiBKb34BH1Pep5qtut5hjp4LaW9kELjr5vuDAKtb5PM=; b=kn19sDmNw45WOCKelTpgT0xByJdoLXvKgqH4xjayQpdR1hUOs0ctx82khMLQT/MmB4 arIaUjRe/pva7MuIN+H7Sg/RyyHoEOpUfsyCdrR+uR3rUEeG97NVk3UxuxDJtzjXf2Bg vzy9xjauIIbojEnnuPIZyhceVk6vYtFSIAFQcL8QL3uudMxZ7AIo+f8s5p/T8ylX7wmK 14wObINOBgrrE9x3O6S1XPuGP0y1fvfJ8OkOGNYs+OnlCcV3+AnFaoroYCoHzR8zu2Oq ggRN9NRMxlXVgDYVz4mg04hZ9+DpY4tZLZmHdbqLTVrhHovIImB4y4fxIzxmYG6dekmI Hx4Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DfVAry6s; 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=ZiBKb34BH1Pep5qtut5hjp4LaW9kELjr5vuDAKtb5PM=; b=QjHXL2i2PeWxH4ZCDjxOmtwlvuurggDyqWSCItJWIT9JU5CyPUj8O5i670gxKHNroH Dwyyn2FrneytfA76bJFrVbfswp5weXUm6GWcFL02zIARKQbZBTpIK4aIBn8f7kg+43GK 3hVAmFrOqRV/P2o3qRkv+cfCCol2KyOvSbKU8= 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=ZiBKb34BH1Pep5qtut5hjp4LaW9kELjr5vuDAKtb5PM=; b=OGX+etMNze1oAWOuzZX0kkOrB22r4uEM/xGQzHjggLGFeAL8yDenoqUFZS6+Aj8Dc9 PoqnYpUx9HxSJcqsvHVR6duTltBjHtSldQHfvVTFu/FZsv6DcinDvn0TdLM0O8yi5pJO txVKGuv3vTV/QP50GIv1Gna2P2HPVTUsLdTHX4Y6mOsvN3k3t/VDBSkqL1YyBAjZ+e8L N7Uyyzn6nqN1wya/R9ejgGwAZ0ZO5iKXECDtltkwcTFLhbtDxs2tKjqGB7wi4IJkFyNF qRz+czoTNZeWzTNT0NkePi3YxRasvz4NmnL0AEneSlisgl5OweOMp9gBPBmqcJ9uTFhp GScg== X-Gm-Message-State: AFqh2kq8iR3mPBn8YY7hzZ9LQga8CECqDEBGXL5iiI40XpItipuYLfjR GGyn1J8/bTKW8sFlbhtZdlLBw7Bp X-Google-Smtp-Source: AMrXdXvG8btmygqxbERnbZyN9eViM/oVyQLmQBoDfsQH2AGvVcG2dVwn7yAeN5N0YMWmgcUO/wx0gA== X-Received: by 2002:a17:90a:1304:b0:217:e054:9ac8 with SMTP id h4-20020a17090a130400b00217e0549ac8mr331085pja.246.1671022815870; Wed, 14 Dec 2022 05:00:15 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:c454:b0:178:35a3:84d9 with SMTP id m20-20020a170902c45400b0017835a384d9ls22232939plm.10.-pod-prod-gmail; Wed, 14 Dec 2022 05:00:09 -0800 (PST) X-Received: by 2002:a05:6a20:4f22:b0:af:7ed7:d370 with SMTP id gi34-20020a056a204f2200b000af7ed7d370mr482004pzb.43.1671022806712; Wed, 14 Dec 2022 05:00:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022806; cv=none; d=google.com; s=arc-20160816; b=AcTGuK4WxH7xzjQQ+tJhpaPUjZk/njsSgneOHRuPLAWCtyP+D4drFGvVKTexkRviEE 6aWhHsnpn8g3Rm7inARLrY9fjX6VVWw3ApU08tUum7T4EpS6J+Lof6H9NQz5di+HtIx1 R97+m/qcEzVYJIEOvpQBiAkOeZ2Deedhwv2yxpNV6I4MR8P8VyqdbSSbuh/cmYYy7we9 9M4DD0H+DGgEP/neevwXpF2s+96uKkL4SV1HLeqhSu6GYo0oUfpOHiGYIgQ7qg1m2hrR yyevo1Yp/WdEV+BRC6sedMdEf6PQuJYiP0AdwbuUD32Go2264oHfyKMD9aQhiNr86OJt s/ug== 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=UIrJ0sMj4TBazRS1wROrogpqFN4PzyDsm2y3+TsztNI=; b=eYEczR5HMa/+DymKWuhS5/o9dPwh6oNM9uxqrdkYvyUg2HN1nxWC+DY2AUFc45C70b MYSMFZl/GNO3ZDPvPskF10CsQtqoGTnUeykgKx/5SrAeazJ9Tt458bHobjXXXO33TvmZ hrX8456/afWRuEMD0z3WExggTA/VDXH78I6a+4eMZXMV6M7ELhvvcf7vkrTAn8+rU7lC pEZonZ+z8RPuhTAbLPdcVWTOFDMFaqsRg5FvCScY2YSp6UP5X5guyTv3no0q4JrONDh8 v0da1GKbNQcnG71JtbxJHU9apcsPSiSrW4rwfn559QrhKWhTuM1hG7fGAGz5ibWSck9s zbWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DfVAry6s; 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 w20-20020a170902ca1400b0017f6e0873e9sor1528191pld.30.2022.12.14.05.00.06 for (Google Transport Security); Wed, 14 Dec 2022 05:00:06 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:6918:b0:9d:efc0:62 with SMTP id q24-20020a056a20691800b0009defc00062mr41746149pzj.10.1671022806323; Wed, 14 Dec 2022 05:00:06 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.04.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:00:05 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v10 05/18] drm: exynos: dsi: Mark PHY as optional Date: Wed, 14 Dec 2022 18:28:54 +0530 Message-Id: <20221214125907.376148-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=DfVAry6s; 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: Marek Vasut Signed-off-by: Jagan Teki Reviewed-by: Frieder Schrempf --- 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 Wed Dec 14 12:58:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2557 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 A92CF3F0FB for ; Wed, 14 Dec 2022 14:00:19 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id v16-20020a62a510000000b005745a58c197sf4113631pfm.23 for ; Wed, 14 Dec 2022 05:00:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022818; cv=pass; d=google.com; s=arc-20160816; b=DXME2jnkXv2WcvmuRPAxX63kCvZR0QxlKTNwcait6B5lQEIlOT1CZCXkcLxSD319jQ 6bk3N34Sk2lyNQFEliIYMbxd6FNn3BInIWJevipLtuN97ftfb7iaCY38nphC8EYHM90R 0lB0I3nphI9NSIo5JcfrE5mJggvKv+UFKBKO3nnTVwSD0PurdijULBvjBMpgyjuBjcRA ouE9+hMKkvRjPQiu3FEHnCUYDXgOWFgRfx6pgLY3JpMjQFlvz6TC1LqDIPBkhRbAY/pG qHKaun9hHiQO9jH8BvE8tqS/XT50PExLZdl/kx20ZVf+qFHA1FSB5tbJiGOBVjasiKlG qkTQ== 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=2gIMnLFW5vZo+7N2CS8xH0rYj5OCnOW2V5jrdhN9Lt8=; b=wpJyeAptj5MzZ0Rp7P0lpsQVh5l2XpFMY1BVECCmDEkUQtE6NfSXs41EBV1TTOTszP 63PZ+0md6g0SbkxNLBHwGTvapjwD3yXbnSYWJL442jHzCJsUtlX886+iG2qO2MYMff4B K50aigRKRImkPQp/LRZmcQU//ZuJ9rjHRP5paI2IF+Vmew41mlEayXlgccUenNGC4u1w hlaGLeS+vLzdlDywtuq7JrTJUGl4tNz7UAmXgSXqrrFAavZ81+M3eJVh2X+QHi4sqnRw FVpY5tZDYyOWMOFKyr6PljoW0eZwWe1zmfaFDBbnxaRc5RH2RG7d1JtEi1WD1oSGBaJ7 XLqA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RNWzCrgw; 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=2gIMnLFW5vZo+7N2CS8xH0rYj5OCnOW2V5jrdhN9Lt8=; b=b6cL9bCkJ4UzYFdIXn87ds3Ao6ZLawtMiZafIvUrwhm6o2VHJGbb2vk/rd50AU++fF Wwyd7ZBob4PBtaySSLzd9JLkgg0Rl7K0c1vZt/DCqaJ6gOj2Cv8oFC4r0mwXCwxUrhUb utN4ZvS5uz9bI3/w/wU7yzDGltaDN7OdP1UrI= 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=2gIMnLFW5vZo+7N2CS8xH0rYj5OCnOW2V5jrdhN9Lt8=; b=uWdiqTxZwv9R7Su+R5UP67A6Ta+35kJzaR/2AWwYqa4apoPMSn48aFQjapkC5MeV5d 7f010ZPztags9moMvP6L2QMH0BZMjuDAf8YQB9lIgX2e840qeoTZsF20q7oGTUQZjxiu VNFBw53oihfRxkaAMVPVFIpogm/LImw8+ySUCh3pK/9Uu+7g5HRsN8IWJzUVGyX23462 A5noEDb4QPqZSZViBwP2ESm1VVyn79c4yslzLbA5buqrMGLUcVErfLn9Y5eLQvjRWl59 34bLpRO1/FPFfietXvWOKcQzzPfWUQGUvKHKXlkUao1R2dL5DIugygjnNuBHuqgTaGMs iPXQ== X-Gm-Message-State: ANoB5pm+eZtQdmQU1MRXWGBizcthxoIVqTKzdkps5zR82DkeJVKhBB3p bdXy3GYGvV+LicFh/cJskecPySiL X-Google-Smtp-Source: AMrXdXt4auSePFdW1RgENU6LbuqiIW1sFAE3VTsDed8TuZFxI7hSUiC/27JXdS0KhrJH5mXmwu1Bew== X-Received: by 2002:a17:90a:7b87:b0:219:4056:720c with SMTP id z7-20020a17090a7b8700b002194056720cmr272674pjc.53.1671022818505; Wed, 14 Dec 2022 05:00:18 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:6b4c:b0:17a:6fa:2290 with SMTP id g12-20020a1709026b4c00b0017a06fa2290ls22251006plt.3.-pod-prod-gmail; Wed, 14 Dec 2022 05:00:17 -0800 (PST) X-Received: by 2002:a17:902:7c90:b0:188:533e:da22 with SMTP id y16-20020a1709027c9000b00188533eda22mr23593428pll.12.1671022813901; Wed, 14 Dec 2022 05:00:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022813; cv=none; d=google.com; s=arc-20160816; b=lcPBlMawICTE4hpWo5YJEQOp/a2X9FmNqhX3aZQPAgrIp5ohCuEb2XmCcNELqzs+x+ pxurjzTB0E4mEbeOGUH28hXHSdh6+XO/b2+tlFRxY7FUvtBc+3FtI5qgoSTiJE9R0mZ0 jnLH1LIpzSHcxou7eq4y8tNHmmdQf6swPx6l+dP9L9GdWEhsVnmT0gNtc3/wVzp/e2VD VbGOgxD34RAh+HqGRkMNCGTtM12KH1S+V9NrIM31Dp/LxDnkeasAis86N/VqvQx8d5Ev C8ixwBFYM1S+nJZIv/9JBuUfA8Vx9f1zFWhhI+BnPrXoeGjSfH+YmYWmwc+2Xcf1OmYB /2eg== 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=mb1nxdVLVqjQupqttT8Xu0fM/Can5U2rIfAM94zt0R0=; b=s//E6mXtNh4c/rhxlhfQBZP5jl86XeJ5W8CEax5M/G1pFL4/WNuDgrNZUDUerijyM1 Tk7mMRbfiD4jR+ubx0n03CPpFCSTC2Rv16fFy2iQyrNFfXDfuJgcRnBnJtD7zqGn/T92 RNpOo3h8/WGZfY11Oq+E2Oz8q8q8pfuBpqmVCBaqONkmGE+dIVvdqbDI51kjcbN5TJyz GDN/O2ArqSkWU3q3NeNmGYW/6DZMbt2+JWqPg3L1ItjGg1Zm01Xc89xuuvCfqXOFWmf8 jdDmEU2H7D2gVcJEP3VBtdhNWHuniSf94Rw6xezQgxluiIl9592AgUhAMWfOyHV+Nzes LAcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RNWzCrgw; 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 jh11-20020a170903328b00b00186c1684da4sor1561349plb.152.2022.12.14.05.00.13 for (Google Transport Security); Wed, 14 Dec 2022 05:00:13 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:e194:b0:189:aab9:cd80 with SMTP id y20-20020a170902e19400b00189aab9cd80mr20942466pla.64.1671022813531; Wed, 14 Dec 2022 05:00:13 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.05.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:00:12 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v10 06/18] drm: exynos: dsi: Add platform PLL_P (PMS_P) offset Date: Wed, 14 Dec 2022 18:28:55 +0530 Message-Id: <20221214125907.376148-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=RNWzCrgw; 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 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 Wed Dec 14 12:58:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2558 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 61F1C3F0FB for ; Wed, 14 Dec 2022 14:00:25 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id i4-20020a17090332c400b0018f82951826sf2505436plr.20 for ; Wed, 14 Dec 2022 05:00:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022824; cv=pass; d=google.com; s=arc-20160816; b=J7XjgFbluT6DHeAIMqYFdQpEfQZqjoIhlNgKHW5ctBTgqN+OVUzAChSQ30dQPNEOtP fKtY78SOo4arj58dNFeQ1vI0ejjWdWGzJFZy4x4F272a0xomTL4CfkiHnMjYyzSL5lyN i0zc5Y7YVoOpNlnljK51jShRgr928n3+ox3wUtQs5DvDATPvf6YB4D9NnLXlYv+zvPsG 45cStNpcok+As1gbNk8GHZrGi5wKqxkwbC6iicCqE9Jgfr2/BE05RiBuBlMeD7R5MeP3 zj0Ua17KQsPIKkdfNjL1jvrHiwWUeZyIy6OCcAenHcWD2xACJPp5h3JT3aoQ7yYtGEc5 dZnA== 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=misUVeIm+4jO9J4JjuxKO5/BRayuKKTDUL6bHlVxKkU=; b=0ESJhJBnHDpDyozcUmBpjQv8BWUWi78agRq1pFFxgkrOgA78uJXTWkYnep1sdrDs7Q ZNM3hyuxq/APAHLqzwV4hev2tOuIuXDNuVSmnq7u+oqoXmTagc4xPCZjfgGiwcWZNpua x1K/1gkqiUCoVHynlYsCmn5IDhT8qMCm/qs6Z4rkeRE9vSI66xlLVhBYIy0rKf/mBAcS cT6eagIE9grwHI2/L0oJ2x8VM33rCYEh5qjpWvcvy+MFmoTTKu2gIY+P+gAn72bPOYvP hSCwQcllwvD5tW4RChnilwZgOvJbi8bZgfBXso0u1wAoZmFLmBHj78LZhJcAVRFuSqVB YuzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rsn53jOg; 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=misUVeIm+4jO9J4JjuxKO5/BRayuKKTDUL6bHlVxKkU=; b=fVVBN9oewqkjT0GB6mgR1achOhZbyAoeogIuqtDzzKEGUkGkGtTf0VVqV0E45KWAH7 56KLk25ckRbZ490OUNQeCiQALU62+gquK3v/HN25q2zhig0Eg6XwYwJrBoqVroYmjfnz sfBufF8Lq7GZr49r9Kckgm0aWPXsJCGFunzSs= 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=misUVeIm+4jO9J4JjuxKO5/BRayuKKTDUL6bHlVxKkU=; b=rVPxPXVLGygaySilMeaeC3DDJBJA9ACMFpdE2p2ThWHjFDrTaYkPXGBRXFV6FP0Y9t lkqDEDG6i46qNsbsBGyonWOAJ5TMF0voFZr8gurvQI1pUuVbN453Gnht2rGm0eznhq4m 6Jtq43wk2K1Id94PAM1yR1IcXRztupZkHMREgPWLxg5fsZu+VQ33wM0O35KQ/NxdpJFH 3cKJbH5N+oMWL9sr/kNv6amgEPTynnoHks2XnHcrwjeDsMZbvrrm2jO1X/MpOJORLP4H EM8asy/bItWg1611O2PZM3bSvAa9RSZcMiZkC7DxEJ9ODbzIxWMjYOEYUvUUfOcgTjJd 9i2w== X-Gm-Message-State: ANoB5pnKrZSvEoFG6f9Z45jS2kTSDPvEsfV9g/9va6G50VRD5gzz0nVo ZFK6X+t94Vowob+skUD7BJskvaw4 X-Google-Smtp-Source: AA0mqf7XH9HcBDu87QmnL5OQz9btIcvzOL/tnbODk7nHQ+T4dhRBqmUkiM3ZLuI4TMQX4ok08bUQAw== X-Received: by 2002:a17:902:70c8:b0:189:d37f:d97 with SMTP id l8-20020a17090270c800b00189d37f0d97mr20920521plt.72.1671022824070; Wed, 14 Dec 2022 05:00:24 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7894:b0:178:5938:29de with SMTP id q20-20020a170902789400b00178593829dels22269045pll.2.-pod-prod-gmail; Wed, 14 Dec 2022 05:00:23 -0800 (PST) X-Received: by 2002:a17:902:7d85:b0:18f:a5b6:54f9 with SMTP id a5-20020a1709027d8500b0018fa5b654f9mr10911464plm.11.1671022821590; Wed, 14 Dec 2022 05:00:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022821; cv=none; d=google.com; s=arc-20160816; b=KJW6UwD3EV5ylngHCBwSQOXVIc5AqmDiIk9hPtB79cVQxFnMAU5SHx5hn2FTUjUTSL GfP99Xuqc7zzSaiBaNH4KxSyrR2niFZ4gPtcZSfg1sKolcwi3ERyT03p3A/ciw6jsnQG bPuTQeC9TgpaQDP9rDCBtDRaSKLD8bSQ1w3pANl1tLmFzZIAeUGl/EgPqk1PFVcaTrcS T7rW07kxyjvJF+eAistG/Be6VTkCrzC8bXv0m4lajKCkkH7To7b92RrcdmP1jbXMbN2W jkKS1LSPAHnS0WAN1IvDMUVZ/r8E+jSBPisTiujo9MUFnU5sBJfIDWrkdqyIV+OTYxBb E/qQ== 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=+fY/W1lN+Ci+ECm9hkCI93VoUxar0STDOgEhzXF/A8s=; b=eTgzFCwPdI1lqGrz7dn7CyS8Z3RJfdXGLSnQiiYjYHz8il90qd+XUeiBmz0MzEGTt3 z9qtxRjrOSNE57H3Oi3pX3Wj1rd6Mtw/QyCAuq5gF//VwOY+DVZejDqRKF13RKV3uVug Iz6+kYM/lf0UzPJazkg7FcNQLA/p9Z1bLbb+pP6r4/Yj1mbtFkKcKsCvEysWCkgpsFQK wUHcaZb/oc+xnP4OmpTXPJzRzSW4aQqIDHz+ZzHid4xQumlg0EKF0BnelZZ0XTmJXRNP jyVN5oKq/wxRD4UEItUIb+R4kNTRtNshCnRPLN9Q2tKKHk1mg3Ho7KBBiyKfMFnIYslz MFJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rsn53jOg; 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 q22-20020a170902789600b00189d4f80a11sor1507918pll.28.2022.12.14.05.00.21 for (Google Transport Security); Wed, 14 Dec 2022 05:00:21 -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:328e:b0:189:dfae:f9c2 with SMTP id jh14-20020a170903328e00b00189dfaef9c2mr24293927plb.23.1671022821194; Wed, 14 Dec 2022 05:00:21 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.05.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:00:20 -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 v10 07/18] drm: exynos: dsi: Introduce hw_type platform data Date: Wed, 14 Dec 2022 18:28:56 +0530 Message-Id: <20221214125907.376148-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=rsn53jOg; 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. Suggested-by: Marek Szyprowski Signed-off-by: Jagan Teki Reviewed-by: Frieder Schrempf --- 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 | 84 ++++++++++++++++++++----- 1 file changed, 69 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..fdaf514b39f2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -254,6 +254,16 @@ 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 +277,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 +311,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 +539,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 +1478,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 +1667,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 +1826,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 Wed Dec 14 12:58:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2559 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 844F43F0FB for ; Wed, 14 Dec 2022 14:00:32 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id nb2-20020a17090b35c200b00221433a393dsf3904157pjb.5 for ; Wed, 14 Dec 2022 05:00:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022831; cv=pass; d=google.com; s=arc-20160816; b=nUT4/78yKNKKMCsMt0RP/hZC/vIBfxmDirzsGIP7AFWLcrFR3SgSPi6vuWv252WmAV mR0zTN5VGq2LBzJMLeQUUdy++FS4jE0RxRWl5c+V1aJ+ZGJPx4sDLdFLf3kmZK8mXpQU Ye4D2CaT+gv2yfZZFg8wQ6+AT3jnBkBUKyfuxX4X3G0XUq24/IbVMsl1/PTrRBYDrX2c NdgBl305E/AGar8Q7AftkF7pyOWHSPNmqo2uT3nBneYqGAB9KXP33K9oj2NqZcrLpt5Z RWVF+COMLsMBNwjpRk1LpRsVUSrqz+ZJ85W/S1YXqLHkD7AbsdTIAKv98BUS8LY0+TfE HIrg== 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=/y2GhzBpH0VbzevuAcmU4sr+wKoREV4tfN/PBgPgyHs=; b=C/8Yr+ckh3U4LTBOkOAW6E5wbDYgmr0aZaMOhtZxNMjYYQahbsmXh+FnLuBZZVS5R2 dSEp8iz/8ofoQ/Dnm/2JWAzSQIjr6A+dGHNaAt/JDZ+ep0Fx7+mGIN7iCPmgoj3IGrTP 4vovGVGlXH+wOXnwd+lgqpQ3C5ERk//OLgHCNUhjTrjbtgl3l4zNUX2TWPhgSHKQcqkI YIaHPW+C2ftbS1J1t9i8+WUJrv3poqx4Zsm4qT8nid7CSy+YX8vFglSjGPA26Ybzxc25 zSF7wVe5Q2EVBc2PNyP/as7hstxUyNZY5gXDLqK7tVM8JQPfGMztkUzwyRLR7zoOGNF/ +7TQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HTPrpriN; 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=/y2GhzBpH0VbzevuAcmU4sr+wKoREV4tfN/PBgPgyHs=; b=W6F2K5OymgZQH/UIduzyL3flxpGHEBxZo9raNBmmdPFu/FpzQ/g1e1b4JgxBzZ/Pyj igJQycmUK8aCNlNiAfQXEk0retLJ2zn6XeWot9mS2E5HMygjm2Ihd5Hr5elZvRu7sc+y Jhm6aLFOvUNOpQlzcEXINR0rqABNjdsm3xmQc= 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=/y2GhzBpH0VbzevuAcmU4sr+wKoREV4tfN/PBgPgyHs=; b=g81ffp2P1CY000e2aZg0i9qY7UwtRQpGNp46JEBKo52EHIEbyBS+ZT/JZQDsbAHVbj dPEqqCVjxajgdmOzYeMSU96+xnSM3DpvtGnUBNKhOAU2mvYW/wm7RwCvk7VLXSx2irLo nY5vKhUTcgoDG5TKxeeTKlq3LT1quGoAUd7SLgpxKHR13FZNJvdoeNc/pc7XfhUDVw+l VBr+5nxUcln+eXeti0rX/kBJ/peTRfiPg8bf9fp356LORg+ZH2OttD44XZjLXqXIcCFY vLCdIeGzj+nbEgEfvmkq3MsW7YQy4xGLAUtQHGnXfervmvNQLdDRoth9Vy8yVh2rMoy7 RtMQ== X-Gm-Message-State: ANoB5plyqbcGq8PU42fuZJbEIM/OuA+ruPQwG3H6BNYHJj5qi7tfJ4/0 3wdHFQZUqrF/l+O/CDfi69670lUx X-Google-Smtp-Source: AA0mqf6SD1H10fCWZrYZrI+4mVMGgdxfZh4Kw8YLhTsFD1eti3lAETwfThyjhfZFXGgkEXXcIwLpLw== X-Received: by 2002:a63:cd52:0:b0:42a:9ba8:8c6b with SMTP id a18-20020a63cd52000000b0042a9ba88c6bmr88598713pgj.407.1671022830297; Wed, 14 Dec 2022 05:00:30 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:a898:b0:210:6f33:e22d with SMTP id h24-20020a17090aa89800b002106f33e22dls24225812pjq.2.-pod-control-gmail; Wed, 14 Dec 2022 05:00:29 -0800 (PST) X-Received: by 2002:a17:902:8c8d:b0:187:262a:7955 with SMTP id t13-20020a1709028c8d00b00187262a7955mr22769852plo.9.1671022829033; Wed, 14 Dec 2022 05:00:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022829; cv=none; d=google.com; s=arc-20160816; b=h/wftaIR9/ZSqKS14+Yc+kTO51ZSZlhzdj2FsJCgPmoIBH6FYWyoOjdFnpJSMhsqMs NFMeXU8trAeWHkYPZiwohqZdDDrP4OrRMFuEUuJKvBqSEnRwkV6H3Xj8VdA+E6O9FyLx brQ4/SXdSBJ4GtLnn255CAE2hQX+HqoSar+X244L+bwOlf2RPKRLx+09ZNUyjGSxMWGA yWZBMKRZqpnbTpzpMRCQzOe4NG0TfXiu345p/R1i0Z+jz8yBYQYUVR6cEflQvXOf+Cl3 AZA5Se28mT5qlVYViz3/nNuCXf6yxCz+R0neMhrVgZRqk6PlxqGJ80zdXbo+h2gBB10f o1gw== 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=reAzV85TkTxD1WK0rGG72gcOzphutndqWeG8pF/PWes=; b=uosj95w9/BRxIibvbUMCvtTyO6J86wUCXp3NYJdCzUO7QJ0o8j0uuM0T4vRrtNOjPK NNyHYqasI3A5+XvWVRLTNLu805i6uVTdrAxXKN301RlgKKGrPcBBaDrn1F9zZCe1Hn/4 MMfM0+k3YPEdyoM40yK8nzamiTC4A24dy1lM2eRJrzjSZrFh8XVy52JryV8M7nQzjx+c HmxH7IOXR9s/FV3FiPhdJBZdq1vXcR3bBBiKnpMSYIpCrInwjlTSusoieZXfeivXtza1 JQVjXYm9J1IbeIzEbYg8qehBQl7K1i8RXQyzDszxc/nGssLo9ezF5SDo+yWs3b3A7Pg5 MNXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HTPrpriN; 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 i5-20020a1709026ac500b001897548534bsor1582495plt.119.2022.12.14.05.00.28 for (Google Transport Security); Wed, 14 Dec 2022 05:00:29 -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:3043:b0:189:bf92:ec8c with SMTP id u3-20020a170903304300b00189bf92ec8cmr22486241pla.7.1671022828579; Wed, 14 Dec 2022 05:00:28 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.05.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:00:27 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v10 08/18] drm: exynos: dsi: Handle proper host initialization Date: Wed, 14 Dec 2022 18:28:57 +0530 Message-Id: <20221214125907.376148-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=HTPrpriN; 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. Signed-off-by: Jagan Teki Signed-off-by: Marek Szyprowski Reviewed-by: Frieder Schrempf --- 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 fdaf514b39f2..5792f9883cee 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, @@ -1344,6 +1347,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); @@ -1356,6 +1362,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; } @@ -1411,6 +1419,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, @@ -1557,12 +1575,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 Wed Dec 14 12:58:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2560 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D36743F0FB for ; Wed, 14 Dec 2022 14:00:39 +0100 (CET) Received: by mail-pj1-f70.google.com with SMTP id v16-20020a17090a899000b00219b1f0ddebsf4892854pjn.5 for ; Wed, 14 Dec 2022 05:00:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022838; cv=pass; d=google.com; s=arc-20160816; b=EWH2Dvk36Ynf6tMyAdjwFdJEkz4veCploklFpI3MlgA5R7YEbEorX4Cwq2O6u/gRjP LN1S5be119inpDc5oHqvx8EiwMbF6F++B/u4PkG1234o4RrIgb+eoE8mQyD5Fx1F0sBQ 2DL6tfEg2S12q98SFE43LUN27/L7szIOhzGIa2TZwmLceQwGgVGbd5joY911t3His8eK Goa22xH2BcaIbuFKvRneashKBydN7lPHmiooPAJCVe7hYXGHtTmWslkS5riEzbdBBmzc p4UOYy6Ni2heOXzAa9VtitE4GNByxGZj/GEPwl/AL0gp6FBkMLM9suzFa9/cTvbrZOHw 8I0Q== 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=SDFWS4rl/1xImis3pDalZgS40SZzms+9mvcQHnYkqsE=; b=fb0r9CLLXjXSLId6OT23GZb+dcgAfJJKLqVVDkDAE92ZThsjdY3zqdmcNhejgx9S+S eSfi/yjdS1a1LDvdfQ8GZ/d+jmRMJsQUQhwWI99j7Rwe2hY4iRqCKg5TR1owoR0qRPqh 7mrhtUbdSruMf/d2vZkScOcrluV6OetTsvLsTCs4C4U/U5MjEoS94jcPKODT5PeK7uG+ Q/vmzlZO+nxASP7vFmZxXsJl9y0VF/glMP3qzm437UGGaEIcxG9WdxpMZPAP/p3nH9FW MpO5Q2ilBaACnQHwX72VKO6jKK5aoo9PgtaNHRDz2cUJaJ6xzSO02uqVsSuGuFsfnGZZ zqQg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=O2SkxtZj; 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=SDFWS4rl/1xImis3pDalZgS40SZzms+9mvcQHnYkqsE=; b=GS86w0sZzDqQmGaYzvUVvdFI1VH3+vz0N5Ma+EDQE2Wwt7B2Clw+9EBA56EeF57XiP kT9Dpy7x5+HHeua7SdB1HEysT+lytxJgXKAFRrsaE1xdNz1czJrZEtxuuhZpRj0pkdGR xMlVPorWAwFvSuT1laqAZWH9RNIvhUpu/9eqY= 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=SDFWS4rl/1xImis3pDalZgS40SZzms+9mvcQHnYkqsE=; b=iyJ0q6Q9hEM4ZzC5MF5l4AdWt8GrXurRnPWXtvtpFugP+gqoUDHMLfWJ+pEE/13ERn izYvkPm42rpZak1pZoZoQ5FpCiqq8OdwqCbKFnvIxwPagcCGx9pG/RGoTpX9njqVfCsk 38APApyLXPsQE1Fwp7eW+LyPi3OmIBMk81MbND/B/DE6oY5dc/iIcnWWFlXaIEGBCIaB Gx0CrcrPaVyVHtiiyAB5VrJkiloIFxZfLYkQBvTRyvrh7xqQPQTisoHuG4PDKNpNZdVc B8IbHyMbF9QOx8VjZwRRMRDzAX1tKXBQFPUrcOf0mGnxcMS3xvrduFbQGqNLasTGMop8 rTpQ== X-Gm-Message-State: AFqh2krZ/akc7tHRGNR86wsi2ECeU75RxDTPB/QTvndPtbUJmKI/P2bn YKo9A2yZXNKn3uKO/bftpi+pRB+u X-Google-Smtp-Source: AMrXdXvOMSr/9llSRPsYh3woSQ4yh45Jx0HkUj0tCbYSbd3pbZ7ImAkiIjluetRIwfT49gL/xpqxJA== X-Received: by 2002:a17:90a:4581:b0:223:376b:f678 with SMTP id v1-20020a17090a458100b00223376bf678mr253482pjg.242.1671022838527; Wed, 14 Dec 2022 05:00:38 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ed49:b0:178:3881:c7e3 with SMTP id y9-20020a170902ed4900b001783881c7e3ls22226096plb.11.-pod-prod-gmail; Wed, 14 Dec 2022 05:00:37 -0800 (PST) X-Received: by 2002:a17:902:9b96:b0:189:5a49:36b7 with SMTP id y22-20020a1709029b9600b001895a4936b7mr25409578plp.33.1671022836919; Wed, 14 Dec 2022 05:00:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022836; cv=none; d=google.com; s=arc-20160816; b=VjGTkiyQBF2iJrYhY88shyQngWf3Wec47XSojlZ+GqVUtxsmYpimTnEOkbnIlDbAC7 R94MRqatHfO7HB17ixT05IDCb9zhCxtTzSCe90SjcE+2+InnxcBYU7ouyCg6ZQJQBkB7 0ou5qyhI8kajccpUtYlSS7A5nwT3QYkBdKTNqQUhjwygR7OrLZ+9lej4Y1/AFEX4MnWM NUAggAoLazlskI4cJI3U9XJ7M4u+9OkV0cQGmMhtUH7HeTeaEEcew2mRFCanRCPj1raR bax0ig9HPn/UZTsOST3Q3i19QUnRHZhl21G/k+gWkEO0evlE3Qs6eoD7890LWGomo1U0 E2wA== 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=Z01OaA7zrA2+KfvvrlxHXzqsMcnora6T9Om/qcw6zXw=; b=GltDX26PfnRU3za1exZQGqzrWP7Lp/bNMdx60hpVeTiLwTKp6aV2/QNjbrqO44b3uj pT0yd3jJs44DGAp1h3SA2nmwqcwnyi4566nWldfLLAHIzCFgHy16hklcaBTAp0wAE73C h16wnx94MVuHQvkoJICsmt1Z3wI6xcoKTywm/YeWluuG/T6YTbvsfDa6/hzL2C8KNueI mFUsP0AiDS+BtaM89QINwX8Tkx/60uWoXeQkzwoaecV/MJwTe4b5lgWgV0YI9oEwEGdY DaihDLmJfWYFHWwswg5MZi/E78b568rxH6rV09EDF6pwmd86dtey/CeuqbqGKueV+hLp 8kUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=O2SkxtZj; 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 t15-20020a17090340cf00b0018980f60677sor1576427pld.23.2022.12.14.05.00.36 for (Google Transport Security); Wed, 14 Dec 2022 05:00:36 -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:330d:b0:18f:9b13:5fc2 with SMTP id jk13-20020a170903330d00b0018f9b135fc2mr13047280plb.52.1671022836497; Wed, 14 Dec 2022 05:00:36 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.05.00.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:00:35 -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 v10 09/18] drm: exynos: dsi: Add atomic check Date: Wed, 14 Dec 2022 18:28:58 +0530 Message-Id: <20221214125907.376148-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=O2SkxtZj; 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 a comment FIXME for this and updated the active low sync polarities using SAMSUNG_DSIM_TYPE_IMX8MM hw_type. Comments are suggested by Marek Vasut. Signed-off-by: Jagan Teki Reviewed-by: Frieder Schrempf --- 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 5792f9883cee..12a40576f937 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, }; @@ -1466,6 +1467,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) @@ -1488,6 +1515,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 Wed Dec 14 12:58:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2561 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 63DCA3F0FB for ; Wed, 14 Dec 2022 14:00:46 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id z10-20020a170902ccca00b001898329db72sf2498756ple.21 for ; Wed, 14 Dec 2022 05:00:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022845; cv=pass; d=google.com; s=arc-20160816; b=pHwBIKD9GtjJQhL6PR+/7GoN0FFN4911FLf0hlzIMzavnwV9hYt3a4etJpn7l0PQZH FfnR8Oc+h0xJDPGLzaCPxIkJ94W99Xrv4X0wZjkAREwZKo2DdA4I7Y3fAdVXJZyRRnG7 miD4ZTj6Kgaq6DLbUaSe5hSrolFO5FLhH/zk7uvwSDOJO3i2EX5r7nTxEOc77l2RNNGX L7qFA2CfycfZ6u/yDsCfNNkqAtZnGMzAHIo/x7wJCsGbOICkswDSfhIfOTqma9UuBuwY cVjrFa4vvBc7itRWdw3ifPcm0sIzXym6ROVN+q/D1qO20oGDocE2H8q1k1VJWcneoKQ8 berw== 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=+j2d6XSAyqZqO+Q7SJqFFMDAQrBqE4IXHYbilOYe2eE=; b=ld8hIH2ntvympm8NLJ40K36a/0kmqPbkE5bpBp6wmfzJbq+8ZitiZB39Glz+5xBMF9 qLxr6hgZF21sT+mtQvNc4JuokEx2gGzaDCnIVkoxgcrZHbbPkdehV/WUGD0PSiAGyHLi ree8A512Fm58G7fu2B87Gu7q1ZIuw4NjEFT6DMuO6vL0RDKlcF/tD5eHCbfj9jyI/qqv xV5pcnfzXAyfUjrXsB3+SVRs4PvYPz6OcKNwKg+inlFPSZItF21/pzsLqmWgx08T2c3B msFQukNOLzgnjETXHCtEA3+PcbHnO/w2K9HkDmB2z9HjFaaeMzX1z+FGd5V2AJsJ2FjD bivQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QYfGH67R; 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=+j2d6XSAyqZqO+Q7SJqFFMDAQrBqE4IXHYbilOYe2eE=; b=Z5f5aH9JGoQ75FhRhR9T0KITF1CHPK8s/8cPQdIRIFumGyXlUknS7KZzKHxRDjK58X dDu9/l0pbkkHZfV8bvRjkOTU5hfKG7X4bssZpg4yQ2hqqOSqV+bRpCyK4fIV14Y+eBrX VwRfr2H1GvH7UYliEWbQgowluZDVE5024WM7E= 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=+j2d6XSAyqZqO+Q7SJqFFMDAQrBqE4IXHYbilOYe2eE=; b=BVrSA7+ztfzEUGAbfmY6gMHRrrgBqougVQdTvew3ckQDtd6aTYow+Er/M95gncMZCH 4ljq7DcA9uFgw+/8EcRV8auKNQZGbpwFfoSbhs/Zsn2AV+hvgtlxMuZ8DA0m9dGrTnww rVquTMXAYKNYjDgW+k+87BFxRXFoxc4fcGb8dkoWG8+yOVaDxAaABrkMzdsoEiseFUel WeGvWWqUmxJGFR1q1SoXyokVQYivkULa5zmXsCFrZRLTp/sg3UXVBgDYxfhGIus6zk1C Z0gYx71L2GZlVIj3NPuG3KC3g98JtSu6tFmkcWYB000oqdpCJluPhdRSeqRVQ+yEwY/Q vpEg== X-Gm-Message-State: ANoB5pls06hgKWhyHUefSj0jc+V6B9XI45og4QFep6MxYAg4Ov7MSrJQ XjLOxF8g9UGMZcJzk+H9O3OXFV+m X-Google-Smtp-Source: AA0mqf500xtQrY0DrGacvaAs1oGH+sC+ZeB2ezpZnEpeNVS3GL4NfN7iW0KJAbUTWRB2Kzj7Wt54iw== X-Received: by 2002:a17:902:f2c9:b0:18f:aca2:4748 with SMTP id h9-20020a170902f2c900b0018faca24748mr716588plc.135.1671022845178; Wed, 14 Dec 2022 05:00:45 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:f609:b0:188:b504:8ce4 with SMTP id n9-20020a170902f60900b00188b5048ce4ls22243009plg.7.-pod-prod-gmail; Wed, 14 Dec 2022 05:00:44 -0800 (PST) X-Received: by 2002:a17:903:2448:b0:189:f277:3830 with SMTP id l8-20020a170903244800b00189f2773830mr36846333pls.68.1671022844232; Wed, 14 Dec 2022 05:00:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022844; cv=none; d=google.com; s=arc-20160816; b=W5eOEX8NNE7orU28Yrb7OlZvur7A7WPli+8+Xyh81Ecj0DXrcGdBCyfh+Aj94Wgfow Iv7ODUn982vGgqm+aSk7GdJdCG6jEUBkJrk+5iVkrF8tcwZkaBd68QtoeYuE+pF/GKgH e8ZoL3WUvOwn5HXuJSZmejsOIG/DMM6r05PvwfmsA4NYDJDIxr9GLuQ7/UcrKb6tLJ1t fVKi6zKkdYYljFZU0mpEO5GzqZScpVBKRahCmnYF6OTbw/Bwgjf97HGmVOpcXwfJKmFI kE1AK6lZ/CKfPWURkLmWX+L6a0ynLG9AjrDFFZhm1IUxT7Jcq7fOZjSvg9LTGFokN3u2 QXLA== 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=aE+Kf4GZG5cBJgW4Glr+nCZ/Jxj375yDCGwPDOZtAag=; b=YL10iWo9iiJK7XEgYbyfRkKrrAhqldpkZelkofiA1PWUZgasuNDbstiSJoOoLomh0p USQ2uJRnYiwWceZHhMn/nlGzKvLAbv14tb+v1alR8IAHEUgwG9wRmgqSxu8PSo+quC4g iPo4EeCzRbOrBcShuK02nmY+7p3N32Jns9IRSQ6/8q4QixxF0vmc6r3RGbtlG7RGdAkP q8/Hr8PlTwXto7qdKB5WWkMRQqkYGwZTFYYfp0wsK+PWdXtOJra3HosUjadP0lyGI3V+ I2Nt0ECszvQxxY9NMYxVV/RmIja19Hg4RAp33fsufJnWTKMrnVBZdoycgfylzv4kwqTa hQ9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QYfGH67R; 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 i4-20020a17090332c400b001733c2e2283sor1466576plr.174.2022.12.14.05.00.44 for (Google Transport Security); Wed, 14 Dec 2022 05:00:44 -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:7d93:b0:189:666a:8d78 with SMTP id a19-20020a1709027d9300b00189666a8d78mr23375559plm.4.1671022843876; Wed, 14 Dec 2022 05:00:43 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.05.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:00:43 -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 v10 10/18] drm: exynos: dsi: Add input_bus_flags Date: Wed, 14 Dec 2022 18:28:59 +0530 Message-Id: <20221214125907.376148-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=QYfGH67R; 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. Suggested-by: Marek Vasut Signed-off-by: Jagan Teki Reviewed-by: Frieder Schrempf --- 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 12a40576f937..36820a7b5884 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1692,6 +1692,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; @@ -1778,6 +1782,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 Wed Dec 14 12:59:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2562 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C3ACA3F0FB for ; Wed, 14 Dec 2022 14:00:54 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id g32-20020a635660000000b00478c21b8095sf1801058pgm.10 for ; Wed, 14 Dec 2022 05:00:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022853; cv=pass; d=google.com; s=arc-20160816; b=fnIZ6Dp/7sLr9HkqwYG/RP18g1GiaGizXH4MDqMlKEoOmaIQnrywTSmyROLU9Aw+CF QPddfX5QZcQ6WITgvum8+kUoEYxXbGJBpGmyZhjgBEbpf3WkH7rcFotbGg5e3gOPmehl wMlIAOivGus/EkTgRJ6wK+DnCjjkrqXZix1U6uavoh3AKC2pz40DB/FAlc2AYhHkEf0P 3PaYVULy1zbekHom6ayF7RR/PhfVmW3JNuOUSfSSlgfBBwuHso2pBbOq8+ItFmM3cdp0 OrKThlnCqnrAECnXxjvUoGVy84ZquU4KIAtK0a6AJIjAx88QEGvYUn5YHi1ChQgCrKCB m8yw== 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=IpCUchmGErxoQZD8nJzrRDRuRK89qMPOIj+CmBqXsSE=; b=sGiXoezUFLRKiFKsSQ2wDWGwAjwGA2XfG6tSFqs7v4DzHKYncvl4aD+MxQmDnUkLMu uMIJ5oHj/eqkEP+0ysTCBMg3oR9Q1NWipC5t/tug/rCt3GVOk9eYqg7ojU7ug2UpFQxr eafR8N0guPQWSfuzQTAnx+mVlKbL216M0eFTeOTAz9e0P08qUTdHypBEG6DbHGDR3e3E ZJkGMxTKIFQoK8Te0VCFKJ36ZI9TQwoTiXdVLoWPp/87I/wesqDnxwPyx8wnQDPoxzCB HccjIxeJMO+UTEO1zEy58DG9Y27Ev+sOMAeHTtVD3gEOsg40Dk2OyWHyHtELyoYkc6h+ s1Cg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kIDUfCKr; 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=IpCUchmGErxoQZD8nJzrRDRuRK89qMPOIj+CmBqXsSE=; b=pDYy6yK0whDJ1cpBcMrz5Vvv1yA/JHPYIl8TyIVZzoc5HbudfGs2iKDs04IWtMJnbM qI7AgR7uQT4N9zUrtdu8M0EcJlW9iA87IG4/AGEVVU6y2FtXXwYcreqSBpO2woQqfIEH P1vcktdpoj++KmykWKMK0XMMnOQyLTZqG/7gA= 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=IpCUchmGErxoQZD8nJzrRDRuRK89qMPOIj+CmBqXsSE=; b=EpbICaWDIneebjRs99p0YXsTJyQRSdigEGtwy0Hcl7ktbMLthDSCwnjc3s78mosFfk Wf74c/l0YVeh7TT3iTBMocfCGOUxNQp8FSrKV3UoQ23AjKSwQpxen85KdpKnRLHOx27H Fm/9BhB3YTrP8XnsmHxtivcFoRJYr9KVKewZFdyRgF2exm12e1ZorD2wtDd1npSXW+zM 1ymcSB+Km8ypCExHaieYthpqDNbSmML+uVk0vBWqonS0joPtqLdImxPDnDjhDJuO4Qfx wo8C0fqXZUSWXBsGZVPTcdGyQpOgIkchpG1QHa8hD61SNeh3FBARdF0gXAqYhsj8ZKIT cYnQ== X-Gm-Message-State: ANoB5pmTsoo3eNs26MXDIJNYRDjZfKpgUo1veaLnStEltru8kKu7zliS +BN5QXBiC9/vkL1sPhxUmiByMAW6 X-Google-Smtp-Source: AA0mqf5FRNYh9OdKY64aumUaRFIoVnYDojwdqvJOEt9oOGnkmhzG/ZbIMGH6xGNKH3xY8MYChcKwIA== X-Received: by 2002:a63:f003:0:b0:45f:bf86:c917 with SMTP id k3-20020a63f003000000b0045fbf86c917mr87808105pgh.201.1671022853402; Wed, 14 Dec 2022 05:00:53 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:a898:b0:210:6f33:e22d with SMTP id h24-20020a17090aa89800b002106f33e22dls24227156pjq.2.-pod-control-gmail; Wed, 14 Dec 2022 05:00:52 -0800 (PST) X-Received: by 2002:a17:902:d509:b0:189:b0fe:d70f with SMTP id b9-20020a170902d50900b00189b0fed70fmr31898028plg.60.1671022852233; Wed, 14 Dec 2022 05:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022852; cv=none; d=google.com; s=arc-20160816; b=GXmPb3vfKGUJRPTdjFgBBqGXPZtq7PpGMExtpGa7r4r4oWOkLot5DPOfxEUtFuRyqb UkXzEttQMZmtiZvi76Ps4aWzT1o4xxYc2vLv71KfGIXCiziRqhS6+gZhj/pXdPO7TgRD 0R/6ycjHrGzbzbvD+H3mTz5JMiAMXYAvb49IDWViq5n1hCO5n+E3jy3rN7whiq6eI115 OLmtwJ/K43L0LM9fQFCvn+x0PWsDrtuA9rzdjqdecW58wDsg2pOYefri21FMP+90Dmh1 0YJGeP9xvN7F+IEb7uij1EuvGErucPsIDXXOLPxaNsyf9FNKtzFNM9S8jILggmP/nx2/ wWbw== 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=GVhftXkOyDrHisXtuBAfFezrQnFr2dvDm7Sl7pD6BIE=; b=GxIagf7VnjMyGzcwz5Xxw6CXIA/mEgGt4EUg3VPxutmljq362BkuGm35sunBAL3BPS /7++nvphk+qGTohrCQPIZ0NSNaK0q38KEK8N1ppkbS53SGJGi1l80Gcz036fAiuCpJvW kgzIdvHEwor0nsb/s09/oEd/7wfWfMlVak3cx1UO+x+l9S1pZTmMwmyA2X/W1jQTbeQ6 FMyuKEXw2a87s+jLDFEMQgZaEefIhSeLR8Iqos5kPUKtD7ut5M+Ei+cvkZmmiaQVEyAQ F9jx8ilowz3cbVlC7TFHua31mfvJV5mLcQs3IV6T4WUYtvNu9D4h1bEEhqRgqBS+hxpe ScWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kIDUfCKr; 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 v23-20020a1709028d9700b00190e233cd36sor1311766plo.4.2022.12.14.05.00.52 for (Google Transport Security); Wed, 14 Dec 2022 05:00:52 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:788e:b0:189:efe7:df8d with SMTP id q14-20020a170902788e00b00189efe7df8dmr24006481pll.43.1671022851498; Wed, 14 Dec 2022 05:00:51 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.05.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:00:51 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v10 11/18] drm: exynos: dsi: Add atomic_get_input_bus_fmts Date: Wed, 14 Dec 2022 18:29:00 +0530 Message-Id: <20221214125907.376148-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=kIDUfCKr; 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 Tested-by: Marek Szyprowski Signed-off-by: Jagan Teki Reviewed-by: Frieder Schrempf --- 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 | 69 +++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 36820a7b5884..bb3d6a7fa84e 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 @@ -1467,6 +1468,73 @@ 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, @@ -1515,6 +1583,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 Wed Dec 14 12:59:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2563 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 9FECF3F0FB for ; Wed, 14 Dec 2022 14:01:01 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id e37-20020a635025000000b00476bfca5d31sf1782001pgb.21 for ; Wed, 14 Dec 2022 05:01:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022860; cv=pass; d=google.com; s=arc-20160816; b=tThdXgx6mO3NI89ItESSaIiZWcle93yI77np+iTcTTcGrCj86HZnLFA6XhC9KqeUX5 rzwObljTa1jejrm7JyBmY/dktSrj5hhfSQVIeY3CbLMZcLXT8ClYZEO5t/RcG22IO7rC rUohFEXQRM131kV0u5QmghgdjWXl5sl78lbHPTFCOe9EPeLeZJkYLxzb94AhTK93mlCc LzbP9KUxt73AkvywP8QV0bwqwZ375e3VThiONEqmLMVnMOxmAOQ0y7sAR+Cp17pUE0ME ZNegsv5gAQFlNPAzj6qPDYMX0hyP2sWeO4WHLiRUWsD05zRP7N16y1rrao8d6o3vAXx0 hoyg== 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=JSwFOW3yvrUKNzw4EgibyOnIm0XXjYDsa0YaE7JkqZg=; b=Ij7j7ZTefqcSiebsF8tefL68Q4krsVYk4/cjU4ZqFIaWtd05sW1VjPZeId1+AXze4N pDlaPAxDQr4m99+kncGxy9Eaqxr/uyDOwvYbW83qpM/4fLIvb4Tq41zbQi0CIEk8jgRs U9cpkWAldCZNFjrw1TOuZ0Dv2QAxGwFWZX/BeThgrbiorN7ReBjGl18mClQD8p27cxsC 1DwKIy86J4b9D54ft4e9n9lmdUqI2xd+JRYwj0hqKxIIiH4sTmDlAGpmmXpHG0Et7YRY whVXFLy/cQCZY3iQHuVHhOybRNSahrAEmFN2MeemkEA0jycr8uQkROC76e5v3oE+CWzI 8N7A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Jq3ptjES; 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=JSwFOW3yvrUKNzw4EgibyOnIm0XXjYDsa0YaE7JkqZg=; b=Grl5S+d7x+3FlMwpQPBbXTOkHViHR04PlpZD6EfFhxYBCvNFIpA68k5fMlv/yqp6n2 QyD7NsnZOESWQSbSopuuTFjg4au2OPLa6fNGKidw9S+ZHEBtptAQqRP1OMN7A+TpAY14 MTQFC1ohVA712mF4N9KkBgmJk94ZqXVDCEeaY= 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=JSwFOW3yvrUKNzw4EgibyOnIm0XXjYDsa0YaE7JkqZg=; b=WQPSzg6GNZM6a+rUed0u99bYVRH7Mk16gVk+/U45nkiBYFG1loDUb4PbhlKcvz3xnc si5IGN7ZkK/GabSun65xu4jSOsHjqq+5gEyjBpB8JrGJfnHjAAlv+woQJt3V1jfi2fP2 VUbDhCwTB5aYWp42UxIjVi+vd+Oqj9/ekHTPwJ2thKHcmDHyWWYrHwYhqLG06QuNdeXx 2iYEgE8BWxDwnECRquk34elNSPwGl71ED6YZ889Vn5gNqhAQ9Okxi10pR9LkOoJP6Srb DPZ4M7iKpnQWDNoMkKbNUH0H19XNXrfzfeGpJYLGaD3RZclpapzCMVvEAqu0QqcAWIiC C3tw== X-Gm-Message-State: ANoB5pnWp6OkJ/TUqklLw7GAyNT2HyTshp+8XyTBogK5f+BndQFgI9gY eSXCdmu46MQuD313cCpTo0WyKPr1 X-Google-Smtp-Source: AA0mqf4PsrvcGOTTiX1YkxSXkiU5uLhTPxyPIhRuHXP8TrgZYxHg0L4gxIKEH8nnE7RP5ukfENSauQ== X-Received: by 2002:a17:903:22ca:b0:189:cca6:3971 with SMTP id y10-20020a17090322ca00b00189cca63971mr23193772plg.89.1671022860317; Wed, 14 Dec 2022 05:01:00 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:2848:b0:219:2eb:a5dc with SMTP id p8-20020a17090a284800b0021902eba5dcls26261028pjf.0.-pod-canary-gmail; Wed, 14 Dec 2022 05:00:59 -0800 (PST) X-Received: by 2002:a17:902:c14a:b0:189:6d2f:4bc7 with SMTP id 10-20020a170902c14a00b001896d2f4bc7mr24757409plj.37.1671022859208; Wed, 14 Dec 2022 05:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022859; cv=none; d=google.com; s=arc-20160816; b=aPfu0F+qhrz1rD7i9oo3zAfLPjnjKukjwvNFiISlCytVIr9OIJCnC+8F+kA5CJFXoG 5UpoXt42GH4twwIC/VXq3mvrJIVNXQLcLla9XrxrZKaHbzlwmsuJpOafHhvHjmgRv2F/ 89Ig7ILXqR8cThmwO2yOdpHOZpPkSTLARBkw+VktzMApfqFPQrwEEOO2sk8w5wt+MRU7 NQq3+yvzOBBJZblIyaxufg0RNNkpKdVA8QelbkvSXf8RBXgqu51a6OO6sgnbiQDrjwEW BnfGitDdrM+ptKqywv6N9A+8HDtMX6gfDQJ5lSoBK+G8t4H9F6g+pcCBzExPWa5rbS2A BOng== 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=ykkoMPBFg25R5qn07gjEHjZhs49sxOTu6Me4c71olVs=; b=w8yUYfRyrmY7zXYFX6yz1ug8FqgV3QQs26Ejh+CS2U/sXxO4dtHAdGDoFybJkfAlTj IIBaeQiaD7NiaC0y3+pNQZIGhQG8XvL3sESHOrnSxz3Py9CG9/DdHnIEN/kYzO2a+rCu Lf2tHLStj30rfJlm6nnJCImyagVIdO5WdGtdTLrqo6QULnr7ay7pFC4SyQmzpTD5YBTo W8nrYnC61nlJL6TuCqJfz3JpsGkonJbo8275GoL/NYGgGRQoDv/aljoV6UGv/T7ssE4Z vf0IOeURn95BMCc7hEmA/4mnM0H2cxofAl5+DU8EqXPrRZ00gsLGIf5MEQOf+RRh2kGl OiaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Jq3ptjES; 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 z14-20020a170903018e00b00189bf5e03a6sor1487653plg.77.2022.12.14.05.00.59 for (Google Transport Security); Wed, 14 Dec 2022 05:00:59 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:7b83:b0:189:b0e7:c5f0 with SMTP id w3-20020a1709027b8300b00189b0e7c5f0mr22677431pll.14.1671022858705; Wed, 14 Dec 2022 05:00:58 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.05.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:00:58 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v10 12/18] drm: exynos: dsi: Consolidate component and bridge Date: Wed, 14 Dec 2022 18:29:01 +0530 Message-Id: <20221214125907.376148-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=Jq3ptjES; 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 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 bb3d6a7fa84e..819131a36b96 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) @@ -282,12 +284,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; @@ -317,6 +326,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) @@ -1320,10 +1335,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; @@ -1597,9 +1613,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); @@ -1613,35 +1628,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; } @@ -1650,12 +1645,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); @@ -1729,10 +1726,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; @@ -1743,17 +1796,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 = { @@ -1761,6 +1814,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, }; @@ -1855,7 +1942,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; @@ -1946,24 +2035,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 Wed Dec 14 12:59:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2564 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 80E3E3F0FB for ; Wed, 14 Dec 2022 14:01:08 +0100 (CET) Received: by mail-pl1-f199.google.com with SMTP id j18-20020a170902da9200b00189b3b16addsf2499023plx.23 for ; Wed, 14 Dec 2022 05:01:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022867; cv=pass; d=google.com; s=arc-20160816; b=cBiMwC0M/N9TI4EypdJ1aJXLK0qS46H7CpraPAUXbRtgzxm1MqcYTRUA9e25QnHDXI QPZ0nUYQZ2GKtQSNLOr8NOXu3x5s54CxB406BA/SJ8EiPEw1Wy8SuHET4ETu/oqYuUQS +uj6ZQZeiYWBPlBnmzoeuH+w1RSj7AuBi41HlJJApPRKXNAeP7GhfwRzJPh8yUSEMYbz BvTnZf9NvDEdEsuAnJFVbxpbZOS34kv2HPs++O5CSzKVR1GSuOVNxWNu9KCCgHSPDgRJ PxFmkJYl5tDKPtn8hn74B0Gjav+6zM4VMwUDjQpP8cSF+NHhmwhCpCvEFVnUei1ZaZpK WfFQ== 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=u2z7fuZUJyAJQ+FuTlERnOvL5DrRXQwkVsDICGlSNM8=; b=ZTc1OA80BEs2Cbm0UymcOr1pVGRfhPc4hQ7dKNEq960tgdgDtD1On4JQjEYD5dfWAV UNvv+7Zij73vZ4zGseGpogOpdwojryoSDI8K9RRr5nAOSPDj78c9INgn7tQfeAxr5SrB ioXlyIo7PdRtHaWVT0fOZ6PI7hyF9pqzhlDbQuUYICVXpi8+KO2Fq3kuZ6N+tU/4BsAN W9W25UQh9JieIELbqwf4jk27XgPf+lPYJk2j+5KDBD4sPF1NJq3BjFfSvGrkw2GChDMB Xv+8xJJlyi7terZKN9HHEP9K2l4mH6Cbgaw5JC/qAGqqOFAxvr6q8BSdiaO7s6DLVowh EMow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=m56FT1oD; 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=u2z7fuZUJyAJQ+FuTlERnOvL5DrRXQwkVsDICGlSNM8=; b=TWeKx3snBRMCjE5oUzT7z43RZeOAoGE6ZT7Q1PJpeqRI36oyNTNLIVQhKKU6f2szAu y68Sktj4OUKeP+c5JOpuf1E+I6Ph+mtAXFHSwweuFwIfJB4P3MVov51VzrMul+126ngK UGMa8Ne9bNqhxZlw34HOvKPLZCCXonibFEzII= 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=u2z7fuZUJyAJQ+FuTlERnOvL5DrRXQwkVsDICGlSNM8=; b=ZrD7qJKF4jsLNvVbMKNvkcaW7/8NhYayYe9k9W4405Y+mC8egM+uLjpv+kM9Nd7BJ5 U0c04X2/3V6zTcq/7wmtBVHgM2T9Q0Ys5o5mvzbmeM/JUXBAn+4dfQx7Pv8RWDMWbQS1 or/iztuyJ6HibPZP+p22WYTxYH90LCkU8raZWOxdu31ecqMyOXXSBd95rYnBkYC/9vQA PfjsOQdUy2SqCrgH2urJL06t+kBtFIPqt+9Xudngwq8oSLDmcRVHoGkhF3lsgLzBP5MV 8AarXmM6BVuVPQnYfyIbAR6xVh/WfYa8gFlq7IeQVbOM8MlBKdAektv+m0NLxnMiLSSh 4gUA== X-Gm-Message-State: ANoB5pl1mCkNE9TDXTGQgGhShpuwJF6gdOlt2UR46IyQVdNHRP4L1Tq/ O6VtsfGz2ORRs4tYBY8ptX2TgvpR X-Google-Smtp-Source: AA0mqf7pqC3T+ruwTbBZQ2qfta7AMyHDoTk833lgaO8HlE45PEaSCf6qsjdMabciii2S92hFLCLKoQ== X-Received: by 2002:a63:cf4f:0:b0:479:45df:425e with SMTP id b15-20020a63cf4f000000b0047945df425emr766432pgj.116.1671022867276; Wed, 14 Dec 2022 05:01:07 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:2848:b0:219:2eb:a5dc with SMTP id p8-20020a17090a284800b0021902eba5dcls26261422pjf.0.-pod-canary-gmail; Wed, 14 Dec 2022 05:01:06 -0800 (PST) X-Received: by 2002:a17:903:14b:b0:189:596c:b20e with SMTP id r11-20020a170903014b00b00189596cb20emr23156212plc.48.1671022866419; Wed, 14 Dec 2022 05:01:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022866; cv=none; d=google.com; s=arc-20160816; b=jqKb9hh1yqD/LYbBc7R8t9JUneYRd0wG3Wp/yDppYLUzNbP4YNQXPCvYcityebViPi mtmLEQLrIZQOrvYVPYj7D2j7Dn+m82zM1SAaVdquLE5NpBune0npRyI2cmRx6ClBtaVP YsXlOh6PiIs1DmxAWl+hdlSEOqqzUkJMD6mke1+4rwKRsgpRaxS5wAw1jzKUwO4u4WiN gVGcrOPJlwb46nlHJvS/txmFynO+5TobGeSggFeakB3w32dQCBc4LWpCR4DZpEfS8EAY JC1mWYdsrinLXsv8DswMQTxdS5tdcuw9Rt9IjJI8y7jbFENw8bNLa3gYgOJpj0on2jyB 4rQA== 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=aGZeH2FdyQWuLWEBAEjslXzZMZhb/E1elB1aBOym2sM=; b=pAEsmaGss4Uk2Ra9yjt1PRX/vs8IUwf9ZgW5IgL9C++3PdqZj2fZoMTVj7XtI5jOex sag+b33N2fs/cVhRlDx39K+S6dO4X5DWAmdDNV0htZf7zQgj6mPNzREX0U/88/jhEaVd xx8o8h46At1+gk+qlAuEFY0XAW7xLEvCGEFY75puSTDo1um8oL/4+TcafXGhIcLl7pI8 IWv6fKMPrkbgcBpTt7Y3lqup0a5DEkwgcnacJZhK4BDXAo1dX4yUanTD78haZ8HAUj4o Y+WaCyeds2Ak4mWnYGOPUskb0jkTHXwtq3NceTbbGR+59unmT1ty3DZxkaVcCldT7j39 F96A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=m56FT1oD; 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 iw2-20020a170903044200b0018b5b4527e5sor1515553plb.150.2022.12.14.05.01.06 for (Google Transport Security); Wed, 14 Dec 2022 05:01:06 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:e8d0:b0:187:3921:2b1c with SMTP id v16-20020a170902e8d000b0018739212b1cmr25543764plg.55.1671022865974; Wed, 14 Dec 2022 05:01:05 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.05.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:01:05 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v10 13/18] drm: exynos: dsi: Add Exynos based host irq hooks Date: Wed, 14 Dec 2022 18:29:02 +0530 Message-Id: <20221214125907.376148-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=m56FT1oD; 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 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 819131a36b96..580e06595b37 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -291,9 +291,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 { @@ -308,7 +314,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; @@ -332,6 +337,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) @@ -1345,18 +1351,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); } @@ -1385,9 +1411,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; @@ -1395,7 +1422,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); } @@ -1405,7 +1432,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; } @@ -1413,8 +1440,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); @@ -2035,6 +2064,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, @@ -2045,26 +2079,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 Wed Dec 14 12:59:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2565 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 62E613F0FB for ; Wed, 14 Dec 2022 14:01:18 +0100 (CET) Received: by mail-pl1-f197.google.com with SMTP id n5-20020a170902d2c500b00189e5b86fe2sf2500771plc.16 for ; Wed, 14 Dec 2022 05:01:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022877; cv=pass; d=google.com; s=arc-20160816; b=s+MYiseUSl5PJ+5KrsKvbVD9oVLua67w+4T13yXMWmh99HFw7DnAnEVxsjms83aw9s 3Wj9g4qn+2U073BbTcDYjRTu/3sW8kba4Vex7SSQ/DST/UiDZWciIvTWcJGdW98BTG3/ 4KYo/1FjQ14Pt4HH1KfvlkTwrDPNQ0xZUHcQCNzaLV5lHs+JVaRdN3IQzk7zRg/aqnBL ASLubaTlv2v3xsA95wTKnoq5mrxi4FwrRX1NcAf/LcuMEyJ3FJDqPG8TfvzuXnUsxeuc QGPM8o37vkmQL96K5A7X1tkLH2eAl16aC8gJgPN0Thi5uFYl9bt8bqT+23CFY2TkaHFH WP7Q== 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=J1dShW/r769a8sbOD8CF1JgZXcIN13djOxGSm+LmUw0=; b=VzeQUO7sgXMYaLbbd2TvNM3EZEhwmQTMXLgGQYU3GyWN/HibomZIon+ZxW3IaGpSk+ 1ZaiNrCWnzq3yOeESjZZ6SG0jFlt9qpbI/l65jA0kfWgOqJM6MQ5zeiu3vzDftn8MKVd wpFuRNgbnkAkh5yqgTaljhN0LuB0uRCGff0Z4U7tEmHzpwGL03opQLOQ3EiLzX8vDKdD Bo3Ms9QA1zDu2ET+4PDLlwSIMTccf0Zg0/dMcuvtuwOoI4hHUF99teQe6aZwvA4rC0Im HcTitt3JjS2LuoRRd7uFFazQFcklhmZhWOBqTV7CXORM/B+VWwdbYzqiVR9BH4IIodkP E9gA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LtiYB6uc; 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=J1dShW/r769a8sbOD8CF1JgZXcIN13djOxGSm+LmUw0=; b=d/qsTTnzX3hlyFJWBls89VrmFO51TA4/0Uzb9kW8Jsd2939f/MALIH669l9J3J3qQk +AxNaknzwB90NjudCtJ+ktvHhnXU+EY4fUeoFtybOWJjXLkK+keNcQNOqV28KG1cGe8R 9KV+vgDG+ZX0vrH2lFouxOQjvsEhWEKbSdG1U= 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=J1dShW/r769a8sbOD8CF1JgZXcIN13djOxGSm+LmUw0=; b=xvSXu8OAPHUAb0f+V4W7IN0pVieXPhk2cODufBnBS7QT+nsIL6uhkI056zcHLR1CRM s7HwA/iEr1DSsLOv9g9K9Mb4YJTSzkeu5K37Ls3WY6HVQFpGdBbuOxXozETBN+E0dT9U Q2vXGl79m0oAx+oukEkBRqmvejyr72LizIj7Hau0+iJ8rdrrPQBdU9ZR2lkNYCQQOhnj PZy5/nkIvBb+HMK1oJ6YUq85n/YaBg6a66/8A3y/zSZLiZ2DIE556WmqcIvERppwx52t 4YaykfFljGmEN2aNxhPuvRtVCqGO/bTNb162hc9dNaBdQvIdKi6drVvAhjJ9dcX+8Ulz T35g== X-Gm-Message-State: AFqh2krF8JNkel2UqahqOJs5Nw0gDuDq/VAOL9SZ49M80s1OLPmndsKJ itjqLFF2EOFVdHPwym7WVTOqxcrY X-Google-Smtp-Source: AMrXdXtvGtHjVvQSwuuQxUeww2pfj/Ky1Nq6+zuAxIAeTy9Y1v9U6Qly/YPDRTX/ctiDdSa+Q/nwOA== X-Received: by 2002:a17:90b:3c12:b0:219:a032:1764 with SMTP id pb18-20020a17090b3c1200b00219a0321764mr278582pjb.84.1671022877126; Wed, 14 Dec 2022 05:01:17 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:f609:b0:188:b504:8ce4 with SMTP id n9-20020a170902f60900b00188b5048ce4ls22244494plg.7.-pod-prod-gmail; Wed, 14 Dec 2022 05:01:16 -0800 (PST) X-Received: by 2002:a17:902:6a85:b0:185:441e:2dda with SMTP id n5-20020a1709026a8500b00185441e2ddamr27151974plk.44.1671022876002; Wed, 14 Dec 2022 05:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022875; cv=none; d=google.com; s=arc-20160816; b=vgrpnLxMY0TGi964D1TTT3qH+K0wHV1kkL2QUxtQJjwlTKVBhc3xWzQirYUc47FN4K EI22DF4xnFX3hJGx6r4wOgBKkM2KGJLGkIUt+bHHTCCHpRV43Nqy1UysJuo1uY805IP0 +SYHgNtldmR5nkG1uQoz7ty3VUukfs6EoIJHtpR/NGjtX6cr5aHQhaI3ty3YYaZMdE7l GeOiA/VH/11oxGEAxvcm7777M3H52dwZFH7uko+cmYfAB+GAzlODP1wQ1W7g/BFR7IoN vgnZ3B+9ij3eW924Q5ubPn6kgLne0RSLlq1dfkXSwItewqan0v7T+GkAxk9IMfX5/p4A qY3A== 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=lucHguVepFMxW+Ybqm2lreoXjxhYOcY70Nki5E0lRnc=; b=buqvCHM6QCPMEUufB+wRbHu+jdQulBmTsFPCvEz5n4WzaFT8Mj5suWReFnvklpDMm1 znnBEP/nybrCbfdkCuhMe5HrdRWxe9eLqI2BNHONkjv0XkxA+0na7KjDbXGka+xysGGj 7VtYaLIzn2ZMqhfNE8zCMAyV/1IskKHAEtkja4zxhEGwm13ZNVsbllBG5C5wp6sXtmrg yB2eu66n/GU3YRLpK3d8JxU12oSbmNdjx1bGOBVQMdvRflMPKs3Gmz7q82UsRgSqCMRr zcd/IZ85hGObWT3Onhu8taNlgUipIpSYh3JlbI+b9lreTvbcnr9Q+cYX/8stOhOi+ecY FNWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LtiYB6uc; 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 l18-20020a170902d35200b001892eba0d51sor1440079plk.165.2022.12.14.05.01.15 for (Google Transport Security); Wed, 14 Dec 2022 05:01:15 -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:bb98:b0:188:6b9c:d17d with SMTP id m24-20020a170902bb9800b001886b9cd17dmr16033843pls.16.1671022874651; Wed, 14 Dec 2022 05:01:14 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.05.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:01:13 -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 v10 14/18] drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge Date: Wed, 14 Dec 2022 18:29:03 +0530 Message-Id: <20221214125907.376148-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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=LtiYB6uc; 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 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 | 1816 ++++++++++++++++++++ drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2007 +---------------------- include/drm/bridge/samsung-dsim.h | 118 ++ 7 files changed, 2027 insertions(+), 1937 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 f3edff6b1cad..9a37cce05062 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6675,6 +6675,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 57946d80b02d..8e85dac9f53e 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -231,6 +231,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 1884803c6860..dae843723991 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -15,6 +15,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..dd27935081a3 --- /dev/null +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -0,0 +1,1816 @@ +// 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