(Use this only for devices with audio reset issues)
Also bump version to 3.1
Signed-off-by: Paul Reioux <reioux@gmail.com>
wcd9xxx-core: add register write without mutex protection
This is assuming the calling function will take care of the mutex.
Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
Remove read permission for debugfs reg dump node
for group and users to not allow reading of wcd9xxx
registers.
CRs-fixed: 2113240
Bug: 62464339
Change-Id: I73a22e140446828e694fdc95fde7ac4e051c9548
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
commit 1a5fb99de4850cba710d91becfa2c65653048589 upstream.
Some boards with TC6393XB chip require full state restore during system
resume thanks to chip's VCC being cut off during suspend (Sharp SL-6000
tosa is one of them). Failing to do so would result in ohci Oops on
resume due to internal memory contentes being changed. Fail ohci suspend
on tc6393xb is full state restore is required.
Recommended workaround is to unbind tmio-ohci driver before suspend and
rebind it after resume.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Zefan Li <lizefan@huawei.com>
commit 97dc4ed3fa upstream.
During probe the driver allocates dummy I2C devices for RTC, haptic and
MUIC with i2c_new_dummy() but it does not check the return value of this
calls.
In case of error (i2c_new_device(): memory allocation failure or I2C
address cannot be used) this function returns NULL which is later used
by i2c_unregister_device().
If i2c_new_dummy() fails for RTC, haptic or MUIC devices, fail also the
probe for main MFD driver.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit ed26f87b9f upstream.
During probe the driver allocates dummy I2C device for RTC with i2c_new_dummy() but it does not check the return value of this call.
In case of error (i2c_new_device(): memory allocation failure or I2C
address cannot be used) this function returns NULL which is later used
by i2c_unregister_device().
If i2c_new_dummy() fails for RTC device, fail also the probe for
main MFD driver.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 96cf3dedc4 upstream.
During probe the driver allocates dummy I2C devices for RTC and ADC
with i2c_new_dummy() but it does not check the return value of this
calls.
In case of error (i2c_new_device(): memory allocation failure or I2C
address cannot be used) this function returns NULL which is later used
by i2c_unregister_device().
If i2c_new_dummy() fails for RTC or ADC devices, fail also the probe
for main MFD driver.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit c5857ccf29 upstream.
With the new interrupt sampling system, we are no longer using the
timer_rand_state structure in the irq descriptor, so we can stop
initializing it now.
[ Merged in fixes from Sedat to find some last missing references to
rand_initialize_irq() ]
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ed Tam <etam@google.com>
commit 775f4b297b upstream.
We've been moving away from add_interrupt_randomness() for various
reasons: it's too expensive to do on every interrupt, and flooding the
CPU with interrupts could theoretically cause bogus floods of entropy
from a somewhat externally controllable source.
This solves both problems by limiting the actual randomness addition
to just once a second or after 64 interrupts, whicever comes first.
During that time, the interrupt cycle data is buffered up in a per-cpu
pool. Also, we make sure the the nonblocking pool used by urandom is
initialized before we start feeding the normal input pool. This
assures that /dev/urandom is returning unpredictable data as soon as
possible.
(Based on an original patch by Linus, but significantly modified by
tytso.)
Tested-by: Eric Wustrow <ewust@umich.edu>
Reported-by: Eric Wustrow <ewust@umich.edu>
Reported-by: Nadia Heninger <nadiah@cs.ucsd.edu>
Reported-by: Zakir Durumeric <zakir@umich.edu>
Reported-by: J. Alex Halderman <jhalderm@umich.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ed Tam <etam@google.com>
commit c6cc25fda5 upstream.
The adp5520 unfortunately also clears the BL_EN bit when the nSTNDBY bit is
cleared. So we need to make sure to restore it during resume if it was set
before suspend.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add a pm8xxx-tm subdevice into pm8821-core. The pm8xxx-tm device
can be used to receive an interrupt when critical temperature
thresholds are reached. Since PM8821 does not have an ADC, it is
not possible to read a real time PM8821 die temperature using
this pm8xxx-tm device.
Change-Id: I3720c79a0546e8bc69044166f70dd4c313e84daa
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit 1604779c47df4bf003211c35e356210e689676d5)
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>
Revert the following customer changes in order to clean up this
branch.
This reverts commit 33ddf5a9eaa031c00b00846458f2ba534e6807b8.
This reverts commit f17df2402b795faf2c03de6d8a5b12378674f3be.
This reverts commit 0a488464c03806e1f775c35d7b2c83650eaab4ef.
This reverts commit 23d2a7cd02b081e1cf2578c02b7ecd3a65319d4e.
This reverts commit 90e32fa7cb701d922825e40b82b566e4af843ea2.
This reverts commit 7346d0fbd3c338d55330766e0f1867f19b364fed.
This reverts commit eb59bf66db9f2ca6e79552f4f72aa56f8c6abd27.
This reverts commit 9c56de000bb2390191fa2ddaea738e6d3e8f5d4f.
This reverts commit 7a72ca62c3f64c7b914edd8d9dbb75933b3c845e.
This reverts commit 76048dac5085eca4459ee5ea5dd4876a1f518cfa.
This reverts commit bfafe7ec7cdeef5b44b32f9aa6ee03beba2020e0.
This reverts commit e346f7a7b8ead1bbb106f4eb1e766c49407bffde.
This reverts commit 1265899c012a463cb0521ed73f2abe057692a9db
This reverts commit 1ff608a341b87defa586ca4a24d0bd89abfdfbb3
This reverts commit 5f030effc8c1af159ad13e77d4c169f037d6c9e4.
This reverts commit 19c87ddde66fd6aad61a60e466a75af235fca7f9.
This reverts commit 905eac978c30c96c5d12a81c1f6968d8c57a645f.
This reverts commit 1bd7c8643cdd8fdc7cf649ec465cc454315a6753.
This reverts commit 69f1730e0d249bad3b4f0fc0f94d917c16c3df19.
This reverts commit 2073afb7ee8b3f80f1f3184bd7ac99ead581adee
This reverts commit 8126554cf049d13f4dd2d815d86ea289efdc6f3a.
This reverts commit 45ccbb53cfc227fd3811e71b0bd813432c96ee9e
This reverts commit 325995993eb806285a35381e803ed5432fe5a93a.
This reverts commit 84cf5a3959bcf412c4b48f8a29b8255c18602d1b.
This reverts commit 839d5a50c761787ded6b8558fa37696be81196fe.
This reverts commit d4b1fb57463d04aeca5ae9bfd2181faa016f97c2.
This reverts commit 2ab04b0deb912a5a52899a50ced73e36974a6a00.
This reverts commit 3a3de0ee621625c8767e0d3c7106c52fcf834499.
This reverts commit f278add027723a90b11c9a97f6d1b09c1aaec795.
This reverts commit 1a749b700752efcc8d832f7b83554df2771dce53.
Change-Id: I21863586360b6bc57dd6d631c34725bea963cffa
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
Although not in internal reference designs, customers
may need to use pmic based vibrator instead of isa1200.
CRs-fixed: 416276
Change-Id: I190840eee4862ac82c5120501748b795e6d0c760
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
-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>
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>
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>
PM8917 is in the same family as PM8921. Add it in all cases of
PM8921 where it applies.
Change-Id: I2bf3937ed7e80355a8d5b330f18298bf040d585b
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit a813d5f4d82a2eedf7b8813fa03cf9e8af236a68)
The battery alarm module provides interrupts when the battery
falls below or rises above a programmed threshold. This feature
is useful to wakeup the device when the battery is in low voltage
situations.
(cherry picked from commit 6d538144cb02933cf27f425ad721541d80377b43)
Change-Id: I5d17bacf363cab165156b62730ccf9c23c633b3c
CRs-Fixed: 372690
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit 16f56979ee6876ce64f6dba8928a782825ff1275)
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>
The wcd9k codec hardware's reset is held since system boots to make sure
hardware is in reset during enabling regulators.
But current codec driver toggles reset which results in resetting twice.
Fix reset sequence so hardware can get reset only once.
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
(cherry picked from commit fdf4751fb7f599070d5e10f84ea232b3b648a9b5)
Change-Id: I2be857ef8d702aecff2427da3c75ad57d2040299
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
The codec hardware appears on the slimbus after hardware reset and it's
possible the reset takes longer than what it's supposed to be.
Retry probing interface device as well as slave device for few more times
prior to claim probe failure.
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
(cherry picked from commit 3c5b2df855d34771f9ee94dfb03e9f83242a1373)
(cherry picked from commit b4f337d580f1302bc05f2af99bae60fd77efc3b3)
Change-Id: I4a0a8a3792c6e46a9ffc844b3fd4f61b9a603457
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
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
The BMS driver needs to know the restart reason of the pmic. Add
an api in the pm8xxx design to provide the restart reason.
Change-Id: I0bbad22c5fed8c32dd7de387194e94c8d4b9ad75
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Read the codec specific data from device tree instead of board file.
Change-Id: Iad382b89692903d2434b63d34c7121fe0b4b9dda
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
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>
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>
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>
PM8821_SEC_N_IRQ on 8064 is being routed as
a direct connect interrupt to QGIC. Change
this to enable mpm to monitor this interrupt
and wake it out of power collapse.This helps
in achieving vdd minimization on 8064.
Change-Id: Ia5c0463dc7c853f44d5d63a737aff10b15cf4a32
Signed-off-by: Chandra Ramachandran <cramacha@codeaurora.org>
The pmic spk driver is not getting disabled due to wrong disble
logic.This results in spk driver always on.
CRs-Fixed: 376950
Change-Id: Ia1509f97ae1a3526732218492ff86063afe68137
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
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>
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>
The 8038 has a ccadc (coulumb counter analog to digital converter) which
is used by the BMS for state of charge (SOC) reporting and is also used by
software to get instantaneous battery current. Without this cell the ccadc
is never probed and current readings and SOC are inaccurate.
CRs-Fixed: 372679
Change-Id: If323a35dda650067219f35e68395f9fd23f4d69b
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Add support for I2C\I2S interface for sitar codec along
With SLIMBUS interface.
Change-Id: I68666fd10cf9fb8d871d4b2a3d9b2e454dd1efe7
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Add pm8xxx-tm subdevice into pm8038-core. The pm8xxx-tm device
can be used to access the real-time PMIC die temperature. It
can also be used to trigger an interrupt when critical
temperature thresholds are reached.
Change-Id: I4b8bda1d51cafaa6b77408da4c183bdb2dc4327a
Signed-off-by: David Collins <collinsd@codeaurora.org>
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>
The WCD9320 Codec Driver is an ALSA-compliant codec driver. This driver
constructs the internal codec audio paths with DAPM widgets and
controls and provides the controls to the upper layers to enable and
configure audio paths.
Change-Id: Iee29359bebfc838cd200732b7191a2eb6a2087ee
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
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>
Add a driver to control the battery alarm module of PMIC PM8xxx
devices. This module uses a pair of comparators to determine
when battery under and over-voltage take place. A wakeup
interrupt is triggered in these cases which can then run any
notifiers which have been registered. Also add APIs to
configure the threshold voltages and the frequency at which the
hardware checks the state of the battery voltage.
Change-Id: Id0b82f9090b29ce743b5e0faac17853c94111771
Signed-off-by: David Collins <collinsd@codeaurora.org>
The driver adds support for configuring the following parameters for
external pmic speaker amp driver
1. Gain
2. Mute/Unmute
3. Speaker enable/Disable
The above operations are supported by driver by exported apis
from kernel space.The Machine driver from ALSA would use these
to configure speaker.
Change-Id: I9817f5d5c2952ca423b84f35162a842123e4d413
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Add a PMIC 8XXX driver which will contain several miscellanous APIs.
The API that is needed is pm8xxx_reset_pwr_off.
Change-Id: I923d01cfd9dc3f8e760ae45d70799f80af65e88c
Signed-off-by: David Collins <collinsd@codeaurora.org>
Qualcomm PM8xxx chips, such as PM8058 and PM8921, have 8 channels of
PWM, also called LPG (Light Pulse Generator) in HW specs. All PWM
channels can be used as simple PWM machine or as a more advanced PWM
pattern generator using programmed lookup table.
This patch supports all APIs listed in <linux/pwm.h> with a small
difference. The two parameters (duty_ns and period_ns) in pwm_config()
are used as values in microseconds instead of nanoseconds. Otherwise a
32-bit integer can't fit for a range of 7 us to 300+ seconds.
Change-Id: Ic8f59e96360ea3dabef591e0b257a4ffe0796d9b
Signed-off-by: Willie Ruan <wruan@codeaurora.org>