msm_fb: Correct GC offset which is same for LM0 and LM1

GC LUT Offset for LayerMixer 0 and LayerMixer 1 is same
hence correct the wrong offset for LayerMixer 1.

CRs-Fixed: 374401
Change-Id: Ia82de062404947998b4595031cc928eac882ca48
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
camera: Correct parameter of wait_event_interruptible_timeout.

wait_event_interruptible_timeout takes timeout value in jiffies.

Change-Id: Idbf25653233b34d6105e544a411b49ca81a04a9f
CRs-Fixed: 373576
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
msm: kgsl: use correct 2d ringbuffer offset in resume

The 2d timestamp is used as an index into the ringbuffer.
Now that z180_dev->current_timestamp is preserved across
resume, make sure that ADDR_VGV3_NEXTADDR is set to the
gpu address that corresponds to the current timestamp.

CRs-Fixed: 347025
Change-Id: Ib7dc4579943ab24e04279ede1555539ec21adabd
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
USB: msm_otg: Add debouncing logic for PMIC id line status handling

Currently reading PMIC ID line status immediately once PMIC interrupt
is triggered. This leads to returning wrong ID line state sometimes
and causes not detecting connected devices. Hence add debouncing time
of 5msec for PMIC ID line state to settle down before reading PMIC
ID status.

CRs-Fixed: 371552
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
(cherry picked from commit 68d55cfa2ed1de84966fae66329a3aeca4ecc3a2)

Conflicts:

	drivers/usb/otg/msm_otg.c

Change-Id: I2f9cfa8d62341555a3269fe64cef34461c838f65
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: display: Enable MDP clock's overlay block during panel on

MDP clock's overlay block is enabled during first update after panel
on currently. This is now moved to panel on to keep clock enabled
right from display on time.

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
CRs-fixed: 368167
(cherry picked from commit 24502cb2cfd176d72cc6884dbeb375c7fb054766)

Change-Id: I6c23396cad4f9ec4d520d82c276bb079b48757cd
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Merge "camera: Correct parameter of wait_event_interruptible_timeout." into ics_chocolate
Merge "USB: msm_otg: Add debouncing logic for PMIC id line status handling" into ics_chocolate
mmc: msm_sdcc: Revert to the older clock-APIs

Use the clock APIs which can be called from the atomic context.

CRs-Fixed: 377874
Change-Id: I0b711e946ad74f953f67f491d767e381c2b0d41b
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
msm: smd_pkt: Fix wakelock concurrency issue

In failure conditions, some clients violate the SMD PKT restriction of
single-threaded access resulting in overlapping open requests which
corrupt the wakelock list.

Move the wakelock initialization into the channel mutex to prevent
concurrent access from corrupting the wakelock.

CRs-Fixed: 374644
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>

(cherry picked from commit b399a4fbce9c9b20ef258e3245e916cd9ce788e2)

Conflicts:

	arch/arm/mach-msm/smd_pkt.c

Change-Id: I43df498cbf3480b8e345900be49c16afc4669f4a
Signed-off-by: Subrahmanyam Uppala <csuppal@codeaurora.org>
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
power_supply: add change the scope property

The scope property indicates the operating mode of the system. This
property could be used to switch to and from usb host mode.

Add a helper api to update this property.

CRs-fixed: 373365 368475
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit 59d890ff84c431d1cf56118ba0c5892b7d9b7a06)

Change-Id: I3ed91574dddedc795fd6bdce7abb729c3116221a
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
power: pm8921-charger: support dc charging while in usb host mode

The current code disables charging when the usb is operating in host
mode. This unnecessarily stops charging from the DC path. The board
layout (the ovp fet and otg path) is assumed to support host mode and
charging from dc path.

Also make the usb driver change the power supply framework's scope
property instead of calling 8921 charger apis directly.

CRs-fixed: 373365 368475
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit 5e96aaa4c667b34b354a100cbe7b0c3da01cc3d4)

