From patchwork Fri Aug 26 02:37:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vinay Simha B N X-Patchwork-Id: 9301051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A6A1607F0 for ; Fri, 26 Aug 2016 09:38:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BEFD295C0 for ; Fri, 26 Aug 2016 09:38:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5087F295FC; Fri, 26 Aug 2016 09:38:20 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 309CC295C0 for ; Fri, 26 Aug 2016 09:38:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE0886E3BD; Fri, 26 Aug 2016 09:38:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 748486EA6A for ; Fri, 26 Aug 2016 02:37:43 +0000 (UTC) Received: by mail-pf0-x243.google.com with SMTP id h186so4108770pfg.2 for ; Thu, 25 Aug 2016 19:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zTELj8gp8UYILsAW3FOmyZUJIopPtsrQN+Sz+6SgqKw=; b=TfDK0ekAwnC1PIPbFKGbzl99yyVA9EW5GkLyw0aJ2L+Li9z2ogpLNZfz6bs+oteNl6 E/MHV/XCKt0XFhJx1iDcpZAkbvdrhxnQpwwabDbue8ZeJJx60d9ova0X05covIuV5Po5 WrXNmsOEfMIVH7kpbd6gAco9x+P6WIO9Wpwkf7ku05s7kuI3N8g6Osi3K8RQ8OtIpfEt wRz26XGAnj6NUQqHpvQ1BlXKYOSS8+LQYUD0HJi+MoIC4l9r7ecbdyeNxA+HhT6VNp3t rYS8bZ/YQtOEAcDN2MiY5RdIAxw0djk6goxJsLe7M/5p+MjPyLa6fXFC2CtJ14302wjg 190A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zTELj8gp8UYILsAW3FOmyZUJIopPtsrQN+Sz+6SgqKw=; b=Wmap3pjJRhTqQm8o/nVT1eHvYccTPV2dSkl0DL9+9PPzrealr/5Pvk2eP8cPoOzIA8 koZFoeLyQxuRn3FkAoZU2o47ve/bErDpakokkEo4oROcP/svNQ0cVg8ybp9Dtt/+wwN6 Lhk2/TDL87unDXsgO+WanoKTRZa2/LhCpl7URb0d7+ZEkqzaAEcvZKX0TH/enwXOiw1I p1XGFn9Be6Bsr1W7x+jBOI5EsXJnuBtfwfpzqvI5g2+iv2uOdqRu5dsrzHoJiYX2AEmI wKWfla54imDvg2FJOVSJ5gdximrguLCSDlltp/pA8491GRGlvWj1Jz/S1DZAfh8eGLN/ ti3g== X-Gm-Message-State: AE9vXwNXmbCzsfKsCHUa7WUeNkY1t3pTTXYAhpvKZ4R3enlwoHTAYV6BBT2eLw4BbPHGlA== X-Received: by 10.98.149.131 with SMTP id c3mr1515817pfk.73.1472179062936; Thu, 25 Aug 2016 19:37:42 -0700 (PDT) Received: from localhost.localdomain ([122.172.145.25]) by smtp.gmail.com with ESMTPSA id q4sm23842780pfb.18.2016.08.25.19.37.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Aug 2016 19:37:42 -0700 (PDT) From: Vinay Simha BN To: Subject: [PATCH v10 3/3] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel Date: Fri, 26 Aug 2016 08:07:07 +0530 Message-Id: <1472179029-9803-3-git-send-email-simhavcs@gmail.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1472179029-9803-1-git-send-email-simhavcs@gmail.com> References: <1472179029-9803-1-git-send-email-simhavcs@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 26 Aug 2016 09:38:09 +0000 Cc: Emil Velikov , open list , "open list:DRM PANEL DRIVERS" , Vinay Simha BN , Archit Taneja X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Virus-Scanned: ClamAV using ClamSMTP Add support for the JDI LT070ME05000 WUXGA DSI panel used in Nexus 7 2013 devices. Programming sequence for the panel is was originally found in the android-msm-flo-3.4-lollipop-release branch from: https://android.googlesource.com/kernel/msm.git And video mode setting is from dsi-panel-jdi-dualmipi1-video.dtsi file in: git://codeaurora.org/kernel/msm-3.10.git LNX.LA.3.6_rb1.27 Cc: Archit Taneja Cc: Rob Clark Cc: Sumit Semwal Cc: John Stultz Cc: Emil Velikov Cc: Thierry Reding Cc: David Airlie Signed-off-by: Sumit Semwal Signed-off-by: John Stultz Signed-off-by: Vinay Simha BN Tested-by: John Stultz Reviewed-by: Emil Velikov --- v1: * sumit ported to drm/panel framework, john cherry-picked to mainline, folded down other fixes from Vinay and Archit, vinay removed interface setting cmd mode, video mode panel selected v2: * incorporated code reviews from theiry, archit code style, alphabetical soring in Makefile, Kconfig, regulator_bulk, arrays of u8, generic helper function, documentation bindings, v3: * dcs backlight support added * tested this panel driver in nexus7 2013 device v4: * backlight interface added in the panel driver * incorporated width_mm and height_mm suggested by rob herring v5: * theirry review comments incorporated panel model naming consistent, alphabetical soring in Kconfig Makefile, MAX_BRIGHTNESS dropped, regulator_names, parameterize panel width and height, descprition for control display, cabc and interface setting, temporary variable removed, consistent error reporting and commit message * removed tear on/off, scanline, since these are required only for command mode panels v6: * emil review comments incorporated PANEL_NUM_REGULATORS dropped, return ret added at necessary places, if checks dropped for backlight and gpios v7: * emil review comments incorporated added ARRAY_SIZE in struct, regulator_bulk_disable in poweroff, gpios checks dropped. some returns cannot be dropped, since drm panel framework return type required. v8: * emil review commnets incorporated for jdi_panel_unprepare, dropped the returns (ref: panel-sharp-lq101r1sx01.c) and for jdi_panel_prepare(panel_on) it does not return prematurely and goes to poweroff if not success * few dev_err's for panel_init v9: * function drm_panel_create_dsi_backlight made as static v10: * proper naming conventions and sequence wrt panel datasheet (vddp-supply, iovcc-supply, enable-gpios, reset-gpios, dcdc-en-gpios) * GPIO_ACTIVE_LOW polarity logic for reset-gpios --- drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 532 +++++++++++++++++++++++++ 3 files changed, 544 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 1500ab9..62aba97 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -18,6 +18,17 @@ config DRM_PANEL_SIMPLE that it can be automatically turned off when the panel goes into a low power state. +config DRM_PANEL_JDI_LT070ME05000 + tristate "JDI LT070ME05000 WUXGA DSI panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for JDI DSI video mode + panel as found in Google Nexus 7 (2013) devices. + The panel has a 1200(RGB)×1920 (WUXGA) resolution and uses + 24 bit per pixel. + config DRM_PANEL_SAMSUNG_LD9040 tristate "Samsung LD9040 RGB/SPI panel" depends on OF && SPI diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index f277eed..a5c7ec0 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -1,4 +1,5 @@ obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o +obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += panel-panasonic-vvx10f034n00.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c new file mode 100644 index 0000000..5b2340e --- /dev/null +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -0,0 +1,532 @@ +/* + * Copyright (C) 2016 InforceComputing + * Author: Vinay Simha BN + * + * Copyright (C) 2016 Linaro Ltd + * Author: Sumit Semwal + * + * From internet archives, the panel for Nexus 7 2nd Gen, 2013 model is a + * JDI model LT070ME05000, and its data sheet is at: + * http://panelone.net/en/7-0-inch/JDI_LT070ME05000_7.0_inch-datasheet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include