From patchwork Mon Feb 25 14:45:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10828697 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3C2D1399 for ; Mon, 25 Feb 2019 15:25:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B09882881E for ; Mon, 25 Feb 2019 15:25:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A55552B79B; Mon, 25 Feb 2019 15:25:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3894C2881E for ; Mon, 25 Feb 2019 15:25:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DAD1A89815; Mon, 25 Feb 2019 15:25:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9FAF1892AA for ; Mon, 25 Feb 2019 14:45:37 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2019 06:45:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,411,1544515200"; d="scan'208";a="120629019" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 25 Feb 2019 06:45:35 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 73AF52B1; Mon, 25 Feb 2019 16:45:34 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Noralf_Tr=C3=B8nnes?= , dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter Subject: [PATCH v1] drm/tinydrm/ili9341: Support Adafruit 2.8" TFT display Date: Mon, 25 Feb 2019 17:45:34 +0300 Message-Id: <20190225144534.29859-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 25 Feb 2019 15:25:01 +0000 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: , Cc: Andy Shevchenko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The Adafruit 2.8" TFT display [1] has different dimensions than 2.4" one. Add support for it. [1]: https://cdn-shop.adafruit.com/datasheets/MI0283QT-11+V1.1.PDF Signed-off-by: Andy Shevchenko --- - based on top of drm-tip drivers/gpu/drm/tinydrm/ili9341.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/ili9341.c b/drivers/gpu/drm/tinydrm/ili9341.c index 3b7565a6311e..7e20d7f1b25f 100644 --- a/drivers/gpu/drm/tinydrm/ili9341.c +++ b/drivers/gpu/drm/tinydrm/ili9341.c @@ -140,6 +140,10 @@ static const struct drm_display_mode yx240qv29_mode = { DRM_SIMPLE_MODE(240, 320, 37, 49), }; +static const struct drm_display_mode dt280qv10_mode = { + DRM_SIMPLE_MODE(240, 320, 43, 58), +}; + DEFINE_DRM_GEM_CMA_FOPS(ili9341_fops); static struct drm_driver ili9341_driver = { @@ -155,25 +159,32 @@ static struct drm_driver ili9341_driver = { }; static const struct of_device_id ili9341_of_match[] = { - { .compatible = "adafruit,yx240qv29" }, + { .compatible = "adafruit,yx240qv29", .data = &yx240qv29_mode }, + { .compatible = "adafruit,dt280qv10", .data = &dt280qv10_mode }, { } }; MODULE_DEVICE_TABLE(of, ili9341_of_match); static const struct spi_device_id ili9341_id[] = { - { "yx240qv29", 0 }, + { "yx240qv29", (kernel_ulong_t)&yx240qv29_mode }, + { "dt280qv10", (kernel_ulong_t)&dt280qv10_mode }, { } }; MODULE_DEVICE_TABLE(spi, ili9341_id); static int ili9341_probe(struct spi_device *spi) { + const struct drm_display_mode *mode; struct device *dev = &spi->dev; struct mipi_dbi *mipi; struct gpio_desc *dc; u32 rotation = 0; int ret; + mode = device_get_match_data(dev); + if (!mode) + return -ENODEV; + mipi = devm_kzalloc(dev, sizeof(*mipi), GFP_KERNEL); if (!mipi) return -ENOMEM; @@ -201,7 +212,7 @@ static int ili9341_probe(struct spi_device *spi) return ret; ret = mipi_dbi_init(&spi->dev, mipi, &ili9341_pipe_funcs, - &ili9341_driver, &yx240qv29_mode, rotation); + &ili9341_driver, mode, rotation); if (ret) return ret;