ASoC: wcd9304: Add driver for Sitar codec.

Add support for 5 RX and 4 TX Slimbus channel support.
Headphone/Earphone/4 DMIX/2 AMIC and IIR1 support

Change-Id: I1b7ad5e5fd9d87aab80d6533503371e63df8cc0a
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>

Conflicts:

	arch/arm/configs/msm8960-perf_defconfig
ASoC: wcd9304: Pull in pending fixes for sitar.

Fix Lineout and DMIC configurations. The configurations are similar
to tabla codec driver and hence pull in changes to sitar driver.

Change-Id: Ia00359e6f8888c08365b85423197821fc16f963b
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>

Conflicts:

	sound/soc/codecs/wcd9304.c
ASoc: msm: Modify debug messages with correct levels

Modify some of the debug messages in codec driver and
afe driver to debug from error to prevent excessive
logging

Change-Id: Ib0ccf0708cfd7965b52a5f672e7e681ff182b3d6
CRs-fixed: 355418
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
ASoC: msm: Add I2S support for mdm9x15 machine driver.

Add I2S support to mdm9x15 machine driver. Slimbus or I2S
Interface is determined during codec probe and respective
drivers are used depending on interface.

Change-Id: I026409b32b05e2984f375e049080b6861d03d419
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>

Conflicts:

	sound/soc/msm/mdm9615.c
ASoC: MSM: Add Support for WCD9304 codec version 1.1

Register and initialize the approriate device for WCD9304 codec
version 1.0 and version 1.1. Query version information from codec
to be used from other drivers.

Change-Id: I64c2dfe2dfc786c6b799f4698c1a36f52115880a
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-8930-regulator.c
ASoC: wcd9304: add I2C\I2S support for sitar codec

Add support for I2C\I2S interface for sitar codec along
With SLIMBUS interface.

Change-Id: I68666fd10cf9fb8d871d4b2a3d9b2e454dd1efe7
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
mfd: wcd9xxx: use codec device id to register the device.

The current code registers multiple devices for i2c clients. This
results in code repetition. instead its better to register single
i2c client and register codec based on device id.

Change-Id: Ifb4adbd47b7a2bf7d32be637fd0641545cd84286
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
ASoC: wcd9xxx: Update platform data pointer for I2C probe.

Initialize platform data pointer for I2S probe if the interface
is not slimbus. Slimbus probe is called first and if interface
is determined to be slimbus then I2C probe for codec will simply
return. This is necessary to avoid wrong update of platform data
pointer.

Change-Id: I40fb66eca4af15aa0ef534e8021285f46f155a42
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
ASoC: wcd9xxx: Add wcd9320 codec slimbus slave support

Update slimbus slave driver to use updated address depending on discovered
The wcd9320 Taiko codec introduced a new register address map to configure
slimbus slave device.

Change-Id: I41e9ebabd1d375a1904b6033e46736b2fb6365f9
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>

Conflicts:

	drivers/mfd/wcd9xxx-slimslave.c
msm: wcd9xxx: add device tree support for codec slimbus component

Read the codec specific data from device tree instead of board file.

Change-Id: Iad382b89692903d2434b63d34c7121fe0b4b9dda
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>

Conflicts:

	drivers/mfd/wcd9xxx-core.c
	sound/soc/codecs/wcd9320.c
mfd: Reorder slimbus disconnect port and channel

After multiple iterations of device switches, codec
port opening gets blocked due to latency between
closing and opening slimbus ports. Re-ordering
the disconnect port will help get the closure
faster and in turns speeds up the close for codec
hardware ports

Change-Id: I55b63f0d22c27ff430828feeec85bcf94366e7f6
CRs-fixed: 381299
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
ASoC: wcd9310: force slimbus ports to disconnect during error cases

With shared data channel architecture, SLIMBUS driver
only removes slimbus channel when all clients vote to
have channel removed. In case of subsystem restart,
client such as MDM can go down without withdrawing
vote. During CODEC path shutdown, CODEC driver will
receive slimbus slave interrupt in time indicating
port disconnection because slimbus channel has not
be been voted off. Then, CODEC driver blindly
shutdown rest of CODEC path. This results in
overflow error on Rx path and underflow error on
Tx path. In case of time out waiting for port disconnect
interrupts to arrive, force ports to disconnect

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
BUG-ID: 7313016
mfd: wcd9xxx-core: fix the device registeration check.

The current logic checks for only one byte id for device
registration. this is not sufficient to identify all
variants. fix this to check all 4 byte id registers.

Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
(cherry picked from commit fbe371bbce2b166e4f651454f00fe4e8ecc2c3b8)

Change-Id: Ife41b16049f9061fc649ad78ed887681c85f5ac1
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
mfd: wcd9xxx: Continue to probe codec without interrupt

Don't treat as an error when no interrupt is configured.
Interrupts are not mandatory for codec driver and hardware.

Change-Id: Ic54f2cdf6f4916db89700b745d82e199bdccf48c
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
mfd: wcd9xxx: Check for wcd9xxx_read error

Check for for wcd9xx read error properly during probe.
Move the determination of codec type to function and
check for interface error during read operation for
I2C. Since slimbus master is changed the slim porbe
may be called later to I2C probe. Handle proper
releasing of reset gpio in case there was error
for I2C read.

Change-Id: I6e8e271861e5bf7fee5df63b5ac265b7976f83d2
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
mfd: wcd9xxx: Add WCD9304 1.2 version codec chip entry

-Add chip byte information for WCD9304 1.2 version.
 This information is required for correct detection
 of the codec at the codec init.
-Fix code to exit codec init with error, if codec
 detection fails.

Change-Id: I6b5522f6fb4d7b18011da2bedd322c4a480a5175
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
mfd: wcd9xxx: fix multi channel payload calculation

When multiple channels are used for a session (Rx/Tx), all bits in the
Rx/Tx port multichannel register needs to be Set. If a bit corresponding
to any channel is missing, the channel will not be aware that the other
channel (corresponding to the missing bit) is also part of the same group.
This will create ambiguity among the channels in the same PCM group and
will lead to shifting of Phase/delay in data in those channels.

CRs-fixed: 425803
Change-Id: Ie78ba82eeeb494db73a781e96b835361ef589a67
Signed-off-by: Banajit Goswami <bgoswa@codeaurora.org>
of/gpio: Add new method for getting gpios under different property names

This patch adds a new routine, of_get_named_gpio_flags(), which takes the
property name as a parameter rather than assuming "gpios".

of_get_gpio_flags() is modified to call of_get_named_gpio_flags() with "gpios"
as the property parameter.

Signed-off-by: John Bonesio <bones@secretlab.ca>
[grant.likely: Tidied up whitespace and tweaked kerneldoc comments.]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>