vidc: Remove client dependency to bump video core clock to turbo mode.

- As turbo mode not set by client, lot of frame drops are observed
  when more performance required.

- video core is bumped up to turbo mode, if more performance
  level required even client not requested turbo mode.

CRs-Fixed: 464490

Change-Id: I7e1afc883b1f5aeb5cda761b7de05eb05ec93243
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
Merge "vidc: Remove client dependency to bump video core clock to turbo mode."
nl80211/cfg80211: add VHT MCS support

Add support for reporting and calculating VHT MCSes.

Note that I'm not completely sure that the bitrate
calculations are correct, nor that they can't be
simplified.

Change-Id: Id4c132850a85ff59f0fc16396763ed717689bec0
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: db9c64cf8d9d3fcbc34b09d037f266d1fc9f928c
Git-repo:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
Merge "nl80211/cfg80211: add VHT MCS support"
Revert "power: pm8921-charger: fix a potential array out of bound access"

This reverts commit 7888a9dd4ca335586bc98efc1a9132d4377893ee.

Change-Id: I99d08c00d3babee5833fa71e4e921a7394c8660d
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
Revert "power: pm8921-charger: get rid of using LPM"

This reverts commit fd48353e6aa8c125fa679d0e68831fd0eaa6d3cb.

Change-Id: I75b6fec5035935453bdcf2d2b91f23cf2b5b7600
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
Revert "power: pm8921-charger: don't apply kickstart unless it is 8921 pmic"

This reverts commit f5abc1c8f6075570e26855897d0ba863f6418c10.

Change-Id: Ia0972141b831dc9e6a25f5a30b5a731738b7a1e0
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
power: pm8921-charger: Support multiple vbus requests

ACA chargers can generate multiple vbus current draw requests
based on the number of USB peripherals connected to the dock.
Handle this by allowing runtime modification to the max target
current limit.

Change-Id: I075c958fa1fb97068afdd3ab0d79330310152f61
CRs-Fixed: 427933
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
power: pm8921-charger: don't apply kickstart unless it is 8921 pmic

The current driver applies the kickstart routine in probe regardless of
the pmic variant. The kickstart is only required for 8921 pmic.
Fix this.

Change-Id: Ibe48766663e60f0a4febef983d97bb6e5370ea1a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
power: pm8921-charger: fix a potential array out of bound access

There is a potential out of bound array access to find the
max adjustment value for battery current. Fix it.

Change-Id: I75b17218d4ac765ca914f092b93680033847ecdb
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
power: pm8921-charger: disable AICL

There are certain conditions where AICL should be disabled. For example,
cases where a strong usb charger capable of supporting the usb_max_current
or cases where a wireless charger is used.

Use the power supply property HEALTH to indicate whether AICL is desired
or not. If HEALTH is unknown enable AICL, if HEALTH is good disable
AICL.

While at it clean up the vbus_draw callback
- there is no need of the vbus_lock, remove it
- there were , comma separated statements in the probe function, use ;
  instead
- the commit to verify the_chip is initialized, defeats the purpose of
  remembering the usb current when the_chip is not initialized. Clean
  this up

Change-Id: I018b3dfeccf10bcd0e9b115cc54f49429bac5827
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
power: pm8921-charger: force 19.2Mhz while writing to a register

We saw a problem where the charger was locked up and it reported
incorrect FSM states.

The root cause was that PMIC could be doing short sleeps while
LPM is set to 0. This means it would enter 32Khz and exit 32Khz
fairly quickly causing the lockup.

For e.g.
pm_chg_write gets called
write LPM = 0
pmic enters and exits sleep quickly.
charger locks up
the writes and reads are unreliable from this point on.

To prevent the lock up instead of using the LPM bit force
the charger to run from 19.2Mhz while doing a write.

Change-Id: I7e61abc394f91eb0c4c83ea1f762972ed1c0ff78
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
power: pm8921-charger: Do not update "type" property of usb_psy

The userspace fails to detect the supply type as USB if "type"
property of usb_psy power-supply class is set to anything other
than USB at init. The driver ends up setting this to type
-UNKNOWN at bootup if there is no USB source present
-USB_DCP/ACA if a wall charger is present
This causes issues with displaying the charger source later on
since the USB path is not noted by the userspace. Moreover, the
userspace ignores the changes to the type property at runtime
making it futile for the driver to update it.

Use local driver data to store the usb type information
and use this to determine the supply-type. Keep the
usb_psy.type set to USB always.

Change-Id: I8b0f1fdaf65bb1ad885dd9fe2eb5873d30c88d91
CRs-Fixed: 451196
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
power: pm8921-charger: don't reject all the chg current requests

The driver currently rejects any changes to the USB charge current if
no other source of power is present. This causes issues because if a
pc usb cable which supplies 500mA  is connected while the PMIC was
drawing 1500mA, it will continue to draw 1500mA from it causing charger
collapse.

The reason why the rejects were put in place were because if we are
running from USB as the source, vbus_draw() could be called with 0mA.
This would cause brownouts.

So only reject setting the current to 0mA in case another source is not
present.

Change-Id: I674d9d17b329c72de44cfce979a312d180529ac8
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
power: pm8921-charger: get rid of using LPM

The LPM is causing a lot of regression on various test cases
1. Writes to charger have become complex
2. There is uncertainty about whether battery insertion/removal could be
detected reliably.

LPM was introduced to prevent lockups from happening when the charger
was running in hw based clock switching while it was suspended. UVLO
lockups were not seen if the charger was running from 19.2Mhz.

Instead activate LPM mode only while the system is suspended and always
force 19.2Mhz when not suspended. This way we avoid the complexities
with writes, can detect battery insertion/removal as long as the system
is not suspended and more importantly fix the UVLO issue since we will
never be running in hw clk switching mode.

Change-Id: I84cbdb6e65191ec43fd0da7e3c55f4029f63396e
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
Merge "Revert "power: pm8921-charger: fix a potential array out of bound access""
Merge "Revert "power: pm8921-charger: get rid of using LPM""
Merge "Revert "power: pm8921-charger: don't apply kickstart unless it is 8921 pmic""
Merge "power: pm8921-charger: Support multiple vbus requests"
Merge "power: pm8921-charger: don't apply kickstart unless it is 8921 pmic"