From patchwork Fri Oct 30 14:20:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 7528011 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AD0F3BEEA4 for ; Fri, 30 Oct 2015 16:09:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C437B207E9 for ; Fri, 30 Oct 2015 16:09:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E4A91207F7 for ; Fri, 30 Oct 2015 16:09:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 220066ECF9; Fri, 30 Oct 2015 09:09:22 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by gabe.freedesktop.org (Postfix) with ESMTP id 94F086ECC0 for ; Fri, 30 Oct 2015 07:32:03 -0700 (PDT) Received: by mail.free-electrons.com (Postfix, from userid 110) id DE9DC1DC9; Fri, 30 Oct 2015 15:22:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (AToulouse-657-1-1002-69.w90-55.abo.wanadoo.fr [90.55.204.69]) by mail.free-electrons.com (Postfix) with ESMTPSA id A7C591DAF; Fri, 30 Oct 2015 15:21:16 +0100 (CET) From: Maxime Ripard To: Mike Turquette , Stephen Boyd , David Airlie , Thierry Reding Subject: [PATCH 13/19] drm: sun4i: tv: Add NTSC output standard Date: Fri, 30 Oct 2015 15:20:59 +0100 Message-Id: <1446214865-3972-14-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1446214865-3972-1-git-send-email-maxime.ripard@free-electrons.com> References: <1446214865-3972-1-git-send-email-maxime.ripard@free-electrons.com> X-Mailman-Approved-At: Fri, 30 Oct 2015 09:08:33 -0700 Cc: Thomas Petazzoni , devicetree@vger.kernel.org, Wynter Woods , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Maxime Ripard , Hans de Goede , linux-sunxi@googlegroups.com, Laurent Pinchart , Alexander Kaplan , Chen-Yu Tsai , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add the settings to support the NTSC standard. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tv.c | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c index 4b95d04ff457..b460406d744c 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tv.c +++ b/drivers/gpu/drm/sun4i/sun4i_tv.c @@ -175,24 +175,69 @@ struct sun4i_tv { struct sun4i_drv *drv; }; +struct video_levels ntsc_video_levels = { + .black = 282, .blank = 240, +}; + struct video_levels pal_video_levels = { .black = 252, .blank = 252, }; +struct burst_levels ntsc_burst_levels = { + .cb = 79, .cr = 0, +}; + struct burst_levels pal_burst_levels = { .cb = 40, .cr = 40, }; +struct color_gains ntsc_color_gains = { + .cb = 160, .cr = 160, +}; + struct color_gains pal_color_gains = { .cb = 224, .cr = 224, }; +struct resync_parameters ntsc_resync_parameters = { + .field = false, .line = 14, .pixel = 12, +}; + struct resync_parameters pal_resync_parameters = { .field = true, .line = 13, .pixel = 12, }; struct tv_mode tv_modes[] = { { + .name = "NTSC", + .mode = SUN4I_TVE_CFG0_RES_480i, + .chroma_freq = 0x21f07c1f, + .yc_en = true, + .dac3_en = true, + .dac_bit25_en = true, + + .back_porch = 118, + .front_porch = 32, + .line_number = 525, + + .hdisplay = 720, + .hfront_porch = 18, + .hsync_len = 2, + .hback_porch = 118, + + .vdisplay = 480, + .vfront_porch = 26, + .vsync_len = 2, + .vback_porch = 17, + + .vblank_level = 240, + + .color_gains = &ntsc_color_gains, + .burst_levels = &ntsc_burst_levels, + .video_levels = &ntsc_video_levels, + .resync_params = &ntsc_resync_parameters, + }, + { .name = "PAL", .mode = SUN4I_TVE_CFG0_RES_576i, .chroma_freq = 0x2a098acb,