From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DD53C46475 for ; Tue, 23 Oct 2018 15:52:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3BF820665 for ; Tue, 23 Oct 2018 15:52:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="O7cpwft6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3BF820665 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728638AbeJXAP6 (ORCPT ); Tue, 23 Oct 2018 20:15:58 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34546 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728616AbeJXAP6 (ORCPT ); Tue, 23 Oct 2018 20:15:58 -0400 Received: by mail-pg1-f193.google.com with SMTP id g12-v6so868477pgs.1 for ; Tue, 23 Oct 2018 08:52:01 -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=udLRPsAiuTrSat5GwLoN+3u3Iu4Wcq2hVaqmCJCg1EtYUeHjnJNqixNtcPjcUzZmgV n73b2Cm4MSTbQOY5PiPGCrOQRDxMErkfUJEu3I2gB0H/i/30PduSWq5vIgP9SvhHPUJ6 9srGALteKuawyU9q5yNFixucvNXMQJlS7owQ+n9ACb1YdcjqpM/3vN94KmzCcmlTqXfz Y7Lk/Y/UDuhkWqSgDD1Gxd53Y0Lt+9jBRTVvSTqsc+3qqZk6E+ssm0cn73AnuK5LfUom s8hdxUQqpgMZhwfGd46A1EritNiNChsHvrqZpHnN49nOB3fzsKsk5y4ZiYKWMXpLqAZf CJQQ== X-Gm-Message-State: ABuFfojEVk8FQ68t5ZntgLg6sQuudx/KX3lKXfKFUpawC7dfqFG7chru KABBa6KRLifRwJAI6gNeIi5SMw== 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 Cc: Jagan Teki 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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