commit 8b8a84c54aff4256d592dc18346c65ecf6811b45 upstream.
Commit 16fa3dc75c ("mfd: omap-usb-tll: HOST TLL platform driver")
added support for USB TLL, but uses OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF
bit the wrong way. The comments in the code are correct, but the inverted
use of OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF causes the register to be
enabled instead of disabled unlike what the comments say.
Without this change the Wrigley 3G LTE modem on droid 4 EHCI bus can
be only pinged few times before it stops responding.
Fixes: 16fa3dc75c ("mfd: omap-usb-tll: HOST TLL platform driver")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
commit 722f191080de641f023feaa7d5648caf377844f5 upstream.
Make sure to drop the reference taken by bus_find_device_by_name()
before returning from mfd_clone_cell().
Fixes: a9bbba9963 ("mfd: add platform_device sharing support for mfd")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Remove read permission for debugfs reg dump node
for group and users to not allow reading of wcd9xxx
registers.
CRs-fixed: 2113240
Change-Id: I73a22e140446828e694fdc95fde7ac4e051c9548
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Range checking is added to prevent buffer overflow.
CRs-Fixed: 1098363
Change-Id: I5871a3a11ec5f5106a386bf149d7ec22605f3db8
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
During ADSP subsystem restart, all slimbus read/write would fail
as the bus is not available. Avoid codec read/write, until the
slimbus master in ADSP is up.
Change-Id: Iec1933d2625c1cd3dd700b2b3e2ffc7eae64880b
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
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>
In case of any codec access failure, return -EPROBE_DEFER
so that slimbus driver can probe the codec again
to toggle codec reset and retry codec access.
CRs-fixed: 969497
Change-Id: I570e7357a6d7810c495f56bbb626b8e823892837
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Codec reset gpio configuration needs to be updated
before slimbus master component is initialized otherwise
codec cannot be enumerated on the bus. Add a new platform
device driver to update the codec reset gpio configuration
to valid state (output, drive-strength) before slimbus
is initialized.
CRs-Fixed: 968161
Change-Id: I7227212e6b846d58196718255aa4b0923352d120
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
wcd9335 has multiple pages with each page has set of registers.
slimbus supports writing multiple registers in one transaction.
Change enables writing set of registers of each page of wcd9335
codec in one slimbus transaction. This will help reduce the latency
during codec register writes.
Change-Id: I4282ca9787d23c097f6ec031d4986898376c6b25
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
slimbus driver supports writing multiple registers with a single
header. Add an API in core driver to support slimbus multi
register write. This will help in reducing the cold start
latency.
Change-Id: I158ef10e5a148408d9f4268da388eac515e46433
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
The Analog RCO control register in WCD9335 codec should
be a volatile register and should bypass cache. Mark this
register as volatile.
Change-Id: I101e632acc2e2e42e0469bd2602dd684be86ac26
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Use new cabability to write multiple
registers using api provided by regmap.
Change-Id: I540aafb7d1ea62cee959d85713f5b5d2c21ff532
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
This change fixes codec HW issues, Slimbus master capability issue
and codec NACK issues caused due to SIDO buck going down abruptly.
Change-Id: I74e94630b2ba4c132d66315ceee5127e05f284c6
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Mark ANC (Active Noise Cancellation) filter coefficients
as volatile because codec hardware can auto update the
registers based on coefficient pointer register update.
Change-Id: I65aef7d7322db0ab3815d69e19cb97c7a2e044b2
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Add support for wcd9335 version 2.0 and update the
register defaults accordingly based on the version.
Change-Id: I33038c1643b83ecd593891688c0ddf4a556b92ee
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
There are few use cases where apps goes down to suspend
but codec should be in active state. Core driver will not
have knowledge of these usescases and hence move suspend and
resume hooks to codec driver.
Change-Id: If5614dd13f24a80d18f53f194c7be1c5b967a003
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Increase the SIDO (single input dual output) buck inductor
current to avoid the output voltage drop to zero during
audio use-cases in which case codec communication over
slimbus will fail.
Change-Id: I0189bd8fd4952b3d7df411e64fd50e59645290b1
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
commit 8a8320c2e78d1b619a8fa8eb5ae946b8691de604 upstream.
Fix:
sm501 sm501: SM501 At b3e00000: Version 050100a0, 8 Mb, IRQ 100
Attribute dbg_regs: write permission without 'store'
------------[ cut here ]------------
WARNING: at drivers/base/core.c:620
dbg_regs does not have a write function and must therefore be marked
as read-only.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vbat adc, gain related registers are not updated by the driver and
are read only. Mark these registers as volatile, to get proper
values when the registers are read.
Change-Id: Icef27deb9459a3193110007a78ad1a84283f4965
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
Some of the wcd9335 codec page-2 registers are missing
in the readable tables. Correct the missing page-2
registers.
Change-Id: If61b5a139d98eb942d01f4485c8e61aa733cc7e2
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Modify the codec power down sequence as below
1. Disable regulators.
2. Pull down codec reset GPIO.
3. Wait for 60 msec for codec to stabilise.
Change-Id: I410482561d99365395eea6ec94347e91507fe03a
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Use efuse register values, to differentiate between
wcd9326 and wcd9335 codecs.
Change-Id: I68e7ae5eb1717dccd0af975670ac3644304996b9
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Modify codec, wsa and core drivers to maintain the power states
and configure the tasha codec and wsa hardware to low power mode
to reduce the power consumption during suspend.
Change-Id: I245c7ee154d0840b8036a99df374fc9392000585
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
When no audio use-cases are active, codec digital core
can be put into power collapse to reduce the power consumption
during codec stand-by. Add support to put core into power
collapse and remove out of the collapse when audio use-cases
are triggered.
Change-Id: Ib72b72239712d1b20542950f05b698647edcb9fa
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
During suspend, set regulator to optimum mode to
reduce power consumption.
Change-Id: Ia3bcd163526b8ecfc9a4a023c652d88093a6d683
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Some of the codec registers can be shared with other processors and
hence can get updated without the knowledge of the driver. In such cases
the regmap cache is not in sync with the hardware register setting. Mark
these registers as volatile so that reads and writes bypass the cache.
Change-Id: I3c8e8e31e36f9f9a1aba0193d696d019437dfed2
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
vdd-cx supply is derived from sido-buck and is connected
to wcd9335 codec. vdd-cx supply is suddenly dropping to zero
during playback usecase that is causing no response from
codec for slimbus read/writes. Add changes to avoid sudden
drop of vdd-cx supply to wcd9335 codec.
Change-Id: I72c85bc46c41771eb969de452cf3f241ed6577f2
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Change sequence of enabling flyback on wcd9335 as per hardware
requirement for flyback to work properly in audio usecase.
Change-Id: I48c24665afc4cb6527cc225ec3fecbc5f883a17d
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Add changes in wcd core driver to support slimbus bulk register
writes API that sends multiple register writes with
one descriptor.
Change-Id: I27fd179f14e03e955f2847e3d2c4249852c14af2
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Add support to detect the wcd9335 codec version and
define macros for wcd9335 1.0 and 1.1 so that codec
driver can use these macros to update the register
configuration.
Change-Id: Ibb497bfb857addb9c7e8db37828c0096979d2c3c
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
WCD9335 codec has paging scheme to write codec registers where the page
number for the register needs to be written first before accessing the
register itself. Update the slimbus repeat write functionality to use
paging scheme for WCD9335 codec.
Change-Id: I502ceb8ac59a20c990a70c0cbe16b89559de529f
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Some of the CPE registers can be updated by the codec hardware to
indicate the CPE status. Mark these registers as volatile so that read
or write for these registers always goes to the codec hardware bypassing
the register cache.
Change-Id: I2c1e15b84b19136649f83072a6b0ca35f93c73a3
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
It is possible that the SVA_OUTBOX1 and SVA_OUTBOX2 interrupts from
codec can be triggered when previous interrupt is still under processing
in threaded context. In order to not lose the interrupts in such case,
clear the SVA_OUTBOX1 and SVA_OUTBOX2 interrupts before they are
dispatched to the threaded interrupt handler.
Change-Id: I9ea0f794a2fcb6a9ee26e685622b3228f7349462
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
wcd9335 codec does not have registers from address
0xE00, but due to erroneous condition check, even
registers above 0xE00 are accessed in the driver.
Update condition so as to prevent the invalid register
access.
Change-Id: Iad3d1e72543c018ae102165f54b8a58f35994923
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
WCD9335 Codec reset sequence is different for versions 1.0
and 1.1. Update the reset sequence if wcd9335 version 1.1
is detected.
Change-Id: I7c0061f8d0218ed67adaa4a1d4f54a60dc925d55
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Add support for wcd9335 MBHC for accessory
detection that gets inserted into headset jack
on the device. Also cleanup MBHC driver.
Change-Id: I50d24d81b083f7d31e2e2f9853a8a44c574e99c5
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Some of the codec registers though readable, are
not currently added in the readable register table.
This will prevent reading those registers from driver.
Add the registers to the table as readable.
Change-Id: Ieae7ef4150396907278631cc5a9b6bc8ad178362
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>