Commit Graph

23 Commits

Author SHA1 Message Date
LuK1337 4e71469c73 Merge tag 'LA.BR.1.3.6-03510-8976.0' into HEAD
Change-Id: Ie506850703bf9550ede802c13ba5f8c2ce723fa3
2017-04-18 12:11:50 +02:00
Surendar karka e6b79f967a mfd: wcd9xxx-slimslave: Change slim driver to use %pK
Change slimslave driver to use %pK instead
of %p. %pK hides addresses when the users doesn't
have kernel permissions. If address information
is needed echo 0 > /proc/sys/kernel/kptr_restrict.

Change-Id: I319f7a4f71e779963c4d31eb5a0f91637cf805d2
Signed-off-by: Surendar karka <sukark@codeaurora.org>
2016-06-28 00:44:17 -07:00
Bhalchandra Gajare 900159f96b mfd: wcd9xxx-slimslave: Cleanup of unused API's
For msm owned master ports, the configuration is done by a separate
driver and hence the master port related API's provided by slimslave are
not used. Remove the unused API's.

Change-Id: I3f6b4ffccce7533250e211441d2f383dc96c8655
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2015-04-28 14:34:26 -07:00
Phani Kumar Uppalapati 5abcba2214 mfd: wcd9xxx-slimslave: Correct slim base rate for 44.1KHz sample rate
Slim base rate for 44.1KHz is not configured correctly for 44.1KHz
sample rate due to which native audio playback for 44.1KHz would
fail. Update the slim base rate for 44.1KHz audio sample rate.

Change-Id: I1eb1dce2c5381c659ff487eb767aaa432a0c5774
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2015-04-27 22:52:19 -07:00
Phani Kumar Uppalapati f3d7c5e573 mfd: wcd9xxx-slimslave: Add support for 44.1KHz sample rate
Currently slim rx port configuration only supports 48KHz
rate family. Extend the configuration to support audio
playback for 44.1KHz sample rate.

Change-Id: If79cd8117dd9029fa3f4841838ec1e537e97717a
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2015-03-29 06:10:05 -07:00
Patrick Lai c76fd0cf39 mfd: wcd9xxx-slimslave: remove fixed bitwidth for Tx ports
The function which configures SLIMBUS Tx ports has bitwidth fixed
to 16 bits. Remove the restriction to allow other bitwidth.

Change-Id: I3540d4a0a8cb84dfb4270cd8e6264858b7ceb12d
Signed-off-by: Patrick Lai <plai@codeaurora.org>
2015-01-23 16:08:55 -08:00
Bhalchandra Gajare 58ddf789ee mfd: wcd9xxx-slimslave: Return error to caller if buffer timeout happens
For the apps-owned data port (master port), in order to receive the data
on the channel, buffers are queued to slimbus/BAM pipe. Under unexpected
error scenarios, like SSR for example, the buffer is never returned,
which causes timeout on the wait for buffer completion. Fix to add error
return under such case so that the caller can take necessary action and
not queue any more buffers as the underlying driver/hardware is in
erroneous state.

CRs-fixed: 667678
Change-Id: Ia69b05be67660c93ae41b12cec632ad38d171655
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2014-11-03 12:22:57 -08:00
Bhalchandra Gajare 2115949c8c mfd: wcd9xxx-slimslave: Remove unnecessary logging
Remove an error log that is unnecessary and is not required even for
debugging purpose.

Change-Id: I319638e493d85464e79786eff0b2b4e8eb08e556
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2014-08-20 13:41:08 -07:00
Kuirong Wang 5ba0aef47e ASoC: wcd9xxx: Add check for array boundary
Current code does not check if the indexes of array
ch_h being accessed are within the maximum number of
channels that slimbus can have for the codec. The change
adds this check and ensures that indexes outside the
bounds of array are not accessed.

Change-Id: I3cd0e0daa14b86cbf718c00b8b2738d1f75150bd
CRs-fixed: 691820
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2014-08-04 10:37:01 -07:00
Venkat Sudhir 20938dead3 ASoC: wcd9xxx: Add support for MAD Slim master channel API
LAB feature is used in listen to capture PCM data once
the keyword is detected. To get the PCM from codec Apps
processor will enable the Slim master channel. PCM data
can be acquired from this master channel which is further
connected to MAD Tx port in codec. This change implements
and exports API to enable the Slim master channel on Apps
side.

Change-Id: Ibac20acc9e1c5c1afe2833c76de894aaf6b1d646
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2014-05-27 15:31:39 -07:00
Aravind Kumar 2f9678cd2b ASoC: wcdxxxx: Add check for buffer overflow
Current code does not check if the indexes of array
codec_dai being accessed is within the maximum
number of codec dais for a particular codec. The change
adds this check and ensures that indexes outside the
bounds of array are not accessed.

CRs-Fixed: 628865
Change-Id: Ibf81f91b35e43feddc6b03a1239b4d12e04a95da
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
2014-03-21 13:02:36 +05:30
Gopikrishnaiah Anandan 99a1383f75 drivers: mfd: Cleanup of wcd drivers
Kernel has defined printk format specifiers and typedefs
for datatypes.
Using the format strings will remove need for typecasting.
This change cleans up wcd msm drivers to use the kernel
defined data types and format specifiers for printk.

