arm: at91: refactor lcdc-includes

Among others the HEO-ISR bit is fixed.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Conflicts:
	arch/arm/mach-at91/at91sam9261_devices.c
	arch/arm/mach-at91/at91sam9263_devices.c
	arch/arm/mach-at91/at91sam9g45_devices.c
	arch/arm/mach-at91/at91sam9rl_devices.c
	arch/arm/mach-at91/include/mach/atmel_lcdc.h
video: atmel_hlcdfb: add new driver

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
WIP: add clut resource

Warning: will currently break old AT91-boards!

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
video: atmel_lcdfb: HLCD modifications

HAS TO BE REWORKED: break compatibility with previous LCD IP due to register
map changes

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
atmel_lcdfb: change pixel clock ratio calculation

DIV_ROUND_UP() was used to calculate the pixel clock divider
in atmel_hlcdfb_setup_core_base().
But this rounding was producing a bigger divider each time it was called.
We replace by DIV_ROUND_CLOSEST() to calculate it.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
video: atmel_lcdfb*: protect bl_power with CONFIG_BACKLIGHT_ATMEL_LCDC

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
video: atmel_lcdfb: adapt to all IP configurations

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
video: atmel_hlcdfb: add second overlay support

New LCD Controller can support a second overlay.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
video: atmel_hlcdfb: increase the base layer AHB burst length

Increase the base layer AHB burst length from 4 to 16.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
video: atmel_hlcdfb: don't read a write only register

Reading a write only register and using its value is useless.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
video: atmel_hlcdfb: don't wait when going to suspend

For an unknown reason polling the end of dma transfer before going to suspend
leads to an infinite loop on sama5d3x.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
video: atmel_hlcdfb: now, suspend/resume is managed only by the base layer

When going to suspend or resume the functions will be called by the base layer
but also by the overlay layers. It's not necessary to do it several time.
Moreover the base address for overlays is not the base address of the IP so
offsets to access some registers are wrong.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
drivers/video/atmel_hlcdfb.c: fix bad timing configuration

The right correspondance between LCD margins and LCD timings is:
* upper margin -> vertical back porch
* lower margin -> vertical front porch
* left  margin -> horizontal back porch
* right margin -> horizontal front porch

 Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com>
drivers/video/atmel_hlcdfb.c: Remove bad default configuration

By default the LCD controller is configured to "launch" pixel data and control signals on the
falling edge of the pixel clock. We have removed this default configuration.

Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com>
video: atmel_lcdfb: add error-msg when out of memory

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
video: atmel_lcdfb: remove duplicated include

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
video: atmel_lcdfb: add pinctrl

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
video: atmel lcd only request the pinctrl once

Introduce simple bus to represent the LCDC itself so we can attached the
pinctrl to it

Conflicts:
	drivers/video/atmel_lcdfb_core.c
video: atmel_lcdfb: move platform data to new header location

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
drivers/video/atmel_lcdfb.c: fix error return code

Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

upstream commit is: 130320bfe0ca88b0f80dde758a551b5beffb9f62

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>