MLK-17275-7 drm/bridge: adv7511: Add dsi-channel property
Add a new property "adi,dsi-channel" to allow the user specify the DSI channel to be used when communicating with DSI peripheral. Signed-off-by: Robert Chiras <robert.chiras@nxp.com> Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
369b5f06ac
commit
1bdc9083f7
|
@ -80,6 +80,8 @@ Optional properties:
|
||||||
- reg-names : Names of maps with programmable addresses.
|
- reg-names : Names of maps with programmable addresses.
|
||||||
It can contain any map needing a non-default address.
|
It can contain any map needing a non-default address.
|
||||||
Possible maps names are : "main", "edid", "cec", "packet"
|
Possible maps names are : "main", "edid", "cec", "packet"
|
||||||
|
- adi,dsi-channel: Only for ADV7533 and ADV7535. DSI channel number to be used
|
||||||
|
when communicating with the DSI peripheral. It should be one of 0, 1, 2 or 3.
|
||||||
|
|
||||||
Required nodes:
|
Required nodes:
|
||||||
|
|
||||||
|
|
|
@ -366,6 +366,7 @@ struct adv7511 {
|
||||||
struct device_node *host_node;
|
struct device_node *host_node;
|
||||||
struct mipi_dsi_device *dsi;
|
struct mipi_dsi_device *dsi;
|
||||||
u8 num_dsi_lanes;
|
u8 num_dsi_lanes;
|
||||||
|
u8 channel_id;
|
||||||
bool use_timing_gen;
|
bool use_timing_gen;
|
||||||
|
|
||||||
enum adv7511_type type;
|
enum adv7511_type type;
|
||||||
|
|
|
@ -143,7 +143,7 @@ int adv7533_attach_dsi(struct adv7511 *adv)
|
||||||
struct mipi_dsi_device *dsi;
|
struct mipi_dsi_device *dsi;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
const struct mipi_dsi_device_info info = { .type = "adv7533",
|
const struct mipi_dsi_device_info info = { .type = "adv7533",
|
||||||
.channel = 0,
|
.channel = adv->channel_id,
|
||||||
.node = NULL,
|
.node = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -189,14 +189,24 @@ void adv7533_detach_dsi(struct adv7511 *adv)
|
||||||
|
|
||||||
int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv)
|
int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv)
|
||||||
{
|
{
|
||||||
u32 num_lanes;
|
struct device *dev = &adv->i2c_main->dev;
|
||||||
|
u32 num_lanes = 0, channel_id = 0;
|
||||||
|
|
||||||
|
of_property_read_u32(np, "adi,dsi-channel", &channel_id);
|
||||||
of_property_read_u32(np, "adi,dsi-lanes", &num_lanes);
|
of_property_read_u32(np, "adi,dsi-lanes", &num_lanes);
|
||||||
|
|
||||||
if (num_lanes < 1 || num_lanes > 4)
|
if (num_lanes < 1 || num_lanes > 4) {
|
||||||
|
dev_err(dev, "Invalid dsi-lanes: %d\n", num_lanes);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (channel_id > 3) {
|
||||||
|
dev_err(dev, "Invalid dsi-channel: %d\n", channel_id);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
adv->num_dsi_lanes = num_lanes;
|
adv->num_dsi_lanes = num_lanes;
|
||||||
|
adv->channel_id = channel_id;
|
||||||
|
|
||||||
adv->host_node = of_graph_get_remote_node(np, 0, 0);
|
adv->host_node = of_graph_get_remote_node(np, 0, 0);
|
||||||
if (!adv->host_node)
|
if (!adv->host_node)
|
||||||
|
|
Loading…
Reference in New Issue