From patchwork Thu Jan 26 14:44:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2674 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CE5753F046 for ; Thu, 26 Jan 2023 15:45:09 +0100 (CET) Received: by mail-pj1-f70.google.com with SMTP id on9-20020a17090b1d0900b0022955c2f0f4sf3418355pjb.1 for ; Thu, 26 Jan 2023 06:45:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744308; cv=pass; d=google.com; s=arc-20160816; b=fr9wBiXnTsmjwrksjJUfm9CJOeffxtJBc8LNTglIsfb9p12lTJg179kKUELbpKuFgt RB2a7oOdNn1sKmrheVbURHZxvArONSsW5CDEsncXKNeQdqT0ydxIfDZsaythj2dkQWAU I6phP8vHk5pQGzkyGpIs+yHo584bJdM4BC3Y68FU2gc3UhuCANwmXMwy0N7hTqd3c/aZ EXr0eMLpfnvXWqlQN91/+qJYvh6QAGzHcejb+ELr9DSuV0a2lkBTwHBx4hodlUIOgL4a lANUuvPZl6W6hCzPKLGVJ0ks5yVy705nHq9UROTGS3+286KuQz+fzAuQK3L5ZWLKGWp2 w8yQ== 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=i0D7m4QFBGK6WPGOXu24RYhoSakVrHvuyE2wum9rnzs=; b=OEL4n5BIcVuxrwmfrjCbn3x2xnz6llv4wYmh6lhMpKjhY+RpQW6m1OXJikeMvabKn4 3g3xy0FhQBWZwcGCWqe48ftV4rFKAt7xWN4HlVr/P5zKqnGHXs9u58eX46/cyu9p/KWe +r+AFy2vgakZeMaZi68YO+I1CqJ+29KXke4d9KongC7KqYUPfGHSn7u26ZzAjvS7h3Ta TcJLScK2zuqKWbIq8IY/pp+EMQn8qbTPvx2a3dMiQzqBkoy6jmXuyB6M87kH+GXPmhxL dJNq5T15VNW7ZowShjefcF4ag9w9xd/j244TtiQ51+VUM1GX98ib2dzzVbu9fOuKz4g/ VvGA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=InagqSKu; 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=i0D7m4QFBGK6WPGOXu24RYhoSakVrHvuyE2wum9rnzs=; b=SKoJFbNuoIpzBcUtL6JhLqRT4YMx6HvpY6tlGX2WCEhU+lFTHVSPzyY9j3evzitDua UKrwd86eYIr9/Zy+eOkUDtfUj1a9ZVvtf3g6ik7462Th7uFw/79qgCXmN3b1hC/aspsF kPloBeSc2eqKny6bt5WGvSiXZqUdI7O0dZIoY= 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=i0D7m4QFBGK6WPGOXu24RYhoSakVrHvuyE2wum9rnzs=; b=gRE6zwj4kzh1cX7pxVV7IKi03tRRqMBr9o0WhGHvb33O9b6OsY8BgTI/qtbbw6Aya1 z6UC1A/zaIzAMtsd4OWkzRnMG/WRrO6tvY1H+BG4VSwM7UGHedPglBm68Y4PclgOfXvK lHC8WFBclZoaahP6gctOzbcyWjUCPzveK4QvSrgXasifDF8yqotNbke8iTn2T2IxlhJQ PVu75ioN0Gh6UWGs8MHJUVZWs8QyOGRfqqaTesSSSzCutGxeCvtRvi9X9x6Y+oVxVQt1 Dk/D+62fmOy5sSwkBQ4vOC8b1p/xFi1Jfwj17TCXlVp+VZkU3XCAtI2B/3guEOQTi3f/ Prvw== X-Gm-Message-State: AFqh2kpWrMB/euFHmHHt+O//dVhyRdiSLwMOrHNQ40irSEvvP6yFOzUi l3UA6R64FNIECKV7XJRsT/qIisOy X-Google-Smtp-Source: AMrXdXtNOAl9tbqIlwnglEMAQToYqeINs+XIfMQtWpmpf1yAo3Y3IZ5G88oygoYr3UA4KZw2dcIovw== X-Received: by 2002:a17:90b:2686:b0:226:eccc:1d65 with SMTP id pl6-20020a17090b268600b00226eccc1d65mr4898036pjb.41.1674744308483; Thu, 26 Jan 2023 06:45:08 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:2312:b0:194:d87a:ffa6 with SMTP id d18-20020a170903231200b00194d87affa6ls2381757plh.1.-pod-prod-gmail; Thu, 26 Jan 2023 06:45:07 -0800 (PST) X-Received: by 2002:a17:902:7c8d:b0:194:9c02:6ea1 with SMTP id y13-20020a1709027c8d00b001949c026ea1mr33149662pll.0.1674744307461; Thu, 26 Jan 2023 06:45:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744307; cv=none; d=google.com; s=arc-20160816; b=A+QubKw7ZsTCFzteDQ5x8xAQvOHlRqzPdmCCH0KIe6fHKJExHaU9i/owEV16XYi2iU feBPkUMbHBpGcMhKub2NGSDZBfgwBUiXoq/8yuTrO/Jpasx+gqpqP/svHaezMUqiqnb9 VEhegT4qLDyNqsnsIXm4SaYciUYhEjDbC7iATskqL9Fa5wKuVoqlIq90nrOqNF1UBpNK bhjOHoxgYeBuDTrOFfDGvHNTpgaKBQivdrS3hJ2OZTK58oc6Mo+o3kW7HBd7hYXR4O+E exiErqH/xwcOPkcUkMPmXO8cW4tpHK1V7Zx/65EbhQiXEqQIQiZoTm6pPTvq6vqLMWmY SUrw== 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=WK+2n5leeCN1ZUwhUDdriDW81kYnEsZfkVBz+dLgw2o=; b=uLJtl27kjDnzt68QV6MRNxup7yX/Jua/OLtpImPQEdkrJSsFnvQhPBLQRw2nQ219ns Jg8MWviRzNxPPihI7X9gWH3eYj1N+1+fyyZR161sjgwvqltAQh6eMHzHEYfl3mzZOTXX plOi+DpV/6zCDs14KOF3bHJT5gIisx4md0851OxLLun5cv5mDMFdgOzvVhNwS9SbvzcS sf5K7sOLA7fVMqslyZbS13aElOoImMGzdvbDD6tn4fWacju6e8fzjQyAOX4pv2l9QW7B lnNFJWuYDR32uxs3Z9RI4ReBsEIk2hkooexCUtwbsEPDvWuMgawcph9yWIzRBwrSNe6W 1GqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=InagqSKu; 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 jj4-20020a170903048400b00194ab28325fsor671004plb.168.2023.01.26.06.45.07 for (Google Transport Security); Thu, 26 Jan 2023 06:45: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:90b:17cb:b0:22b:b9f4:4ad1 with SMTP id me11-20020a17090b17cb00b0022bb9f44ad1mr22793352pjb.34.1674744306993; Thu, 26 Jan 2023 06:45:06 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:45:06 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 01/18] drm: of: Lookup if child node has DSI panel or bridge Date: Thu, 26 Jan 2023 20:14:10 +0530 Message-Id: <20230126144427.607098-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=InagqSKu; 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 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 7bbcb999bb75..e165951e3545 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -216,6 +216,35 @@ int drm_of_encoder_active_endpoint(struct device_node *node, } EXPORT_SYMBOL_GPL(drm_of_encoder_active_endpoint); +static int of_drm_find_panel_or_bridge(struct device_node *remote, + struct drm_panel **panel, + struct drm_bridge **bridge) +{ + int ret = -EPROBE_DEFER; + + if (panel) { + *panel = of_drm_find_panel(remote); + if (!IS_ERR(*panel)) + ret = 0; + else + *panel = NULL; + } + + /* No panel found yet, check for a bridge next. */ + if (bridge) { + if (ret) { + *bridge = of_drm_find_bridge(remote); + if (*bridge) + ret = 0; + } else { + *bridge = NULL; + } + } + + of_node_put(remote); + return ret; +} + /** * drm_of_find_panel_or_bridge - return connected panel or bridge device * @np: device tree node containing encoder output ports @@ -238,7 +267,6 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, struct drm_panel **panel, struct drm_bridge **bridge) { - int ret = -EPROBE_DEFER; struct device_node *remote; if (!panel && !bridge) @@ -259,30 +287,74 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, if (!remote) return -ENODEV; - if (panel) { - *panel = of_drm_find_panel(remote); - if (!IS_ERR(*panel)) - ret = 0; - else - *panel = NULL; - } + return of_drm_find_panel_or_bridge(remote, panel, bridge); +} +EXPORT_SYMBOL_GPL(drm_of_find_panel_or_bridge); - /* No panel found yet, check for a bridge next. */ - if (bridge) { - if (ret) { - *bridge = of_drm_find_bridge(remote); - if (*bridge) - ret = 0; - } else { - *bridge = NULL; - } +/** + * drm_of_dsi_find_panel_or_bridge - return connected DSI panel or bridge device + * @np: device tree node containing encoder output ports + * @port: port in the device tree node + * @endpoint: endpoint in the device tree node + * @panel: pointer to hold returned drm_panel + * @bridge: pointer to hold returned drm_bridge + * + * Lookup for a child DSI node of the given parent that isn't either port + * or ports. If it is found then it will directly find the panel or bridge + * otherwise lookup for the child node with a given port and endpoint number + * as drm_of_find_panel_or_bridge does. + * + * Lookup a given child DSI node or a DT node's port and endpoint number, + * find the connected node and return either the associated struct drm_panel + * or drm_bridge device. Either @panel or @bridge must not be NULL. + * + * Returns zero if successful, or one of the standard error codes if it fails. + */ +int drm_of_dsi_find_panel_or_bridge(const struct device_node *np, + int port, int endpoint, + struct drm_panel **panel, + struct drm_bridge **bridge) +{ + struct device_node *remote; + + if (!panel && !bridge) + return -EINVAL; + if (panel) + *panel = NULL; + /** + * Devices can also be child nodes when we also control that device + * through the upstream device (ie, MIPI-DCS for a MIPI-DSI device). + * + * Lookup for a child node of the given parent that isn't either port + * or ports. + */ + for_each_available_child_of_node(np, remote) { + if (of_node_name_eq(remote, "port") || + of_node_name_eq(remote, "ports")) + continue; + + goto of_find_panel_or_bridge; } - of_node_put(remote); - return ret; + /* + * of_graph_get_remote_node() produces a noisy error message if port + * node isn't found and the absence of the port is a legit case here, + * so at first we silently check whether graph presents in the + * device-tree node. + */ + if (!of_graph_is_present(np)) + return -ENODEV; + + remote = of_graph_get_remote_node(np, port, endpoint); + +of_find_panel_or_bridge: + if (!remote) + return -ENODEV; + + return of_drm_find_panel_or_bridge(remote, panel, bridge); } -EXPORT_SYMBOL_GPL(drm_of_find_panel_or_bridge); +EXPORT_SYMBOL_GPL(drm_of_dsi_find_panel_or_bridge); enum drm_of_lvds_pixels { DRM_OF_LVDS_EVEN = BIT(0), diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h index 10ab58c40746..7a97157c1fa0 100644 --- a/include/drm/drm_of.h +++ b/include/drm/drm_of.h @@ -47,6 +47,10 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, int port, int endpoint, struct drm_panel **panel, struct drm_bridge **bridge); +int drm_of_dsi_find_panel_or_bridge(const struct device_node *np, + int port, int endpoint, + struct drm_panel **panel, + struct drm_bridge **bridge); int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1, const struct device_node *port2); int drm_of_lvds_get_data_mapping(const struct device_node *port); @@ -99,6 +103,14 @@ static inline int drm_of_find_panel_or_bridge(const struct device_node *np, return -EINVAL; } +static inline int drm_of_dsi_find_panel_or_bridge(const struct device_node *np, + int port, int endpoint, + struct drm_panel **panel, + struct drm_bridge **bridge) +{ + return -EINVAL; +} + static inline int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1, const struct device_node *port2) From patchwork Thu Jan 26 14:44: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: 2675 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 5FF553F046 for ; Thu, 26 Jan 2023 15:45:17 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id e184-20020a6369c1000000b0049de6cfcc40sf842851pgc.19 for ; Thu, 26 Jan 2023 06:45:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744316; cv=pass; d=google.com; s=arc-20160816; b=hMwVVnJTQC49nC1/QY18Uv5lyizZDG2aebO1c2NQdYfu4pZnHFuFgNXTk69BxUwANw 2jvYuAU/LWfvGBpzk/idTfsPYdDcBOPAej/hzVcbniInByF0iZRZSapHhXJOhMZVeX0K E8S9l9XWuumpdsW9D6t/ky4fVTx6FrbBaz6VoFgtsT+hdJ27rlIoBUrVVniHUolO58D7 ZPWi/UoETE9+U+sJhy/w9KocfUNkKB3c5NVmXUcq5Tc7jhH4Z5piwXCs+/RMnxqJnhLN LHdZUkmrHZM4QooehvYA3YCzRldeWXvFn5mqKYPFWteofJr0Wg1mFwctsT7jrDudLgAS rJ7Q== 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=RxR1SasJ2PPHWQQNBML89qY6ba2+wWhbqGfHT3YzEzE=; b=1D/3GDkKX/AtasbdUNP/jXR/Ch4I+MSbDLO6XjUhl4fo1Hlyc7qaXGTweRsvymhtcZ ER6hsB8NjOVZ7e5ne/W2PTrVEfD9uG2Y9awjUHZOqxxhV5SWabRMzvHTt0TGwLLud6T+ +r4smRHbY3Qi3r0RdcIia57WC5uXHrKddTdzb1yAowmCclFKBy6KCmPJNp2AJPqHR9xh GIei2RHqEhAE6oD4CrIL11knteV6E77URrQNG6TFhbwwVjULtD/m0ECKRzg4FoYk7Tlq m9YtLoS+EC5VwnABW/E/QD9PXSR15y+G/wQSUrD8iq4II9vYCClrTftrJU/38OwcJqy5 IT9w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NjLrpZiH; 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=RxR1SasJ2PPHWQQNBML89qY6ba2+wWhbqGfHT3YzEzE=; b=lbBA6FX3fmkUDN2jeaU2Kn9XYTzRjkf/qJpMsETksnZQhFWPjcCBFZeMIN3kPGwWlW 6sHMVFGkf4tFXmP6A3muEZ7gmLCN8iJyksCjtr0VDrpGRq3wHN/DDqdpLv7ue3UHkTiT ydxDNiS138HBa1E/+fvjgUMqgugg/dbza1Jbg= 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=RxR1SasJ2PPHWQQNBML89qY6ba2+wWhbqGfHT3YzEzE=; b=sHIHcYnECGvznGOM3XYafRZ+I8LrNWi4gB/nxSJjPRBGxOW1mZvrHv1auv8Iqi3rw+ Zh1pVPZotkxKNfO3FhAMglm7Q89mTZY3IZ+Q0TshW5ckweICK/tpbXAPvNT6PyR58td6 JAsrCImxCvrx1dosNIOjrLijqvxRlbaxalad922xJjIn4uiCUIcz/2LVRBoBL+GChMlk XW+3Yr5Y7VCtDsGNY0zy84Y0tm1okWx2OW8E7YpNd5n9bRKm+EIULmyy8WcWTs5GtLS5 x15ryH7cAEYf9c4TCsRXIlJEbPDo+/BBgiRdQcZKZ6Mhy6uCWHxwtgndFa7WBMeal/We ueww== X-Gm-Message-State: AO0yUKWphkV8RVgWoUBN0Tja8vXaCXYFEKEepbH/UL996o1HU1rLfVZf ymMUtL5qBsATu/dhVwgVTLyAJ6bs X-Google-Smtp-Source: AK7set9diDYUHLn27V+eMaHQ6LPH31O6aUHWLdTQ9w8kcLcn6DW1zFQuK+pZEDvRPVQSbodeAU9A/A== X-Received: by 2002:a17:902:70c2:b0:196:4e61:b6b5 with SMTP id l2-20020a17090270c200b001964e61b6b5mr4695plt.2.1674744316035; Thu, 26 Jan 2023 06:45:16 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:4a92:b0:226:e7:18f9 with SMTP id lp18-20020a17090b4a9200b0022600e718f9ls6366308pjb.0.-pod-canary-gmail; Thu, 26 Jan 2023 06:45:15 -0800 (PST) X-Received: by 2002:a17:902:d651:b0:194:bdcf:1ab8 with SMTP id y17-20020a170902d65100b00194bdcf1ab8mr28661366plh.37.1674744315149; Thu, 26 Jan 2023 06:45:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744315; cv=none; d=google.com; s=arc-20160816; b=vLmdXCmOCzVINbZflB5QnHLmGcbGxFkn0uH+t8dFd2eUDeebgH21q1h5AO6A3lWQY4 HEQjxBbG9zwKto9KSUPEHO5znLqC4DXuMqy/Kf9PUgtgqlNoDC8+PtrzoeEG/YdGnV9t Upk7Pesz9sXTTt8hTr9Miidb+CWzgKJlf0r/oUtgwT4c4WHETTmWrjJ4mZtJbPkt2GGC LQ2Of9Zwe+zPHb9LBP6sTeZ/W7CDzEOfCMQL7/sr2KiIP4YuL1t99Dg26eC8AzLvZqdH uZvXzL29Ht1J+akOiM1FOzbfrXnzZCzF3CaErq1hHBHL9lCcP39vBqzyCT4GHX1byscZ eSUA== 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=BbuFui50T2yH9lXHDgl2DPCW0nuBgP82n9Kixz8u2B4=; b=qZXfkWOgSQXebVuFnK31OvCC+cpgeK/A2zHpDepPutuubQqs/e2BWbHBxc6GvN6Sb9 ffJmRw4d4brW5TrBZnJIcZWYlGPjR0tEOHREFjwTy/hiAjUZCU+U7d8fgSxG82NmqcTg jYMzV2PAYrCwU0MrrQqRJ7TvKhlJ0gq/6q7WzPhXiriisriRrwoXcUXmWJ2jDUkKetHg cG4i7Vm14d0EOI4uaEEE8rAAZVvUQgQS1ww7X8viDRpkckD9Ob6qj3bl3rVA4QjXfMCD S19debHerCLPfYngYc/pb7LR0N6SjeXpvaTjHaTMmj/7UIsXiLHc5BNrM6NFHsT/6Yab Hd1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NjLrpZiH; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id w20-20020a1709027b9400b001964188e054sor693423pll.139.2023.01.26.06.45.15 for (Google Transport Security); Thu, 26 Jan 2023 06:45: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:a05:6a20:1611:b0:b4:6f9:ef7d with SMTP id l17-20020a056a20161100b000b406f9ef7dmr46784387pzj.35.1674744314855; Thu, 26 Jan 2023 06:45:14 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:45:14 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 02/18] drm: bridge: panel: Add devm_drm_of_dsi_get_bridge helper Date: Thu, 26 Jan 2023 20:14:11 +0530 Message-Id: <20230126144427.607098-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=NjLrpZiH; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add devm OF helper to return the next DSI bridge in the chain. Unlike general bridge return helper devm_drm_of_get_bridge, this helper uses the dsi specific panel_or_bridge helper to find the next DSI device in the pipeline. Helper lookup a given child DSI node or a DT node's port and endpoint number, find the connected node and return either the associated struct drm_panel or drm_bridge device. Cc: Maxime Ripard Cc: Laurent Pinchart Cc: Linus Walleij Cc: Maarten Lankhorst Signed-off-by: Jagan Teki --- Changes for v12, v11: - none Changes for v10: - new patch drivers/gpu/drm/bridge/panel.c | 34 ++++++++++++++++++++++++++++++++++ include/drm/drm_bridge.h | 2 ++ 2 files changed, 36 insertions(+) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index e8aae3cdc73d..be281eb26356 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -499,4 +499,38 @@ struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm, } EXPORT_SYMBOL(drmm_of_get_bridge); +/** + * devm_drm_of_dsi_get_bridge - Return next DSI bridge in the chain + * @dev: device to tie the bridge lifetime to + * @np: device tree node containing encoder output ports + * @port: port in the device tree node + * @endpoint: endpoint in the device tree node + * + * Lookup a given child DSI node or a DT node's port and endpoint number, + * find the connected node and return either the associated struct drm_panel + * or drm_bridge device. Either @panel or @bridge must not be NULL. + * + * Returns a pointer to the bridge if successful, or an error pointer + * otherwise. + */ +struct drm_bridge *devm_drm_of_dsi_get_bridge(struct device *dev, + struct device_node *np, + u32 port, u32 endpoint) +{ + struct drm_bridge *bridge; + struct drm_panel *panel; + int ret; + + ret = drm_of_dsi_find_panel_or_bridge(np, port, endpoint, + &panel, &bridge); + if (ret) + return ERR_PTR(ret); + + if (panel) + bridge = devm_drm_panel_bridge_add(dev, panel); + + return bridge; +} +EXPORT_SYMBOL(devm_drm_of_dsi_get_bridge); + #endif diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 42f86327b40a..ccb14e361d3f 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -931,6 +931,8 @@ struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, struct device_node u32 port, u32 endpoint); struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm, struct device_node *node, u32 port, u32 endpoint); +struct drm_bridge *devm_drm_of_dsi_get_bridge(struct device *dev, struct device_node *node, + u32 port, u32 endpoint); #else static inline struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, struct device_node *node, From patchwork Thu Jan 26 14:44:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2676 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 D02443F046 for ; Thu, 26 Jan 2023 15:45:23 +0100 (CET) Received: by mail-pf1-f198.google.com with SMTP id c75-20020a621c4e000000b00592501ac524sf454146pfc.6 for ; Thu, 26 Jan 2023 06:45:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744322; cv=pass; d=google.com; s=arc-20160816; b=EuuLD+eTXgwekKBpeqTwZMKUX1k7e5dH3wcmJ/IYnpGXAXc091AXcOliIqogQcBxNA scOxRtwNaMcFOM8oa+8sRu++q/f/xyk7injXp7LcrbFk7Xuf6oP2CGeHpS23MM1zliBA pJwt8vPuiHed65qx00bHprIz25FeVGIMjeIb68XLorxJ0ka68qv6BpPnE6R4IVQ1OB+Y tpzkAAWLuq9QRNR/hF3bXl1RK6+qNd8RNdUCRSB4zSY2wEtrFer5ENgIK0fTwBgEgoBf uR8x7ENvCGE8l10SEpWcTl8RecMSYJyRspmHizG1+1KLifUY+JSsKLpgyuN2kVx/6asE Mkig== 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=Q/iVXQXIzBtaXWDuI7G2P+2HgfG2/qfrhEeTYYtt4oY=; b=Zm/f0nZJclVs8A2bOnox5s+hj8GXiO0E6YPT1IRecETCAO9uvPIm8Z1LUa2RKMoFP8 ref/R1DeTR837ceYFMsZmeJufFU2TCs2+6i8yv6UWuWWBePcgygAsXx4hnNe11syYnLs HJ3Jf+n25xvYQ+ykSVhkzYhGANAqHxoKytTfLXB4sumPMqqB5Hnqp8+Lw7mI9YdbURZV E5XNhYo4KGzpX8yqH7Oe0CfCUAkNdIl8KV0mkcxcfXEHi1BdwYVPMB+zPHfXS4Wxa6H4 JWWEf1xdWljNxwkU8P/ozlCnX5u59VZMba4+XuvPOT0ETIM96tDVvK82IFF+Ubf4gmqy 6OZg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GMHSCK0V; 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=Q/iVXQXIzBtaXWDuI7G2P+2HgfG2/qfrhEeTYYtt4oY=; b=XiEpdel8MgnRvN81IPzc00TOgy4fUoF1sgHVc31UYnlVHz89wXX55uC5oGCbzeC1/n qezkrlna+VRV+FB1Y2yd3iQSGES/cNbXUUhLhDEY94YjO8WhBnLkAr89R/2z1sWNmvGt M3wT2GkDpX0ygVeeQXLY+bgmCvqfUMMAhgbf4= 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=Q/iVXQXIzBtaXWDuI7G2P+2HgfG2/qfrhEeTYYtt4oY=; b=lJmGaH3bLbvtfclGN+rH5tAbzaDOd0aLGq9iCu4kcWByz/hVgRv9kkYZbvd7O7zxiq d+Qv6qaLeTdzPoybH+6v0UNFxfhqntcNBfGK9E5R5c5C0RetOepqK8cFgRQT8d09x08X qxE0K181hlThHwRyjYE02cwv+k2I7vAU3N37BAmCE4uTUsb7A9EbIc5qOFH6byyDJfsd zbtjxoJlKi4glZQI6zr4gNjYQGzRb02Yf9VBgOawcFWaE4zIZMQelLmDbmOGHyYWQF9f 9Ugef8Attk4EtzS8o3hUCMKxJuLuE8pthXbMASb4XuLxscKn/9x36cDVM2vsyHorPn28 aZSQ== X-Gm-Message-State: AFqh2kqIH20Em/VG11zgFhE8GZ2OIUM6viUuXX8Gjq1um+Mrwx23VhlN byWDUFBpamZEphAq814XnpH7eiKx X-Google-Smtp-Source: AMrXdXtrC4BouaYSA+RrIx0cEMus7MHMKT0iumx+JuSTD2q8dk0eoSpzgpyFp2ahYQ4j7Rdi6lW9yw== X-Received: by 2002:a17:90a:b791:b0:226:2a7c:9ba9 with SMTP id m17-20020a17090ab79100b002262a7c9ba9mr3975764pjr.128.1674744322559; Thu, 26 Jan 2023 06:45:22 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:a3c2:b0:192:62df:a3e7 with SMTP id q2-20020a170902a3c200b0019262dfa3e7ls2316481plb.9.-pod-prod-gmail; Thu, 26 Jan 2023 06:45:21 -0800 (PST) X-Received: by 2002:a17:902:daca:b0:194:d4e5:5e5c with SMTP id q10-20020a170902daca00b00194d4e55e5cmr1647941plx.37.1674744321586; Thu, 26 Jan 2023 06:45:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744321; cv=none; d=google.com; s=arc-20160816; b=CA+O1xtp3XTE1HKREtcAu/akY2LFv/HQMsZgXh50l2K9kjvR6N6FrYQ2/mII635/xM vT+ZC7Yh+rzx3HYNxDzYllJ8rBnvpsEG+3ab6yWYbJ7EpNsBk8zEnOh9VlmE6bzeviCf FW2rF7twKMM62VmQxicB6pru7tUqnI0u5I/d0Op4LsahiCVDY7do3ji8yZg/e1fOrmoZ fc0qJ+V7XXu/gFCEj3JwdfdwKkZlFPfhxXPxvCf2NvDogQ8xjKoXWBOjqrtIqQgLK0Ra Ccf02iiMTIo4PJc1oDXWDQfguK9hCLrB8Tu4bUhoikYSAznMGh5ywmKxt+Pv1ygsFgVW KyBA== 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=szahjNSumSDXHid0fYalhBWCMxVcircmAlXVe0dAaOg=; b=c7mI/6WwRVjqz3vscYgSyv08jUFsRcPK8Y14fnPh2Jrx3chWJDbJHyAkHMw1bsRO6Y 6CvwTvwTincpk6RPSeAvxlh/G+r2YQpC8C7k2+KVYO7h1yHN0+MfBGUxyUNoxoYJjcbf rtHPvRxlXYmW0eMMheoEHaetxRjYL0wJuAkF/4BFJ43Su01Mt4ORPGdO//OVwf3Pgl/8 GgZDLmUlwg6vHaQBJJzGlPObUXWsmGIk8XZhl1SSFrl4oItS/5j6PrgCvDMLMkchqCMk 82GXGUG3KJQ5Q0ukzCqMDuP6pfgM+qYdwx3EKI6UopvLMzHip5yOCNnQXr28OLsAjhDa BXgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GMHSCK0V; 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 b13-20020a170902d40d00b00189bf5e03a6sor741510ple.77.2023.01.26.06.45.21 for (Google Transport Security); Thu, 26 Jan 2023 06:45:21 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:3950:b0:b8:6a9c:fe21 with SMTP id r16-20020a056a20395000b000b86a9cfe21mr2839859pzg.51.1674744321250; Thu, 26 Jan 2023 06:45:21 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:45:20 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 03/18] drm: exynos: dsi: Drop explicit call to bridge detach Date: Thu, 26 Jan 2023 20:14:12 +0530 Message-Id: <20230126144427.607098-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=GMHSCK0V; 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 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 Thu Jan 26 14:44: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: 2677 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EC0FF3F046 for ; Thu, 26 Jan 2023 15:45:31 +0100 (CET) Received: by mail-pj1-f70.google.com with SMTP id y11-20020a17090a86cb00b0022bec81bf5esf937298pjv.4 for ; Thu, 26 Jan 2023 06:45:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744330; cv=pass; d=google.com; s=arc-20160816; b=QZrBfOs9HZ6MuJt5lo17B/QZVo2KPabGy1cQM3cluuZ0D3K3kJ48d/dwp188VvzVD5 uKr4G3JMgpuW419OZZpSKGjiVUF1fU/Ke3oVbKqiWSNmKnG5AZzGDeUgvcMDQUAADKhE YeWYQM9hWqMW5j3/Qy/y5Awx4/XBT6rrdLOYTf8YuhRxM4nYqxaXsKm+KBVK+Xhk4GrI 0kHFwKKwdCdYR8rTAEDxZDN3b2p/LgnxtN3o6/ev4b713sXpUb9eDJDCyaoJ+HrZwEb6 wzLzdKrxNzySMAjOWxSNO17r8XnoWtl0Mm2Jwk4Ubc6tHTPAhvUOcAp/g5stS4hOidZi nunA== 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=fvOYYIbSxsqUPGZQt3xm564caWHKm8MIQO4tvyLIdo8=; b=q2C96tDztY/soWraWKFw37+w57KAt0LATLOB1/XEycKC0hejxEP4M+KnLPawi/tcO6 wVzRDwaX8maSN3BrMORuvZo/k1Q7CLqt0Tq9KGRcOLSAhp4/0ZHycfjXLAakjriZCkG7 fcXM/Ak1vnpoQJxl0rihe9SQNVACZzEzRtXCvs68nKJHukAbM2Gnyw3I8JvQwiyduSTL bBTJwMbzBAW2JMUbjPzKOr/lkUKP8rjd1I3mDlFDkTj+qxMkpU2hnut5uD2qgKnE8hlN DlfmAMk8qpbjuZhUMwWopaygTd6VbSOC65gDVSdqtQBLFRX2phyfWkA3zoynIETkLJSH KILA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eXOCY6fE; 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=fvOYYIbSxsqUPGZQt3xm564caWHKm8MIQO4tvyLIdo8=; b=jy8t2d0pZStVVyhcd6QmB9Q6W3H6eCjyFGhHbN0IWq4uZRCINzWcEbdlMmoZ7Rcbt4 jBda1OxPPafuspZCgTXsTxFhBLqlwngkfgPctfT/qBz9KTwIxwQTNP74Jx0MtQLk06fX QfyP7jnj72YX6iB8am4y6/kvxtViTpW0FmLUA= 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=fvOYYIbSxsqUPGZQt3xm564caWHKm8MIQO4tvyLIdo8=; b=RwLElYEWw3SVZM5evkdFhpQa99x2WlyR8wxhNpU8+jgWYXMEbDMHE9S0Y1oWxwjGQb ixM5RYTh5/WQnEM2JNPh8KYSAxAM6CXta+uClreeQv8InnEvoQbR5Ieh79LClXwg47rJ dEvEEypoQoIgGMRPDf5FIsOzxToPHSQH40SIggRt7sFc4gLP6jLYJRDHXcp8maistRD1 c7KI/xe0UKFMijSOR4/DiH8VQOOF7pFnttXBN1MjFmKER0pNUcJw2sYX6VfxSzlXe6zE LqTlfFpNONm2PCaHJH7DNvlxc/qvmPFEsrjeUf1Ur73ceOWMjjPFNMiDVhLD4wELFemy eyHg== X-Gm-Message-State: AFqh2kqSFR6tHXkhU43jIlmVqJXQGdwznQIEVTxpIveYy4IEhKqAlEZO 643AnSfxoB3EjYdb7MTb1Bc6q45s X-Google-Smtp-Source: AMrXdXsf5RTeXXF6n4WMZ2V3mseXyOHwtlWSw7Ocz6ajJQvW2BYpgsEAEBReEhVKY9qigksS9uv3zw== X-Received: by 2002:a17:902:c3c6:b0:195:e436:6814 with SMTP id j6-20020a170902c3c600b00195e4366814mr2688093plj.14.1674744330740; Thu, 26 Jan 2023 06:45:30 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7088:b0:178:3881:c7e3 with SMTP id z8-20020a170902708800b001783881c7e3ls2312169plk.11.-pod-prod-gmail; Thu, 26 Jan 2023 06:45:30 -0800 (PST) X-Received: by 2002:a17:902:cf08:b0:192:c125:ac2f with SMTP id i8-20020a170902cf0800b00192c125ac2fmr39039178plg.8.1674744329823; Thu, 26 Jan 2023 06:45:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744329; cv=none; d=google.com; s=arc-20160816; b=PMJujf7r3zKVGOmYKlq1nwJ7YUNmYzQo0EzY/TcsJpGUwM2BnO2x3rO+clM8cUDbJ9 AAAWOeQw40b4Qz4LkY4TdolhP6sRbyIdVSwyg5Qebdq2WMy4HWv7QK8Dc1s0kLHZftUm 5ikixh5uDh+wFQYbfgQImZ9lpBgJIZGl4a48+RUjNVkN0TMtc/aguhGbPJpjEhi7Hgzp B5jn3H7YOFH724nru25YYBxucrUbaKUMm7EyV9l/B4l2KB4RkeMHp2ysK3HyjT3ReUMU WWUdEhv0TWIqA2NkbTvDysWU8hTvmrjWo1nTYA8+uOVfi04GQT/UT39XmcMCdjn+aUj9 sXxA== 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=+otNyxyXWcvyXtJMZVAopiBO8ADOw+cl3pmhYxy9GFM=; b=R73WlY+J2fYilEsR1gSeQAI4KOeS7k4WnOis4ECQENyUyYSVppUD9+LVhWZNcmI5GE WlDJAokbl0jYO44CWwCsC8mg9ZVPa96sWOQZRye3ANl0YcTuloaGbpKw57On7fhllvJP 2zn61waYxKvTyChcNoK4H0QSpxnHwPEKxETfecXmkiF1PH0MhbVYkOFhtXce2/ldGnqH j9/3/c+huG590a6jE1IuLWlCduicxJzo03ToXLn2Nev7XVSMFRuMHBxafj7ClBXadCpd jtQOqiuTW81QwWB4/USzlPC3E81WIOzYyA1OgB92jSZ4hA/4aES41s0IgB84+OtuWNm1 WBBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eXOCY6fE; 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 r18-20020a170903411200b0019487b1c90fsor679353pld.163.2023.01.26.06.45.29 for (Google Transport Security); Thu, 26 Jan 2023 06:45:29 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:8b88:b0:b8:aca6:b64f with SMTP id m8-20020a056a208b8800b000b8aca6b64fmr34401167pzh.34.1674744329524; Thu, 26 Jan 2023 06:45:29 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:45:28 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 04/18] drm: exynos: dsi: Switch to devm_drm_of_dsi_get_bridge Date: Thu, 26 Jan 2023 20:14:13 +0530 Message-Id: <20230126144427.607098-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=eXOCY6fE; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , devm_drm_of_dsi_get_bridge is capable of looking up the downstream DSI bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_dsi_get_bridge. Signed-off-by: Jagan Teki --- Changes for v12, v11: - none Changes for v10: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index df15501b1075..4a165764121d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1470,18 +1470,9 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct device *dev = dsi->dev; struct drm_encoder *encoder = &dsi->encoder; struct drm_device *drm = encoder->dev; - struct drm_panel *panel; int ret; - panel = of_drm_find_panel(device->dev.of_node); - if (!IS_ERR(panel)) { - dsi->out_bridge = devm_drm_panel_bridge_add(dev, panel); - } else { - dsi->out_bridge = of_drm_find_bridge(device->dev.of_node); - if (!dsi->out_bridge) - dsi->out_bridge = ERR_PTR(-EINVAL); - } - + dsi->out_bridge = devm_drm_of_dsi_get_bridge(dev, dev->of_node, 1, 0); if (IS_ERR(dsi->out_bridge)) { ret = PTR_ERR(dsi->out_bridge); DRM_DEV_ERROR(dev, "failed to find the bridge: %d\n", ret); @@ -1531,8 +1522,6 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct exynos_dsi *dsi = host_to_dsi(host); struct drm_device *drm = dsi->encoder.dev; - dsi->out_bridge = NULL; - if (drm->mode_config.poll_enabled) drm_kms_helper_hotplug_event(drm); From patchwork Thu Jan 26 14:44: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: 2678 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 443483F046 for ; Thu, 26 Jan 2023 15:45:43 +0100 (CET) Received: by mail-pf1-f197.google.com with SMTP id c12-20020a056a00248c00b0058e1ca45515sf1019489pfv.14 for ; Thu, 26 Jan 2023 06:45:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744342; cv=pass; d=google.com; s=arc-20160816; b=QEn3zBLnKt6MOYtVFEf2E21xebl3cStA1Uduh4SFlaAibm1iSmNTdHHeoTNYZNvMYo mgY9QQKN2ShKlGLDQyba2WkAS+Y8sy+VJN9a+43rhqI7ma3zrX9qaX8QiLZ80IV3bSWe 4yKcY7j9dFukKAC4u/sLqyKJJrHeksR4AdCp7FJvAHWmX696DvpJ6VannJHo/Jn22YSW rSaBIFr2N21r5MjVFRt3jMQDhi5WqCflqR3WCJl4uSI1VCwpq14wlKAHXb+qRQyOEECs XEAEr/Ujav6ha5dm8IUYzKBv8Ed40pkjc4LkvF4lni3UOUY6HOqhcmosYaPXg7PAi85V dJBA== 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=O3waejhMjWexzqfKMWkgslorM0o5aAbAMpYxv9u1YSs=; b=vfpu+Ib0LORljJzqXmcOL6ri/9BjioBF6KPjazv5zj9ex3NqDl+x/wfDxb4Pfi37D7 B3Mq8U0Isi4SBF9EnBB2PSEFHZ3DUBz/ZADFQUHVxJrd/VYdb2Z9wYk99v1VKQdArT7S 9Z7aMkgT2Grcn+y5ksOzl8hqkljN/XjvsItDh/rU6uAeMkZ1A7w4bUsMxSRh3yFVgZxJ vUwPtmlVmxVYDnZIuGPx5E+6eff228KN/+ADHgjE182zvHhOv1gquunYwifohwoij6eM 3dM2yfTJvkVTFwv+colY7uA9+HVU8tRe1P8vIIEE6l6A2KhsswziVM+sQ4s+kdO9e2Wh mfNg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ThwyGZGd; 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=O3waejhMjWexzqfKMWkgslorM0o5aAbAMpYxv9u1YSs=; b=KHki554JNoC1G3AsUjbUSAHhQLN0HKzXM1DpRVNPC14Dlq9Su9qJQMCHNZQdKNjeD/ Ylo8jp+Dq9bTUCxWiUVY3/4OfNy+fb5IJtNjsZQPHNm5XxlSPZw6eyrxqwa/w9ez5SPT LGDy7x382vBjqDOQDKXMQWs5gJ2Pk8OSLBNx8= 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=O3waejhMjWexzqfKMWkgslorM0o5aAbAMpYxv9u1YSs=; b=CNuz1gl2KVw3LMGKw/JQKDm1XId+S/BlUbgdWrsrLDfPlNJryzpmHqUqQWMI2g3rZL 9A+aRQT7mKZrgKmNoghbsXemk82vinhZWnC7gjKEtjsbBdCygNGePjH0qPXpDyj3ulx/ y2pGRTPdY0pKFAmXPMA9cYn1dcHA6ak5wIOAPsQnTqBS8zMAkBE1c0V0PmVC0wc93D4T nQjRPqtqRNqv0a9cohllHm1jvV2FH3kKp4HLsBHzaQ/tbmFm3GQDMAXUYWkXVTfM+jQl ZoVfP/sOakSI1MR/0Ex38oDdB2R/c2qQKJnO6eCWiET4VuxYy9H8ZL4fHS0CKD8WbTEf +I1w== X-Gm-Message-State: AFqh2kq1h1tFZuhM60naHb5deEVwDieGrcQvK9QFAJrb4y1OPvOxOJgL CpLU+v+lg2/l843D7VPinRin1KYK X-Google-Smtp-Source: AMrXdXv8xHDRn5nwuLBkqCcYEd5k/3eiQ1oS7hiFSKBy25V95DYrPoNQt4CPzPbK2TBDGROzpJfyww== X-Received: by 2002:aa7:85d4:0:b0:580:f12c:f6b7 with SMTP id z20-20020aa785d4000000b00580f12cf6b7mr4419195pfn.62.1674744342005; Thu, 26 Jan 2023 06:45:42 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:12d5:b0:192:4b3b:ba41 with SMTP id io21-20020a17090312d500b001924b3bba41ls2328898plb.8.-pod-prod-gmail; Thu, 26 Jan 2023 06:45:41 -0800 (PST) X-Received: by 2002:a17:902:c611:b0:196:35cf:3b08 with SMTP id r17-20020a170902c61100b0019635cf3b08mr3478759plr.36.1674744341125; Thu, 26 Jan 2023 06:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744341; cv=none; d=google.com; s=arc-20160816; b=eDgkV9ZQJOtB9Ve8YWJBjCf8x77bwoWErVgezdwbM1efqMRV/izgRCXjIhJ7KqdpKJ /8npDMvKagrvFB2+rBsF4TzzNJFGeHmeja3CinIXkLh/Z8htKmT48OYFBQgH80RzlLIA h5Z01eEoRpxL5VDZy5BytDCnYVwN1qEoYqhfqzZobbe49TsTEEB92QVz/oH/YgWz0+QA UDAB5qpfigb14c6nMbOyPHRLI1/46dcevAIy8beoyeiJ99V29aepAxghvtCvsytWoCgs zbe56F4P9PcOiRoQRWD8yCjOj57R8/oHG7pdN26wVBEmajmHvK3b1ppV2xK2JV1afoaU 54yw== 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=BaDUbyvaCyU9ZYo1dnwr9WAZI/IyrlPNZL6ZHPBz5Bk=; b=JQH9XBs4ry3gpBQiXqiorobUg36QDnYtgneHCXKoGaqnx/RKi3FVv8yhInumt13CI0 oVUd3Y7SMd9qLRn4Lpuxvzthx/TXp2RCty9z0BVDo0ZVo3AK8/8HAnAPQW9Rw4I8VWbD zw5fX2a4PJ61Ekb/Q2oDXV6qD7Hiak1sixJgnHWN/qk9LGoEATZEnngeofknN1LKtqHb j/luyzlM/0EthA7kiLTwSg7QTM4ro7ULoX3SZ33YwyiMtZ4pnCn1ozPdnlcpnRkMPDsM xKg/B8tgmIDpieBUEWIDmRGbic6/8OQCp9xwRF0xjhXKEYujdatNHnCP5/gWjkvm9au2 ACdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ThwyGZGd; 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 jj1-20020a170903048100b001961f0bb7f7sor715677plb.169.2023.01.26.06.45.41 for (Google Transport Security); Thu, 26 Jan 2023 06:45:41 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:7d83:b0:bb:cf2f:3b09 with SMTP id v3-20020a056a207d8300b000bbcf2f3b09mr8145162pzj.51.1674744340798; Thu, 26 Jan 2023 06:45:40 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:45:40 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 05/18] drm: exynos: dsi: Mark PHY as optional Date: Thu, 26 Jan 2023 20:14:14 +0530 Message-Id: <20230126144427.607098-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=ThwyGZGd; 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 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 4a165764121d..5918d31127aa 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1687,7 +1687,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) if (IS_ERR(dsi->reg_base)) return PTR_ERR(dsi->reg_base); - dsi->phy = devm_phy_get(dev, "dsim"); + dsi->phy = devm_phy_optional_get(dev, "dsim"); if (IS_ERR(dsi->phy)) { dev_info(dev, "failed to get dsim phy\n"); return PTR_ERR(dsi->phy); From patchwork Thu Jan 26 14:44: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: 2679 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5B5AB3F046 for ; Thu, 26 Jan 2023 15:45:57 +0100 (CET) Received: by mail-pj1-f70.google.com with SMTP id h6-20020a17090aa88600b00223fccff2efsf2784531pjq.6 for ; Thu, 26 Jan 2023 06:45:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744356; cv=pass; d=google.com; s=arc-20160816; b=JIbdXSfb3zL/39G1sFaI3uyXUvFOYZUvuuF7kqN1Ay3vO7sOtpkjcZH1BuzLFN1Thd ITlOqqzVnAjSvKyV1SCo6Hb1N90tZs7pND/DM42GESnoP/BReetaM65wnp7udhAqaLs3 VulVdnJ3bc5Y7If5izEiq9FFHWz/ezh2kk7ktGu1iH+ZGUqvCXE8lhpAd3indmaxGQkU fg/SYRZprMjaor/E5BVv61pUyokFm+UJ6UQ2dYOcXi6ceo53TAQ5xX3dwMzes0CD61QX pQdvlHUoJ+HyoOnjje+lCmmkzbxYUCOmRNJhl9VhoYVAHnHFyZ2Y9EMPTYU5NpMzleNN tB1A== 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=9UjrpAG3DfqfSeIRX7Vr9i0YTgESlI0JzOUiU8wHhxo=; b=qjOcEqeo/GvJgiB4y+OcL+PE+6AXjl/nKJPpsRTvZbS68S2hrTq3b7KsZHf2rikjBd Shb45TE9bTql1DHxmX5VCwBVBHxjUtq3IcYkH02pQAeid/bs5LaHoIMfEtA4kytTtuks 3YmwCfEafLzCKY6SWGZ8UkSaFNSQDQ2+UYytRT0DeZoG0n8Xb2H1iHWYv0HPG4b8OnXt +N7VfcIkk4aOWuh18ckj1vLEcmXoqaAGjYIUju5T1maOPOzFJDD3BHWTSnO38GeQP3Fa ZvQl1zpBNBb8ini5YpjdwyFfL/yJIAnYtdW6vTUgprXiJHeslAyVsfhtPNgkkCkNFN+r kxpQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rOfFYHAK; 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=9UjrpAG3DfqfSeIRX7Vr9i0YTgESlI0JzOUiU8wHhxo=; b=TDJ3NNoJg1HX9AO26JYy0Tbys1ne+WEebrE9kKEB/17XTKiLbUWuu/M4KpZg4ahRGA bC+TNJ0W0Rf01Y3qCuci5wkn9qN9Zju+xPuc2YEXSlEqJop2s2fzvw/dy64fekd7IubX knoQGPjP+vmuuHWnKbWr3aOQCpVkaWpJiuFaQ= 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=9UjrpAG3DfqfSeIRX7Vr9i0YTgESlI0JzOUiU8wHhxo=; b=I9V3Ca4NnK+bFG9hmUWk2rTvVYI2lf2oiJpIOwvIpjKNCFM6m1zdfmxXM6RIJ5PQLG LRCHBMp1gM6G7Z4edlYswa1/SNSpGEwHBf7OGAlxBeEZzNWjoUKQ8x7WjnVKDDLKwjpN vTfMg5opbWk14MLmJ0BTAAgxzomfWq3O0jnnMAgmUc/qv4CnFy8wpk96TE8jsBdbQy8+ TMjq1DybL2zqDfEil8ZDT4IqmzGJMypOZ/y1l2/xUdussLTqTgVC+241qfg4SKyOG9T7 m/Ujd7kcsc9V0Wq/fvfmNnNHlvVK6oECyLWSoP2GKm86SwG8K2qm3Raqgb0rngLGWnbX sHHg== X-Gm-Message-State: AFqh2kqVqWIqIr0S6KjqsJusplC81+fILE1sWb7wcHmNICHeX9aV3xf/ MpZMJPW/VlGfyK0BYwh+Y+H7JT8c X-Google-Smtp-Source: AMrXdXuHEv4SbJd5x3vH1PAR0MzJLYfdMhUEDW7opuBVglYIZkhc0idWzSpBcmos5quBeRXa7AJW+g== X-Received: by 2002:a17:90b:686:b0:229:7638:4499 with SMTP id m6-20020a17090b068600b0022976384499mr4363818pjz.167.1674744356197; Thu, 26 Jan 2023 06:45:56 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:d80e:b0:22b:eeb8:fd6a with SMTP id a14-20020a17090ad80e00b0022beeb8fd6als2661201pjv.1.-pod-control-gmail; Thu, 26 Jan 2023 06:45:55 -0800 (PST) X-Received: by 2002:a17:903:2405:b0:194:5116:c3ee with SMTP id e5-20020a170903240500b001945116c3eemr39735660plo.37.1674744355286; Thu, 26 Jan 2023 06:45:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744355; cv=none; d=google.com; s=arc-20160816; b=ER9rxjntQoDklqRyzJYBxqKcYQDqgQHD0wHcPnPOkE6J0I/PoWyCd77siefA9LL2CR 4MqfsxKPKGcQkKiy7lfdBreJB/H7HHH7nEenjgVI3KfBzz+7bVcKJ0o7pqWdDxRWfcen PHK4g/vJjTwuGPAlj60GpnxgX+gLUBWuLWcl5KNBQyoiaBQ45LXWRC5fASWV/10oFTXP qMlXKhiCYTwcZrhsNUoFK01zQl2D1iL2xk+/QPp7YRZYILAfSDrYtVS7YTeumFLNrGGO Sg3gHmkSextFhUUpoz/mSrgrnzrUmfIDDICVFuKCowVQEVZ1JXplcKwP3lLrj8bcwkr7 5NUA== 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=fCKziNtWsgASij+dWWGaDpyDhpD6z6/DqCOerXlFmzI=; b=F9sjZBAUc/wKUtYy87BpcOrjhIBRBy46PDZkKIDA28eiAvuKbabPdUS/PdPLpVoEm5 NH17EwfumavMSiU8m32y8wzT/ndQyqcfEci2Lr5aNxUAC/NRXiJebFzO4bAclm9IUy8T guc03lB3Kmx+7OdC9CxOX/BdCovPCdJ1H4Yl/TF+SiA5vMMg/jGZmTd2ddYziqarRRW0 Nc+pOLj/OeUxvibg6DkupM+wdync3si6TCwsXkDwPH46TpXgE8LjegRnNn9FM3aadD2o hiEFkK+yrWYAIQKJG0hMXnx3LHuABpL2/ofjqCp3nYZ8SZpwSN9vdzD6GU9SvqUxix6h fKEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rOfFYHAK; 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 l5-20020a170903244500b0019607072b23sor708123pls.109.2023.01.26.06.45.55 for (Google Transport Security); Thu, 26 Jan 2023 06:45:55 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:8f0d:b0:a3:6f97:e658 with SMTP id b13-20020a056a208f0d00b000a36f97e658mr50988661pzk.58.1674744354967; Thu, 26 Jan 2023 06:45:54 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:45:54 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 06/18] drm: exynos: dsi: Add platform PLL_P (PMS_P) offset Date: Thu, 26 Jan 2023 20:14:15 +0530 Message-Id: <20230126144427.607098-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=rOfFYHAK; 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 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 5918d31127aa..7a845badb1b2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -194,7 +194,7 @@ /* DSIM_PLLCTRL */ #define DSIM_FREQ_BAND(x) ((x) << 24) #define DSIM_PLL_EN (1 << 23) -#define DSIM_PLL_P(x) ((x) << 13) +#define DSIM_PLL_P(x, offset) ((x) << (offset)) #define DSIM_PLL_M(x) ((x) << 4) #define DSIM_PLL_S(x) ((x) << 1) @@ -263,6 +263,7 @@ struct exynos_dsi_driver_data { unsigned int max_freq; unsigned int wait_for_reset; unsigned int num_bits_resol; + unsigned int pll_p_offset; const unsigned int *reg_values; }; @@ -471,6 +472,7 @@ static const struct exynos_dsi_driver_data exynos3_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -483,6 +485,7 @@ static const struct exynos_dsi_driver_data exynos4_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -493,6 +496,7 @@ static const struct exynos_dsi_driver_data exynos5_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -504,6 +508,7 @@ static const struct exynos_dsi_driver_data exynos5433_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 0, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5433_reg_values, }; @@ -515,6 +520,7 @@ static const struct exynos_dsi_driver_data exynos5422_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 1, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5422_reg_values, }; @@ -628,7 +634,8 @@ static unsigned long exynos_dsi_set_pll(struct exynos_dsi *dsi, writel(driver_data->reg_values[PLL_TIMER], dsi->reg_base + driver_data->plltmr_reg); - reg = DSIM_PLL_EN | DSIM_PLL_P(p) | DSIM_PLL_M(m) | DSIM_PLL_S(s); + reg = DSIM_PLL_EN | DSIM_PLL_P(p, driver_data->pll_p_offset) | + DSIM_PLL_M(m) | DSIM_PLL_S(s); if (driver_data->has_freqband) { static const unsigned long freq_bands[] = { From patchwork Thu Jan 26 14:44: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: 2680 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 38E7E3F046 for ; Thu, 26 Jan 2023 15:46:09 +0100 (CET) Received: by mail-pf1-f197.google.com with SMTP id c5-20020aa78805000000b0058d983c708asf1023503pfo.22 for ; Thu, 26 Jan 2023 06:46:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744368; cv=pass; d=google.com; s=arc-20160816; b=qeZnH8lsZs8fcKmNINollnKRoMMbfxiGFSOvvvrNNYHvJ6PnSA4qKJzV2gQ1C6D8Ot EU9S60dMg6zYVYLhFaIllKqrMjrNxwIPFbLIxqzv+FmGrprQeOQj/vnMNmJviZdlAYd9 MkmOcNldCttEsGZwsyOh0Kct/Ah6GYyalvLL6G0bYGhzsAHa2gkUG5dL6Z7Ai3eCCSuO WaixVFtCmy65Vfy2GckQGQsNdgJ8lPPvMdWdbWZtUnimENhqTQmX+Sp9XUnQg35iiDDY HUZotqy0iX351oiwL+HAHuE9JbCWxASI8s+ibtHETVojwHevOqQCvm0IcVdv8Fo1SbR3 sZlw== 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=G5AYDUuk8gxdK+L5/ZdBVuJz+6Oo/zBITkF+mcw8XWU=; b=iajr0a3mKC4KkJmIQty8mMC0uUpFRQivBkLBaGogLvVUPaRdltU4emzN4qXF6glE3x QKU/DH0hg609MnF70/Z75T2IoMdkg5ijUwh4l9RnwlMKvLPM+5IeePIl+OpOeuDv0Gx2 dAGGFSNqA9vcagpY4WnkmwCamoho2Fue30qXRkBTfCHoVGK9rF0HHkKrA1OOHsltph8r lMw2ss4gghh42+oKghXgj0UPn8EB3QQV2Wif8+R/NoiqslHjC+1gzk3PHafmrVWCP7jb YhCRrYyhhmBaF5b3yaDLZVDXQIPeCpq6FcwJ0OD1NwtfZLA6eO3Ke2yc0lue/2hwi1P4 tPyg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=atzopN0Z; 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=G5AYDUuk8gxdK+L5/ZdBVuJz+6Oo/zBITkF+mcw8XWU=; b=j7cx6bxGmTXi/kIrFvNwCYvyVngBfp/Hpz5m5iBt8r+GTF0u+0pSRzdThERMBtQ4hi xQQZALvXVNBawV2fLzbFkLBBmylFhAk20gublJlg5OUxyRquOIeUxOLcrHRPQKvkiol3 FCqHJuv+w4qakJSKwmII4p1As/zV6GwF8iO44= 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=G5AYDUuk8gxdK+L5/ZdBVuJz+6Oo/zBITkF+mcw8XWU=; b=o++VxsYbpa4GNHcJhAfbOFk5uJj4Jx3aJPMRNvhDp4ONGXwbv11A5N9RYby/ZsfcII 45y6WEezdvsfE0eZGmouoWMV3yInY6kSVgkuuXf1ctE5bhlNVyd2k+YKh34LWIpkFXjC rZMhdy/1JeWIEfkO7c8NimfHE77MLeFG/AEYTq7gb02cDnu94tXyo5eS8oI2l5+JsdOL yHaKG5VDn0IteVtjWpXghIdsHnDBe7ntS5+QrP29eW8jwZB6F210Dmwi25x3Xn3cXcvY r6PMJjvD1Aa9F7YaIQNRjWqJaZIPeZ0wXwmLlPRDp/st0b5Shi4a7OpHzonnIbrx9odM 1LDg== X-Gm-Message-State: AFqh2kqCNoyDH/1VPKN0l0usHEHyzWNlHEmXfGEUx9jXHBc5Txky5ECI ovVeRpNs3sHVTI7+d3r18fBWoQCo X-Google-Smtp-Source: AMrXdXvx8ZWuAHDrJksatJbje+xB/9IEEk03EBAkrzQHfRg0qnQyUWXDEuOwi4Qrh7UKc2Q+lcwaFw== X-Received: by 2002:a17:90a:30d:b0:215:f80c:18e6 with SMTP id 13-20020a17090a030d00b00215f80c18e6mr5324702pje.45.1674744368068; Thu, 26 Jan 2023 06:46:08 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:bb97:b0:196:f81:2760 with SMTP id m23-20020a170902bb9700b001960f812760ls2379320pls.2.-pod-prod-gmail; Thu, 26 Jan 2023 06:46:07 -0800 (PST) X-Received: by 2002:a17:90a:1917:b0:22c:3a4f:83bf with SMTP id 23-20020a17090a191700b0022c3a4f83bfmr278412pjg.9.1674744367105; Thu, 26 Jan 2023 06:46:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744367; cv=none; d=google.com; s=arc-20160816; b=sq3Nj1wzrlQpI+BaGK6X60Ia3MawWuQFOcJ4PaxftLcRhUChYyUW1S06GMM5dry2am 6Oq8VFs/txmtcl8xNWmchAVvYwqvP44OHW3agbtqiko3IYJcbAQGHGkpYSHKjRiG2zl2 PWrU2PWUI//kFB6DHZurYYTO1lUsWR6HLAFaQGMZD8z7eC2CKnc9EMh64PaNmSpaG6NM eoIqLy1VF4phtyZb7BO+0T4lxaopia4aXOnvJjkf85+/KPvBQQ4yKYH22DpnymY6XxP6 kj388BwlBbgHUm9HJv29F6TuWS98NKP0rdwfuJ+FuGchds9yB6ujb4OQsJVPT6CjyRcf 1xPQ== 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=4zNn/ghEcnKtGn+53b6UsMOLZnA5YwEKlrMufet3kNE=; b=iRWg5C/uAwvcJUhur/CdEM343vAU303qmD4roxL7gNVKDcgVmp6LJy5akPNysKa0vh 98vD7L5CfoHZzy0u9rguZeB78Y6ocEF0Tly3shSDoNvccDyTGRw1HW8kZtsapsAuLodi ZZ76OT19it3QYs8GoMqpZcWQUxT7nbj1SaTkXxICYL88hkhSOKBiCqBxr/KqfIdi0izB /aQ7vrdxrqE+ItzhUINiYmTYtZVgYYkdjTxb4qo5yTLJLqtWyEkIx3nSS/stZ8y9/Okf jPSrvfvB4M7wLBwJ26LFvN/mcum398mq8rbLlMqjmi14tQc5Mq3inavHTO2Ejged6TRr bS9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=atzopN0Z; 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 c5-20020a17090a1d0500b0022722f138dfsor2220397pjd.32.2023.01.26.06.46.07 for (Google Transport Security); Thu, 26 Jan 2023 06:46: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:90b:4b83:b0:22b:eb43:a1b9 with SMTP id lr3-20020a17090b4b8300b0022beb43a1b9mr10827566pjb.41.1674744366758; Thu, 26 Jan 2023 06:46:06 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:46:06 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 07/18] drm: exynos: dsi: Introduce hw_type platform data Date: Thu, 26 Jan 2023 20:14:16 +0530 Message-Id: <20230126144427.607098-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=atzopN0Z; 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 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 7a845badb1b2..902bd46964cb 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -254,6 +254,15 @@ struct exynos_dsi_transfer { #define DSIM_STATE_CMD_LPM BIT(2) #define DSIM_STATE_VIDOUT_AVAILABLE BIT(3) +enum exynos_dsi_type { + DSIM_TYPE_EXYNOS3250, + DSIM_TYPE_EXYNOS4210, + DSIM_TYPE_EXYNOS5410, + DSIM_TYPE_EXYNOS5422, + DSIM_TYPE_EXYNOS5433, + DSIM_TYPE_COUNT, +}; + struct exynos_dsi_driver_data { const unsigned int *reg_ofs; unsigned int plltmr_reg; @@ -267,6 +276,10 @@ struct exynos_dsi_driver_data { const unsigned int *reg_values; }; +struct exynos_dsi_plat_data { + enum exynos_dsi_type hw_type; +}; + struct exynos_dsi { struct drm_encoder encoder; struct mipi_dsi_host dsi_host; @@ -297,6 +310,7 @@ struct exynos_dsi { struct list_head transfer_list; const struct exynos_dsi_driver_data *driver_data; + const struct exynos_dsi_plat_data *plat_data; }; #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) @@ -524,18 +538,13 @@ static const struct exynos_dsi_driver_data exynos5422_dsi_driver_data = { .reg_values = exynos5422_reg_values, }; -static const struct of_device_id exynos_dsi_of_match[] = { - { .compatible = "samsung,exynos3250-mipi-dsi", - .data = &exynos3_dsi_driver_data }, - { .compatible = "samsung,exynos4210-mipi-dsi", - .data = &exynos4_dsi_driver_data }, - { .compatible = "samsung,exynos5410-mipi-dsi", - .data = &exynos5_dsi_driver_data }, - { .compatible = "samsung,exynos5422-mipi-dsi", - .data = &exynos5422_dsi_driver_data }, - { .compatible = "samsung,exynos5433-mipi-dsi", - .data = &exynos5433_dsi_driver_data }, - { } +static const struct exynos_dsi_driver_data * +exynos_dsi_types[DSIM_TYPE_COUNT] = { + [DSIM_TYPE_EXYNOS3250] = &exynos3_dsi_driver_data, + [DSIM_TYPE_EXYNOS4210] = &exynos4_dsi_driver_data, + [DSIM_TYPE_EXYNOS5410] = &exynos5_dsi_driver_data, + [DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, + [DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, }; static void exynos_dsi_wait_for_reset(struct exynos_dsi *dsi) @@ -1468,8 +1477,6 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .attach = exynos_dsi_attach, }; -MODULE_DEVICE_TABLE(of, exynos_dsi_of_match); - static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { @@ -1659,7 +1666,8 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->dsi_host.dev = dev; dsi->dev = dev; - dsi->driver_data = of_device_get_match_data(dev); + dsi->plat_data = of_device_get_match_data(dev); + dsi->driver_data = exynos_dsi_types[dsi->plat_data->hw_type]; dsi->supplies[0].supply = "vddcore"; dsi->supplies[1].supply = "vddio"; @@ -1817,6 +1825,51 @@ static const struct dev_pm_ops exynos_dsi_pm_ops = { pm_runtime_force_resume) }; +static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS3250, +}; + +static const struct exynos_dsi_plat_data exynos4210_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS4210, +}; + +static const struct exynos_dsi_plat_data exynos5410_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5410, +}; + +static const struct exynos_dsi_plat_data exynos5422_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5422, +}; + +static const struct exynos_dsi_plat_data exynos5433_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5433, +}; + +static const struct of_device_id exynos_dsi_of_match[] = { + { + .compatible = "samsung,exynos3250-mipi-dsi", + .data = &exynos3250_dsi_pdata, + }, + { + .compatible = "samsung,exynos4210-mipi-dsi", + .data = &exynos4210_dsi_pdata, + }, + { + .compatible = "samsung,exynos5410-mipi-dsi", + .data = &exynos5410_dsi_pdata, + }, + { + .compatible = "samsung,exynos5422-mipi-dsi", + .data = &exynos5422_dsi_pdata, + }, + { + .compatible = "samsung,exynos5433-mipi-dsi", + .data = &exynos5433_dsi_pdata, + }, + { /* sentinel. */ } +}; +MODULE_DEVICE_TABLE(of, exynos_dsi_of_match); + struct platform_driver dsi_driver = { .probe = exynos_dsi_probe, .remove = exynos_dsi_remove, From patchwork Thu Jan 26 14:44: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: 2681 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 1857D3F046 for ; Thu, 26 Jan 2023 15:46:19 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id u6-20020a170903124600b00188cd4769bcsf1203747plh.0 for ; Thu, 26 Jan 2023 06:46:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744378; cv=pass; d=google.com; s=arc-20160816; b=UfGvBfMCCdlsMnhsvgJNRGWMvD8MQ6M4XdeIw63nNXSmMcXuTYDfAYEHXWeyos+BjL MtfCuNjlbo8Ns8w6b2szYIxTtxv/3KfTplb61ODDK0f9ot2q8XoZPenJSLyVFIn8cf/V PGvUfSHbsvMiaZ48jQsQBhEu1ab4CCCsu1A9o0oagIEziAbHHgpF4c5ruNJKlBq8l/aw Wu6VUdDT4jOKrKFN5p8wSSPLQqXo7jP2S6T2fZch13Ghj0hNTXjJuqVRnDR5LHme4Chd A9jsgrCKw4GU+Z9CdrAkbDCVirQ37C9MQIIqg6hV6UptUJGZIHre8knguWcsdfh9Zi+z 78zQ== 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=s7w17IKXyxGWZbiOYba/zsMLlZbi5rlNwnHJJO9/GrM=; b=jtL+3pW7MRVC2QBkJCo6O28kuCtU1KCGAaPAFTk36jyiPjz+9/b79YvGA/eHjfoOR9 GWM793Ad0oWaixcIAKFUaWaxp7rsS736M2au16NfmgSEohkKzB5PF0QtjKaRqiPUzGhu 5cDzUsxxc8onVr1KNJQiKzNHpFQ+P454Lu8r+UIBl9tW85MksZEo6Mwe8C6dCUW5PVLd ZUkbiyNugeIt4lItuNqBifTPzOk8SRMbrEXPnM7hO7phKhdUMIv1GgGeIRJRNFjHQnQD EjWERp/efJNp3wnsl8BCNBNgdN9KDXUtlunvJqJN0Id0kvbpqInra1Vf8aWyO7Vzmw3B d5Xw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="dh6luB/q"; 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=s7w17IKXyxGWZbiOYba/zsMLlZbi5rlNwnHJJO9/GrM=; b=c04CGPmkVdcrIZ9jgjvSI3jnqsVjXfd8721l9KUJkMv2UYDWo5Cj9+i7aVIWO1io4N wBdhW93IgNjzPtm9Jd0wzChORBCEvves63eb3YnH0dTIRf+6faY1yAJ9BaQnvJY7BjHZ 4mI+q9Cidu1sttNhdz9G/ylQm1PzcmFH7xpm4= 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=s7w17IKXyxGWZbiOYba/zsMLlZbi5rlNwnHJJO9/GrM=; b=LHYNgzKiwYGNxFLFc99GM88206g86YG6vKplhORwCuD64G+2zuQnY8G3PDZkcAJXoX akwDpaj2ulTc+BEJDrS82XdnxmD0KH1YN9KRb2np++mOdZxpwO1lMDWAojIfR5akL5Nc DlJcdNgpoL4IwpKsvcmz9KVreeqF+WQKLBMKgNW0XC8rVW5UOeVktNco/Ke8jXp2cifM eUhupzYcjrzQAg/oVVBYzWBrxjLDjUQxBu/uiL4GuzoNeEk3B5YB+1wWOaDpMdOCG4nY Up2VppVVPqjI4E4ifTVISzGaZIlrgnYABsoJgutDk9fEnvaVrYCawG5f20n+6ANrE4YP 83rg== X-Gm-Message-State: AFqh2kpOFL8S82ClobQrIKDbXMGK+UN3qjT6P2Hh30PhbYYp/7w8bcby 2Wt4XxO5FCwNPfbUv8IShdOqAHAC X-Google-Smtp-Source: AMrXdXsEuZj3X243sykQP858h9LLkF1xafYya+hKk6FjQlfFqxHWJNnaRsBmHZiCewZ8/hogF+TgVQ== X-Received: by 2002:a17:90a:7d14:b0:229:efae:388e with SMTP id g20-20020a17090a7d1400b00229efae388emr4503192pjl.46.1674744377910; Thu, 26 Jan 2023 06:46:17 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:4101:b0:22b:b65d:b10d with SMTP id u1-20020a17090a410100b0022bb65db10dls2682757pjf.0.-pod-control-gmail; Thu, 26 Jan 2023 06:46:17 -0800 (PST) X-Received: by 2002:a17:902:c401:b0:194:dc73:5cf8 with SMTP id k1-20020a170902c40100b00194dc735cf8mr36528358plk.39.1674744376874; Thu, 26 Jan 2023 06:46:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744376; cv=none; d=google.com; s=arc-20160816; b=zCxXQQXVeK+USKiw0yz7iC8iLGynEEQtntfzX4qC2yuFaXl053ji54Q57i9k0Jvx+b 3P4xGFi0lDKcocZV8gqK2QWfzyHHNoUsuvGgAGyCud5c/+Ymm7QbmAk+U3CRvv1kGwCT ur+fh8cGm5b83oZPah+yngTFMAMF4Vmw/8jevkcBYmVOcjzo3cewt1Wsv2GoCvZTxevr iap+GeJlGIsszXTelwkjepyjqbgo251ruHYtv6hOr8RSFn+gI+y+cP4Mx0C+b3R8vFwl Xx6YdAJOhVEzP+DBeGNdgrpHBZX5I5Muf8BjO4lq3lBk7usHX0BGtpdNlD9GGKNKuy+L NvQQ== 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=aUy6DNNvAiPX9eeWAOGTVXrnTQlr6Vuyr0HCYZSKb9Q=; b=fn3VIi58Tc5jIaVvgqG7lYbX90tdWjbbgaXGHPL3/UM1s0tmQDXLaDOiKzulrpMkO0 RmVKPX+qkUeNlNKJyJAE24wMmN2X/63WKNlAR4yLEoNkPpOX4A9ni9ar1gKV6Kk95Mlr Y5jakUtyzYIWSY0xe8Z4RiknROIN/Tfs+ibTvsKPLgG641Osfqs46kszfc3TytAIct1L U5bYcCuN8EcXP0aa1LqeIYeKGN64PkfJbPIGSndrVenmliOfb5lRC8tJMWCqG476dSUz NwSZDshk/lSHaX8aVhF8ryZCnqBVLHBMK33pv5+8ktUHXGI9Glwx0YwRLp5lkHp+fR7M jSbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="dh6luB/q"; 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 g10-20020a1709026b4a00b001924e53acfasor680769plt.159.2023.01.26.06.46.16 for (Google Transport Security); Thu, 26 Jan 2023 06:46:16 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:a89c:b0:bb:b945:4865 with SMTP id ca28-20020a056a20a89c00b000bbb9454865mr6751320pzb.8.1674744376555; Thu, 26 Jan 2023 06:46:16 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.46.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:46:15 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 08/18] drm: exynos: dsi: Handle proper host initialization Date: Thu, 26 Jan 2023 20:14:17 +0530 Message-Id: <20230126144427.607098-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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="dh6luB/q"; 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 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 902bd46964cb..d4a976d86f08 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -254,6 +254,9 @@ struct exynos_dsi_transfer { #define DSIM_STATE_CMD_LPM BIT(2) #define DSIM_STATE_VIDOUT_AVAILABLE BIT(3) +#define exynos_dsi_hw_is_exynos(hw) \ + ((hw) >= DSIM_TYPE_EXYNOS3250 && (hw) <= DSIM_TYPE_EXYNOS5433) + enum exynos_dsi_type { DSIM_TYPE_EXYNOS3250, DSIM_TYPE_EXYNOS4210, @@ -1343,6 +1346,9 @@ static int exynos_dsi_init(struct exynos_dsi *dsi) { const struct exynos_dsi_driver_data *driver_data = dsi->driver_data; + if (dsi->state & DSIM_STATE_INITIALIZED) + return 0; + exynos_dsi_reset(dsi); exynos_dsi_enable_irq(dsi); @@ -1355,6 +1361,8 @@ static int exynos_dsi_init(struct exynos_dsi *dsi) exynos_dsi_set_phy_ctrl(dsi); exynos_dsi_init_link(dsi); + dsi->state |= DSIM_STATE_INITIALIZED; + return 0; } @@ -1410,6 +1418,16 @@ static void exynos_dsi_atomic_pre_enable(struct drm_bridge *bridge, } dsi->state |= DSIM_STATE_ENABLED; + + /* + * For Exynos-DSIM the downstream bridge, or panel are expecting + * the host initialization during DSI transfer. + */ + if (!exynos_dsi_hw_is_exynos(dsi->plat_data->hw_type)) { + ret = exynos_dsi_init(dsi); + if (ret) + return; + } } static void exynos_dsi_atomic_enable(struct drm_bridge *bridge, @@ -1556,12 +1574,9 @@ static ssize_t exynos_dsi_host_transfer(struct mipi_dsi_host *host, if (!(dsi->state & DSIM_STATE_ENABLED)) return -EINVAL; - if (!(dsi->state & DSIM_STATE_INITIALIZED)) { - ret = exynos_dsi_init(dsi); - if (ret) - return ret; - dsi->state |= DSIM_STATE_INITIALIZED; - } + ret = exynos_dsi_init(dsi); + if (ret) + return ret; ret = mipi_dsi_create_packet(&xfer.packet, msg); if (ret < 0) From patchwork Thu Jan 26 14:44: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: 2682 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 E55C93F046 for ; Thu, 26 Jan 2023 15:46:33 +0100 (CET) Received: by mail-pf1-f198.google.com with SMTP id by10-20020a056a00400a00b005918acc2e44sf1005699pfb.9 for ; Thu, 26 Jan 2023 06:46:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744392; cv=pass; d=google.com; s=arc-20160816; b=q3s8eLNyiRn3HrpWtjoCR/nZB797la2bLnUFyzt1QWiCfRpDqYdzEvgvuK0ffkG0K/ gu3oxJ76yNRmQ2rRENJY+CAxb2kn2fzkTCqQ19Pcyb/9gCq6bm5Db1KYKZJRsDg2ooIU ZBXXXqO1Ty8jPu45vqVan/PXOyWNi2iuc9ByspwriKbZjRbndrECc6Z4lz1PrV4oYs7j WtwrXolpFn3liSIcJ1AmSFN/wJPF15L3EzPlI6v8EeLQb+bMxBpSRNQm8BeIn83prPFF rbyojdvmD9+dpP+w9lsw8d6htWMyWN0X0Uh+Jmw7gxHgISQZR2HIgcZQg1T8USL3fppN Ofpg== 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=/9CdbAJbMNadqhkbeC1H7uavuwUysT3HfPYG4h2uESo=; b=UxcjYhRNUtNwCVouVIO6ajfelDiCaHZIeAjyu9DyzLJhhvx+UHq5xMeJ8kZhWTd3OH u68UweStVLuAlpFp6lMQ26XhIkw3J7fAMoDCTY7Gf79rzjlybnVlej7x0UDiPg8lSj12 XD71MD+WkfmBjgd4LDH7QeSXm8kxyZEsJYqbAo4PxJArnS/TInJy475tmQD1R4C/ed/N RoWTibfW+M792Dx1zStjCgAUOQ2hK/bBZnlqf+TuIO6Qu2qAnfu47gIoux9SJAGpcD3z 4wU5AJWXg1rYJbxKgFPTHubCk9Z+5Cfz+plmQ1l/T1NZL831lh3D67CL3nMNyvZd7X0c S0TQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nnNSrk9X; 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=/9CdbAJbMNadqhkbeC1H7uavuwUysT3HfPYG4h2uESo=; b=ie6wYT82BR6COddUWuo25b798mA3rfS3MjztFma85uXuL4STbT0zgj0GvwDuBBqjen uNXco6LhgC8gnfzSIIxZEE/K+pxKzYR2wG92N7a+1NNeDqdIXtfkogNBqp24JMQtizJ0 Xp5OcAKuRlXQdvfsQDayvAFMHTMhJDPhAVmxg= 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=/9CdbAJbMNadqhkbeC1H7uavuwUysT3HfPYG4h2uESo=; b=tmlk/agGOodLD6NM5uPLy+hx5ew464B+R21JoUf8rwgtVi5agWn5mXdXWBOwyqFkx/ 4/3FmbfmfiWzeLipvzQXRXRlywpH9sOF8+hs9XonCBnvUDvaluzMJoBlR4OtzhwJoW1s mKjnkV4N+8CJONSagWcyaL5aAfJjgkYensm5PTVPEnAHMqDQzRfEMHWnK+720Pxy5Qnv Wujrv0mmQGqTsICZXa0fmVaRhGsHf9ezzAhvjLBaWyz/xF32lOOQ3uOsElwGPlKh3rd/ Vs8lHsoAUuERjw1nRQjnYXI5uTCVJeI99IL8VE/SEhof97NBeWYIpQdOSGdVP9FBso5P vgOA== X-Gm-Message-State: AFqh2kokp0cpDj9TJwAhe58bQjQl+TT/DaXe4cwoF1FGESuH9o3OHXEb SztNUs77qDTBwTAwwkUxvD+RsZ0G X-Google-Smtp-Source: AMrXdXtJJuljWsrvAswY+aDhS3YzMPIIK2bidCIQwZErGDSc5WvbZSntrBXrBKsWCrCMH9SxYthG4A== X-Received: by 2002:a17:902:8304:b0:194:6253:d685 with SMTP id bd4-20020a170902830400b001946253d685mr3994171plb.3.1674744392730; Thu, 26 Jan 2023 06:46:32 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:2cc:b0:194:6afa:c3 with SMTP id s12-20020a17090302cc00b001946afa00c3ls2368753plk.4.-pod-prod-gmail; Thu, 26 Jan 2023 06:46:32 -0800 (PST) X-Received: by 2002:a17:902:8d94:b0:192:d9dd:167d with SMTP id v20-20020a1709028d9400b00192d9dd167dmr31932876plo.43.1674744391883; Thu, 26 Jan 2023 06:46:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744391; cv=none; d=google.com; s=arc-20160816; b=0wdf2eEkA3/vkVB0ZOksbji5geNSUAsZ5PXftNuDHllnWGBkpGdIA0U4W3JxBX+hhq 5gmNWxbsnFZ26T2VDdy3c9I8hWasU1GYHGenNNGwwWOiyewH0+0mRZeVkOaQwVDPx9oA nbCZBFy5NhITKLhGlyHdvNk5LDcfBnvu1Ht2wbTciF4oYFxyPR3K9haPXZxF0xFcSzHi dQyAQHh9gBz0/6WTGWzJPvgCCPCI+Iyp9UhMu1UJjd5azHQmsKxALMTMn5kcVVkrtnWL iLGe+IO4aEW/i7YeXLGVP8RzTTGIBQsbzrkHya81cJ+Hf/BhhV69D4LhZF0vOD7Oh6lu gIaw== 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=c4Zt0Fx4HYrC+EA7BQu40bK0DS9Q1S4wdUAYAMr7AkA=; b=FZ01oAh4JioBmZ/DN90yCQK6CdQGedoepL5Bm1KSZT1x1cLt1HOuCMBdNv91fww6sS L8AS0mEqxNTBICHB+XzJ0oPGcMs4UJ4gNgQvinogrksKhnY841wLoHGoJEIo7cdGA+MY KXSvmthOz+eEUjV3w/Y4qUH08qDY/yEGoaGwcimi0qp04UHK7/tseYgPue+P49bxVBs+ wpklQyAjTOUCqUYrx8h4e98heEadrs1b6Z/YA16pFayk8jU8rFZt80y4RVF2BeqyK7tU i0XYzbrqk61KOYZxR91eQWKJ9cav2iD5sjoNp2KMiy2KQk84/a1yK2xlD3wfMBY0bjBN V6TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nnNSrk9X; 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 z1-20020a170903018100b00190ec3cd503sor709426plg.64.2023.01.26.06.46.31 for (Google Transport Security); Thu, 26 Jan 2023 06:46:31 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:ce49:b0:bb:9aee:f6d3 with SMTP id id9-20020a056a20ce4900b000bb9aeef6d3mr10489096pzb.46.1674744391517; Thu, 26 Jan 2023 06:46:31 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.46.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:46:30 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 09/18] drm: exynos: dsi: Add atomic check Date: Thu, 26 Jan 2023 20:14:18 +0530 Message-Id: <20230126144427.607098-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=nnNSrk9X; 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 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 d4a976d86f08..d8958838ab7b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -263,6 +263,7 @@ enum exynos_dsi_type { DSIM_TYPE_EXYNOS5410, DSIM_TYPE_EXYNOS5422, DSIM_TYPE_EXYNOS5433, + DSIM_TYPE_IMX8MM, DSIM_TYPE_COUNT, }; @@ -1465,6 +1466,32 @@ static void exynos_dsi_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +static int exynos_dsi_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct exynos_dsi *dsi = bridge_to_dsi(bridge); + struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; + + /* + * The i.MX8M Mini/Nano glue logic between LCDIF and DSIM + * inverts HS/VS/DE sync signals polarity, therefore, while + * i.MX 8M Mini Applications Processor Reference Manual Rev. 3, 11/2020 + * 13.6.3.5.2 RGB interface + * i.MX 8M Nano Applications Processor Reference Manual Rev. 2, 07/2022 + * 13.6.2.7.2 RGB interface + * both claim "Vsync, Hsync, and VDEN are active high signals.", the + * LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. + */ + if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) { + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); + } + + return 0; +} + static void exynos_dsi_mode_set(struct drm_bridge *bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode) @@ -1487,6 +1514,7 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_check = exynos_dsi_atomic_check, .atomic_pre_enable = exynos_dsi_atomic_pre_enable, .atomic_enable = exynos_dsi_atomic_enable, .atomic_disable = exynos_dsi_atomic_disable, From patchwork Thu Jan 26 14:44:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2683 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 53C8A3F046 for ; Thu, 26 Jan 2023 15:46:47 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id pv1-20020a17090b3c8100b0022c1ab71110sf1478921pjb.7 for ; Thu, 26 Jan 2023 06:46:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744406; cv=pass; d=google.com; s=arc-20160816; b=utn5eV60ktFlcMBKCF6MgZXdOuv3ukx4JTwKOV+24/OEl8m1wq5BDd4IegNaLlEFb0 N21vcYjKwTj1jPYjnKqztE/r534/XQJYwjhnCWFBhnS9WRMzCXthxvg142t07lYONgj6 mVu5+vRpKAzfRb/AgvokF4w3E/sWm52iNMknQlS9gA9HaC/Mmy+4xjaEnNgrGtUNPyB4 WuvnC4skP3XZqZUItyN6k1OYtcxCwk/FKoTeuvHGa+74ako8+yu15AaMrNPNXzW8HdyV 3XVI4J89Wc8T62baBttHlAplvg7ECT7brb/x+URxNn72sKasjnKG5UPPCUcEsZPusqvj tw7g== 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=EWwKHQD4VCCeY9gsS2y1rEUzrn6YS0W+wN9KeMLW0oc=; b=lRGdlRi0oaF/MjqOEjNLxLqo0Yf2431V4c5+NykPctMP50JYp0I5MoHMIsArrE62ZA Y8SK5tzJunfrdrjzg97S30VZlmzSAUYXmfMylLcEAiQC6yE0vE7mvdJotZA9mE0kmNA0 bzaerGO/iSbY5WreRvaJiJ74VHMDQn77wgpw6U9qDAAVC7WkmknSGgu7T/Ed9Rq7w6AS IKDp0WkKe40OB9QiU66+cI41UI8tNy7c/yIS/B6mgi3HKQUou8LlKzpzRzLwbX0OPdbQ Uc8qn6M1R8+D6GRInDKUDFBa/Ukh22Gc9ot2qtVQIcLZQUa4paWGNgx6MzzxgazRA7ov 6hZw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=J5r6PKry; 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=EWwKHQD4VCCeY9gsS2y1rEUzrn6YS0W+wN9KeMLW0oc=; b=c2r20fya/h1jsnw5Zh69EQNeFfhTH4/ryXIvqVLR0QNNwuYbbzuszwPjWf5umDxgbX HuwYFkZ6XxBcwDF2R3FGRUKjYF/zD35bpNLYKd3JOUaRcCtgf/YTpDD+OiVJBLP3S/HG TOHjWgqD55O3n9sN8SlpqrAutKvKRYvReLu44= 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=EWwKHQD4VCCeY9gsS2y1rEUzrn6YS0W+wN9KeMLW0oc=; b=A4I67nfP6bw6b8hc+tBzZNbbrhN/TxlbfYcS1radKEWBReKWmFv6oWnbCO7fDe2vIF oPQ7en3MWTV5tF3eqAoVU6bB1v+DGM+sgZTBqd2e9C7gGEG49LCMgNuRQipOLBru5c+9 OSakhxwDgYvtDC4NrqO+b+LoJFvXJcq6OYcYN3GqqgWF6ZFSaco1/i4EX9d1BkN72SpR o7obGl4gYwPDd0j8qaNAFLSbDNSWgp5X/VtDPsbmoYmWeQ5ixC8+e4NZiemuNHNfx6Ly sNPQtpY2S13OEdpvLND4hK4AX6gdTHr+IKMt9fS79PS1MGwqFMsYd03s4P3cxvgaNB1i N6sA== X-Gm-Message-State: AO0yUKXr3n/MVX60/oM86VA9D7bqCQ6kvs4T69WL2r5uAx23L1BwbtOQ KWTB48BWNWySePgMCNNOWvlGtDBo X-Google-Smtp-Source: AK7set/1qtzV7Sv+7C+Gy59cTtboGmQ5Ebh6v+Q3pVrRJvuopt1a5YETkQ4pY0uTbshhYzgH4r0eYQ== X-Received: by 2002:a63:440e:0:b0:4d7:fc60:7ec0 with SMTP id r14-20020a63440e000000b004d7fc607ec0mr1344729pga.107.1674744406152; Thu, 26 Jan 2023 06:46:46 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:d80e:b0:22b:eeb8:fd6a with SMTP id a14-20020a17090ad80e00b0022beeb8fd6als2663332pjv.1.-pod-control-gmail; Thu, 26 Jan 2023 06:46:45 -0800 (PST) X-Received: by 2002:a17:902:da8d:b0:194:7a42:2d33 with SMTP id j13-20020a170902da8d00b001947a422d33mr45694045plx.28.1674744405385; Thu, 26 Jan 2023 06:46:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744405; cv=none; d=google.com; s=arc-20160816; b=RmIxKu63GQS/XcUxMVIhT6chA5VKDvqkAheTYOIPO0V0bxfWb3NRUw3n3yLvas3gzc Gm7yYsb7hqp0zoRlEjow4NTWi1y+Y9JQvZh+SGxz22MnWFZPv+JIfUrPmROg1IzYEdx3 JLQWpuoTxkN5ODrz9embn+bHFRUqAQf6DVtu8uGCZF0OL91DhWKEd+zw1Ks8QGHlsUhW NLC+eb4Sl7Ki/fHigm0+b8ofArwvZPlAMnCz2ncVnlKCXCCUOtIvH++VL7xhnJyePKLj 1jM2iNf79kOyK2zsXCS6LPsIXamztXNWoZTdIfQlcNFREcckZTYnymV2hNuQzinSHrNG hLVA== 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=CCVYG25W1pHQNxSfAOiHmaNQidizxzXKd6AiL4XAwms=; b=ebi3W/95QnomyfozJ/1+faV2Hm9yyJyMxoNs7iemIYf0JpmRZU+6L044XMGaefVDIa G5AO/oJBLnLKLnWRET3aSF0WSIeyWBBP4AmBknSJdlgIY7W6q7mHmex1zZE3xCOpOcVd JNlAXFGvPycfEPhBSqL2ReYfhWkcvHYdT4Q70ySm10VOGJuxXprK74GFXIQ+FRAxVeP8 gNWUDVBqAF5YCtCLRmbrwQuDAvfiREemBW4U8BzPh94uBTikl/WkQWFicnh8B2NPLs1V QVCipeJF8XKuF6uyacgqScwIZ0U6CQmUFzzZdvfr8qgtiawYzmLfhkntL1hMnT4f6g8u +tLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=J5r6PKry; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id r10-20020a170902c60a00b001962546f9f2sor668021plr.170.2023.01.26.06.46.45 for (Google Transport Security); Thu, 26 Jan 2023 06:46:45 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:3942:b0:b8:50fd:fd1a with SMTP id r2-20020a056a20394200b000b850fdfd1amr50376881pzg.19.1674744405018; Thu, 26 Jan 2023 06:46:45 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:46:44 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 10/18] drm: exynos: dsi: Add input_bus_flags Date: Thu, 26 Jan 2023 20:14:19 +0530 Message-Id: <20230126144427.607098-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=J5r6PKry; 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 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 d8958838ab7b..5518d92c8455 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1691,6 +1691,10 @@ static const struct component_ops exynos_dsi_component_ops = { .unbind = exynos_dsi_unbind, }; +static const struct drm_bridge_timings dsim_bridge_timings_de_low = { + .input_bus_flags = DRM_BUS_FLAG_DE_LOW, +}; + static int exynos_dsi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1777,6 +1781,10 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; dsi->bridge.pre_enable_prev_first = true; + /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ + if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) + dsi->bridge.timings = &dsim_bridge_timings_de_low; + ret = component_add(dev, &exynos_dsi_component_ops); if (ret) goto err_disable_runtime; From patchwork Thu Jan 26 14:44:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2684 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EDAC03F046 for ; Thu, 26 Jan 2023 15:46:59 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id v23-20020aa78097000000b005748c087db1sf1013322pff.2 for ; Thu, 26 Jan 2023 06:46:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744418; cv=pass; d=google.com; s=arc-20160816; b=fg+bQf5FHSRqDtukYqUASBipkIgyA0jXmcMJ/tbyVlv2NekvNUbqD3PYyp1iLa0TwI R/6PuXmi5Lyd+DrFX0OYwMRFV2qL+N6KHDDILgI+OuQZ19zuWnchR9E0PPocZdi0dMyU B2TbBlc8DQfD52gM8B/6qolk0WCphhw6GLDzzF6WjB7yC5jiAWdZHzLlPC8ZfJr3v8Be VY2APA0foZJc1tN0VeJhLODGnZr+cRCpmoy8Y4hzceqP3FEsPJMrOEPzxLHP1OYuSkgs 4Ub4uwCdFkG9X79vqp66bpknIqKQLAn6g2zv2zQKvjp7IJNNUIZqYlSwLS/pfHd2EP0M sHKg== 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=VRfJ3AY5ZJrcXLPgwbzKzSe5853vsRvzf0BW25tftRw=; b=0FlkdV3kC3a+lB0M/0hyL7bPwIA2uwBxExtwFAjeAa0m1YRBKZoqn1rTDA+rA2b5Vm RXYg7tkwhGqqAG/B6oJfDwtBJ5wJSGk1jzxq9h2bSLHxyfN+ggrUH2R3gScS4xLBWUjo kMzI8ulsYkbFPebLBVAZCyztws9GsHv+N0B4RGRX3u73RLsUnnJvLyTvlLavs9cmtFUj sghKGmTVQ02K2kHiaBVth8QBLc5UotZEDfuTOKDIl9iPjbY5D3wXHuqMzOrrDKDC3y5y cJScR0Oh8djgtoeQwrARTjviDFHQdCH3Dg7lyP2ArRtUOAND7WKLrfPZDa9tvihqGfA/ +YFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jw5dG3mm; 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=VRfJ3AY5ZJrcXLPgwbzKzSe5853vsRvzf0BW25tftRw=; b=Dbh8/X5ng407acZTCexmPpUZOsyN5LMEkFvwU+4TIZcAFLJnSAcuEiwCoNiuAUR/e4 sUf6kP5Aq4UuY9OkBUiS3ygAU7e4ngFYHRtjUg4XHkTEGCn4HQNOEQBgj8GfBD3RopuW +1YerDKhLWFVap/V0T+Jhimeg9BkNdMNejnYY= 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=VRfJ3AY5ZJrcXLPgwbzKzSe5853vsRvzf0BW25tftRw=; b=xz94RbK9iqG3sk/d/sJrRz2S4lJz3bwHbTF8apZu/ceu6j6Dfdvolnn1jW4/1uvPRE i5RRpkI9tEAQ4V3hL34JNIj8UXy6OOaotVUBEqoIzeecWz2vKQR7N1Tk1PiGN0eXHkWN KvqjWZ8HYK7Knqxj0BkJi17lanZwQi7JfRalJ8X18D4YLnoqvFZDkLaZxBMBuWovQRym A1XWwy1N7V898dshZ2zusqmf0p1bpbiuyc9FM36urZGMbvdG/dZ2aJqkVqWQHB8N+aoX ChuLnkhy5Y1IswBmB6wm/nKSbokyroC3DiiSToGELDSdSLe/tBNw5FyJVdJoQGN9qkDF YMiA== X-Gm-Message-State: AFqh2kriKxwHKRjhmWjd8kfUTy6jmVMJIda8i0/cWnh4mIR1CQ7GnHVC Qbhr86qRIJoR2g/RUNl7E7Ghu+iI X-Google-Smtp-Source: AMrXdXsdIqPbGuBjhixK8Bap5AoRxRHWen+mdeQQf7YF/wF4UoKq9ViEFdmiMfXHjU7UuGOFBcww3g== X-Received: by 2002:aa7:910c:0:b0:58d:bb12:2da5 with SMTP id 12-20020aa7910c000000b0058dbb122da5mr3924477pfh.27.1674744418677; Thu, 26 Jan 2023 06:46:58 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:cf09:b0:210:6f33:e22d with SMTP id h9-20020a17090acf0900b002106f33e22dls2644630pju.2.-pod-control-gmail; Thu, 26 Jan 2023 06:46:58 -0800 (PST) X-Received: by 2002:a17:902:9b8b:b0:194:812b:6737 with SMTP id y11-20020a1709029b8b00b00194812b6737mr36975420plp.23.1674744417799; Thu, 26 Jan 2023 06:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744417; cv=none; d=google.com; s=arc-20160816; b=MTRupPj6HIAMQkj22Of6G/6Ph13itp5GniUXEVx1JrvC+AgemLRCE7nVQqRxwgGj8c apeWR7h7zVMQM78pA8SPn05saLoLWjVDwBZZ+QeY8ASWfU6elmwqQqQ9EozZR2JwpkA4 xZ1ekeBueuQocccFjvI/FkcuT7ANexNnud/AsB2k3BFmGAQGsd5i82CpVIJlstE/cCHI XCao+rSAaAhTN6H5lTNzDv2+HoCJcdsv0ntiuTyxe+qw5+FCvQpst1amCup8cC5tUhs+ /WX1OVsVXnSl2dZVXwYEsvH62ekX52ORMxuol5jG9IdxniAmxMa/GTPy1X+R4/s0vS35 Pp0w== 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=FIzwHk3KlOuotRd1vtFiT01NZHo9fUxqS1kmRS+uxAM=; b=hZIDZ4WOG8UmT3opOXnctgRel5EaJu19z2X+trcwBBG/+GRII5eOTvwc9CeMD4lNiO KO0nVGeko8edvN0bWqOZxlx/TiyoBorS+P9i8B4iMK7UerxDmB33TMwBeyKPA/JvZi5k F1gU1PblvlCIU/L2RiW9cLNevoqvzYZK516LTC07hdadnv7AmC/4mHzQ5yGnsNguF8iV plQ4rGibqAzdyXt+oD7CpLa/Lr7dw+CAEC++aJ927XtPQT6aon43lVH4/kpmO/UIrlfo 24LYqFCbx02QD4bLJWiBj3+bd3ErJ2KA5VAT+wjAe+S0UpA5vJlrtyyaczEonQONy1+4 kd4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jw5dG3mm; 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 i11-20020a170902c94b00b00194c43382fasor732659pla.142.2023.01.26.06.46.57 for (Google Transport Security); Thu, 26 Jan 2023 06:46:57 -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:90b:4a4f:b0:22c:4e1:94f with SMTP id lb15-20020a17090b4a4f00b0022c04e1094fmr6906913pjb.13.1674744417491; Thu, 26 Jan 2023 06:46:57 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:46:57 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 11/18] drm: exynos: dsi: Add atomic_get_input_bus_fmts Date: Thu, 26 Jan 2023 20:14:20 +0530 Message-Id: <20230126144427.607098-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=jw5dG3mm; 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 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 5518d92c8455..9459c138d0e0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -1466,6 +1467,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, @@ -1514,6 +1575,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 Thu Jan 26 14:44:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2685 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 021413F046 for ; Thu, 26 Jan 2023 15:47:12 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id 84-20020a630257000000b00477f88d334esf854188pgc.11 for ; Thu, 26 Jan 2023 06:47:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744430; cv=pass; d=google.com; s=arc-20160816; b=krDPbhvrO0g04jQ0D9pKNM1Rv5ZjuceH+3s9dLAA6AwjMIX0rIGnX8RsvrPRaYh5uh LiqvncgpFoyEmK03XKYxQuMDacFwowCvQPgUJHm+4eCdWwYyC3+HUMWofdQ6BkyKRzzC DTr+6/svY/4+oZmJWoqlqneyueZBv1KWlrB26F6ggs+3FWIYW+Wv63N8lpFK4fy0LRKd 3HXcMOwv5DMNiStI9OETWA9JY+nZr61fyovFDpAy/gJ1hOglnL6PBBgK9PN7xEKO91Fp p9LXQwnQVyYXYXa8769HaTjV1BsRrHsQRUaDiOD3hk3TQHb3+hePEmGcFcL7hkA7yCrI AlbQ== 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=Wu3O+tp+trEbJkKWkFFdDgrlQJS1RHf4YwM+9PCGUaM=; b=mkke1wEpaBDm7mGYP26VZPDSiOV7bINLbqVKhaVNcEuG4Lvy9JT2LxrsR6ctDTU1B/ m/P7Jk1gE3X1axon8MnVdb96Wy5TbSUpuqNkSPVaLVF6vdq4YuWNbSsXCUQukVfQlanl K/ArtJDW0Z6h7WF2SWbvpg1RMEQ26V0+yB+h8bsIa2NmwhvoZKqs6QHMh31aU6AUcYcj cEV4Q1pB27/1Y65Ocu2cRpi1usoLcxva+yibLCF6T4ScgLnSHLCHXGIqopnvv+B74GNK /49xnHOHrcYTWoU9x/irkgMY05SANgABgyFkcw3Vj6mZi366DJrprzfS8SrloFN10kjK 8xvw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CUCJGPZq; 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=Wu3O+tp+trEbJkKWkFFdDgrlQJS1RHf4YwM+9PCGUaM=; b=TydGQwavuO5Mlsg/dQEWqUn5jvIvmotTN5f3P7cNcDBa8TxgokPCTTk8NYHY6B3sn2 S49AGHg5eEdCx6viSlRDZHaw+kPqKplXqZWOlkyR3Qtjkt8S3KS0A/Yky/199gjGkgL9 2evvxErXn64dK3SOn9rkDaEEgUpaD51y0O9PQ= 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=Wu3O+tp+trEbJkKWkFFdDgrlQJS1RHf4YwM+9PCGUaM=; b=MmVkm0vvVCWBoIRdvIzB7HyJMuusY2x903p44i35zvrkM1c0lMpTO3Bg2oKMa+igi0 0pEg8NopflXrFFsjA/0hmf2RS3dtvoOyAHEUbBDx8ZErXRX4435QvukNOJ4KEEVUxahK id0QNW2+tHsldgEt0cIIViIaAxTz3Eih0CbmaqFcK67lDIZvmJimN4A1PVOirjkBDexx js33eIydCYemwUi2sXZUvDUPBUwuMbOsF3bu/5MjRafUanD27T4T3xu7Qg69NMc9pddy y59jqAfqT7VJZqcQltI9nZgCOyefhlZ44RJUKs4tNCG3y7MA9AUOtW4ip6MJ3Mhz4Tch DNUw== X-Gm-Message-State: AFqh2ko5ZSQI6mcaf1tbwhrxDOHuuzODG15LPtcQNnEnXeBql4beTPH4 68uJfOHn5Cgtp/7NF5WMhQU4aC8W X-Google-Smtp-Source: AMrXdXupbGo+aVdhS3w6KgCuB3TssDTjD1HHrDMYrBPP9PGYsg4riR7O07ekuESSYcLO8j9IzK4Wjg== X-Received: by 2002:a17:90a:640d:b0:227:2469:27ed with SMTP id g13-20020a17090a640d00b00227246927edmr5139865pjj.140.1674744430719; Thu, 26 Jan 2023 06:47:10 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:3656:b0:22c:104:b982 with SMTP id nh22-20020a17090b365600b0022c0104b982ls2639831pjb.3.-pod-control-gmail; Thu, 26 Jan 2023 06:47:10 -0800 (PST) X-Received: by 2002:a17:90a:bb8f:b0:226:cdcf:da83 with SMTP id v15-20020a17090abb8f00b00226cdcfda83mr36890843pjr.46.1674744429766; Thu, 26 Jan 2023 06:47:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744429; cv=none; d=google.com; s=arc-20160816; b=T68riC4AiYom5H52C0gg1tBY3s/E3ZcSqcGtadbFlFVkfRvok/N4AT7uAX9B8B+skD 4UMIEgyNfaPGEBZ/g8Rcvd9rSl3Clju914EgSbbX7TwVKvzFxGlBCXAP/5RRacQ1L7kM WCfzXXktjOPiNGqEgRPHuL/5Fy8B9fULyd5ioY/LK1nZLnGq0h5WvzLBxKEmsNFWvdSw iQK3c1VTcEjvWoMof5swPRBG8OokvtZTpQvSYPqjBsBouwQqdqigAEzajKz8fQ3NqzQr SbcI+RNpZS1UzBgQ+XesgegNGbCE39RF+vHB6n4v0bNs/7+4lcJbmL7svIFRhAS65KHo I+Cg== 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=yo9iZG7thbeh/Q27IofLDMHgJmskqvn2YbJQaVoxMqQ=; b=dDEaf0s6gcYNEs5VVCVLEpClHuQkK0CGm4z7z2gT/r6+9RNLS0tYhal9KOKc97z2dN IUhJI6t2vzu1xNjrK/vj91+awFvi43wVh2gVY1M59y+Hsy/ec9QW87MzmXKuivM1Nhip PCrz3o3ruyBf788tlQqJoNr+WB53wgspoXQnynNJ7n9IC4NoJgKotAimY4Q7NK9ZAnG1 nQwrd5ps3jK0PBhfBm1Gn0humFfkdi+Wwsg1ha+QiHY1OE28NciDOcONjb031PPoNW8M CRN8dfRb44sJRMEY1HZHUnCPrQa/tazthSEOB2wq7lCtdBQxEsBJUQ9YA5o51pa2cl3H kH1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CUCJGPZq; 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 r30-20020a17090a43a100b0022659d7a878sor714880pjg.17.2023.01.26.06.47.09 for (Google Transport Security); Thu, 26 Jan 2023 06:47:09 -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:90b:4c43:b0:22b:b392:96be with SMTP id np3-20020a17090b4c4300b0022bb39296bemr23651311pjb.6.1674744429421; Thu, 26 Jan 2023 06:47:09 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:47:08 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 12/18] drm: exynos: dsi: Consolidate component and bridge Date: Thu, 26 Jan 2023 20:14:21 +0530 Message-Id: <20230126144427.607098-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=CUCJGPZq; 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 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 9459c138d0e0..488fae218205 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -283,10 +283,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; @@ -316,6 +316,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) @@ -1320,7 +1333,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); @@ -1589,9 +1603,8 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct exynos_dsi *dsi = host_to_dsi(host); + const struct exynos_dsi_plat_data *pdata = dsi->plat_data; struct device *dev = dsi->dev; - struct drm_encoder *encoder = &dsi->encoder; - struct drm_device *drm = encoder->dev; int ret; dsi->out_bridge = devm_drm_of_dsi_get_bridge(dev, dev->of_node, 1, 0); @@ -1605,35 +1618,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; } @@ -1642,12 +1635,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); @@ -1721,11 +1716,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; @@ -1743,7 +1794,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); } @@ -1753,6 +1804,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, }; @@ -1847,7 +1932,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; @@ -1938,24 +2025,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 Thu Jan 26 14:44:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2686 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 4AA483F046 for ; Thu, 26 Jan 2023 15:47:25 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id on9-20020a17090b1d0900b0022955c2f0f4sf3420378pjb.1 for ; Thu, 26 Jan 2023 06:47:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744444; cv=pass; d=google.com; s=arc-20160816; b=mmbjCc728E+NQmqqw5fSqxDn8Vq7JZliwUnEadq3/2vtjHXen9J1IHVl4iAkwFNh+J lEpkjyYqhuQkMQJ22PlKg1xg8wo6SYXqBAHAwpWu13Y7oBqM78Xa7FL7p0Xv0+h9K8/A U2vIfMRQQ9AUvB9wmHcVgKVVjbZTuvdaJ9/vHHrU+c8Mm7mO0rMcsfZSMNji++9FNUBo +EnkMfDubRW2p+FX32VLcbTEyP/F43cf90uC0nBpVMj2HEUwBbTWO4IJGldmkEu6JRq9 8sgOlOGJ1W7o5S+lPLQoQenkEHEKRtJGdAZA1lsucZ/XjITvsyPclxhzKB6d8AscbtOV 0OWA== 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=Cw2G8jcsU2qHsTBFDSrxxpXB5Bfg4rPNZJoqepKnbzg=; b=nf4qwuPu0OIUsVdlOUyeEOvl4VhHo2bSrx0u/d8hVR7LoUO29XrSEHc0HiWdwNX0bX e+sZ5kvuH8DpaTzbTZU6Xj6/0ZoIanHSrqJeJl95Y7YFX7AF/BD0+FL9OGD7DOftH2sW cyXDezCFoWNqEvWVfvRDS5Yp92mGkzqTOcLTW2s3C0EgIh9QCxxhy0c6MWoAnnDZ5Lgs qp6gxrVguPH+cT7rPZxaYkzSc6YxxdsuvT3EXwN+3bB0hm9bZXJejZ4LGoNxLgQOnjR9 y0BIlPXPjaf75IIISEHwjO6r+gDbeTWZoJzyeq0uSM5XGC19bZggktG3V16/riqywaR/ GPzQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lMOybId8; 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=Cw2G8jcsU2qHsTBFDSrxxpXB5Bfg4rPNZJoqepKnbzg=; b=FPA6147kZiLuYfyVaNOKvPOalSkPPMXqC+aelgm/74b51m9pUnOGDjhPiLkGt7uuAi H2RTJ1/YNCVzWdzmAJ1tSGTUvhxUtWzw7iKlBLoi6EBBY4RurdiRG2N5cAcIaK6dKcBT bD2aP4XFNwwUn8Vc5ycmuEDaoaD2bn4zQmEEQ= 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=Cw2G8jcsU2qHsTBFDSrxxpXB5Bfg4rPNZJoqepKnbzg=; b=iGkMNv8aTdh8HK1YQfbPVCSVWy7yuFunT2Tc0Upejk2gFk7ZUHgMraesVgv9MlHxrn Cz3bHkB9OnhgNyqDej1MFoPx6HnjhUw8aze7q4h8Wc864tXJSKI0UYSuaMpffj6Gu9KT qCg3tG7Re8hQVQuPhdfXL8oh/bChd/Y6j2BRaSmHEnMcd1baNqmRP+iwijkLEY3NDLPb 3Depy3QTdSJlppTg/zcK2atjHAWvOwTEOyVRYcnhgHYz+u0UT/1O2ludQUgHtLVLMTD1 XQBufAawWGvEqMPr2697tf/aQYa88ACgv6YIl6d5VPHA5EBRQZpAGsRIFJ56WAb72jen miDw== X-Gm-Message-State: AFqh2kodFah9oqj3HvElvHCIChB26RwlUYmj71W2nBcrhVfxIesDPjXO V5vrT6IgBaZx3pVaO7HfEy45aC14 X-Google-Smtp-Source: AMrXdXuS/15wcLpdPzr/SCy4jf6yWLYHHw3g9M/L3mbcv8gNzVZuA/hcXfdD44rWrccuGyBdvYK/9w== X-Received: by 2002:aa7:8ecd:0:b0:581:2379:f591 with SMTP id b13-20020aa78ecd000000b005812379f591mr3704993pfr.38.1674744444001; Thu, 26 Jan 2023 06:47:24 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:988f:b0:192:76dc:bdd0 with SMTP id s15-20020a170902988f00b0019276dcbdd0ls2366951plp.5.-pod-prod-gmail; Thu, 26 Jan 2023 06:47:23 -0800 (PST) X-Received: by 2002:a17:902:ea01:b0:196:37a4:772a with SMTP id s1-20020a170902ea0100b0019637a4772amr5195540plg.65.1674744443184; Thu, 26 Jan 2023 06:47:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744443; cv=none; d=google.com; s=arc-20160816; b=uKSIROaIxJ4nQCnvSyATBdIEaFb26CP97KtiPlqVlxf56SI03TmgsfcnvJJLswAFMt prITX+bx+zbN3pIu7Nqght9E5Et7Il3ldBBkc2hcsIzXmNUS/NWvtRmdhC/y1cktgNxZ LWbhW2++iTb3CuKDNkUlL/GvHoAxgjQDIm+ww6bNWXKcTQaJWCkbFiCOT8Amup05cR4a 7E3SwYIR/3Drbl9iaB6099opxStSWzVi1thd03xwRdhaC5avVOz1PxpvmIg/R0DqVFGa 2TCKOiiue5HhkiqRSOGxKIPuwywsxZJNNxfBbJPrvAWQj+oyF7MMjJBsNq+9oVVq3Ied pCBw== 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=A1BDEAt+rxWWloQDlKB/2I6ZLTZG0ASWjyAAcB7oGTE=; b=pskTqPAKI5HLGHSB8DSyDuF/5QHrklTbjnvC3aa7LBLUaBlC6eQmwB2Es7XCwBrMmh wnzASIsLVqy4LmF+4l/Q5qb1tEh/2yshQwF0xh6khhe0W+pWzVWI3RvV7DwrUEMIXRuf vchhSKj210Ln0MlSbdq0zON1srwwiiCqYZOKVDLn933S5qQQphKi6RBzbc2KdMd2o9MH EaW1v990n5ybMbAKUrKx5H7GBRTSUuiF6PAR3iXAdZSPLT/+NARfRtI2qK6gdHquk64Z dV80KWBr54SE2pIlyNWSUFVXoF5eLd1D4hq1b2LdOtRLJ98Rp8CttZ7YdfqqqQLRQNXt R9/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lMOybId8; 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 b19-20020a170902d41300b00196064bf2cesor731177ple.74.2023.01.26.06.47.23 for (Google Transport Security); Thu, 26 Jan 2023 06:47:23 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a21:3381:b0:af:6cc0:5b3d with SMTP id yy1-20020a056a21338100b000af6cc05b3dmr50400165pzb.7.1674744442878; Thu, 26 Jan 2023 06:47:22 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:47:22 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 13/18] drm: exynos: dsi: Add host helper for te_irq_handler Date: Thu, 26 Jan 2023 20:14:22 +0530 Message-Id: <20230126144427.607098-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=lMOybId8; 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 --- 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 488fae218205..1d95909391e2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -325,6 +325,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 { @@ -1333,11 +1334,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; } @@ -1716,6 +1716,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) { @@ -2030,6 +2041,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 Thu Jan 26 14:44:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2687 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 28A8E3F046 for ; Thu, 26 Jan 2023 15:47:36 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id bk2-20020a056a02028200b004a7e2a790d2sf848784pgb.18 for ; Thu, 26 Jan 2023 06:47:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744455; cv=pass; d=google.com; s=arc-20160816; b=N5YqjdsrxMKVKEcHwHjBnJdLLZNyiMeLLG6wY40T0MuLYv7tsoEwcE1O/u6XSqDbkh GTjznFkwsZ2MmPBGtIbI92VgS78rc+Qemq0A18fygjy2WR7f0Xhe8SPRhfQjX6arg0Xw 1DMq48ied4hE6aBJuiasD7jiWAcsybeucto3MZyLp13SdZKo4uWsl4sNLKoQXXwbSzO3 J9TN0pQ0OW54+wwrKFWgZEdjchU98Ur9+TcAKGgZo5KrY3Gv+/a6FvpMAijNhN+G74nT KRxdPUUI+S4bxmXeQT+noihX3I7bmp2lgiFqKg/uJhHJbdeM4CS58WRgAHet5Diiwd98 jmww== 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=+GJEljjqOqmkkTUKBiUPtdfTtsO3+bMErbN9S/U496k=; b=Q4UL2DmvEzHQM6PJaxtXhc8EuI1M9xSgRB0ILF4dS91pTfspv/4hQlG0r2rgRfQImR 2Qz/sNepIzejiAiotWHjEoXaB2vCpw0LOx7/3Ue1yKapDD21gAipf2FuPApe8yWHev0V 7E8nhMrcn25gDGECWX9Z7s41xFw5RAl3/MQ3DpX/MfRz2TjaAxqPxldwlqbX++xENczf c25Xn/T97VBQ35oQQuXL+WitZ1vbBL6AWfhCWGxlzdHu7cIWhNe9S8B5wCkxMNlfY2dw Ucqcl+XVoxRPbu3FHmqLRS3qvUUm039mcJqKXFQxDpgvLBPX5pUNCikHgkkX1eHyoPgq sIpg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TZFPq4O8; 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=+GJEljjqOqmkkTUKBiUPtdfTtsO3+bMErbN9S/U496k=; b=DTQ7qdFoHhri/1lxMtMwdEcNrwP45/LpZDWyKj6qoXpDr5qCKO8j9UDLuw8DCe7tR+ 2IzHIkay+nyvrxZpCWxSn68gRtewxj3aEdJq5ZwZxSZwiPUcexdHv+MTqdOFa1ZAqeHK cuTulIWfB1HJKy/PuuotIroC4Iu+WS/Y5Ggss= 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=+GJEljjqOqmkkTUKBiUPtdfTtsO3+bMErbN9S/U496k=; b=72ypTa1YEJzl+Q2YRBb/G2sRXHIXEJKvbQ5zHv52oPWzp7ZFw0bE7zZ/EdA8D0Ak4i +ei5PCDXVCCq1d9Jd01wZG0m8uQKiYXXSQDiHXT6NXGGN2j2o4PeaU1aYSSEybUwzoFF plKnGocymtgnZVe/10kMv2jAlhOZTA1Fvsx8gTen2nRUfhQ13/j9DmixIU2W7Sx8a8K3 lGKjTztUiwMLAk3aSm1bk6Izln2NqrKKwXVKElxvGfBu/c8/7revanhkY95WtxaEJaCJ 2pTPEiInQPuTnWKKsjlTeel6tu2FYd07hL0Hy7usf49swJeYwnh44lCAVahbOEfSxpub 8QCw== X-Gm-Message-State: AFqh2kqXVD8mG806AO53hNz42ykNx0TzB/rkJzWU1SzWja3aF4/z/UW1 iNuvVxVYWhTRI4OvTJJMCrk7dh3F X-Google-Smtp-Source: AMrXdXv/NxvqJ4gKCHCNwdEPh3R4YIdP95SQPgQr66ZKZTZTB6nFLgNANtWisPPQ/zRa6sq47GpgMg== X-Received: by 2002:a05:6a00:1ad4:b0:586:ed25:a54b with SMTP id f20-20020a056a001ad400b00586ed25a54bmr4153467pfv.6.1674744454782; Thu, 26 Jan 2023 06:47:34 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:db0d:b0:196:2e27:844e with SMTP id m13-20020a170902db0d00b001962e27844els2347262plx.7.-pod-prod-gmail; Thu, 26 Jan 2023 06:47:34 -0800 (PST) X-Received: by 2002:a17:902:b592:b0:194:8eab:8d8d with SMTP id a18-20020a170902b59200b001948eab8d8dmr33867723pls.26.1674744453536; Thu, 26 Jan 2023 06:47:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744453; cv=none; d=google.com; s=arc-20160816; b=j76T1GaJO9FWSjQegWo/2vQZMhrHi3n5o5YCG/Gy7bxAaHVXW3QFNy+qraCEXtT/t+ 9furl/FSgeSIV60qtY24wo6sVWdnFdva1vhaTLkYpqKg9uSNGnVTtMRZtouHo8ox+aIc JoimW9DGdyKkNCaLpxB2CIQxqbzmn8lUIHDRuGs4qOTe1K0BmlvwZ2KfcTJ/lV2WYXiK Oa782ym3eb2VRXzpbHgYa8fs7+bagO/w/MXfI6ltkV/eAH/hv4MF199CpTcUHwEi/1Eq EPlDvGhS/0KA+2upQZxwnVeKnkZSjkXD0noLQRwGLL7HZ0jP4S56RzvCBtMUSTvLohe7 ricw== 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=cfyxDN1Tr8RKZcnYCe3DxARR0/2yUQR0+FZXP6JkyN0=; b=a6BpclyhQqraiy8ll1il2eUA5CpqjBSznq02DzyWHFqSPSLA1O6vrdGhfEaZUxJCqK i4yALfQWJfv5i8OvoCf/2qmavIgLXNMqifuZc33QF4Kg5Lksb5Lh3Xk6kfD3q7TDB1ME Bf+60Mu4eCDtD45rbSYbfIHMFeRL2wD2sOtRv+eh76qQOYTdTEnGDtM5G6ViXmxAPSlS ZL02O60Q0zzK5Gv31ZJId0PzREo+fTKfWnD4leRt0K05gibPUR/ivwB4Hq5nkKGsh04a LPkBkimBKz7NMQIMNwfUpq+rv781pbJHmZWE82yhnpC5dE6HjXeHIx3JG8aO8N6mOp+F 5K5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TZFPq4O8; 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 l5-20020a170903244500b0019607072b23sor709874pls.109.2023.01.26.06.47.33 for (Google Transport Security); Thu, 26 Jan 2023 06:47: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:b691:b0:194:9288:dc19 with SMTP id c17-20020a170902b69100b001949288dc19mr36635281pls.68.1674744452378; Thu, 26 Jan 2023 06:47:32 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:47:31 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 14/18] drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge Date: Thu, 26 Jan 2023 20:14:23 +0530 Message-Id: <20230126144427.607098-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=TZFPq4O8; 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 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 | 1855 +++++++++++++++++++++ drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2008 +---------------------- include/drm/bridge/samsung-dsim.h | 114 ++ 7 files changed, 2038 insertions(+), 1962 deletions(-) create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c create mode 100644 include/drm/bridge/samsung-dsim.h diff --git a/MAINTAINERS b/MAINTAINERS index 2758e7a64fa5..8bddb2a6c925 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6738,6 +6738,15 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/panel/samsung,lms397kf04.yaml F: drivers/gpu/drm/panel/panel-samsung-db7430.c +DRM DRIVER FOR SAMSUNG MIPI DSIM BRIDGE +M: 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 8b2226f72b24..e9d00bcf2d5c 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -220,6 +220,18 @@ config DRM_PARADE_PS8640 The PS8640 is a high-performance and low-power MIPI DSI to eDP converter +config DRM_SAMSUNG_DSIM + tristate "Samsung MIPI DSIM bridge driver" + depends on COMMON_CLK + depends on OF && HAS_IOMEM + select DRM_KMS_HELPER + select DRM_MIPI_DSI + select DRM_PANEL_BRIDGE + help + The Samsung MIPI DSIM bridge controller driver. + This MIPI DSIM bridge can be found it on Exynos SoCs and + NXP's i.MX8M Mini/Nano. + config DRM_SIL_SII8620 tristate "Silicon Image SII8620 HDMI/MHL bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 52f6e8b4a821..2b892b7ed59e 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o +obj-$(CONFIG_DRM_SAMSUNG_DSIM) += samsung-dsim.o obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o obj-$(CONFIG_DRM_SII902X) += sii902x.o obj-$(CONFIG_DRM_SII9234) += sii9234.o diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c new file mode 100644 index 000000000000..c90314c4d205 --- /dev/null +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -0,0 +1,1855 @@ +// 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