From patchwork Fri Mar 15 13:08:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 170 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 B33F93F033 for ; Fri, 15 Mar 2019 14:08:43 +0100 (CET) Received: by mail-pf1-f197.google.com with SMTP id v19sf8964799pfe.15 for ; Fri, 15 Mar 2019 06:08:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1552655322; cv=pass; d=google.com; s=arc-20160816; b=nb1x9y6mv9PkQlnI3wUJIBro36RkfVvMkj2pQURsjFZWRq5SRoHG0019lp95vsHT5w F2V4/BX8OxeZWVxbZIp1ygnUzaIF0SWBzFKKRLP1+uzoubT5YcdPQY8bHuA5MRhdFQv0 X0sj+PPInsjZynWtVE+qsuocVN8n7lvRxTlUiBHKATH3pmLFxOKAiE1DRjLc4wz5cZkZ xboPAwg+CCn0bGKZDNZob0+3VW+9AZ3/N7mPm0ZSIj9W0c8xuSkx40ZJgqmMu6uLeUS+ AxM3WXmJ0eODrAB/emtjWq2TEIr7etvbco7v/Fo4nLySFgEH1AM9fkUKpDegih71xHwX hCXA== 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=VGiaU4qU51dWfbFLGJG+U4Q1vEoNswizfj0e6DKk9G0=; b=afSJNbBFymeuulb7xKm8P6SP/w1zjpgzIO6g67y09YAZx09/Oy4mfgHA53Abg+YjkU jgmrniuLVGvXzpcQl4fkBsk5ZT0kneGD5YsrR0uUMjnLsgVNmB1pWtZuPvwr9VfaWB8p Ri+eLX1JDVrgadFimRE9aOCGJQVe8B9Tk7V6uyFJPeiPpsPf0Am6Yvw5GcewL2cU7QOx RhurfP7mPP74sqpU6GRV8qX9XWZKMEjSNi3AUz2IIMKkHBZTJV75tEWV/mB2Co435d5M eowG4gduq+1j/srT8PvDcKrBOptyq54gKw8QWcP55XJ/s3grA2lp5J13i4nORcBgwr03 qf7A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EEr7kbm4; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=VGiaU4qU51dWfbFLGJG+U4Q1vEoNswizfj0e6DKk9G0=; b=gD7vqscD9OkEUb3KsEgyKqAqcfJtsiiO5ekH1uWVGDkJxiehkoetAis3/SnkqDLodU cSQJ2m8mqtGrLwk7iyNE13UmyvRPaaawbDSGztsGGSRrocrfPuNIAMXFvZJhm9bMQ7hw 0C/JNZZiJPgaGi3JrjanCvdjrrto3RAhO3RNA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=VGiaU4qU51dWfbFLGJG+U4Q1vEoNswizfj0e6DKk9G0=; b=SfZeb0w828Vc4vxixR0RpDr39PM17e/7mp0uTu4+EJzPE5pKEnIC2+hpo/vUypgpGB usGlHzbkTtQf7Kmwwnl9DbtTAHMalydDvf/fHTj84kla2TJeYdvTUBYkaaSIH2VEfAcc 1VHN5lL5Jc/SdL3m7gVvuoIUJUE0jSWjXYi/Cp2VEnMsCrcmKHP3KmGijV62LgLFv5l5 UTFPbR30NtdrpNOm9KuXqDv5k3kMGcP3l9iEnS347zg32tJaXrsr7l6dzJfUBuQLs4Ap jF1xD9VZt9GPKQp2tHyZvP2cUOpMC7WAbVPZKIRUZWuzHLVtLZCcVPRf3ihK93TKFnD9 uy6g== X-Gm-Message-State: APjAAAV7Lau6s+XJWjmemnpdZeT+p0/SOcIuezFuO/6kCojeCpjoHmT6 MmkjnwPoootoy7Kz2L91xC2S+4eF X-Google-Smtp-Source: APXvYqwXIqeUm6oMFNBHf3xxYMQkag/eaGosKqGcIrNk6r8gxSY5aDtUcvctsEEHi/mAQjfDot13Ew== X-Received: by 2002:aa7:924f:: with SMTP id 15mr1381702pfp.44.1552655322568; Fri, 15 Mar 2019 06:08:42 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:430a:: with SMTP id j10ls3566803pgq.0.gmail; Fri, 15 Mar 2019 06:08:42 -0700 (PDT) X-Received: by 2002:a63:f113:: with SMTP id f19mr3293997pgi.141.1552655322178; Fri, 15 Mar 2019 06:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552655322; cv=none; d=google.com; s=arc-20160816; b=H6DsGMCJxsLr6AdPilJtn56gVmsVnqFBB8Dzfyzt2iXO1DvyXSd1sP4UKTvo7PSNLO ukPyArDFb5DoYja/WBtr5hcRYLUN44ZOVsdTU4qoQQ0j4sSnNY9goZAEpxgsc6Xn6hE+ 0xz1pLM4FJIy+4NfYJ5zyEXUT8hePrNWBkZB2NvzSKzv0NagdmEY5EHFHZK/9I8mF4j1 dlsv8mhP4tUfU3R6mGYOX0JH/3PfwFoFoIGMMPoGWKBjLoCwuRIvTvxKy+Wrhhb318wg 167WK9JDhElTlvOpP5vr8OhM1xQB+dcYFK7ge8ADIz3B7zqlim37g2LI0Mch1nV4Mshk hDbw== 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=NP9T09HEiV9lz6LnHjqB2XMYT7hhusLm/ZYVSxXup6g=; b=TCndRg6jWyHannZ1uIt2pJebTpzAxdRkeRa9psU+d5IuR390jCHU2Yyibu8i6cQ+Uu HAASbERT3YLyncJW3erabG/89kVe+kL6pmxtCkraQBhSUHr9thtPJFWYSt/h+8Mg+gjL xrvO6NDcJKZk7hWePRTRFHEt1139y07LfwcvpYtCGBvme0jFMBWo7KCTndcqr4sIwBcw 0+5ZN/26MJV5DCyFf2+alpQjMhTpKD3ejk3Wxw2xxsLTx+kgdoIjPju69eF2naArLi+T nV/PBAYHOymf7DZYFH0D3Wn3pTlSxG/GY5qZJn418qPLZy6A7AAE0rhjV64YBLpnTm9P F9Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EEr7kbm4; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g7sor3210349pfi.48.2019.03.15.06.08.42 for (Google Transport Security); Fri, 15 Mar 2019 06:08:42 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:aa7:85cc:: with SMTP id z12mr4016902pfn.196.1552655321804; Fri, 15 Mar 2019 06:08:41 -0700 (PDT) Received: from localhost.localdomain ([183.82.230.185]) by smtp.gmail.com with ESMTPSA id e2sm854008pfa.64.2019.03.15.06.08.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 06:08:41 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Laurent Pinchart , Chen-Yu Tsai , Maxime Ripard , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland Cc: Michael Trimarchi , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 1/6] drm/bridge: Export drm_bridge_detach Date: Fri, 15 Mar 2019 18:38:20 +0530 Message-Id: <20190315130825.9005-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190315130825.9005-1-jagan@amarulasolutions.com> References: <20190315130825.9005-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=EEr7kbm4; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@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: , Export drm_bridge_detach from drm bridge core so-that it can use on respective interface or bridge driver while detaching the bridge. Signed-off-by: Jagan Teki --- drivers/gpu/drm/drm_bridge.c | 1 + include/drm/drm_bridge.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 138b2711d389..569d4f345429 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -159,6 +159,7 @@ void drm_bridge_detach(struct drm_bridge *bridge) bridge->dev = NULL; } +EXPORT_SYMBOL(drm_bridge_detach); /** * DOC: bridge callbacks diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 9da8c93f7976..4955e3e50fa4 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -301,6 +301,7 @@ void drm_bridge_remove(struct drm_bridge *bridge); struct drm_bridge *of_drm_find_bridge(struct device_node *np); int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, struct drm_bridge *previous); +void drm_bridge_detach(struct drm_bridge *bridge); bool drm_bridge_mode_fixup(struct drm_bridge *bridge, const struct drm_display_mode *mode, From patchwork Fri Mar 15 13:08:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 171 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 5A57E3F033 for ; Fri, 15 Mar 2019 14:08:49 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id n24sf10011081pgm.17 for ; Fri, 15 Mar 2019 06:08:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1552655328; cv=pass; d=google.com; s=arc-20160816; b=pcEK79CVH/LX8WfjZsJeRf/5yji00AmXJh/oky2uWnGw5mjPY89fst7LD4pV/7LrU6 P7efEiYAu3SbqxDIQDnsXODm3H2NfugzGjRnTx2WPaA1IMBSIIywtEAYc5EDg4QicUQZ VQ/vYoVetAUS5CjRTPV7Mlof2vJyGoiFxZ6MJVMfO8gcR911YUrEU1LRSKXKfwCVL0Es +LKFlEo8a9eQdgswhLpCKoL+p84ExpjGHSsqiIMF7/dwW9XA8/lwwT7i4y7ILZg9NSq4 OX9rem77eR1rhKYexOcaPzNOE68c4fGTthKuZT3zvn1UacFpy+NnCZNew9avTqrAeAAn tqEQ== 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=AzdJQnNQZUI6l6VE0raypQ4ALROt0cO914ienSY9Jb0=; b=uCkQ1ecEm5y5ut6avpPmk2NG+3Q1CqsSJC8itnDlSEZaVJRjCP9fcMjCJyO7mQAM10 Lzshte6x+Sq/agWQ4PFj+xhnczmlDyAH5kizw5+CdFJAlmQxw+v+0NGrvteNeZbGJbeK qAhpIf9n4I5opnGYz2yeQdiZpeu7dDil1v0PI3mqP3nhdPQl5w1YOmOBxxC9iWgDCzFn +8qWByQUAv7OM9+NSNm1lfq2rsUckwv98R1PKEHjvMKCbUiCto3Jj/xENdQn1bJhTB2l 7/xGmUpii5oqCcDQTwZW5zVjn5Bds5pLvEKqQAxHZ3vDdkv4hODMR8MTQf89742RWboi kSUg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pO8ssjEa; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=AzdJQnNQZUI6l6VE0raypQ4ALROt0cO914ienSY9Jb0=; b=O+5jEXu94rL5PMXp+bQzEJvYdxMemaEjdU2CHsBsTxdTh0RGW+wOYxtc4ngjJjD0E6 cZLVFADSJsFVfzPvUN3fiFe3SUMuX8Avbr/o3foDfy1KpUVGJvMXRu/cBagUK15q9T+h Odfe6HYxDLkdWCF2a7k1cX6RnRMkibVIdFKdY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=AzdJQnNQZUI6l6VE0raypQ4ALROt0cO914ienSY9Jb0=; b=t5qpQVqfYGUo1oJ65qSymRe0KILLbpa+ylzZbo+hRwoe/R13dCkcRyfn54KowGD9qg Pxx8q2C2uvAoQeYkuX0hQz1Q+pOo3KJIkHEdEMZk4TA7scsE0N+l4WHjlfv2iMXImzq3 M5oGMSUmlb2iuWoEYr1Unt5Z8YsqKUdQFMt6v1O44GJQRXdmN6yhFo2h5JpLhYb5sUdr uFd1AT8B09wCmXGBt2Ql4bzvB9H04w6fowZuINWu93OAaCtahstwiDxTxBHOJsHuyTzF T9rEw84GVtesOQFrm8nFbtuh8HMwmdLpJbdZRtC5wk4YKC8e+TUnfsBMhx7ZAW/hOo0R HB7Q== X-Gm-Message-State: APjAAAW8vMu5JeL4v6rRxUYtAUT3IKJAHuWloIvFe70RPRoXfDsH9iVD Up2rTq6MmVj2G3ccPGX12RZQNmOW X-Google-Smtp-Source: APXvYqxZMmTl6QGzOPdAC7XtT7EA25Hx7wSb0DzS4a3iEqkhyQDRI6PD2k/GdBIbGNqubL93+v+D7Q== X-Received: by 2002:a62:5545:: with SMTP id j66mr1370925pfb.96.1552655328123; Fri, 15 Mar 2019 06:08:48 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:93:: with SMTP id 141ls3558985pga.1.gmail; Fri, 15 Mar 2019 06:08:47 -0700 (PDT) X-Received: by 2002:a65:6498:: with SMTP id e24mr3362563pgv.346.1552655327757; Fri, 15 Mar 2019 06:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552655327; cv=none; d=google.com; s=arc-20160816; b=ZXqO7jGzgZ2YcJdXGWE1cweTl5Mb93EzkRO8Ox1JG4muYAr7SPioeyqE1RgH9W/qGJ hTJFhWc76C06goK2RJ4KVK+5bFUBJD/E1rgHh32Cja1Sm6wByyxXQvu3WNpKuENRCMLe wauj311p9TSWGkMUVtG1HY4dBKaxaXI819bjiyvKM4T0Ovg01m2P0FTYq3f5FDKrrUXQ 6eawT7Sfeto7k+Hwk+DvRfDs+a+l+hrlG2BMzkZ3cUkF3RIQ8z7o1TQiJwyfSZliZd9U it/xzP3fT89t6qkQGR1XNtEaSI/aJqfVhSL097/Mgvl57AtGpi8SJMV73wUPK4zlbPEB AHdA== 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=iy5X5nQ4JgXGLF8UMM2hZ+8DxyqREPSMFw8EUbSF9/Y=; b=FCKICxnYgCKe66XOAySTohvYKy/extTqKqK0Fm273f3BwThu9cvn9Vu8s/g33/FGtc 4eZ4wCpgcG1jYadhERrsy/EO592Y3wH8rncQ7BD4A920SB9PSM8J5w8DAXBn60Y1l1zN NnnHncpXSjbOe57pXw/PBi1InUl+EyVEwCfs0QqDa0RXC9l8hc45ymFbUUi32EOcxtsS qQk6ZoNV1kPhEb9UZ5QlwlCLa0buyv0Md0nrD9zZ5+Rbu1aWb1TlELncdna4FaefuUr9 KJd5nGZHrOX2gzBtydJAD7Azk1NlTzzB4dDzmKUIYfe1tggke0n4bUVEMFv3LAfBfyZ3 NZBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pO8ssjEa; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g135sor3221101pfb.0.2019.03.15.06.08.47 for (Google Transport Security); Fri, 15 Mar 2019 06:08:47 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a62:48c1:: with SMTP id q62mr3983492pfi.113.1552655327466; Fri, 15 Mar 2019 06:08:47 -0700 (PDT) Received: from localhost.localdomain ([183.82.230.185]) by smtp.gmail.com with ESMTPSA id e2sm854008pfa.64.2019.03.15.06.08.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 06:08:46 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Laurent Pinchart , Chen-Yu Tsai , Maxime Ripard , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland Cc: Michael Trimarchi , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com, Jagan Teki , Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park Subject: [PATCH 2/6] drm/exynos: dsi: Use drm_bridge_detach Date: Fri, 15 Mar 2019 18:38:21 +0530 Message-Id: <20190315130825.9005-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190315130825.9005-1-jagan@amarulasolutions.com> References: <20190315130825.9005-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=pO8ssjEa; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , drm_bridge_detach now available to use while detaching bridge, use this core wrapper instead of explicitly pointing the bridge funcs. Cc: Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Signed-off-by: Jagan Teki Acked-by: Inki Dae --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index a4253dd55f86..5daf43d02768 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1583,8 +1583,7 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, dsi->connector.status = connector_status_disconnected; mutex_unlock(&drm->mode_config.mutex); } else { - if (dsi->out_bridge->funcs->detach) - dsi->out_bridge->funcs->detach(dsi->out_bridge); + drm_bridge_detach(dsi->out_bridge); dsi->out_bridge = NULL; } From patchwork Fri Mar 15 13:08:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 172 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 33E4F3F033 for ; Fri, 15 Mar 2019 14:08:54 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id d10sf9997493pgv.23 for ; Fri, 15 Mar 2019 06:08:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1552655333; cv=pass; d=google.com; s=arc-20160816; b=nUqMP7o2u/UBzBxG77R13/rRZExtDOd28A8PAacn2Sg4jIgAkC1u0K5lewJVPcXHx5 9O7tlP6W1IzMRRCqJyxL3IIssHfpZJttbs4/nTDdA9XDSzbMF5DUxRBuEgekvxsVjXXx Ga1+IEum1ci0Np21LdHWaM+n5w4HF/syPtKtFbWVi6q4KKzGP30qYE3O0mHOra7KLylu h+26K6/MOeksvEuiN4sbS+WjqVVbYQBJ/Rk+I5wdYCyHDYMTISZpK3wbdMBAdAMIi4lm Zz9c0RaB6FGK1h671RXqeyOz6cvnq4HRg+haQ0ZId3KSyKBwn/GSJ3MyF3XdEtr0GOVw CQGw== 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=tktU5X2KDjaAYhxvMDk5IJQFPqBaNK35AVRXzFfU9Qo=; b=EGldVFHUOCYBYptIBkG+4njOgxg1r0wzaTQ2Z9YHDfZs8yayYJl8jBwJTqw9qFFJdu 7W9r8Zl+r1M8xYMWKwJ5hzlw+KYatfU6f/AZGHMlaoksXDeXTSOwlMTizeOMD+cHS0gp AxblLQ6yjVZlvP0watczLGTebuzw71Vi+sPvHHhermCTX4aOFIHh3tLKJd1NG1lmwqyo j/dPxc+wZiUSQNOxVx0jzlDgXaJ9wa0FJfLyO+DSQtz46QsZwaHkA2p/hfuxJQWrvguo OJm6lZ8DbNP9LM4eDN+yY0jGjPtyezoXZt89BemcJtw+Q2DKpg5K7XULj0+QU7UCjqwx QmGw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=B2hki3AV; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=tktU5X2KDjaAYhxvMDk5IJQFPqBaNK35AVRXzFfU9Qo=; b=qCBeiaBTbMlghav4Th7YCjXbuYw10sEgL95wiEgNyvbvOddfzKVCOlhp0UcWEzWgoE wESb5Sr1SyhjB9c1lr/yPkexucZGBT0rGrbiugrMCPhmMr3ILZGRaPGtuHrWphGf8qmR HdCE/Bju6+RPWeFBODj2IEf1GXqiuyrQ9dW2E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=tktU5X2KDjaAYhxvMDk5IJQFPqBaNK35AVRXzFfU9Qo=; b=qSOKWMUkKCNg5OHZmpKShCefzaUoqvVaBaUWUa6QZlekjhMKMUiRkswPEJ8wYgcIWK AZae1ZXVkX1z0a6NSgbbIjiQZVjOt7az6G1/k6xWR7arlJzoaiZBa6LUEzQ9bD5972dr lUXvk1lJWzUPrTFph+LafgtYgNj4RkPtSX7wvShMHxyGuVU40pgPn2MrSRXacn8VZHOf qNO96dtETchI8T+BQlIE+JnT6yk0nqX9d0lxFeypHEoMp/1zhiV53dzvrZ4nm2hrntl0 mpz5rMOMPVhL6g8bHaz2z17ZoT6Rp17aSXiafvqNjV0VLT3dckjeD421Q5U/VOCwxtzs +Big== X-Gm-Message-State: APjAAAWTKHPIx70cpHFhN/HBZo+yfslzHVq3rxQcvKgS2P3eoJqTMQbh SLK1HTzdxdZZ/vps8WyuHa8juUJ+ X-Google-Smtp-Source: APXvYqxlaPRCaSOS7m26CvyikpN/3rRO2ckXyAxFGF7tdViyQhEmJeVoWTK1HGb+v0PVdtVRMrxtNw== X-Received: by 2002:a17:902:b60a:: with SMTP id b10mr1131656pls.147.1552655333012; Fri, 15 Mar 2019 06:08:53 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:6257:: with SMTP id q23ls3551741pgv.6.gmail; Fri, 15 Mar 2019 06:08:52 -0700 (PDT) X-Received: by 2002:a62:489d:: with SMTP id q29mr3927963pfi.119.1552655332517; Fri, 15 Mar 2019 06:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552655332; cv=none; d=google.com; s=arc-20160816; b=LoRUwN/dp5zzODLm3jefjm3vNWbtt0XtxaHg/0xcESpL7lUd0g7XOElslH6BNpy2RN qHZjNodS54D8JdO61C+mLAV5yoH5no4T+7t2E1gRV3Z2BZLRAx9uUsV2udPRoxDpnyXF ljAXKRpsQdafhgskePwJvoaePbgTIq+v066m7mATIGrCoZu57ploxeAtQg6yoo6U22HG NhG6LxFwFvVtrqO/h58c6tIFeL5+4pidZVTN4wQFO6ym/Xe6G8ZtoRwbZswlUzzUSJeH ALyFPENUXRtFhu4QvtuJ8WE6ImAgiMHvt9MJ6i1tbkrzJOo4deTazcMEXecQBxkS/T0w KtHQ== 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=MUOsJO/ekVDHiTmtCVq8d27ElQS89ZxoIWk8a+ZsNC8=; b=JtwHAGCQ7RTiCcsErvYF2ssXom4QTpEYzfvE+c1PfinRWIaekvgQc0eGVagt3wSppc D1KXlM9ZW0kdAlbT4R497HZq/J6es1qIyXWXM885W9DoZ5qsDbbRzmn89/qecCyQZ64g IvulI5NSLj01NO2jnJrSZBRX5q0nvYkAXBrMuD2LDmgu+EjRB2AeX8iSqRYvX7GsxC4e V3F97+g2S8sVsF5cO4Qi0MWpQVXXGz3OvmY+RiIJ9+0PG2I1gFO1rx2EUtI9PtA70RYG pfdqkdPP17H0QQ2yJe1iZf9UkxXkgARB64O6JbnMKsJlLG1rihSMp2ez2IZvPlFEPJW/ U4Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=B2hki3AV; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g14sor2918771pgn.40.2019.03.15.06.08.52 for (Google Transport Security); Fri, 15 Mar 2019 06:08:52 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:5321:: with SMTP id h33mr3378181pgb.168.1552655332222; Fri, 15 Mar 2019 06:08:52 -0700 (PDT) Received: from localhost.localdomain ([183.82.230.185]) by smtp.gmail.com with ESMTPSA id e2sm854008pfa.64.2019.03.15.06.08.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 06:08:51 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Laurent Pinchart , Chen-Yu Tsai , Maxime Ripard , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland Cc: Michael Trimarchi , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 3/6] drm/sun4i: dsi: Add bridge support Date: Fri, 15 Mar 2019 18:38:22 +0530 Message-Id: <20190315130825.9005-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190315130825.9005-1-jagan@amarulasolutions.com> References: <20190315130825.9005-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=B2hki3AV; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@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: , Some display panels would come up with a non-DSI output which can have an option to connect DSI interface by means of bridge convertor. This DSI to non-DSI bridge convertor would require a bridge driver that would communicate the DSI controller for bridge functionalities. So, add support for bridge functionalities in Allwinner DSI controller. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 65 +++++++++++++++++++------- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 1 + 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 0960b96b62cc..64d74313b842 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -781,6 +781,9 @@ static void sun6i_dsi_encoder_enable(struct drm_encoder *encoder) if (!IS_ERR(dsi->panel)) drm_panel_prepare(dsi->panel); + if (!IS_ERR(dsi->bridge)) + drm_bridge_pre_enable(dsi->bridge); + /* * FIXME: This should be moved after the switch to HS mode. * @@ -796,6 +799,9 @@ static void sun6i_dsi_encoder_enable(struct drm_encoder *encoder) if (!IS_ERR(dsi->panel)) drm_panel_enable(dsi->panel); + if (!IS_ERR(dsi->bridge)) + drm_bridge_enable(dsi->bridge); + sun6i_dsi_start(dsi, DSI_START_HSC); udelay(1000); @@ -812,6 +818,9 @@ static void sun6i_dsi_encoder_disable(struct drm_encoder *encoder) if (!IS_ERR(dsi->panel)) { drm_panel_disable(dsi->panel); drm_panel_unprepare(dsi->panel); + } else if (!IS_ERR(dsi->bridge)) { + drm_bridge_disable(dsi->bridge); + drm_bridge_post_disable(dsi->bridge); } phy_power_off(dsi->dphy); @@ -973,11 +982,16 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); dsi->device = device; - dsi->panel = of_drm_find_panel(device->dev.of_node); - if (IS_ERR(dsi->panel)) - return PTR_ERR(dsi->panel); - dev_info(host->dev, "Attached device %s\n", device->name); + dsi->bridge = of_drm_find_bridge(device->dev.of_node); + if (!dsi->bridge) { + dsi->panel = of_drm_find_panel(device->dev.of_node); + if (IS_ERR(dsi->panel)) + return PTR_ERR(dsi->panel); + } + + dev_info(host->dev, "Attached %s %s\n", + dsi->bridge ? "bridge" : "panel", device->name); return 0; } @@ -1055,8 +1069,10 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, struct sun4i_tcon *tcon0 = sun4i_get_tcon0(drm); int ret; - if (!dsi->panel) + if (!(dsi->panel || dsi->bridge)) { + dev_info(drm->dev, "No panel or bridge found... DSI output disabled\n"); return -EPROBE_DEFER; + } dsi->drv = drv; @@ -1078,19 +1094,29 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, } dsi->encoder.possible_crtcs = BIT(0); - drm_connector_helper_add(&dsi->connector, - &sun6i_dsi_connector_helper_funcs); - ret = drm_connector_init(drm, &dsi->connector, - &sun6i_dsi_connector_funcs, - DRM_MODE_CONNECTOR_DSI); - if (ret) { - dev_err(dsi->dev, - "Couldn't initialise the DSI connector\n"); - goto err_cleanup_connector; + if (dsi->panel) { + drm_connector_helper_add(&dsi->connector, + &sun6i_dsi_connector_helper_funcs); + ret = drm_connector_init(drm, &dsi->connector, + &sun6i_dsi_connector_funcs, + DRM_MODE_CONNECTOR_DSI); + if (ret) { + dev_err(dsi->dev, + "Couldn't initialise the DSI connector\n"); + goto err_cleanup_connector; + } + + drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); + drm_panel_attach(dsi->panel, &dsi->connector); } - drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); - drm_panel_attach(dsi->panel, &dsi->connector); + if (dsi->bridge) { + ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL); + if (ret) { + dev_err(dsi->dev, "Couldn't attach the DSI bridge\n"); + goto err_cleanup_connector; + } + } return 0; @@ -1104,7 +1130,12 @@ static void sun6i_dsi_unbind(struct device *dev, struct device *master, { struct sun6i_dsi *dsi = dev_get_drvdata(dev); - drm_panel_detach(dsi->panel); + if (dsi->panel) + drm_panel_detach(dsi->panel); + + if (dsi->bridge) + drm_bridge_detach(dsi->bridge); + } static const struct component_ops sun6i_dsi_ops = { diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index 5c4983212f89..76874ff8e3ef 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -36,6 +36,7 @@ struct sun6i_dsi { struct sun4i_tcon *tcon; struct mipi_dsi_device *device; struct drm_panel *panel; + struct drm_bridge *bridge; const struct sun6i_dsi_variant *variant; }; From patchwork Fri Mar 15 13:08:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 173 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 D41693F033 for ; Fri, 15 Mar 2019 14:08:58 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id d10sf9997748pgv.23 for ; Fri, 15 Mar 2019 06:08:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1552655337; cv=pass; d=google.com; s=arc-20160816; b=jAjqL0mCdZ+3dVbwCLgXsUn+b7GWtV0yoAheEjYLaTRtd2xmQd6h59xKi7KPbhRN+F pDcxQzwoi14zZLGRVTwLfYh0j3UA5/jbCdduWpjJGNCxvPX1sfqX4Prj9c8r6/LJ50F3 ujSaKmnpj3BhX0X0W08HwJzgjUanrmbk/81TcwChpIvuF3JweKZOOUyHLhHZxmjDygr4 LC3hoQXbwZpfWZh0axVHIiJZBFFPF6uC1ylDzlVJug4wcOjqwz5LKAGKdF8j/o+lFl3l mzCUxek+l06CEnr0HoGlYM9piuIwYqvAMfpbwANDM/1FAHTQbe5DChq7IhFjVWssDa2w HLRQ== 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=FYIh8v3RvcxNV8P2p1QhQXUXl6q29plTYDizbSVbWzw=; b=jh25QE7e0xmk2eLl9+afZHIv8YFn5vZTrOirnKRIqf2TEObwdtiUXVowCR6ebOWHPF QV/N0Qa3j3VkNcKLqq8ypUW738CFnfR+ygk20uFI9aVpictqoSeEJ8sjd3+zzepjjWZq 8a7tDFsBC2nPTh6bMy0Jlckg0PZ4bX4Yj0RHR3jqkBJv/PCeqld4EFh+EdIvx6C5PhcH 55KKgluMZsH2MMpBfOnhzLAMb3WsZooIWsuOzBCeOs739POlv2oRfLI3vXOlBtD3zwb7 zck69omiFfGBN/p5enEhz3NVAyLiWjQH0tDaz5Z0GWejeuQFbcUVJ24lZLW5T13dDmhc 5CIg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MBPaO0Zl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=FYIh8v3RvcxNV8P2p1QhQXUXl6q29plTYDizbSVbWzw=; b=dN9mqyHkOfwXmsJx4vWwtxinG799hgZny4Nj3+PeKxYIJI6Rdm29SpHOzyjAn1tDGE ZLYxQAzlaqNLRT0yPin6zXztwOrOkXeUXjjvw7DzaRtVKIbdUU44/Bp+Ib7sBGYFlDBz 3B4gdPM3ib95i6VidmHJbiLrURqYyHGMnrGAw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=FYIh8v3RvcxNV8P2p1QhQXUXl6q29plTYDizbSVbWzw=; b=AFDVWmfxYEfUAr3QDvugtXNlW63e3nbBmq/r2pMoZXGnP5sMBIsOixmd0lIuChnEX8 +kqQ0J61x3gQc1X9RlIM3MksZ5nfkDL3G05Z6b5xq3OUckh9g72HGtnEl4g8pMSDau9z QOVcozkoIm7w6XpGbLLWawdobHY5p9TDo/8zEy7I7zz/UmklV4O2fJwXHT4xM2bcdns7 r5KrPqHBOmwq919ofiGVC0wVjHZzQm/r87ToaZfLqkSMZbFwAAC1igPSMvIJUn1RD1tG VvZOYEfrcxmMqy46Uw2IFyTW8/fbBCwr/z4nRXkRyhnPJdJakOkenTyfJkvKau/t3hLn fqQA== X-Gm-Message-State: APjAAAXhhSw9cY2Vgegh0nAwT8sMUMvDhOlUD+0Fx8d9ZFrmqsVI+OZf KBoZILeGte/yzR9QPbk8hUBwc5Dn X-Google-Smtp-Source: APXvYqyeGAv+BIKVSUJ5iHbdZWOJYM1inKi4XyMco/wgMm33vaXdwXnK4n2mP2iYo/c5Bzy2oR0wFw== X-Received: by 2002:a63:c642:: with SMTP id x2mr1186974pgg.34.1552655337640; Fri, 15 Mar 2019 06:08:57 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:68c7:: with SMTP id d190ls3573078pgc.3.gmail; Fri, 15 Mar 2019 06:08:57 -0700 (PDT) X-Received: by 2002:a62:574d:: with SMTP id l74mr4047283pfb.9.1552655337195; Fri, 15 Mar 2019 06:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552655337; cv=none; d=google.com; s=arc-20160816; b=XOzOoLl2pbiELz4mLX1chZzyvRkr1X0O0QmBfh1UTufNT5+mfUmgWmy2ZYr6R1oHHC WAHDDTDw/BGHfeLYMosAnMuclhFNED2Ay+nxKCCtNqhTGC3k8+Rcok3BY/xt+/a6jALD V7Hr8+q2CghkqMpRpHLKMM6vcwX1GV5vheNBORwrFgwHdfSWmd1mNd2EgTA5ACRRh18Q l/zFebHuJNkreCptv/vtyr7ODysQdUFcOIbNg4olntdX/Gv9jaF9jdw5NUuIy7aMbYla SETlpFK8xitAG7+NLm/faxmCSF1xEdm39oEZRgXEGnUhhjV09Dykb0krRQAkbBmdXQMx /OKw== 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=AAGhTSDHAoMycmwWhiYuqV20infnrcRGhVpZHstA2bg=; b=kX4zT5XqXvJJ9g9lCbYL2NReRnvcexa3MMV9gappGdb5z3vcd8mzZQ8UoA0W9NNuZf TmirLTtE8pzMH1F408Ks0DgwdPwRnzFFSdY+SRfkP431sUnEPcYUV1TCgozlYh4IrP8Y klZmPLegL/vnOaPtYYDzRH3I+P1UEfqCUB2O3zDYjxjJlHleWMm4hooZ80jM+zR8QnXh /UurAxakhpEKr0OkVvFKMAPKiP+rYJPuUFtGbuDO+Tt905yiCAyrBLxvlZ++tdyKs8By 452tvf/8Jx/IINr/znuGEQPG8EoOhSHdGCozEm/xf+floAI25nNZOcgFqJFlcxEG4Eqz vxVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MBPaO0Zl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id gn4sor2847291plb.64.2019.03.15.06.08.57 for (Google Transport Security); Fri, 15 Mar 2019 06:08:57 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:234b:: with SMTP id n11mr4218595plg.89.1552655336942; Fri, 15 Mar 2019 06:08:56 -0700 (PDT) Received: from localhost.localdomain ([183.82.230.185]) by smtp.gmail.com with ESMTPSA id e2sm854008pfa.64.2019.03.15.06.08.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 06:08:56 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Laurent Pinchart , Chen-Yu Tsai , Maxime Ripard , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland Cc: Michael Trimarchi , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 4/6] dt-bindings: display: bridge: Add ICN6211 MIPI-DSI to RGB convertor bridge Date: Fri, 15 Mar 2019 18:38:23 +0530 Message-Id: <20190315130825.9005-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190315130825.9005-1-jagan@amarulasolutions.com> References: <20190315130825.9005-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=MBPaO0Zl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@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: , ICN6211 is MIPI-DSI/RGB converter bridge from chipone. It has a flexible configuration of MIPI DSI signal input and produce RGB565, RGB666, RGB888 output format. Add dt-bingings for it. Signed-off-by: Jagan Teki --- .../display/bridge/chipone,icn6211.txt | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/chipone,icn6211.txt diff --git a/Documentation/devicetree/bindings/display/bridge/chipone,icn6211.txt b/Documentation/devicetree/bindings/display/bridge/chipone,icn6211.txt new file mode 100644 index 000000000000..7f13efd7ee7f --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/chipone,icn6211.txt @@ -0,0 +1,36 @@ +Chipone ICN6211 MIPI-DSI to RGB Convertor Bridge + +ICN6211 is MIPI-DSI/RGB converter bridge from chipone. +It has a flexible configuration of MIPI DSI signal input +and produce RGB565, RGB666, RGB888 output format. + +Required properties for RGB: +- compatible: must be "chipone,icn6211" and one of: + * "bananapi,icn6211" +- reg: the virtual channel number of a DSI peripheral +- reset-gpios: a GPIO phandle for the reset pin + +The device node can contain following 'port' child nodes, +according to the OF graph bindings defined in [1]: + 0: DSI Input, not required, if the bridge is DSI controlled + 1: RGB Output, mandatory + +[1]: Documentation/devicetree/bindings/media/video-interfaces.txt + +Example: + + bridge@0 { + compatible = "bananapi,icn6211", "chipone,icn6211"; + reg = <0>; + reset-gpios = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* LCD-RST: PD6 */ + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + + bridge_out_ep: endpoint { + remote-endpoint = <&panel_ep>; + }; + }; + }; From patchwork Fri Mar 15 13:08:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 174 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 BB8753F033 for ; Fri, 15 Mar 2019 14:09:03 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id m17sf10075664pgk.3 for ; Fri, 15 Mar 2019 06:09:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1552655342; cv=pass; d=google.com; s=arc-20160816; b=0nEF0ZlEWwTZ/rbi/wKd7OLLecPEPmk4R5RUHxf0jbfpSUZcGrj4VgOCCu5T1mKNuO wXK7L6Ht4PDgghxM3DrclnquJq6fGQF4EqAs6DrvXygFKH0afOjQ4SZ28GnFJ1A7gLsF M4BLG2HyP5L2dHxkVWT39VP2VIzff+L8ddfmeZ3mGm2qVP1I3hjfurIVAal4tz0Hlwda 8PZqQjDMs3znXS+RBJgWYMLw4Rb+57Ujyavc6FziuCF+KiL/GLxuCv6vs1NtkqxkRE5X HJvVne3B4A5/INOe7Z1ekIA7kF9VQ0bJoKDDk/8KhotsZN5ilZ0waSkxxtaxfuNiFspU o6sQ== 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=DMrmnXaqGTl+jKggjb/wKMGfuSzNVKDeOWRDJm0nMTQ=; b=PmLWWXBVSL7i8hERET7zpnGvIO6lGlyQfkR8upd/g444E5ZwbCLsq6JnqQNMOppf7X msF+beT/TNavYnM3k5dWHsbFnWP1hqEZgwMPu3pK20FLtYPH9al/9ZinOU98+08Xnn3b sV9tMaOAqX+kIKUd7Z3ElfGK6yQpGtqQD6m3qTD6Ms1n+mouadXuffP8/PhFM1dlZsCv bsdgcr1u5bMKFJ+M2ZlJFVhr5t5dZArpxWUIW+AzvwTrnUBUETyqb+ie+zx2mQ+/TbUe t9zPWbjLOQxACynvKf5gGKZ86RC1fxG66aEGQDnEi6+kLlmthSUMSYXnqvvtfFtj+rnr W3yQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dD9jLFn+; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=DMrmnXaqGTl+jKggjb/wKMGfuSzNVKDeOWRDJm0nMTQ=; b=A8G3Ly0MsiYhLpN8OQwR122cLLhND3Nn1qq8jtTTtFMwUV2WLiYdnJZ6/TRXXMIOkx Ap6ph6DqCmREMmiyJRRFVbFkzROEKtzJcjcyKbMR8FEcRmqwnLvi12fsfiFCM5kNyTJZ 0+z4ohl/10KxJRRY1wLJ0FV1IWt6f3n1AJmvg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=DMrmnXaqGTl+jKggjb/wKMGfuSzNVKDeOWRDJm0nMTQ=; b=i9Tc1TSYMzT62IekPDyHmPXyESZ+oJS3IqRa7RrLJtiH5yIxJmFD+bbVMnL9aCjtBw pjYiosgDEnin13hDBvJoiA4poS4aXaW7AUEheuG6hlmFRqDy3wYyO6OT3S0SBM589yDh z+c73844ySdysdxC1vikSZp4+/lMNwKJp2EuGs6A0cmETJzyaGNPy50TCjd/g6TIWxbn N5sKEf22cM8kHSGaGL9Rj0L7nR9lpF+5Auqo3rbWO/VnYq7Gng/FUnhr/wRo3Sla010R 8SJzOWweYDd05ld66oM1rNtNtFu7fYD8M90+abD84NmrgABknXUGlbDnP38c+ZZ5XC2S MSmw== X-Gm-Message-State: APjAAAU9p+OPW7z6k5OgnMAQeaUnfGGIAVUJeqPkRR/D1y6D34wkfk8k VgYP0BxbvKfnfIIJoIiyoOU+bvP/ X-Google-Smtp-Source: APXvYqzdG24vF+e3TXTXexn7cpY+hK2nq/yRSYdxStq/6zSHMuo6+yNZXodUZVAPlI/R/cbRtFPuLA== X-Received: by 2002:aa7:8d4d:: with SMTP id s13mr1344375pfe.92.1552655342524; Fri, 15 Mar 2019 06:09:02 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:cb48:: with SMTP id m8ls3542443pgi.12.gmail; Fri, 15 Mar 2019 06:09:02 -0700 (PDT) X-Received: by 2002:a65:4147:: with SMTP id x7mr3434867pgp.54.1552655342078; Fri, 15 Mar 2019 06:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552655342; cv=none; d=google.com; s=arc-20160816; b=Nbm8esPvbiCHnipX+/5ym0KA6mT6TOiBKmCDd8DU6FwmRqZwykJHxpcgVK4MhFKszM MxoMGv0x63knK6AaOKtMR1GD05K5O8ZZJXIzyNZ65XY/3MAkHl+tud6VwDtXMjIuxQMC etqQ1MuDKG9MIrGD8BXZrIbOm5Wy+FmH2VvaHWhMRb7bBVFXCWT8hfQDswdiwNB+G0r+ sq9irIRoFn34MxYw83PDtQg5nD56pUBdAXbOBn32LJhVZ5aPq02kzJhvilLEJu23bI4o fH+IZ0zFfpa/XfhNHd4E/CAcDZ7pPTb7IM1oyBBmNUMLLAg2JLPL3ARR3FzK/is61XMC tSeA== 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=l7jDKekA1zKlo/xV9xtxEUytM5+wSMRdUwycfkyRP+g=; b=tUU8qTN19rLWiUfuT5e2S/pQb4CobGOhGCLwn0Cu0qcjMj2Va/zQRJit+7yQpdNUYt nHO/+97UMiQBAcujBAQ6HNtw7CPKPr0Lq+u3kpYmmV+yuC07cgngSAZQ8LBsC5Tsz0Q9 MjeH4WacaSMD8J6wDfa5rC1Gd1v+47ZkHGyz+QV0U6xFhunk89TWXkPxlmHrPUMrlaCP t4YCKgF2Bkdxun/vegmKjO3fMqD7x3rpmFISXV3wiYEUISKzjShKQrrnGbRdNrRUcxp9 dr2iTUBSnOd4WwHSbu2ZoKjMtH9ndT7RkHgvOTyg1pxqNXPNDoLyUTs6sr+DJhVpRzqJ C+3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dD9jLFn+; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id d13sor2919369pga.42.2019.03.15.06.09.02 for (Google Transport Security); Fri, 15 Mar 2019 06:09:02 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:e40b:: with SMTP id a11mr3347314pgi.259.1552655341691; Fri, 15 Mar 2019 06:09:01 -0700 (PDT) Received: from localhost.localdomain ([183.82.230.185]) by smtp.gmail.com with ESMTPSA id e2sm854008pfa.64.2019.03.15.06.08.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 06:09:01 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Laurent Pinchart , Chen-Yu Tsai , Maxime Ripard , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland Cc: Michael Trimarchi , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 5/6] drm/bridge: Add Chipone ICN6211 MIPI-DSI/RGB convertor bridge Date: Fri, 15 Mar 2019 18:38:24 +0530 Message-Id: <20190315130825.9005-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190315130825.9005-1-jagan@amarulasolutions.com> References: <20190315130825.9005-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=dD9jLFn+; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@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: , ICN6211 is MIPI-DSI/RGB converter bridge from chipone. It has a flexible configuration of MIPI DSI signal input and produce RGB565, RGB666, RGB888 output format. Add bridge driver for it. Signed-off-by: Jagan Teki --- MAINTAINERS | 6 + drivers/gpu/drm/bridge/Kconfig | 10 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/chipone-icn6211.c | 275 +++++++++++++++++++++++ 4 files changed, 292 insertions(+) create mode 100644 drivers/gpu/drm/bridge/chipone-icn6211.c diff --git a/MAINTAINERS b/MAINTAINERS index 4de80222cffb..e529addd30f5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4897,6 +4897,12 @@ T: git git://anongit.freedesktop.org/drm/drm-misc S: Maintained F: drivers/gpu/drm/bochs/ +DRM DRIVER FOR CHIPONE ICN6211 MIPI-DSI to RGB CONVERTOR BRIDGE +M: Jagan Teki +S: Maintained +F: drivers/gpu/drm/bridge/chipone-icn6211.c +F: Documentation/devicetree/bindings/display/bridge/chipone,icn6211.txt + DRM DRIVER FOR FARADAY TVE200 TV ENCODER M: Linus Walleij T: git git://anongit.freedesktop.org/drm/drm-misc diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 8840f396a7b6..cd314572e4ed 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -36,6 +36,16 @@ config DRM_CDNS_DSI Support Cadence DPI to DSI bridge. This is an internal bridge and is meant to be directly embedded in a SoC. +config DRM_CHIPONE_ICN6211 + tristate "Chipone ICN6211 MIPI-DSI/RGB converter bridge" + depends on DRM && DRM_PANEL + depends on OF + select DRM_MIPI_DSI + help + ICN6211 is MIPI-DSI/RGB converter bridge from chipone. + It has a flexible configuration of MIPI DSI signal input + and produce RGB565, RGB666, RGB888 output format. + config DRM_DUMB_VGA_DAC tristate "Dumb VGA DAC Bridge support" depends on OF diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 4934fcf5a6f8..541fdccad10b 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o obj-$(CONFIG_DRM_CDNS_DSI) += cdns-dsi.o +obj-$(CONFIG_DRM_CHIPONE_ICN6211) += chipone-icn6211.o obj-$(CONFIG_DRM_DUMB_VGA_DAC) += dumb-vga-dac.o obj-$(CONFIG_DRM_LVDS_ENCODER) += lvds-encoder.o obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o diff --git a/drivers/gpu/drm/bridge/chipone-icn6211.c b/drivers/gpu/drm/bridge/chipone-icn6211.c new file mode 100644 index 000000000000..cd2f3505f845 --- /dev/null +++ b/drivers/gpu/drm/bridge/chipone-icn6211.c @@ -0,0 +1,275 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018 Amarula Solutions + * Author: Jagan Teki + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define ICN6211_INIT_CMD_LEN 2 + +struct chipone { + struct device *dev; + struct drm_bridge bridge; + struct drm_connector connector; + struct drm_panel *panel; + + struct gpio_desc *reset; +}; + +static inline struct chipone *bridge_to_chipone(struct drm_bridge *bridge) +{ + return container_of(bridge, struct chipone, bridge); +} + +static inline +struct chipone *connector_to_chipone(struct drm_connector *connector) +{ + return container_of(connector, struct chipone, connector); +} + +struct icn6211_init_cmd { + u8 data[ICN6211_INIT_CMD_LEN]; +}; + +static const struct icn6211_init_cmd icn6211_init_cmds[] = { + { .data = { 0x7A, 0xC1 } }, + { .data = { 0x20, 0x20 } }, + { .data = { 0x21, 0xE0 } }, + { .data = { 0x22, 0x13 } }, + { .data = { 0x23, 0x28 } }, + { .data = { 0x24, 0x30 } }, + { .data = { 0x25, 0x28 } }, + { .data = { 0x26, 0x00 } }, + { .data = { 0x27, 0x0D } }, + { .data = { 0x28, 0x03 } }, + { .data = { 0x29, 0x1D } }, + { .data = { 0x34, 0x80 } }, + { .data = { 0x36, 0x28 } }, + { .data = { 0xB5, 0xA0 } }, + { .data = { 0x5C, 0xFF } }, + { .data = { 0x2A, 0x01 } }, + { .data = { 0x56, 0x92 } }, + { .data = { 0x6B, 0x71 } }, + { .data = { 0x69, 0x2B } }, + { .data = { 0x10, 0x40 } }, + { .data = { 0x11, 0x98 } }, + { .data = { 0xB6, 0x20 } }, + { .data = { 0x51, 0x20 } }, + { .data = { 0x09, 0x10 } }, +}; + +static int chipone_get_modes(struct drm_connector *connector) +{ + struct chipone *icn = connector_to_chipone(connector); + + return drm_panel_get_modes(icn->panel); +} + +static const +struct drm_connector_helper_funcs chipone_connector_helper_funcs = { + .get_modes = chipone_get_modes, +}; + +static const struct drm_connector_funcs chipone_connector_funcs = { + .fill_modes = drm_helper_probe_single_connector_modes, + .destroy = drm_connector_cleanup, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, +}; + +static void chipone_disable(struct drm_bridge *bridge) +{ + struct chipone *icn = bridge_to_chipone(bridge); + int ret = drm_panel_disable(bridge_to_chipone(bridge)->panel); + + if (ret < 0) + DRM_DEV_ERROR(icn->dev, "error disabling panel (%d)\n", ret); +} + +static void chipone_post_disable(struct drm_bridge *bridge) +{ + struct chipone *icn = bridge_to_chipone(bridge); + int ret; + + ret = drm_panel_unprepare(icn->panel); + if (ret < 0) + DRM_DEV_ERROR(icn->dev, "error unpreparing panel (%d)\n", ret); + + msleep(50); + + gpiod_set_value(icn->reset, 0); +} + +static void chipone_pre_enable(struct drm_bridge *bridge) +{ + struct chipone *icn = bridge_to_chipone(bridge); + struct mipi_dsi_device *dsi = to_mipi_dsi_device(icn->dev); + unsigned int i; + int ret; + + gpiod_set_value(icn->reset, 0); + msleep(20); + + gpiod_set_value(icn->reset, 1); + msleep(50); + + for (i = 0; i < ARRAY_SIZE(icn6211_init_cmds); i++) { + const struct icn6211_init_cmd *cmd = &icn6211_init_cmds[i]; + + ret = mipi_dsi_generic_write(dsi, cmd->data, + ICN6211_INIT_CMD_LEN); + if (ret < 0) { + DRM_DEV_ERROR(icn->dev, + "failed to write cmd %d: %d\n", i, ret); + return; + } + } + + ret = drm_panel_prepare(icn->panel); + if (ret < 0) + DRM_DEV_ERROR(icn->dev, "error preparing panel (%d)\n", ret); +} + +static void chipone_enable(struct drm_bridge *bridge) +{ + struct chipone *icn = bridge_to_chipone(bridge); + int ret = drm_panel_enable(icn->panel); + + if (ret < 0) + DRM_DEV_ERROR(icn->dev, "error enabling panel (%d)\n", ret); +} + +static int chipone_attach(struct drm_bridge *bridge) +{ + struct chipone *icn = bridge_to_chipone(bridge); + struct drm_device *drm = bridge->dev; + int ret; + + icn->connector.polled = DRM_CONNECTOR_POLL_HPD; + ret = drm_connector_init(drm, &icn->connector, + &chipone_connector_funcs, + DRM_MODE_CONNECTOR_Unknown); + if (ret) { + DRM_ERROR("Failed to initialize connector\n"); + return ret; + } + + drm_connector_helper_add(&icn->connector, + &chipone_connector_helper_funcs); + drm_connector_attach_encoder(&icn->connector, bridge->encoder); + drm_panel_attach(icn->panel, &icn->connector); + icn->connector.funcs->reset(&icn->connector); + drm_fb_helper_add_one_connector(drm->fb_helper, &icn->connector); + drm_connector_register(&icn->connector); + + return 0; +} + +static void chipone_detach(struct drm_bridge *bridge) +{ + struct chipone *icn = bridge_to_chipone(bridge); + struct drm_device *drm = bridge->dev; + + drm_connector_unregister(&icn->connector); + drm_fb_helper_remove_one_connector(drm->fb_helper, &icn->connector); + drm_panel_detach(icn->panel); + icn->panel = NULL; + drm_connector_put(&icn->connector); +} + +static const struct drm_bridge_funcs chipone_bridge_funcs = { + .disable = chipone_disable, + .post_disable = chipone_post_disable, + .enable = chipone_enable, + .pre_enable = chipone_pre_enable, + .attach = chipone_attach, + .detach = chipone_detach, +}; + +static int chipone_probe(struct mipi_dsi_device *dsi) +{ + struct device *dev = &dsi->dev; + struct chipone *icn; + int ret; + + icn = devm_kzalloc(dev, sizeof(struct chipone), GFP_KERNEL); + if (!icn) + return -ENOMEM; + + mipi_dsi_set_drvdata(dsi, icn); + + icn->dev = dev; + dsi->lanes = 4; + dsi->format = MIPI_DSI_FMT_RGB888; + dsi->mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE; + + icn->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(icn->reset)) { + DRM_DEV_ERROR(dev, "no reset GPIO pin provided\n"); + return PTR_ERR(icn->reset); + } + + ret = drm_of_find_panel_or_bridge(icn->dev->of_node, 1, 0, + &icn->panel, NULL); + if (ret && ret != -EPROBE_DEFER) { + DRM_DEV_ERROR(dev, "failed to find panel (ret = %d)\n", ret); + return ret; + } + + icn->bridge.funcs = &chipone_bridge_funcs; + icn->bridge.of_node = dev->of_node; + + drm_bridge_add(&icn->bridge); + + ret = mipi_dsi_attach(dsi); + if (ret < 0) { + drm_bridge_remove(&icn->bridge); + DRM_DEV_ERROR(dev, "failed to attach dsi (ret = %d)\n", ret); + } + + return ret; +} + +static int chipone_remove(struct mipi_dsi_device *dsi) +{ + struct chipone *icn = mipi_dsi_get_drvdata(dsi); + + mipi_dsi_detach(dsi); + drm_bridge_remove(&icn->bridge); + + return 0; +} + +static const struct of_device_id chipone_of_match[] = { + { .compatible = "bananapi,icn6211" }, + { } +}; +MODULE_DEVICE_TABLE(of, chipone_of_match); + +static struct mipi_dsi_driver chipone_driver = { + .probe = chipone_probe, + .remove = chipone_remove, + .driver = { + .name = "chipone-icn6211", + .owner = THIS_MODULE, + .of_match_table = chipone_of_match, + }, +}; +module_mipi_dsi_driver(chipone_driver); + +MODULE_AUTHOR("Jagan Teki "); +MODULE_DESCRIPTION("Chipone ICN6211 MIPI-DSI to RGB Convertor Bridge"); +MODULE_LICENSE("GPL v2"); From patchwork Fri Mar 15 13:08:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 175 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 417103F033 for ; Fri, 15 Mar 2019 14:09:08 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id w16sf10228841pfn.3 for ; Fri, 15 Mar 2019 06:09:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1552655347; cv=pass; d=google.com; s=arc-20160816; b=OQtvXZ4ztiDzLuSYT3q7T1y353Uv8YwWpRaXoBYESlMVtXXStw4JTjj22bqcI2iANN fg+I1qyijt4LDwFRc1WqbEaywfe8a6xNBXRyk2mTCDuiN9ozlGlJjx4Owz3iTZLTObab PCxx0kb2zZVYMph9NQQYp5l2I5cos7IsLOyUWG+95GDCvJT5itbD8hO+Qr5pa3xQHa2s HArt47zN1M5aMffbZpJUpDZw4J/Hy+mB0eODFLxj9G5sP31qbQlHVhvLhgRAmKLRk1/L KT1U2O/MkMqzF/5PidrFt6+MXkcVhSrzmMD5ovLOnawiQnhNJUA6uTseXKKPejLITQV2 1uYw== 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=jzUOwPF/pnqIdCFQBF01/prJEiQ0q7yR1n39hLZLVXA=; b=IJx4TkN+3MnVLDMZpyp+WUPJOzfHEWse0IWXC2Qf8Euv6qx0ypPFlQ3MkFQcy6IMZR lf0K41dnPTFPdc8fl6g4MNq2O9xWawrcDCn1KjBYT9iOU4IFlKZ6qsN3m46Dr0MkIwZf WrWLNDfiRLr0lsIH+W7C+h0Pc+lZb/5nfnEWEJ9zzNoDbZb05ojCJAn/zkEnUUZiSRin v42wvKqHn+WRfjxaKwx10/AoY+zuoeKi0g/ky3cXxCAw1UBG/ahHRcVBQqRix7w/5Pom rbgW+XWJu+Sh3LZoLsd6tkhpOmhVALuot6ScCxUjH4Qqdu89sEz+zuHpUTEE6qPyFRMB gJcA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BTB4zVgu; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=jzUOwPF/pnqIdCFQBF01/prJEiQ0q7yR1n39hLZLVXA=; b=YFaC1xf1gz7/B0nbw/TQo3qmxJ3wX07ElBzElUtya5iBhH5wPa87GD0gywbGokmIjX 4Mm+QbDs6qfcEmnVIa0l6any2sfICEcaHwW2FIf5dofATk0N9Cuovz3lgwuXPzwpKfNT Uzhkx9KKHPTKGu45mTdZyCJFrD4fbJS55zAvA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=jzUOwPF/pnqIdCFQBF01/prJEiQ0q7yR1n39hLZLVXA=; b=kSFfXEfxvHAVKsVLWrsUgLOYPo82VYUb4E9VNyo12nTpQ/dYLPrWUWfW5G+7pvlHgY mfry3dZeFXwhI+eZ64V3DBJT5D7tFI+yRDGKlDO4AWQbGIRCl/+loCZuZOmlm+gs/PoX Et3sJgwQWCpzU2nX9DFf+Rdzllj0FpUoM23DJHnPsy/n9YMq+2sH7sTqrxscDC7I4uB8 4CeX539AmdFivZRRLGbJi38i2MF0IIiwfmXBR1wvOGBAvr5IYe8snzQ/9YnKjYxWKqpI lN5d4rdIrdQ7gLjfkxGhRJAt2KHtiK4rKL1vf5MP2IBk3sgDvlbSxcdBO8Dqhs5J9r7N fhtQ== X-Gm-Message-State: APjAAAUS6ufeqEL5+otNrvsgd1pULYb8YlO1K3KwchCpuFRPJZvN8oXQ KUrqDN3BYmxN9gaB2StOaeHm+T8W X-Google-Smtp-Source: APXvYqwIqu661T+XcApPKRkHy7uyzLOyNGQptIo600EO5eJ5Kyx/T/J0NwDNZ1eY6k5a9laskhFBzQ== X-Received: by 2002:a63:6f83:: with SMTP id k125mr1188807pgc.127.1552655347060; Fri, 15 Mar 2019 06:09:07 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:1281:: with SMTP id 1ls3991331pfs.4.gmail; Fri, 15 Mar 2019 06:09:06 -0700 (PDT) X-Received: by 2002:a65:4549:: with SMTP id x9mr3427133pgr.3.1552655346673; Fri, 15 Mar 2019 06:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552655346; cv=none; d=google.com; s=arc-20160816; b=sC150IQbDfRwdqh4eBq9FI70FtuEBR1PIsiZZm4exA9kEmtA4jHTjb5CMq9TQAFVxD d/sK3w8rNTLTu+Ve9sg++kRX8KiGi/WmHiUwEJ8v8+QfwVdv96RL7gpbcPz5+jz5mHXS HRk0rNh0d7YH85RfMejERGmW2IRkhFYVMDyBJeILbsKCP6BvRUDStJBmmpEnWjgS8RDz cU06u8pExutKs6WfS6brRJ3MaFZMpXJA9vNXWSiKqpAXIPPIQ+cJWHf+x9DaMlPBoyeK r+mfEpUIwPgIxgTL4syvuhiWPXX1fTOi7bUnMWjVlltcA3lANpxTzg18t/AwIBBuq9RY 1neA== 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=fgjvITMSu4P9dEIyxGHg+50sb9yJF4/343qaf5B+0M4=; b=YIeeXWUMMtZ6IBMFgfZRZguhMtRu9nQLBNKcPiZ9eTrfyGuNvfZOf8O7diE6hIogFH tT+yrhRTXl8RIqlk8gO51X5p4eGLzYOHKC+rxngW5bv6jnDTHtI9CQ/d5G1VYxuu9GZg HDJme5vX3Cy/Mj0GmlvmZDDnEPH/IxYcRL4kJv5j4/gJup8w02orFtBvCgTh6zg8d7pT BHROBeB4eEWzEbYZ69B0ApK3AdaxkX79Z5YqAzYF0KfqSUZLsRdECeAxZ5xq27pIqhOg bsdSdNRx8eg3hFkYctFLlQ0yiQ6Wz2WX3X6aZefRlAHzI6JOHbjf4eaXoPVPPfSkB3Od GrvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BTB4zVgu; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id s86sor3087841pfa.59.2019.03.15.06.09.06 for (Google Transport Security); Fri, 15 Mar 2019 06:09:06 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:aa7:9102:: with SMTP id 2mr3913621pfh.179.1552655346407; Fri, 15 Mar 2019 06:09:06 -0700 (PDT) Received: from localhost.localdomain ([183.82.230.185]) by smtp.gmail.com with ESMTPSA id e2sm854008pfa.64.2019.03.15.06.09.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 06:09:05 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Laurent Pinchart , Chen-Yu Tsai , Maxime Ripard , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland Cc: Michael Trimarchi , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 6/6] arm64: dts: allwinner: bananapi-m64: Enable S070WV20-CT16 DSI panel Date: Fri, 15 Mar 2019 18:38:25 +0530 Message-Id: <20190315130825.9005-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190315130825.9005-1-jagan@amarulasolutions.com> References: <20190315130825.9005-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=BTB4zVgu; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@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: , This patch add support for Bananapi S070WV20-CT16 DSI panel to BPI-M64 board. Bananapi S070WV20-CT16 is a pure RGB output panel with ICN6211 DSI/RGB convertor bridge, so enable bridge along with associated panel. DSI panel connected via board DSI port with, - DLDO1 as VCC-DSI supply - PD6 gpio for reset pin - PD5 gpio for backlight enable pin - PD7 gpio for backlight vdd supply Signed-off-by: Jagan Teki --- .../dts/allwinner/sun50i-a64-bananapi-m64.dts | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts index 7793ebb5d2b8..f31083aa4521 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts @@ -45,6 +45,7 @@ #include "sun50i-a64.dtsi" #include +#include / { model = "BananaPi-M64"; @@ -56,6 +57,15 @@ serial1 = &uart1; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>; + brightness-levels = <1 2 4 8 16 32 64 128 512>; + default-brightness-level = <2>; + enable-gpios = <&pio 3 5 GPIO_ACTIVE_HIGH>; /* LCD-BL-EN: PD5 */ + power-supply = <®_vdd_backlight>; + }; + chosen { stdout-path = "serial0:115200n8"; }; @@ -91,6 +101,26 @@ }; }; + panel-connector { + compatible = "bananapi,s070wv20-ct16", "simple-panel"; + + port { + backlight = <&backlight>; + panel_ep: endpoint { + remote-endpoint = <&bridge_out_ep>; + }; + }; + }; + + reg_vdd_backlight: vdd-backlight { + compatible = "regulator-fixed"; + regulator-name = "vdd-backlight"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pio 3 7 GPIO_ACTIVE_HIGH>; /* LCD-PWR-EN: PD7 */ + enable-active-high; + }; + wifi_pwrseq: wifi_pwrseq { compatible = "mmc-pwrseq-simple"; reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ @@ -116,6 +146,33 @@ status = "okay"; }; +&dphy { + status = "okay"; +}; + +&dsi { + vcc-dsi-supply = <®_dldo1>; /* VCC3V3-DSI */ + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + bridge@0 { + compatible = "bananapi,icn6211", "chipone, icn6211"; + reg = <0>; + reset-gpios = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* LCD-RST: PD6 */ + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + + bridge_out_ep: endpoint { + remote-endpoint = <&panel_ep>; + }; + }; + }; +}; + &ehci0 { status = "okay"; }; @@ -208,6 +265,12 @@ status = "okay"; }; +&r_pwm { + pinctrl-names = "default"; + pinctrl-0 = <&r_pwm_pin>; + status = "okay"; +}; + &r_rsb { status = "okay";