From patchwork Thu Oct 24 11:43:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 177415 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2065307ill; Thu, 24 Oct 2019 04:43:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6tCLl3QU8fPrdH1otr86eQupAdABAHsRytDYYrQVO6/N8/yCk54qwha7ivzHZtxig8vAw X-Received: by 2002:a62:60c7:: with SMTP id u190mr16811710pfb.256.1571917404421; Thu, 24 Oct 2019 04:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571917404; cv=none; d=google.com; s=arc-20160816; b=0lIBJAB4LPAxQt+d4a8FnU84At4sRss2VVTu4o0XOWOqcv247dW2sf6edHx1uAM7Nm gk7Y8hfmpnPAKisLjpqxVWZdOh0KAC9e9NklxkzqWbZH6FL9ZgblpPaiP5hNMlfFc1OQ Z60qSisEMManT8THLoys0L+tjU4U6eCy4X9hau0yYt6yYGh094/Gz0Mgdrjliu/QByRs /RA/Ol0ilYrAfU674sCuYRHaT6RyFwT6qQIu9FnUPX0nFT2tS4TXtnvGYYQUOzk7cRDo vQhoxazFsDzhIKMbU86+Qt3oY7P+r6Xq2A/OY7h6nQXfXioGU4SthGUQ1L/nKgbStJ8n /c9A== 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=rXXgL4giQV6Nj4qZdib3WUkf7KauRG9xiqFJMygD3C4=; b=W0FoVWx4ZXqzxCZNxuCrL3xCp8k7bk+ZPwMmxFyemKT0Ask7kiTvUZkTMR/rDUslAL liXwZb+1+Btc9zVEu7q9+ukE9R2jFsz1DO5k89GFmjz42ZsliUkoQ7Sk5vUxBpRTUlI7 l+l887WAHe2LLuIx9L7Kkms5nU20oFcHEM2mlZd/JYqhdLfeMXkYD2kx5LQOSsvd4TwA ZOVD+zqDP5Qo7hceoaCrrFIresA/PrCcYiVDIiOE1T9Hv4LX3pnWKmYWg+UZguSjVZVn M6KLyXNIP5un3w+S7DU/XoCBF34XIMbjjsRGSEQp1pwv61VL1oxpPwzdrFIS4Yv/aNsx lEow== 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 27si26759304pgn.7.2019.10.24.04.43.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 04:43:24 -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 5A63F6E2E3; Thu, 24 Oct 2019 11:43:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id C63776E2F2 for ; Thu, 24 Oct 2019 11:43:15 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id d1so24619370ljl.13 for ; Thu, 24 Oct 2019 04:43:15 -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=HocbHkVryxQKKYD4eJZYx0TKKDYaGAurOyeG5XutFxE=; b=jticXYNFVPgb1g/hUtnzulJwMI3ViipqAE3OXxlCxC3r2aCgAczTl+3SwHNdFOFkCK zqHfXcFs07xDUiqRZJnPc3+kh7i8I2Z1ifu5U3PS61OOVNTLUvJOK5GnfsdCEswnxTRI XLe10M2O1PLkfQfKYDNyfd7K8mPvpfR/gx/Y8nn4f2bP0g+53pZ6iJZkCQL7wlU56HWF 6DdqQgv/1vuFLvZ2HHoLEnLsjwW2J31SaHp6Qpzc2uowPA177i7M87SrBG2Tau+7LSkg /qWAcVMyAPfMNKuruwEMsNG1rnQbtSqVD20pdVPUriqnpfSmK1xmTM072eo5mu/QT+92 5cFA== X-Gm-Message-State: APjAAAWsA8EvXHQshX5q0DThLqy7bBpGHB7gr0L0grNiM0yIgQwhn27M aqFyBDcNOa+i+d+MLodbYOCIHA== X-Received: by 2002:a2e:9e85:: with SMTP id f5mr26487084ljk.203.1571917393741; Thu, 24 Oct 2019 04:43:13 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e14sm4001846ljb.75.2019.10.24.04.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 04:43:13 -0700 (PDT) From: Linus Walleij To: Thierry Reding , Sam Ravnborg , dri-devel@lists.freedesktop.org Subject: [PATCH 3/3 v4] drm/panel: Add driver for Sony ACX424AKP panel Date: Thu, 24 Oct 2019 13:43:05 +0200 Message-Id: <20191024114305.15581-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191024114305.15581-1-linus.walleij@linaro.org> References: <20191024114305.15581-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=HocbHkVryxQKKYD4eJZYx0TKKDYaGAurOyeG5XutFxE=; b=k81rwmW70iZcnMNYDKoKql86Z5v2JtegX+HhBvBItjDaDP3ZaiQ1ZSdT5DE3S3W3uP yG3acCQfCrLo+x9H9Gw6GzLkSyf0lfPNyoSx0dK2uSNkbXm8azMMJswWwxCi0VLvNsUw SleFhz5+rIP1gSZS/DtTr2YKGy1okQDFdtUmegnKW1TU0mx9OaStHLhLQWJiUZQDgO1v 8pw+ejFNn4bnI4D16+orvdiqEcfiBIw2ps+NtfPfdttMUe772lLCp46UbYNhG+n75XMA 8gAcPIs5u3QZpi50nV6uCoILDb6aZJf8iih6WB5DHFIA1FHwtT6+kY0DdhhszSELaxI8 xPmA== 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 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 | 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