Skip to contentSkip to conversation

video: atmel/lcd: add LCD driver for Atmel new SoC

PATCH Superseded Bo Shen 2 participants 6 messages May 22, 2012 – Jun 4, 2012

Subsystems (2)
lore
Share & tools
lore

Bo Shen

author
#0 lore raw

PATCH v2 1/1 video: atmel/lcd: add LCD driver for Atmel new SoC

The Atmel new SoC (at91sam9x5 series and at91sam9n12) add a totally different LCD controller. Add this new driver is used to support it.

Using CONFIG_ATMEL_HLCD (distinguish with CONFIG_ATMEL_LCD) to enable this in board configuration file.

---
Change since v1
Change the sequence in Makefile according to the suggestion from Mike Frysinger.

Remove unnecessary funtions.

 drivers/video/Makefile       |    1 +
 drivers/video/atmel_hlcdfb.c |  223 +++++++++++++++++++++++++++++++++++++++++
 include/atmel_hlcdc.h        |  225 ++++++++++++++++++++++++++++++++++++++++++
 include/lcd.h                |    3 +-
 4 files changed, 451 insertions(+), 1 deletion(-)
 create mode 100644 drivers/video/atmel_hlcdfb.c
 create mode 100644 include/atmel_hlcdc.h
drivers/video/Makefile +1 -0
index 6252f6a..b664344 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	:= $(obj)libvideo.o
 
 COBJS-$(CONFIG_ATI_RADEON_FB) += ati_radeon_fb.o videomodes.o
+COBJS-$(CONFIG_ATMEL_HLCD) += atmel_hlcdfb.o
 COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
 COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o
 COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o
drivers/video/atmel_hlcdfb.c new file +223 -0

223 lines not on this page · raw message

include/atmel_hlcdc.h new file +225 -0

225 lines not on this page · raw message

include/lcd.h +2 -1
index d95feeb..d4f96e2 100644
@@ -157,7 +157,7 @@ typedef struct vidinfo {
 	struct	pxafb_info pxa;
 } vidinfo_t;
 
