Daniel Baluta [Fri, 2 Nov 2018 15:20:53 +0000 (17:20 +0200)]
MLK-20094: ASoC: fsl: dsp: Fix crash in compress cleanup path
We must find a way to no longer touch resources after they are
cleand up.
Now, after a stress test we get the following crash:
[ 2156.863772] fsl-dsp
596e8000.dsp: xf_pool_alloc failed
[ 2156.869337] Unable to handle kernel NULL pointer dereference at
virtual address
00000060
[ 2157.148594] [<
ffff000008d8839c>] _raw_spin_lock+0x14/0x48
[ 2157.153995] [<
ffff000008b3e0b8>] xf_cmd_send_recv_complete+0x40/0xf0
[ 2157.160354] [<
ffff000008b3e470>] xf_close+0x40/0x88
[ 2157.165239] [<
ffff000008b3f7a4>] xaf_comp_delete+0x5c/0x70
[ 2157.170730] [<
ffff000008b40530>] dsp_platform_compr_free+0xa0/0xe8
[ 2157.176917] [<
ffff000008b287fc>] soc_compr_free_fe+0x144/0x1a0
[ 2157.182754] [<
ffff000008b11b24>] snd_compr_free+0x64/0x98
This happens because:
1) dsp_platform_process work handler waits in a loop for
messages to arrive.
2) when cplay process finishes it cleans up most of the
resources.
3) when another cplay process starts it reinitializes the
resources including queues for example.
4) a message will be generated and kernel will crash because
dsp_platform_process uses the older queues.
A solution for this is to make sure dsp_platform_process work loop
is stopped at cleanup time.
We use is_active state and signal dsp_platform_process handler to
finish because we are on the cleanup path.
While at it replace cancel_work with cancel_work sync to be sure
that work handler ends before going on with the rest of the cleanup.
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit
c0f7ef8eaf096523e9ebe3acd818e5f67fdb639f)
Daniel Baluta [Mon, 15 Apr 2019 14:03:33 +0000 (17:03 +0300)]
MLK-18279: ASoC: fsl_dsp: get the information of reserved memory from
dts
The reserved memory for dsp is defined in dts file, however, the dsp
driver has also defined the address and size of this reserved memory,
which is repeated and inflexible.
So by cancelling the definition in dsp driver and use system API to
get the information of reserved memory from dts dynamically to fix
this problem.
Signed-off-by: Weiguang Kong <weiguang.kong@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Horia Geantă [Mon, 15 Apr 2019 13:28:21 +0000 (16:28 +0300)]
MLK-21453: crypto: caam - fix Mentor's port, merge conflict resolutions
1. imx_4.14.y commit ("
6c68d27892c4 MLK-18082: boot: dtsi: Align DTSI")
changes in Documentation/devicetree/bindings/crypto/fsl-sec4.txt were
omitted, add them now.
2. Some commits (see Fixes tags) are incomplete / merge conflict
resolutions are incorrect.
Fixes:
0cab3173f44a ("MLK-18082: ARM: dts: imx: Change size of caam-sm to correct size")
Fixes:
9c5e81b8410b ("MLK-9710-18 snvs - make SECVIO module device tree correct")
Reviewed-by: Franck LENORMAND <franck.lenormand@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Franck LENORMAND [Tue, 19 Mar 2019 15:05:30 +0000 (16:05 +0100)]
MLK-19449: crypto: caam - Add Power Management
Add support for suspend and resume operation for PM in CAAM driver.
When the CAAM goes in suspend, the hardware is considered to do nothing.
On some platforms, the power of the CAAM is not turned off so it keeps
its configuration.
On other platforms, it doesn't so it is necessary to save the state of
the CAAM:
- JRs MID
- Address of input and output rings
Limitation:
When the CAAM is powered OFF, it is resetted so the JDKEK and TDKEK
changes. This impacts crypto transforms using MDHA split-keys
which are kept over suspend as they are encrypted with the JDKEK:
- hmac(*) from caamhash.c
- authenc(hmac(*),*) from caamalg.c
- echainiv(authenc(hmac(*),*)) from caamalg.c
The issue was already present in current code so this patch does not
add a regression in this regard.
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Franck LENORMAND [Tue, 5 Mar 2019 13:20:34 +0000 (14:20 +0100)]
MLK-19449: crypto: caam - Change structure type representing DECO MID
The structure partid is not suitable to represent the DECO MID register.
This patch replace partid by masterid which is more appropriate.
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Franck LENORMAND [Fri, 15 Feb 2019 15:24:35 +0000 (16:24 +0100)]
SSI-35: crypto: caam - Do not rely on common index of jr
With current code, the index are stored in an array at their common index,
ie jr0 store at index 0, jr1 at 1, ...
It force to use buggy mechanic to compute it and is not scalable.
This patch removes the mechanic of computation of hardware register
addresses and the notion of first_jr_index.
Instead the first JR available is set to index 0 of the table and so on.
Legacy code was retrieving the index of the first jr to access registers.
With this new way, we simply always access the first jr.
This is working because after the configuration of the JR in ctl
(enable_jobrings), the driver checks that there is at least 1 JR.
Without this, we could create segfaults.
Fixes:
de9807e6e0de ("MLK-15473-1: crypto: caam: Add CAAM driver support for iMX8 soc family")
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Horia Geantă [Thu, 7 Feb 2019 18:07:04 +0000 (20:07 +0200)]
crypto: caam - lower SM test verbosity
Let's use dev_dbg() instead of dev_info() to minimize verbosity in case
we're not interested in low-level details.
While here, replace dev_info() with dev_err() in places where errors are
reported.
Reported-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Franck LENORMAND [Fri, 23 Nov 2018 15:06:45 +0000 (16:06 +0100)]
MLK-20204: drivers: crypto: caam: Remove deadcode on 32bit platform
When building on a platform with a 32bit DMA address, taking the
upper 32 bits makes no sense.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Franck LENORMAND [Fri, 23 Nov 2018 10:47:18 +0000 (11:47 +0100)]
MLK-20204: drivers: crypto: caam: sm: test: Dealloc keyslot properly
Some keyslot values were used during deallocation
but were not initiliazed nor set properly.
drivers/crypto/caam/sm_test.c:446: CID
3901091 (#1 of 1):
Type: Uninitialized scalar variable (UNINIT)
Classification: Unclassified
Severity: Unspecified
Action: Modeling Required
Owner: nxa21133
Defect only exists locally.
drivers/crypto/caam/sm_test.c:98:
1. var_decl: Declaring variable "keyslot24" without initializer.
drivers/crypto/caam/sm_test.c:113:
2. path: Condition "!ctrlpriv", taking false branch.
drivers/crypto/caam/sm_test.c:118:
3. path: Condition "kspriv == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:123:
4. path: Condition "!units", taking false branch.
drivers/crypto/caam/sm_test.c:130:
5. path: Condition "units < 2", taking false branch.
drivers/crypto/caam/sm_test.c:150:
6. path: Condition "blob8 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
7. path: Condition "blob16 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
8. path: Condition "blob24 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
9. path: Condition "blob32 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:178:
10. path: Condition "sm_keystore_slot_alloc(ksdev, unit,
(16U /* (8 % 16) ? (8 >> 4) + 1 << 4 : 8 */), &keyslot8)", taking true
branch.
drivers/crypto/caam/sm_test.c:179:
11. path: Jumping to label "dealloc".
drivers/crypto/caam/sm_test.c:446:
12. uninit_use_in_call: Using uninitialized value "keyslot24" when
calling "sm_keystore_slot_dealloc".
drivers/crypto/caam/sm_store.c:771:
12.1. path: Condition "smpriv->slot_alloc == NULL", taking false branch.
drivers/crypto/caam/sm_store.c:771:
12.2. path: Condition "smpriv->pagedesc[unit].ksdata == NULL", taking
false branch.
drivers/crypto/caam/sm_store.c:775:
12.3. read_parm: Reading a parameter value.
drivers/crypto/caam/sm_test.c:445: CID
3901093 (#1 of 1):
Type: Uninitialized scalar variable (UNINIT)
Classification: Unclassified
Severity: Unspecified
Action: Modeling Required
Owner: nxa21133
Defect only exists locally.
drivers/crypto/caam/sm_test.c:98:
1. var_decl: Declaring variable "keyslot16" without initializer.
drivers/crypto/caam/sm_test.c:113:
2. path: Condition "!ctrlpriv", taking false branch.
drivers/crypto/caam/sm_test.c:118:
3. path: Condition "kspriv == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:123:
4. path: Condition "!units", taking false branch.
drivers/crypto/caam/sm_test.c:130:
5. path: Condition "units < 2", taking false branch.
drivers/crypto/caam/sm_test.c:150:
6. path: Condition "blob8 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
7. path: Condition "blob16 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
8. path: Condition "blob24 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
9. path: Condition "blob32 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:178:
10. path: Condition "sm_keystore_slot_alloc(ksdev, unit,
(16U /* (8 % 16) ? (8 >> 4) + 1 << 4 : 8 */), &keyslot8)", taking true
branch.
drivers/crypto/caam/sm_test.c:179:
11. path: Jumping to label "dealloc".
drivers/crypto/caam/sm_test.c:445:
12. uninit_use_in_call: Using uninitialized value "keyslot16" when
calling "sm_keystore_slot_dealloc".
drivers/crypto/caam/sm_store.c:771:
12.1. path: Condition "smpriv->slot_alloc == NULL", taking false branch.
drivers/crypto/caam/sm_store.c:771:
12.2. path: Condition "smpriv->pagedesc[unit].ksdata == NULL", taking
false branch.
drivers/crypto/caam/sm_store.c:775:
12.3. read_parm: Reading a parameter value.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Franck LENORMAND [Fri, 23 Nov 2018 10:37:28 +0000 (11:37 +0100)]
MLK-20204: drivers: crypto: caam: sm: Remove deadcode
There was some code to free the keystore but the current
state of the function make this code unreachable so
remove it.
Coverity explanation:
drivers/crypto/caam/sm_store.c:654: CID 17839 (#1 of 1):
Type: Logically dead code (DEADCODE)
Classification: Bug
Severity: Major
Action: Fix Required
Owner: nxa21133
Defect only exists locally.
drivers/crypto/caam/sm_store.c:625:
cond_null: Condition "keystore_data == NULL", taking true branch. Now
the value of "keystore_data" is "NULL".
drivers/crypto/caam/sm_store.c:653:
null: At condition "keystore_data != NULL", the value of "keystore_data"
must be "NULL".
drivers/crypto/caam/sm_store.c:653:
dead_error_condition: The condition "keystore_data != NULL" cannot be
true.
drivers/crypto/caam/sm_store.c:654:
dead_error_line: Execution cannot reach this statement:
"kfree(keystore_data);".
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Silvano di Ninno [Thu, 17 May 2018 16:44:03 +0000 (18:44 +0200)]
MLK-18345: drivers: caam: add support for i.mx8mm
Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Reviewed-by: Franck Lenormand <franck.lenormand@nxp.com>
Leonard Crestez [Mon, 15 Apr 2019 12:53:27 +0000 (15:53 +0300)]
MLK-21452 drivers/mxc/Kconfig: Only build imx8 vpu on arm64
There is no ARCH_MXC_ARM64 in 4.19 because upstream rejected it. We must
still check for ARM64 though because vpu compilation fails on 32-bit
platforms in multiple ways.
This fixes build for imx6/7
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Haibo Chen [Fri, 22 Jun 2018 07:50:28 +0000 (15:50 +0800)]
MLK-18662 iio: adc: imx8qxp_adc: add runtime suspend/resume support
Add runtime suspend/resume support for imx8QXP ADC
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit
85a5f4ad37d764ba6b17f5a49edfe469e2a80b34)
Haibo Chen [Thu, 14 Jun 2018 09:06:06 +0000 (17:06 +0800)]
MLK-18612-3 iio: adc: imx8qxp_adc: fix register setting
For the register CFG/TCTRLx/CMDLx/CMDHx, all the defined bits of
these register are setting, so no need to read the register
first, and use "|=", and will cause issue, the bit setting will be
impact by the last time setting. So write these register directlly.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit
7e5abc21dda7a82900b6337360361ae0226b1876)
Haibo Chen [Thu, 14 Jun 2018 08:08:40 +0000 (16:08 +0800)]
MLK-18612-1 iio: adc: imx8qxp_adc: add 4 more input channel
The ADC on imx8qxp/imx8qm totally has 8 differential external
analog inputs per instance.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit
483083f734fedd5156f9c53d56355c9ad0a2d2da)
Haibo Chen [Wed, 16 May 2018 08:36:17 +0000 (16:36 +0800)]
MLK-18323-4: ARM64: defconfig: enable imx8qxp adc
Enable imx8qxp adc in default
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit
73813a858c54a6f80c59cc095f5adb4b94c59e47)
Haibo Chen [Tue, 15 May 2018 07:27:05 +0000 (15:27 +0800)]
MLK-18323-1 iio: adc: Add imx8qxp adc driver support
i.MX8QXP B0 and i.MX8QM has the same ADC IP, so add the
adc driver to support it.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit
018a6f552e560eaf640c6d537d1962db6d2236fb)
Robert Chiras [Tue, 9 Apr 2019 10:19:15 +0000 (13:19 +0300)]
MLK-21312: drm/panel: rm67191: Add support for suspend/resume
The 'reset' pin used by this panel driver is shared with the touchscreen
driver, which is causing issues during suspend/resume process. In order
to better handle this gpio pin, release its resource during suspend and
acquire it again in resume.
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Robert Chiras [Thu, 11 Apr 2019 07:39:55 +0000 (10:39 +0300)]
MLK-21239: arm64: dts: fsl-imx8qxp: Fix DTS warning
This patch fixes a warning introduced in current version of dtc script:
graph endpont node name should be 'endpoint'
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Robert Chiras [Wed, 10 Apr 2019 08:12:00 +0000 (11:12 +0300)]
MLK-21388: imx: nwl_dsi-imx: Fix pm_runtime_enable
Apparently, the pm_runtime_enable call is made too early, causing the PM
API printing this warning: 'Unbalanced pm_runtime_enable!'.
So move the call to pm_runtime_enable into the bind stage, which is more
appropriate than probe, since the disable is also made in unbind.
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Zhou Peng [Mon, 15 Apr 2019 07:24:59 +0000 (15:24 +0800)]
MLK-21449-6: [VPU]: 4.19 integration on 8MM/8MD
Enable 8MD decoder in config and makefile
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Zhou Peng [Mon, 15 Apr 2019 07:22:15 +0000 (15:22 +0800)]
MLK-21449-5: [VPU]: 4.19 integration on 8MM/8MD
Add 8MD decoder driver: drivers/mxc/hantro
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Zhou Peng [Mon, 15 Apr 2019 07:16:45 +0000 (15:16 +0800)]
MLK-21449-4: [VPU]: 4.19 integration on 8MM/8MD
Enable 8MM encoder in config and makefile
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Zhou Peng [Mon, 15 Apr 2019 07:13:15 +0000 (15:13 +0800)]
MLK-21449-3: [VPU]: 4.19 integration on 8MM/8MD
Add 8MM encoder driver: drivers/mxc/hantro_845_h1
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Zhou Peng [Mon, 15 Apr 2019 07:10:49 +0000 (15:10 +0800)]
MLK-21449-2: [VPU]: 4.19 integration on 8MM/8MD
Enable 8MM decoder in config and makefile
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Zhou Peng [Mon, 15 Apr 2019 06:25:21 +0000 (14:25 +0800)]
MLK-21449-1: [VPU]: 4.19 integration on 8MM/8MD
Add 8MM decoder driver: drivers/mxc/hantro_845
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Shengjiu Wang [Mon, 15 Apr 2019 06:08:27 +0000 (14:08 +0800)]
MLK-21450: ASoC: fsl_rpmsg: fix timer issue for updating to 4.19
The timer_setup function's interface is changed in 4.19, the
struct timer_list pointer is used for callback function, and
from_timer is used to get its parent struct, so driver need to
be updated for this new change.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Shengjiu Wang [Sun, 14 Apr 2019 02:55:34 +0000 (10:55 +0800)]
MLK-21447: ASoC: fsl_rpmsg_i2s: underrun in m4 for msg delayed
With small buffer size, the resume will be triggered after suspend
immediately, if we reserve the period done message to be sent with
the next command, one period time later, it will cause underrun in
m4 side, for ALSA thought the appl_ptr is updated, but the command
won't be sent to M4 immediately, M4 don't have enough data to play.
In this patch, we check that if the left size in the buffer is less
that one period, the work queue will be triggered to send the period
done message immediately.
Fixes:
348d47695622 ("MLK-21307: ASoC: fsl_rpmsg_i2s: optimize
the message sent to m4")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
3dfecae40765329c0b7de1157f97ade24ecfce6d)
Shengjiu Wang [Mon, 1 Apr 2019 08:40:57 +0000 (16:40 +0800)]
MLK-21307: ASoC: fsl_rpmsg_i2s: optimize the message sent to m4
M4 complain that there are two much period done message sent to m4, that
M4 don't have enough time to handle these messages.
The solution for this issue is to reduce the number of period done message.
We allocate a specific memory for period done message, every time there is
period done coming, it will be writed to this memory, not write it directly
to the work queue, that queue will not be overflow, and the old period done
message will be overwrited.
In the rpmsg_i2s_work, we first check if there is period done message, then
send it first, after that, send the command in queue.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit
caabdfa176453cc7c8d6521f7865a670a7265a18)
Shengjiu Wang [Thu, 11 Apr 2019 11:43:19 +0000 (19:43 +0800)]
MLK-21440-4: ASoC: imx-cs42888: remove snd_soc_find_dai
Previously we add snd_soc_find_dai to check if the codec is probed or
not, but this bring kernel dump issue when CONFIG_LOCKDEP=y.
[ 2.823379] WARNING: CPU: 2 PID: 1 at sound/soc/soc-core.c:1016 snd_soc_find_dai+0x144/0x150
[ 2.831827] Modules linked in:
[ 2.834907] CPU: 2 PID: 1 Comm: swapper/0 Not tainted
4.14.78-00007-g524e1b1f0b3f #18
[ 2.842748] Hardware name: FSL i.MX8MM EVK board (DT)
[ 2.847811] task:
ffff8000624f0000 task.stack:
ffff000008078000
[ 2.853745] PC is at snd_soc_find_dai+0x144/0x150
[ 2.858462] LR is at snd_soc_find_dai+0x140/0x150
...
[ 3.469675] Call trace:
[ 3.472135] Exception stack(0xffff00000807ba40 to 0xffff00000807bb80)
[ 3.478590] ba40:
0000000000000000 00000000ffffffff 0000000000000000 0000000000000002
[ 3.
4864333.596564] [<
ffff00000883f2a8>] bus_add_driver+0x110/0x230
[ 3.602149] [<
ffff0000088412e8>] driver_register+0x68/0x100
[ 3.607735] [<
ffff0000088426dc>] __platform_driver_register+0x54/0x60
[ 3.614191] [<
ffff0000097e4cc8>] imx_rpmsg_driver_init+0x20/0x28
[ 3.620213] [<
ffff0000080844c4>] do_one_initcall+0x44/0x130
[ 3.625801] [<
ffff000009760ef8>] kernel_init_freeable+0x1e0/0x280
[ 3.631909] [<
ffff00000908c3f8>] kernel_init+0x18/0x110
[ 3.637148] [<
ffff000008085a4c>] ret_from_fork+0x10/0x1c
So we could't resolve the warning "snd_soc_register_card failed (-517)".
Fixes:
2bf5f9704785 ("MLK-19854-1: ASoC: imx-cs42888: fix error when m4
image is not loaded")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
58ffdf239288cfa6904640fc8432c182cf56589b)
(cherry picked from commit
d1222a0e5f93d2a5d3b3b69699f79f2c62ce1d7c)
Shengjiu Wang [Thu, 11 Apr 2019 11:43:07 +0000 (19:43 +0800)]
MLK-21440-3: ASoC: imx-wm8960: remove snd_soc_find_dai
Previously we add snd_soc_find_dai to check if the codec is probed or
not, but this bring kernel dump issue when CONFIG_LOCKDEP=y.
[ 2.823379] WARNING: CPU: 2 PID: 1 at sound/soc/soc-core.c:1016 snd_soc_find_dai+0x144/0x150
[ 2.831827] Modules linked in:
[ 2.834907] CPU: 2 PID: 1 Comm: swapper/0 Not tainted
4.14.78-00007-g524e1b1f0b3f #18
[ 2.842748] Hardware name: FSL i.MX8MM EVK board (DT)
[ 2.847811] task:
ffff8000624f0000 task.stack:
ffff000008078000
[ 2.853745] PC is at snd_soc_find_dai+0x144/0x150
[ 2.858462] LR is at snd_soc_find_dai+0x140/0x150
...
[ 3.469675] Call trace:
[ 3.472135] Exception stack(0xffff00000807ba40 to 0xffff00000807bb80)
[ 3.478590] ba40:
0000000000000000 00000000ffffffff 0000000000000000 0000000000000002
[ 3.
4864333.596564] [<
ffff00000883f2a8>] bus_add_driver+0x110/0x230
[ 3.602149] [<
ffff0000088412e8>] driver_register+0x68/0x100
[ 3.607735] [<
ffff0000088426dc>] __platform_driver_register+0x54/0x60
[ 3.614191] [<
ffff0000097e4cc8>] imx_rpmsg_driver_init+0x20/0x28
[ 3.620213] [<
ffff0000080844c4>] do_one_initcall+0x44/0x130
[ 3.625801] [<
ffff000009760ef8>] kernel_init_freeable+0x1e0/0x280
[ 3.631909] [<
ffff00000908c3f8>] kernel_init+0x18/0x110
[ 3.637148] [<
ffff000008085a4c>] ret_from_fork+0x10/0x1c
So we could't resolve the warning "snd_soc_register_card failed (-517)".
Fixes:
a52c88bc3932 ("MLK-19854-1: ASoC: imx-wm8960: fix error when m4
image is not loaded")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
f5d9013702e172a243da74a42941a62283bbe4a8)
(cherry picked from commit
c54e5cd3817fde4133c8c994ff7bec59075fc5ec)
Shengjiu Wang [Thu, 11 Apr 2019 11:42:50 +0000 (19:42 +0800)]
MLK-21440-2: ASoC: imx-rpmsg: Remove snd_soc_find_dai
Previously we add snd_soc_find_dai to check if the codec is probed or
not, but this bring kernel dump issue when CONFIG_LOCKDEP=y.
[ 2.823379] WARNING: CPU: 2 PID: 1 at sound/soc/soc-core.c:1016 snd_soc_find_dai+0x144/0x150
[ 2.831827] Modules linked in:
[ 2.834907] CPU: 2 PID: 1 Comm: swapper/0 Not tainted
4.14.78-00007-g524e1b1f0b3f #18
[ 2.842748] Hardware name: FSL i.MX8MM EVK board (DT)
[ 2.847811] task:
ffff8000624f0000 task.stack:
ffff000008078000
[ 2.853745] PC is at snd_soc_find_dai+0x144/0x150
[ 2.858462] LR is at snd_soc_find_dai+0x140/0x150
...
[ 3.469675] Call trace:
[ 3.472135] Exception stack(0xffff00000807ba40 to 0xffff00000807bb80)
[ 3.478590] ba40:
0000000000000000 00000000ffffffff 0000000000000000 0000000000000002
[ 3.
4864333.596564] [<
ffff00000883f2a8>] bus_add_driver+0x110/0x230
[ 3.602149] [<
ffff0000088412e8>] driver_register+0x68/0x100
[ 3.607735] [<
ffff0000088426dc>] __platform_driver_register+0x54/0x60
[ 3.614191] [<
ffff0000097e4cc8>] imx_rpmsg_driver_init+0x20/0x28
[ 3.620213] [<
ffff0000080844c4>] do_one_initcall+0x44/0x130
[ 3.625801] [<
ffff000009760ef8>] kernel_init_freeable+0x1e0/0x280
[ 3.631909] [<
ffff00000908c3f8>] kernel_init+0x18/0x110
[ 3.637148] [<
ffff000008085a4c>] ret_from_fork+0x10/0x1c
So we could't resolve the warning "snd_soc_register_card failed (-517)".
Fixes:
75632b22a332 ("MLK-20247: ASoC: imx-rpmsg: fix error when
m4 image is not loaded")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
bbc1868d1c3ec448301d76606e7199f74aa35581)
(cherry picked from commit
ebf3fc59b84503a8da40a8e54a92e6de60e01dce)
Shengjiu Wang [Thu, 11 Apr 2019 11:39:47 +0000 (19:39 +0800)]
MLK-21440-1: ASoC: fsl_rpmsg_i2s: init spin lock
With CONFIG_LOCKDEP=y, there will kernel dump
[ 55.305563] INFO: trying to register non-static key.
[ 55.310540] the code is fine but needs lockdep annotation.
[ 55.316027] turning off the locking correctness validator.
[ 55.321520] CPU: 0 PID: 32 Comm: kworker/0:1 Tainted: G W
4.14.78-00007-g524e1b1f0b3f #18
[ 55.330827] Hardware name: FSL i.MX8MM EVK board (DT)
[ 55.335892] Workqueue: events rpmsg_work_handler
[ 55.340515] Call trace:
[ 55.342971] [<
ffff00000808c438>] dump_backtrace+0x0/0x270
[ 55.348375] [<
ffff00000808c6cc>] show_stack+0x24/0x30
[ 55.353433] [<
ffff000009078f38>] dump_stack+0xb8/0xf0
[ 55.358490] [<
ffff000008150404>] register_lock_class+0x364/0x548
[ 55.364501] [<
ffff000008153544>] __lock_acquire+0x7c/0x18a8
[ 55.370077] [<
ffff0000081555e8>] lock_acquire+0xc8/0x290
[ 55.375394] [<
ffff00000909422c>] _raw_spin_lock_irqsave+0x54/0x70
[ 55.381493] [<
ffff000008d80888>] i2s_rpmsg_cb+0xe8/0x1b0
[ 55.386810] [<
ffff000008d01dc4>] rpmsg_recv_done+0x144/0x210
[ 55.392476] [<
ffff000008713f44>] vring_interrupt+0x44/0x78
[ 55.397966] [<
ffff000008d025d4>] imx_mu_rpmsg_callback+0x6c/0x80
[ 55.403977] [<
ffff000008111f44>] notifier_call_chain+0x5c/0x98
[ 55.409813] [<
ffff0000081124f8>] __blocking_notifier_call_chain+0x58/0xa0
[ 55.416605] [<
ffff00000811257c>] blocking_notifier_call_chain+0x3c/0x50
[ 55.423223] [<
ffff000008d029a0>] rpmsg_work_handler+0x88/0xe8
[ 55.428974] [<
ffff000008108380>] process_one_work+0x290/0x738
[ 55.434723] [<
ffff000008108880>] worker_thread+0x58/0x460
[ 55.440127] [<
ffff000008110084>] kthread+0x104/0x130
[ 55.445096] [<
ffff000008085a4c>] ret_from_fork+0x10/0x1c
The reason is that the spin lock is not initilized.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
0e98ac55f17f6505f92c515c3c04581039e21865)
(cherry picked from commit
314ef30b1bc75971c3e59f5ab9919586495ca556)
Zhou Peng [Mon, 15 Apr 2019 04:33:30 +0000 (12:33 +0800)]
MLK-21448-4: [VPU]: 4.19 integration on 8QXP/QM
Enable windsor encoder in config and makefile
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Zhou Peng [Mon, 15 Apr 2019 04:12:35 +0000 (12:12 +0800)]
MLK-21448-3: [VPU]: 4.19 integration on 8QXP/QM
Add encoder driver: drivers/mxc/vpu_windsor
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Zhou Peng [Mon, 15 Apr 2019 04:07:58 +0000 (12:07 +0800)]
MLK-21448-2: [VPU]: 4.19 integration on 8QXP/QM
Enable malone decoder in config and makefile
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Zhou Peng [Mon, 15 Apr 2019 03:38:20 +0000 (11:38 +0800)]
MLK-21448-1: [VPU]: 4.19 integration on 8QXP/QM
Add decoder driver: drivers/mxc/vpu_malone
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Haibo Chen [Fri, 12 Apr 2019 09:21:21 +0000 (17:21 +0800)]
MLK-21444-3 input: touch: focaltech: remove the redundancy file
All the file in the directory drivers/input/touchscreen/focaltech_touch/include/
are useless, so remove them.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Haibo Chen [Fri, 12 Apr 2019 08:55:29 +0000 (16:55 +0800)]
MLK-21444-2 ARM: dts: imx_v7_defconfig: default build in GOODIX touch driver
use the following command to replace the imx_v7_defconfig
make savedefconfig
cp defconfig /arch/arm/configs/imx_v7_defconfig
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Haibo Chen [Fri, 12 Apr 2019 08:42:49 +0000 (16:42 +0800)]
MLK-21444-1 ARM: dts: imx7ulp-evkb-mipi: change to use GOODIX touch
The new MIPI panel used for 7ulp evkb board change to use the new
GOODIX touch chip rather than the FOCALTECH touch chip.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Clark Wang [Fri, 12 Apr 2019 12:26:31 +0000 (20:26 +0800)]
MLK-21446 arm64: defconfig: remove duplicate config setting
Because CONFIG_I2C_RPBUS has been add by (
f70afa74e62d MLK-21381
arm64: defconfig: Build in drivers to support i.MX8qm/qxp DPU KMS
via IT6263), remove the duplicate one from commit (
ad284b230391
MLK-20940-4 ARM64: defconfig: Add RPBUS and RPMSG config) to avoid build
warning.
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Xianzhong [Wed, 19 Sep 2018 18:47:16 +0000 (02:47 +0800)]
MGS-4265 gpu: imx: dpu-blit: fix video hang with g2d compositor
video playback cause system hang with Wayland g2d compositor,
this also can be reproduced with Android G2D HWComposer.
the problem is second prg not handled between GPU and video.
need re-enable dprc & prg pipes when modifier changed.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
8ca7df522719ac94d126d34618cc9d25a2798660)
Xianzhong [Fri, 6 Jul 2018 12:04:00 +0000 (20:04 +0800)]
MGS-3940 gpu: imx: dpu-blit: fix dpr hang for smaller size
auto-trigger cause dpr hang in inital blitter implementation,
the problem is dpr repeat mode has conflict with command sequencer.
as proposed by design, blitter need do manual trigger for each process:
dpr register -> dpr run -> seeris register -> seeris trigger -> sync
frstly this patch removed dprc first frame handler from dpu blitter,
then removed dpr repeat, and enable dpr run for each blit processing.
also add sync flag to avoid the duplicated calling to dpu_be_wait.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
04eb0533d5008ab20aae1e0acb9e4d8b910d82e5)
Xianzhong [Thu, 5 Jul 2018 19:35:07 +0000 (03:35 +0800)]
MGS-4051 gpu: imx: dpu-blit: fix suspend resume issue
suspend & resume will destory and recreate blitter,
reset dprc start flags in blitter initialization.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
01514db13899b1d7639190c17ec0a5e423292829)
Xianzhong [Fri, 12 Apr 2019 15:41:29 +0000 (23:41 +0800)]
MGS-3940 gpu: imx: dpu-blit: fix first frame handler
chrome browser hang is reproduced with mouse connected,
the first frame handler trigger the problem in below scenario:
tile (dprc-enable) --> linear (dprc->disable) --> tile (handle first frame wrongly).
need_handle_start is set following dprc_enable, need reset it with dprc_disable.
fix event trigger as previous implementation does not flush command sequence,
that will cause the obvious flicker when run glmark2 in full-screen.
also reduce bitter delay to 30us to improve blitter performance.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Xianzhong [Tue, 10 Jul 2018 13:44:44 +0000 (21:44 +0800)]
MGS-4061 gpu: imx: dpu-blit: fix kernel panic in pm test
resume will increase unlock counter, max allowed value is 15.
suspend need decrease unlock counter to avoid overflow panic.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
0582cd50ed70f932158fe20d6caf2f4ad68eabf0)
Meng Mingming [Wed, 27 Dec 2017 02:17:52 +0000 (10:17 +0800)]
MLK-17311 gpu: imx: dpu-blit: enable prefetch feature
Add struct drm_imx_dpu_frame_info.
Configure dprc to enable prefetch for dpu blit.
Configure prefetch with source frame info for dpu blit.
Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
Meng Mingming [Thu, 31 Aug 2017 09:17:41 +0000 (17:17 +0800)]
MLK-15321-4 drm/imx: core: Add bliteng as component of imx-drm
Implement Blt engine as DRM renderer.
Add dpu bliteng as component of imx-drm.
Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
Meng Mingming [Thu, 31 Aug 2017 09:14:06 +0000 (17:14 +0800)]
MLK-15321-3 drm/imx: dpu: Add render feature support
Implement Blt engine as DRM renderer.
Add dpu ioctl to support imx-drm render feature.
Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
Meng Mingming [Wed, 30 Aug 2017 06:46:55 +0000 (14:46 +0800)]
MLK-15321-2 gpu: imx: dpu: Add dpu blit engine driver
Implement Blt engine as DRM renderer.
Add dpu blit engine driver.
Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
Liu Ying [Tue, 29 Aug 2017 08:58:58 +0000 (16:58 +0800)]
MLK-16290 drm: Add drm_of_component_probe_with_match() helper
A component master may have both OF based and non-OF based components to be
bound with. This patch adds a helper drm_of_component_probe_with_match()
similar to drm_of_component_probe() so that the new helper may get an
additional provided match pointer(contains match entries for non-OF based
components) to support this case.
Tested-by: Meng Mingming <mingming.meng@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit
c3cad7223488638ab56c20b2c29345487857bc5f)
Leonard Crestez [Tue, 26 Mar 2019 22:41:36 +0000 (00:41 +0200)]
MLK-21117-2 arm64: dts: imx8mm: Use upstream bd718x7 pmic driver
The upstream bd718x7 is usable but has slightly different DT bindings:
- Update compatible to
bd71847 (chip found on newer boards)
- Use standard interrupt bindings instead of gpio_into
- Use uppercase names for regulator-compatible
- Use rohm,reset-snvs-powered and rohm,dvs-*
- Rename BUCK5/6/7/8 relative to datasheet just like upstream driver
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Robin Gong <yibin.gong@nxp.com>
Leonard Crestez [Thu, 28 Mar 2019 22:18:58 +0000 (00:18 +0200)]
MLK-21117-1 arm64: defconfig: Enable ROHM_BD718XX
Enable mfd and regulator for PMIC found on imx8mm boards
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Robin Gong <yibin.gong@nxp.com>
Matti Vaittinen [Thu, 14 Feb 2019 09:39:36 +0000 (11:39 +0200)]
regulator: bd718x7: Support SNVS low power state
read ROHM
BD71837 /
BD71847 specific device tree bindings for
controlling the PMIC shutdown/reset states and voltages for
different HW states. The PMIC was designed to be used with NXP
i.MX8 SoC and it supports SNVS low power state which seems to
be typical for NXP i.MX SoCs. However, when SNVS is used we must
not allow SW to control enabling/disabling those regulators which
are crucial for system to boot as there is a HW limitation which
causes SW controlled regulators to be kept shut down after SNVS
reset.
Allow setting the SNVS to be used as reset target state and allow
marking those regulators which are critical for boot.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Tested-by: Angus Ainslie <angus@akkea.ca>
Reviewed-by: Angus Ainslie <angus@akkea.ca>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
049369d464289bb57bcfb6faa20990a06fe1e7ae)
Matti Vaittinen [Thu, 14 Feb 2019 09:38:05 +0000 (11:38 +0200)]
regulator: add regulator_desc_list_voltage_linear_range
Add regulator_desc_list_voltage_linear_range which can be used
by drivers for getting the voltages before regulator is registered.
This may be useful for drivers which need to fetch the voltage
selectors at device-tree parsing callback.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Mark Brown <broonie@kernel.org>
Tested-by: Angus Ainslie <angus@akkea.ca>
Reviewed-by: Angus Ainslie <angus@akkea.ca>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
6a47b4da551a762217215aeeda22e46469c5868a)
Matti Vaittinen [Thu, 14 Feb 2019 09:34:50 +0000 (11:34 +0200)]
devicetree: bindings: bd718x7: document HW state related ROHM specific properties
Add ROHM
BD71837 /
BD71847 specific device tree bindings for
controlling the PMIC shutdown/reset states and voltages for
different HW states. The PMIC was designed to be used with NXP
i.MX8 SoC and it supports SNVS low power state which seems to
be typical for NXP i.MX SoCs. However, when SNVS is used we must
not allow SW to control enabling/disabling those regulators which
are crucial for system to boot as there is a HW limitation which
causes SW controlled regulators to be kept shut down after SNVS
reset.
Allow setting the SNVS to be used as reset target state and allow
marking those regulators which are critical for boot.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Tested-by: Angus Ainslie <angus@akkea.ca>
Reviewed-by: Angus Ainslie <angus@akkea.ca>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
f43d1b388f9be4aa47ed42c33659243a675c5c76)
Axel Lin [Thu, 24 Jan 2019 10:02:08 +0000 (18:02 +0800)]
regulator: bd718x7: Constify regulator_ops
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
704c5c01ce6e0d322e2c9555490b39c41e729383)
Matti Vaittinen [Wed, 7 Nov 2018 13:41:26 +0000 (15:41 +0200)]
regulator: bd718x7: Change next state after poweroff to ready
BD71837 and
BD71847 have a HW functionality which leave power
rails OFF after powerof state:
- if they have been controlled by SW.
- if state transition from poweroff is done to SNVS
BD71837 can after reset transition from power-off to SNVS or
READY state depending on reset reason. By default only wathcdog
reset changes state from poweroff to ready. Change PMIC
configuration to always transition to READY in order to avoid
crucial power rails being OFF after reset.
If SNVS is required the crucial power rails should not be
controlled by SW - eg corresponding regulator control register
should have SEL bit kept zero. Currently the driver assumes all
regulators to be controlled by SW so it sets all SEL bits to 1.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
e770b18bbbaecebfb37389b45bf82974a17488d7)
Axel Lin [Sat, 10 Nov 2018 03:50:03 +0000 (11:50 +0800)]
regulator: bd718x7: Use regulator_map_voltage_ascend for buck5 and buck7
The voltages in bd718xx_3rd_nodvs_buck_volts are in ascendant order, so use
regulator_map_voltage_ascend.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
2e61286dc6ce10ebce17825cd61031c5fd0289db)
Matti Vaittinen [Mon, 29 Oct 2018 12:16:30 +0000 (14:16 +0200)]
regulator: bd718x7: add missing linux/of.h inclusion (deja-vu)
0-Day tests found compilation error on x86.
Driver won't compile on x86_64 as "of_match_ptr" is
not found. Add missing include <linux/of.h>
At some point this fix was lost. So re-apply it.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
9cce72448364675ed5d4c793cf546023c003fdd6)
Geert Uytterhoeven [Sun, 28 Oct 2018 16:09:22 +0000 (17:09 +0100)]
regulator: bd718x7: Remove double indirection for bd718xx_pmic_inits.rdatas
With gcc 4.1:
drivers/regulator/bd718x7-regulator.c: In function ‘bd718xx_probe’:
drivers/regulator/bd718x7-regulator.c:1020: warning: initialization from incompatible pointer type
drivers/regulator/bd718x7-regulator.c:1024: warning: initialization from incompatible pointer type
Apparently this old compiler can't handle the obscure double
indirection.
However, there is no need for a double indirection. Just store a
pointer to the array instead, like other drivers tend to do.
Fixes:
494edd266b945f36 ("regulator/mfd: Support ROHM
BD71847 power management IC")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
de226ebda96cafa981b9c0fef56888931668b671)
Axel Lin [Thu, 4 Oct 2018 07:25:58 +0000 (15:25 +0800)]
regulator: bd718x7: Remove struct bd718xx_pmic
All the fields in struct bd718xx_pmic are not really necessary.
Remove struct bd718xx_pmic to simplify the code.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
bcb047ebf28453da56f0265aeeb9edc52b797ea7)
Matti Vaittinen [Tue, 2 Oct 2018 07:16:50 +0000 (10:16 +0300)]
regulator: bd718xx: fix build warning on x86_64
Casting address to unsigned int causes a warning on some 64 bit
architectures. Fix the cast.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
eb108c3611dd21d5d058cee25fec1c29baf5b0c9)
Matti Vaittinen [Fri, 14 Sep 2018 08:34:02 +0000 (11:34 +0300)]
regulator: bd718xx: rename
bd71837 to 718xx
rename
bd71837-regulator.c to bd718x7-regulator.c to reflect the
fact that also
BD71847 is now supported by the driver.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
2ece646c90c5b45dd76c76ea207a3f3459f2c472)
Matti Vaittinen [Fri, 14 Sep 2018 08:33:11 +0000 (11:33 +0300)]
regulator: bd718XX use pickable ranges
Few regulators in
BD71837 and
BD71847 can output voltages from
different voltage ranges. Register interface is arranged so that
used range is selected by toggling bits which are not next to actual
voltage selection bits. Then the voltage inside selected range is
determined by voltage selection bits (as usual). Support
BD71837
and
BD71847 selectible range voltages using new pickable ranges
helpers.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
a4bfc2c28a21f4d5274d813b20fd015a9dc9bcfa)
Matti Vaittinen [Fri, 14 Sep 2018 08:32:26 +0000 (11:32 +0300)]
regulator/mfd: bd718xx: rename
bd71837/
bd71847 common instances
Rename parts of code that support both
BD71837 and
BD71847 to BD718XX.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
dd2be639f4a918b335818bf22a937956e552b957)
Matti Vaittinen [Fri, 14 Sep 2018 08:30:58 +0000 (11:30 +0300)]
mfd: dt bindings: add
BD71847 device-tree binding documentation
Add ROHM
BD71847 Power Management IC MFD binding information to
device-tree binding documents.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
01e17e5d8004f53044c6c9062e04ca118c420512)
Matti Vaittinen [Fri, 14 Sep 2018 08:31:36 +0000 (11:31 +0300)]
regulator: Support regulators where voltage ranges are selectable
For example ROHM
BD71837 and ROHM
BD71847 Power management ICs have
regulators which provide multiple linear ranges. Ranges can be
selected by individual non contagious bit in vsel register. Add
regmap helper functions for selecting ranges.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
18e4b55fbd2069cee51ef9660b35c65ec13bee6d)
Matti Vaittinen [Fri, 14 Sep 2018 08:30:06 +0000 (11:30 +0300)]
regulator: dt bindings: add
BD71847 device-tree binding documentation
Add ROHM
BD71847 Power Management IC regulator binding information to
device-tree binding documents.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
12fc309a956b82e75db2a19fd36074266bff9413)
Matti Vaittinen [Fri, 14 Sep 2018 08:27:46 +0000 (11:27 +0300)]
regulator/mfd: Support ROHM
BD71847 power management IC
BD71847 is reduced version of
BD71837. DVS bucks 3 and 4 are
removed as is LDO7. Voltage ranges of some regulators are
expanded.
Add initial support for
BD71847 with
BD71837 driver.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
494edd266b945f36908184433dd36eda1719cdb0)
Matti Vaittinen [Wed, 22 Aug 2018 09:53:27 +0000 (12:53 +0300)]
regulator: regmap helpers - support overlapping linear ranges
Don't give up voltage mapping if first range with suitable min/max uV
does not provide the wanted voltage.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
e7d80b6b848b4b5f83d3fbee9fd042d036ede9c6)
Axel Lin [Fri, 24 Aug 2018 11:16:12 +0000 (19:16 +0800)]
regulator:
bd71837: Remove duplicate assignment for n_voltages of LDO2
Set it once is enough.
Also move n_voltages close to volt_table for better readability.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit
61b2e6741e81226c29a5ed92fd886f11efb78e98)
Leonard Crestez [Thu, 11 Apr 2019 09:09:34 +0000 (12:09 +0300)]
MLK-21388-1 arm64: dts: imx8qxp-mek: Mark pca9646 compatible with nxp,pca9546
Looking at the datasheet for both parts no special handling is required
in software so upstream support for nxp,pca9546 is acceptable.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Fugang Duan [Wed, 10 Apr 2019 10:05:48 +0000 (18:05 +0800)]
MLK-21432 clk: imx: only enable clocks for earlycon/earlyprintk port
Only enable clocks for earlycon or earlyprintk uart port.
For communication uart port, clock enable will break clock
paraent and rate switch by commit
9461f7b33d11 (clk: fix
CLK_SET_RATE_GATE with clock rate protection)
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Fugang Duan [Wed, 10 Apr 2019 10:14:47 +0000 (18:14 +0800)]
MLK-21431 arm: dts: imx6sx: remove the dumplicated ocram_s node
Remove the dumplicated ocram_s node.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Fugang Duan [Wed, 10 Apr 2019 10:11:15 +0000 (18:11 +0800)]
MLK-21430 ARM: clk: imx6sx: remove the duplicated code to set uart clock source
Remove the duplicated code to set UART clock source that is
introduced by commit
4880bfc5fded (MLK-11414-1 ARM: imx: add
clk return check for imx6sx).
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Haibo Chen [Wed, 10 Apr 2019 08:53:58 +0000 (16:53 +0800)]
MLK-21434 ARM64: dts: change the imx8 usdhc compatible properity
Change all the iMX8MM/iMX8QXP/iMX8QM usdhc compatible properity
to "fsl,imx8qxp-usdhc", so that it can support eMMC V5.1
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
BOUGH CHEN [Mon, 7 Jan 2019 10:11:32 +0000 (10:11 +0000)]
mmc: sdhci-esdhc-imx: add HS400_ES support for i.MX8QXP
Add an new esdhc_soc_data for i.MX8QXP, and add HS400_ES mode
support.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
[Ulf: Rebased on top of latest changes]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit
029e2476f9e6755ca6cc91922d1d75e856c0820a)
Haibo Chen [Wed, 10 Apr 2019 08:05:09 +0000 (16:05 +0800)]
MLK-21435 mmc: sdhci: fix the cherry-pick conflicts issue.
commit
4a26e955522a ("MLK-14539 mmc: sdhci: make no-1-8-v also work
for DDR52 mode") cherry picked by mentor has some conflicts, and they
wrongly handle the conflicts, this patch fix it.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
BOUGH CHEN [Wed, 27 Feb 2019 08:24:48 +0000 (08:24 +0000)]
mmc: sdhci-esdhc-imx: clear the HALT bit when enable CQE
After system suspend, CQE is in cqhci_off state, which set the HALT bit, make
CQE in HALT state. If the SoC do not power down the USDHC module, then when
system resume back, this bit keep the same, still set. Though there is a
sdhci reset during sdhci_resume_host(), but this reset do not impact the
CQE part, so need to clear this bit when enable CQE, otherwise CQE will
stuck in the first CMDQ request after system resume back.
Find this issue on NXP i.MX845s-mek board
[ 105.919862] mmc2: cqhci: timeout for tag 6
[ 105.923965] mmc2: cqhci: ============ CQHCI REGISTER DUMP ===========
[ 105.930407] mmc2: cqhci: Caps: 0x0000310a | Version: 0x00000510
[ 105.936847] mmc2: cqhci: Config: 0x00001001 | Control: 0x00000001
[ 105.943286] mmc2: cqhci: Int stat: 0x00000000 | Int enab: 0x00000006
[ 105.949725] mmc2: cqhci: Int sig: 0x00000006 | Int Coal: 0x00000000
[ 105.956164] mmc2: cqhci: TDL base: 0x7809b000 | TDL up32: 0x00000000
[ 105.962604] mmc2: cqhci: Doorbell: 0x00000040 | TCN: 0x00000000
[ 105.969043] mmc2: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x00000000
[ 105.975483] mmc2: cqhci: Task clr: 0x00000000 | SSC1: 0x00011000
[ 105.981922] mmc2: cqhci: SSC2: 0x00000001 | DCMD rsp: 0x00000000
[ 105.988362] mmc2: cqhci: RED mask: 0xfdf9a080 | TERRI: 0x00000000
[ 105.994801] mmc2: cqhci: Resp idx: 0x00000000 | Resp arg: 0x00000000
[ 106.001240] mmc2: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 106.007680] mmc2: sdhci: Sys addr: 0xb2b37800 | Version: 0x00000002
[ 106.014120] mmc2: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000001
[ 106.020560] mmc2: sdhci: Argument: 0x00010000 | Trn mode: 0x00000013
[ 106.026999] mmc2: sdhci: Present: 0x01f88008 | Host ctl: 0x00000030
[ 106.033439] mmc2: sdhci: Power: 0x00000002 | Blk gap: 0x00000080
[ 106.039878] mmc2: sdhci: Wake-up: 0x00000008 | Clock: 0x0000000f
[ 106.046318] mmc2: sdhci: Timeout: 0x0000008f | Int stat: 0x00000000
[ 106.052757] mmc2: sdhci: Int enab: 0x107f4000 | Sig enab: 0x107f4000
[ 106.059196] mmc2: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000502
[ 106.065635] mmc2: sdhci: Caps: 0x07eb0000 | Caps_1: 0x8000b407
[ 106.072075] mmc2: sdhci: Cmd: 0x00000d1a | Max curr: 0x00ffffff
[ 106.078514] mmc2: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x31360181
[ 106.084954] mmc2: sdhci: Resp[2]: 0x44473430 | Resp[3]: 0x00450100
[ 106.091392] mmc2: sdhci: Host ctl2: 0x00000008
[ 106.095836] mmc2: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x7804b208
[ 106.102274] mmc2: sdhci: ============================================
[ 106.108785] mmc2: running CQE recovery
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit
85236d2be844ade0bd8b34e3626fc3e36498cd85)
BOUGH CHEN [Thu, 20 Dec 2018 11:57:41 +0000 (11:57 +0000)]
mmc: sdhci-esdhc-imx: clear ESDHC_STD_TUNING_EN for manual tuning method
The bit ESDHC_STD_TUNING_EN may be configed by bootloader code if it
choose to use standard tuning method. So on linux side, if choose to
use manual tuning method, need to clear the bit ESDHC_STD_TUNING_EN,
remove the impact of bootloader code.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit
a98c557e2af3e12e38dee6019a5cf210156d629e)
Fabio Estevam [Thu, 18 Jul 2013 18:07:48 +0000 (15:07 -0300)]
ASoC: fsl: imx-wm8962: Fix error path
If the 'failed to find codec platform device' error path is executed, it should
jump to 'fail' label instead of returning an error immediately.
'fail' label will then free the ssi_np and codec_np previously acquired nodes.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit
d8a14e302ffeecc312186b8b9b0efc8963cec83b)
Shengjiu Wang [Thu, 7 Mar 2019 03:09:17 +0000 (11:09 +0800)]
MLK-21107-1: ASoC: Fix timer wake up system after suspend
Fixes commit
4028bd0f76fd ("MLK-21002-2: ASoC: imx-pcm-rpmsg: don't
remove timer at suspend")
if the timer isn't removed at suspend, there will be interrupt
from M4 side when the period size is small to wake up system quickly
So we need to revert the previous fix and add timer in resume state
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
a23d1df081f1ed33bc8dc7fffc42d1dfa3db2366)
Shengjiu Wang [Thu, 27 Dec 2018 06:48:06 +0000 (14:48 +0800)]
MLK-20661: ASoC: imx-pcm-rpmsg: remove the nonblock constraint
we can call the snd_pcm_period_elapsed in timer's callback
to achieve pseudo period wake up, so the nonblock constraint
can be removed
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
545031216a5a7b91f1a50e2f8e39f9672e76c8f8)
Shengjiu Wang [Wed, 27 Feb 2019 05:58:26 +0000 (13:58 +0800)]
MLK-21002-1: ASoC: imx-pcm-rpmsg: fix data consumed faster with pause
In LPA, we use the timer to simulate the interrupt, if the period time
is 1s, the timer is 500ms, which means the interrupt is more frequent
than actual.
With pause ALSA will update the hw_ptr_jiffies, because the interrupt
is more frequent, so sometimes in snd_pcm_update_hw_ptr0, the condition
delta > new_hw_ptr will be true, then the new_hw_ptr will be added whole
buffer_size, which cause the whole buffer be flushed.
if (in_interrupt) {
/* we know that one period was processed */
/* delta = "expected next hw_ptr" for in_interrupt != 0 */
delta = runtime->hw_ptr_interrupt + runtime->period_size;
if (delta > new_hw_ptr) {
/* check for double acknowledged interrupts */
hdelta = curr_jiffies - runtime->hw_ptr_jiffies;
if (hdelta > runtime->hw_ptr_buffer_jiffies/2 + 1) {
hw_base += runtime->buffer_size;
if (hw_base >= runtime->boundary) {
hw_base = 0;
crossed_boundary++;
}
new_hw_ptr = hw_base + pos;
goto __delta;
}
}
}
So even we use the timer to simulate the interrupt, the timer should
be same as the period time, otherwise will cause issue.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
9a9af932118774083119dba72c5c6133852ba926)
Shengjiu Wang [Fri, 2 Nov 2018 09:47:51 +0000 (17:47 +0800)]
MLK-20183-2: ASoC: imx-cdnhdmi: reconfigure the mclk for HDMI on imx8mq
In order to support 44kHz and 48kHz sample rate together, we need to
reconfigure the parent clock of mclk.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
3bc7e6bcca6613e43b7dab98b5a16d2c8097d29e)
Shengjiu Wang [Thu, 13 Sep 2018 05:07:47 +0000 (13:07 +0800)]
MLK-19565-1: ASoC: fsl_rpmsg_i2s: support rpmsg on imx8qm
On imx8qm mek, the cs42888 is connected with i2c in cm41 domain,
but wm8960 is connected with i2c1, which is not in m4 domain.
So we only need to eable rpmsg for cs42888.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
9d2368aef40e4d107e4deee1a2c7e191c1afe644)
(cherry picked from commit
dd108f1dd88feb55cd9a31f135ae6481b8e6774b)
Shengjiu Wang [Thu, 7 Mar 2019 03:01:06 +0000 (11:01 +0800)]
MLK-21107-2: ASoC: Drop msg if msg queue is full
We designed length of msg queue to be 0x18, which is too
small if the period size = 512bytes, sometimes the queue
will be full, which cause the msg is replaced by new one.
which is not acceptable.
So we need to enlarge the length of msg queue and add
protection when msg queue is full, if the msg queue is full
with the cmd (START, STOP, PAUSE...), driver will return
error, with the cmd (I2S_TX_POINTER, I2S_TX_PERIOD_DONE)
driver will drop the cmd.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
31def064871336af7780d01a6ed8c5ed075b7e48)
Shengjiu Wang [Mon, 17 Dec 2018 08:19:32 +0000 (16:19 +0800)]
MLK-18182: ASoC: fsl_asrc: increase the retry times
When 3 asrc pair are working in parallel, there will be
error log randomly
output DMA task timeout
fsl-asrc
2034000.asrc: Pair B: failed to process buffer: -62
The reason is that the initialization is not finished for
some pair, the prefill data is failed to be input in FIFO.
The patch is to increase the retry times to make sure that
initialization is success.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
85e0a5be4c11c9efeccc893e4c0e1f6b4e90fa01)
Shengjiu Wang [Mon, 12 Jun 2017 07:19:42 +0000 (15:19 +0800)]
MLK-15061-2: ASoC: fsl_asrc_m2m: fix asrc m2m can't work in imx8
Power domain need to be enabled when asrc m2m start to work, and
disabled when it stop.
Switch back to use the pm_runtime_get_sync and pm_runtime_put_sync
for which is removed in commit
1a3d82e08fa2 ("ASoC: fsl: refine
the asrc driver for imx8qm").
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit
602f4f47e454e371f80f55e4e79a3bdfd09ce7d5)
Shengjiu Wang [Wed, 12 Dec 2018 11:14:21 +0000 (19:14 +0800)]
MLK-20096: ASoC: fsl_asrc_m2m: fix noise issue for 8k5c to 176k5c conversion
Compare with imx6, the conversion of 8kHz 5channel to 176kHz is ok.
And compare the output we found that about every 48K bytes, there will be
additional data be added, which cause noise.
In this case, there will be two sg_nodes, for the maxmum output size exceed
the ASRC_MAX_BUFFER_SIZE, each size is ASRC_MAX_BUFFER_SIZE, it is 49152.
the value can't be exact divided by channel * word_with * watermark = 40.
So the EDMA can't finish the copy with correct size.
There is limitation of EMDA described in commit
3519b67ac01c
("MLK-19151: ASoC: fsl_asrc: fix dma timeout issue for imx8qxp")
EDMA just copy 49120 bytes, there will 32 bytes wrong data.
According to this limitation, this commit is to change the maxburst to 1
for EDMA case, then EDMA can do what we expect correctly.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
3ed46932710cd8c15d7fa79555935be04d768e40)
Shengjiu Wang [Tue, 7 Aug 2018 07:02:34 +0000 (15:02 +0800)]
MLK-19151: ASoC: fsl_asrc: fix dma timeout issue for imx8qxp
In the imx8qxp, the DMA is EDMA, which require the buffer size
should be divided by burst size with no remainder, otherwise
the remainder is not transferred by EDMA, so the input buffer
is not consumed by ASRC, then there will be dma output timeout
issue. This behavior is different with SDMA.
This patch is to change the input burst size to be 1 to avoid
the issue, and refine the last_period_size for output buffer.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
46008056908bc2f7f9305381112f058d1ae52437)
Shengjiu Wang [Tue, 18 Dec 2018 08:08:14 +0000 (16:08 +0800)]
MLK-20613: ASoC: fsl_asrc: add limitation for non ideal ratio mode
for non ideal ratio mode, the clock rate should divide the sample rate
with no remainder, and the quotient should be less than 1024.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
f1459e0be38a89230f9c4831d6d7c0021b1ffc48)
Shengjiu Wang [Wed, 5 Jul 2017 07:29:40 +0000 (15:29 +0800)]
MLK-13945-3: ASoC: fsl_asrc: support two asrc devices
In imx8qm, there is two asrc devices, so using global structure
"miscdevice" will cause error. Each instance should have their
own structure.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit
f70f67b04b5351fe6d0d288f62f8050932cf5085)
(cherry picked from commit
8c533278e6f62185b976d6d49f039d87620a4c0e)
Shengjiu Wang [Wed, 6 Dec 2017 03:40:31 +0000 (11:40 +0800)]
MLK-17089-2: ASoC: fsl_esai: support suspend & resume for imx8
Base on latest power management design in MLK-17074, every driver
need to enter runtime suspend state in suspend, so the driver should
call the pm_runtime_force_suspend in suspend. with this implementation
the suspend function almost same as runtime suspend function. so remove
the suspend function, just use pm_runtime_force_suspend instead.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
f78c1564e501eaca142cd606df991abe92ff8461)
Shengjiu Wang [Wed, 6 Dec 2017 03:40:20 +0000 (11:40 +0800)]
MLK-17089-1: ASoC: fsl_sai: support suspend & resume for imx8
Base on latest power management design in MLK-17074, every driver
need to enter runtime suspend state in suspend, so the driver should
call the pm_runtime_force_suspend in suspend. with this implementation
the suspend function almost same as runtime suspend function. so remove
the suspend function, just use pm_runtime_force_suspend instead.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
6398e9efcae3a2aa102689797c9b63e260a06cdd)
Viorel Suman [Tue, 9 Apr 2019 15:23:02 +0000 (18:23 +0300)]
arm64: dts: adjust AUDMIX configuration with upstream
Adjust AUDMIX configuration with upstream version.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Viorel Suman [Tue, 9 Apr 2019 10:43:05 +0000 (13:43 +0300)]
ASoC: imx-audmix: fix object reference leaks in probe
Release the reference to the underlying device taken
by of_find_device_by_node() call.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reported-by: Julia Lawall <Julia.Lawall@lip6.fr>
Viorel Suman [Tue, 9 Apr 2019 09:43:55 +0000 (12:43 +0300)]
dt-bindings: fsl,audmix: remove "model" attribute
Remove "model" attribute.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Viorel Suman [Tue, 9 Apr 2019 10:38:23 +0000 (13:38 +0300)]
ASoC: fsl_audmix: remove "model" attribute
Use "of_device_id.data" to specify the machine driver
instead of "model" DTS attribute.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>