pl_hardware: add delay to wait for TI PMIC to power down

The TI TPS65185 PMIC has a delay of 3ms when powering down. Add a delay
to give the PMIC a chance to fully power down when disabling pl_hardware.
The mdelay in the driver is set to 4ms as the entire power down process
takes slightly longer than 3ms.
S1D135x1: Disable the PMIC before putting the Epson chip into sleep

Currently, the Epson chip is being put to sleep before powering down
PMIC. This causes an unwanted spike in power usage. The PMIC should
be disabled first.
add dummy touch screen driver `dummy-ts'

This is a virtual device driver, it uses sysfs entries to
generate input events.  It is useful to automate tests involving
user touch input.

The default resolution is 640x480, which can be set to anything
else using the `xres' and `yres' module parameters.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
add dummy keyboard driver `dummy-kbd'

This is a virtual device driver, it uses sysfs entries to
generate input events.  All keycodes can be used within the
0..KEY_MAX (0x2ff) range.  It is useful to automate tests
involving user input.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335x_evm_z6_z7_defconfig: build at24 driver as loadable module
modelffb: convert panel_type param into display_type option

Some display hardware contains an EEPROM with the display type,
which can only be accessed when the power is turned on.  The
display driver turns the power on, which makes it impossible to
read the display type from the EEPROM before loading the driver,
so this doesn't work as a module parameter.

Instead, the panel_type parameter can now be set via the control
set_opt command, and is also renamed to display_type for
consistency.  Like interleaved_sources, it needs to be set before
the chip is initialised as it has an impact on the frame buffer
size and display resolution registers.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
modelffb: Add handling for manual temperature mode and temperature setting.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
modelffb: do not update option if invalid value

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
modelffb: Add readonly sysfs entries for temperature and temperature_auto.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
modelffb: Update waveform as soon as a manual temperature is set

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
modelffb: enable manual mode on all platforms

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335xevm: disable keypad on PL Hummingbird Z5.x

The keypad GPIOs are connected to a switch 3.3V regulator on
Hummingbird Z5.1, which is also powering the ePDC.  When the ePDC
is switched off, all the GPIOs read 0 which causes spurious key
events.  The keypad is now disabled on HB Z5.1 until the issue is
fixed in hardware.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
modelffb: fix info message about interleaved sources

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
pl_hardware: remove dead code for old CPLD

Remove old dead code for the CPLD as it's not used with small
displays and associated supported platforms.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
pl_hardware: add static init/free functions

Add pl_hardware_static_{init|free} to allocate and free static
resources.  This basically configures the GPIOs, which as a side
effect can turn the power on when needed by the modelffb driver.

This is still an interim solution until the pl_hardware module
becomes a separate driver with some dedicated platform data.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
modelffb: use pl_hardware_static_{init|free}

Call the new pl_hardware_static{init|free} functions when the
driver is probed and removed to ensure the hardware-specific GPIO
configuration is always applied before trying to access the Epson
chip (or the EEPROMs from userland).

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am33x_evm_z*_defconfig: update with dummy inputs + at24

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335x_evm_z6_z7_defconfig: use CONFIG_I2C_S1D135X1

The standard behaviour with recent small displays is to use
the Epson S1D13541 master I2C bus to access the display
hardware devices.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
modelffb: avoid crash by checking init state in sysfs I/O

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
pl_hardware: remove temperature-dependent VCOM

* remove support for temperature-dependent VCOM voltage as it was
  never used and it is not needed

* tidy-up the code by using u8 and u16, long for vcom_mv and add
  pl_hardware_get_vcom function to retrieve the value last stored

* add tests to check the module has been initialised before
  accessing its API (plhw_is_init)

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>