From patchwork Fri Oct 26 14:43:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10657573 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 D333814BD for ; Fri, 26 Oct 2018 15:17:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C40C12C9C7 for ; Fri, 26 Oct 2018 15:17:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B81C82C9DD; Fri, 26 Oct 2018 15:17:38 +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 117DF2C9C7 for ; Fri, 26 Oct 2018 15:17:38 +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=QXL49xfsD9J4zXRuwRJqq9xTE+JxpONSVxS0vKE5pEE=; b=VT0wmuZ5UTpbWg AQ857Gi8inb/k0IHpx8cEqECH7iTywYa7DCfEhu5ae2BWFTbKaebuQ/x0szRgF+5DGCp8pSyaUfqP XBLndwkXWLMGxf+8nMorUVnzmdgfDHjZArZXp2bJTwMehM5JQsSc7XhzPuyo+Th0330Uj/pI7iSgQ Dt6JvNQx/r0bFbI5moD9j8fC/1NCAdTShBPgYVJqiOJ8laag4dMzg+TMdd5KnC9LsohjlXe9DWJ8B sKetOwi3FhizDQovCl011RZDsutW4uqVoXXhIkQ6jAQVNGIjPCpPhn1VXahlx32FYp+z6oW4Y5Zei ecVZ5JmQxSriY6RuL+vg==; 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 1gG3rj-00006W-Aw; Fri, 26 Oct 2018 15:17:35 +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 1gG3bj-00012G-PS for linux-arm-kernel@bombadil.infradead.org; Fri, 26 Oct 2018 15:01:03 +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=/F8dMaCNMFKq/EyugOUVTAbhzlNwtGch4eQYIYheg1s=; b=BJx82D6dpbpvp4NAAnOSSjG0tJ /lu4dEVsIveBKY1qwcyg6bwDArv2A2/jl0cViGaVby6c1WLGn9/9uxP9SEud9g75ius/kpmc483QG 3FvjxD8G1KdXl882cS/NjgkBL5acPsznhBbJCBpVmtpyu+gLrmY0DceLfMFNkBpmUCH4mt/O+Q8zq qp4VW9CihHOvOR7arR5BwVJXxcoUTK+SMwq8SRU6z7H9/kFjE7JUlQeHWGtcohIvZX5KNITc+I6Iz G3I/iUoazs85p9deCK19ZfF4NA6LZSh9IuJoFiMo7R5bgV4Qu9oHD6GVsPEOIlrRsMSojnMOjYhqW vYxMLyyA==; 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 1gG3NB-0008Lq-Am for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:46:07 +0000 Received: by mail-pg1-x541.google.com with SMTP id w3-v6so632780pgs.11 for ; Fri, 26 Oct 2018 07:45:55 -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=/F8dMaCNMFKq/EyugOUVTAbhzlNwtGch4eQYIYheg1s=; b=GEaAlk6yTT777d7BfS+tpJ8S4xYtoqT/e2pZ3pT7elj4zM+GBcPTHfh/XlQcRoJZXR CFaAQBR6CEt7UEauRNh6cBPiTw+zoqkDjQMoemJKZl1pY6kRKRR+yK7TCz1YhdBefAVm oLPJEwgHGuZdGvOu15BsV7oHkVfQPQJGvaouE= 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=/F8dMaCNMFKq/EyugOUVTAbhzlNwtGch4eQYIYheg1s=; b=tYZbaze1K38nA0Of58TXuxfMIlQOM2mlRnZ3d65iC3vTXUbCgwQd3O68pyDNVyArD/ 69WU+lvhdFj6anMAbF/yDWEl3Xh4o2ZgDEPlbEfOBQYTIEQAqcZvdqC73yFcplwN3fLs A8SpupnCCJcWR0SiZicH0dtm03qRddisPaQXqlmv65pZ4rFlj8BqPADI//9yO3GXLZaP RmYqAIp2PLY/lpTeTkUKxi4EbN8gDHh4H4NF7qGrrkfKxAlUh4j6L9p12a2ZI3yXicbL 9luhxFSTtRsoMrFCZ8lEsifip08UQWD9kfxdcQgyeCTJJJg96ftGlrlYgnjVlrRNLg88 P5EA== X-Gm-Message-State: AGRZ1gLp8OTGLVqCimVqHFUxTMD0UqQmmht4SbzKF5NKLRO6EGBVY8Kc 4KehgUXXq96rp3Buutj3+tz3Gg== X-Google-Smtp-Source: AJdET5ei6CkytoTjWDhaa0kJ7NVhvlCoiRGN5rAKGIYt7tTGlMkh+wvUafYpFyHwDFbvqOn404p0cw== X-Received: by 2002:a62:670f:: with SMTP id b15-v6mr3964805pfc.243.1540565154087; Fri, 26 Oct 2018 07:45:54 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:53 -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 v3 18/25] drm/panel: Add Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge Date: Fri, 26 Oct 2018 20:13:37 +0530 Message-Id: <20181026144344.27778-19-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_154601_517603_30C7E366 X-CRM114-Status: GOOD ( 30.98 ) 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. BSP dclock of 30MHz is not working with existing sunxi-ng and sun4i sun4i_dclk_recalc, so updated to 55MHz can result proper working nkm dividers. dclock, 30MHz => PLL_MIPI, 300MHz => set rate 440MHz with 1,2,1 nkm dclock, 55MHz => PLL_MIPI, 300MHz => set rate 330MHz with 5,2,9 nkm Signed-off-by: Jagan Teki Tested-by: Jagan Teki --- Changes for v3: - Fixed to add proper commit message - add tested credit Changes for v2: - none 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