From patchwork Tue Oct 15 08:28:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 176376 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp5584310ill; Tue, 15 Oct 2019 01:28:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqycTAeYNVUYezbPLGV0puMOcvdgujOAtk8xtbyyvtDDztK7GaP+ZX47xRYmJ8Jhwn5BREc3 X-Received: by 2002:a62:b504:: with SMTP id y4mr37700637pfe.40.1571128108812; Tue, 15 Oct 2019 01:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571128108; cv=none; d=google.com; s=arc-20160816; b=reE1v56NKiyyHlSoD23yASblMJ6ot1P0zxhPLYSCiKY+6VESTpWPBNGsTEeYmJ5LzE kTGYKWZuNHPBCrArNw2FsgXQQE55kxWtd8B4kjUSv6ePk7w/4RQZVK7YZeCGKL7RSFTl Mla5wrQfeyuZEDNOn5HKT6/WrV1drnWfX1Dl08bbsuKEcMVGinHrajsDMjy3YxWQU8Mm AnsHSdve/hlq6iDp4mhegcGLIdWETxpYE1EWJXqC1dFher/xM/XxpuqpjpdvkrsVgWRn WfGsudoL/6K/N4kauI2A8jQtmjeZf6ObEt191W/5DehpnjOWgVb3qaMKE8GHTB5yd5o5 jldA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:to:from :delivered-to; bh=nConLJnKl/Co2H5KW1zE5ap8Zmb6DLjC2FFH7EMFlrU=; b=wL655T9ICjnUkueuoi4X6rr3FEQhrIBeT11+/mMWAc4SoOHNXkEEKKqWkv25n49q2V bEUqxp40ByCK7fLKxJ43Fp697bYGKF97SgHoB4XfczexpDL2Nr6+2Z2Ue+OxzqS9IzDb SmOA+aNfCMj3MC4s3wpvCYiL8La1tz5Y48YUSMj1c8dCV5Y7s82bal91U1Pti8yQZh6V b3VfzcQVhLTMPtgLcfF93xJPmHpSbISe3sqrvQb79mLuIhaF4N8IDMR8GS2UcjQBLaSv UA1mDtZUJ89GKzUzrYVXNzgtl99Q8AmGWwpv6VlDKRUEPt1h0mdJWncQn2BPWG/+gNYv 7sEw== ARC-Authentication-Results: i=1; mx.google.com; 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 x189si22957133pfb.280.2019.10.15.01.28.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Oct 2019 01:28:28 -0700 (PDT) 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; 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 B86616E632; Tue, 15 Oct 2019 08:28:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by gabe.freedesktop.org (Postfix) with ESMTPS id C1F766E632 for ; Tue, 15 Oct 2019 08:28:23 +0000 (UTC) Received: by mail-lf1-x141.google.com with SMTP id w67so13788277lff.4 for ; Tue, 15 Oct 2019 01:28:23 -0700 (PDT) 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=TqyXsc6PlVzrcPKyygecv+nh/Spcb5WfABEp5L+UujQ=; b=Zdn2ahQyxhH9fj+sCfzVZZPDN5Cl+eBcNPC8J3oiw6mOC09duYaepUmX9Yo3xTGEvU q3uMgrHoe9ubSU0CIosZBhiBQhcVPxrJ4H/2A9qXfMxVg1iDg6IaiJaEesnUQ6N7N2Th /4kuaabBASA3ihyRhaBkShh1drlYpceLZQO/P5WE+YJVEiWes6o3IfkU1WRUCmtY8CwS 34EQrxBs14x551wkb9/g12dTUYCg/mTXXdr5Q2fs0b3urwjtuBbpajYo4qohmgJ8mMqj sSwIcazc+E6ZVKeZpCWM5lOCRrh0xmy9Lj0fufwop8l8S4hZAbbpSi4SAQk4DhCnaP38 QiJg== X-Gm-Message-State: APjAAAWn/7OJ3AOW0sy65gCI4od2BG3HL6l9ez3XogDxzv6ShFJjgn45 /IFrp8oUf3ILZK6pJ7BLjd/yUg== X-Received: by 2002:ac2:5986:: with SMTP id w6mr20689070lfn.120.1571128101721; Tue, 15 Oct 2019 01:28:21 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id y3sm4795141lji.53.2019.10.15.01.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2019 01:28:20 -0700 (PDT) From: Linus Walleij To: Thierry Reding , Sam Ravnborg , dri-devel@lists.freedesktop.org Subject: [PATCH 3/3 v2] drm/panel: Add driver for Sony ACX424AKP panel Date: Tue, 15 Oct 2019 10:28:11 +0200 Message-Id: <20191015082811.29497-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191015082811.29497-1-linus.walleij@linaro.org> References: <20191015082811.29497-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TqyXsc6PlVzrcPKyygecv+nh/Spcb5WfABEp5L+UujQ=; b=YAFIaN5uCL8QM21RQAIrZr5DIv5fP5DXR3LhHI/bgXTkMJxJB7h8/gTF/8u0WSRDVM yCuchvOLVDi468OcCNzfWokUBblba/GFWricyHuVs2h23VcGfln/Q9nBKnyXbUxH6Ty9 JWNHrFkgzLJxpw852GzNsWm7QkpPpDSCeZ9yrpWxwKPqAYHIJpCZxNLtpaqu/HSp/d0i 1ksekk0/0RrTXKh8xe030nnmPvB/Qakhj0PrsPaEoSHKMGQYvmOVWxvgV5dCWNWhiZQO aUGlyh8PBeytaGc5FDiG1F8mimV3+wIhgWIgCsGHeWWYrEcx0i9y9iC0gfpy3Cf8Aunl ovig== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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". Signed-off-by: Linus Walleij --- 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 | 7 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-sony-acx424akp.c | 542 +++++++++++++++++++ include/video/mipi_display.h | 1 + 4 files changed, 551 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..959df5bea7d2 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -316,6 +316,13 @@ 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 + 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..96a1450b699e --- /dev/null +++ b/drivers/gpu/drm/panel/panel-sony-acx424akp.c @@ -0,0 +1,542 @@ +// 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