Commit graph

1358 commits

Author SHA1 Message Date
Paul Reioux
b5feb08ab6 Sound Control: (Optional) work around for WCD93xx audio issues
(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>
2019-03-16 12:46:51 +01:00
Karthikeyan Mani
71495e2047 ASoC: wcd9xxx: restrict debugfs permission
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>
2018-01-13 17:13:39 +03:00
Artem Borisov
d7992e6feb Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1
All bluetooth-related changes were omitted because of our ancient incompatible bt stack.

Change-Id: I96440b7be9342a9c1adc9476066272b827776e64
2017-12-27 17:13:15 +03:00
Dmitry Eremin-Solenikov
9de18f8e90 mfd: tc6393xb: Fail ohci suspend if full state restore is required
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>
2015-04-14 17:33:43 +08:00
Krzysztof Kozlowski
3b015ff024 mfd: max8997: Fix possible NULL pointer dereference on i2c_new_dummy error
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>
2014-05-06 07:51:41 -07:00
Krzysztof Kozlowski
4efaf4210b mfd: max8998: Fix possible NULL pointer dereference on i2c_new_dummy error
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>
2014-05-06 07:51:41 -07:00
Krzysztof Kozlowski
b9546b807f mfd: max8925: Fix possible NULL pointer dereference on i2c_new_dummy error
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>
2014-05-06 07:51:41 -07:00
Theodore Ts'o
eff211bddf random: remove rand_initialize_irq()
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>
2013-09-09 17:01:42 -07:00
Theodore Ts'o
a1cca5558b random: make 'add_interrupt_randomness()' do something sane
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>
2013-09-09 14:43:59 -07:00
Lars-Peter Clausen
d82f013b8c mfd: adp5520: Restore mode bits on resume
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>
2013-05-07 19:51:57 -07:00
Iliyan Malchev
491b58e1ca Revert "msm: power: Revert LGE power patches"
This reverts commit 2f24cb771c.
2013-03-15 17:13:25 -07:00
Iliyan Malchev
b8c65bc60a Revert "msm: power: update power drivers to msm-3.4 tip"
This reverts commit fae0afd7be.
2013-03-15 17:13:24 -07:00
Duy Truong
04e554807c Update copyright to The Linux Foundation
Change-Id: Ibead64ce2e901dede2ddd1b86088b88f2350ce92
Signed-off-by: Duy Truong <dtruong@codeaurora.org>
2013-03-15 17:07:39 -07:00
David Collins
56468a5ad1 mfd: pm8821-core: Add support for PMIC thermal alarm
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)
2013-03-15 17:07:33 -07:00
Banajit Goswami
6f31536fe3 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>
2013-03-15 17:07:27 -07:00
Abhijeet Dharmapurikar
fae0afd7be msm: power: update power drivers to msm-3.4 tip
This branch is currently very outdated. Cherry pick the following
changes in order to bring recent fixes to this branch.

