From patchwork Thu Jan 9 07:28:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 182799 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3216074ile; Sun, 12 Jan 2020 10:01:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwkPQikzjcNcqWUCFxQieg2hB1afYMCQLy4vi14DTYA3d6YXfwLF6QHyosGuxBsTukY+TPL X-Received: by 2002:a63:4824:: with SMTP id v36mr16583253pga.343.1578845406166; Sun, 12 Jan 2020 08:10:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578845406; cv=none; d=google.com; s=arc-20160816; b=BAjo5AL2SmnnySIn5OI+HsDholIyn3Kkj6BP3R4lYgDCi/IttVk732Z33upyQG6k9+ cE5frpe18MT5x21G8+Cz1dvY9YqVFCuXB7q64gtvWoZ87SXE5OwOTLnqWRp7bZW/NPaB aPd3KJifN4Jj4KfzNMo8gmkI48qwBC2zIGrzdCVGKqOeH3ItytxJni1532OqQwOAEo1j 2fIT7YNK2zMs1kw5vN3nk98/9zV9eYts3Sdzk4pofQGkeCkYi/cQ9fp/JD00f6+wubTg oYBMyCWVmSoZKZNLbu7EGZPbiPAOESo1rBeXQ5i0g+nQDls+0oT6TNri29huEGQY6eeb KmYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=TqHxWlvbeV6E4m0sqodp0bJGDDbhlxXw7y6fZesAAGY=; b=zx2OxWQAho08ntKNMndH4sLVUp6h5TLFHI/LGSU4ffOoeNebVFB9DkFimBXfakHHUD cz8HUAlFM40skOhf6jlfw3erw0ArMJqdHqKX7es4+IUNUi/RfSDC+s9owgS2hLEU6Zoi q0p5ggHVIS874HS8DBuK9L5wInRMzMN4S2mhOJ49OI1RjZsNf5OAz1Rp3k4AVjfxD5gs G5zogvZgJEOtqV64V9VOYHGR1NMxqWs7UtWbNzRSKY3KhrvWz7/4avCImkXiJl/IrfCX ndeTOmbnDkyEPwM2TSJHbS6sSBbAHZZjFXcwwVtVPCpTfKG4x7lXcxw7vSWXOia1oXX1 ZbuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CdPybmxo; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id k17si9003996pfe.163.2020.01.12.08.10.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 08:10:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CdPybmxo; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C42768982C; Thu, 9 Jan 2020 07:30:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id E101F8982C for ; Thu, 9 Jan 2020 07:30:22 +0000 (UTC) Received: by mail-lj1-x242.google.com with SMTP id y6so6139547lji.0 for ; Wed, 08 Jan 2020 23:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CaMxKStNOGqHopwc9nZElcg5Mm5NYsdUJ9zFexw16jw=; b=CdPybmxoytosHOFaziwbRBNPWp69sZdoVY4QcFN1aVeZ5hvoIfemSd0AHUOJDoELZI 3UN2ONR1lxdywQX0JjKeKZilk9m31A1TKYz0G9MND6SOksotvzTeF7+C8UScd94wiWnZ WnqJs/T5vhINKYO3Yf/SYh9Dvy/Ub2B+2QKA9jwSGYV7d+jQnHxcqY4RD1NDQmfpyU0h 02+AZrNK9y2PqV37ThZeKReVQwhX9fUlHUEni8vAD1rVr1l7ecQDkRei2eXJlnzZ/qIw tbb8jTB9eve9JthcYNfyLNDnSCOXVJUDJE/ES7FjDZjy6ots1qBj1pF807uteaPi/KMm ILGQ== 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:mime-version :content-transfer-encoding; bh=CaMxKStNOGqHopwc9nZElcg5Mm5NYsdUJ9zFexw16jw=; b=CRz7HVFx8FwFhBsu3dr1uAaBcHRMO0kHCpLqhQPGtrvWCZ7UqVsutsuqbQ6UUsjREl BBw1A4tbDYZs2NBfEkls1RdGSaRXwWGBmntWFjtaKns7F73ChayG7lAbSGkc9IDALFfF IrgU2p5xb3Elw2+XdYh2eePRPakQYSAQd7sGvL7TkyqUGCFdllPlBFLSh9WsMS5DgzkL d0kj5tc9vaf3hD3q0xERXDMoBCabcnEk/PS1mptFLALQo/0qkS38yGS+elY8pCuwwlOQ 4gsLSkDoLTn9S290gmypwToT1alOgfQB7yypTEixyhx8X436uWayEBn4VD2l1zEob4WX gIsw== X-Gm-Message-State: APjAAAUGq2utv5J0IIgDknhmxF/tkbQDfgYmJ/+mlVSHS8AlL+cbl5oa F8IITEmnrngpA/iiafgOmc1Q5g== X-Received: by 2002:a2e:81c7:: with SMTP id s7mr5622516ljg.3.1578555021021; Wed, 08 Jan 2020 23:30:21 -0800 (PST) Received: from localhost.localdomain (c-5ac9225c.014-348-6c756e10.bbcust.telenor.se. [92.34.201.90]) by smtp.gmail.com with ESMTPSA id y11sm2928068lfc.27.2020.01.08.23.30.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 23:30:18 -0800 (PST) From: Linus Walleij To: Thierry Reding , Sam Ravnborg , dri-devel@lists.freedesktop.org, Rob Herring Subject: [PATCH v8] drm/panel: Add driver for Sony ACX424AKP panel Date: Thu, 9 Jan 2020 08:28:15 +0100 Message-Id: <20200109072815.334867-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.23.0 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: Stephan Gerhold Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The Sony ACX424AKP is a command/videomode DSI panel for mobile devices. It is used on the ST-Ericsson HREF520 reference design. We support video mode by default, but it is possible to switch the panel into command mode by using the bool property "dsi-command-mode". Cc: Stephan Gerhold Signed-off-by: Linus Walleij --- ChangeLog v7->v8: - Fix some compilation problems due to the connector refactoring that went in recently so all builds fine now. - Add a MAINTAINERS entry for the driver. - Convert some msleep() to usleep_range(): it's fine to sleep some more so make this explicit. ChangeLog v6->v7: - Add some Kconfig help text. - Sort includes alphabetically. - Move the struct drm_panel first in the state container struct since we are subclassing the panel class. - Put an explicit /* sentinel */ text in the NULL entry for compatible. - Move MTP ID readout to the .prepare() callback. - Add a verbose comment about the MDDI setting so others understand what may be going on. - Explain why the backlight follows the display and cannot be turned on/off ChangeLog v5->v6: - Move the "set MDDI" command back to this file. It is a local pecularity, we suspect there is a Novatek controller inside this display. ChangeLog v4->v5: - Bindings were iterated separately so a jump in versioning. - Add Stephan as reviewer. ChangeLog v3->v4: - No changes just resending with the new binding updates. ChangeLog v2->v3: - No changes just resending with the new binding updates. ChangeLog v1->v2: - Fix up the ID read function to split into reading header, version and ID, store the version in the struct. - Get rid of a surplus semicolon found by the build robot while rewriting the above code. - Use unsigned int in probe() loop. - Set vrefresh to 60Hz, as good as any, the measured vrefresh in continous command mode is ~117 Hz. - Use a different for() idiom while retrying to read ID 5 times. - Drop the sync pulse setting, we are not using this, this panel uses an event. - Use the generic "enforce-video-mode" for video mode enforcement. --- MAINTAINERS | 6 + drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-sony-acx424akp.c | 550 +++++++++++++++++++ 4 files changed, 568 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-sony-acx424akp.c -- 2.23.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel diff --git a/MAINTAINERS b/MAINTAINERS index 4118dfe61867..3d5cbbaee117 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5368,6 +5368,12 @@ S: Maintained F: drivers/gpu/drm/tiny/st7735r.c F: Documentation/devicetree/bindings/display/sitronix,st7735r.txt +DRM DRIVER FOR SONY ACX424AKP PANELS +M: Linus Walleij +T: git git://anongit.freedesktop.org/drm/drm-misc +S: Maintained +F: drivers/gpu/drm/panel/panel-sony-acx424akp.c + DRM DRIVER FOR ST-ERICSSON MCDE M: Linus Walleij T: git git://anongit.freedesktop.org/drm/drm-misc diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 41f796b28dd5..ae44ac2ec106 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -338,6 +338,17 @@ config DRM_PANEL_SITRONIX_ST7789V Say Y here if you want to enable support for the Sitronix ST7789V controller for 240x320 LCD panels +config DRM_PANEL_SONY_ACX424AKP + tristate "Sony ACX424AKP DSI command mode panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + select VIDEOMODE_HELPERS + help + Say Y here if you want to enable the Sony ACX424 display + panel. This panel supports DSI in both command and video + mode. + config DRM_PANEL_SONY_ACX565AKM tristate "Sony ACX565AKM panel" depends on GPIOLIB && OF && SPI diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 4dc7acff21b9..7c4d3c581fd4 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_DRM_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o +obj-$(CONFIG_DRM_PANEL_SONY_ACX424AKP) += panel-sony-acx424akp.o obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o diff --git a/drivers/gpu/drm/panel/panel-sony-acx424akp.c b/drivers/gpu/drm/panel/panel-sony-acx424akp.c new file mode 100644 index 000000000000..de0abf76ae6f --- /dev/null +++ b/drivers/gpu/drm/panel/panel-sony-acx424akp.c @@ -0,0 +1,550 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * MIPI-DSI Sony ACX424AKP panel driver. This is a 480x864 + * AMOLED panel with a command-only DSI interface. + * + * Copyright (C) Linaro Ltd. 2019 + * Author: Linus Walleij + * Based on code and know-how from Marcus Lorentzon + * Copyright (C) ST-Ericsson SA 2010 + */ +#include +#include +#include +#include +#include +#include + +#include