From patchwork Sat Sep 30 01:43:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: crj X-Patchwork-Id: 9978985 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 06BCD6034B for ; Sat, 30 Sep 2017 01:44:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBEC228FEC for ; Sat, 30 Sep 2017 01:44:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0F9C29879; Sat, 30 Sep 2017 01:44:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7E2CF28FEC for ; Sat, 30 Sep 2017 01:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HFVGLG3KbnAdZvP69LHfIwkEVP7ZPjkhNQq4d1v/DWI=; b=cXOThpKZqtIHnN3LB5Y1MguF5h DCKF7H8ezmcH4ISaRojI+VueVf5t5fcejT+YTSl7rwQTdCwMZ2hmhC2c9SzuSNPSb+DlqVfQH/lpO 5Z2Su6e8Sz/nCXiOx79nvK7Lczvy2+w5SF3WntK53iQnyjbEtrl1OfmhpqoAiITpNo+Y84EfK5M0B +Eh5rI/QVwPJRKyi98AzFvbB6SvUqhr4KnOog5vz5mf4U/Gh11njudwIEUEF86YkEDvxxmJDTHroR SqXQLGN9cBe2TI/j1KWnJ39gIbJ4KMPILZKKTLu1rpFSBmSWvV3GCzQ/IsOk9CYfDrp9Ysol7FSXJ WS1gUcpw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dy6pR-0006Ya-6I; Sat, 30 Sep 2017 01:44:29 +0000 Received: from regular1.263xmail.com ([211.150.99.137]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dy6pM-0006UZ-W4 for linux-rockchip@lists.infradead.org; Sat, 30 Sep 2017 01:44:26 +0000 Received: from algea.cao?rock-chips.com (unknown [192.168.167.174]) by regular1.263xmail.com (Postfix) with ESMTP id 7F473DA96; Sat, 30 Sep 2017 09:44:00 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 7FE6C3DB; Sat, 30 Sep 2017 09:43:58 +0800 (CST) X-RL-SENDER: algea.cao@rock-chips.com X-FST-TO: daniel.vetter@intel.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: algea.cao@rock-chips.com X-UNIQUE-TAG: <2793df0b79e044b2bb6180b6bcfd0d82> X-ATTACHMENT-NUM: 0 X-SENDER: algea.cao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 17623UI9HH4; Sat, 30 Sep 2017 09:44:00 +0800 (CST) From: Algea Cao To: daniel.vetter@intel.com, jani.nikula@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH v2 2/7] drm/rockchip: dw_hdmi: add device type Date: Sat, 30 Sep 2017 09:43:56 +0800 Message-Id: <1506735836-151661-1-git-send-email-algea.cao@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506735713-147081-0> References: <1506735713-147081-0> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170929_184425_403684_DF4F27E4 X-CRM114-Status: UNSURE ( 6.81 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Algea Cao , yang.zheng@rock-chips.com, kever.yang@rock-chips.com, mark.yao@rock-chips.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP To determine type of SOC, we add a parameter dev_type. Signed-off-by: Algea Cao --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 5 +++++ include/drm/bridge/dw_hdmi.h | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 719452d..09c77f9 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -46,6 +46,7 @@ struct rockchip_hdmi { struct regmap *regmap; struct drm_encoder encoder; const struct rockchip_hdmi_chip_data *chip_data; + enum dw_hdmi_devtype dev_type; struct clk *vpll_clk; struct clk *grf_clk; }; @@ -305,6 +306,7 @@ static const struct dw_hdmi_plat_data rk3288_hdmi_drv_data = { .cur_ctr = rockchip_cur_ctr, .phy_config = rockchip_phy_config, .phy_data = &rk3288_chip_data, + .dev_type = RK3288_HDMI, }; static struct rockchip_hdmi_chip_data rk3399_chip_data = { @@ -315,6 +317,7 @@ static struct rockchip_hdmi_chip_data rk3399_chip_data = { static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = { .mode_valid = dw_hdmi_rockchip_mode_valid, + .dev_type = RK3328_HDMI, }; static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = { .mode_valid = dw_hdmi_rockchip_mode_valid, @@ -322,6 +325,7 @@ static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = { .cur_ctr = rockchip_cur_ctr, .phy_config = rockchip_phy_config, .phy_data = &rk3399_chip_data, + .dev_type = RK3399_HDMI, }; static const struct of_device_id dw_hdmi_rockchip_dt_ids[] = { @@ -360,6 +364,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, plat_data = match->data; hdmi->dev = &pdev->dev; hdmi->chip_data = plat_data->phy_data; + hdmi->dev_type = plat_data->dev_type; encoder = &hdmi->encoder; encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node); diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index 182f832..fdb1f0a 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -92,6 +92,15 @@ enum dw_hdmi_phy_type { DW_HDMI_PHY_VENDOR_PHY = 0xfe, }; +enum dw_hdmi_devtype { + RK3228_HDMI, + RK3288_HDMI, + RK3328_HDMI, + RK3366_HDMI, + RK3368_HDMI, + RK3399_HDMI, +}; + struct dw_hdmi_mpll_config { unsigned long mpixelclock; struct { @@ -124,6 +133,7 @@ struct dw_hdmi_phy_ops { struct dw_hdmi_plat_data { struct regmap *regm; + enum dw_hdmi_devtype dev_type; enum drm_mode_status (*mode_valid)(struct drm_connector *connector, const struct drm_display_mode *mode); unsigned long input_bus_format;