Received: by 10.192.165.148 with SMTP id m20csp3476617imm; Mon, 23 Apr 2018 07:13:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/OWNgRV/kl+0/d0oAxI0QaanwM9BOanUaRaeXcTSCTANN1sUTBMGOH21OY1/JQzim0PT1J X-Received: by 2002:a17:902:7e46:: with SMTP id a6-v6mr21059118pln.61.1524492838884; Mon, 23 Apr 2018 07:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524492838; cv=none; d=google.com; s=arc-20160816; b=YAv6govBYy4eA2AwT0PKYOcVsJMSORUYNg/70b7PoLQg30iVcX8HWRSblmgTNRMe6K sk494kyHnDgm5P9pnBV/wrzH1JVPI9TgQWPPKzXk94gN8WgEv0ZO+WwXKEDcoqdSlLtp N8sW3+m1tVNHvZeOxGpl9A+0AzKtxkhUyIjkvBMPK4m0vl9XuCkNCjxUvtnfTsyY8LFp qJgma/DMVejJD20zlYc8bYHq3u8ymz7SLhAhiKezBvwn+yWbedb0u+ONPZ/0ubxoCj30 fPaB0hYpJzlRHZ0qpj3t9inTv5vtFf+3seoe0KZSQj+ZAcrRroAEgqesu02O/YklvJOI YO/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=EG59VTgu26BCe0Y2eKbUF8o51pNxnFwOVeC5g1xFXmE=; b=Njt5Gnn0RTAPgZcfXmFRSx7ph/o7A/gmUu86+a019psyc6d5SKVSeWbQh7eQFqjOlt vhy6yNWL1yZ4BcnG6JpcyTqJ3ilgP0LEHWQaTw6rifil6M10GjXV8+UstufweB4nxisb EHXir7INVyJKQ0laz6In077SiF+CeA3dXdhfId0UMUtdJV9auZHlz/XbM/1AigIYRsTj +t9c+qbeUE3eKbn0IXN4JCEqabvGoxOyrmDfV8nMcXMAEfDcaByd/sFF2boKr4dQe+nR do5CppnRTUgjFEZBmJNMiT5HWep3Ja3dABtwhLnFJt2p/iXpWpL0v9o6FIKk8KN9mbDh KGiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8si9710390pgc.617.2018.04.23.07.13.43; Mon, 23 Apr 2018 07:13:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755594AbeDWOLZ (ORCPT + 99 others); Mon, 23 Apr 2018 10:11:25 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:27015 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755561AbeDWOLR (ORCPT ); Mon, 23 Apr 2018 10:11:17 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w3NE4QVR001943; Mon, 23 Apr 2018 16:11:02 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2hftrwk9gh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 23 Apr 2018 16:11:02 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4E8FB31; Mon, 23 Apr 2018 14:11:02 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 307622C41; Mon, 23 Apr 2018 14:11:02 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 23 Apr 2018 16:11:01 +0200 Received: from localhost (10.201.23.32) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 23 Apr 2018 16:11:01 +0200 From: Philippe Cornu To: Thierry Reding , David Airlie , , CC: Andrzej Hajda , Yannick Fertre , Philippe Cornu , "Benjamin Gaignard" , Vincent Abriou , Alexandre Torgue Subject: [PATCH 1/4] drm/panel: otm8009a: fix backlight updates Date: Mon, 23 Apr 2018 16:10:50 +0200 Message-ID: <20180423141054.13128-2-philippe.cornu@st.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180423141054.13128-1-philippe.cornu@st.com> References: <20180423141054.13128-1-philippe.cornu@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.32] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-23_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Backlight updates was not working anymore since the good implementation of the dsi lpm mode in the dsi host driver. After a longer analysis, the backlight updates in dsi video mode require the dsi hs mode. Note: it is important to keep the dsi lpm mode for the rest of the driver as init sequence, sleep in/out... dsi commands work in lp mode. Signed-off-by: Philippe Cornu --- drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c index 90f1ae4af93c..0fd2e0144d2b 100644 --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c @@ -98,6 +98,20 @@ static void otm8009a_dcs_write_buf(struct otm8009a *ctx, const void *data, DRM_WARN("mipi dsi dcs write buffer failed\n"); } +static void otm8009a_dcs_write_buf_hs(struct otm8009a *ctx, const void *data, + size_t len) +{ + struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); + + /* data will be sent in dsi hs mode (ie. no lpm) */ + dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; + + otm8009a_dcs_write_buf(ctx, data, len); + + /* restore back the dsi lpm mode */ + dsi->mode_flags |= MIPI_DSI_MODE_LPM; +} + #define dcs_write_seq(ctx, seq...) \ ({ \ static const u8 d[] = { seq }; \ @@ -387,7 +401,7 @@ static int otm8009a_backlight_update_status(struct backlight_device *bd) */ data[0] = MIPI_DCS_SET_DISPLAY_BRIGHTNESS; data[1] = bd->props.brightness; - otm8009a_dcs_write_buf(ctx, data, ARRAY_SIZE(data)); + otm8009a_dcs_write_buf_hs(ctx, data, ARRAY_SIZE(data)); /* set Brightness Control & Backlight on */ data[1] = 0x24; @@ -399,7 +413,7 @@ static int otm8009a_backlight_update_status(struct backlight_device *bd) /* Update Brightness Control & Backlight */ data[0] = MIPI_DCS_WRITE_CONTROL_DISPLAY; - otm8009a_dcs_write_buf(ctx, data, ARRAY_SIZE(data)); + otm8009a_dcs_write_buf_hs(ctx, data, ARRAY_SIZE(data)); return 0; } -- 2.15.1