Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1605981
| Path | csiph.com!feeder.erje.net!2.eu.feeder.erje.net!border1.nntp.ams1.giganews.com!nntp.giganews.com!feeds.phibee-telecom.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Sean Paul <seanpaul@chromium.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 3/4] drm/rockchip/dsi: enable the grf clk before writing grf registers |
| Date | Tue, 21 Mar 2017 21:40:02 +0100 |
| Message-ID | <tnyJs-8ra-17@gated-at.bofh.it> (permalink) |
| References | <tlRnb-l0-5@gated-at.bofh.it> <tlRnc-l0-11@gated-at.bofh.it> |
| X-Original-To | Chris Zhong <zyw@rock-chips.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FvLtSzwXpIQnn8kVgsr+OW9MR1RKZF4co4jRnoM4c8I=; b=ae1MDI87ibPR6jq4uFmevhnHPm5iFsuQ6mp25JQjigu6ieCxnhIcaB7RrcOp6bnEjO iHhog5pZE5UuswdNuRpgVGBOwPTeVNDLVb4k4vYs/XT+FJcN58MU0pwQ3vBnZKukmFgu /8cZkA/oPS93JRSMKcqcUjjMmyVE37K9fJHwc= |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FvLtSzwXpIQnn8kVgsr+OW9MR1RKZF4co4jRnoM4c8I=; b=pjxZbecsQjL3VV4m7FpDlcOkIenexyipVAp7ESbrk4dd1Yl59EGu4SJWYi2gfUmPvo 8pE54WMIPZRnjo/xUxtSP1lCJfpNy2at2U+gxYjMMAVk57F9QLp0p5j6uYGlODHP34qw u285nXxx2ab79rp8lVnqIuyLi26BiUyh3qbtQWaxEVQqdB2IZONJo52ivzA2e6KWECpx s6WoZSapPyrUpLEOSIJg17v5nKGXLmSB7vjUlhWJH4BMf12WzSby1oVxDEqAK4OQL5Dk mzx6yIqKwrynE9UL7k0kitNnTwzoqhHK+i55eKR1xYhJy5GVzQ8bIUmyKQojciwsF0hK toeQ== |
| X-Gm-Message-State | AFeK/H0jM6ZAih82tLN1hvREVKFikgRftCvZ/PNnP5Ns+8PGMYFcHozqdQfOROimanQ9Ntof |
| X-Received | by 10.55.78.88 with SMTP id c85mr36423687qkb.52.1490128240887; Tue, 21 Mar 2017 13:30:40 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.21 (2010-09-15) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 106 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org |
| X-Original-Date | Tue, 21 Mar 2017 16:30:39 -0400 |
| X-Original-Message-ID | <20170321203039.GK19389@art_vandelay> |
| X-Original-References | <1489722865-22122-1-git-send-email-zyw@rock-chips.com> <1489722865-22122-4-git-send-email-zyw@rock-chips.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1605981 |
Show key headers only | View raw
On Fri, Mar 17, 2017 at 11:54:23AM +0800, Chris Zhong wrote:
> For RK3399, the grf clk should be enabled before writing grf registers,
> otherwise the register value can not be changed.
>
> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Minor nit below, with that:
Reviewed-by: Sean Paul <seanpaul@chromium.org>
> ---
>
> Changes in v3:
> - add a DW_MIPI_NEEDS_GRF_CLK for RK3399
>
> Changes in v2:
> - check the grf_clk only for RK3399
>
> drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 26 +++++++++++++++++++++++++-
> 1 file changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
> index 68f48b0..5a18281 100644
> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
> @@ -252,6 +252,7 @@
> #define THS_ZERO_PROGRAM_EN BIT(6)
>
> #define DW_MIPI_NEEDS_PHY_CFG_CLK BIT(0)
> +#define DW_MIPI_NEEDS_GRF_CLK BIT(1)
>
> enum {
> BANDGAP_97_07,
> @@ -294,6 +295,7 @@ struct dw_mipi_dsi {
> struct regmap *grf_regmap;
> void __iomem *base;
>
> + struct clk *grf_clk;
> struct clk *pllref_clk;
> struct clk *pclk;
> struct clk *phy_cfg_clk;
> @@ -982,6 +984,17 @@ static void dw_mipi_dsi_encoder_enable(struct drm_encoder *encoder)
> dw_mipi_dsi_dphy_interface_config(dsi);
> dw_mipi_dsi_clear_err(dsi);
>
> + /*
> + * For the RK3399, the clk of grf must be enabled before writing grf
> + * register. And for RK3288 or other soc, this grf_clk must be NULL,
> + * the clk_prepare_enable return true directly.
> + */
> + ret = clk_prepare_enable(dsi->grf_clk);
> + if (ret) {
> + dev_err(dsi->dev, "Failed to enable grf_clk\n");
nit: Print ret?
> + return;
> + }
> +
> if (pdata->grf_dsi0_mode_reg)
> regmap_write(dsi->grf_regmap, pdata->grf_dsi0_mode_reg,
> pdata->grf_dsi0_mode);
> @@ -1006,6 +1019,8 @@ static void dw_mipi_dsi_encoder_enable(struct drm_encoder *encoder)
> regmap_write(dsi->grf_regmap, pdata->grf_switch_reg, val);
> dev_dbg(dsi->dev, "vop %s output to dsi0\n", (mux) ? "LIT" : "BIG");
> dsi->dpms_mode = DRM_MODE_DPMS_ON;
> +
> + clk_disable_unprepare(dsi->grf_clk);
> }
>
> static int
> @@ -1139,7 +1154,7 @@ static struct dw_mipi_dsi_plat_data rk3399_mipi_dsi_drv_data = {
> .grf_switch_reg = RK3399_GRF_SOC_CON19,
> .grf_dsi0_mode = RK3399_GRF_DSI_MODE,
> .grf_dsi0_mode_reg = RK3399_GRF_SOC_CON22,
> - .flags = DW_MIPI_NEEDS_PHY_CFG_CLK,
> + .flags = DW_MIPI_NEEDS_PHY_CFG_CLK | DW_MIPI_NEEDS_GRF_CLK,
> .max_data_lanes = 4,
> };
>
> @@ -1240,6 +1255,15 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master,
> }
> }
>
> + if (pdata->flags & DW_MIPI_NEEDS_GRF_CLK) {
> + dsi->grf_clk = devm_clk_get(dev, "grf");
> + if (IS_ERR(dsi->grf_clk)) {
> + ret = PTR_ERR(dsi->grf_clk);
> + dev_err(dev, "Unable to get grf_clk: %d\n", ret);
> + return ret;
> + }
> + }
> +
> ret = clk_prepare_enable(dsi->pllref_clk);
> if (ret) {
> dev_err(dev, "%s: Failed to enable pllref_clk\n", __func__);
> --
> 2.6.3
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Sean Paul, Software Engineer, Google / Chromium OS
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 0/4] RK3399 dw-mipi-dsi patches Chris Zhong <zyw@rock-chips.com> - 2017-03-17 05:10 +0100
[PATCH v3 4/4] drm/rockchip/dsi: correct the grf_switch_reg name Chris Zhong <zyw@rock-chips.com> - 2017-03-17 05:10 +0100
Re: [PATCH v3 4/4] drm/rockchip/dsi: correct the grf_switch_reg name Brian Norris <briannorris@chromium.org> - 2017-03-21 21:10 +0100
Re: [PATCH v3 4/4] drm/rockchip/dsi: correct the grf_switch_reg name Sean Paul <seanpaul@chromium.org> - 2017-03-21 21:20 +0100
[PATCH v3 3/4] drm/rockchip/dsi: enable the grf clk before writing grf registers Chris Zhong <zyw@rock-chips.com> - 2017-03-17 05:10 +0100
Re: [PATCH v3 3/4] drm/rockchip/dsi: enable the grf clk before writing grf registers Sean Paul <seanpaul@chromium.org> - 2017-03-21 21:40 +0100
[PATCH v3 1/4] drm/rockchip/dsi: check phy_cfg_clk only for RK3399 Chris Zhong <zyw@rock-chips.com> - 2017-03-17 05:10 +0100
Re: [PATCH v3 1/4] drm/rockchip/dsi: check phy_cfg_clk only for RK3399 Sean Paul <seanpaul@chromium.org> - 2017-03-21 21:20 +0100
Re: [PATCH v3 1/4] drm/rockchip/dsi: check phy_cfg_clk only for RK3399 Sean Paul <seanpaul@chromium.org> - 2017-03-21 21:40 +0100
[PATCH v3 2/4] dt-bindings: add the grf clock for dw-mipi-dsi Chris Zhong <zyw@rock-chips.com> - 2017-03-17 05:10 +0100
Re: [PATCH v3 2/4] dt-bindings: add the grf clock for dw-mipi-dsi Sean Paul <seanpaul@chromium.org> - 2017-03-21 21:20 +0100
Re: [PATCH v3 2/4] dt-bindings: add the grf clock for dw-mipi-dsi Sean Paul <seanpaul@chromium.org> - 2017-03-21 21:30 +0100
Re: [PATCH v3 0/4] RK3399 dw-mipi-dsi patches Brian Norris <briannorris@chromium.org> - 2017-03-21 21:10 +0100
csiph-web