Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp886672pxu; Mon, 23 Nov 2020 06:39:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwA/v6wmyaI+hBJRtIkRaZez1MT1H+riYdKUd9UfEM9xR5VkrEi4S+k4iZe3lMIWLgNPrf/ X-Received: by 2002:a17:906:6a51:: with SMTP id n17mr26990103ejs.478.1606142346051; Mon, 23 Nov 2020 06:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606142346; cv=none; d=google.com; s=arc-20160816; b=QF3W53TlgFQrfHmnd/HRWgUuo/uGcRpdwC3KFh8Vb8x0XTppGjJzmeC3YssV9KfMjW 3acSKz77AIkzpr308ryJpVlO53NfZJ0Cy/Enkdgxq4kul/Bu5jDdRdTXDlk/9BzQH08w xj3FUKA80ZQJXRpmZ7hscjKQoOQHk2zM5rnX+7E3+0KZzpNb6BnjBQZYlkmpfQyVFWYX rAoWajX/MYwBqquLyIh5pzEeod69uevFjp4u9q/IMLF/LLhAtuBsAndHNDn/LXUEUhsI ngJJPgas97aTS6IRom4m6E9GFxQw5DejazAkmiyj2jy91iYHbBt0PyT3M9J2Ym4NTnc+ vvzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=N1gL9iG9VNNQODcQ4bqy/3MjLCHTiEErerOPbbpGmaw=; b=OhqsB/oFQfLbjO+ql+aDiBpu3S8ZG+NuAJp7gb69kuqBMEC8/xTkGxrspjk3vR2hJl 97dW69J5Ot+nuGEl/9fyoQowBZ4ldWLI8t3SmqFUOJ2Bf9XV8aScR4UWmpQWNCSl8gOr 8DHU0ZuqxA7J/sRnSrhsSgVCYcJn1RJfwj6rBAMj1CPblsPjq3kQxm1iiySEW7gK5CBm QDwn6T8VYLeoBdB5aNOmuDqp9hR8d54UdmAJB4yTFkdKQXBf9MQJHxSaa9q+MpJiyUiz zFR7B9xwtt2wV2MFK0+pCr/dvkuX69khNz7oW4E5NlGSdKP3xj2Obk9OZ0C9Opp6FP0m Wx0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=sMPr04Ey; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si7010895edy.584.2020.11.23.06.38.41; Mon, 23 Nov 2020 06:39:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=sMPr04Ey; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731638AbgKWOeM (ORCPT + 99 others); Mon, 23 Nov 2020 09:34:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729535AbgKWOeL (ORCPT ); Mon, 23 Nov 2020 09:34:11 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E655BC0613CF for ; Mon, 23 Nov 2020 06:34:10 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id g14so3610141wrm.13 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=aI4wwVFBrPzIKTghcRzC0jNBJ0fjnMC7UNwHqElvIGrjS60hdLPlUT8SOCY0BJALfk 6gMD8HZ0XdF1dXO+V2mbgQrwqZSgdgB5KqpU3M+JhlUuFIpea7mVgCJNt9SBaUk6rHmZ hm84apWQENn/upusdGLISV8Qy5N/nP8Znosv8MWV41+8I65P0aXEkxPAin6UTDbdPYMt VyGjbM2GYNAHBRTXqnpeHitaHaGVYr2ilgdhJsYkvZHEaFudSkQGlGYAco2eQNTxDzUB jgYq8Tacm7djyJOoCkwAkfUH7itQYr8EqVFAPzcqfMY8p/2P2L/k1Ru66RjfoRLvDzc+ 6lLw== X-Gm-Message-State: AOAM533LKTfshNRQziAXm5OWYMY7xlT7mMj9yJg5KE/t9sMkR0Z5iypV XOv6ogVRH91KSc21Fr5AeUWI2Q== 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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