S1D135x1: add option to disable init waveform

Add `clear_on_init' option which can be set to 0 or 1 via
the `setopt' command and the sysfs control inferface.  This
respectively disables or enables the init waveform update
when the driver is initialised.  It is enabled by default.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335xevm: configure all PLDEK pins as GPIOs

Add a pinmux table with the list of GPIOs used on the Plastic
Logic Display Evaluation Kit to make sure they're all initialised
as GPIOs (MUX_MODE7).  This enables them to be exported via the
user-land GPIO sysfs interface, unless some driver requires them.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: drop ASNYC support and use `hotplug' SPI config

* drop all the code that uses the ASYNC parallel bus as it's not
  supported any more and likely to be broken
* drivers/video/Kconfig: remove CONFIG_MODELF_CONNECTION_* as
  only SPI is used now
* add include/linux/modelffb.h with new structure
  `struct modelffb_platform_data' to contain the SPI board info
  as populated by the board file
* register as a platform driver and platform device, then hotplug
  the SPI driver and device based on the SPI board info passed
  via the platform data structure using `spi_new_device'
* unregister the SPI driver and device when removing the modelffb
  module, which frees the SPI bus + chip select so it can be used
  by another SPI hotplug driver
* compile-out all the HRDY_GPIO code for now, until it's
  configured as part of the platform data
* use stubs for the SPI driver functions for now as all the
  framebuffer management is done by modelffb as a platform driver

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: rename CONFIG_MODELF_PL_Z5_Z0 -> PL_Z5

* drivers/video/Kconfig: rename PL_Z5_0 -> PL_Z5 as it
  applies to all Hummingbird Z5.x board versions
* pl_hardware: use PL_Z5 instead of PL_Z5_0

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335xevm: update S1D135x1 configuration

* pass SPI board info via modelffb_platform_data to allow dynamic
  board configuration `hotplug'
* drop support for ASYNC (now SPI only)
* tidy-up the pinmux tables
* fix some compiler warnings
* rename PL_Z5_0 -> PL_Z7

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
spidev: add dynamic hotplug configuration

Add a platform driver that will use the spi_new_device function
to dynamically configure an spidev device.  This enables hardware
to be hotplugged and removed as the SPI bus.chip_select
configuration can then be freed.  Other drivers following this
scheme can thus share a same SPI port.  The board configuration
needs to define the spidev_hotplug device with spi_board_info as
platform data (only a single device for now).

This feature is enabled by the CONFIG_SPI_SPIDEV_HOTPLUG
build-time option.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335xevm: add spidev hotplug + tidy-up pix mux

* group all the pin multiplexer configuration for the PL hardware
  into pldek_pin_mux with all the various build options
* add spidev hotplug platform device configuration to allow spi1
  to be shared between the modelffb and spidev drivers
* add spidev_hotplug_init to register the spidev_hotplug device
* only register the modelffb platform device in modelf_init

This configuration has been tested successfully on a HB Z5.1 with
both S1D135x1 (modelffb) and Solomon (spidev) drivers with a
single build and run-time switch.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
pl_hardware: remove unused GPIOs + tidy-up

* remove unused GPIO definitions for LEDs and buttons
* rename functions for consistency
* fix MODULE_AUTHOR string

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: add modelffb_platform_data to modelffb_par

Add a pointer to the platform data structure in modelffb_par so
it can be used easily in all the driver functions.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: move GPIO and HIRQ configuration to platform data

Stop using hard-coded macros in the modelffb driver and use
run-time definitions from the platform data instead, which need
to be set as part of the platform configuration.

* Kconfig: remove MODELF_SPI_WITHOUT_HDC
* include/linux/modelffb.h: add entries for control GPIO and HIRQ
  interrupt
* modelffb: use platform data values instead of macros

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335xevm: populate new modelffb_platform_data values

Add GPIOs and HIRQ values to the modelffb_platform_data
structure, adjusted for each target hardware.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335xevm: fix compiler warnings

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: tidy-up GPIO init and error handling

* add modelffb_setup_gpio function used when the driver is loaded
  to request a GPIO and print an error message if it fails
* fix various error handling labels to make sure resources are
  freed if anything fails during the driver initialisation

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335xevm: set maximum S1D13541 SPI clock to 24MHz

Set the maximum SPI clock to 24MHz which is still under
the specified maximum of 32MHz.  This has been tested
successfully with a HB Z1.3 and Z5.1.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: add MODELF_FB_PL_Z6_Z7 configuration

Add MODELF_FB_PL_Z6_Z7 configuration option to select the
new Hummingbird Z6.x and Z7.x with associated GPIO
definitions in pl_hardware.c.  This is an intermediate step
and the Z6.x and Z7.x are not actually supported yet.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335xevm: add GPIO definitions for HB Z6 and Z7

Add the pldek_pin_mux entries for HB Z6.x and Z7.x as well
as the GPIOs to define the keypad.  This has been tested
with HB Z1.3 and Z5.1 + Epson and Solomon targets.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
pl_hardware: rename HVPMIC -> MAX17135

In preparation to support more than one HVPMIC, rename all
the HVPMIC definitions with MAX17135 for the Maxim part.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
arch/arm/mach-omap2/mux33xx.c: define gpio2_2 mux entry

Set the MODE7 of GPMC_ADVN_ALE to gpio2_2.  This pin is available
on the BeagleBone expansion header P8.7 and for some reason was
configured for a different usage than GPIO.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
pl_hardware: add support for TI TPS65185 HVPMIC + HB Z6-Z7

Add code to initialise and use the TI TPS65185 HVPMIC and its
internal DAC to generate the VCOM voltage.  This can be used on
PL Hummingbird Z6.x and Z7.x which have this TI HVPMIC.

Add a hvpmic_id field to the pl_hardware_config structure to let
the caller choose which HVPMIC to use.  The discrete VCOM DAC is
used only with the Maxim MAX17135 HVPMIC.

The VCOM calibration is not enabled when using HB Z6-Z7.

Also add the GPIOs for the Z6-Z7 boards to the list, and review
the GPIO handling functions to make the code more maintainable
with the Z1.3 and Z5.x GPIOs using a pl_hardware_gpio_init_data
table.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: choose appropriate HVPMIC for pl_hardware

Depending on the target hardware being used, either choose
the TI TPS65185 or Maxim MAX17135 HVPMIC in the pl_hardware
configuration structure.

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