ASoC: msm: Add check for both offset and index variable

-The offset and index variable may leads to array out of
boundary exception.
-Added offset and index overflow check.

Change-Id: I1f71ee595944573e85d77d2001f656bd8ba53806
CRs-fixed: 583931
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
pwm: qpnp: provide both nsec/usec-supported pwm config() functions

Now implement pwm_config() to support nanosecond parameters, which
has better granularity in some situation, for example, if the number
of backlight brightness levels is 256, using microseond parameters
will only get nearly 50 levels.

But Qualcomm platform should support 384 seconds pwm-period at most,
the above standard API couldn't satisfy the requirement of the bigger
period, so we also provide pwm_config_us() this such platform related
API.

CRs-Fixed: 545809
Change-Id: Ia3ea9904141f69c1f40a8619ba8d9fe891e3460a
Signed-off-by: Xu Kai <kaixu@codeaurora.org>
pwm: qpnp: modify to use pwm_config_us() for some qcom drivers

Kernel 3.10 defines pwm_config() to use nanosecond parameters, but
now some qcom drivers still use pwm_config() to pass microsecond
parameters. pwm-qpnp driver has already provided a new API called
pwm_config_us() to support microsecond parameters, so we should
modify to use pwm_config_us() instead of pwm_config() for these
drivers.

CRs-Fixed: 587715
Change-Id: I222440bb7636972b9ae35eba175ddffc58095ce8
Signed-off-by: Xu Kai <kaixu@codeaurora.org>
Merge "pwm: qpnp: provide both nsec/usec-supported pwm config() functions"
Merge "pwm: qpnp: modify to use pwm_config_us() for some qcom drivers"
ASoC: msm: qdsp6v2: Fix ion_import failure

When ion_import_legacy api fails,we should not
destory the client instead just bail out.

CRs-Fixed: 620370
Change-Id: Icbcf4dadd5f00e1cf4d7a356ee1c0f5835dcb4c4
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
msm: camera: Cleanup msm_generic_buff list while close

Cleanup the camera msm generic buffer manager list
when all v4l2 nodes are closed.

Change-Id: I27636533621d3329bcc5dffba8c003d2cdc252c2
CRs-Fixed: 599983
Signed-off-by: Azam Sadiq Pasha Kapatrala Syed <akapatra@codeaurora.org>
leds: leds-qpnp: PWM period granularity auto selection for leds

Some leds use PWM wave to control the brightness. The original
period granularity is using microsecond by default, it's a very
large granularity and will cause some user experience issues on
leds' brightness.

Auto select the PWM period granularity between microsecond and
nanosecond according to the range that hardware can support.

CRs-Fixed: 622683
Change-Id: I0669a0c88ca2ba491f0a53be6070476d61374d72
Signed-off-by: Xu Kai <kaixu@codeaurora.org>
leds: leds-qpnp: avoid calling pwm_disable when scaling leds' brightness

The LPG hardware supports dynamically changing the duty cycle
without disabling the output. So pwm_disable calling can be
removed when setting nonzero brightness level, which avoid the
delays of the PWM wave output when changing PWM configuration.

CRs-Fixed: 622683
Change-Id: I8c5bdef1992c41f73fe16cce615b2d1d6dad7775
Signed-off-by: Xu Kai <kaixu@codeaurora.org>
Merge "leds: leds-qpnp: PWM period granularity auto selection for leds"
Merge "leds: leds-qpnp: avoid calling pwm_disable when scaling leds' brightness"
Revert "NFC: Continue probe if i2c poke fails"

This reverts commit 1e21cab3279c4d9f08932476c495a2dc6778ed77

Change-Id: I692559015cf71452b053c0cfe4bb5bad5a922acc
Merge "Revert "NFC: Continue probe if i2c poke fails""
Merge "ASoC: msm: qdsp6v2: Fix ion_import failure"
msm: kgsl: Remove sscanf() from kgsl_pwrctrl.c

Replace sscanf() in kgsl_pwrctrl.c with a generic function to safely
convert 32 bit unsigned ints.

CRs-fixed: 563585
Change-Id: Ic0dedbad10e2264ec8fccab622d094d123b49b77
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
ASoC: msm: Null dereference check added

In asm_read function we should check buffer pointer
before it is dererferenced.

CRs-Fixed: 612682
Change-Id: I1968c038e1d35381bf174000287d542441e41092
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Merge "msm: camera: Cleanup msm_generic_buff list while close"
Merge "ASoC: msm: Null dereference check added"
msm: camera: Fix various small issues in Actuator driver

Bound check and validate userspace parameters direction,
number of steps and direction sign. Also fix possible
memory leak in certain error cases.

CRs-Fixed: 511349
Change-Id: Icaa324468574494fb40f2de78e522090806744cb
Signed-off-by: Hariram Purushothaman <hpurus@codeaurora.org>
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Merge "msm: camera: Fix various small issues in Actuator driver"