From patchwork Mon Aug 5 08:58:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 170529 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4011788ile; Mon, 5 Aug 2019 01:59:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwetSzOa22QLKar/Ft68gZwy97xFSiQ4WBJ7kvTB6sf6FYkapUOEqjRJzTazQyC+wiWDYyZ X-Received: by 2002:aa7:95bb:: with SMTP id a27mr73547085pfk.229.1564995552892; Mon, 05 Aug 2019 01:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564995552; cv=none; d=google.com; s=arc-20160816; b=J0e5aVfkqwqiqjkKHRy0lhf90xxdTFAr5y1/Du3i5vlY0UXW2Xk3Ux5oxNUMUzFckL 7Pb2NIi+emtGf2/CcSmEPFQyiUXTMzGCJx48IDJxexT/xjZVQ3f6uzDbb1x4A5Oqz1Y3 DGTaXjlBA7mAteTBh/mPokmnulpheyRhSBDbMCMB0zO3fGBVOVMFg9j8GlzGM0uvcl4r eERwvH2d8QH6Ld0+6A5VaCfbGvTmPkBnDQ1L3JbWDdu8mIVS5I1PkePtCWqfe89wKocL XTb+N+fqsRTniS4e/BCsuvkHKS1S6Lg2D2uG5nO1EROimuRYXjWzyyGvG3gDlMa4mw/a 4d8A== 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:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=H+CR63GOBExgfEJc+Dc3e9jG72xNqF6vtMYPLgrQ9Gw=; b=HmQ02jt+VJyM9/F2v+WviyBCiNGAyCEExsxKNF6qZDuD0bWrKXeOdZ9jU+rVN4Sc2w QfwD1wDU25CYd7RBURW40rYswSp93wt1FaHGRmpnm7+NPK4HsmePVLLgRJBiMWimrwZf Sq7wJ+BHXQ9cVqJCXyEYNCSTuXWBVa7I+7SSOmhGSbUgJVFkrpCnnh+z+MvQbnmY/oZO 0bOV1l/SYvxi9kRtv1XEzAIdeQD71b9jr+6cHgXRBEaigJck2trOMlKviGi0uJLjwonx 4XiUbGRt3MqSEYrNGlfsueBhBkpn00hCLoWB8kIFBdySrELyxkVaPdDy8WXlS+0NpX5Y APQg== 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 2610:10:20:722:a800:ff:fe36:1795 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. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id q2si41502822plh.59.2019.08.05.01.59.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Aug 2019 01:59:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 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 C26326E373; Mon, 5 Aug 2019 08:59:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A5496E377 for ; Mon, 5 Aug 2019 08:59:10 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id z28so24408145ljn.4 for ; Mon, 05 Aug 2019 01:59:10 -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=LNyCV5nRBh8vr0if6GHpu5YY8NlSLnHE1s9JSiyGhqo=; b=TV4QEHysnEhdV7ytKEu/7+MqYDGxbDlWt2+GGpVzjZ44E8q54TK5QwpFZ9oa3r7rn8 yW4a7/4F9JUSZDufgy8gCyBK1TCp/dWotGYTekEU9H1mQJvIpMVTmgzXs7CZL51e2OT7 LrUMicIRQzG68twA/Pi5bjUCyFhaGnpR7WSr5DtYISoAA3drlyINNZXj167BYHrengmc 8eWS66Cjp2xEo7Rd/HelKjDVuv/ERroVjkWMj9WA3n+UD485NSH0sx9df+PxJ/ozyj+u HkLMZKu8uMllvh0LTMR9TgqT67VpQasq/T5Y9vK7Sn38PTB0HIBx2WZWovsfMieoF4+O qRmg== X-Gm-Message-State: APjAAAXXUT51ZhOHisxrLUrZ+QRnApuYbgiN/KvQYFicwnpxlAvP/Smh 4/ibL2Ms7BKHvfPAhAHSxkZnow== X-Received: by 2002:a2e:8515:: with SMTP id j21mr63843840lji.233.1564995548901; Mon, 05 Aug 2019 01:59:08 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id b20sm234500lfc.17.2019.08.05.01.59.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 01:59:07 -0700 (PDT) From: Linus Walleij To: Daniel Tang , Fabian Vogt Subject: [PATCH 3/4 v2] drm/panel: simple: Support TI nspire panels Date: Mon, 5 Aug 2019 10:58:46 +0200 Message-Id: <20190805085847.25554-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190805085847.25554-1-linus.walleij@linaro.org> References: <20190805085847.25554-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=LNyCV5nRBh8vr0if6GHpu5YY8NlSLnHE1s9JSiyGhqo=; b=j54Rj2XaGuAIh1QjDzcW4Ftb6/YJer99fQuk8COxqyd60VzDeuQ65d6FHyUF5S1IS8 2quTXmox5D/afUITLCaLymjqQ4HeFS6BXZQTsmTQfD8ilpFQMf1hpdO7aAHUK45hj4mW Sji83QTaCNlQhAGJ/cWfg5t+0ArDMd2imzJUlJw7V+XZtnQuEmFsF/waSfpvNhUkJ468 UsXI5DVCBel4zUwtGvG8QIO7esZQYpfyjCDb+xs6fif5FsbKJMuKjuJxtOkHNMDAeDNO x79NvYeJsVQG11B1rwQT1Rv76AIPpwFECXhDWMcjOaPelHapSXLbbAAmaaCxqOslNaoF 12Jg== 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: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This adds support for the TI nspire panels to the simple panel roster. This code is based on arch/arm/mach-nspire/clcd.c. This includes likely the first grayscale panel supported. These panels will be used with the PL11x DRM driver. Cc: Daniel Tang Cc: Fabian Vogt Tested-by: Fabian Vogt Signed-off-by: Linus Walleij Reviewed-by: Sam Ravnborg --- ChangeLog v1->v2: - Bump clock frequency to 10 MHz after Fabian's trial-and-error - Changed vsymbol names to ti_nspire_* - Sorted alphabetically - Specify positive edge on the classic display bus --- drivers/gpu/drm/panel/panel-simple.c | 64 ++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 5a93c4edf1e4..96f894b44313 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -2578,6 +2578,64 @@ static const struct panel_desc tianma_tm070rvhg71 = { .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, }; +static const struct drm_display_mode ti_nspire_cx_lcd_mode[] = { + { + .clock = 10000, + .hdisplay = 320, + .hsync_start = 320 + 50, + .hsync_end = 320 + 50 + 6, + .htotal = 320 + 50 + 6 + 38, + .vdisplay = 240, + .vsync_start = 240 + 3, + .vsync_end = 240 + 3 + 1, + .vtotal = 240 + 3 + 1 + 17, + .vrefresh = 60, + .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, + }, +}; + +static const struct panel_desc ti_nspire_cx_lcd_panel = { + .modes = ti_nspire_cx_lcd_mode, + .num_modes = 1, + .bpc = 8, + .size = { + .width = 65, + .height = 49, + }, + .bus_format = MEDIA_BUS_FMT_RGB888_1X24, + .bus_flags = DRM_BUS_FLAG_PIXDATA_NEGEDGE, +}; + +static const struct drm_display_mode ti_nspire_classic_lcd_mode[] = { + { + .clock = 10000, + .hdisplay = 320, + .hsync_start = 320 + 6, + .hsync_end = 320 + 6 + 6, + .htotal = 320 + 6 + 6 + 6, + .vdisplay = 240, + .vsync_start = 240 + 0, + .vsync_end = 240 + 0 + 1, + .vtotal = 240 + 0 + 1 + 0, + .vrefresh = 60, + .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC, + }, +}; + +static const struct panel_desc ti_nspire_classic_lcd_panel = { + .modes = ti_nspire_classic_lcd_mode, + .num_modes = 1, + /* The grayscale panel has 8 bit for the color .. Y (black) */ + .bpc = 8, + .size = { + .width = 71, + .height = 53, + }, + /* This is the grayscale bus format */ + .bus_format = MEDIA_BUS_FMT_Y8_1X8, + .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE, +}; + static const struct drm_display_mode toshiba_lt089ac29000_mode = { .clock = 79500, .hdisplay = 1280, @@ -3029,6 +3087,12 @@ static const struct of_device_id platform_of_match[] = { }, { .compatible = "tianma,tm070rvhg71", .data = &tianma_tm070rvhg71, + }, { + .compatible = "ti,nspire-cx-lcd-panel", + .data = &ti_nspire_cx_lcd_panel, + }, { + .compatible = "ti,nspire-classic-lcd-panel", + .data = &ti_nspire_classic_lcd_panel, }, { .compatible = "toshiba,lt089ac29000", .data = &toshiba_lt089ac29000,