input: touchscreen: Add threaded irq support to Goodix driver

Add threaded irq support to Goodix touchscreen driver to reduce
the time spent with interrupts diabled to a bare minimum by
pushing the processing out into the kernel thread.

CRs-fixed: 563900
Change-Id: I3ade13181957d327ad9d0266b1999a4b0f2d8d1a
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
msm: kgsl: avoid zero length scatterlist allocation

During sglist allocation we calculate sglen as
per below

sglen_alloc = PAGE_ALIGN(size) >> PAGE_SHIFT;

sglen_alloc can be zero if size falls within the
last page. For example, when size = 0xFFFF_FF7B,
PAGE_ALIGN(0xFFFF_FF7B) will be 0, considering
0x1000 (4kb) PAGE_SIZE. if kzalloc() with
zero size, it will return ZERO_SIZE_PTR which is
not NULL and we always do NULL check. Dereferencing
ZERO_SIZE_PTR will lead to a distinct access fault.

Conflicts:
	drivers/gpu/msm/kgsl_sharedmem.h

Change-Id: Ibcc6198438c13b5111be0faa736328db92511597
CRs-Fixed: 563106
Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
radio: iris: Use kernel API to copy data from user space

Use copy_from_user kernel api to copy any data from user space
to kernel space.

Change-Id: Ia3b7bb0f98180bd8792c1c18e930cb5609b8dc82
CRs-Fixed: 540320
Signed-off-by: Ayaz Ahmad <aahmad@codeaurora.org>
msm: lpm_levels: remove debug print

remove a pr_info that was added for debug purpose. This is
causing excessive logging issues.

CRs-fixed: 589307
Change-Id: I1f7bcb5282b51734cb7bf30ff933d65714445cba
Signed-off-by: Venkat Devarasetty <vdevaras@codeaurora.org>
msm: mdss: Add six zone LUT size as PAv2 parameter

Added six zone LUT size as a parameter to PAv2 in order for the size to be
specified by the user. This size is sanitized based on the required LUT
size.

Change-Id: Iaf1b418ce1a3ec4b5013b1192c7f3b7de5827e3d
Signed-off-by: Benet Clark <benetc@codeaurora.org>
msm: mdss: Fix error in BL linearity inverse LUT check

Associate the maximum index for the BL linearity inverse LUT with the
table size and not the maximum backlight value. The maximum backlight
value can cause an out of bounds index for the BL linearity inverse LUT.

Change-Id: I35fb276f8f1cc6be3be158fa25e6442be438cbf0
Signed-off-by: Benet Clark <benetc@codeaurora.org>
leds: leds-qpnp: Correctly terminate of_device_id array

Correctly terminate of_device_id array to avoid of_device_lookup()
incorrectly probe an additional instance of leds-qpnp device.

Change-Id: Ie6c61b4500a5fbe792e3154a761c235573c7e6bf
CRs-Fixed: 582141
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
USB: gadget: f_uac1.c: Fix bug in accessing freed buffer pointer

Current driver is accessing the buffer pointer after it is freed.
This results in target crash. Hence fix the bug by setting pointer
variable to NULL before it is freed.

CRs-Fixed: 564289
Change-Id: I4df7513748f4378f6adce682102c8ddd3811ead8
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
msm: mdss: Allow AD register programming in AD calibration mode

When in AD calibration mode, AD should still be programmed even though all
other post processing features should be temporarily disabled.

Change-Id: I15ab36c657d9936386ff24cdd343711e29e157bb
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm: mdss: Read the max brightness level from device tree

Parse the maximum brightness level supported by different targets from
device tree instead of defining a macro for all targets.

Change-Id: If997f87c75d763395844cc11dbb8b8c0c24f4212
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
msm: vidc: fix corruption of registered buffer list

The buffer list for output buffers is accessed from
different threads leading to race conditions. Consider
the case of firmware throwing up a fatal error, which gets
propagated to v4l2 client. The v4l2 client closes the
driver fd, which will trigger msm_vidc_release_buffers
to release all output buffers and free node from
the registered buffer list. During this time, if
firmware sends a release reference event, the buffer
node being accessed in msm_vidc_release_buffers could
be freed, triggering kernel panic.

Change-Id: I522edff06a62dbc2ab60d6cca5990babb18d5c6c
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
power: qpnp-charger: allow 0 mA iusbmax request

Currently 0 mA requests for qpnp_chg_iusbmax_set
are rejected.
Fix this by allowing 0 mA and configuring IUSB_MAX
to the lowest setting of 100 mA (0x00).

Change-Id: Iff1ee312e85e3fe33d6421630215196125c1136f
CRs-Fixed: 580614
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
mmc: core : fix arbitrary read/write to user space

In the MMC card debug_fs the read and write handlers use the strlcat
and sscanf, without checking the pointer given.
Since the pointer is not checked it is possible to write
everywhere (ring 0 or 3).
In order to fix it, an access_ok function is being used to verify
the buffer's pointer supplied by user is valid.

CRs-fixed: 545716
Change-Id: Ia710b6af5a95974fc930ca902e8ff18afa4e17ba
Signed-off-by: Raviv Shvili <rshvili@codeaurora.org>
mmc: core : fix arbitrary read/write to user space

In the MMC card debug_fs the read and write handlers use the strlcat
and sscanf, without checking the pointer given.
Since the pointer is not checked it is possible to write
everywhere (ring 0 or 3).
In order to fix it, an access_ok function is being used to verify
the buffer's pointer supplied by user is valid.

CRs-fixed: 545716

Change-Id: I13ca736337fefe29ff9b0df6a318e7d92240f8b2
Signed-off-by: Raviv Shvili <rshvili@codeaurora.org>
ARM: dts: msm: Move data to devicetree for 8926

Move the cpu frequency and voltage data to devicetree.

Change-Id: I69a4cf3a553815a6e687fb8e3009cb31f440e809
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
msm: usbaudio: Add check for NULL before dereferencing

kzalloc() and usb_ifnum_to_if() both APIs can return NULL. Current
code is not checking return value and derefencing which may crash
device if it is set to NULL. Fix this by checking return value
against NULL and handling the same.

CRs-Fixed: 562273
Change-Id: I0d2c910f43321e94fc447b19ae3e3207727e24f3
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
input: synaptics_i2c_rmi4: Reinitialize list after freeing it

During firmware update and device reset through sysfs, query info
needs to be updated in support_fn_list. However, both these procedures
free the existing list before updation without setting its list head
to consistent state. Reinitialize the list head of support_fn_list
to avoid memory fault during updation.

CRs-Fixed: 589295
Change-Id: I560e2df53d258e273ff9890c7c62b90a58a423f7
Signed-off-by: c_sgarna <c_sgarna@codeaurora.org>
clock-mdss-8974: Switch HDMI clocks to use the new PLL implementation

This change cleans up the HDMI VCO/PLL implementation. It implements
the HDMI VCO clock and uses generic div and mux clocks to align to
the HDMI PLL architecture.

CRs-Fixed: 456315
Change-Id: I19ef344aafc954935cd6d236f3725bf168658ec9
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm: clock-mdss-8974: Enable AHB clock before register access

Enable the MDSS AHB clock for proper HDMI PHY PLL register
access. Disable the MDSS AHB clock after register access.

Change-Id: Ice8e723333f3c041bc1cffa2ebc8d7d40a8817d2
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm: clock-mdss-8974: Proper hdmi set rate

Do not call set rate if the rate is zero. Reset the flag which sets
the rate on cable disconnect so that next cable connect can set the
rate again.

Change-Id: Ieb8eed3760c4b285182ae47d732352771d13b020
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>