ASoC: wcd9xxx: fix build warning

Fix warnings due to -Wmaybe-uninitialized in GCC

Change-Id: Ied264ec359620006f1beea26ab7457bb5367fcb7
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9xxx: register available conditions to resource manager

When mbhc driver isn't used, resource conditions from mbhc driver isn't
also available even though resources might be still available.
Make resource manager to get registration of available conditions to find
out if specific conditions are available.

CRs-fixed: 514718
Change-Id: I06309f7d1e9b2696c6dd421d6bef481c5d8f0cf8
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9xxx: improve mbhc button release detection performance

MBHC hardware block monitors microphone's voltage when button is pressed
to detect button release event.  Reprogram release threshold to narrow
down the threshold voltage to be able to detect button release quickly.

CRs-fixed: 509925
Change-Id: I9802564ea5467f7b5b23a87191ded6ed2f10ab98
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9xxx: request bandgap in slow mode

Since bandgap mode change requires clock block disablement when bandgap
get and clock put which are followed by clock get and bandgap put happen,
two clock get or put happen unnecessary.
Reqeust bandgap mode in slow mode to avoid unnecessary temporary clock
source changes.  Also regardless of this change, resource manager always
requests bandgap in slow mode as fast mode request is meaningless.

Change-Id: I6ff52d004cfab6372373b7405f66d8777b3396fd
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9xxx: Use lower voltage micbias for plug type determination

Enable current source during plug type determination
and use it for measuring mic voltages to minimize pop
noise resulting from higher voltage of mic bias.

Change-Id: I4e67a64dfbb3952c0bfebebb08eb030ce12ed8d0
CRs-fixed: 485047
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9xxx: Support to configure the code for media button

There is mismatch in button 0 code value that is used
in kernel and userspace. Configure the code for button 0
to match with that of userspace.

Change-Id: I3019807ee1e68e9990a12073fa11315e26575814
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
mfd: wcd9xxx: Refactor codec core driver and irq driver

IRQ driver can be used by codecs that do not use the core driver.
Refactor the drivers so that codec drivers that are not children
of the core driver can also request/access the interrupt routines
provided by the IRQ driver.

Change-Id: I3086be02839fd735db2d32665abf7b984958dc2b
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
(cherry picked from commit c68ed369921e8d08f4254b9243872785a3a5cf2f)
Signed-off-by: Dan Trifan <jimsth@gmail.com>