From: Vladimir Zapolskiy <vz@mleia.com>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] video: ARM CLCD: use panel device node for panel initialization
Date: Wed, 21 Dec 2016 03:27:15 +0000 [thread overview]
Message-ID: <20161221032717.13154-3-vz@mleia.com> (raw)
In-Reply-To: <20161221032717.13154-1-vz@mleia.com>
There is no necessity to pass an endpoint device node to custom panel
initialization functions, because a child panel device node should be
sufficient, note that the existing init_panel() callback declaration from
linux/amba/clcd.h already prompts to use the panel device node here.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
drivers/video/fbdev/amba-clcd-nomadik.c | 9 +--------
drivers/video/fbdev/amba-clcd-nomadik.h | 5 ++---
drivers/video/fbdev/amba-clcd-versatile.c | 14 +++-----------
drivers/video/fbdev/amba-clcd-versatile.h | 5 ++---
drivers/video/fbdev/amba-clcd.c | 8 ++++++--
5 files changed, 14 insertions(+), 27 deletions(-)
diff --git a/drivers/video/fbdev/amba-clcd-nomadik.c b/drivers/video/fbdev/amba-clcd-nomadik.c
index 0c06fca..a9a8f75 100644
--- a/drivers/video/fbdev/amba-clcd-nomadik.c
+++ b/drivers/video/fbdev/amba-clcd-nomadik.c
@@ -214,15 +214,8 @@ static void tpg110_init(struct device *dev, struct device_node *np,
board->disable = tpg110_disable;
}
-int nomadik_clcd_init_panel(struct clcd_fb *fb,
- struct device_node *endpoint)
+int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel)
{
- struct device_node *panel;
-
- panel = of_graph_get_remote_port_parent(endpoint);
- if (!panel)
- return -ENODEV;
-
if (of_device_is_compatible(panel, "tpo,tpg110"))
tpg110_init(&fb->dev->dev, panel, fb->board);
else
diff --git a/drivers/video/fbdev/amba-clcd-nomadik.h b/drivers/video/fbdev/amba-clcd-nomadik.h
index 50aa9bd..a24032c 100644
--- a/drivers/video/fbdev/amba-clcd-nomadik.h
+++ b/drivers/video/fbdev/amba-clcd-nomadik.h
@@ -6,8 +6,7 @@
#ifdef CONFIG_ARCH_NOMADIK
int nomadik_clcd_init_board(struct amba_device *adev,
struct clcd_board *board);
-int nomadik_clcd_init_panel(struct clcd_fb *fb,
- struct device_node *endpoint);
+int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel);
#else
static inline int nomadik_clcd_init_board(struct amba_device *adev,
struct clcd_board *board)
@@ -15,7 +14,7 @@ static inline int nomadik_clcd_init_board(struct amba_device *adev,
return 0;
}
static inline int nomadik_clcd_init_panel(struct clcd_fb *fb,
- struct device_node *endpoint)
+ struct device_node *panel)
{
return 0;
}
diff --git a/drivers/video/fbdev/amba-clcd-versatile.c b/drivers/video/fbdev/amba-clcd-versatile.c
index e5d9bfc..d42047d 100644
--- a/drivers/video/fbdev/amba-clcd-versatile.c
+++ b/drivers/video/fbdev/amba-clcd-versatile.c
@@ -452,11 +452,9 @@ static const struct versatile_panel versatile_panels[] = {
},
};
-static void versatile_panel_probe(struct device *dev,
- struct device_node *endpoint)
+static void versatile_panel_probe(struct device *dev, struct device_node *panel)
{
struct versatile_panel const *vpanel = NULL;
- struct device_node *panel = NULL;
u32 val;
int ret;
int i;
@@ -488,11 +486,6 @@ static void versatile_panel_probe(struct device *dev,
return;
}
- panel = of_graph_get_remote_port_parent(endpoint);
- if (!panel) {
- dev_err(dev, "could not locate panel in DT\n");
- return;
- }
if (!of_device_is_compatible(panel, vpanel->compatible))
dev_err(dev, "panel in DT is not compatible with the "
"auto-detected panel, continuing anyway\n");
@@ -514,8 +507,7 @@ static void versatile_panel_probe(struct device *dev,
}
}
-int versatile_clcd_init_panel(struct clcd_fb *fb,
- struct device_node *endpoint)
+int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel)
{
const struct of_device_id *clcd_id;
enum versatile_clcd versatile_clcd_type;
@@ -551,7 +543,7 @@ int versatile_clcd_init_panel(struct clcd_fb *fb,
fb->board->enable = versatile_clcd_enable;
fb->board->disable = versatile_clcd_disable;
fb->board->decode = versatile_clcd_decode;
- versatile_panel_probe(dev, endpoint);
+ versatile_panel_probe(dev, panel);
dev_info(dev, "set up callbacks for Versatile\n");
break;
case REALVIEW_CLCD_EB:
diff --git a/drivers/video/fbdev/amba-clcd-versatile.h b/drivers/video/fbdev/amba-clcd-versatile.h
index 1b14359..4692c30 100644
--- a/drivers/video/fbdev/amba-clcd-versatile.h
+++ b/drivers/video/fbdev/amba-clcd-versatile.h
@@ -6,11 +6,10 @@
#include <linux/platform_data/video-clcd-versatile.h>
#if defined(CONFIG_PLAT_VERSATILE_CLCD) && defined(CONFIG_OF)
-int versatile_clcd_init_panel(struct clcd_fb *fb,
- struct device_node *endpoint);
+int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel);
#else
static inline int versatile_clcd_init_panel(struct clcd_fb *fb,
- struct device_node *endpoint)
+ struct device_node *panel)
{
return 0;
}
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index a806fb8..f25b5fc 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -764,7 +764,7 @@ static int clcdfb_of_init_tft_panel(struct clcd_fb *fb, u32 r0, u32 g0, u32 b0)
static int clcdfb_of_init_display(struct clcd_fb *fb)
{
- struct device_node *endpoint;
+ struct device_node *endpoint, *panel;
int err;
unsigned int bpp;
u32 max_bandwidth;
@@ -781,8 +781,12 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
if (!endpoint)
return -ENODEV;
+ panel = of_graph_get_remote_port_parent(endpoint);
+ if (!panel)
+ return -ENODEV;
+
if (fb->vendor->init_panel) {
- err = fb->vendor->init_panel(fb, endpoint);
+ err = fb->vendor->init_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 ` Vladimir Zapolskiy [this message]
2016-12-21 3:27 ` [PATCH 3/4] video: ARM CLCD: use panel device node for getting backlight and mode Vladimir Zapolskiy
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-3-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).