From patchwork Mon Feb 27 11:39:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2741 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 10D853F9C2 for ; Mon, 27 Feb 2023 12:39:47 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id d18-20020a63f252000000b00502f11fb2fcsf1770811pgk.6 for ; Mon, 27 Feb 2023 03:39:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677497986; cv=pass; d=google.com; s=arc-20160816; b=wmIrXh1EyUeo6aUbiWn+UT1nwlKI9cvVLFAhpkiFtFsD6EVfbmPqijKASArxdWmTai 8XUlJp9OJ6xzz3Une/ghQelzVOgF6mBj/nOqBl64YbfttnfrArdifZlCRkD22d0e+Kff JmWbaMD1L6sKREB4TLHDGqRwEUpwKfoVyoPgfwD2WPMysyqkT0KNe1ped3EyPZdmZrfl uBvM8RpbZuFQ+muqxV/Euu6lwucsP6WeXbbYWSJtRFfV3nu+6X5HsEqSBNbPNUls4trl VOrbgEAKT55pwQRU25B7H60ocP7RWkqATe97FcbLexf70z+CusXn1ZDWZtriQqV45RWE +m4w== 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=WEY6/o3Iz6e/T5XVcQP5WzEvCt/oldJnH9+r2evMzRo=; b=L/JGRwOuEYZ3sLl/kS8apS+ZBw8K32ODs+NBaFrNdcC9gAZohCAxugDR5g0pRNrslG 9FSdJKbz5K0nAorpqwtfC/3V7cAL/m1TgjtWhkQ+yOt2nbOlBvYvrObEjGBz0pjzlvcs IvgX3X55twQzOHKGEVkBUxgxazWP0V47zTc88z/c9nM39Mmxxjo0JX8xalZi9XED9xAv ngHOxKl56YkKgT+dhnMI/tTtb6WbgsWy0N90mBKkeaLYLtvtDbDWVblHtS2GwfALzyAC qt+NnEKZCKXphnOpNH8dHRmTzOR2zmfrcvloCCbZ//G9fh2It9GB+w7y1uQCpc5q3t0l HtOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=i5B0Fixj; 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=WEY6/o3Iz6e/T5XVcQP5WzEvCt/oldJnH9+r2evMzRo=; b=cCwSxSQuASuuaihAoHh9wyORfw+mg8RKnJsOelwr3pHQfdA/JjZvaYNW4zZKhU2J4e NXPmC5OcvU5ws0z+u/1okWY5v2g3RK4LSvlQvD6Ag8swaGRczlGKuVHg24qS9bBxtCIa wMRlsH6VerGJJ86jPG/aClEuQtM2ei7hRvDkU= 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=WEY6/o3Iz6e/T5XVcQP5WzEvCt/oldJnH9+r2evMzRo=; b=PAdoiplvCYXxX97EjbYPcMM7bmlylX+E/ZxUl/HhC878Jtn/yHZEPILs00zrw4Vb6S JO8vDtj0qmypjWHGooadAf1A2jRstSRQ8YEVtqy0Z6pc+xBuDjgnHjVevqC1t5X9wE0n vFPHMZ1NwS91dP65uu1mp9f7SrXKX0Grb+rgUavBn831aw5Kt59iP2oC/b1iUmnIv/zy ka43AjPn8PcHAH2mVHDxakgI4/2RZKrP6A8tfV54L+B+8Bf8XE1BFZfWDMy+LJvvECZ/ AuNVwOXQnf6Uon2pDocA6uIOHYu9thgB4Ic+PoEwaCXh/Xrz1WC+W3/v3TgCBs/pAbvP wSRQ== X-Gm-Message-State: AO0yUKURPkI/FPaX8iZ+qmcmXsEp61QVTZIAOFspaSSq6F2WWBqoiJZ5 MLjjHf629k5/uHo9YVrwzFZLOu9NgaWqYg== X-Google-Smtp-Source: AK7set/5h+vwoa8EYlLORaPgOSH2xHjv75ZmtAXRqPEb9RT45ufqsl52NQFOwBL9xKqDAANJNFagUQ== X-Received: by 2002:a63:7555:0:b0:4fd:4602:1b9a with SMTP id f21-20020a637555000000b004fd46021b9amr5880466pgn.9.1677497985842; Mon, 27 Feb 2023 03:39:45 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:2881:b0:225:cae6:ff24 with SMTP id f1-20020a17090a288100b00225cae6ff24ls4577586pjd.2.-pod-preprod-gmail; Mon, 27 Feb 2023 03:39:45 -0800 (PST) X-Received: by 2002:a17:902:fb8c:b0:19c:f8c9:4dff with SMTP id lg12-20020a170902fb8c00b0019cf8c94dffmr5567252plb.38.1677497984957; Mon, 27 Feb 2023 03:39:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677497984; cv=none; d=google.com; s=arc-20160816; b=wUv9HLEW9MMZbN2/pGkKYAZ0fdw2I/66PFJVoGZp1HfrmnQWXFBNRQYu5fuUmGQRq3 fs1XFn8nhPO9iTjl4cbJ3TNY5OpZuHOn5Ojo16VSkvLr7BcXNE4nxMvXlQOBdUPfN4rH bzQXf0vT81bB6uyQ84cKof+BTxY2qEW4m06nnPCNDXSEk974U349zZ8nEvLP4zPNyNTM LiaxNOxrMeq5LYb0tN+dkeakYLdB0rUgh+YBorOcmFDMKlXIPQkN8kXuCdrlZz3fASv5 t6NLY7jqh+l2i1TO3GTtiDIje1R4cHtK+PIz5iUadu2ew9/ob7GT8NVyTZ9YPj5+Snzs LJVA== 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=gbvjHStPQvWuSxXASASmwsU09AsH+4vOrw1mjy5ckwY=; b=BIo0bxaC0kpbojKyzyYNqKY9CQAmPN5L1SPCmIKuYCfVoCd+UP/qYOJaw7lh+UATER DJE+HGXeQAUyMxiYPAwnn8pHx3KHK9QRFgsjFfOXE30a4xePvux5SjDSr3ajDz2Bz0lJ CzI4SGML7ZIuA/AtUHOpP5o5I6/BaoZIrtQ+lTWv/mpWgjRU1mb5tQJ285zbSZOMnauj Wjae3qK3ao5+5iv8MMiBVj9prfU7gqwt3R707sKRTMJ4fQW7168r5vSOcHfJaHwE0Zri XgW9mR2Zxn9TcM/2S50D+u94GB1KRQjCuN0STMFTlhMSxDcB0bnSo0oTG8vcC6BeLp0t j3uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=i5B0Fixj; 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 je9-20020a170903264900b0019ac76a59b9sor2139109plb.169.2023.02.27.03.39.44 for (Google Transport Security); Mon, 27 Feb 2023 03:39: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:db0f:b0:19c:edcd:26cf with SMTP id m15-20020a170902db0f00b0019cedcd26cfmr9443714plx.61.1677497984630; Mon, 27 Feb 2023 03:39:44 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:39:44 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 01/18] drm: of: Lookup if child node has DSI panel or bridge Date: Mon, 27 Feb 2023 17:09:08 +0530 Message-Id: <20230227113925.875425-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=i5B0Fixj; 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 v13, v12: - none Changes for v11: - drop extra line Changes for v10: - new patch drivers/gpu/drm/drm_of.c | 112 ++++++++++++++++++++++++++++++++------- include/drm/drm_of.h | 12 +++++ 2 files changed, 104 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 177b600895d3..87cfd685318a 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -217,6 +217,35 @@ int drm_of_encoder_active_endpoint(struct device_node *node, } EXPORT_SYMBOL_GPL(drm_of_encoder_active_endpoint); +static int of_drm_find_panel_or_bridge(struct device_node *remote, + struct drm_panel **panel, + struct drm_bridge **bridge) +{ + int ret = -EPROBE_DEFER; + + if (panel) { + *panel = of_drm_find_panel(remote); + if (!IS_ERR(*panel)) + ret = 0; + else + *panel = NULL; + } + + /* No panel found yet, check for a bridge next. */ + if (bridge) { + if (ret) { + *bridge = of_drm_find_bridge(remote); + if (*bridge) + ret = 0; + } else { + *bridge = NULL; + } + } + + of_node_put(remote); + return ret; +} + /** * drm_of_find_panel_or_bridge - return connected panel or bridge device * @np: device tree node containing encoder output ports @@ -239,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) @@ -260,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 082a6e980d01..5e0d958121ce 100644 --- a/include/drm/drm_of.h +++ b/include/drm/drm_of.h @@ -49,6 +49,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); @@ -101,6 +105,14 @@ static inline int drm_of_find_panel_or_bridge(const struct device_node *np, return -EINVAL; } +static inline int drm_of_dsi_find_panel_or_bridge(const struct device_node *np, + int port, int endpoint, + struct drm_panel **panel, + struct drm_bridge **bridge) +{ + return -EINVAL; +} + static inline int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1, const struct device_node *port2) From patchwork Mon Feb 27 11:39:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2742 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DC4A03F9C2 for ; Mon, 27 Feb 2023 12:39:54 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id b21-20020a63cf55000000b004393806c06esf1783395pgj.4 for ; Mon, 27 Feb 2023 03:39:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677497993; cv=pass; d=google.com; s=arc-20160816; b=auSbhyf4ZTnpgnakyP6qYNlwhdVlJyFr6B9iSQWPiKDeFT9XeIR0JczNx6r3Ss5+a0 aI9eXA2vNOabDMV4HOBF0LFyEQN5HcAQZFaMFTb+eBc8rJISrCvk76iCTbV133YSN8sp vtmcJRdtgJuMGfJNwDcW8l1DRyv/pOf4UBi72wKUCBV4kuF3JP9W9HjX/JM4HPD3ZKPb WgPpnWEFi8ouvlY4RSoXmONmZPdFkaLr14e2IWCENF38loW/HKYRcLYhlzJ1NE/A3sY+ bYD62SjgHx9fH2rY6DTp7fZxLf7ieHrYWRleAHG32KaFKzILphRlE4Z/m1XXPVkx6hLW byfA== 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=PXyMaYakWpzeHxDItJjMLvVDwLUKRthExKSMycQHk94=; b=G6glJLkuNz0t5Q/3Nw0FNWAN3hufvBE3RiOmBqcpRWluALOcYs+jVevEgoS7hyUTF3 J0auHTJRgDQaZHoSmPkv3tbpItPXB2RzzRACcZ4oFxJemEy/PWgDs+uWXQ6jESz592ta +lP6oyJB8caSiJ5yPVrorVDxstQpXi3IrflnN8j/D5jHGYF5fVZFSJFJy0ZtHGl5CPLy 0L8kSv1wHYGMUp1xx/fDWTeZ1S4/+K2X6yxEXKgnrOWkaNwHYZPRUjboSmErJSjXtXNx lIHKiD+RrUc2bl5LTTxnoCwBattc7PKCbCR7jvhRMkZPMJcD4tgwCiwNBrjuZFRvBwMG BmYg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="XO8VVmB/"; 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=PXyMaYakWpzeHxDItJjMLvVDwLUKRthExKSMycQHk94=; b=ffmLgU62GE0VRaBoD9j3hd0y4oHbNS8bdz8MZDLPFMeudCqrgIO0pKH0zdeQPvETKS +xEkNSqXbh+DZavUoRu3/8Z35F5e4oKPpqEm8cdZUAnqMRHfUryzuXWLJ+vca3MdUM+5 rEBbsiIx3RlwBorK48/03ICp9tPHQcQ/bFTGg= 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=PXyMaYakWpzeHxDItJjMLvVDwLUKRthExKSMycQHk94=; b=aJOeuIvigJsWPpUea/VIPfPUaEhesrkgsz6xLcDpk+ljFtwAreUzeVQi6W0KlNYnQl 6vh6SM+Q7gHBrBbxe201V58R9w8qbzFUIOVbeHxGMO24s+vucViEItGAbUo2X8b4+pST mZLGdy/XryF4FF9Nz+U6nelWTxZrJTkXTcJT2V0CsZCzSDAI2xgQoppUVirJw/6LNN9q /HIsHSCSfxeb8dGgzeP45Ft65+aJ0VPmEWBB/vzu29hBKh9xGGBt5yuN7v35m2STyP/o J7D+grsFkkHt3K09IFqUlJQHQ3lVk6NddQZGeuvpBsB6kJv2ESCr76vKAsXwih2daXUD pOJw== X-Gm-Message-State: AO0yUKU//g9pQuF5ysCul89PbgHLPaA2EATs/DJqTxkfB9JG3Hr/+bEh YJV63jZT85GMhsHXFmK0LTEfxvoT X-Google-Smtp-Source: AK7set+O4XfDZn6I9j8o022UnMQ+r/vihi67/i65ixg5Aw3Xmnk2WoaexejScSiZ6YgaYImrBnzbNg== X-Received: by 2002:a17:903:48e:b0:19a:e617:34ff with SMTP id jj14-20020a170903048e00b0019ae61734ffmr5897362plb.11.1677497993547; Mon, 27 Feb 2023 03:39:53 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:2881:b0:225:cae6:ff24 with SMTP id f1-20020a17090a288100b00225cae6ff24ls4577643pjd.2.-pod-preprod-gmail; Mon, 27 Feb 2023 03:39:52 -0800 (PST) X-Received: by 2002:a17:902:ea07:b0:199:33ff:918a with SMTP id s7-20020a170902ea0700b0019933ff918amr30482450plg.21.1677497992592; Mon, 27 Feb 2023 03:39:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677497992; cv=none; d=google.com; s=arc-20160816; b=Vb3VcNw4sv0mO6Rm55mTiBhirAT974e+gU11AiSlsd5HLHDqxU2kokiihcWILqylAk byP9kDDck21j/qj4bZKDa/S4nYk1TDrBmUF6d8DnfC+viXSeqzH3bKsWuLvua6SBr/5W AHDXnE2g+gWeVE5c+RkigpFw86+R7r1+asI6TpLFJH6NYzhgLVpFkHbhirZ3uVCiRNHr +k8ben0B+qCvLwR1wDbMn/OJbMjapki/jEVsAPrIGVP/MbFkWxhIUEkqNQ9jGarB+8Ty okFNV95vxA8v8uJ4zjtQNaWukT/vt2RX8/robEEqQWp7tRSIJco/ff3APG87+L2hfWeH rnyg== 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=nuq+y+HWw18yw8Sob2qSkhl5lK1AxCLgf7u71EJPHEk=; b=tHkph/G+HoB+qewaJ1mhPQ//e10L+LLJIxysSdu4R6P+AbghYp0OOuD3JfjmHJjlT7 VeWO5IKW6LIUv7Cs1E0CJXQckTY19R5VMXTFMF2js+zRzO9wXaFqViSHleEC/SEmEtJR mpYN+fpBkgBlVxu0gf9dDVWbWGSzkNGSKGhrPKEDrHpXPM0shS9bATL68WK8uH6FlFo6 l3+5j3aUOk6I+mIFjuCRtSTvUW0SRKvISsXUzEgSi/m4DhzAtr50RJCBY+5KvcAqrBDc 5jgxBIexgLw8l3kRwugT+9nam6YSPZYkh7A4DIh5HFqOiFNN9LJyvb0ASJtQXtTS+Luz JkrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="XO8VVmB/"; 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 d14-20020a170902654e00b00198ec2df868sor2286990pln.121.2023.02.27.03.39.52 for (Google Transport Security); Mon, 27 Feb 2023 03:39: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:903:42cd:b0:19c:d5c7:9401 with SMTP id jy13-20020a17090342cd00b0019cd5c79401mr9789215plb.52.1677497992292; Mon, 27 Feb 2023 03:39:52 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:39:51 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 02/18] drm: bridge: panel: Support nodrm case for drmm_panel_bridge_add Date: Mon, 27 Feb 2023 17:09:09 +0530 Message-Id: <20230227113925.875425-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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="XO8VVmB/"; 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: , drmm_panel_bridge_add DRM-managed action helper is useful for the bridge which automatically removes the bridge when drm pointer is cleaned. Supporting the same on non-component bridges like host DSI bridge requires a drm pointer which is indeed available only when a panel-bridge is found. For these use cases, the caller would call the drmm_panel_bridge_add by passing NULL to drm pointer. So, assign the bridge->dev to drm pointer for those cases. Cc: Maxime Ripard Cc: Laurent Pinchart Cc: Linus Walleij Cc: Maarten Lankhorst Signed-off-by: Jagan Teki --- Changes for v13: - new patch Note: use case on "[PATCH v13 04/18] drm: exynos: dsi: Switch to DSI panel or bridge find helper" drivers/gpu/drm/bridge/panel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index d4b112911a99..45a0c6671000 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -402,6 +402,13 @@ struct drm_bridge *drmm_panel_bridge_add(struct drm_device *drm, if (IS_ERR(bridge)) return bridge; + /* + * For non-component bridges, like host DSI bridge the DRM pointer + * can be available only when a panel-bridge is found. + */ + if (!drm) + drm = bridge->dev; + ret = drmm_add_action_or_reset(drm, drmm_drm_panel_bridge_release, bridge); if (ret) From patchwork Mon Feb 27 11:39:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2743 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DB8693F9C2 for ; Mon, 27 Feb 2023 12:40:01 +0100 (CET) Received: by mail-pf1-f198.google.com with SMTP id w130-20020a628288000000b005d1f4325e2asf3267019pfd.18 for ; Mon, 27 Feb 2023 03:40:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498000; cv=pass; d=google.com; s=arc-20160816; b=OQ8xwJmzDUJE5KlA/SdxvsP2NaD0VxMYtvzjCkoIa45jtU6/PNJF8x8Bsol5RnMOUj kUaBE2Sa0ouvYJqMPSlesUcoQUA9/DouTiG8QDbDcUJJCo6Op9kom2OTTEqqiewdXMet DwAkfJXX3his/H2G5p1RyLEphp6/s76UnHEDvmnoMDR/aWgOn71IgOuPl3Gxf8OOPFcq rkrSgf0GuAaTNwvgSl9lQFOZJHpDMMyq8JDJxhn3ZB6R5O4cmmEVicluWNw8SlTvM8PX Ho7BSHCjNkmOmp5gMymiDKXkqqKL+47WTc+pCeNoaJsuOzwNQ9gYflsJRtf30bYXDPQS aLMA== 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=DYyZ4T6AqLU+WBD/NZJS+mINVVxwGX6hlJYiy1HMJ14=; b=vhBcz+E/9FBn4Gi5hST79+f21ubm89gxoH9NzBl7wmrtbGwlYXOW0Yslt0MMQUqK0U z6xySGIq8clWok/Gjtdm4920CTbvsqxiH53Y3orZAYzl95vPjevSfJw0Tas0xU3PeAUI Mw6eCJb7l2xyU9QbP5XIHyIQ+RF3cpg91be/EJBNuQ+jHNYEI5iyW6gy3JJyja54zQuI 7Wp6IzTQAJ6FEuyKlu8u9CKt4CKgdQQ/S2bL/2U+bd+oCZk0IEu+zhOY/7amvqxdwoe0 ZS/ttyz5b72Flr12SjsxpfLmLoGZYvbGlyH2Zh6WToOoC/ucAN0O+Jqrh8EMctZ/8XuA fqvQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eZ7KZSmM; 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=DYyZ4T6AqLU+WBD/NZJS+mINVVxwGX6hlJYiy1HMJ14=; b=myzfQWfRBtovOTDacVDhn7rgkAb2gTb0lRVb7JSkaNMamFwic/mNMHCfH7r4FmLhFa 8wV7lSsf4WEVAgr6fmBTJEeU2t9h5kVKlhGSL/Xb4pgM9N0e1t2ea31Vb4ey5JhGCwXa 9Kunz3Dwa9skJMs+6Z7HzATEPIPnyHBEXbshw= 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=DYyZ4T6AqLU+WBD/NZJS+mINVVxwGX6hlJYiy1HMJ14=; b=TkvLuRSYJ5OtW85AkEyp1h/HDMcaz5pXguON1DznbcmPX1wqUt/NigQf9Pf5YPu9Ke AJnNTmAzdhPhe8E/Bu4CLqYxa0J/PDlxYeafJY5Z57s8qRMcBuaViJ5O2QM0s+9aY3pP 3EKD7vBEAe2r2E/lwwP+jZgWR/uUkL48oXcOYhs9crrbO3VjbJZiDPLfqYoTj4nI4336 U8zQWCAeWWYZZ+jwfwpBnmKlokcXIZlmAYoMdeKrd7y9QrMcEU6wmgHawSOzFP8sKJzf KrVu48Bwq2sQs90FpO3xcsRhDl1Tl1SaLCwrmFU0eK+g7FPwFBVkMzbyMPi3UgqLtqTA E63w== X-Gm-Message-State: AO0yUKW5YzZcxGpRAhW5rrUgHqaIgp3RvVJVk0T6vPX1elEtEWgE8vUa NviI9El2BmdLky3GmdaJIvBXwy3B X-Google-Smtp-Source: AK7set8UkjR/PvV9Ki3I0/EpGOWP5cTImKuryta5k5+tvLkrqKAkncjKo+qMU5IF46yurmbh5sItUA== X-Received: by 2002:a17:902:f784:b0:19d:13d2:550c with SMTP id q4-20020a170902f78400b0019d13d2550cmr1101852pln.10.1677498000627; Mon, 27 Feb 2023 03:40:00 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:224d:b0:233:cf4f:61f4 with SMTP id hk13-20020a17090b224d00b00233cf4f61f4ls14519465pjb.1.-pod-canary-gmail; Mon, 27 Feb 2023 03:40:00 -0800 (PST) X-Received: by 2002:a17:902:c40b:b0:19a:5958:15e7 with SMTP id k11-20020a170902c40b00b0019a595815e7mr9897350plk.15.1677497999687; Mon, 27 Feb 2023 03:39:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677497999; cv=none; d=google.com; s=arc-20160816; b=RjzE0CeRjMrPCmRhTRa0TC/6/bGJxESl/7G+j9cV1TSzhEoi+rgWFodZ4YrHUFQNa3 rVbFR1bmpftFHITLP5SJva9SmbSju+9eASzvxRgO7FrfEJT2TnK8SU8n48eTQ2mhN8Db Afgv3DnEhLQFaZTwf0hbZXboYtNTNelbnArkeRMlXCrcfaJ3ELDWsGCImwjDzcBBQ5xo aULA9Rve+GmSuVnoccxiu2BFqT5IwmuETqbyT303y/VCjyyCkxdkwiQ1USL2u5pto9hS bZrKt/j7oBendb1EEUZ1lrRNgYpZ87e+zU/hrWgufpEmKLyAzz4hh8bUBwJbOITP3N7L 649Q== 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=+rsXUA1KC0Yo0ZaAbDx/BQxkAqMf2mzDgWqmsD9i/BI=; b=Zmbe6KNqoRmobBW8QfxBk/FHB5cN1gokZ/ILwNhguNXTjvkTKv3p46o8DTTIarU0oI 1Ef5l42b4/SgQKwbZCe6nMibYp+Ye5SdSiZaXEZZ49ACgVRuO8EVL3UeXlT96oNOE+rO ZBO0kLiRobd2AI+d8MVXfLA2X3Jfob+MRgETNiHkMHUxC6NDwphfPlEGe1TCN4Mc8nBq mOzCCAdGQJyKKKsulpNayZYRQ4giGC+cNN3mpA49/NVkUS89F6mc3phOjp1R1DPjIaDi SsR0fWl5jBqPqSLCkVphkK59xeBJEgxyHdlf2L5GDO3yHw1H71V+W7CKuuE7IerM/uUy V+ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eZ7KZSmM; 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 jk17-20020a170903331100b0019926985134sor2291691plb.147.2023.02.27.03.39.59 for (Google Transport Security); Mon, 27 Feb 2023 03:39: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:d2c6:b0:19d:1dfe:eac8 with SMTP id n6-20020a170902d2c600b0019d1dfeeac8mr1802046plc.26.1677497999350; Mon, 27 Feb 2023 03:39:59 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:39:58 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 03/18] drm: exynos: dsi: Drop explicit call to bridge detach Date: Mon, 27 Feb 2023 17:09:10 +0530 Message-Id: <20230227113925.875425-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=eZ7KZSmM; 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 v13, v12, v11: - none Changes for v10: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 06d6513ddaae..df15501b1075 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1531,8 +1531,6 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct exynos_dsi *dsi = host_to_dsi(host); struct drm_device *drm = dsi->encoder.dev; - if (dsi->out_bridge->funcs->detach) - dsi->out_bridge->funcs->detach(dsi->out_bridge); dsi->out_bridge = NULL; if (drm->mode_config.poll_enabled) From patchwork Mon Feb 27 11:39:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2744 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DA71D3F9C2 for ; Mon, 27 Feb 2023 12:40:08 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id f11-20020a6547cb000000b00502d7714305sf1792745pgs.13 for ; Mon, 27 Feb 2023 03:40:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498007; cv=pass; d=google.com; s=arc-20160816; b=VXsKYYnFUQoqnM+aTLG9FsKz6HYdPqjTeoWfOvslnz7OTeEhugxz5biFxPkUcRFxEJ SoHLFamxvX+EvNmCWALal+wrXN+SDAmomonAltcNCx6FL49gRzVqV0X6G/AW8MEXvsZ5 8KhYeaVd1Dj0IJnZtyfAcFwV/ISf4DJi5aPqdbSd//T5Tsl1m23ATk4OqEmalNEWBQpk RCA9itCuoJqJZmetlzXp8+z/V8ZCWQEbNIC27vjyIghgtNcWPjsdJOCFmDuxpq+M5MJZ B/hzzZBDgj4J+hcy0f0DvBnbJC2MUVf+Jv1zhbPiAUkln0rgk4sUafbEB870MWpZIaae D/dA== 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=B/g4lyoKuPyo7cWDrL7y5OOBPb+i0JNUyygSvIr8QmQ=; b=CXx0sQ4an3fu7XgWP0/w8kQIHwfF4phYdQ9KVzRPlk4RvEzLw6hlZGOtpGxzi0tMnx 6WBPdBH6Pj3gJxJUqDhaWHgLcKdmh1GHKXTcZWnpYxN/ih6Ag9GworDu2K2lETFG9Ho/ Pb6HHFR6w25zUVsHEpz+8Y02LLVixObPWnOf+dmHFske8uvNDqKqHEix4pPl/MiZ+nkD mZsdyoVAWV7UMnVlJRaxH/D4PaGwnbO2mcpsAR6HPah7ikonuNfolVZz+qHnfkFKl+JP i5ktvbv53mIRNjj0+Ropo+QUnyozQI068lWriEAyc/JWLD6AVl4SO7Cxf0HUmoRtThQO wjTA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gPmtRl7o; 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=B/g4lyoKuPyo7cWDrL7y5OOBPb+i0JNUyygSvIr8QmQ=; b=R+BTVLwANkX4RNZ7Zb7tgWE5MIjvCVR19zA2Tx8VOG7WeDK9zMwaEomQPZigL0EtFP KuO6NsIX1UFsIFy3DdbWM/oihyoh/7KvxJszBUCAM42qc+YYvMlZFWszDcWj3ZM6kcez 9+rF9fdQGEGu+SCOFCN8TJzzwP8V8h/YqqOTA= 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=B/g4lyoKuPyo7cWDrL7y5OOBPb+i0JNUyygSvIr8QmQ=; b=u1paJnr6uXiEByAno7cagyj6wScsZqQfvqIpsRj0rbDkML6DgrrzyUgNC90qMBq1Tn iX9LGNIpP8gRyR2ckp7IUFiMt1k5CurHUiiCOdlCRAZytQs2PC8pucrkeTpvY0611q1m gh+AiGoMnb+4urtU47uxESGd2wiHrCWFnGsxTkI2ImjuLFfnPv7o763LGTgaleX8d9TK 0hYIZRsLXRP7aOBDq17CsGOc9JIjBf9sTHBjRKuwrqQ1792Lr1ERhjwbkpxFvY5kE/Vc +PgXkC+POTW50n+xrHLqVFrg/y1GcqZlqwPRVmmah4VU/K//YQxDZxL8oSBRxzPW6z1A U9Ig== X-Gm-Message-State: AO0yUKUYO2U5lYLnkGZ7DSM5cXNtYbwJcrEXDSmZT6jqKtup7EoCH3AC 5gZv1JAMwZJNUIHsoiWEUDYHYDkz X-Google-Smtp-Source: AK7set8lSrludlnCV2k29fJ2pTGzyGMi5+DtCYm0gCsaQ1pk3ecnrqWR/Ye3IC9m16GfjZWM9OBuiA== X-Received: by 2002:a05:6a00:2451:b0:5a8:5c7d:e4db with SMTP id d17-20020a056a00245100b005a85c7de4dbmr4342579pfj.3.1677498007551; Mon, 27 Feb 2023 03:40:07 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:f542:b0:199:182b:34bf with SMTP id h2-20020a170902f54200b00199182b34bfls10521858plf.3.-pod-prod-gmail; Mon, 27 Feb 2023 03:40:07 -0800 (PST) X-Received: by 2002:a17:902:ecd0:b0:195:e9d4:5380 with SMTP id a16-20020a170902ecd000b00195e9d45380mr29076642plh.56.1677498006626; Mon, 27 Feb 2023 03:40:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498006; cv=none; d=google.com; s=arc-20160816; b=xeRAl/TceoFGzcNrqJIAxnHjvzsW9W4mHTuQf1TXOSPfx8b7vlJuhinJeej/gNGEOA KWty7x5MI9rzUhmaE+m0UvZWMii+z7Afjky28Sf7ypOzoFzxdtO6a1Tsz32qgJ0kTAWc 5eSu9XTo8K52TRPoEXyIHCZQwDmsZD8iEMCxhdAcXRL2etd3SDDc+DfsMES5sWzH7rJG mIyL9lME3+hLKzuJYxZEQKtki288ov0hP/qDZhd21M2El6r1wtn+xuYScOBBLf7dI+VK aFzdGu+md4c2dhnYgK6LnTf5sYBVT7rHk8pnO5XLDnesEhASxW4AicyL1dzvsiUEoWf+ dv0g== 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=N1ZnzcX6mJcklgIlxO4H+jhNQQoX1Q7wrMHIRpiIlXQ=; b=ElrvaOLcdlLhcUUtlzcs5ROwtzSeqPYx7H+2WB2FTz5JBbPTHSkjoQuEpe7jxrj+Td JkH1kQgU2W7ZJhsI4vgznplbEkg5aXfn+zrNCt+yhXw4/rGEJ1ZxkinjOb4yky6FNhE8 B8yqrzXkyfQJemZGmzKGz7BFQc9WFei+c3xOSI9bTE5gzJyI6IlyugbWst5K13ScsTHV HVB2ufnvvz0fakZeMNfpe4zq4bXEVyJL3mJdEnaWaJnSnG1YnnogEzRtyp2pJZNp7LSp tDPWIU7URsBhLqFdSZzn8L+xJW4G/b/Z5MHec2yS9knYQW6jd6L8vqMq1BwIn460Ei9h R70Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gPmtRl7o; 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 iw19-20020a170903045300b0019c953917absor2131362plb.17.2023.02.27.03.40.06 for (Google Transport Security); Mon, 27 Feb 2023 03:40: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:d48b:b0:19d:20d7:d51 with SMTP id c11-20020a170902d48b00b0019d20d70d51mr1628482plg.29.1677498006324; Mon, 27 Feb 2023 03:40:06 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.39.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:40:05 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 04/18] drm: exynos: dsi: Switch to DSI panel or bridge find helper Date: Mon, 27 Feb 2023 17:09:11 +0530 Message-Id: <20230227113925.875425-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=gPmtRl7o; 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: , drm_of_dsi_find_panel_or_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 drm_of_dsi_find_panel_or_bridge followed with drmm_panel_bridge_add. Signed-off-by: Jagan Teki --- Changes for v13, v12, v11: - none Changes for v10: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index df15501b1075..12a6dd987e8f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1470,24 +1471,26 @@ 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_bridge *bridge; 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); - } + ret = drm_of_dsi_find_panel_or_bridge(dev->of_node, 1, 0, + &panel, &bridge); + if (ret) + return ret; - if (IS_ERR(dsi->out_bridge)) { - ret = PTR_ERR(dsi->out_bridge); + if (panel) + bridge = drmm_panel_bridge_add(NULL, panel); + + if (IS_ERR(bridge)) { + ret = PTR_ERR(bridge); DRM_DEV_ERROR(dev, "failed to find the bridge: %d\n", ret); return ret; } + dsi->out_bridge = bridge; + DRM_DEV_INFO(dev, "Attached %s device\n", device->name); drm_bridge_add(&dsi->bridge); @@ -1531,8 +1534,6 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct exynos_dsi *dsi = host_to_dsi(host); struct drm_device *drm = dsi->encoder.dev; - dsi->out_bridge = NULL; - if (drm->mode_config.poll_enabled) drm_kms_helper_hotplug_event(drm); From patchwork Mon Feb 27 11:39:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2745 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 8C8DF3F9C2 for ; Mon, 27 Feb 2023 12:40:15 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id n1-20020a170902968100b0019cf3c5728fsf2867846plp.19 for ; Mon, 27 Feb 2023 03:40:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498014; cv=pass; d=google.com; s=arc-20160816; b=qzYF1AxNU55xvQ/P+WWGP3SRWUkyMI5T5vAprTdTeTjpe4dRfaAK6VpZY+BMK4QTCZ 9meePGwf6LArrCzllUcmQQidAtbC5mdT7+J1MJI2s+CDI4rZ9TbK0blvQDbTiLI8oihE mWfOfrOVKk1fNm8IjCxb2mM8h+Df9+5OVUhK4Jil1fQk9WVa5on6fGoo+bMHQaJsUu5+ n0qvA/Z2XdTq422rWDXijeP0sICaw+wSKE5uUgFMba5iWfHClcttidx2uRSx0ev2fLRs 2uqiLBPXUEUP7bqqGNDyBk6y9WPfwtAFD1E1XYof4UAu4cihCAM60xOQRLcS2ICn/2T3 v/uw== 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=okoBAF4yOzmR28bddkwN/FFAF8GdvfEdC4GHslyh6uQ=; b=pzgnG9vnhfsThnz3vAhTE2rdSlYal84PTjH5Q/2RmuzP+eXe83yNvYeiARsIsbZBMA amq6WMpadPlrcTeLJTKHSDPe2hQw1WbIWMA/gwLtfJc1PfT758g3/W6HycEeOHJAE8tC z2x0jtpcO5WE1hrprspjcg+LmC5mYuFWyLYvbB9q/I4py9qMcO9MhjGtoPVcQGdSJYr6 6G6+4dgCFIslNxGZWJ1CFGmwkmb+gI8yFXTZPWG8/P/lXZ8OmOWWMqJM1jKPoA0JeXBb teurI/qMaWWEeQ4w0KtZWZUdc8RsUaGxCS14XoVOngDa8GcAMi9Tt0QEJErxLdMgzkcO x+Ew== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rOiJ8pyf; 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=okoBAF4yOzmR28bddkwN/FFAF8GdvfEdC4GHslyh6uQ=; b=lTmgbQsxP5Gm4g+c/Md0GUw1fRcK1o4UUBd8rrb1CUmzexNacZXtE0MaurO4bzpkPM isguRPFDVJS6/GJx6WHJo63LxhyyQLvGe8bFPmMMdVronucegctloMwCPUB48kWMtDA9 Q2CuVYDCf5q6CDsjqmmF3J8UzLJkTwyEVkfjQ= 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=okoBAF4yOzmR28bddkwN/FFAF8GdvfEdC4GHslyh6uQ=; b=Y+3DouoNP4dC9Ce+gCF160OPPlwtwzirRxCuTsviLZv3ey0NqVmqTvO7HbdkLMVj23 lPXW8pHlaMVve0Ad4EM2lJPqaLu40uxjy02TONUywgKPpQghwPIvgF4fG+heG1hN4SnH Eh+IXutjZSk1xzH/OCGWcES6UIf1Q3wX9TmCS6IZ+O3rGxq2Wd4hzCq+ZYzQ4RQyKiKz zGhlp6xEQdYNy4L7kjrlJUA0gvdy3SBeB2u2VLcxA8l9YQkydJnHJnc7+cPeITR+dT8B bU/7PeRsPMOqXOcgdOZL480zwQ2mxws4nNBODQKs/P4LX0Hfblz/egI7LOSCsNyzcGjA c2PA== X-Gm-Message-State: AO0yUKVE8ZRDMQDQzbRlKmvqbXwgKLRqlR+f1ADo/OT5usyZW9GiKaXf sM+AZd3ReS28+GBEl27+TxVZPwWr X-Google-Smtp-Source: AK7set+xqjbevzSBhalPhLNzV9YmQ+cjYNdUlaCfhQroMc+cotBAT0zEAyxrOz4hu1kRTRrZgTtzpg== X-Received: by 2002:a63:3dc4:0:b0:502:d6c1:a72 with SMTP id k187-20020a633dc4000000b00502d6c10a72mr5407574pga.12.1677498014345; Mon, 27 Feb 2023 03:40:14 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d4ca:b0:196:751e:4f6e with SMTP id o10-20020a170902d4ca00b00196751e4f6els10443929plg.10.-pod-prod-gmail; Mon, 27 Feb 2023 03:40:13 -0800 (PST) X-Received: by 2002:a17:902:ec86:b0:196:11b1:101d with SMTP id x6-20020a170902ec8600b0019611b1101dmr29561181plg.28.1677498013132; Mon, 27 Feb 2023 03:40:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498013; cv=none; d=google.com; s=arc-20160816; b=zr5yv9d3m2DGY6AnUWZNV4PV8IMLFCCFzrNKTtu1VsWkhOLB5odc4KwwkBD8yPDEJl Nrnfysudug0Zbs6hAifnO1d9CW3Aav0stNHDX/gBFmqBvC363swSdefYqM7BU7/AT/Ad twfQzyhXqxZn/JDVdK0SkTjBpb4c9YAlty/bsuGr//Wxc1M1juNUHLu9CFhi9MscrHUT UYPaGgBYr+uDBxfZinJ3pP8v6Kmj3/ZY7jgOWFjLWwJJeDc25bLNCgMy1F8+Y4VYMWFI UHerZh9e2+AZxmQ+twVTEpMz1SygDlTIw7OKZOsfusbO+ODOG0hZVTWbt0ylKehvyOk5 QugA== 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=OIgviWBqKUtGyYA8pNcGlHAIxKkXaoAhqP3nf0sw740=; b=hbjLCjKUKablz6K4Q94lVCOV9KudkrgCMBjn5F1CKt5TDnc4lbzclEG+pkHKFps6/9 AbJ447ShI3JDzenYd5S6VnA6JHNGuf2J7ERq1yr+cXEmBZEhzzL5cRuIYnKGSM4gB4Tb LQBvzGEQtMDxW+C3DhYShP9uaCUsMh1EP62ny7rTFuq3tuLBHunFhTUTUl4rH1bSjgAx bBLlBfpNnsY9DdZUJ6HdFUIhz1RlKp2vYSAzGtIUd9LTdJwUQys9zI2oKNPh7EypUU6f 7Kt35TtiPbzGll43+X5eVvBnMBrm2rnvP0QXoiwyJb0dMEoS8VsPDB3GT124VRiz5oSU B85g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rOiJ8pyf; 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 q16-20020a170902dad000b0019a5d8e0a32sor2106177plx.40.2023.02.27.03.40.13 for (Google Transport Security); Mon, 27 Feb 2023 03:40: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:903:18d:b0:19c:f232:4604 with SMTP id z13-20020a170903018d00b0019cf2324604mr7364687plg.10.1677498012743; Mon, 27 Feb 2023 03:40:12 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.40.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:40:12 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 05/18] drm: exynos: dsi: Mark PHY as optional Date: Mon, 27 Feb 2023 17:09:12 +0530 Message-Id: <20230227113925.875425-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=rOiJ8pyf; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The same Samsung MIPI DSIM master can also be used in NXP's i.MX8M Mini/Nano/Plus SoC. In i.MX8M Mini/Nano/Plus SoC the DSI Phy requires a MIPI DPHY bit to reset in order to activate the PHY and that can be done via upstream i.MX8M blk-ctrl driver. So, mark the phy get as optional. Reviewed-by: Frieder Schrempf Reviewed-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v13, v12: - none Changes for v11: - collect Frieder RB Changes for v10: - add Plus in commit message - collect Marek RB Changes for v9, v8, v7, v6, v5, v4, v3, v2: - none Changes for v1: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 12a6dd987e8f..529e010291c8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1699,7 +1699,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) if (IS_ERR(dsi->reg_base)) return PTR_ERR(dsi->reg_base); - dsi->phy = devm_phy_get(dev, "dsim"); + dsi->phy = devm_phy_optional_get(dev, "dsim"); if (IS_ERR(dsi->phy)) { dev_info(dev, "failed to get dsim phy\n"); return PTR_ERR(dsi->phy); From patchwork Mon Feb 27 11:39:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2746 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 2231C3F9C2 for ; Mon, 27 Feb 2023 12:40:22 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id x10-20020a170902ea8a00b0019cdb7d7f91sf3470352plb.4 for ; Mon, 27 Feb 2023 03:40:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498021; cv=pass; d=google.com; s=arc-20160816; b=Myr+fyOqASN27V7tQMX2+IXwFOhXvADHew8LqOjFqcQUV7bgE33QhWe8YiDR1W9VqX PCdX1gtja/+wttWqRNkZIZd43/KBDFUaZg2ye39TOs2t5enk9WfMQi6p1BKenddKAPsI OCsxOWikhCZCyVsXAuYEERtqJk2ZacGgcYQ4doqmw/RHMWnLGJrozvRtaXzs1decyH2m ZcrVzd4iJA1Xoo5ErHHZj85y8Sr+5e+UUMROqDRZx9C8PT/WpcUdStpEPy0eKLUnutFU j62LpSU96Ods9zLTX46RB1Z5vmkZR0aOfbdWpjhsXirkk9EXCdnTdGVfEtgUmDLssmCn VA0w== 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=BHMBKLt1SlvJCg7OEc75kpvsi14dLm5KNbclJ1QQ2ho=; b=VWjnFQo8SLbnikxnLBs5cO0JvaiByDYXHEvwCjYQchdJZBbVIUeX1mRfv/S/D0+rHB FNMqEW4j+5ikRGYCKORUENKYnhLHjLrMSDlZlzbvfN/9mZ5fSoBNMmGeR7COsLjIrkon XpXXd4Yu/iSx6GVJMOJevF6RtMAr8DEEvOQkygS90mAdMwqL3iRdyvBxKBnRUuJpsymy lF+rhpeGjTxw7RgKFiTBCDEbsM6CHoonB2NOzJ61HEZwtRbREsdJ5cBQsNICtiZor6LG I30wV4BySo52/nPOEMLgFJfMC+K/c/yHUGM/02qzWQRVLYK/G5q5lurv2Zj4ZE78+5uy F65Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="dZV/bNLq"; 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=BHMBKLt1SlvJCg7OEc75kpvsi14dLm5KNbclJ1QQ2ho=; b=kN3UGfHN/Whv3agGj0MMfXb5ecv9ZvgrR17GChJz0yYIPbxaQckhKlmYQuXcUhQ6uG WM4uWB34KU8UjEWXlvLuRTtXnYm5pPoIskwwpJdDY5FaoCDHficn9CyGZKdk305lbhd2 kfph/fYJTn9rGN8X/CZu5FGFdB32DH3VNf9Ks= 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=BHMBKLt1SlvJCg7OEc75kpvsi14dLm5KNbclJ1QQ2ho=; b=rNFQSOed5EXOzXIP9PqVaGMqW8dHz6/Y0kgvH+cnKijk9HtplFjb/J5NWp03CYtKhf SDQMphzdnfatECgNmDrU2I+IAFFCTy7HfVOMC8JhXjHUOCtrhDB5JTr3073msyGfM8mk 3WdiJv2kasKMhMw5XfWkagbey7NgDBB9Ci95Zw1vnt2U42AjArkBL8jF3ilWC1DMUsYQ /WPz20VepCTL216Fqct5L9z+og3hDRKgycLuXqzSy28+mS4IffRQnECtKXse7/SYwVfG 4XbQciVuMZgFWPRqmPpC42LFIiGe2spHF3vsT0TJfkEY5OGVAW9cZ/30b/02mzama3Qu BqzA== X-Gm-Message-State: AO0yUKUTqqpjYuOt+2hvH1r/eTFXODIGA0wjgK3vSp2w4RLGTk0F9Zdm FznJPc3dIm7sGavFgfu9vc8xzxaIwjjbLg== X-Google-Smtp-Source: AK7set962BfPH1tWosHZD4cv8i5ZLu21UXj3GdNsQ8PxXmCZOb3YVGe8wD8z5GtnFJCSwOsLZs6kwg== X-Received: by 2002:a62:52c2:0:b0:590:3182:9339 with SMTP id g185-20020a6252c2000000b0059031829339mr5682418pfb.0.1677498020823; Mon, 27 Feb 2023 03:40:20 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:2881:b0:225:cae6:ff24 with SMTP id f1-20020a17090a288100b00225cae6ff24ls4578030pjd.2.-pod-preprod-gmail; Mon, 27 Feb 2023 03:40:20 -0800 (PST) X-Received: by 2002:a17:902:cecd:b0:196:63d0:a674 with SMTP id d13-20020a170902cecd00b0019663d0a674mr29807090plg.9.1677498019966; Mon, 27 Feb 2023 03:40:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498019; cv=none; d=google.com; s=arc-20160816; b=qZTh6Egfr1S71jBQmj4Z4pUS7H8WcskfdLpuoWkOgYAqEXEtifzOh1MJcHkCzbUkEG rF1ye7i++7B3UchOjGlR0tD7nOfgAJ9Eu0hQxf7oDNh2jl41Cm3zzPgSTENI5oM3Kupl 36pjh5n9kwUAVxLMEyAslkWzo3gJ6r7/ZzkzJQdFix7fEeIjlmb6kb6EKCq5PPY1y4DF jqt+EI2Y2eF+2gXDmcf+g0OAn6kKxXylokeXoGyafZeQPWILogtA+K7QQK4T7Q7jx+hO n+y5qYYD5ZoxWI7ZPXuJDO6hOANDyQXegEKkAIx4/2teS/t5qpuVBtGHVY+a/b4M4WxA dKgQ== 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=hcK49RjKscvvI/Bcjzdcif+XCEL3a0d7sa1A+ZWBEvs=; b=YlTRlL7z962d5CP4CLDxyo+YTHy6R2XdpA4XPuhWutR+wtoxOfONnXU+lnZ9s7T5wq xnPxg2YhnDONqcFxfMikFN6UlRf7DhPN6buJMx5AHn/NgY5MRsHkx1giCMMY5MtI7Mxf tw4uiG3DQJq1O6xgCuOvlkOz2vprxlgGCqBoQNPiT46BIPPnGa1HuW5+lSFaMC94322Q /VaZkkvbyQJK76JeH/Bx1y45ugm1MwsMjJRHg7E8RPlSNg/b+x3kiPskdmFrvz2qrjjE IOhqGfFI0Ky9ZQTby4X/wQITi+gTMI5E7dQx9EjfMmr+ws5WhzPh7OxV0gQUr6Fp5bxf nZUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="dZV/bNLq"; 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 jc2-20020a17090325c200b0019c8ef51473sor1925840plb.87.2023.02.27.03.40.19 for (Google Transport Security); Mon, 27 Feb 2023 03:40:19 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:e84b:b0:196:44d4:2453 with SMTP id t11-20020a170902e84b00b0019644d42453mr29018973plg.7.1677498019646; Mon, 27 Feb 2023 03:40:19 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:40:19 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 06/18] drm: exynos: dsi: Add platform PLL_P (PMS_P) offset Date: Mon, 27 Feb 2023 17:09:13 +0530 Message-Id: <20230227113925.875425-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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="dZV/bNLq"; 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 v13, v12, v11, v10, v9: - none Changes for v8: - updated commit message for 8M Nano/Plus Changes for v7, v6: - none Changes for v5: - updated clear commit message Changes for v4, v3, v2: - none Changes for v1: - updated commit message - add downstream driver link drivers/gpu/drm/exynos/exynos_drm_dsi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 529e010291c8..8eac1c6e35c2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -195,7 +195,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) @@ -264,6 +264,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; }; @@ -472,6 +473,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, }; @@ -484,6 +486,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, }; @@ -494,6 +497,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, }; @@ -505,6 +509,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, }; @@ -516,6 +521,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, }; @@ -629,7 +635,8 @@ static unsigned long exynos_dsi_set_pll(struct exynos_dsi *dsi, writel(driver_data->reg_values[PLL_TIMER], dsi->reg_base + driver_data->plltmr_reg); - reg = DSIM_PLL_EN | DSIM_PLL_P(p) | DSIM_PLL_M(m) | DSIM_PLL_S(s); + reg = DSIM_PLL_EN | DSIM_PLL_P(p, driver_data->pll_p_offset) | + DSIM_PLL_M(m) | DSIM_PLL_S(s); if (driver_data->has_freqband) { static const unsigned long freq_bands[] = { From patchwork Mon Feb 27 11:39:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2747 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8DF023F9C2 for ; Mon, 27 Feb 2023 12:40:28 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id t185-20020a635fc2000000b00502e332493fsf1788860pgb.12 for ; Mon, 27 Feb 2023 03:40:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498027; cv=pass; d=google.com; s=arc-20160816; b=eTQA4yrF+Q2O3fiM6IgJXob+FOBWByJ2zcxKObcVNVH90ephJCwu5079MQ/KA2WpED WIUJg6Ry7ldtXth/LC50FRZRd4v7a3/fckCQ4qWEIoMZm0Z9eZ4aepV8Ve6N97vcpNtk arB6iPYF5BH47oQQVQfRiGOVxX0QsPywxNqAlImXgL/QVtlbH0sRj9lSVelA4+t40SRX HZ87KOrKHmmYfGNVzcoud5tY/MEH7wAeUcqloKgDtsj2u8blzV9212E9CaiBOAkTuRxa gqZeryPLultBgVcM1gyLUcYULEOFGXQaIflImP3V8hluIwfZRQAKoYBRyYNlfbP6hDwC 2MwQ== 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=5pMj6UDO7ZqMMA0luGGI04Sml4DsgPfi6gWVvFexHyU=; b=YVtM9z4hCuBjyYynZgcdUkzRGzmBeJotdS+l5iWslloXBWdRnO+p3o8O1vpipTgoKS VBb3ubVMAYAHEL/sM5qAr0UzXAkKvscTON5ZqsiiCBNtF6CT8YpbOFmBRPXCAq8r0cqz s9/MyeNCAPVT8eitb8GUrPfwpLK7QU8QI0h/fb0dKj7FrE5Zfygka4H395PVGSJGxxzL 49a4jc78FIYgpIYX7OXmWVARMY7MSbwIdmUiRxB7t26rcxWat+q1pVUUUGYUBXIJxCQu G6hjDxc8wm6U2HsQKPoThBXRK+SMLI6R8MqFKHGxInHvVh88jMnf1enC8bCnSClZr3P1 IARg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jpNudG2O; 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=5pMj6UDO7ZqMMA0luGGI04Sml4DsgPfi6gWVvFexHyU=; b=IC3hYttA1NhxxYcMsQ+AL9TO5t8E+GSvaofUBmhMQPVCNgDdw927p2S80P6eFBAJHx VG3BdkMkE5HF+NhvoZ5CTHrcWL1FNyd6uSxvjdlOV4ssgwpnQ5axA/dILM9+c0RGPtqo ksjvuqXFn4DL3FMRtyrIizGmRiBIwojPATK8c= 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=5pMj6UDO7ZqMMA0luGGI04Sml4DsgPfi6gWVvFexHyU=; b=5ye7YwFAjfcC1dNYHMpTzbNLmF1Zr5DhIHzRIijA0XO+WsLtnntQKfnA9Gdby2w9n4 SeFFYVR5qGN8UnH9Gp89z0rhnaWqVruQPT/lKvfP2MtbknuJWGndyDRz5Wui0xXXcXFv P1I1M6BjiO+5jkl2ThO7Essg7yFB/lDGNIZD+z+ZBBXtWbFKut+0sA4aFEiHDm0Zt+ty MgpmkmqWCD9XHwwx2eHgrf7e9DhG5VXu/e3xnCxstAOsWxsVLk07eXnjebppxPobrEuq NbtAyi7oa4tyUGZCq0bQ8WgFU3fCIN1G7P45hfNvJXgUyQd+aj6y7hDvf/J7LD3S5Eky M9vQ== X-Gm-Message-State: AO0yUKVAQ5/cdGchI7mD7jcMEEWYruO2zWjhMSqK49Izt6EeQzqL8L1u AweL0sDwFe0/luj3CRdXJrV+wNia X-Google-Smtp-Source: AK7set/md6Rzd3lEy6nEulxnS6HN0T3qPYToptDkX6GAoAaP/L0XpHoliAA1iypiGPywwjjt90VQkA== X-Received: by 2002:aa7:87cf:0:b0:5a8:fc35:8e99 with SMTP id i15-20020aa787cf000000b005a8fc358e99mr5626039pfo.4.1677498027368; Mon, 27 Feb 2023 03:40:27 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d50d:b0:199:50f5:6729 with SMTP id b13-20020a170902d50d00b0019950f56729ls10425570plg.11.-pod-prod-gmail; Mon, 27 Feb 2023 03:40:26 -0800 (PST) X-Received: by 2002:a17:902:f990:b0:19c:df17:7c99 with SMTP id ky16-20020a170902f99000b0019cdf177c99mr9508741plb.33.1677498026573; Mon, 27 Feb 2023 03:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498026; cv=none; d=google.com; s=arc-20160816; b=sEOf7qWIGkEuMBaHUQL08NGdD3MDO+R6HspV7CqHT5czWEKOZ2PMKeWjd4/xDTgrEm MFomZiIHduex+lwcPdZnnW30FPURddD5cjy1/rbv2EyMToS8AixatIWiG8NNNKlt/1pe Vx4YAH6em//X/TxXGe+jmFd0CXvzNragQTeAiVmLd00ZFXFo7p8cgFR+Twi/cChhdEbR ykrqLSqJ1ZP8X9EfS3MNpMYuViyrxipQsXutTtVSTCx30RoJZs9C5Oq/fyn+Ics/VbHI s4YfRsNk2jHazJHTLl/zfi1ztu933ZZ9gdpGtTEKMyKm89IZonI04mXT8lsSaFrvdRhE o2pA== 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=42ThMJ2/t+fXcxS7gPtZrrUkoIWrhAnkLbSBJwEbg+c=; b=bjNaspbe/Y27pLsX3qzFTI38mgXHTGWRBUv1w/IEkC3e+xfcjXrEkNYeyiueKYKrt7 EBGzuvXPUFiTw4h8SluzkmMlSpJVCwkNXpJcVY4hhhnp2nYtYmlBOKfZxN3ATXHD6rAP DvGD8/ExRxwI/i2Y0L8qInxlBAwu4MXOhYfA2FhPVaZ96pWYBF2F5JZNw7vipXUEiSr3 65989CAN7JDMRY2qqaW7nRoS29Z5OhobRthZZIKG4wv/u+iwmZ7hobTRmZD2wuVDpkwz FY/1DXlCIoP5jEdH6lNDhYDkq/0ORX1ho9JWzZ62sBPpbeez3Gc4pmOWsiZSRyxeH7mG QmxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jpNudG2O; 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 jc4-20020a17090325c400b0019c97fadf44sor2351935plb.15.2023.02.27.03.40.26 for (Google Transport Security); Mon, 27 Feb 2023 03:40:26 -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:22c8:b0:19b:64bb:d547 with SMTP id y8-20020a17090322c800b0019b64bbd547mr26874568plg.62.1677498026250; Mon, 27 Feb 2023 03:40:26 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.40.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:40:25 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 07/18] drm: exynos: dsi: Introduce hw_type platform data Date: Mon, 27 Feb 2023 17:09:14 +0530 Message-Id: <20230227113925.875425-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=jpNudG2O; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano/Plus. Add hw_type enum via platform_data so that accessing the different controller data between various platforms becomes easy and meaningful. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Suggested-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v13: - none Changes for v12: - collect RB from Marek Changes for v11: - collect RB from Frieder - drop extra line Changes for v10: - split from previous series patch "drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge" - update enum type names drivers/gpu/drm/exynos/exynos_drm_dsi.c | 83 ++++++++++++++++++++----- 1 file changed, 68 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 8eac1c6e35c2..9217b362224a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -255,6 +255,15 @@ struct exynos_dsi_transfer { #define DSIM_STATE_CMD_LPM BIT(2) #define DSIM_STATE_VIDOUT_AVAILABLE BIT(3) +enum exynos_dsi_type { + DSIM_TYPE_EXYNOS3250, + DSIM_TYPE_EXYNOS4210, + DSIM_TYPE_EXYNOS5410, + DSIM_TYPE_EXYNOS5422, + DSIM_TYPE_EXYNOS5433, + DSIM_TYPE_COUNT, +}; + struct exynos_dsi_driver_data { const unsigned int *reg_ofs; unsigned int plltmr_reg; @@ -268,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; @@ -298,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) @@ -525,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) @@ -1469,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) { @@ -1671,7 +1678,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"; @@ -1829,6 +1837,51 @@ static const struct dev_pm_ops exynos_dsi_pm_ops = { pm_runtime_force_resume) }; +static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS3250, +}; + +static const struct exynos_dsi_plat_data exynos4210_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS4210, +}; + +static const struct exynos_dsi_plat_data exynos5410_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5410, +}; + +static const struct exynos_dsi_plat_data exynos5422_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5422, +}; + +static const struct exynos_dsi_plat_data exynos5433_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5433, +}; + +static const struct of_device_id exynos_dsi_of_match[] = { + { + .compatible = "samsung,exynos3250-mipi-dsi", + .data = &exynos3250_dsi_pdata, + }, + { + .compatible = "samsung,exynos4210-mipi-dsi", + .data = &exynos4210_dsi_pdata, + }, + { + .compatible = "samsung,exynos5410-mipi-dsi", + .data = &exynos5410_dsi_pdata, + }, + { + .compatible = "samsung,exynos5422-mipi-dsi", + .data = &exynos5422_dsi_pdata, + }, + { + .compatible = "samsung,exynos5433-mipi-dsi", + .data = &exynos5433_dsi_pdata, + }, + { /* sentinel. */ } +}; +MODULE_DEVICE_TABLE(of, exynos_dsi_of_match); + struct platform_driver dsi_driver = { .probe = exynos_dsi_probe, .remove = exynos_dsi_remove, From patchwork Mon Feb 27 11:39:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2748 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 63FA93F9C2 for ; Mon, 27 Feb 2023 12:40:35 +0100 (CET) Received: by mail-pf1-f198.google.com with SMTP id s20-20020a056a00179400b005c4d1dedc1fsf3296861pfg.11 for ; Mon, 27 Feb 2023 03:40:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498034; cv=pass; d=google.com; s=arc-20160816; b=tpCvWvel47Y7ykvfI+Av8T9BPpBf2J4/NsAT8XJXXqZdx0CHfTBI6PeKze9Y4RYKVD hpUXQdY1bRdPgGV1SN+VAU0YSTUPhQO+DDve4inj4xD4cb6dqkg+QIdxDQOfHllkUqQL GynP+vvPdbfJtwuu6lPtISP+pN9Ob36xih3WDCz2sisDcwagCIo4cJLEk0NjHiIceo/b LQFmrUnI+9grmDVO91gPaZrYYHVMDvuitSE5x02wInbQmGmw4nr/9tJTJqUJ/dYQqFmP O1XMPMczzBKOIPaZCt7pKXMMfX/m1IvRQ4TGBWFTBRYMNUhVU59yXj5TsUmqi5bnqapZ 3MwA== 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=FpWDFsilpVibidJeWRGaj6zRJON9aPUs784QrnHRfZM=; b=wEGrEe/q89fMb/16M9dqP6qrsdFK8Tbby2Jl/v5BTZkD799+t7SwMFosa1RogQQnoy X1r5a0B2PctiBkisQZvAqBxXI35Rwd76Ts6gbEWx/bk4wV6QJG3R0J+T1GmxSuzzy9Wb g+oojqGNVSzPdcYB7y8dK65bhqkzspBZInHS5a09Gi5CbJs5vM6/jjQlrXhh+7/gz0jK WXAFaGjhXT5oeBQJ+cR3Lk54gIAaYoLfZgVUBgGFkkpGGEhCxbA3hL5Pz/nl/7iZi5FD 7AvqD1XlWJaqy59h3bum+u6iO6ItoJOaDvMVdK9kojMyhGFPVlerBLD6ZNA/BRe/3viK UKGQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oMN7np5Y; 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=FpWDFsilpVibidJeWRGaj6zRJON9aPUs784QrnHRfZM=; b=QVUNFntD5x6Yv75AjOAJ1COv0sdv6Ac64Z4ibFTiuaW+tPIemUJ3GwScxy2OEb7Sfc IO6b8DrKK3bpLp6LVaM8fnc++9JB2zFumQHUEJByOcIcYGSbHdclfrfLnRc2Hoo8XUP+ IHta8FtCuFBfkdf+A3pAHIIpE6/y3GtZuIjuo= 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=FpWDFsilpVibidJeWRGaj6zRJON9aPUs784QrnHRfZM=; b=IOfEF507WlFvF8yp077VQ+hF8K1Ov5XCK0EVOAL0aeT2bJ0iI2fiCVd9LRH88HSwBE 0Lu9q9tpgBlNHzpK3MTPZoz8PP5YnDF1034qdpzsEbj6MBEzJlsKXr/jC/cPv0SgKhW9 AuV76owBHETq3VL89lVwvaHJRguIhfJEEh5vOsAeBjRqLEvm8RhX41tfq2i2wUyVlkiW 6iA5hpxmq3yrAQWRfQm19YgR9/P4oWJgGafMQ/Mn2oxEp6E5j5vZKJ1aty2o08R2tqyR M1SmsztHwnLssDGS8H7svQhR81BU7kK4htBHhVhEAycYVQTUlulHW9nan08dxhtuoJq2 OukQ== X-Gm-Message-State: AO0yUKVknFQnQdkSGVxrBnBdFaay8GM3qOlVp+dQdHGL91BdHuyqpqxy 8EBDhWbIBrGG/iVI1EbbwKby3VWj X-Google-Smtp-Source: AK7set/YBiNUlfFBejbJkM+Rzq1Rv0F3y4fJzBOAnQ4CEITMuEwHJR4qNPR+I8LOwPSeiYphZnBDig== X-Received: by 2002:a17:902:f7ca:b0:19a:f80f:9619 with SMTP id h10-20020a170902f7ca00b0019af80f9619mr5893315plw.3.1677498034147; Mon, 27 Feb 2023 03:40:34 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d50d:b0:199:50f5:6729 with SMTP id b13-20020a170902d50d00b0019950f56729ls10425855plg.11.-pod-prod-gmail; Mon, 27 Feb 2023 03:40:33 -0800 (PST) X-Received: by 2002:a17:903:2345:b0:196:3feb:1f1e with SMTP id c5-20020a170903234500b001963feb1f1emr29944879plh.47.1677498033256; Mon, 27 Feb 2023 03:40:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498033; cv=none; d=google.com; s=arc-20160816; b=rBF4jmw1YjIKbLlnvn3eY3VGipeUGsBoTARZMW+W6TmNGDagLO4tE73MGhcO7khmmQ dqkEWsgpwMNzp8tWUexEkLAa0jj6Wk7Yif7/qdYmBUkqsMYDSCS+/HX/KSLYbpG7bAA8 uPx4+oV3eqGHwnEBceb6eB2ODgUer5eUkFefuUKE+05J7/hYYd+KOb8xhOmBI2szx/bJ uNSDxI4ImBRHmnF0tb5pNDmk/SbWK802XBlnrmeDT3G8tJ4KBKv16V2T8KLAxjOqmuf4 xtK+8g+XbVI7iG+NG7j8q6iZlhIBUtfi8uXApPdxGcPG4XJecJV0QoMQGNMc6uYijDvD djxQ== 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=aXzlQcM2+q3cNKX9yDd3QRgxQ4bSUjE8wzTk4MHaeas=; b=A88TJi5l0gwnnoOVf/K6CbnFQ8ttmHZzbEQ7NBGSxGNssynBrh7a/67egCAxU/5eCR k+zOAj0Cq54aNnIhcrqX1ZSs0ajZzwbjAQ8eTOsYX1164LOqPNu4jeUwWm40MpowtIoo ILYF/THniHY/AihSkqPaQYlXBMvkfO9V0t26YF14NkJ+/UDJqmIACyBOfcLXy8orpK1K XVhBxT6yYSUCTlmahHKav16J1+GRCDCmGRwNlKCULXdBMZy+kl8y2MWPBsMdwcKQn5o9 XdI/N+khB1CIXw+HazgR/Q9pinMUDRR4b+CvGH16nv6GnRa9x+pyr+DYpExMZC4Yjp/q tU2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oMN7np5Y; 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 d4-20020a170903230400b0019634c4979bsor2136894plh.146.2023.02.27.03.40.33 for (Google Transport Security); Mon, 27 Feb 2023 03:40:33 -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:c946:b0:19d:74c:78e5 with SMTP id i6-20020a170902c94600b0019d074c78e5mr5079561pla.50.1677498032954; Mon, 27 Feb 2023 03:40:32 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.40.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:40:32 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 08/18] drm: exynos: dsi: Handle proper host initialization Date: Mon, 27 Feb 2023 17:09:15 +0530 Message-Id: <20230227113925.875425-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=oMN7np5Y; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Marek Szyprowski Host transfer() in the DSI master will invoke only when the DSI commands are sent from DSI devices like DSI Panel or DSI bridges and this host the transfer wouldn't invoke for I2C-based-DSI bridge drivers. Handling DSI host initialization in transfer calls misses the controller setup for I2C configured DSI bridges. This patch updates the DSI host initialization by calling host to init from bridge pre_enable as the bridge pre_enable API is invoked by core as it is common across all classes of DSI device drivers. The host init during pre_enable is conditional and not invoked for Exynos as existing downstream drm panels and bridges in Exynos are expecting the host initialization during DSI transfer. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v13: - none Changes for v12: - collect RB from Marek Changes for v11: - collect RB from Frieder Changes for v10: - update the to simple logic to handle all platforms Changs for v9 - v8: - none Changes for v2: - check initialized state in samsung_dsim_init Changes for v1: - keep DSI init in host transfer drivers/gpu/drm/exynos/exynos_drm_dsi.c | 27 +++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 9217b362224a..5723d91ff686 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -255,6 +255,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, @@ -1568,12 +1586,9 @@ static ssize_t exynos_dsi_host_transfer(struct mipi_dsi_host *host, if (!(dsi->state & DSIM_STATE_ENABLED)) return -EINVAL; - if (!(dsi->state & DSIM_STATE_INITIALIZED)) { - ret = exynos_dsi_init(dsi); - if (ret) - return ret; - dsi->state |= DSIM_STATE_INITIALIZED; - } + ret = exynos_dsi_init(dsi); + if (ret) + return ret; ret = mipi_dsi_create_packet(&xfer.packet, msg); if (ret < 0) From patchwork Mon Feb 27 11:39:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2749 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 3676D3F9C2 for ; Mon, 27 Feb 2023 12:40:42 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id c3-20020a170902724300b0019d1ffec36dsf798822pll.9 for ; Mon, 27 Feb 2023 03:40:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498041; cv=pass; d=google.com; s=arc-20160816; b=orbz870Y5cvjwmrouPV9v2Gj6AbwwCFuf9cgk0HeZu4xZWcm0pvDpAYZEk1M4WIIeS 8iLoO+a+r0oXaXHIADzCX6V3h9ZaxdMIR/QXAPzpUiVcasmYOa43fCtiJZVfzlQeqf+l bdM27/z+vwsTbBg4mQFHYmquDg37mFsiR5uwTo0/TDgx05Pz8WX/cWiovmlfDNXb1iCe omsbX8+uiMtucEKwI4eOP9yul1LMrFNHYNupYI5HyT3jPKDLEqgFTAeqO0PdyQySu7fz hJJ4+QjpxWhOhpEGHRkAnrurK8M1H3OMbH/iNVv71aFuy0b4JqTIHUinhBw3rmta7VO2 fzcQ== 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=83kmXwv0FEn91j4mbBLndDxDHAazYhxhKccPBHQeB3k=; b=HtSvHLMBJ/L2/dHFYjqXmxx0IMlxvqBOOF6BH7/Y35+h/mraenOAcxDVpEsdnM+QhA xPTNlGbAGINLpxEOwxT7aod+RJz7/m2oWerlgHa5jCVGPU3Dr9Jf7OgLXKbcCg48xrm6 aPq8Do4SMjGmGJ0b1NCXv0ZGYr9Y29dbRpGzNhKBzx0DAN0eo6JhCaKwCGzAtVEn1Ch9 2Nh81JnowW3v4x0EcwGxYBBD7DgyXn9IFq8X0VrwqqnsPmIL9svK+sZemDuV5RFza3gv 9xZ0umz4Yb7rKYEBA2WaIvsgGfkzXms6naOjGCfcSqZtFQC1EEniDgm8sRnO98aZ0HV7 G/Xw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y96TmNpy; 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=83kmXwv0FEn91j4mbBLndDxDHAazYhxhKccPBHQeB3k=; b=Fmgs1RHJBOvMn9gAp15Q7Mk8s93gvq5AEpNv03RxmDMwn7AE9aTXqmilrYohZGZYjp Tu0zJFEl26awDWy+SIwcP8J3Y1iaUo6DDxuAT1GDoqPTfbiXbMhLXzmBcern4ctpi+bA OUoLJWmYcBKoVcunLhhgSQuCGo4bSt3cLL/KU= 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=83kmXwv0FEn91j4mbBLndDxDHAazYhxhKccPBHQeB3k=; b=UPm33Y+rvyqB68QPYDgMlTY+EQ1+0IUD05W8aMGazcwtO3F5cflwJ5iEtmzQGNVZxq bzIv++tjWaOQ2tVI3J73WDYYCgjx1VqVf0NIuQGRdu9TOiZbOKKdnEDa3tyo6fdG2WJZ erxCxU2YBYj193BYgHxZsZpdthNdD9pmaxcApb0zcHw4W/Kazg8dsYtHYgPQJdGQpwhD 2x7Yhyvt2VOvJdZfni2b7fhK+1lZYjrVXlMTEZNDjNSKiu+LnaVIGVeC5YF7hGDs0fOn NISBHDZChnJWI0OD2UlW/wivbVuOzhEUK/ufvdseaAd07nSGUojNNZFsNxvqowVr7Eds XrUg== X-Gm-Message-State: AO0yUKVBd6xerKmk67CViPj+EhlsLqSG8arOokSdCxab9o1q2n03Bna2 Ch4O+346BXay7wMDxxLLdYULZg5nY/Bumw== X-Google-Smtp-Source: AK7set+L9+zDw6KacJ9FFnKagpyhQWQ4/44j+kypp4v+AiGZDbOzxZ7LgJaimWJ/SNJFbzV9bY29ag== X-Received: by 2002:a17:902:ab1e:b0:199:2451:feaf with SMTP id ik30-20020a170902ab1e00b001992451feafmr6114512plb.3.1677498040923; Mon, 27 Feb 2023 03:40:40 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:c149:b0:19d:16ed:fd02 with SMTP id 9-20020a170902c14900b0019d16edfd02ls2722525plj.5.-pod-prod-gmail; Mon, 27 Feb 2023 03:40:40 -0800 (PST) X-Received: by 2002:a17:902:7448:b0:19c:92f5:ab4e with SMTP id e8-20020a170902744800b0019c92f5ab4emr18320672plt.18.1677498040000; Mon, 27 Feb 2023 03:40:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498039; cv=none; d=google.com; s=arc-20160816; b=XZzoP5LTfwT/OrABr6bnsLPsGGt4sHDDKUWlfOUjIQ6/A1pWT449x5pWJrmMtZboF3 57CM/THVMAX/OUpSCFWdjeOr1JuiUGhSZdK4OFWJDKDKaOMhjaTrxOKk4sfJV8veECoi QW8mwjWBYZheQPoU1rtgEc2cOwnvChyh0rxXPJ9vQRveuwghzCHLX6b6scQGKk6QC8N7 lelmzjyifMKFMfqH/qHkILb50e0p9zcEW8nB8NPYEyjStxp6QWqp0U2s/u91m1PCNjLf thufk84iJAzU6VV1m7SNmpzSGdont98ysH4JGAoNx5wdy9P4TRh7EfiEuAvJuF/pSCVk I1jg== 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=LU+ldY5CPu/D8luQ9aqgfh0M/OSOuFnng/b9Q9chcZ8=; b=XvVhcT29IoC/5FweW9DUk/lKklyf+MY6gHlK+ODAsxR05lgfhIFfU4UZ+YG5ZTpu3w 3uNkvByuVSIitP77KU7tBLy4wBD5flmcTnANYuF/LXpBqCMbP5ly4wvTUzRsHwxGHTXM hC8OOMRM1ZM7R1z/JerAVxVtSPgLb2hGZUrKvLbtiXqN2ivJldog9rs6zEQ4vfS4OMxn fYPmAxWOoRO1QNxRb03xPKymsyn1zU4NPdhFzpWXe9uReNlvnabHioy6+8y0Ta8tfitL aAMZBXKmzb7qVyOL1vo08az7D4BUN0qqqr20u87RPQR5kdT4erZHjvEL8jJ8lLEMFVTM 2OcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y96TmNpy; 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 jc4-20020a17090325c400b0019c97fadf44sor2352211plb.15.2023.02.27.03.40.39 for (Google Transport Security); Mon, 27 Feb 2023 03:40:39 -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:228d:b0:199:4a00:9788 with SMTP id b13-20020a170903228d00b001994a009788mr27406857plh.19.1677498039672; Mon, 27 Feb 2023 03:40:39 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.40.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:40:39 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 09/18] drm: exynos: dsi: Add atomic check Date: Mon, 27 Feb 2023 17:09:16 +0530 Message-Id: <20230227113925.875425-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=Y96TmNpy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Look like an explicit fixing up of mode_flags is required for DSIM IP present in i.MX8M Mini/Nano SoCs. At least the LCDIF + DSIM needs active low sync polarities in order to correlate the correct sync flags of the surrounding components in the chain to make sure the whole pipeline can work properly. On the other hand the i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020 says. "13.6.3.5.2 RGB interface Vsync, Hsync, and VDEN are active high signals." i.MX 8M Mini Applications Processor Reference Manual Rev. 3, 11/2020 3.6.3.5.2 RGB interface i.MX 8M Nano Applications Processor Reference Manual Rev. 2, 07/2022 13.6.2.7.2 RGB interface both claim "Vsync, Hsync, and VDEN are active high signals.", the LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. No clear evidence about whether it can be documentation issues or something, so added proper comments on the code. Comments are suggested by Marek Vasut. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Signed-off-by: Jagan Teki --- Changes for v13: - none Changes for v12: - collect RB from Marek Changes for v11: - collect RB from Frieder - fix commit message Changes for v10, v9: - none Changes for v8: - update the comments about sync signals polarities - added clear commit message by including i.MX8M Nano details Changes for v7: - fix the hw_type checking logic Changes for v6: - none Changes for v5: - rebase based new bridge changes [mszyprow] - remove DSIM_QUIRK_FIXUP_SYNC_POL - add hw_type check for sync polarities change. Changes for v4: - none Changes for v3: - add DSIM_QUIRK_FIXUP_SYNC_POL to handle mode_flasg fixup Changes for v2: - none Changes for v1: - fix mode flags in atomic_check instead of mode_fixup drivers/gpu/drm/exynos/exynos_drm_dsi.c | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 5723d91ff686..22e3bdcf5494 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -264,6 +264,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 Mon Feb 27 11:39:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2750 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CA7C53F9C2 for ; Mon, 27 Feb 2023 12:40:48 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id p9-20020a17090a930900b00237a7f862dfsf4072665pjo.2 for ; Mon, 27 Feb 2023 03:40:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498047; cv=pass; d=google.com; s=arc-20160816; b=QxKCXM84sPP4o7/iSqTDr/EvCLbtGYtKig8nym/KnLwzb4p4lMWMH/hlqKNac7pPqv tcbmB42YVfEw9NztXV5zqNuAALYOyMh5Uh9Vaj415ObAz8jtylQvZ7YQPNK2tl6lqDRS +2+mpfEK6a+k+LmKFUXpxAsBpvFNlfxgut2mANhs823RO87oA3Kai+0PAkLJizVj4Ekd xuZQJILyz4c/OQDjYokc8g72vKoVwEOMf29+fzodlVfsf6mO1XanUYyucZ0whcP1VBfp FFi+lZnMAZcLTsqVUVZ0qpJ6cmttQV8Xmc8e1t3/eDUyYvZ8t6gnYOxDoMl9sYtDW2I6 uZtw== 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=jFxvGw20/UdlI1OSNHkpMLf7whBD/J1Duvp/CSQ/3oo=; b=a3oa2apFOmcGXb6q7NGtePMe7qaKF+xIvZ682igc3BYw28IDa2dOuYzO38yRRQPRti 5VXcDCNzrON/xRTB14sXn+8iGvXPCSeY2B8PwxNpavArDRakkKPLLg7fKBofruxMnNb0 8cAqInKO+r89iDemG5h6VvAShNRDZP5aFulNdofOhk6luI6agPjPoG9g+oW0ag/TVA7a 2iqjn8VI72H+AO1AhmwUdrnCBi3icEGbaoeTW6Q6wNllkzNO/VvMtpThO95qhT+fE9Rf 0OyDtENmK/1gUR1lR2NtId1zUAxejxW9s0MeEI1OBX3F+LkJ9g2dAgjpYd6asiKVKO31 m+BQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NHF1TraY; 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=jFxvGw20/UdlI1OSNHkpMLf7whBD/J1Duvp/CSQ/3oo=; b=kINxWDldvW0q/Q/mgMVA9LcAsInY6z5GUSgkgpQqshsvPDVkPD5mbv5pZGulLZzuKJ e4Ev6hzOD3pm6m6zGaQeJib34TTnf6hHIL8Exwj/zu/AzCtdekcoynBcPh0ZH1x1EVun huZVFcSp/0/urOU57/bv7zEfisfe1Mbbn2vvc= 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=jFxvGw20/UdlI1OSNHkpMLf7whBD/J1Duvp/CSQ/3oo=; b=F04eZ9T7OAm3uC47cvQdcPJGG+91MX6agXE4wPPqBP4V+L0oWxA1NQf4pDP8u7+uAu d/Sx1j7Di2rAdCqYhDdGg/VJOwbZctJsrXOK2t35ni6+h97dzd9o/IQEJDXkBK5cYadN QO1n7KNlXdtvpiizsVSYcmFXIKg+v/UVY/7axED9CjLnSiFpIPFR8Qje7XeVN9QgvUsX vN+SiJ2Jc3sUptuk6/CUw5pan31ZN6N5H0ixe+msioHCu3pe9dd/j9MqztQ3wcFmyu7K R2LOHt8uiS6Wnyyeb04tBWV/8J1NvqN5x60hTm9L3VADt5R4njcZ0+6qISlsD2WqwASh HAbg== X-Gm-Message-State: AO0yUKWDPd2xalxWmvPVHWM/Ad64qBkDI6CPWJ8cyTM3NyRNHKLkVARJ 8MDoIdeoJCHU/AGQ0XqvoZ9bHLCE X-Google-Smtp-Source: AK7set/ecn/7kOzphE1Ygy7swUTgIHpRAVrhK+oRBhMyEfaJCg4bvyGlm9thvMbym0eT9lG1kDvdhg== X-Received: by 2002:a17:902:bb17:b0:19d:756:d99c with SMTP id im23-20020a170902bb1700b0019d0756d99cmr1367017plb.1.1677498047628; Mon, 27 Feb 2023 03:40:47 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:f542:b0:199:182b:34bf with SMTP id h2-20020a170902f54200b00199182b34bfls10523885plf.3.-pod-prod-gmail; Mon, 27 Feb 2023 03:40:47 -0800 (PST) X-Received: by 2002:a17:902:da82:b0:19a:73fb:6175 with SMTP id j2-20020a170902da8200b0019a73fb6175mr9338009plx.27.1677498046738; Mon, 27 Feb 2023 03:40:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498046; cv=none; d=google.com; s=arc-20160816; b=MifSMatYCYsmYZkqoln6iPfvmzIi2Fz0xz4VQ2fTczqvZZo/JxiBpakGz5u34dKk6P bP3TPaQHSf306TAPD9X4RAcqsw2XK+1u8hHUKWUYSQHMl3cATlLDrzVea7iRtowWCgSb TqzXBJoWbONYt9UQNvcahTNfNDe5JjZZ2xX9Dq0lOqCpDD0u5BWyXjfvgr2YEke0+hVP tKQHYAkWhna5dkCFv0ON+zm3hq8gM4YopQgV323V6/YlWb9iJhLQZPbV12ROUKQaH8yz fok3YuYYqo/sSsSRWoje0IWbD8EF2SzoDVIrRm2OMJbpCjqrJspFa/cjWy0W7RuRvMWt M0ag== 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=yZkoAXyn2QKQ3FviAmwtWqDuAvR1Fa+T3DM+tfAbFeA=; b=zqy1/e+JfJpyTZC8u7Ft5ShMOafAfqyTjo59iywRgl6sRlUe+P7XFvep7ILvDy4oHU ott57CEi4/vzrG19GjutEumETPjDARHLLyo/9Pzpz9HJ/iMriE8FiahSLgYvE0EflhN7 FS3uiyPnUsMsjbhtaliavNrca16C0V3rvbqDLPZACTs97g7KPvFeP7wLaa5Nc7RBE3zd AyUAAAtq+bLrqLNfL4Ze0MAhYpW3KD/Hc7qbUA5+06rpYYs9jxogqtEVk2F1JKQeKEbP yHOlcoZpGn29fSxWgn7PxpEepK4agDzXdiYHr7veuUot5cqcRhAl9StX1Df07gJwZ5H8 vX2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NHF1TraY; 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 w9-20020a1709026f0900b0019a7a239ea7sor2358466plk.71.2023.02.27.03.40.46 for (Google Transport Security); Mon, 27 Feb 2023 03:40:46 -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:ec92:b0:19a:9864:2887 with SMTP id x18-20020a170902ec9200b0019a98642887mr8853408plg.7.1677498046366; Mon, 27 Feb 2023 03:40:46 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:40:45 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 10/18] drm: exynos: dsi: Add input_bus_flags Date: Mon, 27 Feb 2023 17:09:17 +0530 Message-Id: <20230227113925.875425-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=NHF1TraY; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , LCDIF-DSIM glue logic inverts the HS/VS/DE signals and expecting the i.MX8M Mini/Nano DSI host to add additional Data Enable signal active low (DE_LOW). This makes the valid data transfer on each horizontal line. So, add additional bus flags DE_LOW setting via input_bus_flags for i.MX8M Mini/Nano platforms. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Suggested-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v13: - none Changes for v12: - collect RB from Marek Changes for v11: - collect RB from Frieder Changes for v10, v9: - none Changes for v8: - add DE_LOW for i.MX8M Mini/Nano platforms. Changes for v7, v6: - none Changes for v5: - rebased based on updated bridge changes Changes for v4 - v1: - none drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 22e3bdcf5494..7f0703582506 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1703,6 +1703,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; @@ -1789,6 +1793,10 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; dsi->bridge.pre_enable_prev_first = true; + /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ + if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) + dsi->bridge.timings = &dsim_bridge_timings_de_low; + ret = component_add(dev, &exynos_dsi_component_ops); if (ret) goto err_disable_runtime; From patchwork Mon Feb 27 11:39:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2751 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 962E13F9C2 for ; Mon, 27 Feb 2023 12:40:55 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id z19-20020a056a001d9300b005d8fe305d8bsf3304771pfw.22 for ; Mon, 27 Feb 2023 03:40:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498054; cv=pass; d=google.com; s=arc-20160816; b=tRWKesZ6BVU3kjfzF3k9EGxXo4ubTMcrbr0lbXYxj3MFL48e/BU/0nXu6/xS2/aZRc Z4+9PsORYJUtnb0CtoGd2MWoKVT75v+LIQ3+Jy4BPZ8B5QhXe7fhA9MxGBW8q4jYuOqQ 981u5qiDo40KuYBvOSMUQEKMRBcNqYQ8NOXKkkMmzOZ5KDMvrrLG4hDFPg/r2l8IY+Zl Tdk7knoPbRGqmbHeYz065ctmzNYFM9RVrRpNNCDWZp1arSA+bN96wyNyt79ir6xGPtWj 5T1Uv46BenF+ePzfpCQjYDQrM9n0+LDFe5EJppRpGAptGQLSpVXr1aUxz1ERVIOqW8qN PTew== 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=7MNVVmbFthAezpN2pHOcY1MnPgFCW9tk7Pxt1Car0bc=; b=q4sBQxXamux+kEmZFWHiky57kkY4Rw1AACedzCX07irkPgk4OjfYLgxbU+EWQqT3iy MiCb8u5w1Hiv2X+FIl7t9sc0eBb/p0+Nw8Y4dtmBHWmg6H0VoUxE8D4QkgHbzsJtm/a6 rxOw3A31LeYsWOGY8+5XqyddUApxP1Uwl9hVkg2rUFPPRstVpizNEQEM1Xj1pwPQFHaF gX6tHRmAQAP6xFKFL+g/0+HFf0zWdpHgk2vb+95410p/YlzBTCh+H9N8F67Kb/xebKj7 GrCuxYCERwmwb4Z6wsHO13zl/pT2sq6vJnqF+6ws/6a0DGUnxO2UD1ApR9J19zL8dOMI UhtA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Fg/gj+++"; 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=7MNVVmbFthAezpN2pHOcY1MnPgFCW9tk7Pxt1Car0bc=; b=Q9gVJLRMr3M9QJh3QsLM2fAWdYCEmWs9MOj9JZtJdO6zUacGQ5zQLfCY2J4AFPn/l9 i5rPkvT9Ci9W0fGvWrebbrDYBClWexj54GTkigrgISRaQpvda9yFYjLEpdRsjlX9i0YE wxPstG/hrA4S4/IZqyfE8JW/NAus0TO5hBXl4= 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=7MNVVmbFthAezpN2pHOcY1MnPgFCW9tk7Pxt1Car0bc=; b=sc0s9U8acCmnhjMaPsy4euE/CqmMHA91YAkqMYqWbIVeIaA9X6gwptkpg3gyGbbCiX 0rYRkX5xA/3f34sWQ+fwbM5m3bTVUkWbo7DVDtoMxaVdwsG82OW8cVn8vkspozXMJQU9 XYJdAEiL5/FW3rx3YeK+z9oFy6tVcAekCTUg+GSvuvgXC6z/2wAPRw35gIqnKwITIdzi USzliyBC24NrmLQBBd0ahyW/z2f1Q83Kn8ccSGbZQob5R4vXDyKU0iXb4vTJzgr39ncl Lw+dbj76Vy+GR7WSEWGuuqJ42edtrqoXnWbaEakBWBvyB0qFg7sR2sLTqnVx6oFawu/M vEkQ== X-Gm-Message-State: AO0yUKV3A1XPd1Sz/pykdW56reF3y3pp1LfgZYryD+/4llZa7RqZln1Q irx30znC9UnnFlBXj4fKwLG4Xctt X-Google-Smtp-Source: AK7set/WaTqdkOMDXbocgdj5wCPKIuwJMdV0srHrYvakwvYZkgCJdyAOnVfLDCbaJVBdFwZ4A3XO3w== X-Received: by 2002:a63:7b56:0:b0:4fb:933a:919 with SMTP id k22-20020a637b56000000b004fb933a0919mr5497229pgn.3.1677498054399; Mon, 27 Feb 2023 03:40:54 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:451:b0:19c:b3c9:49d5 with SMTP id iw17-20020a170903045100b0019cb3c949d5ls10500979plb.6.-pod-prod-gmail; Mon, 27 Feb 2023 03:40:53 -0800 (PST) X-Received: by 2002:a17:903:120c:b0:19c:bd10:3d40 with SMTP id l12-20020a170903120c00b0019cbd103d40mr17590783plh.40.1677498053393; Mon, 27 Feb 2023 03:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498053; cv=none; d=google.com; s=arc-20160816; b=TcyAiPSpH283VEly2qiWVAIK0xFIX1LYBjQ8o+CIhJsM50HCuQoUmEf0voxlhEA4jW G6j55drUCW4gSAFQQzySesoMIJ7fFDhFD+SIgcXfVCNyCAidhfJ0KQBe+VuqBGAiAzzW iMPRxHN7xfwbSzIvlf77b//QLYIFAbVkfuglSP79nj/mJpPH+IloqS9ietoz2RxHPEf2 DMtUHv4wmzXs6cR/7uLA6u8wm6cx1gWrjB0eN0tMiE77MOpjxuVfGg6webnTqEgssl6M 8TGrv7DjY/VSkwU4TRHcxuFxQZijbe1GPSLNdq7xpcvc5RX+m2WOP+Wsqe2+XqP95/eR nG6w== 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=Yy00kSfB9ubDpN+1KzITSR+hdj0rooRsqbMSOz16J0s=; b=UCSmgadewglEQAhsa786Lfxtx77ErFZTuNZrekFwJUxvThYZ1DJndd51EcA4TnEsS7 TXQaYO/eCmawnvsMeTKtLByuS04wZg247yyRr+GRgEdkYlBX1PMLwxQ1SHFpWNuxqYMo aJhzI7zIBPaEEgL/uIH85pGYtV5Sqyrav1SNVDQrlOPMj0K3Cy6X9BEmtwGyE+OV1LUZ ZItIrZ5BO94h8nIzWsYDFkWrBiFxvrUC2mI0G04T6kmNdYeSTAKgkbzPJAmHRUF3SPyC EMeINqa0Hx1Yx/95K9wJYumCd9XPIAssV88Df8fCNSHy3RQtUVzMskrlXrl8MV+wki5M LEDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Fg/gj+++"; 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 g12-20020a1709026b4c00b0019c86b0dd45sor2134271plt.96.2023.02.27.03.40.53 for (Google Transport Security); Mon, 27 Feb 2023 03:40:53 -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:cf4e:b0:19d:b20:4d1a with SMTP id e14-20020a170902cf4e00b0019d0b204d1amr3321667plg.60.1677498053066; Mon, 27 Feb 2023 03:40:53 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:40:52 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 11/18] drm: exynos: dsi: Add atomic_get_input_bus_fmts Date: Mon, 27 Feb 2023 17:09:18 +0530 Message-Id: <20230227113925.875425-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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="Fg/gj+++"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Finding the right input bus format throughout the pipeline is hard so add atomic_get_input_bus_fmts callback and initialize with the proper input format from list of supported output formats. This format can be used in pipeline for negotiating bus format between the DSI-end of this bridge and the other component closer to pipeline components. List of Pixel formats are taken from, AN13573 i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 3.7.4 Pixel formats Table 14. DSI pixel packing formats Reviewed-by: Frieder Schrempf Tested-by: Marek Szyprowski Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v13: - none Changes for v12: - update the logic suggested by Marek Changes for v11: - collect RB from Frieder - drop extra line Changes for v10: - none Changes for v9: - added MEDIA_BUS_FMT_FIXED - return MEDIA_BUS_FMT_RGB888_1X24 output_fmt if supported output_fmt list is unsupported. - added MEDIA_BUS_FMT_YUYV10_1X20, MEDIA_BUS_FMT_YUYV12_1X24 Changes for v8: - added pixel formats supported by NXP AN13573 i.MX 8/RT MIPI DSI/CSI-2 Changes for v7 - v4: - none Changes for v3: - include media-bus-format.h Changes for v2: - none Changes for v1: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 62 +++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 7f0703582506..aea56b6fbf17 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,66 @@ 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, +}; + +static bool exynos_dsi_pixel_output_fmt_supported(u32 fmt) +{ + int i; + + if (fmt == MEDIA_BUS_FMT_FIXED) + return false; + + 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; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + 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[0] = output_fmt; + *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 +1576,7 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_get_input_bus_fmts = exynos_dsi_atomic_get_input_bus_fmts, .atomic_check = exynos_dsi_atomic_check, .atomic_pre_enable = exynos_dsi_atomic_pre_enable, .atomic_enable = exynos_dsi_atomic_enable, From patchwork Mon Feb 27 11:39:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2752 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 8B6883F9C2 for ; Mon, 27 Feb 2023 12:41:02 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id s8-20020a170902b18800b0019c92f56a8asf3510167plr.22 for ; Mon, 27 Feb 2023 03:41:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498061; cv=pass; d=google.com; s=arc-20160816; b=v7uiKMj3mpcpqz+4iKmlUubg3EcPgnTs1XrFzWd61SodG5FR6GBdwfylO1shy1IjuE xLVpM4ISEcka/wPu0cY1oPptNOiKOz8e/vxF6Y4e7YALo1CwviQ099aUu+bWV/xcTpzd dde+irP9ir9/8JBG1gjN+RJ69W8yc8P8zx9eXKUmRKkS6KMSKWNXnaHrBqe4Dw0T3dSu MpHSh+Waetd8Zh4YcXqT1Y8lPFuWv6WylKePq3RiIAFZqIzz3AMGfIz+o93Oqqsy1BMz 8betIVGnKOQ+r30DSoD/WJHVHGFTn+E4xYKUAnBt4Tb4D2W35lg6jcpjKskawLX8b1Te 8Pdw== 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=SegeWF6S9BunpXDFhbO6R7dBqxqsGRYr3cXoZtW0Fho=; b=LdaEKqeT13QzI9mYe6uSPlBAUP7H68r5vUYcUGjXcb4NsxMwUuMKYjyRYIpaDdJTJm IVgOfmmH6Rw/kk7vcDYqVkSnbJNZ5jH1ilH02UC0uNPn2j4yrXgSdcrz+DVoDt0xp8sM jQ4k9zA5kHLRuwiDVHe197vgjT8hwDpbopFeO0aHhwrN3FVZkPl4ltwhlqDwzdohiuyu ghShY1Pg7qHC31pe2L0P2zjxjYDPf7EmDdwmSDH7OmYJA8G0+naHV7GwrSfZINE4+51U i/IVcWjuVY2Za1dyUeiSNx1WvIxyOqpoeuxKaslazvQ+tqT4B7BbXalQELB08wf41dcn JqBA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Xjfy4NB+; 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=SegeWF6S9BunpXDFhbO6R7dBqxqsGRYr3cXoZtW0Fho=; b=WcHOWIMz8FX1VfbQbmLP8oQaaOxy8T3J3hjB0aKCjzXb3ckJkV3TCrrR+qOy8+5abW pCrvxumsWrVZuhDFKGqdqWpBkhI8eKJRfuJ9XGKZyYSkS0UmlsSDyiv8bE+LPIkzVvAg echg9juzHi9R+hVva6qVtY1BwnO+IQ34Rl98o= 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=SegeWF6S9BunpXDFhbO6R7dBqxqsGRYr3cXoZtW0Fho=; b=Et+IvV3FbbAzTBychb+9IkjoaN5LKbr4T3XvyRD/HjKGSnwBGUp4ljUg/Xol9IyP21 DTKdAhimRr4dGlc/h4hVkuYB6T+gnPDMhERth0A37SamxRF+CG3/bjgECVkp60yy9+vI NSplFr330IjidUMrpGR4CP5ut+qwYNjVJxsnJEvZrVfBgEEUZZ42yN35v6qh/EaE9SoT E+3rAxp3HHJzeAAAjryxVjcKnBYc77hTwSna0EvCUa1A2mgVsEx5rdytyQ4kOI1xd/I+ YNDTy0bT/1+tAi04gZtDJVf6iV8v+GsCTKe8UIvabdDb4iayMV+7WhZKcZBkAmTgyz+M TGXg== X-Gm-Message-State: AO0yUKXj2uuswjNqEzT0BSobdGqmLyoaMaEX2HHa0TpYrgdV1wEn/hOA NC4hd1kj5e2ibX5pnRaPkX5DZE16 X-Google-Smtp-Source: AK7set93563mSe3ahpxOZqRJ8aQf18CXsLaa9SJYQpA09sq6lBP5iQfHnfDXVTu9Bz6/3KbLVsjoUQ== X-Received: by 2002:a17:902:f782:b0:19c:b7da:d2ef with SMTP id q2-20020a170902f78200b0019cb7dad2efmr4731431pln.12.1677498061306; Mon, 27 Feb 2023 03:41:01 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ef4c:b0:19c:a86d:b340 with SMTP id e12-20020a170902ef4c00b0019ca86db340ls10459819plx.9.-pod-prod-gmail; Mon, 27 Feb 2023 03:41:00 -0800 (PST) X-Received: by 2002:a17:902:e5cc:b0:19a:b754:4053 with SMTP id u12-20020a170902e5cc00b0019ab7544053mr30138285plf.26.1677498060398; Mon, 27 Feb 2023 03:41:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498060; cv=none; d=google.com; s=arc-20160816; b=iPnsRWqBhWDWbpWoV2o/GwC9Qgt+yhfN5IuYTSN9cz4REfcksdHwnwLORdlQUDsBAh IJXCxf+yAiagiC8Zqr3/SeyXOKtgvYFz2VaHzvKggLaAPECEe4epox25rbeuJspewBSw Jks9OG67kMfm2zykxRo9lFUQfXSzY2oMeMmwOtfaxzK5GUpaZu9az5ezvDOZcTx8n/HW s4ib1docR0V/ym+11NkfPdKI0UOlDU9i6KurmaML8tqtpGSwvFXkl987ESgssDXULRte y6SJRoXuEqp1i+mIKdBt/A2ZN86+AHyGERmc6peggqcX2ZZxNK2K38cS+ifNI0rcDGaR yB1g== 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=gqI591/7pV38dOGca+aLBhhdwvSSpofrW8ilT0Vq6Zg=; b=FlxhYbfmHUe2WBcM+yqsbZoXDCSxP1gAls73kRbZ7r4uYbAOtvQV+mfDQLCA0z204G WFm1lSVCuxFhvTwCRO1/JZ5qU/asTWgbWhMcg7wgnmU0derdhXFH13K20wkTtwYmrY9l TbmQpH8+mWOQi5AJ/MYAAv3Ddm7UVLOz7hKVIvMMU/FfXICKkywlGYEzSPrFCfr+jXYl V2EBppcdeAtwRw3VTLuUUDeOWaHfPbLj54LiCy2EN3QrSg5DEZmqK14tbYg1BVW+16JH 91mI2MZk8x5TXW82/e/SaYJXAcItiP+DQt+G+3tsa1fkJW8ZzjVAS+L7n52k9eDg5uVN SJbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Xjfy4NB+; 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 e14-20020a170902ed8e00b0019ac86db5a9sor2220077plj.58.2023.02.27.03.41.00 for (Google Transport Security); Mon, 27 Feb 2023 03:41:00 -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:6c7:b0:19c:a395:4acf with SMTP id kj7-20020a17090306c700b0019ca3954acfmr17002454plb.40.1677498060056; Mon, 27 Feb 2023 03:41:00 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:40:59 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 12/18] drm: exynos: dsi: Consolidate component and bridge Date: Mon, 27 Feb 2023 17:09:19 +0530 Message-Id: <20230227113925.875425-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=Xjfy4NB+; 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. Reviewed-by: Marek Vasut Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v13: - none Changes for v12: - fix unneeded decleration - collect RB from Marek Changes for v11: - none Changes for v10: - split from previous series patch "drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge" drivers/gpu/drm/exynos/exynos_drm_dsi.c | 169 +++++++++++++++++++----- 1 file changed, 134 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index aea56b6fbf17..de8604450fb9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -284,10 +284,10 @@ struct exynos_dsi_driver_data { 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 +317,19 @@ struct exynos_dsi { const struct exynos_dsi_driver_data *driver_data; const struct exynos_dsi_plat_data *plat_data; + + void *priv; +}; + +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_enc { + struct drm_encoder encoder; }; #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) @@ -1321,7 +1334,8 @@ 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 drm_encoder *encoder = &dsi->encoder; + struct exynos_dsi_enc *dsi_enc = dsi->priv; + struct drm_encoder *encoder = &dsi_enc->encoder; if (dsi->state & DSIM_STATE_VIDOUT_AVAILABLE) exynos_drm_crtc_te_handler(encoder->crtc); @@ -1590,9 +1604,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; struct drm_bridge *bridge; struct drm_panel *panel; int ret; @@ -1617,35 +1630,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; } @@ -1654,12 +1647,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); @@ -1733,11 +1728,67 @@ 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_enc = dsim->priv; + struct drm_encoder *encoder = &dsi_enc->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_enc = dsim->priv; + struct drm_device *drm = dsi_enc->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 drm_encoder *encoder = &dsi->encoder; + struct exynos_dsi_enc *dsi_enc = dsi->priv; + struct drm_encoder *encoder = &dsi_enc->encoder; struct drm_device *drm_dev = data; int ret; @@ -1755,7 +1806,7 @@ static void exynos_dsi_unbind(struct device *dev, struct device *master, { struct exynos_dsi *dsi = dev_get_drvdata(dev); - exynos_dsi_atomic_disable(&dsi->bridge, NULL); + dsi->bridge.funcs->atomic_disable(&dsi->bridge, NULL); mipi_dsi_host_unregister(&dsi->dsi_host); } @@ -1765,6 +1816,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_enc; + + dsi_enc = devm_kzalloc(dsim->dev, sizeof(*dsi_enc), GFP_KERNEL); + if (!dsi_enc) + return -ENOMEM; + + dsim->priv = dsi_enc; + 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, }; @@ -1859,7 +1944,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; @@ -1950,24 +2037,36 @@ static const struct dev_pm_ops exynos_dsi_pm_ops = { pm_runtime_force_resume) }; +static const struct exynos_dsim_host_ops exynos_dsi_host_ops = { + .register_host = exynos_dsi_register_host, + .unregister_host = exynos_dsi_unregister_host, + .attach = _exynos_dsi_host_attach, + .detach = _exynos_dsi_host_detach, +}; + static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS3250, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos4210_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS4210, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos5410_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5410, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos5422_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5422, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos5433_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5433, + .host_ops = &exynos_dsi_host_ops, }; static const struct of_device_id exynos_dsi_of_match[] = { From patchwork Mon Feb 27 11:39:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2753 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 1DAF03F9C2 for ; Mon, 27 Feb 2023 12:41:09 +0100 (CET) Received: by mail-pl1-f199.google.com with SMTP id z1-20020a170902d54100b00198bc9ba4edsf3524656plf.21 for ; Mon, 27 Feb 2023 03:41:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498068; cv=pass; d=google.com; s=arc-20160816; b=Ne65oXR+d/ahlOBi6+BZu+GpbyGezh/Rmc3QLUxx7rEdg0jI8ps/QZnUdUJ4jwtIGs 90bizPM+WrPJVOtB1e5hq4XQGKXip6enIlYmY8F5eBXoJvR+/obSyFEUl98RgDPHppMb 3fuL58x0HSd/GuS4PQrbdBe2gX4IFZ4orTPJAWYlHPI166Z8ww3/zoYmx3SehqaLveF4 Cx7jqtQOpKhOwJqc/eKgVV9F+1zWuP5om4BlBYcTVw4MuziCELDz2k8lEIiP7LRcscsq 1CGl6OmSX6yEXEz8RsPz5qljDLRxTqrHHq5Oy7eY8ZPKgcroTap9U5y/IVZmehsFm1X3 VMSQ== 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=4HKnPasbqN2givTjYW5kTJHWES5TxFJFVRL8E7tScKs=; b=iAYFEF3EKjMBt005hx5XsY8g3xHLhR7yOldlzrh1spmifCPY3zz0GOcCVpIp24PNH3 Qf0sTSjDcjEEpw9hWBHgy1PNixUWDAoxaAdunjlYWX+2wdSa4LrVQRGmYNkxnfhozz/p 4AiJl/3/iwW/91Zs/UdesC2XxPKcBvUKGRMbvfVvjBNrbX+Ls4EKN4voXt0RRGmkI+d2 Knn8phfoJFUzM6Q5EDx/hj96Dz+qf4ZGV9J0IIpaZWT8/lOIbQObWpxE63qJSHY7pMb2 4NzGoeea9+T3Ve5v2ock74iEN/U6BDBofbNxB54I/5jgSvkaPmiCP42r8y6PYIFt/MCV LpHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=etdN6B4M; 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=4HKnPasbqN2givTjYW5kTJHWES5TxFJFVRL8E7tScKs=; b=jdtksBdbctICRM8Ga3NNkK4JnTw11AELRc51lHg9GaYfbTJor2UfxvzyzhBmRqNbbA fypfRY+ib+eEO4B9vkgvkIlaJDFrtzlipUZA0ZwFW5Ab4gg98CGxvXbmBEBfUVcq+dov P0oFiaCzpyU/L9z0vG/VK9I744ZeNueszk0Gs= 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=4HKnPasbqN2givTjYW5kTJHWES5TxFJFVRL8E7tScKs=; b=l2B9fDNa957cMgg32QpBkiQmyh584zyFLsADFcjL0WN3iLqVMuzixBLeHvRXd+76A2 4jtBaQ/bqFEOi5VDus0Cu6czRymUqaYcOA201jTv92olCJBBvZICq+3Hfqz8wi02qvxG aUNleOA9WI4hs/FeHH8o9QS/rKDZfh0UM9+if1/6qbewtdlALbdTdFkdssZwmWwgPcwD 4T3/fqCDc/P6oapwwdnSf1D3gOWzbxiGwoZFO556j494NTXJfPLyyHgjJ0d/Gln6vHfD 7kGhVBD9bZ6KNquxzJ6LljXAM4iypr0csJntFHn+z51lH4Og2KKC18+RH3/PfV6ofs5C r2DQ== X-Gm-Message-State: AO0yUKW29m54j/uQH30mwcsULHz1/B8fCtV2Ntyk1NIZ1lOca9AqcX2o CwkxhC3c4cuxxXEume1hYDNbTvFC X-Google-Smtp-Source: AK7set/FGKs0bV2QYJu++HPWwwcwhuk38qlzRDdfgFJAeqQUDjt5lggtE5N976C1oHzbi2Lcs1ywqA== X-Received: by 2002:a17:90b:4b10:b0:22c:3ee1:db3b with SMTP id lx16-20020a17090b4b1000b0022c3ee1db3bmr4839956pjb.3.1677498067909; Mon, 27 Feb 2023 03:41:07 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:5d82:b0:234:2ef4:2e9 with SMTP id t2-20020a17090a5d8200b002342ef402e9ls8891044pji.0.-pod-control-gmail; Mon, 27 Feb 2023 03:41:07 -0800 (PST) X-Received: by 2002:a17:903:2ca:b0:19d:d960:122c with SMTP id s10-20020a17090302ca00b0019dd960122cmr862458plk.58.1677498067072; Mon, 27 Feb 2023 03:41:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498067; cv=none; d=google.com; s=arc-20160816; b=oOLp494ERJsA3hQt8oPtYEzfzR1RobNwdsM+bq7of8SMI5H2LEzBND67qBwWVw1TIG OOFkDZ4CqBrlHKAbE9YQhpMLhissfoJMCJwxG4of651pIdzk3H44zGpEjwdz2/h9XxdF DUpov67W26CeXbjYmUnXIosmIIf6Fil8uDaQnMhrQM9v/DGyNflLbJaWHvtJBdwNZOEg SOaoyH0fFjf8Rzx0nHpnDp3u0/GM1WEDd/E30u3/eJe7br2d3opNLSPtE5VTNddvmxqN MhCpoBx7D9Djvnu7gA3C2NdtGlKlK+A4CeZ06LJ5sonhxWisAD/BO5tjVM6TV54rld/h vkUw== 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=h/pvsdevlqP7CP6iuiZkDWC//vV9mr41wh5OsotB/Yc=; b=o0Ei8gLhN26ouDU46rQtR2WQc6e7/32qTLEEYYRxAIbZSNoorT6ZQlGT7dW/eqIocu YbkaL8MSkVdcIn/0amGFIrgYj/3XoxDzvSa+IxiJ/HjyZIQBgGiHmv7c+nI/QkFpN1fz xW2u8Ua3dh2jX32MOjhqtSitKPmVSpcUElRuY0p/gP+BXd5YIUlY28FFIGHpTF91DnXT lavWv0v7iOIMuGxyRiHR9P+qkYlo2L9Aku3DSq4a+/c3yGT7vhf0lylWJnZgYKIn0xku 8p5zlIEMMmp2Niv/SQiHYAyiQHKX9etepd4hgwzFRV6UpdGWK/XCQCtC3J4Nuoxgipne yZ6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=etdN6B4M; 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 y16-20020a170902b49000b0019cb7ed7172sor2314409plr.8.2023.02.27.03.41.07 for (Google Transport Security); Mon, 27 Feb 2023 03:41:07 -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:f542:b0:19c:e405:4446 with SMTP id h2-20020a170902f54200b0019ce4054446mr8518208plf.30.1677498066732; Mon, 27 Feb 2023 03:41:06 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:41:06 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 13/18] drm: exynos: dsi: Add host helper for te_irq_handler Date: Mon, 27 Feb 2023 17:09:20 +0530 Message-Id: <20230227113925.875425-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=etdN6B4M; 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: , IRQ handler for te-gpio seems to be common across DSIM host. However, Exynos is handling this via CRTC drivers but there is no clear evidence on how the same has been handled in i.MX8MM. Keeping the handler as-it-is can be a viable option but adding DSIM bridge core in upcoming patches is not possible to call Exynos CRTC handler as DSIM bridge has to be common across DRM bridge core instead of platform specific DRM drivers like Exynos here. So, this patch handles the handler via platform host helper, so-that handling platform specific hook across Exynos and generic can be reasonable till it makes it generic across all platforms. Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v13: - none Changes for v12: - updated patch - suggested by Marek V Changes for v11: - none Changes for v10: - split from previous series patch "drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge" drivers/gpu/drm/exynos/exynos_drm_dsi.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index de8604450fb9..938bbc701d3c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -326,6 +326,7 @@ struct exynos_dsim_host_ops { 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); + irqreturn_t (*te_irq_handler)(struct exynos_dsi *dsim); }; struct exynos_dsi_enc { @@ -1334,11 +1335,10 @@ 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_enc *dsi_enc = dsi->priv; - struct drm_encoder *encoder = &dsi_enc->encoder; + const struct exynos_dsi_plat_data *pdata = dsi->plat_data; - if (dsi->state & DSIM_STATE_VIDOUT_AVAILABLE) - exynos_drm_crtc_te_handler(encoder->crtc); + if (pdata->host_ops && pdata->host_ops->te_irq_handler) + return pdata->host_ops->te_irq_handler(dsi); return IRQ_HANDLED; } @@ -1728,6 +1728,17 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) return 0; } +static irqreturn_t _exynos_dsi_te_irq_handler(struct exynos_dsi *dsim) +{ + struct exynos_dsi_enc *dsi_enc = dsim->priv; + struct drm_encoder *encoder = &dsi_enc->encoder; + + if (dsim->state & DSIM_STATE_VIDOUT_AVAILABLE) + exynos_drm_crtc_te_handler(encoder->crtc); + + return IRQ_HANDLED; +} + static int _exynos_dsi_host_attach(struct exynos_dsi *dsim, struct mipi_dsi_device *device) { @@ -2042,6 +2053,7 @@ static const struct exynos_dsim_host_ops exynos_dsi_host_ops = { .unregister_host = exynos_dsi_unregister_host, .attach = _exynos_dsi_host_attach, .detach = _exynos_dsi_host_detach, + .te_irq_handler = _exynos_dsi_te_irq_handler, }; static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = { From patchwork Mon Feb 27 11:39:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2754 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5E59C3F9C2 for ; Mon, 27 Feb 2023 12:41:18 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id d22-20020a63d716000000b00502e3fb8ff3sf1792223pgg.10 for ; Mon, 27 Feb 2023 03:41:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498077; cv=pass; d=google.com; s=arc-20160816; b=WBfTBUF8mTnXmNzLd5JdQjxKkgXodpZoaumXT82nAupV4KswrrDcDNukKxcq61mYKb nRv0mIy8a7zCgMSEbubgSuLSky/1bNEgASf1fKLyxvngzZ9EDx53d0xZS0TgwpVFOAkB Tydog7MynCHSqRcv8qSd7qa1gkWsnfOymlhlirlcASY+qgjwehlIpUMeW4Wif36YY4Q8 UphFjzFKHd+9RSNiokWKV1llljEIBwbSxbNtylmWT5gC6fxQ25/pWT2So6eQzIJo4zTn fN+iaKhkd43k3TztAsTl8aSUtki32je2HXyUcmINoaGtM5Kja5542BvlBGLKuX3CQgAu P01g== 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=vbiBWYOuQQlaaaGthI0Bh+TUcXObG5DMGVOHLQUkmKw=; b=q/u2b99UPDXMO3f81nSRXQhqtAD9oCDFheMz2oqbYled+H7W1PHtKv/isJAEq8s/Ik 28+ydxdfvET+QO450HshOgy6yk3tKstNM9QMKcMTNLUTAIB7jQmVPCnud+BPfYVm3Ph/ ZaUS0/rqA8dxqk03y/v1Ka0UZN3nmj7DnhnZRTyHnijMQOb1DhnQHx7CGwDSe4MxzrY0 L69tw/vLuuFjT0j8hqMjDC6alWd+yURT0u9CNat2G4SXxwjXKSSEHZQVh8j/EKtSepG7 knmDB7F5fnFayhDd2SQefwc/vgmXKZy8fRD/C+tJLa2eekkSaR7QmkH8TsasGoERk5pB M2fw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=e49xPyL2; 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=vbiBWYOuQQlaaaGthI0Bh+TUcXObG5DMGVOHLQUkmKw=; b=U+tVqi1m4Ofkh0WaSj28HsBlii4HVlXFCcVoXkx6KWEutg4PPpQ3iuAS2y3sT4qQ5v 0mLgiUMClsBXSWMroS6IbRNuD8P+5riluGoGokM8clMGa1bpS1LuiBi56n0c+BL3c+z7 xQjGns+aVngoTHw+TxRSkeOg93waIUgAVHBx0= 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=vbiBWYOuQQlaaaGthI0Bh+TUcXObG5DMGVOHLQUkmKw=; b=pSylOI680WToXxvQyu9mMbuJTUGbFRgDpWS5DU10t/k3dOmKXgHTiQ2YSZMQ7+4pSu E+hWtmisBUQLlMlAnZb6jCrOBmOcBMQvJfCD2WUQK9HGZXkMxtq2J0qBhj41cnNtaBWn rUJ9m/63nZUCix/VQ1gdoJ04Yk4maMLfvFaj5XOk4NowZrgcwjp1IlAaCd9fcCVjGhfd fbDuiGEz32PrtLOH2dhBXDUT/+sPBRaHkqcVNSTlSuI2uMD6X94kQPsKRSFL+sc/4E7k DmJ0YOGoIcaBIon3QIfCs4BHJvaUrEupQM/yUIp2TfXMidqcxEdsm7cghF6aSg2bVl+z xL/Q== X-Gm-Message-State: AO0yUKU5ZN144PyUTHptRZx+l5L14Gnt9R8rXxyMjV2dS1AZu7Mv16UY YFRvhTiS57cZk4bf6dgxukEO1ZW8 X-Google-Smtp-Source: AK7set8WNwLuSp43BHKCurBkdw5mHNhiV++rR17UqT4iUz2J1Xk6FFQjotcw8avVWkqHDlwrSoAdEg== X-Received: by 2002:a17:902:a3cd:b0:19a:82a2:fcf9 with SMTP id q13-20020a170902a3cd00b0019a82a2fcf9mr5896039plb.2.1677498077040; Mon, 27 Feb 2023 03:41:17 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:da88:b0:19c:2b1c:4d75 with SMTP id j8-20020a170902da8800b0019c2b1c4d75ls8836349plx.0.-pod-prod-gmail; Mon, 27 Feb 2023 03:41:16 -0800 (PST) X-Received: by 2002:a17:902:ea07:b0:19a:9831:c8d6 with SMTP id s7-20020a170902ea0700b0019a9831c8d6mr27750477plg.50.1677498075924; Mon, 27 Feb 2023 03:41:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498075; cv=none; d=google.com; s=arc-20160816; b=UAUwDysdVulPL4YDUNzyRZx/TyK9/2hZ1Mk4PxJhcmI9UleR3CVD0vQS2TR3tg/Rw2 6g2PyCjGN3VZ7eHMuKTFGv6o6WTSq0J4guQXBQFu/ka4r2UrlDKDSh6l32ABgO43ggbA oh02/bYdDL0346eDcKrhaLtOBWXkXvavSXwTftXGubG2cDEGrA1bMDNoOnP/7bkISXER fl0c/rBNALT5QsGdGX1xe4so/6WBCQYdwfO5Z4SK1gbNpss4VJ/yj56al1+rP/0V4msb HUbiTQkGR5sMGps94WjDXhDuGhbJxOJsEBjikGi2uGuTYBUeWQINUWLFBYGG5wDLGCOg 4hBQ== 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=UvJ9dKkJMjKY/4A/NiSqErkks3wyDJwycnutYJtRshQ=; b=M/FA4hFyRoYUrXD8m8gslbj/iaDA8H7mZjfMjqGOchPOey6rLZG7lxz1rruLbiV4mE LQQKfdFZ/bCHxcbe3TIs80bTNAoWq8/LswzFa9UxOwWvmxFccQy4T0v1e45RPva7Q1Mp tC3PNWe6rIfQHPsopYwZcu8WAdzhtrS6HTG04qvLZFug8RAlQveUXISpYmjYgiV1YUbC E74VP/L3jXQ7O6a5EKK0rWK4FNdbqKJjbRAv7XrXLmnpY59gX3w2KhwkSh/Be/LqxQpn VEMIY2SmNgjICYrq2yaYsfC3VbN0JskKI1x0c7cJhlDBbkVsG4HAm+cz8mX+8yxXF5/J Yd9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=e49xPyL2; 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 q4-20020a170902f78400b0019aa8f911e2sor2549747pln.197.2023.02.27.03.41.15 for (Google Transport Security); Mon, 27 Feb 2023 03:41: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:d4ca:b0:19a:9880:175f with SMTP id o10-20020a170902d4ca00b0019a9880175fmr30454400plg.51.1677498074721; Mon, 27 Feb 2023 03:41:14 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:41:14 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 14/18] drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge Date: Mon, 27 Feb 2023 17:09:21 +0530 Message-Id: <20230227113925.875425-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=e49xPyL2; 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 Reviewed-by: Marek Vasut Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v13: - none Changes for v11: - sort MAINTAINERS list - collect RB from Marek Changes for v11: - fix BIT macro replacements - fix checkpatch --strict warnings Changes for v10: - don't add new code - move the files and update samsung_dsim names - update commit message Changes for v9: - drop the bridge attach fix for Exynos Changes for v8: - update the commit message head Changes for v7: - fix the drm bridge attach chain for exynos drm dsi driver - fix the hw_type checking logic Changes for v6: - handle previous bridge pointer for exynos dsi Changes for v5: - [mszyprow] reworked driver initialization using the same approach as in drivers/gpu/drm/{exynos/exynos_dp.c, bridge/analogix/analogix_dp_core.c}, removed weak functions, moved exynos_dsi_driver back to exynos_drm_dsi.c and restored integration with exynos_drm custom initialization. - updated the commit message [Jagan] Changes for v4: - include Inki Dae in MAINTAINERS - remove dsi_driver probe in exynos_drm_drv to support multi-arch build Changes for v3: - restore gpio related fixes - restore proper bridge chain - rework initialization issue - fix header includes in proper way Changes for v2: - fixed exynos dsi driver conversion (Marek Szyprowski) - updated commit message - updated MAINTAINERS file Changes for v1: - don't maintain component_ops in bridge driver - don't maintain platform glue code in bridge driver - add platform-specific glue code and make a common bridge MAINTAINERS | 9 + drivers/gpu/drm/bridge/Kconfig | 12 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/samsung-dsim.c | 1866 +++++++++++++++++++++ drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2020 +---------------------- include/drm/bridge/samsung-dsim.h | 114 ++ 7 files changed, 2049 insertions(+), 1974 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 97d814a19475..f604c36b31bf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6737,6 +6737,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: Inki Dae +M: Jagan Teki +M: Marek Szyprowski +S: Maintained +T: git git://anongit.freedesktop.org/drm/drm-misc +F: drivers/gpu/drm/bridge/samsung-dsim.c +F: include/drm/bridge/samsung-dsim.h + DRM DRIVER FOR SAMSUNG S6D27A1 PANELS M: Markuss Broks S: Maintained diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 12e8f30c65f7..f076a09afac0 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -220,6 +220,18 @@ config DRM_PARADE_PS8640 The PS8640 is a high-performance and low-power MIPI DSI to eDP converter +config DRM_SAMSUNG_DSIM + tristate "Samsung MIPI DSIM bridge driver" + depends on COMMON_CLK + depends on OF && HAS_IOMEM + select DRM_KMS_HELPER + select DRM_MIPI_DSI + select DRM_PANEL_BRIDGE + help + The Samsung MIPI DSIM bridge controller driver. + This MIPI DSIM bridge can be found it on Exynos SoCs and + NXP's i.MX8M Mini/Nano. + config DRM_SIL_SII8620 tristate "Silicon Image SII8620 HDMI/MHL bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 52f6e8b4a821..2b892b7ed59e 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o +obj-$(CONFIG_DRM_SAMSUNG_DSIM) += samsung-dsim.o obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o obj-$(CONFIG_DRM_SII902X) += sii902x.o obj-$(CONFIG_DRM_SII9234) += sii9234.o diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c new file mode 100644 index 000000000000..e0dac7aeab37 --- /dev/null +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -0,0 +1,1866 @@ +// 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