-#elif defined(CONFIG_ATMEL_LCD)
+#elif defined(CONFIG_ATMEL_LCD) || defined(CONFIG_ATMEL_HLCD)
 
 typedef struct vidinfo {
 	ushort vl_col;		/* Number of columns (i.e. 640) */
@@ -169,6 +169,7 @@ typedef struct vidinfo {
 	u_long vl_bpix;		/* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 = 16 */
 	u_long vl_tft;		/* 0 = passive, 1 = TFT */
 	u_long vl_cont_pol_low;	/* contrast polarity is low */
+	u_long vl_clk_pol;	/* clock polarity */
 
 	/* Horizontal control register. */
 	u_long vl_hsync_len;	/* Length of horizontal sync */
Signature · 1 line
1.7.10
#1 lore raw

PATCH v3 1/1 video: atmel/lcd: add LCD driver for new Atmel SoC

From: Bo Shen <[email protected]>

The new Atmel SoC (at91sam9x5 series and at91sam9n12) add a totally different LCD controller. Add this new driver to support it.

Using CONFIG_ATMEL_HLCD (distinguish with CONFIG_ATMEL_LCD) to enable this in board configuration file.

---
Changes since v2:
- rebase on current tree
- convert to use struct for register offsets
- fix indentation in header file
- slightly revise commit log

 drivers/video/Makefile       |    1 +
 drivers/video/atmel_hlcdfb.c |  211 ++++++++++++++++++++++++++++++++++++++
 include/atmel_hlcdc.h        |  231 ++++++++++++++++++++++++++++++++++++++++++
 include/lcd.h                |    3 +-
 4 files changed, 445 insertions(+), 1 deletions(-)
 create mode 100644 drivers/video/atmel_hlcdfb.c
 create mode 100644 include/atmel_hlcdc.h
drivers/video/Makefile +1 -0
index 4fad20d..9b8907b 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	:= $(obj)libvideo.o
 
 COBJS-$(CONFIG_ATI_RADEON_FB) += ati_radeon_fb.o videomodes.o
+COBJS-$(CONFIG_ATMEL_HLCD) += atmel_hlcdfb.o
 COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
 COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o
 COBJS-$(CONFIG_EXYNOS_FB) += exynos_fb.o exynos_fimd.o
drivers/video/atmel_hlcdfb.c new file +211 -0

211 lines not on this page · raw message

include/atmel_hlcdc.h new file +231 -0

231 lines not on this page · raw message

include/lcd.h +2 -1
index ee47247..6e0a2a3 100644
@@ -158,7 +158,7 @@ typedef struct vidinfo {
 	struct	pxafb_info pxa;
 } vidinfo_t;
 
-#elif defined(CONFIG_ATMEL_LCD)
+#elif defined(CONFIG_ATMEL_LCD) || defined(CONFIG_ATMEL_HLCD)
 
 typedef struct vidinfo {
 	ushort vl_col;		/* Number of columns (i.e. 640) */
@@ -170,6 +170,7 @@ typedef struct vidinfo {
 	u_long vl_bpix;		/* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 = 16 */
 	u_long vl_tft;		/* 0 = passive, 1 = TFT */
 	u_long vl_cont_pol_low;	/* contrast polarity is low */
+	u_long vl_clk_pol;	/* clock polarity */
 
 	/* Horizontal control register. */
 	u_long vl_hsync_len;	/* Length of horizontal sync */
Signature · 1 line
1.7.1
author
#2 lore raw

PATCH v3 1/1 video: atmel/lcd: add LCD driver for new Atmel SoC

Hi Anatolij,

Quoted 17 lines · Anatolij Gustschin

From: Bo Shen<[email protected]>

The new Atmel SoC (at91sam9x5 series and at91sam9n12) add a totally different LCD controller. Add this new driver to support it.

Using CONFIG_ATMEL_HLCD (distinguish with CONFIG_ATMEL_LCD) to enable this in board configuration file.

---
Changes since v2:
- rebase on current tree
- convert to use struct for register offsets
- fix indentation in header file
- slightly revise commit log

Quoted 7 lines
  drivers/video/Makefile       |    1 +
  drivers/video/atmel_hlcdfb.c |  211 ++++++++++++++++++++++++++++++++++++++
  include/atmel_hlcdc.h        |  231 ++++++++++++++++++++++++++++++++++++++++++
  include/lcd.h                |    3 +-
  4 files changed, 445 insertions(+), 1 deletions(-)

create mode 100644 drivers/video/atmel_hlcdfb.c
create mode 100644 include/atmel_hlcdc.h

Verified on Atmel SoC. It works well.
Thanks

Best Regards,
Bo Shen

#3 lore raw

PATCH v3 1/1 video: atmel/lcd: add LCD driver for new Atmel SoC

In reply to Anatolij Gustschin
Quoted 17 lines · On Fri, 25 May 2012 12:59:58 +0200 Anatolij Gustschin <[email protected]> wrote:

From: Bo Shen <[email protected]>

The new Atmel SoC (at91sam9x5 series and at91sam9n12) add a totally different LCD controller. Add this new driver to support it.

Using CONFIG_ATMEL_HLCD (distinguish with CONFIG_ATMEL_LCD) to enable this in board configuration file.

---
Changes since v2:
- rebase on current tree
- convert to use struct for register offsets
- fix indentation in header file
- slightly revise commit log

Quoted 7 lines
 drivers/video/Makefile       |    1 +
 drivers/video/atmel_hlcdfb.c |  211 ++++++++++++++++++++++++++++++++++++++
 include/atmel_hlcdc.h        |  231 ++++++++++++++++++++++++++++++++++++++++++
 include/lcd.h                |    3 +-
 4 files changed, 445 insertions(+), 1 deletions(-)
 create mode 100644 drivers/video/atmel_hlcdfb.c
 create mode 100644 include/atmel_hlcdc.h

Applied to u-boot-video/master. Thanks!

Anatolij

#4 lore raw

PATCH v2 1/1 video: atmel/lcd: add LCD driver for Atmel new SoC

In reply to Bo Shen

Hi,

On Tue, 22 May 2012 16:47:29 +0800
Bo Shen <[email protected]> wrote:
...

Quoted 5 lines
drivers/video/atmel_hlcdfb.c new file +0 -0
new file mode 100644
index 0000000..0fd7800

...

drivers/video/atmel_hlcdfb.c line 52

Quoted 2 lines
drivers/video/atmel_hlcdfb.c new file +2 -0
+#define lcdc_readl(mmio, reg)		__raw_readl((mmio)+(reg))
+#define lcdc_writel(mmio, reg, val)	__raw_writel((val), (mmio)+(reg))

Wolfgang won't accept base + offset for register access, we should use struct instead. Converted patch is on the way, please review/test.

Thanks,
Anatolij

author
#5 lore raw

PATCH v2 1/1 video: atmel/lcd: add LCD driver for Atmel new SoC

Hi Anatolig,

Quoted 11 lines · Anatolij Gustschin

Hi,

On Tue, 22 May 2012 16:47:29 +0800
Bo Shen<[email protected]> wrote:
...

Quoted 5 lines
drivers/video/atmel_hlcdfb.c new file +0 -0
new file mode 100644
index 0000000..0fd7800

...

Quoted 5 lines

drivers/video/atmel_hlcdfb.c line 52

Quoted 2 lines
drivers/video/atmel_hlcdfb.c new file +2 -0
+#define lcdc_readl(mmio, reg)		__raw_readl((mmio)+(reg))
+#define lcdc_writel(mmio, reg, val)	__raw_writel((val), (mmio)+(reg))

Wolfgang won't accept base + offset for register access, we should use struct instead. Converted patch is on the way, please review/test.

This converted patch has been verified. It works well on Atmel SoC (at91sam9x5ek, and etc).

Quoted 3 lines

Thanks,
Anatolij