Lines Matching +full:r8a7795 +full:- +full:lvds

1 // SPDX-License-Identifier: GPL-2.0
3 * rcar_du_of.c - Legacy DT bindings compatibility
23 /* -----------------------------------------------------------------------------
39 .compatible = "renesas,du-" #soc, \
59 return -ENODEV; in rcar_du_of_apply_overlay()
62 return of_overlay_fdt_apply(dtb->begin, dtb->end - dtb->begin, in rcar_du_of_apply_overlay()
72 int ret = -ENOMEM; in rcar_du_of_add_property()
76 return -ENOMEM; in rcar_du_of_add_property()
78 prop->name = kstrdup(name, GFP_KERNEL); in rcar_du_of_add_property()
79 if (!prop->name) in rcar_du_of_add_property()
82 prop->value = kmemdup(value, length, GFP_KERNEL); in rcar_du_of_add_property()
83 if (!prop->value) in rcar_du_of_add_property()
88 prop->length = length; in rcar_du_of_add_property()
95 kfree(prop->value); in rcar_du_of_add_property()
96 kfree(prop->name); in rcar_du_of_add_property()
101 /* -----------------------------------------------------------------------------
102 * LVDS Overlays
105 RCAR_DU_OF_DTB(lvds, r8a7790);
106 RCAR_DU_OF_DTB(lvds, r8a7791);
107 RCAR_DU_OF_DTB(lvds, r8a7793);
108 RCAR_DU_OF_DTB(lvds, r8a7795);
109 RCAR_DU_OF_DTB(lvds, r8a7796);
112 RCAR_DU_OF_OVERLAY(lvds, r8a7790),
113 RCAR_DU_OF_OVERLAY(lvds, r8a7791),
114 RCAR_DU_OF_OVERLAY(lvds, r8a7793),
115 RCAR_DU_OF_OVERLAY(lvds, r8a7795),
116 RCAR_DU_OF_OVERLAY(lvds, r8a7796),
122 static void __init rcar_du_of_lvds_patch_one(struct device_node *lvds, in rcar_du_of_lvds_patch_one() argument
133 * Set the LVDS clocks property. This can't be performed by the overlay in rcar_du_of_lvds_patch_one()
138 if (clk->args_count >= ARRAY_SIZE(value) - 1) in rcar_du_of_lvds_patch_one()
143 value[0] = cpu_to_be32(clk->np->phandle); in rcar_du_of_lvds_patch_one()
144 for (i = 0; i < clk->args_count; ++i) in rcar_du_of_lvds_patch_one()
145 value[i + 1] = cpu_to_be32(clk->args[i]); in rcar_du_of_lvds_patch_one()
147 psize = (clk->args_count + 1) * 4; in rcar_du_of_lvds_patch_one()
148 ret = rcar_du_of_add_property(&rcar_du_lvds_changeset, lvds, in rcar_du_of_lvds_patch_one()
154 * Insert the node in the OF graph: patch the LVDS ports remote-endpoint in rcar_du_of_lvds_patch_one()
157 * overlay would contain a phandle for the DU LVDS output port that in rcar_du_of_lvds_patch_one()
159 * is board-specific. in rcar_du_of_lvds_patch_one()
161 value[0] = cpu_to_be32(local->phandle); in rcar_du_of_lvds_patch_one()
162 value[1] = cpu_to_be32(remote->phandle); in rcar_du_of_lvds_patch_one()
167 endpoint = of_graph_get_endpoint_by_regs(lvds, i, 0); in rcar_du_of_lvds_patch_one()
169 ret = -EINVAL; in rcar_du_of_lvds_patch_one()
174 endpoint, "remote-endpoint", in rcar_du_of_lvds_patch_one()
215 info = match->data; in rcar_du_of_lvds_patch()
218 if (WARN_ON(info->num_lvds > ARRAY_SIZE(lvds_data))) in rcar_du_of_lvds_patch()
222 * Skip if the LVDS nodes already exists. in rcar_du_of_lvds_patch()
230 soc_name = strchr(match->compatible, '-') + 1; in rcar_du_of_lvds_patch()
231 sprintf(compatible, "renesas,%s-lvds", soc_name); in rcar_du_of_lvds_patch()
240 * specifier and the local and remote endpoint of the LVDS link for in rcar_du_of_lvds_patch()
243 for (i = 0; i < info->num_lvds; ++i) { in rcar_du_of_lvds_patch()
244 struct lvds_of_data *lvds = &lvds_data[i]; in rcar_du_of_lvds_patch() local
249 sprintf(name, "lvds.%u", i); in rcar_du_of_lvds_patch()
250 index = of_property_match_string(du_node, "clock-names", name); in rcar_du_of_lvds_patch()
255 "#clock-cells", index, in rcar_du_of_lvds_patch()
256 &lvds->clkspec); in rcar_du_of_lvds_patch()
260 port = info->routes[RCAR_DU_OUTPUT_LVDS0 + i].port; in rcar_du_of_lvds_patch()
262 lvds->local = of_graph_get_endpoint_by_regs(du_node, port, 0); in rcar_du_of_lvds_patch()
263 if (!lvds->local) in rcar_du_of_lvds_patch()
266 lvds->remote = of_graph_get_remote_endpoint(lvds->local); in rcar_du_of_lvds_patch()
267 if (!lvds->remote) in rcar_du_of_lvds_patch()
270 index = of_property_match_string(du_node, "reg-names", name); in rcar_du_of_lvds_patch()
274 of_address_to_resource(du_node, index, &lvds->res); in rcar_du_of_lvds_patch()
279 match->compatible); in rcar_du_of_lvds_patch()
283 /* Patch the newly created LVDS encoder nodes. */ in rcar_du_of_lvds_patch()
303 /* Patch the LVDS encoder. */ in rcar_du_of_lvds_patch()
310 for (i = 0; i < info->num_lvds; ++i) { in rcar_du_of_lvds_patch()