[PATCH v14 05/12] drm: imx: imx-hdmi: move imx-hdmi to bridge/dw_hdmi

Philipp Zabel p.zabel at pengutronix.de
Mon Dec 1 03:42:13 PST 2014


Hi Andy,

Am Montag, den 01.12.2014, 19:24 +0800 schrieb Andy Yan:
[...]
> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
> new file mode 100644
> index 0000000..1bbf3ca
> --- /dev/null
> +++ b/include/drm/bridge/dw_hdmi.h
> @@ -0,0 +1,57 @@
> +/*
> + * Copyright (C) 2011 Freescale Semiconductor, Inc.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + */
> +
> +#ifndef __DW_HDMI__
> +#define __DW_HDMI__
> +
> +#include <drm/drmP.h>
> +
> +enum {
> +	RES_8,
> +	RES_10,
> +	RES_12,
> +	RES_MAX,
> +};
> +
> +enum dw_hdmi_devtype {
> +	IMX6Q_HDMI,
> +	IMX6DL_HDMI,
> +};
> +
> +struct mpll_config {
> +	unsigned long mpixelclock;
> +	struct {
> +		u16 cpce;
> +		u16 gmp;
> +	} res[RES_MAX];
> +};
> +
> +struct curr_ctrl {
> +	unsigned long mpixelclock;
> +	u16 curr[RES_MAX];
> +};
> +
> +struct sym_term {
> +	unsigned long mpixelclock;
> +	u16 sym_ctr;    /*clock symbol and transmitter control*/
> +	u16 term;       /*transmission termination value*/
> +};

since this is going to be used by multiple drivers, the enums and
structs should all be properly namespaced. How about DW_HDMI_RES_x,
struct dw_hdmi_mpll_config, struct dw_hdmi_curr_ctrl, and struct
dw_hdmi_sym_term?

> +struct dw_hdmi_plat_data {
> +	enum dw_hdmi_devtype dev_type;
> +	const struct mpll_config *mpll_cfg;
> +	const struct curr_ctrl *cur_ctr;
> +	const struct sym_term *sym_term;
> +};
> +
> +void dw_hdmi_unbind(struct device *dev, struct device *master, void *data);
> +int dw_hdmi_bind(struct device *dev, struct device *master,
> +		 void *data, struct drm_encoder *encoder,
> +		 const struct dw_hdmi_plat_data *plat_data);
> +#endif /* __IMX_HDMI_H__ */

regards
Philipp



More information about the dri-devel mailing list