Skip to content

Commit

Permalink
fbdev: omap/lcd: Make callbacks optional
Browse files Browse the repository at this point in the history
Most OMAP FB LCD drivers don't have anything to do in their panel
callbacks. This leads to a large set of empty boilerplate functions in the
panel drivers. Make those callbacks optional by checking if they are set
before calling them. This allows those boilerplate functions to be removed.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
  • Loading branch information
larsclausen authored and bzolnier committed Jan 30, 2017
1 parent b2c1e8a commit 561eb9d
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 183 deletions.
6 changes: 0 additions & 6 deletions drivers/video/fbdev/omap/lcd_ams_delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ static void ams_delta_panel_disable(struct lcd_panel *panel)
gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0);
}

static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}

static struct lcd_panel ams_delta_panel = {
.name = "ams-delta",
.config = 0,
Expand All @@ -163,7 +158,6 @@ static struct lcd_panel ams_delta_panel = {
.cleanup = ams_delta_panel_cleanup,
.enable = ams_delta_panel_enable,
.disable = ams_delta_panel_disable,
.get_caps = ams_delta_panel_get_caps,
};


Expand Down
17 changes: 0 additions & 17 deletions drivers/video/fbdev/omap/lcd_h3.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@

#define MODULE_NAME "omapfb-lcd_h3"

static int h3_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
{
return 0;
}

static void h3_panel_cleanup(struct lcd_panel *panel)
{
}

static int h3_panel_enable(struct lcd_panel *panel)
{
int r = 0;
Expand All @@ -63,11 +54,6 @@ static void h3_panel_disable(struct lcd_panel *panel)
pr_err(MODULE_NAME ": Unable to turn off LCD panel\n");
}

static unsigned long h3_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}

static struct lcd_panel h3_panel = {
.name = "h3",
.config = OMAP_LCDC_PANEL_TFT,
Expand All @@ -85,11 +71,8 @@ static struct lcd_panel h3_panel = {
.vbp = 0,
.pcd = 0,

.init = h3_panel_init,
.cleanup = h3_panel_cleanup,
.enable = h3_panel_enable,
.disable = h3_panel_disable,
.get_caps = h3_panel_get_caps,
};

static int h3_panel_probe(struct platform_device *pdev)
Expand Down
30 changes: 0 additions & 30 deletions drivers/video/fbdev/omap/lcd_htcherald.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,6 @@

#include "omapfb.h"

static int htcherald_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
return 0;
}

static void htcherald_panel_cleanup(struct lcd_panel *panel)
{
}

static int htcherald_panel_enable(struct lcd_panel *panel)
{
return 0;
}

static void htcherald_panel_disable(struct lcd_panel *panel)
{
}

static unsigned long htcherald_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}

/* Found on WIZ200 (miknix) and some HERA110 models (darkstar62) */
static struct lcd_panel htcherald_panel_1 = {
.name = "lcd_herald",
Expand All @@ -74,12 +50,6 @@ static struct lcd_panel htcherald_panel_1 = {
.vsw = 3,
.vfp = 2,
.vbp = 2,

.init = htcherald_panel_init,
.cleanup = htcherald_panel_cleanup,
.enable = htcherald_panel_enable,
.disable = htcherald_panel_disable,
.get_caps = htcherald_panel_get_caps,
};

static int htcherald_panel_probe(struct platform_device *pdev)
Expand Down
18 changes: 0 additions & 18 deletions drivers/video/fbdev/omap/lcd_inn1510.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@

#include "omapfb.h"

static int innovator1510_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
return 0;
}

static void innovator1510_panel_cleanup(struct lcd_panel *panel)
{
}

static int innovator1510_panel_enable(struct lcd_panel *panel)
{
__raw_writeb(0x7, OMAP1510_FPGA_LCD_PANEL_CONTROL);
Expand All @@ -48,11 +38,6 @@ static void innovator1510_panel_disable(struct lcd_panel *panel)
__raw_writeb(0x0, OMAP1510_FPGA_LCD_PANEL_CONTROL);
}

static unsigned long innovator1510_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}

static struct lcd_panel innovator1510_panel = {
.name = "inn1510",
.config = OMAP_LCDC_PANEL_TFT,
Expand All @@ -70,11 +55,8 @@ static struct lcd_panel innovator1510_panel = {
.vbp = 0,
.pcd = 12,

.init = innovator1510_panel_init,
.cleanup = innovator1510_panel_cleanup,
.enable = innovator1510_panel_enable,
.disable = innovator1510_panel_disable,
.get_caps = innovator1510_panel_get_caps,
};

static int innovator1510_panel_probe(struct platform_device *pdev)
Expand Down
6 changes: 0 additions & 6 deletions drivers/video/fbdev/omap/lcd_inn1610.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ static void innovator1610_panel_disable(struct lcd_panel *panel)
gpio_set_value(15, 0);
}

