From: Vladimir Zapolskiy <vz@mleia.com>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] video: ARM CLCD: use panel device node for getting backlight and mode
Date: Wed, 21 Dec 2016 03:27:16 +0000 [thread overview]
Message-ID: <20161221032717.13154-4-vz@mleia.com> (raw)
In-Reply-To: <20161221032717.13154-1-vz@mleia.com>
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().
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
drivers/video/fbdev/amba-clcd.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index f25b5fc..0fab92c 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;
--
2.10.2
next prev parent reply other threads:[~2016-12-21 3:27 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-21 3:27 [PATCH 0/4] video: ARM CLCD: add support of an optional GPIO to enable panel Vladimir Zapolskiy
2016-12-21 3:27 ` [PATCH 1/4] video: ARM CLCD: sort included headers out alphabetically Vladimir Zapolskiy
2016-12-21 3:27 ` [PATCH 2/4] video: ARM CLCD: use panel device node for panel initialization Vladimir Zapolskiy
2016-12-21 3:27 ` Vladimir Zapolskiy [this message]
2016-12-21 3:27 ` [PATCH 4/4] video: ARM CLCD: add support of an optional GPIO to enable panel Vladimir Zapolskiy
2016-12-30 8:20 ` Linus Walleij
2016-12-30 9:24 ` Vladimir Zapolskiy
2016-12-30 8:23 ` [PATCH 0/4] " Linus Walleij
2017-01-01 20:50 ` Vladimir Zapolskiy
2017-01-02 14:22 ` Russell King - ARM Linux
2017-01-07 23:32 ` Vladimir Zapolskiy
2017-01-10 4:06 ` Vladimir Zapolskiy
2017-01-10 13:47 ` Vladimir Murzin
2017-01-11 15:16 ` Linus Walleij
2017-01-12 0:05 ` Vladimir Zapolskiy
2017-01-12 8:27 ` Linus Walleij
2017-01-12 21:26 ` Vladimir Zapolskiy
2017-01-13 11:08 ` Bartlomiej Zolnierkiewicz
2017-01-17 1:57 ` Vladimir Zapolskiy
2017-01-18 12:22 ` Linus Walleij
[not found] ` <CGME20170130152340epcas5p3f68349ef89c5ec902186ae71011c0c4b@epcas5p3.samsung.com>
2017-01-30 15:23 ` Bartlomiej Zolnierkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161221032717.13154-4-vz@mleia.com \
--to=vz@mleia.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).