Change-Ids
Ib99cd49623698d0295bc3c3cf880225495d530cb
Ifba2bd1248e8bb47a0700dec4d321d32db4f2066
I0fc1e116c0f5a5648f99df967bdbb41fe5a07cbc
I8e3e9068e7b9a3bfd24c07a00bb3953180ce0741
I2bf31a23199f942a9ac843b9940a0f7377256238
I96b47c8603a291c41c5769fab9483d83fefb6084
If3c5f00f4b75d03838ee556235697369fd2e47dd
I32d50caf7b7a84db2654b69baafb40a441f46bf0
Ibd1020113de05e8214d41ffb975d4c95d3bb1ccf
I67c2ac422b0ba1e5eca11ffccfe7e112c2e65a3d
I2c149e6edd7c194e7f31ece95e2003ffde935806
I1f4b65cba149480fb4a8f91667ce45a876dff2f0
I2605afc2d6f9f3569ec783b2d23881f31cc9038a
I77b40f9cb8295cff1d4a24dfc7d85b0e57262f6e
I8ec5a68cad573218a0b0bd0073277b76978417ff
I9eaf7f21c73dd1ceaf97589cbf82b722706c48c2
I089725e20ae20956530e570d918a87b72e59626e
Ifa70a4daf01414dfafed7830e3a6a682c42e9364
Iaace5bc1d0611619f11b760ea6986eadb7346da1
I415d7831f15c0d690fd118ff190cd710a31368c6
I1e55bbfe37c7cc6f62581af11280a565ed648c06
I11938c569a25b026ee6b7b5125cec930676ec01d
I07577d1aa57bfa4bee40b52c18b5bfcb1cdb7070
Icdb0a28b5f9456135c60badf726c367b02f6d762
I4f14b7419f7a90813650601638f6563422c13ae4
I016a33c358be2e7a2d26202f2e9b168dd54b6d34
I43e26a2932ab3e3d9d79bb5af7daf2364ca133b7
I333c810568cdc656d2e13f0eeb9511857335b834
I830bf2e679e76efe7ed9d8bb30a8d459d8b9a09a
I08d8d319d096c050ae53d90eeac293c9b1bab2bf
I445676d558e05a6c5e9dd1e76e80ba2f5e8cd6c1
I9f38515f35fcddfbdc34ae4f59ffcfc6682033d4
Ia32e581c11954163bc8ff20a7b32432a843a17b2
I07c346475fb4a294bc8eb8da8c2048cc23394e20
Ic3f2c4e5bafd3a1556412005564fc0b549e6813c
Ic68717f4410170814d3e3b141de77b35eca12f7b
Ifad79991298e9d779b38a33a270af5197d2fc060
I3060c5ba31b59666aedfafad430e21329c4479d4
I9c87282ba5819a76a6f6697a5e9de6c92d74a665
I8144e2b83748a96ab83ba14894bfa5bd59995895
I8cac84296ddb1e323f28e2476f78d0190f4a1b73
Icef2b7fa70f274f671bd1b9469eb6a333ab462f9
Idc4ceb7973d1a424834f8c2a4bc5916ef7b1e961
I1bc779e5890f6994442c562ee5abf37c06dc6d3d
Ib1161d3d8c4a9378eabf44f9de1eae9556d82643
I11a17fc105dea398140abc1a59e6355e9e55b322
I0aa523321f1eed4a0a5461b1a894452f77e6ff99
I827bd74e9892969bb4891b31af1515789fa76c1c
I1bb658339e5a6f0adb07fda3ee0bc6c03670cc09
I135261c851067a25b20b30482764b5a61145f186
I4971d605c3475949be64372dc6bd3355ed258527
I08f6a7830c4b9ad44fb96f6d304ce257a899e287
I96886f8d0f3f03905163d93c4f8f3e637d98127f
Idf2cf7f40780cf46ba95228764790b818bc72db5
Ib046fd7149d71fc62c8f2df7a9747d6b54e95138
I546ff57d76e50ad86eb5853782fdcc1f348c9f0e
I1293ecc2974bae4ad530ecb775cd19072e413c72
I8db5a202a2e63ca0a3e355a6083d426acb7342cb
I71482f9a4430a8bbcd02c954a415ff3fab2a0c8f
I0c5656798444764b52f4d9d8889f831d674a1610
I2ac4ccd967a7a47284573c9b645055ebeca4635c
I93b830d42e7d44435c790832c11d5d38861015e0
If24985f47cc9fcd6c2eb84a73165878559008120
I39b908451f4b678ed63b872ffc46590e2c728b2c
If7e5622067c77c4c8d64ee466d1c62e4dcb0e53f
If58279329f6c76978223369a2d08d47a7b1e3579
I3621a0a204360343ba684e2217a68a6ef51a7850
I358909c38b0771fe0283386841b6123ddb2931a6
I2e8fcb4a15af3a66331a921d378bfd5d2dfe4533
I0bbad22c5fed8c32dd7de387194e94c8d4b9ad75
I34f51c6202cbaa805c496360e8dbd391890decc6
Iaab82ea254444bba233cd9ebad93d38426154ca4
Ica2565031546a8281820c17edc95d258ad31ba65
Ic282fff7167a8224ec1a1e0f7c247a9c8d73f390
Icdc707a9438adae5c8bb2d9b97af95e65c4bc2a1
I26c4e1fb971f22ec721e1dddcce6b301f5db6608
I8882575084eefa6a23bd59b8d2a54a53d793298e
Ic1e7cf4da4d2bf73d889aee7bac6cf260b26d532
I472b9da10e9f45b3c254f8440526f3f9d5116931
I1560e0df1c89be1db1e1d1aeaaeef2e6da5f85c1
Ie2842b28648084d8970329d7c76fcf0d0666a847
I2dccaedb559fc5e9865b137f980024e068bdafa3
I61a3d44f81d829f1ef22fd3044c65e4b3518b92b
I0d657c2e0d47af32cc35cd66b902be72952e5438
I22d2dbdae5c9c859d4baca2bdb7bea71da09b85b
I8c99fcbbf2f7229728236ae1059f4c9cb8dbb065
I1bb841e463658c8db42eb15ecc1687262df86a2f

