msm_fb: Fix the hang issues due to improper usage of vsync

For LCDC/DSI command/DTV interfaces, fix the various corner cases
of wait4vsync getting stuck due to TG turned off/wait4sync
count being reset to zero etc. Add timeout to waiting for vsync
to avoid hang issues when vsync interrupt is turned off.

Change-Id: I97322f3f1c6cc13b484cfa594d2fadcdec53d48a
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
lcdc_ld9040: fix locking in lcd_sysfs_store_auto_brightness()

  * mutex was unlocked before the call to lcdc_ld9040_set_brightness()

Change-Id: I73765ca66f3dce908f93290d0e76da8e72c1d2ae