[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <568CB47B.1010205@rock-chips.com>
Date: Wed, 06 Jan 2016 14:30:19 +0800
From: Mark yao <mark.yao@...k-chips.com>
To: Chris Zhong <zyw@...k-chips.com>, heiko@...ech.de,
linux-rockchip@...ts.infradead.org, treding@...dia.com
CC: linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
David Airlie <airlied@...ux.ie>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v7 3/5] drm: rockchip: Support Synopsys DW MIPI DSI
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists