depends on OF
help
Driver for display connectors with support for DDC and hot-plug
- detection. Most display controller handle display connectors
+ detection. Most display controllers handle display connectors
internally and don't need this driver, but the DRM subsystem is
moving towards separating connector handling from display controllers
on ARM-based platforms. Saying Y here when this driver is not needed
depends on OF
select DRM_PANEL_BRIDGE
select DRM_KMS_HELPER
+ select DRM_MIPI_DSI
select REGMAP_I2C
help
Driver for Lontium LT8912B DSI to HDMI bridge
depends on OF
select DRM_PANEL_BRIDGE
select DRM_KMS_HELPER
+ select DRM_MIPI_DSI
select REGMAP_I2C
help
Driver for Lontium LT9611 DSI to HDMI bridge
depends on OF
select DRM_PANEL_BRIDGE
select DRM_KMS_HELPER
+ select DRM_MIPI_DSI
select REGMAP_I2C
help
Driver for Lontium LT9611UXC DSI to HDMI bridge
tristate "TC358762 DSI/DPI bridge"
depends on OF
select DRM_MIPI_DSI
+ select DRM_KMS_HELPER
select DRM_PANEL_BRIDGE
help
Toshiba TC358762 DSI/DPI bridge driver.
#include <linux/device.h>
#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/of_gpio.h>
{
struct gpio_desc *gp_reset;
struct device *dev = lt->dev;
- int ret = 0;
+ int ret;
+ int data_lanes;
struct device_node *port_node;
struct device_node *endpoint;
lt->gp_reset = gp_reset;
endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
- if (IS_ERR(endpoint)) {
- ret = PTR_ERR(endpoint);
- goto end;
- }
+ if (!endpoint)
+ return -ENODEV;
- lt->data_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
+ data_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
of_node_put(endpoint);
+ if (data_lanes < 0) {
+ dev_err(lt->dev, "%s: Bad data-lanes property\n", __func__);
+ return data_lanes;
+ }
+ lt->data_lanes = data_lanes;
lt->host_node = of_graph_get_remote_node(dev->of_node, 0, -1);
if (!lt->host_node) {
dev_err(lt->dev, "%s: Failed to get remote port\n", __func__);
- ret = -ENODEV;
- goto end;
+ return -ENODEV;
}
port_node = of_graph_get_remote_node(dev->of_node, 1, -1);
}
lt->hdmi_port = of_drm_find_bridge(port_node);
- if (IS_ERR(lt->hdmi_port)) {
+ if (!lt->hdmi_port) {
dev_err(lt->dev, "%s: Failed to get hdmi port\n", __func__);
- ret = PTR_ERR(lt->hdmi_port);
- of_node_put(lt->host_node);
- goto end;
+ ret = -ENODEV;
+ goto err_free_host_node;
}
if (!of_device_is_compatible(port_node, "hdmi-connector")) {
dev_err(lt->dev, "%s: Failed to get hdmi port\n", __func__);
ret = -EINVAL;
+ goto err_free_host_node;
}
of_node_put(port_node);
-
- end:
- return ret;
+ return 0;
err_free_host_node:
+ of_node_put(port_node);
of_node_put(lt->host_node);
return ret;
}