static unsigned long innovator1610_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}

static struct lcd_panel innovator1610_panel = {
.name = "inn1610",
.config = OMAP_LCDC_PANEL_TFT,
Expand All @@ -95,7 +90,6 @@ static struct lcd_panel innovator1610_panel = {
.cleanup = innovator1610_panel_cleanup,
.enable = innovator1610_panel_enable,
.disable = innovator1610_panel_disable,
.get_caps = innovator1610_panel_get_caps,
};

static int innovator1610_panel_probe(struct platform_device *pdev)
Expand Down
18 changes: 0 additions & 18 deletions drivers/video/fbdev/omap/lcd_osk.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@

#include "omapfb.h"

static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
{
/* gpio2 was allocated in board init */
return 0;
}

static void osk_panel_cleanup(struct lcd_panel *panel)
{
}

static int osk_panel_enable(struct lcd_panel *panel)
{
/* configure PWL pin */
Expand Down Expand Up @@ -68,11 +58,6 @@ static void osk_panel_disable(struct lcd_panel *panel)
gpio_set_value(2, 0);
}

static unsigned long osk_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}

static struct lcd_panel osk_panel = {
.name = "osk",
.config = OMAP_LCDC_PANEL_TFT,
Expand All @@ -90,11 +75,8 @@ static struct lcd_panel osk_panel = {
.vbp = 0,
.pcd = 12,

.init = osk_panel_init,
.cleanup = osk_panel_cleanup,
.enable = osk_panel_enable,
.disable = osk_panel_disable,
.get_caps = osk_panel_get_caps,
};

static int osk_panel_probe(struct platform_device *pdev)
Expand Down
30 changes: 0 additions & 30 deletions drivers/video/fbdev/omap/lcd_palmte.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,6 @@

#include "omapfb.h"

static int palmte_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
return 0;
}

static void palmte_panel_cleanup(struct lcd_panel *panel)
{
}

static int palmte_panel_enable(struct lcd_panel *panel)
{
return 0;
}

static void palmte_panel_disable(struct lcd_panel *panel)
{
}

static unsigned long palmte_panel_get_caps(struct lcd_panel *panel)
{
return 0;
}

static struct lcd_panel palmte_panel = {
.name = "palmte",
.config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC |
Expand All @@ -67,12 +43,6 @@ static struct lcd_panel palmte_panel = {
.vfp = 8,
.vbp = 7,
.pcd = 0,

.init = palmte_panel_init,
.cleanup = palmte_panel_cleanup,
.enable = palmte_panel_enable,
.disable = palmte_panel_disable,
.get_caps = palmte_panel_get_caps,
};

static int palmte_panel_probe(struct platform_device *pdev)
Expand Down
23 changes: 0 additions & 23 deletions drivers/video/fbdev/omap/lcd_palmtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,6 @@ GPIO13 - screen blanking

#include "omapfb.h"

static int palmtt_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
return 0;
}

static void palmtt_panel_cleanup(struct lcd_panel *panel)
{
}

static int palmtt_panel_enable(struct lcd_panel *panel)
{
return 0;
}

static void palmtt_panel_disable(struct lcd_panel *panel)
{
}

static unsigned long palmtt_panel_get_caps(struct lcd_panel *panel)
{
return OMAPFB_CAPS_SET_BACKLIGHT;
Expand All @@ -74,10 +55,6 @@ static struct lcd_panel palmtt_panel = {
.vbp = 7,
.pcd = 0,

.init = palmtt_panel_init,
.cleanup = palmtt_panel_cleanup,
.enable = palmtt_panel_enable,
.disable = palmtt_panel_disable,
.get_caps = palmtt_panel_get_caps,
};

Expand Down
24 changes: 0 additions & 24 deletions drivers/video/fbdev/omap/lcd_palmz71.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,6 @@

#include "omapfb.h"

static int palmz71_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
{
return 0;
}

static void palmz71_panel_cleanup(struct lcd_panel *panel)
{

}

static int palmz71_panel_enable(struct lcd_panel *panel)
{
return 0;
}

static void palmz71_panel_disable(struct lcd_panel *panel)
{
}

static unsigned long palmz71_panel_get_caps(struct lcd_panel *panel)
{
return OMAPFB_CAPS_SET_BACKLIGHT;
Expand All @@ -69,10 +49,6 @@ static struct lcd_panel palmz71_panel = {
.vbp = 7,
.pcd = 0,

.init = palmz71_panel_init,
.cleanup = palmz71_panel_cleanup,
.enable = palmz71_panel_enable,
.disable = palmz71_panel_disable,
.get_caps = palmz71_panel_get_caps,
};

Expand Down
Loading

0 comments on commit 561eb9d

Please sign in to comment.