gpiomux-8974: Modify direction of suspended GPIO

changed the direction and strength for some below mentioned GPIOs
as per 8974 suggested GPIO settings in Rockbottom.
With new config 0.400-0.500mA been saved on floor in Audio
use case.
Settings are applicable when there is no user to GPIOs
Following are the changes made:
	GPIO# Changed       What Changed
	24                  IN->OUT 8mA->2mA
	46                  IN->OUT 8mA->2mA
	80                  8mA->2mA
	82                  IN->OUT 8mA->2mA
	104                 IN->OUT 8mA->2mA PD->NO PULL
	105                 IN->OUT 8mA->2mA
	106                 IN->OUT 8mA->2mA

Change-Id: Iaedc91b3d696a588e0723ffb495be179c7e0ae6c
Signed-off-by: Tirtha Kanti Ghosh <tirtha@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
arm: mach-msm: fix integer overflow in DFE_IOCTL_COMMAND

Added error checks for upper limit of param.num in
DFE_IOCTL_COMMAND

Change-Id: I0143813d38ec7a5dfa7a8307b075daf7d4a4d101
Acked-by: John Nicholas <jnichola@qti.qualcomm.com>
Signed-off-by: Venkatesh Yadav Abbarapu <quicvenkat@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
regulatory: use correct regulatory initiator on wiphy register

The current regdomain was not always set by the core. This causes
cards with a custom regulatory domain to ignore user initiated changes
if done before the card was registered.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 23df0b731954502a9391e739b92927cee4360343
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
CRs-Fixed: 569424
Change-Id: Ia5462145a27f5ecdd7a1eb9f4235992f7a801097
[smihir@codeaurora.org: changes to merge cleanly in older kernel]
Signed-off-by: Mihir Shete <smihir@codeaurora.org>

Signed-off-by: Dan Trifan <jimsth@gmail.com>
bluetooth: set optimum current requirement for vdd la

Add change in bluetooth power module to specify load current
requirement for regulator vdd la during Bluetooth turn on.

Change-Id: Iddd602b2ea45be62cb3786cc482e3ce12ae6302b
Signed-off-by: Pradeep Panigrahi <pradeepp@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
bluetooth: hci_ath: enable driver support for bluedroid stack

Added module params to allow userspace to control the sleep
mechanism of atheros chipset.

Change-Id: Ie7a9a6c0d73d8df694c805f59a22ad9c52ea8c87
Signed-off-by: Pradeep Panigrahi <pradeepp@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: clock-8974: Update SDCC1 Apps clock frequency for MSM8974Pro

Update SDCC1 Apps clock frequency for MSM8974Pro to match latest software
frequency plan.

CRs-fixed: 613318
Change-Id: Id88259998862aade7492f1b56592e68beda6fd17
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
leds: leds-qpnp: Support vin control for MPP LEDs

MPP can support input voltages from vin0 to vin3. Parse
this data from Device Tree and program appropriate MPP
registers. Also add support for minimum brightness that
MPP LED can support.

Signed-off-by: Chun Zhang <chunz@codeaurora.org>
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
leds: leds-qpnp: Add LUT support for KPDBL

Keypad Backlight module supports LUT mode. Add
support for LUT mode and parse the parameters
from DTS file.

Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
leds: leds-qpnp: Add brightness control for mpp leds

Add brightness control by changing the current supplied
to leds in manual mode.

Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
leds: leds-qpnp: fix WLED max current mask

Change WLED_MAX_CURR_MASK to 0x1F as max current value in
LED1_FULL_SCALE_CURRENT register occupies 5 bits

Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
leds: leds-qpnp: Set proper flash duration

Flash duration is between 0ms and 1280ms in increments of 10ms and can
be stored in an 8-bit value. The current conversion formula to u8
results in shrinking of this value, which leads to a loss of
most-significant bit in flash duration. This erroneous calcuation
is corrected in the driver.

Signed-off-by: Abinaya P <abinayap@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
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.

Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
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.

[neo: Even 3.4 kernel defines nanoseconds pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) ]

Signed-off-by: Xu Kai <kaixu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
leds: leds-qpnp: Set the strobe bit correctly for flash led

The strobe bit is set to 1 when the flash led uses HW strobe and it is
set to 0 when the flash led uses SW strobe.

CRs-Fixed: 585414
Change-Id: Id65e9e70bc6c84ca5c8a9e65fd86e67b513e6745
Signed-off-by: Abinaya P <abinayap@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
qpnp: pwm: Select proper pwm sizes

Here are different Qualcomm pmic chipsets and supported pwm resolutions.
PM8941:-
	LPG1 to LPG8 channels support 6, 7 and 9 bit PWM resolutions.
	LPG9 to LPG12 channels support 7 and 8 bit PWM resolutions.
PM8026:-
	LPG1 to LPG6 channels support 6, 7 and 9 bit PWM resolutions.
PM8110:-
	PWM supports 6 and 9 bit PWM resolutions. There is no support
for LPG mode and pwm mode only supported.

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
qpnp: pwm: Force the pwm size selection

For certain use cases pwm size need to restricted
to avoid dynamic pwm size selection based on the
pwm period value. Currently pwm freqency and pwm
sizes are selected for a given pwm period. Restrict
pwm size to a specific value and select pwm frequency
closest to pwm period requested.

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
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.

Signed-off-by: Xu Kai <kaixu@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
qpnp: pwm: PM8110 pwm changes for backlight

Qualcomm PMIC chipset PM8110's ENABLE_CONTROL register
definition is different from other pmic chipset. So avoid
modifying the other bits in ENABLE_CONTROL register when
pwm_config is called.

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>