Change-Id: Ib04f801b0085e7d5da3d73594bbc41c281b06026
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2013-03-07 15:25:37 -08:00
Xiaozhe Shi
2f24cb771c msm: power: Revert LGE power patches
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>
2013-03-07 15:25:37 -08:00
Amy Maloche
258d6bf0bf mfd: pm8038: Add structure to support pm8xxx vibrator
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>
2013-03-07 15:24:27 -08:00
Venkat Sudhir
df7259796a 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>
2013-03-07 15:20:20 -08:00
Venkat Sudhir
4b5af6ccec 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>
2013-03-07 15:20:19 -08:00
Joonwoo Park
e1ab2c0018 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>
2013-03-07 15:20:19 -08:00
Willie Ruan
480c05b75d mfd: pm8xxx-misc: add PM8917 in PM8921 cases
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)
2013-03-07 15:20:16 -08:00
Abhijeet Dharmapurikar
092d7c8abb mfd: pm8038: Enable the battery alarm module
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)
2013-03-07 15:20:10 -08:00
Asish Bhattacharya
f1abcda9aa 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>
2013-03-07 15:19:38 -08:00
Joonwoo Park
79829558fb mfd: wcd9xxx: Fix codec hardware reset sequence
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>
2013-03-07 15:19:08 -08:00
Joonwoo Park
afa047d5e4 ASoC: wcd9xxx: Retry probing interface device on slimbus.
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>
2013-03-07 15:18:01 -08:00
Asish Bhattacharya
b9d5cf5f7a mfd: pm8xxx-spk: Fix settings for the class D audio amplifier
Test results based on noise gate recommended the following settings

0x254=0xC8 (Threshold=110, preamp bias=01)
0x255=0xC1 (Hold=110, max attn=0000, mute=1)
0x256=0xB0 (decay=101, attack=10, delay=0)

CRs-Fixed: 385187
Change-Id: I7276a6d0689ffb475aa8c58214fd2b00fe62f81c
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
(cherry picked from commit 59442e223dcd616d7a244c85d8e0acccf4df9651)
2013-03-07 15:17:51 -08:00
SathishKumar Mani
b502df8c7c 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
2013-03-04 12:47:36 -08:00
Iliyan Malchev
c49f0bf07b pm8921-core: initialize pwrkey device earlier
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:47:31 -08:00
choongryeol.lee
9309bccb81 mfd: pm8xxx: provide api to read restart reason
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>
2013-03-04 12:47:18 -08:00
Kiran Kandi
6a05c9e1d4 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>
2013-02-27 18:20:08 -08:00
Swaminathan Sathappan
34616f3148 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-02-27 18:19:52 -08:00
Joonwoo Park
7ad053abe0 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-02-27 18:19:20 -08:00
Venkat Sudhir
a0c6b1b5f2 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>
2013-02-27 18:17:26 -08:00
Chandra Ramachandran
daec5ecaf5 mfd: Update mpm to monitor pm8821 gpio line
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>
2013-02-27 18:17:11 -08:00
Asish Bhattacharya
de0d6d5c29 mfd: pm8xxx-spk: Fix the disable logic for pmic speaker driver
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>
2013-02-27 18:16:56 -08:00
Asish Bhattacharya
57e874b720 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>
2013-02-27 18:15:57 -08:00
Swaminathan Sathappan
97ab0481b2 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-02-27 18:13:52 -08:00
Abhijeet Dharmapurikar
23b420290c mfd: pm8038: add ccadc cell
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>
2013-02-27 18:13:17 -08:00
Asish Bhattacharya
6bc62a66f0 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>
2013-02-27 18:12:33 -08:00
David Collins
5f1b9eef24 mfd: pm8038-core: Add support for PMIC thermal alarm
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>
2013-02-27 18:12:12 -08:00
Jay Wang
c31e3b26fc 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-02-27 18:11:13 -08:00
Kiran Kandi
3534eb6906 ASoC: wcd9320: Add intial driver for WCD9320 codec
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>
2013-02-27 18:11:03 -08:00
Stephen Boyd
9c4a050aff mfd: pm8921-core: Sync up to our copy
Pull in all our to this file up to quic/msm-3.4 merge from
quic/msm-3.0.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:31:47 -08:00
Asish Bhattacharya
065bd4444f 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-02-25 11:31:46 -08:00
David Collins
ef43639219 mfd: pm8xxx: Add PM8xxx battery alarm driver
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>
2013-02-25 11:31:45 -08:00
Asish Bhattacharya
ab125a4d10 mfd: pm8xxx-spk: Add support for class D speaker amplifier driver
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>
2013-02-25 11:31:45 -08:00
David Collins
e79d4e36e8 mfd: pm8xxx-misc: Add a PMIC 8XXX misc driver to hold various APIs
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>
2013-02-25 11:31:44 -08:00
Willie Ruan
e70d3fa4a2 mfd: pm8xxx-pwm: add pm8xxx PWM driver
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>
2013-02-25 11:31:43 -08:00
Stephen Boyd
d1b9398d86 mfd: pm8xxx-irq: Sync up to our version
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:31:42 -08:00