diff options
author | Vladimir Zapolskiy <vz@mleia.com> | 2017-01-30 11:39:48 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2017-01-30 11:39:48 -0500 |
commit | 6306b3a58c91806a9d9b1bf60fa66804b29beecb (patch) | |
tree | a4f0644cab2689bae892e9185c7d687e3b5daa45 | |
parent | be7367968f54b452ee221ba03458593499e040cc (diff) |
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>
-rw-r--r-- | drivers/video/fbdev/amba-clcd.c | 20 |
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) | |||
624 | mode->refresh); | 624 | mode->refresh); |
625 | } | 625 | } |
626 | 626 | ||
627 | static int clcdfb_of_get_backlight(struct device_node *endpoint, | 627 | static int clcdfb_of_get_backlight(struct device_node *panel, |
628 | struct clcd_panel *clcd_panel) | 628 | struct clcd_panel *clcd_panel) |
629 | { | 629 | { |
630 | struct device_node *panel; | ||
631 | struct device_node *backlight; | 630 | struct device_node *backlight; |
632 | 631 | ||
633 | panel = of_graph_get_remote_port_parent(endpoint); | ||
634 | if (!panel) | ||
635 | return -ENODEV; | ||
636 | |||
637 | /* Look up the optional backlight phandle */ | 632 | /* Look up the optional backlight phandle */ |
638 | backlight = of_parse_phandle(panel, "backlight", 0); | 633 | backlight = of_parse_phandle(panel, "backlight", 0); |
639 | if (backlight) { | 634 | if (backlight) { |
@@ -646,19 +641,14 @@ static int clcdfb_of_get_backlight(struct device_node *endpoint, | |||
646 | return 0; | 641 | return 0; |
647 | } | 642 | } |
648 | 643 | ||
649 | static int clcdfb_of_get_mode(struct device *dev, struct device_node *endpoint, | 644 | static int clcdfb_of_get_mode(struct device *dev, struct device_node *panel, |
650 | struct clcd_panel *clcd_panel) | 645 | struct clcd_panel *clcd_panel) |
651 | { | 646 | { |
652 | int err; | 647 | int err; |
653 | struct device_node *panel; | ||
654 | struct fb_videomode *mode; | 648 | struct fb_videomode *mode; |
655 | char *name; | 649 | char *name; |
656 | int len; | 650 | int len; |
657 | 651 | ||
658 | panel = of_graph_get_remote_port_parent(endpoint); | ||
659 | if (!panel) | ||
660 | return -ENODEV; | ||
661 | |||
662 | /* Only directly connected DPI panels supported for now */ | 652 | /* Only directly connected DPI panels supported for now */ |
663 | if (of_device_is_compatible(panel, "panel-dpi")) | 653 | if (of_device_is_compatible(panel, "panel-dpi")) |
664 | err = clcdfb_of_get_dpi_panel_mode(panel, clcd_panel); | 654 | err = clcdfb_of_get_dpi_panel_mode(panel, clcd_panel); |
@@ -791,11 +781,11 @@ static int clcdfb_of_init_display(struct clcd_fb *fb) | |||
791 | return err; | 781 | return err; |
792 | } | 782 | } |
793 | 783 | ||
794 | err = clcdfb_of_get_backlight(endpoint, fb->panel); | 784 | err = clcdfb_of_get_backlight(panel, fb->panel); |
795 | if (err) | 785 | if (err) |
796 | return err; | 786 | return err; |
797 | 787 | ||
798 | err = clcdfb_of_get_mode(&fb->dev->dev, endpoint, fb->panel); | 788 | err = clcdfb_of_get_mode(&fb->dev->dev, panel, fb->panel); |
799 | if (err) | 789 | if (err) |
800 | return err; | 790 | return err; |
801 | 791 | ||