From patchwork Mon Nov 23 14:33:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11925441 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,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 D4DBAC2D0E4 for ; Mon, 23 Nov 2020 14:34:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 695BD20773 for ; Mon, 23 Nov 2020 14:34:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="sMPr04Ey" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 695BD20773 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F8DB89FDD; Mon, 23 Nov 2020 14:34:15 +0000 (UTC) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 00FF189F8B for ; Mon, 23 Nov 2020 14:34:10 +0000 (UTC) Received: by mail-wr1-x42d.google.com with SMTP id l1so18780542wrb.9 for ; Mon, 23 Nov 2020 06:34:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N1gL9iG9VNNQODcQ4bqy/3MjLCHTiEErerOPbbpGmaw=; b=sMPr04EyF5S8Qx34VNvHLBDDSBvG1qC05Pf8Ln7nmActrfePfdMJSshFZg2Eb5K0eQ cgRpHdi+7tRLYIy/fkIT+0BTZsQbbEyqRL2cpMJwNA0t/hrWKnYIkRVB4SGTAWGeZ9ke ic0EBZLMGim01KZYdtH3os5CGnJ06nAo+a7xGSL2QqMRAfgj4XUVCaWxnVOIAfJkEn+1 Q9U3nsCbe5HvrjLTev0xTQK4ECRq68nq9ZfD717hEBy8elFsLYw08DkE+QL+RKVqOYtm yyEwQ6FeWnN9On+OK6hwnKF3SSTp2YVONb+151iL2pIpLi5+CwChggCUc6xySf2qMVUl jyUg== 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=N1gL9iG9VNNQODcQ4bqy/3MjLCHTiEErerOPbbpGmaw=; b=TpTXUs7gJOYlSp29Jv1zZ6qNzQdiEq/bfQsd2HYx1fHz9A69pvdNQtmFVxf1FMs9Wt 5em3kMcCrAk2g5nN5H7OF2ZfLFgDODYfzUmqWhNbB0CV+AtTPpxgYEhQd4QBufnATkKq skAiJj0/jO6VYjYCWEgZc0lb8AfR5YfslA7gSFpH+vUVHHZPnYQDSZ2niXczx0qEWslb 9EWjUbkJxZMIUGDdOO86IoVHgYDTIpiv7boQrdTTELlKXkk+/V3PamZwsRDxrazuyoQ0 QslLVFdRTl/0kQ2JyfVqfAu5eE+px01mi1GaSQ32G7gAG0kO0cpQmbk+9QuTldCxOy23 mDlQ== X-Gm-Message-State: AOAM5312Sdm55jQb1JsrIjWG2o5Q20pktqLzQG6VRJAjIbT5gogysnpo vIkJgPxe8q4IOj/ZWWne76VXlg== X-Google-Smtp-Source: ABdhPJxihrxawGEH0Ao7tnStlBwVolzE1Ui5ROmtavEmsY4HvTT5ctYDAl/EWAkxb53Qe1bkxa1Uww== X-Received: by 2002:adf:fe48:: with SMTP id m8mr7959840wrs.89.1606142049297; Mon, 23 Nov 2020 06:34:09 -0800 (PST) Received: from localhost.localdomain ([2a01:e35:2ec0:82b0:9541:d2fd:3a68:67ae]) by smtp.gmail.com with ESMTPSA id h2sm18126723wme.45.2020.11.23.06.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 06:34:08 -0800 (PST) From: Neil Armstrong To: sam@ravnborg.org Subject: [PATCH 2/2] drm: panel: add Khadas TS050 panel driver Date: Mon, 23 Nov 2020 15:33:54 +0100 Message-Id: <20201123143354.295844-3-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201123143354.295844-1-narmstrong@baylibre.com> References: <20201123143354.295844-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Neil Armstrong Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This add support for the Khadas TS050 1080x1920 5" LCD DSI panel designed to work with the Khadas Edge-V, Captain, VIM3 and VIM3L Single Board Computers. It provides a MIPI DSI interface to the host, a built-in LED backlight and touch controller. The init values was taken from the vendor source tree, comments were added to the know values but most of the init table is undocumented. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-khadas-ts050.c | 876 +++++++++++++++++++++ 3 files changed, 888 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-khadas-ts050.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index b4e021ea30f9..8fec45b2ce02 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -145,6 +145,17 @@ config DRM_PANEL_JDI_LT070ME05000 The panel has a 1200(RGB)×1920 (WUXGA) resolution and uses 24 bit per pixel. +config DRM_PANEL_KHADAS_TS050 + tristate "Khadas TS050 panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for Khadas TS050 TFT-LCD + panel module. The panel has a 1080x1920 resolution and uses + 24 bit RGB per pixel. It provides a MIPI DSI interface to + the host, a built-in LED backlight and touch controller. + config DRM_PANEL_KINGDISPLAY_KD097D04 tristate "Kingdisplay kd097d04 panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index ebbf488c7eac..03496695e03f 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o +obj-$(CONFIG_DRM_PANEL_KHADAS_TS050) += panel-khadas-ts050.o obj-$(CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04) += panel-kingdisplay-kd097d04.o obj-$(CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W) += panel-leadtek-ltk050h3146w.o obj-$(CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829) += panel-leadtek-ltk500hd1829.o diff --git a/drivers/gpu/drm/panel/panel-khadas-ts050.c b/drivers/gpu/drm/panel/panel-khadas-ts050.c new file mode 100644 index 000000000000..856fcad69306 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-khadas-ts050.c @@ -0,0 +1,876 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 BayLibre, SAS + * Author: Neil Armstrong + */ + +#include +#include +#include +#include +#include + +#include