Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion drivers/gpu/drm/rp1/rp1-dsi/rp1_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,11 @@ static const struct mipi_dsi_host_ops rp1dsi_mipi_dsi_host_ops = {
static int rp1dsi_platform_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *node = dev->of_node;
struct device_node *endpoint;
struct drm_device *drm;
struct rp1_dsi *dsi;
int i, ret;
int i, nr_lanes, ret;

drm = drm_dev_alloc(&rp1dsi_driver, dev);
if (IS_ERR(drm)) {
Expand Down Expand Up @@ -459,6 +461,12 @@ static int rp1dsi_platform_probe(struct platform_device *pdev)
}
}

endpoint = of_graph_get_endpoint_by_regs(node, 0, -1);
nr_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
if (nr_lanes > 0 && nr_lanes <= 4)
of_property_read_u32_array(endpoint, "lane-polarities",
dsi->lane_polarities, nr_lanes + 1);

for (i = 0; i < RP1DSI_NUM_HW_BLOCKS; i++) {
dsi->hw_base[i] =
devm_ioremap_resource(dev,
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/rp1/rp1-dsi/rp1_dsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ struct rp1_dsi {
/* Clocks. We need DPI clock; the others are frequency references */
struct clk *clocks[RP1DSI_NUM_CLOCKS];

/* Device tree parsed information */
u32 lane_polarities[5];

/* Block (DSI DMA, DSI Host) base addresses, and current state */
void __iomem *hw_base[RP1DSI_NUM_HW_BLOCKS];
u32 cur_fmt;
Expand Down
Loading