Change-Id: I9f451d0fc5eb15a93a51b6ffe647b6990c9e9dc1
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2014-02-10 14:02:06 -08:00
Joonwoo Park 435ec1090b mfd: wcd9xxx: Enhance codec detection logic to be forward compatible
So far driver claims detection only when major and major chip id are
matching with predefined table.  Amend the detection logic to support
possible unknown version of hardware by checking only chip id major when
driver doesn't have exact matching chip id table for both of major and
minor.

This will give us a capability of supporting hardware with minor changes
without software changes.

Change-Id: I7c5d1bce0c8542664b979a0fb2280ffa01f2279a
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-09-04 16:21:07 -07:00
Bhalchandra Gajare e5fcc0ad61 ASoC: msm: Add support for 24-bit playback
Update MSM ALSA driver to support 24-bit PCM sample packed into 32-bit
frame. A mixer control is added to allow 24/16 bitwidth selection on
SLIMBUS_0_RX backend

Change-Id: Ib2530159841bf191d4b27d0750db4c4a191bc0e0
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2013-09-04 16:01:04 -07:00
Joonwoo Park 74c22a5590 mfd: wcd9xxx: Pass slimbus slave address type to slimbus slave driver
There are slimbus slave address differences among the different wcd9xxx
codec hardwares.  Fix core driver to pass this information to slimbus
slave driver in order to avoid slimbus slave device determines interface
type by itself.

Currently when new codec hardware support introduced the same change has
to be made in both of core and slimslave driver.
This change removes slimslave change requirement.

Change-Id: Ie36cfb1139ce2360be1bd66ddfc22b283f948561
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2013-09-04 15:58:23 -07:00
Kuirong Wang 7ddef26d08 ASoC: wcd9xxx: Add fix to prevent same RX port added to same virtual port
There is big chance that application could add the same RX port
to same active virtual port. It can cause the linked list tracking
the RX ports to an AIF playback invalid. Add fix to prevent it happening.

Change-Id: I20661a51181d04233d75b964a50a0259dceb9f7d
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2013-09-04 15:29:54 -07:00
Kuirong Wang 465ef6c5e2 ASoC: wcd9xxx codecs: Add dynamic SLIMBUS ports/DAI mapping support
wcd9xxx series CODECs have hardware limitation that not all microphone
inputs can be routed to all decimators and not all decimators can be
routed to all SIMBUS TX ports. Currently, CODEC DAIs are defined based
on use cases and SLIMBUS ports are preallocated per CODEC DAI based on
microphone placements on the reference design. As concurrency use
cases grow and inflexibilty to establishing SLIMBUS port/DAI mapping,
concept of virtual port is introduced to allow run-time mapping.
At the same time, assignment of SLIMBUS shared data channel is being
rearranged to top-down approach which machine driver assigns share
data channel number to CPU DAI and CODEC DAI.

Change-Id: I43f0da5a7eff372379e159ceb99892b97f461c64
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2013-09-04 15:27:29 -07:00
Swaminathan Sathappan 2d82e0521e 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

Change-Id: I33f5aba16c02fe4bfdb903b50120460e460acefb
CRs-Fixed: 388030
CRs-Fixed: 388967
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
2013-09-04 15:11:59 -07:00
Swaminathan Sathappan fbfdee91c6 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>
2013-09-04 15:07:52 -07:00
Joonwoo Park 80ddd20830 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>
2013-09-04 15:06:59 -07:00
Swaminathan Sathappan 17fe8aa0de ASoC: Handle slimbus port disconnection before opening another
Problem Description:
Open and close the same set of slimbus ports after
certain iterations will fail port open, as that port
was not disconnected successfully.

Fix Description:
Handle sequence of closing slimbus ports. Store
the channel masks associated with each codec dai
and reset them after they are closed from slimbus
Then, release the close slimbus port event, after
all the channels are closed completely

Change-Id: Ie14b9f0920b37f905151b48f18df181503acc21d
CRs-fixed: 370761
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
2013-09-04 14:58:39 -07:00
Jay Wang 8e0a40729d Revert "mfd: slimslave: Audio recording doesn't work sometimes"
This reverts commit 62e08ad71751ada1a26a77b0b75e525fbc6aa2fb.

The patch has a side-effect and causes the audio loss during
device switch

Signed-off-by: Jay Wang <jaywang@codeaurora.org>
2013-09-04 14:54:38 -07:00
Asish Bhattacharya b3ca976a20 ASoC: wcd9xxx: Move to a generic framework for codec core driver.
The current core assumes TABLA as the only codec driver registering.
To support single binary for multiple targets its essential that
we remove this restriction and move to a generic framework
to support multiple codec. This can be done by moving all codec
specific code to dedicated codec driver and use core driver to probe
the codec based on slimbus device id and do generic setup for the
codec. This also helps to have same boards with different flavours
of codec variants.

The WCD9XXX family of codecs share the initial codec register
mapping which holds the Slimbus device id to identify the
codec existing on the target.Core driver now registers the
codec device based on this check.

Change-Id: I4c43d5f04c20696f4f5138411460681ec7879d34
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2013-09-04 14:48:53 -07:00