ARM: dts: update frequency to corner and quot mapping on msm8226 and msm8610

Some devices need to adjust their CPR quotient value according to the cpu
frequency. The existing configuration uses the same fuse target quotient
for each frequency in a given corner. This configuration is not power
efficient as some corners have a large range of frequencies. Hence use a
virtual corner for each frequency for power saving purposes.

CRs-Fixed: 583719
Change-Id: I90113c4ad26c792c849378ec192bfde4ff2ec199
Signed-off-by: Ke Liu <keliu@codeaurora.org>
msm: mdss: Fix writeback timeout on WFD

Configure MDSS_MDP_REG_SCALE_INIT_PHASE_X and
MDSS_MDP_REG_SCALE_INIT_PHASE_Y only for VG
pipe.

Change-Id: I95aac47d7f9cdeffb208bf7c08040b90cb2e364a
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
USB: dwc3: gadget: Add support for sending zero length packets

Currently driver is not honouring req->zero flag even though
function driver sets this flag. If device has to send IN data back
to host and length is multiple of endpoint maximum packet size, it
should send additional zero length packet at the end to terminate
transfer.

CRs-Fixed: 592504
Change-Id: I5a8aecc504098ed386a9a9d19f4f5b78c911a376
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>

Conflicts:
	drivers/usb/dwc3/gadget.c
kernel: enable internaldb on perf build

Enable internaldb for performance build. It is already enabled on
non-performance build.

Change-Id: I0ef151c02b5bb8db76f7a100016e76e126a909dd
CRs-Fixed: 592107
Signed-off-by: Tushnim Bhattacharyya <tushnimb@codeaurora.org>

Conflicts:
	arch/arm/configs/msm8226-perf_defconfig
hwmon: qpnp-adc: add battery thermistor mapping table for skug

Since the new values of parameters including Rs1=30.3K,
Rs2=12.8K, Tcold=-15DegC and Thot=55DegC are used for
skug device, we add a new table accordingly.

CRs-fixed: 590617
Change-Id: If9e6b1103abd0fb40e98dabb0c75c5c9deb5cacc
Signed-off-by: Wu Fenglin <fenglinw@codeaurora.org>

Conflicts:
	drivers/hwmon/qpnp-adc-common.c
input: sensor: adjust the cm36283 sysfs interface path

The cm36283 sysfs interface path did not follow the sensor sysfs
path conventions, thus lead to the sensor HAL complicated.

Change-Id: Idc0c49a71eddb331736e2fb42eaa198a5bffba95
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
sensors: add enable and poll_delay handle for bmp18x sensor drver

Add enable and poll_delay handle functions for the bmp18x pressure
driver. The system will create the general enable and poll_delay handles
in the "/sys/class/sensors/xxx/" for each sensor drvier which is using
the sensor class driver.

Change-Id: I1e24cbc6a63c5e1e5eb4db66049bd7be85b81352
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>

Conflicts:
	drivers/input/misc/bmp18x-core.c
ARM: dts: update frequency to corner and quot mapping for CPR on msm8226

Some devices need to adjust their CPR quotient value according to the cpu
frequency. The existing configuration uses the same fuse target quotient
for each frequency in a given corner. This configuration is not power
efficient as some corners have a large range of frequencies. Hence use a
virtual corner for each frequency for power saving purposes.

CRs-Fixed: 583719
Change-Id: I88ea741a46446f43552672c8327599d0f6db8692
Signed-off-by: Ke Liu <keliu@codeaurora.org>
msm: mdss: Update op mode register access for calibration

Update OP_MODE register access on all source pipes for
calibration service to enable/disable PA, IGC, six
zone, etc post processing blocks.

Change-Id: Id52d7af71e0c0ad758c3ca939c8e1991c1dcf6ff
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: mdss: set vsync clock rate

Vsync clock rate is not set when vsync clock is enabled.
This cause command mode TE logic not works.

Change-Id: Ibf7dd07e53b2cd76ef30f13133368000c79ae149
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm: mdss: Prevent multiple completions for each read request

Each read request should only capture one histogram done. completion to
prevent future histograms from trying to read unavailable data. Makes sure
that the read request is set for both pipes before waiting for a new
histogram. Likewise, make sure the read request is unset for both pipes
after waiting. To prevent accumulation of histogram bins, only kick off
histograms when histogram state is IDLE (i.e. read or reset(recently
 zeroed) bins).

Change-Id: Idc1ebb14dce500a6e5dfc0261ecec992e727a380
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm: mdss: Remove redundant data from histogram info

Remove the 'is_kick_ready' variable from the histogram info since it is
duplicating col_en.

Change-Id: Ie2b3d5fae83d3030e79b323260223458eed174b0
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
input: sensors: add enable and poll_delay handler for mpu3050 sensor driver

The kernel will create the general enable and poll_delay interfaces
in the "/sys/class/sensors/xxx" for each sensor driver using sensor
class interface.

Change-Id: I17ca9822b759ec16393a184ce6bd16458a51ff65
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
sensors: unify the poll delay interface name of bmp18x sensor driver

Change the bmp18x sensor poll delay interface name from "delay" to
"poll_delay", because the "poll_delay" is used as uniform interface.

Change-Id: I380c5d32518eacb9f14985424c22c43d7d985658
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>
USB: u_serial: Don't free usb_requests in gs_close and reuse them

Commit: 950a3a3 "USB: Gadget: u_serial: Freeing usb requests as a
part of gs_close" results in freeing requests and flushing the EP
on every port close even if USB connection is present. These requests
are allocated again on port open. Also, EP flush call may result in
unclocked access of USB hardware if USB BUS state was suspended at
the time of port_close. This patch fixes that and also addresses the
original issue of gs_open allocating usb requests on every port_open
by adding a condition to allocate USB requests in port open only if
they are not already allocated.

CRs-fixed: 591617
Change-Id: If2ab31fa1d36ea6119dc0ced13ade5ed93d85d86
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>

Conflicts:
	drivers/usb/gadget/u_serial.c
msm: mdss: Fix race condition for vsync irq enable/disable

Disable and enable of vsync happens in separate thread, which
may lead to a race condition where enable/disable may
happen at the same time and resulting irq in disable state.
Add lock to properly synchronize the enabling/disabling
of vsync interrupts to fix race condition.

Change-Id: Ib52bea5ca7a3612c866a4a962f09725a77e40563
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>