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: 331582 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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 8906FC6379D for ; Mon, 23 Nov 2020 14:34:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3400520782 for ; Mon, 23 Nov 2020 14:34:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="sMPr04Ey" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731667AbgKWOeN (ORCPT ); Mon, 23 Nov 2020 09:34:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729535AbgKWOeM (ORCPT ); Mon, 23 Nov 2020 09:34:12 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2609C061A4D for ; Mon, 23 Nov 2020 06:34:10 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id m6so18796697wrg.7 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=WFuCksqV7n4bheQMZTvNPA/a0E4FiJPoPtzkeQkQ/W94iinvl9W5wYNxrlmBzYylig SCPCUnOe/uFQeoHheGORi1L6OAqP8Rj6BH8ldNfTN8B/RHnAYbVuxxTCVg5v/tcZDtjA n3Ag+hpKi82U8jEopsa0ooU0jAglTznrCRQ2yL9tfEs32y7B4mzzFAWwlgM2cqVdNjaO V0zmyWmTYUW75g/xIsWMoNzvIA5AWG3HfmiRqzxUGGcd/oy3C1fJ4cnPjf/skmFYrIRX vAHrhxYkyFNQ5yK93ZnqfFN4rEEcUfHn0+nbTai4k6CG1Zhd/PHarWI21c/WFVNmesPm QZqw== X-Gm-Message-State: AOAM530QyJkhNioNPjHwnRHKT28MJ/DEbJIafICtgo0eYRN6xz3FI0aQ AmgLXSXEZW/gV1Uxwx5AvlISPg== 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 Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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