Asoc: Add support for codec bulk write for Helicon

Helicon can not use existing bulk_write function
as analog and digital codecs are in different busses.
So implement bulk write accordingly as per the codec interfaces

CRs-Fixed: 593609
Change-Id: Ibc16539cbd795fd998e88b6dc5b9060d70b498ac
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
ASoC: wcd9xxx: add device_reset functions for taiko and tapan

When slimbus is reset reset_device callback is called. In this event codec
driver should reset the codec so that codec can be enumulated again.

Change-Id: I14a2921b71dbe862cc52f7af1166c30fa4346a5a
Signed-off-by: Fred Oh <fred@codeaurora.org>
Asoc: wcd9xxx: Avoid unnecessary dispatch of mechanical interrupts

Interrupt number for WCD9306_IRQ_MBHC_JACK_SWITCH and
WCD9320_IRQ_EAR_PA_STARTUP is same due to this single interrupt is
dispatched twice, due to this real interrupts are not getting handled.
To avoid this remove WCD9320_IRQ_EAR_PA_STARTUP from interrupt table.

CRs-Fixed: 589453
Change-Id: Id1945bb6399bc9b3f991ffc587b83ca02dd9647d
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
slimbus: Provide framer-booted notification to slimbus device drivers

When slimbus resets (due to bus reset sequence, or after it shuts down
and comes up), framer boots up and starts clocking the bus.
Devices on the bus may be in undefined state at that time. Callback
is provided to slimbus device drivers so that controller can report
framer-booted notification so that drivers can take necessary action
to put devices in reset state so that they can acquire sync, report
present, and be operational.

Change-Id: I6068063ef32c91a67c246f9ee727b4724c11f5f2
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim_msm: ngd: Return success for channel removal during ADSP SSR

Slimbus master component resides on ADSP when this driver is used.
Wehn ADSP restarts, slimbus component goes down and bus is not
operational until it comes back up. During restart, slimbus clients
are notified since their device goes down, and the clients remove
channels and/or disconnect ports. Since bus is not operational,
return success for channel removal/port disconnection calls so that
the channel, port state is consistent with HW (not active, removed)

Change-Id: Ia2707ed9f3fc3573b5746c8e42fa7f229e0dea4f
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim_ngd: Return success for resource removal requests if HW restarts

Channel and ports are removed when HW restarts. Return success to
client channel removal, port disconnection requests when slimbus HW
is restarting.

Change-Id: Ifc9a3bb80023c823a7776a16fe32e5b59b181350
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim_ngd: Fix logical address notification mechanism

It's possible that multiple slaves report present and expect
corresponding notifications concurrently. Make sure notifications
are sent out in that case. Since notifications cannot be sent when
device doesn't have associated driver, make sure logical address
is not queried in that case.

Change-Id: I371c48d25a0953f5f1909c904e8fd80b599d16b3
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim_ngd: Handle runtime-pm resume error gracefully

Runtime-pm resume for satellite driver may fail if ADSP is going
through subsystem-restart. Handle that error, and set runtime-pm's
status to suspended if resume fails. Resume typically fails due to
failure to wake slimbus from pause_clock. Make sure another wakeup
can be tried later when ADSP comes back up

Change-Id: Ie9b798f5506de89a37491dbc3798acaa24b98808
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slimbus: Manage channel slots only if framework manages bandwidth

If slimbus controller overrides bandwidth management, channel slots
should not be managed since controller is expected to do that.
Slimbus controller will go into idle mode due to this change when
channel setup/teardown is done. Make sure controller can transition
states correctly in runtime-pm suspend, and system-suspend case.

Change-Id: Id41aed822e3c98af8c1fe7db3a3527a1206739be
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim_msm: Rectify physical address type

Make sure physical address type is of correct type.

Change-Id: I9ec7a846e0fc14efd3627d141bb2228c8e56b2cc
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
msm: qmi: Match service version and instance during lookup

The remote subsystems construct instance_id from the version and service-
registered instance information. The version field is used to identify the
compatibility between client and service. The instance field is used to
uniquely identify a service from multiple instances of the same service_id
and version.

Currently the kernel QMI client interface matches only the instance during
the service lookup. Update the kernel QMI client interface to construct
instance_id from the version and instance information during lookup.

Change-Id: I2a4124ca8179d175d47c9468e907568a74281901
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Gottardo Stefano <whiteflash@email.it>
Subject: msm: qmi: Match service version and instance during lookup

The remote subsystems construct instance_id from the version and service-
registered instance information. The version field is used to identify the
compatibility between client and service. The instance field is used to
uniquely identify a service from multiple instances of the same service_id
and version.

Currently the kernel QMI client interface matches only the instance during
the service lookup. Update the kernel QMI client interface to construct
instance_id from the version and instance information during lookup.

Change-Id: I2a4124ca8179d175d47c9468e907568a74281901
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Slimbus: Correct the conditional check during channel removal

Use actual channel number to check if the channel to be
removed is present in the define_chan list before removing
it, instead of using the internal channel number used by
the frame work.

CRs-Fixed: 555260
Change-Id: I4c9521f7d228ca43c155fedf2c9ba5b8f86e2d3a
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
slim_msm: Add support for external MDM restart

If external MDM restarts when MDM slimbus channels are active, it
is possible that the MDM framer was clocking the bus, and ADSP was
not active. Make sure apps wakes up ADSP and checks the framer status
so that slimbus is clocked by ADSP instead of MDM, and communication
over slimbus is restored.

CRs-Fixed: 539637
Change-Id: I931ec418687b590934bac133979c0c7d608f1266
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
slimbus: Fix logical address notification mechanism

Make sure device-up/down notifications don't involve race condition,
and sub-system restart in such cases is handled gracefully

Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>

Conflicts:
	drivers/slimbus/slimbus.c