linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: Chris Zhong <zyw@rock-chips.com>,
	heiko@sntech.de, linux-rockchip@lists.infradead.org,
	treding@nvidia.com
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v7 3/5] drm: rockchip: Support Synopsys DW MIPI DSI
Date: Wed, 06 Jan 2016 14:30:19 +0800	[thread overview]
Message-ID: <568CB47B.1010205@rock-chips.com> (raw)
In-Reply-To: <1452053038-32098-4-git-send-email-zyw@rock-chips.com>

Hi Chris

Looks good for me except some tiny issues.


On 2016年01月06日 12:03, Chris Zhong wrote:
> +struct dw_mipi_dsi {
> +	struct drm_encoder encoder;
> +	struct drm_connector connector;
> +	struct mipi_dsi_host dsi_host;
> +	struct drm_panel *panel;
> +	struct device *dev;
> +	struct regmap *grf_regmap;
> +	void __iomem *base;
> +
> +	struct clk *pllref_clk;
> +	struct clk *pclk;
> +
> +	unsigned int lane_mbps; /* per lane */
> +	u32 channel;
> +	u32 lanes;
> +	u32 format;
> +	u16 input_div;
> +	u16 feedback_div;
> +	struct drm_display_mode *mode;
> +
> +	const struct dw_mipi_dsi_plat_data *pdata;
> +

remove this blank line.

> +};
> +

[...]

> +static void dw_mipi_dsi_encoder_mode_set(struct drm_encoder *encoder,
> +					struct drm_display_mode *mode,
> +					struct drm_display_mode *adjusted_mode)
> +{
> +	struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder);
> +	int ret;
> +
> +	dsi->mode = adjusted_mode;
> +
> +	ret = dw_mipi_dsi_get_lane_bps(dsi);
> +	if (ret < 0)
> +		return;
> +
> +	if (clk_prepare_enable(dsi->pclk)) {
> +		dev_err(dsi->dev, "%s: Failed to enable pclk\n", __func__);
> +		return;
> +	}
> +
> +	dw_mipi_dsi_init(dsi);
> +	dw_mipi_dsi_dpi_config(dsi, mode);
> +	dw_mipi_dsi_packet_handler_config(dsi);
> +	dw_mipi_dsi_video_mode_config(dsi);
> +	dw_mipi_dsi_video_packet_config(dsi, mode);
> +	dw_mipi_dsi_command_mode_config(dsi);
> +	dw_mipi_dsi_line_timer_config(dsi);
> +	dw_mipi_dsi_vertical_timing_config(dsi);
> +	dw_mipi_dsi_dphy_timing_config(dsi);
> +	dw_mipi_dsi_dphy_interface_config(dsi);
> +	dw_mipi_dsi_clear_err(dsi);
> +	if (drm_panel_prepare(dsi->panel)) {
> +		dev_err(dsi->dev, "failed to prepare panel\n");

Don't forget doing clk_disable_unprepare when run into error path.

> +		return;
> +	}
> +	clk_disable_unprepare(dsi->pclk);
> +}
> +


-- 
Mark Yao


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-01-06  6:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06  4:03 [PATCH v7 0/5] Add mipi dsi support for rk3288 Chris Zhong
2016-01-06  4:03 ` [PATCH v7 1/5] drm/rockchip: return a true clock rate to adjusted_mode Chris Zhong
2016-01-06  4:03 ` [PATCH v7 2/5] Documentation: dt-bindings: Add bindings for rk3288 DW MIPI DSI driver Chris Zhong
2016-01-06  4:03 ` [PATCH v7 3/5] drm: rockchip: Support Synopsys DW MIPI DSI Chris Zhong
2016-01-06  6:30   ` Mark yao [this message]
2016-01-06  7:12     ` [PATCH v7.1 " Chris Zhong
2016-01-06  8:12     ` [PATCH v7.2 " Chris Zhong
2016-01-06  4:03 ` [PATCH v7 4/5] ARM: dts: rockchip: add rk3288 mipi_dsi nodes Chris Zhong
     [not found]   ` <1452053038-32098-5-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-19 15:29     ` Heiko Stuebner
2016-01-20  0:50       ` Chris Zhong
     [not found] ` <1452053038-32098-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-06  4:03   ` [PATCH v7 5/5] ARM: dts: rockchip: add support mipi panel tv080wum-nl0 Chris Zhong
     [not found]     ` <1452053038-32098-6-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-19 19:26       ` Heiko Stuebner
2016-01-20  1:09         ` Chris Zhong
     [not found]           ` <569EDE2F.6060400-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-20 22:25             ` Heiko Stuebner
2016-01-06  8:39 ` [PATCH v7 0/5] Add mipi dsi support for rk3288 Mark yao
2016-02-08 10:12 ` Archit Taneja
2016-02-08 10:52   ` Heiko Stuebner
2016-02-08 12:26     ` Archit Taneja
     [not found]   ` <56B869F4.6090507-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-02-24  9:38     ` Xinliang Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=568CB47B.1010205@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=treding@nvidia.com \
    --cc=zyw@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).