Skip to contentSkip to conversation

OMAP: DSS2: Add NEC NL8048HL11-01B display panel

PATCH Superseded Samreen 2 participants 3 messages Oct 21, 2010 – Oct 22, 2010 Framebuffer layer

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Samreen

author
#0 lore raw

PATCH v2 1/1 OMAP: DSS2: Add NEC NL8048HL11-01B display panel

From: Erik Gilling <[email protected]>

NEC WVGA LCD NL8048HL11-01B panel support has been added. This panel is being used in zoom2/zoom3/3630 sdp boards.

---
Version2:
- the brightness updation is removed from the nec_8048_panel_enable() to assure the user set brightness value is not over written
- error checking added where ever missing
- cosmetic changes are also included

This panel driver has orginated from panel-zoom2 from the L25.x releases.Refer Commit:
http://git.omapzoom.org/?p=kernel/omap.git;a=commit;h=75fc121865125d9e3ca3b36f1f19f86b394e1f6b

 drivers/video/omap2/displays/Kconfig               |    7 +
 drivers/video/omap2/displays/Makefile              |    1 +
 .../omap2/displays/panel-nec-nl8048hl11-01b.c      |  379 ++++++++++++++++++++
 3 files changed, 387 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
drivers/video/omap2/displays/Kconfig +7 -0
index 12327bb..f8152cf 100644
@@ -20,6 +20,13 @@ config PANEL_SHARP_LQ043T1DG01
         help
           LCD Panel used in TI's OMAP3517 EVM boards
 
+config PANEL_NEC_NL8048HL11_01B
+	tristate "NEC NL8048HL11-01B Panel"
+	depends on OMAP2_DSS
+	help
+		This NEC NL8048HL11-01B panel is TFT LCD
+		used in the Zoom2/3/3630 sdp boards.
+
 config PANEL_TAAL
         tristate "Taal DSI Panel"
         depends on OMAP2_DSS_DSI
drivers/video/omap2/displays/Makefile +1 -0
index aa38609..8ece91c 100644
@@ -1,6 +1,7 @@
 obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
 obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
+obj-$(CONFIG_PANEL_NEC_NL8048HL11_01B) += panel-nec-nl8048hl11-01b.o
 
 obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
 obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c new file +379 -0

379 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 5 lines · Samreen

From: Erik Gilling <[email protected]>

NEC WVGA LCD NL8048HL11-01B panel support has been added. This panel is being used in zoom2/zoom3/3630 sdp boards.

<snip>

Quoted 5 lines
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c new file +0 -0
new file mode 100644
index 0000000..0327731

<snip>

Quoted 2 lines

+static int spi_send(struct spi_device *spi, unsigned char reg_addr,
+                       unsigned char reg_data)

you could be more consistent and name it nec_8048_spi_send.

Quoted 6 lines
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c new file +6 -0
+{
+       int ret = 0;
+       unsigned int cmd = 0, data = 0;
+
+       cmd = 0x0000 | reg_addr; /* register address write */
+       data = 0x0100 | reg_data ; /* register data write */

drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c line 225

Quoted 10 lines
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c new file +10 -0
+       data = (cmd << 16) | data;
+
+       ret = spi_write(spi, (unsigned char *)&data, 4);
+       if (ret)
+               pr_err("error in spi_write %x\n", data);
+
+       return ret;
+}
+
+

one blank line is enough

drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c line 235

Quoted 10 lines
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c new file +10 -0
+static int init_nec_8048_wvga_lcd(struct spi_device *spi)
+{
+       /* Initialization Sequence */
+       /* spi_send(spi, REG, VAL) */
+       spi_send(spi, 3, 0x01);
+       spi_send(spi, 0, 0x00);
+       spi_send(spi, 1, 0x01);    /* R1 = 0x01 (normal), 0x03 (reversed) */
+       spi_send(spi, 4, 0x00);
+       spi_send(spi, 5, 0x14);
+       spi_send(spi, 6, 0x24);

This code wastes quite a bit of space (at least 3 mov and one bl instruction for every such write on ARM), you could better do something like:

static const struct {
u8 address;
u8 value;
} nec_8048_init_seq[] = {
{ 3, 0x01 },
{ 0, 0x00 },
{ 1, 0x01 },
...
};

static int init_nec_8048_wvga_lcd(struct spi_device *spi) {
int i, ret;

  for (i = 0; i < ARRAY_SIZE(nec_8048_init_seq); i++) {
    ret = nec_8048_spi_send(spi, nec_8048_init_seq[i].address,
nec_8048_init_seq[i].value);
    if (ret < 0)
      break;

}
udelay(20);
nec_8048_spi_send(spi, 2, 0x00);
}

Quoted 1 line

+MODULE_DESCRIPTION("Nec Driver");

could use more complete description here.

#2 lore raw
Quoted 19 lines · Grazvydas Ignotas
Quoted 5 lines · Samreen

From: Erik Gilling <[email protected]>

NEC WVGA LCD NL8048HL11-01B panel support has been added. This panel is being used in zoom2/zoom3/3630 sdp boards.

<snip>

Quoted 1 line

diff --git

a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c

Quoted 5 lines

b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c new file mode 100644
index 0000000..0327731

drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c new file +0 -0

<snip>

Quoted 4 lines
Quoted 2 lines

+static int spi_send(struct spi_device *spi, unsigned char reg_addr,
+                       unsigned char reg_data)

you could be more consistent and name it nec_8048_spi_send.

[Samreen]
Will take care of this.

Quoted 17 lines
Quoted 5 lines
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c new file +4 -0
+{
+       int ret = 0;
+       unsigned int cmd = 0, data = 0;
+

drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c line 225

Quoted 10 lines
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c new file +10 -0
+       cmd = 0x0000 | reg_addr; /* register address write */
+       data = 0x0100 | reg_data ; /* register data write */
+       data = (cmd << 16) | data;
+
+       ret = spi_write(spi, (unsigned char *)&data, 4); +       if (ret)
+               pr_err("error in spi_write %x\n", data); +
+       return ret;
+}
+
+

one blank line is enough

[Samreen]
Will fix this

Quoted 15 lines
Quoted 10 lines

+static int init_nec_8048_wvga_lcd(struct spi_device *spi) {
+       /* Initialization Sequence */
+       /* spi_send(spi, REG, VAL) */
+       spi_send(spi, 3, 0x01);
+       spi_send(spi, 0, 0x00);
+       spi_send(spi, 1, 0x01);    /* R1 = 0x01 (normal), 0x03 +(reversed) */
+       spi_send(spi, 4, 0x00);
+       spi_send(spi, 5, 0x14);
+       spi_send(spi, 6, 0x24);

This code wastes quite a bit of space (at least 3 mov and one bl instruction for every such write on ARM), you could better do something like:

Quoted 9 lines

static const struct {
u8 address;
u8 value;
} nec_8048_init_seq[] = {
{ 3, 0x01 },
{ 0, 0x00 },
{ 1, 0x01 },
...
};

[Samreen]
Agree, I'll surely take this more optimized approach

Quoted 12 lines

static int init_nec_8048_wvga_lcd(struct spi_device *spi) { int i, ret;

  for (i = 0; i < ARRAY_SIZE(nec_8048_init_seq); i++) {
    ret = nec_8048_spi_send(spi,
nec_8048_init_seq[i].address, nec_8048_init_seq[i].value);     if (ret < 0)
      break;

}
udelay(20);
nec_8048_spi_send(spi, 2, 0x00);
}

Quoted 3 lines
Quoted 1 line

+MODULE_DESCRIPTION("Nec Driver");

could use more complete description here.

[Samreen]
Sure..--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html