include/linux/pmeter.h: update with user-side functions

Synchronise pmeter.h to include the user-side functions in
order to have a single version of the file used by both the
kernel driver and user-side applications.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: add option to disable deferred I/O

* drivers/video/Kconfig: add MODELF_DEFERRED_IO to disable
  deferred I/O in modelffb driver when this configuration option
  is not enabled
* add standard read/write/mmap implementation when
  MODELF_DEFERRED_IO is not enabled, and use previous
  implementation otherwise

Disabling the deferred I/O should prevent automatic updates from
being generated.  This disables parts of the code that would
otherwise automatically trigger new display updates based on the
data being written to the framebuffer.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: add SYNC_LOG messages using pmeter

When enabled, some pmeter_log calls are added to help diagnosing
synchronous updates behaviour.

+ remove incorrect SYNC_BUSY state when filling the buffer
  (typically used during init waveform)

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: tidy-up code in TIME_SEND_IMAGE macro

* only enable image transfer time log message when
  TIME_SEND_IMAGE is set to 1, not when CONFIG_MODELF_DEBUG is
  enabled
* tweak log message to show the width, height and number of
  pixels sent

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: tidy-up function signatures

* return void instead of int when no error can be propagated
* use const pointers in write functions
* tweak code formatting (reduce long lines)

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: inline more functions

Add several `inline' keywords to ensure some small functions and
other functions used only once or twice are inlined by the
compiler.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: remove unnecessary reg read when using SPI

Remove unnecessary extra status register read when using SPI.
This seems to only have a side effect when using the parallel
interface, and slows down the SPI transactions for no reason
otherwise.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: add optimised __modelffb_write_n16_spi function

Add __modelffb_write_n16_spi function to write a series of 16-bit
words in the same SPI message.  This is an optimised SPI
implementation which is used in the __modelffb_command_pX
functions.  It helps speeding up the SPI transfers.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: add optimised __modelffb_read_reg_spi function

Add __modelffb_read_reg_spi function to read a register over SPI
using a single SPI message to speed up the SPI data transfers.
This is especially useful when the HRDY hardware signal is not
available and the status register is polled frequently.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D134x1: fix and disable SYNC_LOG

* only define modelffb_sync_status_table when SYNC_LOG is enabled
* fix disabled definition of SYNC_LOG
* disable SYNC_LOG to avoid filling up the pmeter log

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: fix typos and spelling in function names

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: convert image_pool from uint32_t to void *

The image_pool member of struct modelffb_par is really a pointer,
to contain some temporary image data.  It can then be cast to 8-
or 16-bit pointer types depending on the pixel format.

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
S1D135x1: transfer more than one line of image data at a time

Instead of working on a single line at a time, increase the image
pool size to be up to 32KB.  This can contain about 40 lines of
400 16-bit pixels instead of one.  The number of lines is
determined to use the maximum number of bytes in the pool.

Then modify the code that prepares and sends the image data to
use all the lines in one block, which greatly reduces the SPI
transfer overhead.  The overall time to send the image data is
typically divided by 2.

+ print message with number of lines and size of image pool

Signed-off-by: Guillaume Tucker <guillaume.tucker@plasticlogic.com>
am335x_evm_*_defconfig: update with latest config options

* enable PMETER
* disable MODELF_DEFERRED_IO

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