summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2017-01-30 17:39:48 +0100
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2017-01-30 17:39:48 +0100
commit6306b3a58c91806a9d9b1bf60fa66804b29beecb (patch)
treea4f0644cab2689bae892e9185c7d687e3b5daa45 /drivers/video/fbdev
parentvideo: ARM CLCD: use panel device node for panel initialization (diff)
downloadlinux-6306b3a58c91806a9d9b1bf60fa66804b29beecb.tar.xz
linux-6306b3a58c91806a9d9b1bf60fa66804b29beecb.zip
video: ARM CLCD: use panel device node for getting backlight and mode
Having obtained panel device node in clcdfb_of_init_display() it allows to generalize and simplify two more helper functions clcdfb_of_get_backlight() and clcdfb_of_get_mode(). Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/amba-clcd.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index f25b5fce9991..0fab92c62828 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -624,16 +624,11 @@ static int clcdfb_snprintf_mode(char *buf, int size, struct fb_videomode *mode)
mode->refresh);
}
-static int clcdfb_of_get_backlight(struct device_node *endpoint,
+static int clcdfb_of_get_backlight(struct device_node *panel,
struct clcd_panel *clcd_panel)
{
- struct device_node *panel;
struct device_node *backlight;
- panel = of_graph_get_remote_port_parent(endpoint);
- if (!panel)
- return -ENODEV;
-
/* Look up the optional backlight phandle */
backlight = of_parse_phandle(panel, "backlight", 0);
if (backlight) {
@@ -646,19 +641,14 @@ static int clcdfb_of_get_backlight(struct device_node *endpoint,
return 0;
}
-static int clcdfb_of_get_mode(struct device *dev, struct device_node *endpoint,
- struct clcd_panel *clcd_panel)
+static int clcdfb_of_get_mode(struct device *dev, struct device_node *panel,
+ struct clcd_panel *clcd_panel)
{
int err;
- struct device_node *panel;
struct fb_videomode *mode;
char *name;
int len;
- panel = of_graph_get_remote_port_parent(endpoint);
- if (!panel)
- return -ENODEV;
-
/* Only directly connected DPI panels supported for now */
if (of_device_is_compatible(panel, "panel-dpi"))
err = clcdfb_of_get_dpi_panel_mode(panel, clcd_panel);
@@ -791,11 +781,11 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
return err;
}
- err = clcdfb_of_get_backlight(endpoint, fb->panel);
+ err = clcdfb_of_get_backlight(panel, fb->panel);
if (err)
return err;
- err = clcdfb_of_get_mode(&fb->dev->dev, endpoint, fb->panel);
+ err = clcdfb_of_get_mode(&fb->dev->dev, panel, fb->panel);
if (err)
return err;