msm: jpeg: Handle ERESTARTSYS properly

ERESTARTSYS return code for wait_* functions should be
propogated all the way to ioctl call.

Bug: 11856490
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
hammerhead_defconfig: Enable usb tablet devices and xpad

Bug: 11759904
Change-Id: If83a00279300c9d069d737cfa70fd15f406b73a3
Signed-off-by: jude84.kim <jude84.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: camera: Use correct type for function return code

Using an unsigned integer to hold the signed return code
is wrong. So fix it by using the correct type to hold the
return code.

CRs-fixed: 512824
Change-Id: I389732a9af740174b26c8c43946e638a1be0d2a2
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: camera: Fix various small issues in cci driver

Remove some unused ioctl exposed, Also add
some bound checks for ioctl user params.

Change-Id: Ifdd441fdb25fd20b005c4e4e1ebe4e203f1216ac
CRs-Fixed: 511382
Signed-off-by: Hariram Purushothaman <hpurus@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: camera_v2: CCI release resources in case of timeout

Turn off the CCI clocks and release gpio if reset timeout error is
received in function_msm_cci_init()

Bug: 11825720
Change-Id: Ib4387ce08635e0b4e6458f225bd3013557d6b5fa
Signed-off-by: Evgeniy Borisov <eborisov@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: camera: Reset CCI core based on I2C MASTER

CCI core is used by camera sensor, actuator and EEPROM. CCI core gets
reset first time when either one of hardware modules initializes it.
But, as per hardware requirement sensor has to be powered up before
CCI can be reset. This imposes limitation in the sequence in which
camera is opened. To remove this limitation, initialize CCI core
only for corresponding I2C MASTER everytime either of the hardware
modules initilizes it.

Change-Id: If2d7cc26fe23533243714839e6375f73d5efd4f2
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: camera: Checking an enum value greater than zero

An enum value cci_i2c_master is not checked to be greater than 0.
Add the check.

Change-Id: Ibe75ab7155def45d81b8127c5eda3fa2ed570bce
Signed-off-by: Xu Han <hanxu@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: cci: fix for invalid error handle

fix for invalid error handle in msm cci
- msm_cci_flush_queue function never return
error because variable rc is unsigned int
- msm_cci_init function return result int32_t
but variable rc is int

Change-Id: I2610b08f4eceedfbb8bd07d8027310f43b9ee6bf
Signed-off-by: Vasko Kalanoski <vaskok@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm-hdmi-codec-rx: sync state with HDMI core

To keep the state of the HDMI core and HDMI audio
sessions congruent, audio checks the state of the
core on startup, then notifies the core of the
active audio session.  On shutdown, notifies the
core of the event.

Change-Id: I8f90a4610ed9345c1affa67a7fee306e7d388d85
CRs-Fixed: 539309
Author: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: hdmi: HDMI cable connection status and vote

Add HDMI cable connection status functionality to be used by
audio driver before starting the audio session and vote for
hdmi tx core to remain power on until the audio has completed
its processing.

Change-Id: I35d1bafff472da19e04aa44f4ac91b1c3c0349e1
Author: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Revert "Revert "hammerhead: Enable /dev/diag""

This reverts commit 90642b3f4e788885d8b189be1cdc94bf7838bb42.

Change-Id: I8fefcd80e475fb689514633d92d8af2f3dbd7aa1
Signed-off-by: Dan Trifan <jimsth@gmail.com>
video: slimport: disable not-supported timings

Disable non-supported timings from the HDMI LUT. ANX7808 is able to
support for max 1080p60.

Change-Id: Iaf26fbdd584153cbd570344830e5ac083872b267
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
video: slimport: Fix slimport blinking issue

Link integrity check sometimes failed without external power.
This is a workaround for this failure. Enabling the USB clk prevent
this issue.

Change-Id: I4934c8fe840bd865b6355aefdb565ca00f1c7b69
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
arm/dt: hammerhead: slimport: Fix slimport blinking issue

Link integrity check is sometimes failed without external the power.
This is a workaround for this failure. Enabling the USB clk prevent
this issue.

Change-Id: I793127de438d14e71ee0f104e94fd39e09d7b39b
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Revert "mdss: hdmi: Wait for mdss iommu attached on boot with hdmi"

This reverts commit cdc6e7b7f83bceb9b099c56ac2e0c594634febae.

Signed-off-by: Dan Trifan <jimsth@gmail.com>

Conflicts:
	drivers/video/msm/mdss/mdss.h

Change-Id: I2026e75a7a252a91c6c08810f1207120a21ecfee
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
video: slimport: wait until boot done before start detection

If slimport cable inserted during boot up, slimport could not
work properly since other system is not ready yet. So, wait
until boot completion before start cable detection. The boot
completion should be notified by userspace.

Change-Id: I9fbee9568068b03a3b0d6776cc051a7d87e41c94
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Fix sizeof-pointer-memaccess warning with gcc 4.8

Get size of dereferenced object when using memcpy.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
Fix sizeof-pointer-memaccess warning with gcc 4.8

Used strcmp instead of strncmp to match strings.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
arm/dt: hammerhead: Change the search order of dtb

bootloader searches the dtb matched with board id from appended DTBs.
So changed the order to search latest dtb first.

order:
kernel -> rev11 -> rev11j -> rev10 -> ...

Change-Id: I5d9ff4f1aee6d17616fa67e532283d3d31f8e295
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: camera: modify the number of gpios

gpios such as SENSOR_GPIO_VANA, SENSOR_GPIO_VDIG,
SENSOR_GPIO_VIO, SENSOR_GPIO_VCM, SENSOR_GPIO_OIS_LDO_EN,
and SENSOR_GPIO_OIS_RESET in msm_camera_sensor.h, must be
considered in gpio_num value.

Bug: 11747300
Signed-off-by: insup.choi <insup.choi@lge.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>