From patchwork Mon Apr 25 13:22:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 8928211 Return-Path: X-Original-To: patchwork-linux-clk@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 83C789F39D for ; Mon, 25 Apr 2016 13:24:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 918AF20114 for ; Mon, 25 Apr 2016 13:24:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 19BCB201BB for ; Mon, 25 Apr 2016 13:24:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932384AbcDYNX7 (ORCPT ); Mon, 25 Apr 2016 09:23:59 -0400 Received: from down.free-electrons.com ([37.187.137.238]:59860 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932658AbcDYNXQ (ORCPT ); Mon, 25 Apr 2016 09:23:16 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id B7DF32157; Mon, 25 Apr 2016 15:23:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id BC913182C; Mon, 25 Apr 2016 15:22:58 +0200 (CEST) From: Maxime Ripard To: Mike Turquette , Stephen Boyd , David Airlie , Chen-Yu Tsai , Rob Herring , Daniel Vetter Cc: Hans de Goede , devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, dri-devel@lists.freedesktop.org, Boris Brezillon , Thomas Petazzoni , Alexander Kaplan , Laurent Pinchart , Maxime Ripard Subject: [PATCH v4 09/11] drm: sun4i: tv: Add NTSC output standard Date: Mon, 25 Apr 2016 15:22:50 +0200 Message-Id: <1461590572-4027-10-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1461590572-4027-1-git-send-email-maxime.ripard@free-electrons.com> References: <1461590572-4027-1-git-send-email-maxime.ripard@free-electrons.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add the settings to support the NTSC standard. Signed-off-by: Maxime Ripard Reviewed-by: Boris Brezillon --- 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 ccf275a90132..bc047f923508 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tv.c +++ b/drivers/gpu/drm/sun4i/sun4i_tv.c @@ -178,24 +178,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,