From patchwork Sat Jan 4 00:10:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11317539 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5119138D for ; Sat, 4 Jan 2020 00:12:37 +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 B3182222C3 for ; Sat, 4 Jan 2020 00:12:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kBtzuCZE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3182222C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 9005A6E391; Sat, 4 Jan 2020 00:12:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 102236E388 for ; Sat, 4 Jan 2020 00:12:33 +0000 (UTC) Received: by mail-lf1-x12f.google.com with SMTP id 203so32837776lfa.12 for ; Fri, 03 Jan 2020 16:12:32 -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=k1g83G636+PNQyGwO3vnE8owSC/ZkIVijx3SC5Cp0Qw=; b=kBtzuCZEJi6LJ1rT7FN3mePDbfCaqCnREvPxzmQAZjHHYmRtwsA7Az3D9Cp24pQN4N UHzuvrcF+BF8uZmFsEe40FE5NYSYDqfYkqXJ/uau7SMNa9JeexTrxw9ZUe2lOdLxx5KF sPERzWlZqq0xa98LQNm0WSSlpScXzTP+G+PuM3LlmyvyojBWptzAOqcFkFat+YK1SmeH w0uFCG46Nl+v3pS0lbEXrEJNOGev7xcSGWp2ZHyXfxXZKeiXOGhTgMjackQh7md1mfNa dJoiR/qZ8OuoQE7xyyrbuBVG7k2eyQTUXFfY8tV+hHsN/+BmiQ96a6aeeRTJJs9QsUtM TGFg== 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=k1g83G636+PNQyGwO3vnE8owSC/ZkIVijx3SC5Cp0Qw=; b=aAvxWYrxRM7b4oohKpXFN1uw6ePNnccqGH0/lFgTAJXqYOnHv5ckdxYZ+gFW/vvIKK DuH+LJHnbHc8R7NVb/dxMucjHD0QyFjXnKL4NB9RajQyw9da5yZCZ03QM09XAjIaWdy/ 9ulFkaD39dXlSA7M5op6iVHVI6vUpgKlvXEqlXlZSNiH8bGE3FCqaZQ0bHA1Eezu0rRh rBwooRjtwJOq5f7O0l6kPkcEkIT4c1qI0IETKVAmNye7643iQDNI0EDXK/7UTpqL4Kde YHOOpantnfkxf01KgoPU3B1PHFghhmsV4EDsTuzs0NbUCLpgjCo04ugGwpxjTV8M3iZI QZyA== X-Gm-Message-State: APjAAAVlquKTNHNhZogo3sIxx374d67LzXTl77sYIfpICwUJKEsyrD/W H4RznPGaRlUzAdvTfPWdH+F3SQ== X-Google-Smtp-Source: APXvYqyFD7lsYI4ttXMpJLRhOnn7gMiZrs6w3k2gzko21e7TFmpWps6rwM9mRpsnWOfiX+1trf0Ymw== X-Received: by 2002:ac2:48bc:: with SMTP id u28mr50560764lfg.81.1578096751117; Fri, 03 Jan 2020 16:12:31 -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 z26sm25280260lfq.69.2020.01.03.16.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 16:12:30 -0800 (PST) From: Linus Walleij To: Thierry Reding , Sam Ravnborg , dri-devel@lists.freedesktop.org, Rob Herring Subject: [PATCH v7] drm/panel: Add driver for Sony ACX424AKP panel Date: Sat, 4 Jan 2020 01:10:26 +0100 Message-Id: <20200104001026.201086-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 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. --- drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-sony-acx424akp.c | 550 +++++++++++++++++++ 3 files changed, 562 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-sony-acx424akp.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index f152bc4eeb53..7ef8d095aae6 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -316,6 +316,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 b6cd39fe0f20..0b51793e3b43 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -33,6 +33,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..fe33f97cd812 --- /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