From patchwork Mon May 11 01:38:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Zhang X-Patchwork-Id: 6372811 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C047C9F32B for ; Mon, 11 May 2015 02:51:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E838F203E6 for ; Mon, 11 May 2015 02:51:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 082F1203E3 for ; Mon, 11 May 2015 02:51:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F9306E303; Sun, 10 May 2015 19:51:33 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from hqemgate15.nvidia.com (hqemgate15.nvidia.com [216.228.121.64]) by gabe.freedesktop.org (Postfix) with ESMTP id C63426E13A for ; Sun, 10 May 2015 18:38:40 -0700 (PDT) Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Sun, 10 May 2015 18:37:44 -0700 Received: from hqemhub03.nvidia.com ([172.20.12.94]) by hqnvupgp08.nvidia.com (PGP Universal service); Sun, 10 May 2015 18:36:25 -0700 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Sun, 10 May 2015 18:36:25 -0700 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQEMHUB03.nvidia.com (172.20.150.15) with Microsoft SMTP Server id 8.3.342.0; Sun, 10 May 2015 18:38:40 -0700 Received: from markz-hp6200.nvidia.com (Not Verified[10.19.224.127]) by hqnvemgw01.nvidia.com with MailMarshal (v7,1,2,5326) id ; Sun, 10 May 2015 18:38:40 -0700 From: Mark Zhang To: thierry.reding@gmail.com Subject: [RFC PATCH 06/12] drm: panel: Parse "te-polarity" in Sharp lq101r1sx01 driver Date: Mon, 11 May 2015 09:38:25 +0800 Message-ID: <1431308311-4470-7-git-send-email-markz@nvidia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431308311-4470-1-git-send-email-markz@nvidia.com> References: <1431308311-4470-1-git-send-email-markz@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 10 May 2015 19:51:30 -0700 Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Mark Zhang --- drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c index b69f88cd15b2..654575607864 100644 --- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c +++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c @@ -27,6 +27,7 @@ struct sharp_panel { struct backlight_device *backlight; struct regulator *supply; + u32 te_polarity; bool prepared; bool enabled; @@ -280,7 +281,7 @@ static int sharp_panel_enable(struct drm_panel *panel) return 0; } -static const struct drm_display_mode default_mode = { +static struct drm_display_mode default_mode = { .clock = 278000, .hdisplay = 2560, .hsync_start = 2560 + 128, @@ -297,6 +298,12 @@ static const struct drm_display_mode default_mode = { static int sharp_panel_get_modes(struct drm_panel *panel) { struct drm_display_mode *mode; + struct sharp_panel *sharp = to_sharp_panel(panel); + + if (sharp->te_polarity) + default_mode.flags |= DRM_MODE_FLAG_TE_POLARITY_HIGH; + else + default_mode.flags |= DRM_MODE_FLAG_TE_POLARITY_LOW; mode = drm_mode_duplicate(panel->drm, &default_mode); if (!mode) { @@ -341,6 +348,14 @@ static int sharp_panel_add(struct sharp_panel *sharp) if (IS_ERR(sharp->supply)) return PTR_ERR(sharp->supply); + err = of_property_read_u32(sharp->link1->dev.of_node, + "te-polarity", &sharp->te_polarity); + if (err < 0) { + dev_err(&sharp->link1->dev, + "Read te-polarity failed: %d\n", err); + return err; + } + np = of_parse_phandle(sharp->link1->dev.of_node, "backlight", 0); if (np) { sharp->backlight = of_find_backlight_by_node(np);