From patchwork Tue Oct 23 15:50:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10653365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E57B14DE for ; Tue, 23 Oct 2018 16:09:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D2B029EAC for ; Tue, 23 Oct 2018 16:09:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4120C29EB4; Tue, 23 Oct 2018 16:09:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 64F4929EAC for ; Tue, 23 Oct 2018 16:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EGw/8BPbwY/k5ZMuF7VY18Z8f6OJQCzDa6s2myZUiNA=; b=L3+X7ufqcBWT1V T2/I0RskFx1V6wO5efH07IE8jKoFBrKX8hwo/czywLWyiARuFKhymej5UakHCB9jhliVv4Q1Kfy+B Ppnla3Zvml8hbhPaaSrM7VJq/L1tQYVN8u73qYl8ACYvt+xX21aa1wGchW8FVkr3ApBDPXc1pwrSg MZi7Xw5O5GiEl2NDAeuQLTTCTPp64ssDMCv++pjfgxl+/qOzEv9Mcd9VGRmzVbkq67tnskeWhbOJc Dc2Xc8bHRIUbiaestyLs2gpkOcQVcJrTl36S2Ra/ytlF0jzQnsJetsDJ5V0rRtc3hEX757wI9nBhA 5TWyfgcQyI3zpqE9mefw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEzEc-0005JO-E6; Tue, 23 Oct 2018 16:08:46 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEzE4-0004yG-Dy for linux-arm-kernel@bombadil.infradead.org; Tue, 23 Oct 2018 16:08:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Mxf9bLJ64wGfshFY8z9ZlFTV50JGRovm/Nkf235Myp8=; b=tMtze7pJ78Z4rWXkcCe6X8TwFN kriRwp/ZtC1C0E55Kuz65hswFGyfW9e122yWQ9CZFnrIQhVAzj5nQUBQGfb5CCpy55U9CPFV08FpX 5z9YkmkMSLYtBzbEznZiFVKB4nZGjSztRthCkuV0/0PqK5TDuvJTBhsCdE4oTYWwt53iEqkQbUkzc XOF6J9nhDssMnGAjEAjdsX9ExkiE6JOvcOZEdoEc/BHm88NJ48FaAP5CO9A+Qr1HvQ2uPgZOABWOE Kjr+Krn8WQsR+UfWzkKQDXtHXCRuuqszEpb/3bv8RekqBy381f0aH9T2x+4MyXjDbRhf+A5Xc/yJN 5cOs7Nsg==; Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEyyb-00013U-Go for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:52:15 +0000 Received: by mail-pg1-x541.google.com with SMTP id 32-v6so865034pgu.2 for ; Tue, 23 Oct 2018 08:52:02 -0700 (PDT) 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:content-transfer-encoding; bh=Mxf9bLJ64wGfshFY8z9ZlFTV50JGRovm/Nkf235Myp8=; b=O7cpwft6JaLDKZ9XT4opBiZzGwX6J4CvP6FV37dQY3QmBXyRnjI8vwpVK1E/ksxMm/ EJRhM2RQCqAoorhAq0ZJkEkoqSGIEwee+/HNMasHsrgzPnp1dn+kA+wsUyRO3ljdHaC3 mTSd/CwZ8pC5QN7q2i4I8nfxxzGwlyHr7knt0= 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:content-transfer-encoding; bh=Mxf9bLJ64wGfshFY8z9ZlFTV50JGRovm/Nkf235Myp8=; b=iClxxnZBaYpxlkEALNIBE+NCKCblEP1LGb08TvkyI3G0vhUeWw8oJaNxEN0adF/fqy 2UeemKoXEe+Pe8A9l5RyXAw1ym0FYHUzDT2FL5JA+7waGju285zZUuRzcZGinDNG0IN1 xiFv9nrBFJP5BlsoZ51XR84ENlMJYTmgrJl4wmeLhaWxbbJIu4rozyh9RH2q45dzAAcA KTEWXwEjFyjrrAjmB5r6nwdhCoV59K4kTcccgKb8M5hHb3pG6lvi4eyGywuN+jaJ2Fg5 H2zjZderH68KZW/7Pl76gCwEwakvuqCl1V6JlM8GZUqLBw+ZI/yu3oxbF6S/ZMkzq5Gp ijAg== X-Gm-Message-State: ABuFfoiel/GXzGjX/oxN+Eq/I3KPWe5oZEvPlbIVZ+ezlPqrjkkDf35S BiAONVx4B16G/khIhs75yncgQA== X-Google-Smtp-Source: ACcGV60EbjWDJpyU6LQyMR5ISQRSoRJZ/WtrmDjL84l80LBmoGRyuaOkjS44bC3uBfcFNeoUfLBZAQ== X-Received: by 2002:a63:ce56:: with SMTP id r22-v6mr46751275pgi.217.1540309921005; Tue, 23 Oct 2018 08:52:01 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:52:00 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v2 11/15] drm/panel: Add Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge Date: Tue, 23 Oct 2018 21:20:31 +0530 Message-Id: <20181023155035.9101-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_165213_625399_722B5174 X-CRM114-Status: GOOD ( 32.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Bananapi S070WV20-CT16 ICN6211 is 800x480, 4-lane MIPI-DSI to RGB bridge panel which can be used to connect via DSI port on BPI-M64 board, so add a driver for it. The same panel PCB comes with parallel RBG which is supported via panel-simple driver with "bananapi,s070wv20-ct16" compatible. Panel clock frequency used by BSP is 30MHz but the same cannot be handle via A64 PLL_MIPI and which is not working. So use 55MHz so-that it can rounded to 33MHz while calculating nkm dividers. Signed-off-by: Jagan Teki --- Changes for v2: - Add detailed commit message - Update the compatible string for MIPI-DSI to RGB bridge - Use clock as 55MHz drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../panel/panel-bananapi-s070wv20-icn6211.c | 336 ++++++++++++++++++ 3 files changed, 346 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 6020c30a33b3..20b88c275421 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -17,6 +17,15 @@ config DRM_PANEL_ARM_VERSATILE reference designs. The panel is detected using special registers in the Versatile family syscon registers. +config DRM_PANEL_BANANAPI_S070WV20_ICN6211 + tristate "Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge panel driver" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y if you want to enable support for panels based on the + Bananapi S070WV20-CT16 MIPI-DSI controller. + config DRM_PANEL_LVDS tristate "Generic LVDS panel driver" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 5ccaaa9d13af..04696bb85218 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o +obj-$(CONFIG_DRM_PANEL_BANANAPI_S070WV20_ICN6211) += panel-bananapi-s070wv20-icn6211.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o diff --git a/drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c b/drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c new file mode 100644 index 000000000000..643b215bec34 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c @@ -0,0 +1,336 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Copyright (C) 2018 Amarula Solutions + * Author: Jagan Teki + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include