Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752409AbbGOPvo (ORCPT ); Wed, 15 Jul 2015 11:51:44 -0400 Received: from mout.gmx.net ([212.227.15.19]:57321 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752279AbbGOPvm (ORCPT ); Wed, 15 Jul 2015 11:51:42 -0400 Message-ID: <55A6817F.4000205@gmx.at> Date: Wed, 15 Jul 2015 17:51:27 +0200 From: Manfred Schlaegl User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: David Airlie , Philipp Zabel , Jean-Christophe Plagniol-Villard , Tomi Valkeinen CC: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Manfred Schlaegl , Steve Longerbeam , Deepak Das , Jiada Wang , linux-fbdev@vger.kernel.org Subject: [RFC PATCH 2/2] gpu: ipu-v3: use clock and de polarity from videomode References: <55A67FDB.8010602@gmx.at> In-Reply-To: <55A67FDB.8010602@gmx.at> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:CgOY4s3AlCk1bbfMqjczP354lapGetFVIxx6RNlk/Zvzw9g1Tz0 KTrV+UPhwb47abI+D/ODNR4JUoRpslQid2G9fpUtqMBKWQUC1tiJ/yeyl1Zc18IxUq66Ryw Cu+scZYTqofHokfPdZflptDB/cdYqMoI8wA8scMQ4NE1BHjZptVjsAIaNmCbJu8bFF4ETFD LZzGU/H41J/fS9VB4hdIQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:c1m7zBDBq9g=:8i985LrbkB/XjoP9Kevhki afZ8T1lYNY3p8FC2HuV8z7xtDv+z6uQuANKLBMPTXdv6IQzYqHlgDnr+hpGTkh/8CvFzeroZL NHU0rJG0PkZS4lGNqX2C92b96gsKv9D2XXQGatk4jmuVRotAVz/6YvzTHJC+DjoPRn7FKdQXW CIA8YseL6mTemYbZliEKh7GkGUHoZSrsPyH9PVksnFSjfFZO1BvdcXvUaLEzi5TMF8m+mvI8w yVZBPzGEt2AP3ZWRQ94WtNf8zEbzAVAZmXWAxpwzQfnX/SwXFet7hIvl6C4DffnrUkP87CSrt s2DlO56L7euYdEegWidqYSFbwC5mBjKfIPSRgcXEzwsR6GAmo7lnIC4CtsQdVhg3pzdor1OPw GzQDgSURbQ1yfbYMzDE9eb8YokzBwH14zeD75gp3Afwxjk/KRQBnylV9zWSIy/gjLkFkiCujE FFGtvyI4lsZBAJM7uH7mXox3BjtNlbYRDXUOZbLPl/mPetxvyQ/7o0FFrIvw/TJDommC/Jqx+ THBePS92djUZsCLIfqOXWfEVi4PgPAxcEg1ra2rpTpwpDx25dZPZfZGJFkFmECFC4LWxY4++e Zt7xDhrXR2W5KzLTJgK8qKAE7umvcsOuSEEifafUQbO3gRjifj8zbnt//PcGE0rRSlYOzvxRy DFkzoUM6KEK60UUBupCLijgwiaLHEAB7U8mrVvoUNZIeMaA16OJvFDhPxk8gs/kq/JnI= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3211 Lines: 91 This patch depends on "drm: add support for for clk and de polarity". Since "drm: add support for for clk and de polarity", clock and data polarity set in devicetree are passed correctly through drm_display_mode to videomode flags used by ipuv3. Removes custom configuration flags for clock and de polarities and use polarity flags from given videomode. Keeps compatibility to current settings and device tree descriptions, by setting data enable polarity to high, if not explicitly set to low by flags. display-timings resulting polarity of pixel clock past now pixelclk-active unset 0 0 pixelclk-active = 0 0 0 pixelclk-active = 1 0 1 <--- corrected display-timings resulting polarity of data enable past now de-active unset 1 1 de-active = 0 1 0 <--- corrected de-active = 1 1 1 Tested on Freescale i.MX53(parallel) and i.MX6(LVDS). Signed-off-by: Manfred Schlaegl --- drivers/gpu/drm/imx/ipuv3-crtc.c | 2 -- drivers/gpu/ipu-v3/ipu-di.c | 4 ++-- include/video/imx-ipu-v3.h | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index 7bc8301..6813271 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -172,8 +172,6 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc, else sig_cfg.clkflags = 0; - sig_cfg.enable_pol = 1; - sig_cfg.clk_pol = 0; sig_cfg.bus_format = ipu_crtc->bus_format; sig_cfg.v_to_h_sync = 0; sig_cfg.hsync_pin = ipu_crtc->di_hsync_pin; diff --git a/drivers/gpu/ipu-v3/ipu-di.c b/drivers/gpu/ipu-v3/ipu-di.c index 2970c6b..0b1a7d2 100644 --- a/drivers/gpu/ipu-v3/ipu-di.c +++ b/drivers/gpu/ipu-v3/ipu-di.c @@ -621,7 +621,7 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig) } } - if (sig->clk_pol) + if (sig->mode.flags & DISPLAY_FLAGS_PIXDATA_POSEDGE) di_gen |= DI_GEN_POLARITY_DISP_CLK; ipu_di_write(di, di_gen, DI_GENERAL); @@ -632,7 +632,7 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig) reg = ipu_di_read(di, DI_POL); reg &= ~(DI_POL_DRDY_DATA_POLARITY | DI_POL_DRDY_POLARITY_15); - if (sig->enable_pol) + if (!(sig->mode.flags & DISPLAY_FLAGS_DE_LOW)) reg |= DI_POL_DRDY_POLARITY_15; if (sig->data_pol) reg |= DI_POL_DRDY_DATA_POLARITY; diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index 85dedca..4178fa2 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -34,8 +34,6 @@ enum ipuv3_type { */ struct ipu_di_signal_cfg { unsigned data_pol:1; /* true = inverted */ - unsigned clk_pol:1; /* true = rising edge */ - unsigned enable_pol:1; struct videomode mode; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/