aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/omap2/dss/hdmi_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbdev/omap2/dss/hdmi_common.c')
-rw-r--r--drivers/video/fbdev/omap2/dss/hdmi_common.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/video/fbdev/omap2/dss/hdmi_common.c b/drivers/video/fbdev/omap2/dss/hdmi_common.c
index 0b12a3f62fe1..9a2c39cf297f 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi_common.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi_common.c
@@ -17,6 +17,7 @@
17 17
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/of.h>
20#include <video/omapdss.h> 21#include <video/omapdss.h>
21 22
22#include "hdmi.h" 23#include "hdmi.h"
@@ -323,6 +324,46 @@ end:
323 return cm; 324 return cm;
324} 325}
325 326
327int hdmi_parse_lanes_of(struct platform_device *pdev, struct device_node *ep,
328 struct hdmi_phy_data *phy)
329{
330 struct property *prop;
331 int r, len;
332
333 prop = of_find_property(ep, "lanes", &len);
334 if (prop) {
335 u32 lanes[8];
336
337 if (len / sizeof(u32) != ARRAY_SIZE(lanes)) {
338 dev_err(&pdev->dev, "bad number of lanes\n");
339 return -EINVAL;
340 }
341
342 r = of_property_read_u32_array(ep, "lanes", lanes,
343 ARRAY_SIZE(lanes));
344 if (r) {
345 dev_err(&pdev->dev, "failed to read lane data\n");
346 return r;
347 }
348
349 r = hdmi_phy_parse_lanes(phy, lanes);
350 if (r) {
351 dev_err(&pdev->dev, "failed to parse lane data\n");
352 return r;
353 }
354 } else {
355 static const u32 default_lanes[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
356
357 r = hdmi_phy_parse_lanes(phy, default_lanes);
358 if (WARN_ON(r)) {
359 dev_err(&pdev->dev, "failed to parse lane data\n");
360 return r;
361 }
362 }
363
364 return 0;
365}
366
326#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) 367#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
327int hdmi_compute_acr(u32 pclk, u32 sample_freq, u32 *n, u32 *cts) 368int hdmi_compute_acr(u32 pclk, u32 sample_freq, u32 *n, u32 *cts)
328{ 369{