* Re: [PATCH RESEND v2 2/2] drivers/video: fsl-diu-fb: fix bugs in interrupt handling
From: Andrew Morton @ 2013-02-13 0:54 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1360308959-3096-2-git-send-email-agust@denx.de>
On Fri, 8 Feb 2013 08:35:59 +0100
Anatolij Gustschin <agust@denx.de> wrote:
> Since commit f74de500 "drivers/video: fsl-diu-fb: streamline
> enabling of interrupts" the interrupt handling in the driver
> is broken. Enabling diu interrupt causes an interrupt storm and
> results in system lockup.
>
> The cookie for the interrupt handler function passed to request_irq()
> is wrong (it must be a pointer to the diu struct, and not the address
> of the pointer to the diu struct). As a result the interrupt handler
> can not read diu registers and acknowledge the interrupt. Fix cookie
> arguments for request_irq() and free_irq().
>
> Registering the diu interrupt handler in probe() must happen before
> install_fb() calls since this function registers framebuffer devices
> and if fbcon tries to take over framebuffer after registering a frame
> buffer device, it will call fb_open of the diu driver and enable the
> interrupts. At this time the diu interrupt handler must be registered
> already.
>
> Disabling the interrupts in fsl_diu_release() must happen only if all
> other AOIs are closed. Otherwise closing an overlay plane will disable
> the interrupts even if the primary frame buffer plane is opened. Add
> an appropriate check in the release function.
>
> ...
>
> This patch fixes a regression, it should be included in v3.8 since
> without it all mpc512x based boards (with DIU support enabled) do not
> boot
Thanks, I queued both these with a plan to merge into 3.9-rc1. I
tagged the patches with "Cc: <stable@vger.kernel.org>" so they should
get backported into 3.8.1 and possibly earlier kernels. Sound OK?
^ permalink raw reply
* Re: [PATCH RESEND v2 2/2] drivers/video: fsl-diu-fb: fix bugs in interrupt handling
From: Andrew Morton @ 2013-02-13 1:01 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1360308959-3096-2-git-send-email-agust@denx.de>
On Tue, 12 Feb 2013 16:54:58 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:
> Thanks, I queued both these with a plan to merge into 3.9-rc1.
No I didn't. The patches have already found their way into linux-next
via some other tree.
Without any -stable tags, either. You don't think we should fix the
"24 and 16 bpp" thing in 3.8.x and earlier?
^ permalink raw reply
* Re: [PATCH v2 0/1] OMAP4: DSS: Add panel for Blaze Tablet boards
From: Tomi Valkeinen @ 2013-02-13 8:18 UTC (permalink / raw)
To: Ruslan Bilovol
Cc: andi, FlorianSchandinat, linux-fbdev, linux-kernel, linux-omap
In-Reply-To: <1360338220-12753-1-git-send-email-ruslan.bilovol@ti.com>
[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]
Hi,
On 2013-02-08 17:43, Ruslan Bilovol wrote:
> Hi,
>
> This patch adds support for TC358765 DSI-to-LVDS transmitter
> from Toshiba, that is used in OMAP4 Blaze Tablet development
> platform. It was originally developed a long time ago and
> was used internally survived few kernel migrations.
> Different people worked in this driver during last two
> years changing its sources to what each new version of
> kernel expects.
>
> Current version is ported from internal kernel v3.4 to 3.8.0-rc6
> Tested basic functioning under busybox.
Thanks for updating the driver to a recent kernel.
I didn't review the patch line by line, but with a brief look it looks
fine. However, I'm not quite sure what to do with this patch.
The problem is that the driver is a combined driver for the TC358765
chip and the panel on Blaze Tablet, and we are very much trying to fix
that design issue so that the drivers for the chip and panel could be
separate, as they should.
So I fear that if I now accept the patch, it'll increase my burden of
managing the display drivers during this design rework. Furthermore, to
my knowledge the Blaze Tablet is quite a rare board, and it's not even
supported in the mainline kernel, so this driver wouldn't be usable by
itself.
So if I'm right about the blaze tablet status, I'm inclined to say that
I think this should be still kept out of tree.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]
^ permalink raw reply
* Re: [PATCH RESEND v2 2/2] drivers/video: fsl-diu-fb: fix bugs in interrupt handling
From: Anatolij Gustschin @ 2013-02-13 9:21 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1360308959-3096-2-git-send-email-agust@denx.de>
On Tue, 12 Feb 2013 17:01:55 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:
> On Tue, 12 Feb 2013 16:54:58 -0800
> Andrew Morton <akpm@linux-foundation.org> wrote:
>
> > Thanks, I queued both these with a plan to merge into 3.9-rc1.
>
> No I didn't. The patches have already found their way into linux-next
> via some other tree.
Yes, via MPC5XXX tree. Since I didn't receive response from fbdev
maintainer I applied both patches in my powerpc MPC5XXX next branch
so that these can be exposed in linux-next at least. MPC5121 uses the
fsl-diu-fb driver, so these patches could go via MPC5XXX tree, but I
can't push them via my tree without an ACK from fbdev maintainer.
> Without any -stable tags, either. You don't think we should fix the
> "24 and 16 bpp" thing in 3.8.x and earlier?
I didn't add any -stable tags since my hope was that the patches
will go into v3.8 via fbdev tree. It would be good to fix the bpp
issue in 3.8.x. But the issue is not critical for earlier maintained
stable versions I think.
Thanks,
Anatolij
^ permalink raw reply
* [PATCH 0/5] Cleanups and fixes for the Himax HX8357
From: Maxime Ripard @ 2013-02-13 10:40 UTC (permalink / raw)
To: linux-fbdev
Hi,
This patchset does minor cleanups and fixes as suggested in private by
Joe Perches to the HX8357 LCD driver.
Thanks,
Maxime
Maxime Ripard (5):
fb: hx8357: Change parameters of the write function to u8
fb: hx8357: Fix inverted parameters for kcalloc
fb: hx8357: Remove useless error message
fb: hx8357: Remove trailing period
fb: hx8357: Use static arrays for LCD configuration
drivers/video/backlight/hx8357.c | 187 ++++++++++++++++++++------------------
1 file changed, 101 insertions(+), 86 deletions(-)
--
1.7.10.4
^ permalink raw reply
* [PATCH 1/5] fb: hx8357: Change parameters of the write function to u8
From: Maxime Ripard @ 2013-02-13 10:40 UTC (permalink / raw)
To: linux-fbdev
Cc: joe, Andrew Morton, Richard Purdie, Florian Tobias Schandinat,
linux-kernel
In-Reply-To: <1360752028-7301-1-git-send-email-maxime.ripard@free-electrons.com>
Moving from void* to u8* removes the need for castslater on in the
function.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/video/backlight/hx8357.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c
index 00925c0..071525c 100644
--- a/drivers/video/backlight/hx8357.c
+++ b/drivers/video/backlight/hx8357.c
@@ -79,8 +79,8 @@ struct hx8357_data {
};
static int hx8357_spi_write_then_read(struct lcd_device *lcdev,
- void *txbuf, u16 txlen,
- void *rxbuf, u16 rxlen)
+ u8 *txbuf, u16 txlen,
+ u8 *rxbuf, u16 rxlen)
{
struct hx8357_data *lcd = lcd_get_data(lcdev);
struct spi_message msg;
@@ -102,7 +102,7 @@ static int hx8357_spi_write_then_read(struct lcd_device *lcdev,
}
for (i = 0; i < txlen; i++) {
- local_txbuf[i] = ((u8 *)txbuf)[i];
+ local_txbuf[i] = txbuf[i];
if (i > 0)
local_txbuf[i] |= 1 << 8;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 2/5] fb: hx8357: Fix inverted parameters for kcalloc
From: Maxime Ripard @ 2013-02-13 10:40 UTC (permalink / raw)
To: linux-fbdev
Cc: joe, Andrew Morton, Richard Purdie, Florian Tobias Schandinat,
linux-kernel
In-Reply-To: <1360752028-7301-1-git-send-email-maxime.ripard@free-electrons.com>
The element size and the number of elements was inverted in the kcalloc
call.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/video/backlight/hx8357.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c
index 071525c..2691fd6 100644
--- a/drivers/video/backlight/hx8357.c
+++ b/drivers/video/backlight/hx8357.c
@@ -94,7 +94,7 @@ static int hx8357_spi_write_then_read(struct lcd_device *lcdev,
if (txlen) {
int i;
- local_txbuf = kcalloc(sizeof(*local_txbuf), txlen, GFP_KERNEL);
+ local_txbuf = kcalloc(txlen, sizeof(*local_txbuf), GFP_KERNEL);
if (!local_txbuf) {
dev_err(&lcdev->dev, "Couldn't allocate data buffer.\n");
--
1.7.10.4
^ permalink raw reply related
* [PATCH 3/5] fb: hx8357: Remove useless error message
From: Maxime Ripard @ 2013-02-13 10:40 UTC (permalink / raw)
To: linux-fbdev
Cc: joe, Andrew Morton, Richard Purdie, Florian Tobias Schandinat,
linux-kernel
In-Reply-To: <1360752028-7301-1-git-send-email-maxime.ripard@free-electrons.com>
In case of a failing allocation, a dump stack will be printed anyway, so
the dev_err is redundant.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/video/backlight/hx8357.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c
index 2691fd6..7c82561 100644
--- a/drivers/video/backlight/hx8357.c
+++ b/drivers/video/backlight/hx8357.c
@@ -96,10 +96,8 @@ static int hx8357_spi_write_then_read(struct lcd_device *lcdev,
local_txbuf = kcalloc(txlen, sizeof(*local_txbuf), GFP_KERNEL);
- if (!local_txbuf) {
- dev_err(&lcdev->dev, "Couldn't allocate data buffer.\n");
+ if (!local_txbuf)
return -ENOMEM;
- }
for (i = 0; i < txlen; i++) {
local_txbuf[i] = txbuf[i];
--
1.7.10.4
^ permalink raw reply related
* [PATCH 4/5] fb: hx8357: Remove trailing period
From: Maxime Ripard @ 2013-02-13 10:40 UTC (permalink / raw)
To: linux-fbdev
Cc: joe, Andrew Morton, Richard Purdie, Florian Tobias Schandinat,
linux-kernel
In-Reply-To: <1360752028-7301-1-git-send-email-maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/video/backlight/hx8357.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c
index 7c82561..6da8ebe 100644
--- a/drivers/video/backlight/hx8357.c
+++ b/drivers/video/backlight/hx8357.c
@@ -120,7 +120,7 @@ static int hx8357_spi_write_then_read(struct lcd_device *lcdev,
ret = spi_sync(lcd->spi, &msg);
if (ret < 0)
- dev_err(&lcdev->dev, "Couldn't send SPI data.\n");
+ dev_err(&lcdev->dev, "Couldn't send SPI data\n");
if (txlen)
kfree(local_txbuf);
--
1.7.10.4
^ permalink raw reply related
* [PATCH 5/5] fb: hx8357: Use static arrays for LCD configuration
From: Maxime Ripard @ 2013-02-13 10:40 UTC (permalink / raw)
To: linux-fbdev
Cc: joe, Andrew Morton, Richard Purdie, Florian Tobias Schandinat,
linux-kernel
In-Reply-To: <1360752028-7301-1-git-send-email-maxime.ripard@free-electrons.com>
This allows a smaller and less error-prone code by using static arrays
and the ARRAY_SIZE macro.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/video/backlight/hx8357.c | 173 +++++++++++++++++++++-----------------
1 file changed, 95 insertions(+), 78 deletions(-)
diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c
index 6da8ebe..a0482b5 100644
--- a/drivers/video/backlight/hx8357.c
+++ b/drivers/video/backlight/hx8357.c
@@ -78,6 +78,71 @@ struct hx8357_data {
int state;
};
+static u8 hx8357_seq_power[] = {
+ HX8357_SET_POWER, 0x44, 0x41, 0x06,
+};
+
+static u8 hx8357_seq_vcom[] = {
+ HX8357_SET_VCOM, 0x40, 0x10,
+};
+
+static u8 hx8357_seq_power_normal[] = {
+ HX8357_SET_POWER_NORMAL, 0x05, 0x12,
+};
+
+static u8 hx8357_seq_panel_driving[] = {
+ HX8357_SET_PANEL_DRIVING, 0x14, 0x3b, 0x00, 0x02, 0x11,
+};
+
+static u8 hx8357_seq_display_frame[] = {
+ HX8357_SET_DISPLAY_FRAME, 0x0c,
+};
+
+static u8 hx8357_seq_panel_related[] = {
+ HX8357_SET_PANEL_RELATED, 0x01,
+};
+
+static u8 hx8357_seq_undefined1[] = {
+ 0xea, 0x03, 0x00, 0x00,
+};
+
+static u8 hx8357_seq_undefined2[] = {
+ 0xeb, 0x40, 0x54, 0x26, 0xdb,
+};
+
+static u8 hx8357_seq_gamma[] = {
+ HX8357_SET_GAMMA, 0x00, 0x15, 0x00, 0x22, 0x00,
+ 0x08, 0x77, 0x26, 0x77, 0x22, 0x04, 0x00,
+};
+
+static u8 hx8357_seq_address_mode[] = {
+ HX8357_SET_ADDRESS_MODE, 0xc0,
+};
+
+static u8 hx8357_seq_pixel_format[] = {
+ HX8357_SET_PIXEL_FORMAT,
+ HX8357_SET_PIXEL_FORMAT_DPI_18BIT |
+ HX8357_SET_PIXEL_FORMAT_DBI_18BIT,
+};
+
+static u8 hx8357_seq_column_address[] = {
+ HX8357_SET_COLUMN_ADDRESS, 0x00, 0x00, 0x01, 0x3f,
+};
+
+static u8 hx8357_seq_page_address[] = {
+ HX8357_SET_PAGE_ADDRESS, 0x00, 0x00, 0x01, 0xdf,
+};
+
+static u8 hx8357_seq_rgb[] = {
+ HX8357_SET_RGB, 0x02,
+};
+
+static u8 hx8357_seq_display_mode[] = {
+ HX8357_SET_DISPLAY_MODE,
+ HX8357_SET_DISPLAY_MODE_RGB_THROUGH |
+ HX8357_SET_DISPLAY_MODE_RGB_INTERFACE,
+};
+
static int hx8357_spi_write_then_read(struct lcd_device *lcdev,
u8 *txbuf, u16 txlen,
u8 *rxbuf, u16 rxlen)
@@ -179,7 +244,6 @@ static int hx8357_exit_standby(struct lcd_device *lcdev)
static int hx8357_lcd_init(struct lcd_device *lcdev)
{
struct hx8357_data *lcd = lcd_get_data(lcdev);
- u8 buf[16];
int ret;
/*
@@ -198,125 +262,78 @@ static int hx8357_lcd_init(struct lcd_device *lcdev)
gpio_set_value(lcd->reset, 1);
msleep(120);
- buf[0] = HX8357_SET_POWER;
- buf[1] = 0x44;
- buf[2] = 0x41;
- buf[3] = 0x06;
- ret = hx8357_spi_write_array(lcdev, buf, 4);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_power,
+ ARRAY_SIZE(hx8357_seq_power));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_VCOM;
- buf[1] = 0x40;
- buf[2] = 0x10;
- ret = hx8357_spi_write_array(lcdev, buf, 3);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_vcom,
+ ARRAY_SIZE(hx8357_seq_vcom));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_POWER_NORMAL;
- buf[1] = 0x05;
- buf[2] = 0x12;
- ret = hx8357_spi_write_array(lcdev, buf, 3);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_power_normal,
+ ARRAY_SIZE(hx8357_seq_power_normal));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_PANEL_DRIVING;
- buf[1] = 0x14;
- buf[2] = 0x3b;
- buf[3] = 0x00;
- buf[4] = 0x02;
- buf[5] = 0x11;
- ret = hx8357_spi_write_array(lcdev, buf, 6);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_panel_driving,
+ ARRAY_SIZE(hx8357_seq_panel_driving));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_DISPLAY_FRAME;
- buf[1] = 0x0c;
- ret = hx8357_spi_write_array(lcdev, buf, 2);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_display_frame,
+ ARRAY_SIZE(hx8357_seq_display_frame));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_PANEL_RELATED;
- buf[1] = 0x01;
- ret = hx8357_spi_write_array(lcdev, buf, 2);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_panel_related,
+ ARRAY_SIZE(hx8357_seq_panel_related));
if (ret < 0)
return ret;
- buf[0] = 0xea;
- buf[1] = 0x03;
- buf[2] = 0x00;
- buf[3] = 0x00;
- ret = hx8357_spi_write_array(lcdev, buf, 4);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_undefined1,
+ ARRAY_SIZE(hx8357_seq_undefined1));
if (ret < 0)
return ret;
- buf[0] = 0xeb;
- buf[1] = 0x40;
- buf[2] = 0x54;
- buf[3] = 0x26;
- buf[4] = 0xdb;
- ret = hx8357_spi_write_array(lcdev, buf, 5);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_undefined2,
+ ARRAY_SIZE(hx8357_seq_undefined2));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_GAMMA;
- buf[1] = 0x00;
- buf[2] = 0x15;
- buf[3] = 0x00;
- buf[4] = 0x22;
- buf[5] = 0x00;
- buf[6] = 0x08;
- buf[7] = 0x77;
- buf[8] = 0x26;
- buf[9] = 0x77;
- buf[10] = 0x22;
- buf[11] = 0x04;
- buf[12] = 0x00;
- ret = hx8357_spi_write_array(lcdev, buf, 13);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_gamma,
+ ARRAY_SIZE(hx8357_seq_gamma));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_ADDRESS_MODE;
- buf[1] = 0xc0;
- ret = hx8357_spi_write_array(lcdev, buf, 2);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_address_mode,
+ ARRAY_SIZE(hx8357_seq_address_mode));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_PIXEL_FORMAT;
- buf[1] = HX8357_SET_PIXEL_FORMAT_DPI_18BIT |
- HX8357_SET_PIXEL_FORMAT_DBI_18BIT;
- ret = hx8357_spi_write_array(lcdev, buf, 2);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_pixel_format,
+ ARRAY_SIZE(hx8357_seq_pixel_format));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_COLUMN_ADDRESS;
- buf[1] = 0x00;
- buf[2] = 0x00;
- buf[3] = 0x01;
- buf[4] = 0x3f;
- ret = hx8357_spi_write_array(lcdev, buf, 5);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_column_address,
+ ARRAY_SIZE(hx8357_seq_column_address));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_PAGE_ADDRESS;
- buf[1] = 0x00;
- buf[2] = 0x00;
- buf[3] = 0x01;
- buf[4] = 0xdf;
- ret = hx8357_spi_write_array(lcdev, buf, 5);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_page_address,
+ ARRAY_SIZE(hx8357_seq_page_address));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_RGB;
- buf[1] = 0x02;
- ret = hx8357_spi_write_array(lcdev, buf, 2);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_rgb,
+ ARRAY_SIZE(hx8357_seq_rgb));
if (ret < 0)
return ret;
- buf[0] = HX8357_SET_DISPLAY_MODE;
- buf[1] = HX8357_SET_DISPLAY_MODE_RGB_THROUGH |
- HX8357_SET_DISPLAY_MODE_RGB_INTERFACE;
- ret = hx8357_spi_write_array(lcdev, buf, 2);
+ ret = hx8357_spi_write_array(lcdev, hx8357_seq_display_mode,
+ ARRAY_SIZE(hx8357_seq_display_mode));
if (ret < 0)
return ret;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 00/11] OMAPDSS: Misc cleanups
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
These patches perform cleanups which will help the omapdss driver to migrate
to DT more easily:
- omapdss panel drivers call platform specific backlight functions defined in
board files. These callbacks are removed. Setting of max backlight level
in the board file is also removed.
- other misc changes which thin down the omap_dss_device struct by removing
some unnecessary fields.
- usage of devm_kzalloc in panel drivers.
Reference branch:
git://gitorious.org/~boddob/linux-omap-dss2/archit-dss2-clone.git for-3.9/misc_cleanups
Archit Taneja (7):
OMAPDSS: ZOOM/NEC-nl8048hl11: remove platform backlight support
OMAPDSS: Generic DPI Panel: use devm_kzalloc for allocating driver
data
OMAPDSS: lb035q02: use devm_kzalloc for allocating driver data
OMAPDSS: picodlp: use devm_kzalloc for allocating driver data
OMAPDSS: remove unnecessary DSI external TE pin platform info from
omap_dss_device
OMAPDSS: panel acx565akm: remove omap_dss_device maximum backlight
level usage
OMAPDSS: Remove max_backlight_level form omap_dss_device
Tomi Valkeinen (4):
OMAPDSS: acx565akm: remove platform backlight calls
OMAPDSS: ls037v7dw01: remove platform backlight calls
OMAPDSS: n8x0: remove platform backlight calls
OMAPDSS: remove set_backlight/get_backlight function ptrs
arch/arm/mach-omap2/board-zoom-display.c | 2 -
drivers/video/omap2/displays/panel-acx565akm.c | 11 +--
drivers/video/omap2/displays/panel-generic-dpi.c | 6 +-
.../omap2/displays/panel-lgphilips-lb035q02.c | 16 ++---
drivers/video/omap2/displays/panel-n8x0.c | 74 --------------------
.../omap2/displays/panel-nec-nl8048hl11-01b.c | 74 --------------------
drivers/video/omap2/displays/panel-picodlp.c | 16 ++---
.../video/omap2/displays/panel-sharp-ls037v7dw01.c | 62 ----------------
include/video/omap-panel-n8x0.h | 2 -
include/video/omapdss.h | 7 --
10 files changed, 14 insertions(+), 256 deletions(-)
--
1.7.9.5
^ permalink raw reply
* [PATCH 01/11] OMAPDSS: acx565akm: remove platform backlight calls
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
acx565akm has support to call set_backlight/get_backlight in platform
code. They are not used by any board, and thus can be removed from the
driver.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/displays/panel-acx565akm.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-acx565akm.c b/drivers/video/omap2/displays/panel-acx565akm.c
index 72699f8..a980a11 100644
--- a/drivers/video/omap2/displays/panel-acx565akm.c
+++ b/drivers/video/omap2/displays/panel-acx565akm.c
@@ -336,8 +336,6 @@ static int acx565akm_bl_update_status(struct backlight_device *dev)
r = 0;
if (md->has_bc)
acx565akm_set_brightness(md, level);
- else if (md->dssdev->set_backlight)
- r = md->dssdev->set_backlight(md->dssdev, level);
else
r = -ENODEV;
@@ -352,7 +350,7 @@ static int acx565akm_bl_get_intensity(struct backlight_device *dev)
dev_dbg(&dev->dev, "%s\n", __func__);
- if (!md->has_bc && md->dssdev->set_backlight = NULL)
+ if (!md->has_bc)
return -ENODEV;
if (dev->props.fb_blank = FB_BLANK_UNBLANK &&
@@ -564,8 +562,6 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
if (md->has_bc)
brightness = acx565akm_get_actual_brightness(md);
- else if (dssdev->get_backlight)
- brightness = dssdev->get_backlight(dssdev);
else
brightness = 0;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 02/11] OMAPDSS: ls037v7dw01: remove platform backlight calls
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
Sharp ls037v7dw01 driver contains support to call platform backlight
functions. These are not used by any board, and can be removed.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
---
.../video/omap2/displays/panel-sharp-ls037v7dw01.c | 62 --------------------
1 file changed, 62 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
index cada8c6..eb6bd81 100644
--- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
@@ -20,7 +20,6 @@
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/device.h>
-#include <linux/backlight.h>
#include <linux/fb.h>
#include <linux/err.h>
#include <linux/slab.h>
@@ -28,7 +27,6 @@
#include <video/omapdss.h>
struct sharp_data {
- struct backlight_device *bl;
};
static struct omap_video_timings sharp_ls_timings = {
@@ -52,45 +50,10 @@ static struct omap_video_timings sharp_ls_timings = {
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES,
};
-static int sharp_ls_bl_update_status(struct backlight_device *bl)
-{
- struct omap_dss_device *dssdev = dev_get_drvdata(&bl->dev);
- int level;
-
- if (!dssdev->set_backlight)
- return -EINVAL;
-
- if (bl->props.fb_blank = FB_BLANK_UNBLANK &&
- bl->props.power = FB_BLANK_UNBLANK)
- level = bl->props.brightness;
- else
- level = 0;
-
- return dssdev->set_backlight(dssdev, level);
-}
-
-static int sharp_ls_bl_get_brightness(struct backlight_device *bl)
-{
- if (bl->props.fb_blank = FB_BLANK_UNBLANK &&
- bl->props.power = FB_BLANK_UNBLANK)
- return bl->props.brightness;
-
- return 0;
-}
-
-static const struct backlight_ops sharp_ls_bl_ops = {
- .get_brightness = sharp_ls_bl_get_brightness,
- .update_status = sharp_ls_bl_update_status,
-};
-
-
static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
{
- struct backlight_properties props;
- struct backlight_device *bl;
struct sharp_data *sd;
- int r;
dssdev->panel.timings = sharp_ls_timings;
@@ -100,37 +63,12 @@ static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
dev_set_drvdata(&dssdev->dev, sd);
- memset(&props, 0, sizeof(struct backlight_properties));
- props.max_brightness = dssdev->max_backlight_level;
- props.type = BACKLIGHT_RAW;
-
- bl = backlight_device_register("sharp-ls", &dssdev->dev, dssdev,
- &sharp_ls_bl_ops, &props);
- if (IS_ERR(bl)) {
- r = PTR_ERR(bl);
- kfree(sd);
- return r;
- }
- sd->bl = bl;
-
- bl->props.fb_blank = FB_BLANK_UNBLANK;
- bl->props.power = FB_BLANK_UNBLANK;
- bl->props.brightness = dssdev->max_backlight_level;
- r = sharp_ls_bl_update_status(bl);
- if (r < 0)
- dev_err(&dssdev->dev, "failed to set lcd brightness\n");
-
return 0;
}
static void __exit sharp_ls_panel_remove(struct omap_dss_device *dssdev)
{
struct sharp_data *sd = dev_get_drvdata(&dssdev->dev);
- struct backlight_device *bl = sd->bl;
-
- bl->props.power = FB_BLANK_POWERDOWN;
- sharp_ls_bl_update_status(bl);
- backlight_device_unregister(bl);
kfree(sd);
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH 03/11] OMAPDSS: ZOOM/NEC-nl8048hl11: remove platform backlight support
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja, Tony Lindgren
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
omap_dss_device provides a callback function to set backlight. Panel backlight
on Zoom board is implemented by the function zoom_set_bl_intensity() in the
board file. This needs to be removed. The PWM backlight should be implemented
with the pwm_bl driver.
For now, function zoom_set_bl_intensity() is left as is, but omap_dss_device's
set_backlight func pointer and max_brightness_level are removed. NEC-nl8048hl11
panel driver contains support to call platform backlight functions. These are
not used any more in zoom and are now removed.
Signed-off-by: Archit Taneja <archit@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/board-zoom-display.c | 2 -
.../omap2/displays/panel-nec-nl8048hl11-01b.c | 74 --------------------
2 files changed, 76 deletions(-)
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
index 1c7c834..4717ed5 100644
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ b/arch/arm/mach-omap2/board-zoom-display.c
@@ -109,8 +109,6 @@ static struct omap_dss_device zoom_lcd_device = {
.phy.dpi.data_lines = 24,
.platform_enable = zoom_panel_enable_lcd,
.platform_disable = zoom_panel_disable_lcd,
- .max_backlight_level = 100,
- .set_backlight = zoom_set_bl_intensity,
};
static struct omap_dss_device *zoom_dss_devices[] = {
diff --git a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
index c4e9c2b..c197927 100644
--- a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
+++ b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
@@ -19,7 +19,6 @@
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/spi/spi.h>
-#include <linux/backlight.h>
#include <linux/fb.h>
#include <video/omapdss.h>
@@ -33,7 +32,6 @@
#define LCD_PIXEL_CLOCK 23800
struct nec_8048_data {
- struct backlight_device *bl;
};
static const struct {
@@ -84,43 +82,9 @@ static struct omap_video_timings nec_8048_panel_timings = {
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE,
};
-static int nec_8048_bl_update_status(struct backlight_device *bl)
-{
- struct omap_dss_device *dssdev = dev_get_drvdata(&bl->dev);
- int level;
-
- if (!dssdev->set_backlight)
- return -EINVAL;
-
- if (bl->props.fb_blank = FB_BLANK_UNBLANK &&
- bl->props.power = FB_BLANK_UNBLANK)
- level = bl->props.brightness;
- else
- level = 0;
-
- return dssdev->set_backlight(dssdev, level);
-}
-
-static int nec_8048_bl_get_brightness(struct backlight_device *bl)
-{
- if (bl->props.fb_blank = FB_BLANK_UNBLANK &&
- bl->props.power = FB_BLANK_UNBLANK)
- return bl->props.brightness;
-
- return 0;
-}
-
-static const struct backlight_ops nec_8048_bl_ops = {
- .get_brightness = nec_8048_bl_get_brightness,
- .update_status = nec_8048_bl_update_status,
-};
-
static int nec_8048_panel_probe(struct omap_dss_device *dssdev)
{
- struct backlight_device *bl;
struct nec_8048_data *necd;
- struct backlight_properties props;
- int r;
dssdev->panel.timings = nec_8048_panel_timings;
@@ -130,38 +94,12 @@ static int nec_8048_panel_probe(struct omap_dss_device *dssdev)
dev_set_drvdata(&dssdev->dev, necd);
- memset(&props, 0, sizeof(struct backlight_properties));
- props.max_brightness = 255;
-
- bl = backlight_device_register("nec-8048", &dssdev->dev, dssdev,
- &nec_8048_bl_ops, &props);
- if (IS_ERR(bl)) {
- r = PTR_ERR(bl);
- kfree(necd);
- return r;
- }
- necd->bl = bl;
-
- bl->props.fb_blank = FB_BLANK_UNBLANK;
- bl->props.power = FB_BLANK_UNBLANK;
- bl->props.max_brightness = dssdev->max_backlight_level;
- bl->props.brightness = dssdev->max_backlight_level;
-
- r = nec_8048_bl_update_status(bl);
- if (r < 0)
- dev_err(&dssdev->dev, "failed to set lcd brightness\n");
-
return 0;
}
static void nec_8048_panel_remove(struct omap_dss_device *dssdev)
{
struct nec_8048_data *necd = dev_get_drvdata(&dssdev->dev);
- struct backlight_device *bl = necd->bl;
-
- bl->props.power = FB_BLANK_POWERDOWN;
- nec_8048_bl_update_status(bl);
- backlight_device_unregister(bl);
kfree(necd);
}
@@ -169,8 +107,6 @@ static void nec_8048_panel_remove(struct omap_dss_device *dssdev)
static int nec_8048_panel_power_on(struct omap_dss_device *dssdev)
{
int r;
- struct nec_8048_data *necd = dev_get_drvdata(&dssdev->dev);
- struct backlight_device *bl = necd->bl;
if (dssdev->state = OMAP_DSS_DISPLAY_ACTIVE)
return 0;
@@ -188,10 +124,6 @@ static int nec_8048_panel_power_on(struct omap_dss_device *dssdev)
goto err1;
}
- r = nec_8048_bl_update_status(bl);
- if (r < 0)
- dev_err(&dssdev->dev, "failed to set lcd brightness\n");
-
return 0;
err1:
omapdss_dpi_display_disable(dssdev);
@@ -201,15 +133,9 @@ err0:
static void nec_8048_panel_power_off(struct omap_dss_device *dssdev)
{
- struct nec_8048_data *necd = dev_get_drvdata(&dssdev->dev);
- struct backlight_device *bl = necd->bl;
-
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return;
- bl->props.brightness = 0;
- nec_8048_bl_update_status(bl);
-
if (dssdev->platform_disable)
dssdev->platform_disable(dssdev);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 04/11] OMAPDSS: n8x0: remove platform backlight calls
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
The n8x0 panel contains support to call platform backlight functions.
These are not used by any board, and can be removed.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/displays/panel-n8x0.c | 74 -----------------------------
include/video/omap-panel-n8x0.h | 2 -
2 files changed, 76 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c
index dd12947..b750480 100644
--- a/drivers/video/omap2/displays/panel-n8x0.c
+++ b/drivers/video/omap2/displays/panel-n8x0.c
@@ -5,7 +5,6 @@
#include <linux/slab.h>
#include <linux/gpio.h>
#include <linux/spi/spi.h>
-#include <linux/backlight.h>
#include <linux/fb.h>
#include <video/omapdss.h>
@@ -69,7 +68,6 @@ static struct panel_drv_data {
struct omap_dss_device *dssdev;
struct spi_device *spidev;
- struct backlight_device *bldev;
int blizzard_ver;
} s_drv_data;
@@ -424,55 +422,10 @@ static const struct rfbi_timings n8x0_panel_timings = {
.cs_pulse_width = 0,
};
-static int n8x0_bl_update_status(struct backlight_device *dev)
-{
- struct omap_dss_device *dssdev = dev_get_drvdata(&dev->dev);
- struct panel_n8x0_data *bdata = get_board_data(dssdev);
- struct panel_drv_data *ddata = get_drv_data(dssdev);
- int r;
- int level;
-
- mutex_lock(&ddata->lock);
-
- if (dev->props.fb_blank = FB_BLANK_UNBLANK &&
- dev->props.power = FB_BLANK_UNBLANK)
- level = dev->props.brightness;
- else
- level = 0;
-
- dev_dbg(&dssdev->dev, "update brightness to %d\n", level);
-
- if (!bdata->set_backlight)
- r = -EINVAL;
- else
- r = bdata->set_backlight(dssdev, level);
-
- mutex_unlock(&ddata->lock);
-
- return r;
-}
-
-static int n8x0_bl_get_intensity(struct backlight_device *dev)
-{
- if (dev->props.fb_blank = FB_BLANK_UNBLANK &&
- dev->props.power = FB_BLANK_UNBLANK)
- return dev->props.brightness;
-
- return 0;
-}
-
-static const struct backlight_ops n8x0_bl_ops = {
- .get_brightness = n8x0_bl_get_intensity,
- .update_status = n8x0_bl_update_status,
-};
-
static int n8x0_panel_probe(struct omap_dss_device *dssdev)
{
struct panel_n8x0_data *bdata = get_board_data(dssdev);
struct panel_drv_data *ddata;
- struct backlight_device *bldev;
- struct backlight_properties props;
- int r;
dev_dbg(&dssdev->dev, "probe\n");
@@ -491,40 +444,13 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev)
dssdev->ctrl.rfbi_timings = n8x0_panel_timings;
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
- memset(&props, 0, sizeof(props));
- props.max_brightness = 127;
- props.type = BACKLIGHT_PLATFORM;
- bldev = backlight_device_register(dev_name(&dssdev->dev), &dssdev->dev,
- dssdev, &n8x0_bl_ops, &props);
- if (IS_ERR(bldev)) {
- r = PTR_ERR(bldev);
- dev_err(&dssdev->dev, "register backlight failed\n");
- return r;
- }
-
- ddata->bldev = bldev;
-
- bldev->props.fb_blank = FB_BLANK_UNBLANK;
- bldev->props.power = FB_BLANK_UNBLANK;
- bldev->props.brightness = 127;
-
- n8x0_bl_update_status(bldev);
-
return 0;
}
static void n8x0_panel_remove(struct omap_dss_device *dssdev)
{
- struct panel_drv_data *ddata = get_drv_data(dssdev);
- struct backlight_device *bldev;
-
dev_dbg(&dssdev->dev, "remove\n");
- bldev = ddata->bldev;
- bldev->props.power = FB_BLANK_POWERDOWN;
- n8x0_bl_update_status(bldev);
- backlight_device_unregister(bldev);
-
dev_set_drvdata(&dssdev->dev, NULL);
}
diff --git a/include/video/omap-panel-n8x0.h b/include/video/omap-panel-n8x0.h
index 50a1302..9cc69c8 100644
--- a/include/video/omap-panel-n8x0.h
+++ b/include/video/omap-panel-n8x0.h
@@ -8,8 +8,6 @@ struct panel_n8x0_data {
void (*platform_disable)(struct omap_dss_device *dssdev);
int panel_reset;
int ctrl_pwrdown;
-
- int (*set_backlight)(struct omap_dss_device *dssdev, int level);
};
#endif
--
1.7.9.5
^ permalink raw reply related
* [PATCH 05/11] OMAPDSS: remove set_backlight/get_backlight function ptrs
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
Now that no board nor panel is using set_backlight and get_backlight
functions, we can remove them from omapdss.h.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
---
include/video/omapdss.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index caefa09..d5dcd50 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -659,8 +659,6 @@ struct omap_dss_device {
/* platform specific */
int (*platform_enable)(struct omap_dss_device *dssdev);
void (*platform_disable)(struct omap_dss_device *dssdev);
- int (*set_backlight)(struct omap_dss_device *dssdev, int level);
- int (*get_backlight)(struct omap_dss_device *dssdev);
};
struct omap_dss_hdmi_data
--
1.7.9.5
^ permalink raw reply related
* [PATCH 06/11] OMAPDSS: Generic DPI Panel: use devm_kzalloc for allocating driver data
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
Use devm_kzalloc instead of kzalloc to allocate driver data for the generic dpi
panel driver. This simplifies the driver's probe and remove functions.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/displays/panel-generic-dpi.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
index 54ca8ae..6cb2fe0 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -632,7 +632,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
dssdev->panel.timings = panel_config->timings;
- drv_data = kzalloc(sizeof(*drv_data), GFP_KERNEL);
+ drv_data = devm_kzalloc(&dssdev->dev, sizeof(*drv_data), GFP_KERNEL);
if (!drv_data)
return -ENOMEM;
@@ -648,12 +648,8 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
static void __exit generic_dpi_panel_remove(struct omap_dss_device *dssdev)
{
- struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev);
-
dev_dbg(&dssdev->dev, "remove\n");
- kfree(drv_data);
-
dev_set_drvdata(&dssdev->dev, NULL);
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH 07/11] OMAPDSS: lb035q02: use devm_kzalloc for allocating driver data
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja, Steve Sakoman
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
Use devm_kzalloc instead of kzalloc to allocate driver data for the lg phillips
panel driver. This simplifies the driver's probe and remove functions.
Cc: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Archit Taneja <archit@ti.com>
---
.../omap2/displays/panel-lgphilips-lb035q02.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
index 6e5abe8..8effea8 100644
--- a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
+++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
@@ -89,27 +89,21 @@ static void lb035q02_panel_power_off(struct omap_dss_device *dssdev)
static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
{
struct lb035q02_data *ld;
- int r;
dssdev->panel.timings = lb035q02_timings;
- ld = kzalloc(sizeof(*ld), GFP_KERNEL);
- if (!ld) {
- r = -ENOMEM;
- goto err;
- }
+ ld = devm_kzalloc(&dssdev->dev, sizeof(*ld), GFP_KERNEL);
+ if (!ld)
+ return -ENOMEM;
+
mutex_init(&ld->lock);
dev_set_drvdata(&dssdev->dev, ld);
+
return 0;
-err:
- return r;
}
static void lb035q02_panel_remove(struct omap_dss_device *dssdev)
{
- struct lb035q02_data *ld = dev_get_drvdata(&dssdev->dev);
-
- kfree(ld);
}
static int lb035q02_panel_enable(struct omap_dss_device *dssdev)
--
1.7.9.5
^ permalink raw reply related
* [PATCH 08/11] OMAPDSS: picodlp: use devm_kzalloc for allocating driver data
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
Use devm_kzalloc instead of kzalloc to allocate driver data for the picodlp
panel driver. This simplifies the driver's probe and remove functions.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/displays/panel-picodlp.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-picodlp.c b/drivers/video/omap2/displays/panel-picodlp.c
index 1b94018..3864299 100644
--- a/drivers/video/omap2/displays/panel-picodlp.c
+++ b/drivers/video/omap2/displays/panel-picodlp.c
@@ -423,11 +423,11 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev);
struct i2c_adapter *adapter;
struct i2c_client *picodlp_i2c_client;
- int r = 0, picodlp_adapter_id;
+ int picodlp_adapter_id;
dssdev->panel.timings = pico_ls_timings;
- picod = kzalloc(sizeof(struct picodlp_data), GFP_KERNEL);
+ picod = devm_kzalloc(&dssdev->dev, sizeof(*picod), GFP_KERNEL);
if (!picod)
return -ENOMEM;
@@ -438,25 +438,21 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
adapter = i2c_get_adapter(picodlp_adapter_id);
if (!adapter) {
dev_err(&dssdev->dev, "can't get i2c adapter\n");
- r = -ENODEV;
- goto err;
+ return -ENODEV;
}
picodlp_i2c_client = i2c_new_device(adapter, &picodlp_i2c_board_info);
if (!picodlp_i2c_client) {
dev_err(&dssdev->dev, "can't add i2c device::"
" picodlp_i2c_client is NULL\n");
- r = -ENODEV;
- goto err;
+ return -ENODEV;
}
picod->picodlp_i2c_client = picodlp_i2c_client;
dev_set_drvdata(&dssdev->dev, picod);
- return r;
-err:
- kfree(picod);
- return r;
+
+ return 0;
}
static void picodlp_panel_remove(struct omap_dss_device *dssdev)
--
1.7.9.5
^ permalink raw reply related
* [PATCH 09/11] OMAPDSS: remove unnecessary DSI external TE pin platform info from omap_dss_device
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
The omap_dss_device provides platform related parameters ext_te and ext_te_gpio
for DSI command mode panels. These parameters are now owned by a panel driver's
platform_data instead.
Remove these fields as they aren't used anymore.
Signed-off-by: Archit Taneja <archit@ti.com>
---
include/video/omapdss.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index d5dcd50..ec68769 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -579,9 +579,6 @@ struct omap_dss_device {
struct {
int module;
-
- bool ext_te;
- u8 ext_te_gpio;
} dsi;
struct {
--
1.7.9.5
^ permalink raw reply related
* [PATCH 10/11] OMAPDSS: panel acx565akm: remove omap_dss_device maximum backlight level usage
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
The omap_dss_device structs's max_backlight_level is used to pass maximum
backlight level for the platform. However, no board file using this panel
populates this field. Therefore, we remove it's usage from the panel driver.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/displays/panel-acx565akm.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-acx565akm.c b/drivers/video/omap2/displays/panel-acx565akm.c
index a980a11..a8fb26b 100644
--- a/drivers/video/omap2/displays/panel-acx565akm.c
+++ b/drivers/video/omap2/displays/panel-acx565akm.c
@@ -555,10 +555,7 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
md->cabc_mode = get_hw_cabc_mode(md);
}
- if (md->has_bc)
- max_brightness = 255;
- else
- max_brightness = dssdev->max_backlight_level;
+ max_brightness = 255;
if (md->has_bc)
brightness = acx565akm_get_actual_brightness(md);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 11/11] OMAPDSS: Remove max_backlight_level form omap_dss_device
From: Archit Taneja @ 2013-02-13 14:19 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com>
The maximum backlight level supported is a parameter which should come from
the panel's platform data. Usage of max_backlight_level in omap_dss_device has
been removed from all panel drivers. Remove it from the omap_dss_device struct.
Signed-off-by: Archit Taneja <archit@ti.com>
---
include/video/omapdss.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index ec68769..f0b65a5 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -631,8 +631,6 @@ struct omap_dss_device {
int reset_gpio;
- int max_backlight_level;
-
const char *name;
/* used to match device to driver */
--
1.7.9.5
^ permalink raw reply related
* [PATCH 00/33] OMAPDSS: platform_enable/disable callback removal from panel drivers
From: Archit Taneja @ 2013-02-13 14:33 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
init functions in omap board files request panel specific gpios, and provide
functions which omapdss panel drivers call to enable or disable them.
Instead of the board files requesting these gpios, they should just pass the
platform specific data(like the gpio numbers), the panel should retrieve the
platform data and request the gpios. Doing this prevents the need of the panel
driver calling platform functions in board files.
Panel drivers have their own platform data struct, and the board files populate
these structs and pass the pointer to the 'data' field of omap_dss_device. This
work will make it easier for the panel drivers be more adaptable to the
DT model.
There is also removal of passing panel reset_gpio numbers through
omap_dss_device struct directly, reset gpios are passed through platform data
only.
Reference tree:
git://gitorious.org/~boddob/linux-omap-dss2/archit-dss2-clone.git for-3.9/remove_enable_disable_callbacks
Archit Taneja (32):
OMAPDSS: panels: keep platform data of all panels in a single header
arm: omap: board-2430: use generic dpi panel's gpio handling
arm: omap: board-devkit8000: use generic dpi panel's gpio handling
arm: omap: board-cm-t35: use generic dpi panel's gpio handling
arm: omap: board-apollon: use generic dpi panel's gpio handling
arm: omap: board-am3517: use generic dpi panel's gpio handling
arm: omap: board-ldp: use generic dpi panel's gpio handling
OMAPDSS: lb035q02: handle gpios in panel driver
arm: omap: board-overo: use lb035q02 dpi panel's gpio handling
OMAPDSS: lb035q02 panel: remove platform_enable/disable callbacks
OMAPDSS: generic dpi panel: remove platform_enable/disable ops from
platform_data
arm: omap: board-omap3evm: use sharp panel's gpio handling
arm: omap: board-sdp3430: use sharp panel's gpio handling
OMAPDSS: sharp-ls panel: remove platform_enable/disable callbacks
OMAPDSS: acx565akm panel: handle gpios in panel driver
arm: omap: board-rx-51: use acx565akm panel's gpio handling
OMAPDSS: nec-nl8048 panel: handle gpios ins panel driver
arm: omap: board-zoom: use NEC panel's gpio handling
OMAPDSS: nec-nl8048 panel: remove platform_enable/disable callbacks
OMAPDSS: tpo-td043 panel: handle gpios in panel driver
arm: omap: board-omap3pandora: use tpo panel's gpio handling
OMAPDSS: tpo-td043: remove platform_enable/disable callbacks
OMAPDSS: picodlp panel: handle gpio data in panel driver
arm: omap: dss-common: use picodlp panel's gpio handling
OMAPDSS: picodlp panel: remove platform_enable/disable callbacks
OMAPDSS: n8x0 panel: handle gpio data in panel driver
OMAPDSS: n8x0 panel: remove platform_enable/disable callbacks
arm: omap boards: Remove unnecessary platform_enable/disable
callbacks for VENC devices
OMAPDSS: VENC: remove platform_enable/disable calls
OMAPDSS: remove platform_enable/disable callbacks from
omap_dss_device
arm: dss-common: don't use reset_gpio from omap4_panda_dvi_device
OMAPDSS: remove reset_gpio field from omap_dss_device
Tomi Valkeinen (1):
OMAPDSS: generic dpi panel: handle gpios in panel driver
arch/arm/mach-omap2/board-2430sdp.c | 45 +-----
arch/arm/mach-omap2/board-3430sdp.c | 55 +++-----
arch/arm/mach-omap2/board-am3517evm.c | 77 +----------
arch/arm/mach-omap2/board-apollon.c | 11 +-
arch/arm/mach-omap2/board-cm-t35.c | 60 +-------
arch/arm/mach-omap2/board-devkit8000.c | 30 +---
arch/arm/mach-omap2/board-h4.c | 2 +-
arch/arm/mach-omap2/board-igep0020.c | 2 +-
arch/arm/mach-omap2/board-ldp.c | 63 ++-------
arch/arm/mach-omap2/board-omap3beagle.c | 2 +-
arch/arm/mach-omap2/board-omap3evm.c | 72 +++-------
arch/arm/mach-omap2/board-omap3pandora.c | 7 +-
arch/arm/mach-omap2/board-omap3stalker.c | 14 +-
arch/arm/mach-omap2/board-overo.c | 61 ++-------
arch/arm/mach-omap2/board-rx51-video.c | 26 +---
arch/arm/mach-omap2/board-zoom-display.c | 38 ++----
arch/arm/mach-omap2/dss-common.c | 58 +++-----
drivers/video/omap2/displays/panel-acx565akm.c | 48 +++++--
drivers/video/omap2/displays/panel-generic-dpi.c | 33 +++--
.../omap2/displays/panel-lgphilips-lb035q02.c | 44 ++++--
drivers/video/omap2/displays/panel-n8x0.c | 29 ++--
.../omap2/displays/panel-nec-nl8048hl11-01b.c | 53 ++++---
drivers/video/omap2/displays/panel-picodlp.c | 35 +++--
.../video/omap2/displays/panel-sharp-ls037v7dw01.c | 78 ++++++++---
drivers/video/omap2/displays/panel-taal.c | 2 +-
drivers/video/omap2/displays/panel-tfp410.c | 2 +-
.../video/omap2/displays/panel-tpo-td043mtea1.c | 45 +++---
drivers/video/omap2/dss/venc.c | 9 --
include/video/omap-panel-data.h | 144 ++++++++++++++++++++
include/video/omap-panel-generic-dpi.h | 37 -----
include/video/omap-panel-n8x0.h | 13 --
include/video/omap-panel-nokia-dsi.h | 32 -----
include/video/omap-panel-picodlp.h | 23 ----
include/video/omap-panel-tfp410.h | 35 -----
include/video/omapdss.h | 6 -
35 files changed, 528 insertions(+), 763 deletions(-)
create mode 100644 include/video/omap-panel-data.h
delete mode 100644 include/video/omap-panel-generic-dpi.h
delete mode 100644 include/video/omap-panel-n8x0.h
delete mode 100644 include/video/omap-panel-nokia-dsi.h
delete mode 100644 include/video/omap-panel-picodlp.h
delete mode 100644 include/video/omap-panel-tfp410.h
--
1.7.9.5
^ permalink raw reply
* [PATCH 01/33] OMAPDSS: panels: keep platform data of all panels in a single header
From: Archit Taneja @ 2013-02-13 14:33 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360765345-19312-1-git-send-email-archit@ti.com>
Structs for platform data of omapdss panels are found in headers in the
'include/video/' path. Board files populate these structs with platform
specific values, and the panel driver uses these to configure the panel.
Currently, each panel has it's own header in the above path. Move all the
omapdss panel platform data structs to a single header omap-panel-data.h.
This is useful because:
- All other omapdss panel drivers will be modified to use platform data. This
would lead to a lot of panel headers usable only by omapdss. A lot of these
platform data structs are trivial, and don't really need a separate header.
- Platform data would be eventually removed, and platform information would be
passed via device tree. Therefore, omapdss panel platform data structs are
temporary, and will be easier to remove if they are all in the same header.
- All board files will have to include the same header to configure a panel's
platform data, that makes the board files more consistent.
Signed-off-by: Archit Taneja <archit@ti.com>
---
arch/arm/mach-omap2/board-2430sdp.c | 2 +-
arch/arm/mach-omap2/board-3430sdp.c | 2 +-
arch/arm/mach-omap2/board-am3517evm.c | 3 +-
arch/arm/mach-omap2/board-apollon.c | 2 +-
arch/arm/mach-omap2/board-cm-t35.c | 3 +-
arch/arm/mach-omap2/board-devkit8000.c | 3 +-
arch/arm/mach-omap2/board-h4.c | 2 +-
arch/arm/mach-omap2/board-igep0020.c | 2 +-
arch/arm/mach-omap2/board-ldp.c | 2 +-
arch/arm/mach-omap2/board-omap3beagle.c | 2 +-
arch/arm/mach-omap2/board-omap3evm.c | 2 +-
arch/arm/mach-omap2/board-omap3stalker.c | 3 +-
arch/arm/mach-omap2/board-overo.c | 3 +-
arch/arm/mach-omap2/dss-common.c | 4 +-
drivers/video/omap2/displays/panel-generic-dpi.c | 2 +-
drivers/video/omap2/displays/panel-n8x0.c | 2 +-
drivers/video/omap2/displays/panel-picodlp.c | 2 +-
drivers/video/omap2/displays/panel-taal.c | 2 +-
drivers/video/omap2/displays/panel-tfp410.c | 2 +-
include/video/omap-panel-data.h | 101 ++++++++++++++++++++++
include/video/omap-panel-generic-dpi.h | 37 --------
include/video/omap-panel-n8x0.h | 13 ---
include/video/omap-panel-nokia-dsi.h | 32 -------
include/video/omap-panel-picodlp.h | 23 -----
include/video/omap-panel-tfp410.h | 35 --------
25 files changed, 120 insertions(+), 166 deletions(-)
create mode 100644 include/video/omap-panel-data.h
delete mode 100644 include/video/omap-panel-generic-dpi.h
delete mode 100644 include/video/omap-panel-n8x0.h
delete mode 100644 include/video/omap-panel-nokia-dsi.h
delete mode 100644 include/video/omap-panel-picodlp.h
delete mode 100644 include/video/omap-panel-tfp410.h
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 4815ea6..13a1a3b 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -37,7 +37,7 @@
#include "gpmc-smc91x.h"
#include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
+#include <video/omap-panel-data.h>
#include "mux.h"
#include "hsmmc.h"
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index bb73afc..fb75a81 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -33,7 +33,7 @@
#include "common.h"
#include <linux/omap-dma.h>
#include <video/omapdss.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
#include "gpmc.h"
#include "gpmc-smc91x.h"
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index f81a303..2988049 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -35,8 +35,7 @@
#include "common.h"
#include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
#include "am35xx-emac.h"
#include "mux.h"
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 5d0a61f..d2a83a8 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -38,7 +38,7 @@
#include "gpmc.h"
#include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
+#include <video/omap-panel-data.h>
#include "mux.h"
#include "control.h"
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index b3102c2..f940a79 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -40,8 +40,7 @@
#include <linux/platform_data/mtd-nand-omap2.h>
#include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
#include <linux/platform_data/spi-omap2-mcspi.h>
#include "common.h"
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 12865af..019b212 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -42,8 +42,7 @@
#include "gpmc.h"
#include <linux/platform_data/mtd-nand-omap2.h>
#include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
#include <linux/platform_data/spi-omap2-mcspi.h>
#include <linux/input/matrix_keypad.h>
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 3be1311..88d1b5b 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -34,7 +34,7 @@
#include <asm/mach/map.h>
#include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
+#include <video/omap-panel-data.h>
#include "common.h"
#include "mux.h"
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 0f24cb8..810e168 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -30,7 +30,7 @@
#include <asm/mach/arch.h>
#include <video/omapdss.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
#include <linux/platform_data/mtd-onenand-omap2.h>
#include "common.h"
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 0869f4f..68e56f1 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -40,7 +40,7 @@
#include "gpmc-smsc911x.h"
#include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
+#include <video/omap-panel-data.h>
#include "board-flash.h"
#include "mux.h"
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 22c483d..8d357ce 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -40,7 +40,7 @@
#include <asm/mach/flash.h>
#include <video/omapdss.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
#include <linux/platform_data/mtd-nand-omap2.h>
#include "common.h"
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 3985f35..335127d 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -50,7 +50,7 @@
#include "common.h"
#include <linux/platform_data/spi-omap2-mcspi.h>
#include <video/omapdss.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
#include "soc.h"
#include "mux.h"
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 53a6cbc..621ace1 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -43,8 +43,7 @@
#include "gpmc.h"
#include <linux/platform_data/mtd-nand-omap2.h>
#include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
#include <linux/platform_data/spi-omap2-mcspi.h>
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index c8fde3e..bf6b2ce 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -46,8 +46,7 @@
#include <asm/mach/map.h>
#include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
#include "common.h"
#include "mux.h"
diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c
index 4be5cfc..9c49bbe 100644
--- a/arch/arm/mach-omap2/dss-common.c
+++ b/arch/arm/mach-omap2/dss-common.c
@@ -27,9 +27,7 @@
#include <linux/gpio.h>
#include <video/omapdss.h>
-#include <video/omap-panel-tfp410.h>
-#include <video/omap-panel-nokia-dsi.h>
-#include <video/omap-panel-picodlp.h>
+#include <video/omap-panel-data.h>
#include "soc.h"
#include "dss-common.h"
diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
index 6cb2fe0..d8d0cd5 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -35,7 +35,7 @@
#include <linux/slab.h>
#include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
+#include <video/omap-panel-data.h>
struct panel_config {
struct omap_video_timings timings;
diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c
index b750480..9c55c91 100644
--- a/drivers/video/omap2/displays/panel-n8x0.c
+++ b/drivers/video/omap2/displays/panel-n8x0.c
@@ -8,7 +8,7 @@
#include <linux/fb.h>
#include <video/omapdss.h>
-#include <video/omap-panel-n8x0.h>
+#include <video/omap-panel-data.h>
#define BLIZZARD_REV_CODE 0x00
#define BLIZZARD_CONFIG 0x02
diff --git a/drivers/video/omap2/displays/panel-picodlp.c b/drivers/video/omap2/displays/panel-picodlp.c
index 3864299..56d536c 100644
--- a/drivers/video/omap2/displays/panel-picodlp.c
+++ b/drivers/video/omap2/displays/panel-picodlp.c
@@ -31,7 +31,7 @@
#include <linux/gpio.h>
#include <video/omapdss.h>
-#include <video/omap-panel-picodlp.h>
+#include <video/omap-panel-data.h>
#include "panel-picodlp.h"
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index a32407a..031d406 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -33,7 +33,7 @@
#include <linux/mutex.h>
#include <video/omapdss.h>
-#include <video/omap-panel-nokia-dsi.h>
+#include <video/omap-panel-data.h>
#include <video/mipi_display.h>
/* DSI Virtual channel. Hardcoded for now. */
diff --git a/drivers/video/omap2/displays/panel-tfp410.c b/drivers/video/omap2/displays/panel-tfp410.c
index 8281baa..a1dba868 100644
--- a/drivers/video/omap2/displays/panel-tfp410.c
+++ b/drivers/video/omap2/displays/panel-tfp410.c
@@ -24,7 +24,7 @@
#include <linux/gpio.h>
#include <drm/drm_edid.h>
-#include <video/omap-panel-tfp410.h>
+#include <video/omap-panel-data.h>
static const struct omap_video_timings tfp410_default_timings = {
.x_res = 640,
diff --git a/include/video/omap-panel-data.h b/include/video/omap-panel-data.h
new file mode 100644
index 0000000..e8e30f9
--- /dev/null
+++ b/include/video/omap-panel-data.h
@@ -0,0 +1,101 @@
+/*
+ * Header containing platform_data structs for omap panels
+ *
+ * Copyright (C) 2013 Texas Instruments
+ * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
+ * Archit Taneja <archit@ti.com>
+ *
+ * Copyright (C) 2011 Texas Instruments
+ * Author: Mayuresh Janorkar <mayur@ti.com>
+ *
+ * Copyright (C) 2010 Canonical Ltd.
+ * Author: Bryan Wu <bryan.wu@canonical.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __OMAP_PANEL_DATA_H
+#define __OMAP_PANEL_DATA_H
+
+struct omap_dss_device;
+
+/**
+ * struct panel_generic_dpi_data - panel driver configuration data
+ * @name: panel name
+ * @platform_enable: platform specific panel enable function
+ * @platform_disable: platform specific panel disable function
+ */
+struct panel_generic_dpi_data {
+ const char *name;
+ int (*platform_enable)(struct omap_dss_device *dssdev);
+ void (*platform_disable)(struct omap_dss_device *dssdev);
+};
+
+/**
+ * struct panel_n8x0_data - N800 panel driver configuration data
+ */
+struct panel_n8x0_data {
+ int (*platform_enable)(struct omap_dss_device *dssdev);
+ void (*platform_disable)(struct omap_dss_device *dssdev);
+ int panel_reset;
+ int ctrl_pwrdown;
+};
+
+/**
+ * struct nokia_dsi_panel_data - Nokia DSI panel driver configuration data
+ * @name: panel name
+ * @use_ext_te: use external TE
+ * @ext_te_gpio: external TE GPIO
+ * @esd_interval: interval of ESD checks, 0 = disabled (ms)
+ * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms)
+ * @use_dsi_backlight: true if panel uses DSI command to control backlight
+ * @pin_config: DSI pin configuration
+ */
+
+struct nokia_dsi_panel_data {
+ const char *name;
+
+ int reset_gpio;
+
+ bool use_ext_te;
+ int ext_te_gpio;
+
+ unsigned esd_interval;
+ unsigned ulps_timeout;
+
+ bool use_dsi_backlight;
+
+ struct omap_dsi_pin_config pin_config;
+};
+
+/**
+ * struct picodlp_panel_data - picodlp panel driver configuration data
+ * @picodlp_adapter_id: i2c_adapter number for picodlp
+ */
+struct picodlp_panel_data {
+ int picodlp_adapter_id;
+ int emu_done_gpio;
+ int pwrgood_gpio;
+};
+
+/**
+ * struct tfp410_platform_data - tfp410 panel driver configuration data
+ * @i2c_bus_num: i2c bus id for the panel
+ * @power_down_gpio: gpio number for PD pin (or -1 if not available)
+ */
+struct tfp410_platform_data {
+ int i2c_bus_num;
+ int power_down_gpio;
+};
+
+#endif /* __OMAP_PANEL_DATA_H */
diff --git a/include/video/omap-panel-generic-dpi.h b/include/video/omap-panel-generic-dpi.h
deleted file mode 100644
index 127e3f2..0000000
--- a/include/video/omap-panel-generic-dpi.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Header for generic DPI panel driver
- *
- * Copyright (C) 2010 Canonical Ltd.
- * Author: Bryan Wu <bryan.wu@canonical.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __OMAP_PANEL_GENERIC_DPI_H
-#define __OMAP_PANEL_GENERIC_DPI_H
-
-struct omap_dss_device;
-
-/**
- * struct panel_generic_dpi_data - panel driver configuration data
- * @name: panel name
- * @platform_enable: platform specific panel enable function
- * @platform_disable: platform specific panel disable function
- */
-struct panel_generic_dpi_data {
- const char *name;
- int (*platform_enable)(struct omap_dss_device *dssdev);
- void (*platform_disable)(struct omap_dss_device *dssdev);
-};
-
-#endif /* __OMAP_PANEL_GENERIC_DPI_H */
diff --git a/include/video/omap-panel-n8x0.h b/include/video/omap-panel-n8x0.h
deleted file mode 100644
index 9cc69c8..0000000
--- a/include/video/omap-panel-n8x0.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __OMAP_PANEL_N8X0_H
-#define __OMAP_PANEL_N8X0_H
-
-struct omap_dss_device;
-
-struct panel_n8x0_data {
- int (*platform_enable)(struct omap_dss_device *dssdev);
- void (*platform_disable)(struct omap_dss_device *dssdev);
- int panel_reset;
- int ctrl_pwrdown;
-};
-
-#endif
diff --git a/include/video/omap-panel-nokia-dsi.h b/include/video/omap-panel-nokia-dsi.h
deleted file mode 100644
index 04219a2..0000000
--- a/include/video/omap-panel-nokia-dsi.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __OMAP_NOKIA_DSI_PANEL_H
-#define __OMAP_NOKIA_DSI_PANEL_H
-
-struct omap_dss_device;
-
-/**
- * struct nokia_dsi_panel_data - Nokia DSI panel driver configuration
- * @name: panel name
- * @use_ext_te: use external TE
- * @ext_te_gpio: external TE GPIO
- * @esd_interval: interval of ESD checks, 0 = disabled (ms)
- * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms)
- * @use_dsi_backlight: true if panel uses DSI command to control backlight
- * @pin_config: DSI pin configuration
- */
-struct nokia_dsi_panel_data {
- const char *name;
-
- int reset_gpio;
-
- bool use_ext_te;
- int ext_te_gpio;
-
- unsigned esd_interval;
- unsigned ulps_timeout;
-
- bool use_dsi_backlight;
-
- struct omap_dsi_pin_config pin_config;
-};
-
-#endif /* __OMAP_NOKIA_DSI_PANEL_H */
diff --git a/include/video/omap-panel-picodlp.h b/include/video/omap-panel-picodlp.h
deleted file mode 100644
index 1c342ef..0000000
--- a/include/video/omap-panel-picodlp.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * panel data for picodlp panel
- *
- * Copyright (C) 2011 Texas Instruments
- *
- * Author: Mayuresh Janorkar <mayur@ti.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#ifndef __PANEL_PICODLP_H
-#define __PANEL_PICODLP_H
-/**
- * struct : picodlp panel data
- * picodlp_adapter_id: i2c_adapter number for picodlp
- */
-struct picodlp_panel_data {
- int picodlp_adapter_id;
- int emu_done_gpio;
- int pwrgood_gpio;
-};
-#endif /* __PANEL_PICODLP_H */
diff --git a/include/video/omap-panel-tfp410.h b/include/video/omap-panel-tfp410.h
deleted file mode 100644
index aef35e4..0000000
--- a/include/video/omap-panel-tfp410.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Header for TFP410 chip driver
- *
- * Copyright (C) 2011 Texas Instruments Inc
- * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __OMAP_PANEL_TFP410_H
-#define __OMAP_PANEL_TFP410_H
-
-struct omap_dss_device;
-
-/**
- * struct tfp410_platform_data - panel driver configuration data
- * @i2c_bus_num: i2c bus id for the panel
- * @power_down_gpio: gpio number for PD pin (or -1 if not available)
- */
-struct tfp410_platform_data {
- int i2c_bus_num;
- int power_down_gpio;
-};
-
-#endif /* __OMAP_PANEL_TFP410_H */
--
1.7.9.5
^ permalink raw reply related
* [PATCH 02/33] OMAPDSS: generic dpi panel: handle gpios in panel driver
From: Archit Taneja @ 2013-02-13 14:33 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
In-Reply-To: <1360765345-19312-1-git-send-email-archit@ti.com>
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
The generic dpi panel driver leaves gpio configurations to the platform_enable
and disable calls in the platform's board file. These should happen in the
panel driver itself.
Add a generic way of passing gpio information to the generic dpi panel driver
via it's platform_data. This information includes the number of gpios used by
the panel, the gpio number and logic level (active high/low) for each gpio. This
gpio data will be used by the driver to request and configure the gpios required
by the panel.
This will help in removing the need for the panel drivers to have platform
related callbacks.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/displays/panel-generic-dpi.c | 25 ++++++++++++++++++++--
include/video/omap-panel-data.h | 7 ++++++
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
index d8d0cd5..4a12db6 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -33,6 +33,7 @@
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/slab.h>
+#include <linux/gpio.h>
#include <video/omapdss.h>
#include <video/omap-panel-data.h>
@@ -557,7 +558,7 @@ static inline struct panel_generic_dpi_data
static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev)
{
- int r;
+ int r, i;
struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev);
struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev);
struct panel_config *panel_config = drv_data->panel_config;
@@ -582,6 +583,11 @@ static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev)
goto err1;
}
+ for (i = 0; i < panel_data->num_gpios; ++i) {
+ gpio_set_value_cansleep(panel_data->gpios[i],
+ panel_data->gpio_invert[i] ? 0 : 1);
+ }
+
return 0;
err1:
omapdss_dpi_display_disable(dssdev);
@@ -594,10 +600,16 @@ static void generic_dpi_panel_power_off(struct omap_dss_device *dssdev)
struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev);
struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev);
struct panel_config *panel_config = drv_data->panel_config;
+ int i;
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return;
+ for (i = panel_data->num_gpios - 1; i >= 0; --i) {
+ gpio_set_value_cansleep(panel_data->gpios[i],
+ panel_data->gpio_invert[i] ? 1 : 0);
+ }
+
if (panel_data->platform_disable)
panel_data->platform_disable(dssdev);
@@ -613,7 +625,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev);
struct panel_config *panel_config = NULL;
struct panel_drv_data *drv_data = NULL;
- int i;
+ int i, r;
dev_dbg(&dssdev->dev, "probe\n");
@@ -630,6 +642,15 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
if (!panel_config)
return -EINVAL;
+ for (i = 0; i < panel_data->num_gpios; ++i) {
+ r = devm_gpio_request_one(&dssdev->dev, panel_data->gpios[i],
+ panel_data->gpio_invert[i] ?
+ GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW,
+ "panel gpio");
+ if (r)
+ return r;
+ }
+
dssdev->panel.timings = panel_config->timings;
drv_data = devm_kzalloc(&dssdev->dev, sizeof(*drv_data), GFP_KERNEL);
diff --git a/include/video/omap-panel-data.h b/include/video/omap-panel-data.h
index e8e30f9..eec93f1 100644
--- a/include/video/omap-panel-data.h
+++ b/include/video/omap-panel-data.h
@@ -34,11 +34,18 @@ struct omap_dss_device;
* @name: panel name
* @platform_enable: platform specific panel enable function
* @platform_disable: platform specific panel disable function
+ * @num_gpios: number of gpios connected to panel
+ * @gpios: gpio numbers on the platform
+ * @gpio_invert: configure gpio as active high or low
*/
struct panel_generic_dpi_data {
const char *name;
int (*platform_enable)(struct omap_dss_device *dssdev);
void (*platform_disable)(struct omap_dss_device *dssdev);
+
+ int num_gpios;
+ int gpios[10];
+ bool gpio_invert[10];
};
/**
--
1.7.9.5
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox