RE: [PATCH v3 1/2] drm: bridge: Add sii902x driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Boris,

> -----Original Message-----
> From: Boris Brezillon [mailto:boris.brezillon@xxxxxxxxxxxxxxxxxx]
> +

> +static int sii902x_bridge_attach(struct drm_bridge *bridge) {
> +	const struct drm_connector_funcs *funcs = &sii902x_connector_funcs;
> +	struct sii902x *sii902x = bridge_to_sii902x(bridge);
> +	struct drm_device *drm = bridge->dev;
> +	int ret;
> +
> +	drm_connector_helper_add(&sii902x->connector,
> +				 &sii902x_connector_helper_funcs);
> +
> +	if (drm_core_check_feature(drm, DRIVER_ATOMIC))
> +		funcs = &sii902x_atomic_connector_funcs;
> +
> +	ret = drm_connector_init(drm, &sii902x->connector, funcs,
> +				 DRM_MODE_CONNECTOR_HDMIA);
> +	if (ret)
> +		return ret;
> +


I think drm_connector_register should be used here, or drmlib can't find this connector.


> +	if (sii902x->i2c->irq > 0)
> +		sii902x->connector.polled = DRM_CONNECTOR_POLL_HPD;
> +	else
> +		sii902x->connector.polled =
> DRM_CONNECTOR_POLL_CONNECT;
> +
> +	drm_mode_connector_attach_encoder(&sii902x->connector,
> +bridge->encoder);
> +
> +	return 0;
> +}
> +

...
> +
> +static int sii902x_probe(struct i2c_client *client,
> +			 const struct i2c_device_id *id)
> +{
> +	struct device *dev = &client->dev;
> +	unsigned int status = 0;
> +	struct sii902x *sii902x;
> +	u8 chipid[4];
> +	int ret;
> +
> +	sii902x = devm_kzalloc(dev, sizeof(*sii902x), GFP_KERNEL);
> +	if (!sii902x)
> +		return -ENOMEM;
> +
> +	sii902x->i2c = client;
> +	sii902x->regmap = devm_regmap_init_i2c(client,
> &sii902x_regmap_config);
> +	if (IS_ERR(sii902x->regmap))
> +		return PTR_ERR(sii902x->regmap);
> +
> +	sii902x->reset_gpio = devm_gpiod_get(dev, "reset",
> GPIOD_OUT_LOW);
> +	if (IS_ERR(sii902x->reset_gpio)) {
> +		dev_err(dev, "Failed to retrieve/request reset gpio: %ld\n",
> +			PTR_ERR(sii902x->reset_gpio));
> +		return PTR_ERR(sii902x->reset_gpio);


Maybe we can use  "warning" instead of "dev_err" if there is no "reset_gpio" , because some board using CPLD to manage the reset order , they can't reset the HDMI chip independently.

> +	}
> +
> +	sii902x_reset(sii902x);
> +

Regards,
Meng
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux