From patchwork Mon Dec 17 12:36:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 10733341 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 3BB3A14DE for ; Mon, 17 Dec 2018 12:38:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BFA729DA6 for ; Mon, 17 Dec 2018 12:38:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FB8529DB2; Mon, 17 Dec 2018 12:38:01 +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=ham 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 B723029DA6 for ; Mon, 17 Dec 2018 12:38:00 +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=Uncr9aIs9u4RE8PB2lrxFKMCkOsVjuqi+rmEvf0amnE=; b=Fl6ueWjl1+d/SG XGqgQJuCPBBDEeiivaVr7UrLdCnxHDtdlgDTB1p8LG5gLX7Qa477B/Ao4FFbipffZR8jBkaN9qAgh dlGehCRyxD35o3Z8vqhbwhAjfwlCrYpSNfSoPJPo9byU1NQnQvn61z40n/uU37T1L3Hww5rRZNMZa qQ8khghnAz6sLpIQLB2o2l2pFwhhO7AhxoZc8VxT2Gpqwwe6YxAnvGGT2Q9y+DZEpedQJEPPjkVk2 ZTrl4BjOyraCKs8b3fI3F4soyslGbkeB5YWCgyv/hvt+cL4xtMdrFzgkxtkEvd4IiUsGw9TEhVb62 2PMSGRbiEvtY9k/ApblQ==; 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 1gYs9j-0003DY-NP; Mon, 17 Dec 2018 12:37:55 +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-0002SN-O9; 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 1gYs8t-0003o4-8O; Mon, 17 Dec 2018 13:37:03 +0100 From: Heiko Stuebner To: linux-rockchip@lists.infradead.org, hjc@rock-chips.com Subject: [PATCH 07/15] drm/rockchip: dw-mipi-dsi: add support for rk3368-variant Date: Mon, 17 Dec 2018 13:36:42 +0100 Message-Id: <20181217123650.6773-8-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_093020_D74C3F7C X-CRM114-Status: GOOD ( 14.11 ) 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 grf values and allow the driver to also not select a specific crtc input on systems with only one vop. Signed-off-by: Heiko Stuebner Reviewed-by: Rob Herring --- .../display/rockchip/dw_mipi_dsi_rockchip.txt | 1 + .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 25 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt index 6bb59ab39f2f..869fbc256d51 100644 --- a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt +++ b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt @@ -5,6 +5,7 @@ Required properties: - #address-cells: Should be <1>. - #size-cells: Should be <0>. - compatible: "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi". + "rockchip,rk3368-mipi-dsi", "snps,dw-mipi-dsi". "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi". - reg: Represent the physical address range of the controller. - interrupts: Represent the controller's interrupt to the CPU(s). diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c index 7ee359bcee62..041647bfce71 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c @@ -142,6 +142,11 @@ #define RK3288_DSI0_LCDC_SEL BIT(6) #define RK3288_DSI1_LCDC_SEL BIT(9) +#define RK3368_GRF_SOC_CON7 0x41c +#define RK3368_DSI_TURNDISABLE BIT(5) +#define RK3368_DSI_FORCERXMODE BIT(6) +#define RK3368_DSI_FORCETXSTOPMODE (0xf << 7) + #define RK3399_GRF_SOC_CON20 0x6250 #define RK3399_DSI0_LCDC_SEL BIT(0) #define RK3399_DSI1_LCDC_SEL BIT(4) @@ -192,7 +197,7 @@ enum { struct rockchip_dw_dsi_chip_data { u32 reg; - u32 lcdsel_grf_reg; + int lcdsel_grf_reg; u32 lcdsel_big; u32 lcdsel_lit; @@ -566,7 +571,7 @@ static const struct dw_mipi_dsi_phy_ops dw_mipi_dsi_rockchip_phy_ops = { static void dw_mipi_dsi_rockchip_config(struct dw_mipi_dsi_rockchip *dsi, int mux) { - if (dsi->cdata->lcdsel_grf_reg) + if (dsi->cdata->lcdsel_grf_reg >= 0) regmap_write(dsi->grf_regmap, dsi->cdata->lcdsel_grf_reg, mux ? dsi->cdata->lcdsel_lit : dsi->cdata->lcdsel_big); @@ -1008,6 +1013,19 @@ static const struct rockchip_dw_dsi_chip_data rk3288_chip_data[] = { { /* sentinel */ } }; +static const struct rockchip_dw_dsi_chip_data rk3368_chip_data[] = { + { + .reg = 0xff960000, + .lcdsel_grf_reg = -1, + .lanecfg1_grf_reg = RK3368_GRF_SOC_CON7, + .lanecfg1 = HIWORD_UPDATE(0, RK3368_DSI_TURNDISABLE | + RK3368_DSI_FORCERXMODE | + RK3368_DSI_FORCETXSTOPMODE), + .max_data_lanes = 4, + }, + { /* sentinel */ } +}; + static const struct rockchip_dw_dsi_chip_data rk3399_chip_data[] = { { .reg = 0xff960000, @@ -1058,6 +1076,9 @@ static const struct of_device_id dw_mipi_dsi_rockchip_dt_ids[] = { { .compatible = "rockchip,rk3288-mipi-dsi", .data = &rk3288_chip_data, + }, { + .compatible = "rockchip,rk3368-mipi-dsi", + .data = &rk3368_chip_data, }, { .compatible = "rockchip,rk3399-mipi-dsi", .data = &rk3399_chip_data,