Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5076680pxb; Mon, 15 Feb 2021 08:54:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxebd3cZOwUF6oH0H5zwr9eJ1M1F6Jz8oHTPCadQUX+0VXkC/2or+sRdil76pj8RdmVWSz X-Received: by 2002:a05:6402:100b:: with SMTP id c11mr16395566edu.193.1613408078014; Mon, 15 Feb 2021 08:54:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613408078; cv=none; d=google.com; s=arc-20160816; b=yo92tmvk6E9d6HDVz9HAQIRpKbmDNL6nItVX7e1aipO+QCMkWBc5LKoV9caf8FK1fX iPqYcKhBDm+jwK6Z7mt7LuvYG5qwhuWQD9Zinye9UFK0zWp6HuBqow3S8jLjgU4w84GJ ao5c86ivoh+1Exybt2554fClJK06KtsNuShz54oz5EcAJXv/U8ZCT3cm64ZK8mmK2z9h UZmF4QwiphQyQ8iKs48I8hNx3ld9yNi97rUCEPR/G6/lVhsApQS9rZsn1DdgJkFvLCpq HxMEKQlLEc5WOoqIAwa3kXYwutkLSZDi9b2qN9GmNMsd2TDb+kp6BfeqSatxG928+eO6 2R4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OyB/wT/4QgAKsVWMfjcM50Ojw0UD2ZDLkGELZ2tsRno=; b=kxH/+aTkGDh2o0IypI5f6/mlOL38mf9mRGtwW58a1TEjQaZImdx4HuWORQBzjyKM3c kmkuC44rjWOssdty4bQoTn+SYkmKI2N48GQxkbDLyzwJLi1Kipakj74GsU7ACTe1Bthq 1pIQELZrBJQE4FlK2zKtZHR+XyPtfCQB/TEhPFfBnQe8n+VRuVuAk6Q51IcAyNYqfR68 yIp2jjpzfBhwLJoBlvJ6OKNplnxjAViWep9DfkQCnxiW/2+S5Y5hW1PO2Fi7g5ePtgW3 4eykR6nPxp54c8etbk/Avz8JocwbPN3f273dI7BegShItIn5w3zvpwdiehYLZvpeBD6Q BJVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LBCRzGhj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si14264563ejo.142.2021.02.15.08.54.15; Mon, 15 Feb 2021 08:54:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LBCRzGhj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232428AbhBOQxW (ORCPT + 99 others); Mon, 15 Feb 2021 11:53:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:50212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231627AbhBOPmY (ORCPT ); Mon, 15 Feb 2021 10:42:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 62C4E64EBA; Mon, 15 Feb 2021 15:35:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613403307; bh=zRQR1UPCqdCuh9varNQfm/WRjLAk0jxD1MjBnCnwVM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LBCRzGhjlEyuMhYWfDRfK6YiW/9E9gTCm7SMMwh8rh+66eWfJa+yPyR265pixdcEx dHnJCjWOdOHZWz5jmGiYWo9340oP9oa1kMkTkp2cd52P48xXaEfDfSNol4bO3YLYUS L0V7aeGJL1TKrHLXTDc4nP7edP/Vk06EVu/Pv3+Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andre Heider , Jernej Skrabec , Maxime Ripard , Sasha Levin Subject: [PATCH 5.10 079/104] drm/sun4i: Fix H6 HDMI PHY configuration Date: Mon, 15 Feb 2021 16:27:32 +0100 Message-Id: <20210215152722.000062835@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152719.459796636@linuxfoundation.org> References: <20210215152719.459796636@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jernej Skrabec [ Upstream commit 6a155216c48f2f65c8dcb02c4c27549c170d24a9 ] As it turns out, vendor HDMI PHY driver for H6 has a pretty big table of predefined values for various pixel clocks. However, most of them are not useful/tested because they come from reference driver code. Vendor PHY driver is concerned with only few of those, namely 27 MHz, 74.25 MHz, 148.5 MHz, 297 MHz and 594 MHz. These are all frequencies for standard CEA modes. Fix sun50i_h6_cur_ctr and sun50i_h6_phy_config with the values only for aforementioned frequencies. Table sun50i_h6_mpll_cfg doesn't need to be changed because values are actually frequency dependent and not so much SoC dependent. See i.MX6 documentation for explanation of those values for similar PHY. Fixes: c71c9b2fee17 ("drm/sun4i: Add support for Synopsys HDMI PHY") Tested-by: Andre Heider Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210209175900.7092-5-jernej.skrabec@siol.net Signed-off-by: Sasha Levin --- drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c index 35c2133724e2d..9994edf675096 100644 --- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c +++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c @@ -104,29 +104,21 @@ static const struct dw_hdmi_mpll_config sun50i_h6_mpll_cfg[] = { static const struct dw_hdmi_curr_ctrl sun50i_h6_cur_ctr[] = { /* pixelclk bpp8 bpp10 bpp12 */ - { 25175000, { 0x0000, 0x0000, 0x0000 }, }, { 27000000, { 0x0012, 0x0000, 0x0000 }, }, - { 59400000, { 0x0008, 0x0008, 0x0008 }, }, - { 72000000, { 0x0008, 0x0008, 0x001b }, }, - { 74250000, { 0x0013, 0x0013, 0x0013 }, }, - { 90000000, { 0x0008, 0x001a, 0x001b }, }, - { 118800000, { 0x001b, 0x001a, 0x001b }, }, - { 144000000, { 0x001b, 0x001a, 0x0034 }, }, - { 180000000, { 0x001b, 0x0033, 0x0034 }, }, - { 216000000, { 0x0036, 0x0033, 0x0034 }, }, - { 237600000, { 0x0036, 0x0033, 0x001b }, }, - { 288000000, { 0x0036, 0x001b, 0x001b }, }, - { 297000000, { 0x0019, 0x001b, 0x0019 }, }, - { 330000000, { 0x0036, 0x001b, 0x001b }, }, - { 594000000, { 0x003f, 0x001b, 0x001b }, }, + { 74250000, { 0x0013, 0x001a, 0x001b }, }, + { 148500000, { 0x0019, 0x0033, 0x0034 }, }, + { 297000000, { 0x0019, 0x001b, 0x001b }, }, + { 594000000, { 0x0010, 0x001b, 0x001b }, }, { ~0UL, { 0x0000, 0x0000, 0x0000 }, } }; static const struct dw_hdmi_phy_config sun50i_h6_phy_config[] = { /*pixelclk symbol term vlev*/ - { 74250000, 0x8009, 0x0004, 0x0232}, - { 148500000, 0x8029, 0x0004, 0x0273}, - { 594000000, 0x8039, 0x0004, 0x014a}, + { 27000000, 0x8009, 0x0007, 0x02b0 }, + { 74250000, 0x8009, 0x0006, 0x022d }, + { 148500000, 0x8029, 0x0006, 0x0270 }, + { 297000000, 0x8039, 0x0005, 0x01ab }, + { 594000000, 0x8029, 0x0000, 0x008a }, { ~0UL, 0x0000, 0x0000, 0x0000} }; -- 2.27.0