video: ARM CLCD: use panel device node for panel initialization

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.

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>
This commit is contained in:
Vladimir Zapolskiy 2017-01-30 17:39:48 +01:00 committed by Bartlomiej Zolnierkiewicz
parent 69550ad23d
commit be7367968f
5 changed files with 14 additions and 27 deletions

View File

@ -214,15 +214,8 @@ static void tpg110_init(struct device *dev, struct device_node *np,
board->disable = tpg110_disable; board->disable = tpg110_disable;
} }
int nomadik_clcd_init_panel(struct clcd_fb *fb, int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel)
struct device_node *endpoint)
{ {
struct device_node *panel;
panel = of_graph_get_remote_port_parent(endpoint);
if (!panel)
return -ENODEV;
if (of_device_is_compatible(panel, "tpo,tpg110")) if (of_device_is_compatible(panel, "tpo,tpg110"))
tpg110_init(&fb->dev->dev, panel, fb->board); tpg110_init(&fb->dev->dev, panel, fb->board);
else else

View File

@ -6,8 +6,7 @@
#ifdef CONFIG_ARCH_NOMADIK #ifdef CONFIG_ARCH_NOMADIK
int nomadik_clcd_init_board(struct amba_device *adev, int nomadik_clcd_init_board(struct amba_device *adev,
struct clcd_board *board); struct clcd_board *board);
int nomadik_clcd_init_panel(struct clcd_fb *fb, int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel);
struct device_node *endpoint);
#else #else
static inline int nomadik_clcd_init_board(struct amba_device *adev, static inline int nomadik_clcd_init_board(struct amba_device *adev,
struct clcd_board *board) struct clcd_board *board)
@ -15,7 +14,7 @@ static inline int nomadik_clcd_init_board(struct amba_device *adev,
return 0; return 0;
} }
static inline int nomadik_clcd_init_panel(struct clcd_fb *fb, static inline int nomadik_clcd_init_panel(struct clcd_fb *fb,
struct device_node *endpoint) struct device_node *panel)
{ {
return 0; return 0;
} }

View File

@ -452,11 +452,9 @@ static const struct versatile_panel versatile_panels[] = {
}, },
}; };
static void versatile_panel_probe(struct device *dev, static void versatile_panel_probe(struct device *dev, struct device_node *panel)
struct device_node *endpoint)
{ {
struct versatile_panel const *vpanel = NULL; struct versatile_panel const *vpanel = NULL;
struct device_node *panel = NULL;
u32 val; u32 val;
int ret; int ret;
int i; int i;
@ -488,11 +486,6 @@ static void versatile_panel_probe(struct device *dev,
return; 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)) if (!of_device_is_compatible(panel, vpanel->compatible))
dev_err(dev, "panel in DT is not compatible with the " dev_err(dev, "panel in DT is not compatible with the "
"auto-detected panel, continuing anyway\n"); "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, int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel)
struct device_node *endpoint)
{ {
const struct of_device_id *clcd_id; const struct of_device_id *clcd_id;
enum versatile_clcd versatile_clcd_type; 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->enable = versatile_clcd_enable;
fb->board->disable = versatile_clcd_disable; fb->board->disable = versatile_clcd_disable;
fb->board->decode = versatile_clcd_decode; 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"); dev_info(dev, "set up callbacks for Versatile\n");
break; break;
case REALVIEW_CLCD_EB: case REALVIEW_CLCD_EB:

View File

@ -6,11 +6,10 @@
#include <linux/platform_data/video-clcd-versatile.h> #include <linux/platform_data/video-clcd-versatile.h>
#if defined(CONFIG_PLAT_VERSATILE_CLCD) && defined(CONFIG_OF) #if defined(CONFIG_PLAT_VERSATILE_CLCD) && defined(CONFIG_OF)
int versatile_clcd_init_panel(struct clcd_fb *fb, int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel);
struct device_node *endpoint);
#else #else
static inline int versatile_clcd_init_panel(struct clcd_fb *fb, static inline int versatile_clcd_init_panel(struct clcd_fb *fb,
struct device_node *endpoint) struct device_node *panel)
{ {
return 0; return 0;
} }

View File

@ -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) static int clcdfb_of_init_display(struct clcd_fb *fb)
{ {
struct device_node *endpoint; struct device_node *endpoint, *panel;
int err; int err;
unsigned int bpp; unsigned int bpp;
u32 max_bandwidth; u32 max_bandwidth;
@ -781,8 +781,12 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
if (!endpoint) if (!endpoint)
return -ENODEV; return -ENODEV;
panel = of_graph_get_remote_port_parent(endpoint);
if (!panel)
return -ENODEV;
if (fb->vendor->init_panel) { if (fb->vendor->init_panel) {
err = fb->vendor->init_panel(fb, endpoint); err = fb->vendor->init_panel(fb, panel);
if (err) if (err)
return err; return err;
} }