misc: bln: import BLNv10 with updates and changes by Christopher83

Patchset #1:
  bln: Changes to fix the suspend problems caused by BLN
    Changes on the bln module:
     - New centralized methods for wakelock management (init, destroy, acquire and release)
     - Some changes to call the new methods

Patchset #2:
  This patch includes new implementations and changes for BLN module
  to better manage existent features and provide additional in-kernel
  features.

  1) Add in-kernel management of notifications with static lights:
      Two new sysfs attributes allow to enable in-kernel notifications
      with static lights.
      Set "/sys/class/misc/backlightnotification/in_kernel_static" to 0
      if you want to disable this feature, otherwise set it to 1 to
      enable it, the default value is 0 (disabled).
      Set "/sys/class/misc/backlightnotification/static_maxtime" with the
      preferred lights timeout in seconds (from 1 to 3600 sec = 1 hour),
      the default value is 60 seconds = 1 minute.
  2) Possibility to set separate intervals for blink ON and OFF transitions:
      Two new sysfs attributes allow to set separate intervals for blink
      ON and OFF transitions.
      Set "/sys/class/misc/backlightnotification/blink_interval_on" and
      "/sys/class/misc/backlightnotification/blink_interval_off" with the
      preferred interval in milliseconds for the related blink transition,
      the default value is 500 milliseconds.
      The attribute "/sys/class/misc/backlightnotification/blink_interval"
      is still provided to ensure compatibility with other apps, if set,
      both intervals for blink ON and OFF will be updated with the same
      provided value.
  3) Possibility to set or not set static lights after the timeout of
     blinking lights:
      A new sysfs attribute allows to enable in-kernel notifications with
      static lights after the expiration of blinking timeout.
      Set "/sys/class/misc/backlightnotification/status_after_blinking"
      to 0 if you want to turn the lights off after blinking timeout,
      otherwise set it to 1 to turn the lights on, the default value is 0.
  4) Better timeout management for in-kernel blinking lights
      The code to manage the timeout of blinking lights has been revised
      to use a more reliable comparison between jiffies times instead of a
      simple counter.
  5) Use a dedicated workqueue for scheduled works for blinking and static
     lights instead of the shared workqueue
      By using a dedicated workqueue,  blinking and static lights operations
      are performed more efficiently without taking account of the various
      scheduled works from other drivers/processes.
  6) Turn the lights off after system resume if a notification is ongoing
  7) Remove duplicated calls to wakelock routines
  8) Free up the reserved space when the module is removed
  9) Some code cleanup, comments, copyright updates and other minor changes

Patchset #3:
  misc: bln: Cancel pending blinking/static light works on lights off
    When the notification lights are turned off, be sure that there are
    no more pending blinking/static light works.

Other changes:
  1) Make the led-class implementations compatible with this new version.
  2) Add/edit the Kconfigs

Signed-off-by: Cristoforo Cataldo <cristoforo.cataldo@gmail.com>
Signed-off-by: Vineeth Raj <contact.twn@opmbx.org>
pico_defconfig: enable BLN && BLN Blinks by default

Signed-off-by: Vineeth Raj <contact.twn@opmbx.org>
qdsp5: Add vocpcm driver
Revert "add mdp_display_commit struct to hackishly fix display-legacy-exp build"

This reverts commit ab09abd15e326b68f35cff77913a03779f9f2186.

This should have never been in the kernel, but should have rather been
overridden in the device tree.
msm: display: Buffer sync point support

Add MSMFB_BUFFER_SYNC ioctl for the communication of
the acquired and released fence fd between kernel and hwc.

Wait for acquired fence before pan display.
Release the previous released fence after pan display

Change-Id: I6534aed574a025d948581e70465f06a86b46c868
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
msm: kgsl: hold a process_private refcount in process_mem_print

There is a possible race condition where the process can be going
away while its debugfs 'mem' file is being read, which could cause
memory corruption.

Conflicts:
	drivers/gpu/msm/kgsl.c
	drivers/gpu/msm/kgsl_device.h

CRs-Fixed: 627780
Change-Id: I697486faeb3f186fd1220d0acc1e449a4f7b77b0
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Look up the process struct in process_mem_open()

The pointer to an active process struct stands the risk of going stale
if process_mem_open() is called just before the debugfs dentry is
destroyed.  Instead of storing and using the pointer pass the process pid
to process_mem_open() and do a lookup to ensure that we always get active
processes.

Conflicts:
	drivers/gpu/msm/kgsl.c
	drivers/gpu/msm/kgsl_debugfs.c

Change-Id: Ic0dedbad3a3b54dc96251663fdf89c466fef3ca5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Gaurav Gagrani <ggagrani@codeaurora.org>
msm: kgsl: prevent kgsl_get_pagetable from returning a destroyed pt

A race condition exists between kref_get_pagetable and
kref_put_pagetable such that is is possible to put the last
reference to a pagetable slightly before it has been removed
from the list. By checking kref_get_unless_zero we can determine
if the last reference has already been released. This is safe
because the list is protected by a ptlock.

Change-Id: If6a75e9ca0dec6a12bda5739f835c936a4c3a3b4
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
msm: kgsl: Fix spinlock recursion in destroy pagetable

pagetable list is protected by ptlock. Few functions
while iterating over a pagetable list takes same ptlock,
kgsl_destroy_pagetable() also need same lock. This will
cause spinlock recursion if kgsl_destroy_pagetable()
called while iterating over a list. Created two versions
of same function one is with lock and other is without
lock.

CRs-Fixed: 621172
Change-Id: I61440f99022fce8629a57bb5661e2eef9613187b
Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
Signed-off-by: Gaurav Gagrani <ggagrani@codeaurora.org>