Conflicts:

	drivers/power/pm8921-charger.c

Change-Id: I852fbee9f1fec6d9f55b8f5583023f029cb6ec63
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
power_supply: add SCOPE attribute to power supplies

This adds a "scope" attribute to a power_supply, which indicates how
much of the system it powers.  It appears in sysfs as "scope" or in
the uevent file as POWER_SUPPLY_SCOPE=.  There are presently three
possible values:
	Unknown - unknown power topology
	System - the power supply powers the whole system
	Device - it powers a specific device, or tree of devices

A power supply which doesn't have a "scope" attribute should be assumed to
have "System" scope.

In general, usermode should assume that loss of all System-scoped power
supplies will power off the whole system, but any single one is sufficient
to power the system.

Change-Id: Ib0d844dc7f0c175ee0ccb5307df7f85bf8797658
Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Richard Hughes <richard@hughsie.com>
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Bluetooth: Update Local COD to bluez userspace on write complete.

Class of device information is required to the bluez userspace
to write to persistant storage and also update upper layers on
request. So update the local CoD info to bluez once the hci write
is successful.

CRs-fixed: 375304
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
(cherry picked from commit 58562d8177e97893c27d04a378867e714029e620)

Change-Id: I88355cbf128f8e5f9b85f2a4bcfcdea4ab3b0f78
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm-fb: display: lm2 writeback support on mpq platfroms

lm2 writeback has broken on mpq platfroms as lm1 and lm2 are
selecting the same axi writeback path. It adds the support
to select the right axi writeback path based the availability
of the write master

CRs-fixed: 375340
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
(cherry picked from commit b411a253ea37acbe8cc817bf004ae08d877d9bd1)

Change-Id: I06917794b08fa4dadb5ecf0ec6867b26cba106c5
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
diag: Add missing SSID range

OEMs use SSID in a specific range. Recently DIAG changed the mask
update algorithm and this range was missed as its not used internally.
This change adds it back.

CRs-fixed: 359379
Change-Id: Ib7249f157e4e37294b6da6580fcf19995afeef8f
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
(cherry picked from commit 44b79b7bb5aeeaa2c956ce0fd1e605d840c55a73)

Conflicts:

	include/linux/diagchar.h

Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm: bam_dmux: Add locking around platform device calls

The channel state is used to determine if a platform device has been
registered on a particular channel.  In the case of a subsystem restart
while a channel is being opened, the subsystem restart can occur between
the channel state being set to opened and the platform device being
added.  This will result in the subsystem restart code seeing that the
channel is open and attempting to remove a platform device that has been
added.

This change adds mutex protection around the channel state updates and
the platform device add/remove calls to handle any race conditions.

CRs-fixed: 378060
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
(cherry picked from commit a623da8bda62e95acf5991905af2847e8e326e09)

Change-Id: I8eef024141a2c81552439856aa9c77fc491354a3
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
hwmon: pm8xxx-adc: Update pa_therm mapping table

Inaccurate temperature readings are reported for
pa_therm when read from the apps. This is because
an inaccurate B constant was used while calculating
the voltage to temperature mapping table. Fix it
by generating the table using the correct B constant
for the thermistor.

CRs-fixed: 374589
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
(cherry picked from commit 9ae3efba35a5291df925bc645662dd2c5fbd4efb)

Change-Id: I879f6281efe6afed8ff5a3037ca34d2988d231a5
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Merge changes Ibb07c69b,Ia1c1339a,I9e5321c4 into ics_chocolate

* changes:
  power_supply: add SCOPE attribute to power supplies
  power: pm8921-charger: support dc charging while in usb host mode
  power_supply: add change the scope property
Merge "msm: bam_dmux: Add locking around platform device calls" into ics_chocolate
Merge "hwmon: pm8xxx-adc: Update pa_therm mapping table" into ics_chocolate