sunxi:pm: Fix suspend to RAM

This patch fixes crash in try to suspend to RAM for sun4i and sun5i
machines
Suspend framebuffer on sustem suspend.

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
video:sunxi:disp:Sparse fixes and remove dead code

One possibly fatal warning in disp_lcd.c (mixing enum types)

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:disp:Remove unused b_reg_change variable

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:Remove unused defines

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:Use read(b/w/l) and write(b/w/l) part1

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:Use read(b/w/l) and write(b/w/l) part2

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:Use read(b/w/l) and write(b/w/l) part3

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:Use read(b/w/l) and write(b/w/l) part4

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:Use read(b/w/l) and write(b/w/l) part5

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:Add sunxi_disp_regs.h

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:Use read/write (l/b) instead own macro

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:hdmi:Move hdmi i2c logic to own file

Makes code easier move to newer architectures.
I2C functinality was tested with i2cdump, i2cget and i2cprobe.

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:hdmi:Use define instead of magic number on registers

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
video:sunxi:hdmi:Use read/write (l/b) instead macro

Signed-off-by: Jari Helaakoski <tekkuli@gmail.com>
spi:sunxi: spi board IRQ setting with GPIO management

Read "irq_gpio" value from script.bin and use it to set the IRQ for the SPI board. Some SPI boards should need a IRQ to work properly and register the irq handler inside the device driver.
The "irq_gpio" value is converted using gpiolib function "gpio_to_irq" and assigned to the specific board irq field.

Here is an example of script.txt configuration:

[spi_board0]
modalias = "sun5i_enc28j60"
max_speed_hz = 10000000
chip_select = 0
bus_num = 2
mode = 0
irq_gpio = 1

[gpio_para]
gpio_used = 1
gpio_num = 1
gpio_pin_1 = port:PB04<6><default><default><default>

In this case you can easily assign the PB04 corrensponding interrupt to the network device using the virtual IRQ created by the GPIOlib.

Signed-off-by: Lorenzo Nava <lorenx4@gmail.com>

v3 => v4: Fix gpio_request and spi message

v2 => v3: Fix indentations from hard tabs to spaces

v1 => v2: Fix driver failure when no irq definition was found in script.bin config file
spi:sunxi: fix platform data for correct number of CS's

This patch corrects the platform data so that the correct number of chip
selects are available on both the sun4i and sun5i.
It needs to applied to stage/sunxi-3.0 with Lorenzo Nava's "[PATCH] Sunxi
spi board IRQ setting with GPIO management" applied.

Signed-off-by: Simon Ratcliffe simon@proatomic.com.au
spi:sunxi: fixes a bug with setting up spi transfers

This patch addresses an issue where the first transfers to an spi device
doesn't get set up correctly if it just uses the parameters specified in
the script.bin file and has no overrides in the transfer structure.  The
patch forces the parameters to be setup at the start of each group of
transfers and also removes unnecessary initialisation in spi_sunxi_hw_init.

Signed-off-by: Simon Ratcliffe simon@proatomic.com.au
video: sunxi: disp: fix screen wakeup when using earlysuspend

Commit 1ede6cfd2b ("sunxi-disp: Unify early and normal suspend paths")
causes BSP_disp_*_[close|open] to be called twice when earlysuspend is
in use. This commit skips those calls on the normal suspend path used
when earlysuspend is enabled.

Signed-off-by: Emilio López <turl@linux-sunxi.org>
watchdog: sunxi: Readjust timeout on ioctl

SETTIMEOUT ioctl only adjusted the local timeout value but did not apply
it, so we were not setting the new timeout on the hardware at all until
the next watchdog stop and start cycle (which might not occur at all)

Fix it by running sunxi_wdt_set_timeout to readjust the hardware after
changing the local value.

Signed-off-by: Emilio López <turl@linux-sunxi.org>