From patchwork Mon Dec 17 12:36:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 10733339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0FF214DE for ; Mon, 17 Dec 2018 12:37:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0FE929DB1 for ; Mon, 17 Dec 2018 12:37:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3C4F29DA6; Mon, 17 Dec 2018 12:37:58 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 6E5F829DA6 for ; Mon, 17 Dec 2018 12:37:58 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=PsAVdWRGijYL0g1i4rs5+ueDK9l/Ppp+v/E27owGh+g=; b=PblgTtTmuC1JEk xL+ADVlg860791bZ52ozpP1+oYiI8GZx/MDWonfirWhcw3GZR8cyMBfz3qr947NH3fzBytIsL00L3 jqsrDbRFIFfPHkKvCdIPPb86av8jCQHmZYUtA8RK8YD+hQtfSGmI72TFKc9JQaFQ4Ny/DVmuze22v 8a/+5hzhER7cwfqJ1WChtdFPmd6gGXq3duhsZhl22ShPGx6C2WgufEm/k5zE+BWflpDcJUEpJsP/P 77o8ijUbBqybHI82XveGQCoyRUGNDIfVFJwS5BgXbYVPCVyB941klDk8Oy6VU8Mep35FwrstQRkvn UXYS+tppDj41OBphKhZQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gYs9h-00039e-Bj; Mon, 17 Dec 2018 12:37:53 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gYs97-0002SK-O2; Mon, 17 Dec 2018 12:37:21 +0000 Received: from wf0848.dip.tu-dresden.de ([141.76.183.80] helo=phil.dip.tu-dresden.de) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1gYs8s-0003o4-Tn; Mon, 17 Dec 2018 13:37:02 +0100 From: Heiko Stuebner To: linux-rockchip@lists.infradead.org, hjc@rock-chips.com Subject: [PATCH 06/15] drm/rockchip: analogix_dp: add support for the rk3368 variant Date: Mon, 17 Dec 2018 13:36:41 +0100 Message-Id: <20181217123650.6773-7-heiko@sntech.de> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181217123650.6773-1-heiko@sntech.de> References: <20181217123650.6773-1-heiko@sntech.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181217_043718_079641_4795AEEA X-CRM114-Status: GOOD ( 16.63 ) 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: mark.rutland@arm.com, devicetree@vger.kernel.org, architt@codeaurora.org, Heiko Stuebner , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, a.hajda@samsung.com, robh+dt@kernel.org, Laurent.pinchart@ideasonboard.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add the compatible and allow the driver to also not set any crtc input on socs that only have one vop. While that was already possible because the driver checked against the grf-reg being 0, make that var an int as "0x0" is a valid grf address itself. So standardize on -1 for "no setting needed". The dp controller behaves similar to the one found on rk3288, so we don't add a new chip_type to not overly pollute the bridge driver. Signed-off-by: Heiko Stuebner Reviewed-by: Rob Herring --- .../display/rockchip/analogix_dp-rockchip.txt | 1 + drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt index 43561584c13a..d0f7a1292355 100644 --- a/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt +++ b/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt @@ -3,6 +3,7 @@ Rockchip RK3288 specific extensions to the Analogix Display Port Required properties: - compatible: "rockchip,rk3288-dp", + "rockchip,rk3368-dp", "rockchip,rk3399-edp"; - reg: physical base address of the controller and length diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index 080f05352195..acfcffc279ea 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -54,7 +54,7 @@ * @chip_type: specific chip type */ struct rockchip_dp_chip_data { - u32 lcdsel_grf_reg; + int lcdsel_grf_reg; u32 lcdsel_big; u32 lcdsel_lit; u32 chip_type; @@ -207,9 +207,12 @@ static void rockchip_dp_drm_encoder_enable(struct drm_encoder *encoder) return; } - ret = regmap_write(dp->grf, dp->data->lcdsel_grf_reg, val); - if (ret != 0) - DRM_DEV_ERROR(dp->dev, "Could not write to GRF: %d\n", ret); + if (dp->data->lcdsel_grf_reg >= 0) { + ret = regmap_write(dp->grf, dp->data->lcdsel_grf_reg, val); + if (ret != 0) + DRM_DEV_ERROR(dp->dev, "Could not write to GRF: %d\n", + ret); + } clk_disable_unprepare(dp->grfclk); } @@ -455,8 +458,14 @@ static const struct rockchip_dp_chip_data rk3288_dp = { .chip_type = RK3288_DP, }; +static const struct rockchip_dp_chip_data rk3368_dp = { + .lcdsel_grf_reg = -1, + .chip_type = RK3288_DP, +}; + static const struct of_device_id rockchip_dp_dt_ids[] = { {.compatible = "rockchip,rk3288-dp", .data = &rk3288_dp }, + {.compatible = "rockchip,rk3368-dp", .data = &rk3368_dp }, {.compatible = "rockchip,rk3399-edp", .data = &rk3399_edp }, {} };