linux.git
7 years agoMLK-17491-39 clk: imx: remove private clk-frac-divider
Dong Aisheng [Thu, 7 Sep 2017 07:10:50 +0000 (15:10 +0800)]
MLK-17491-39 clk: imx: remove private clk-frac-divider

Kernel already supports fractional divider and we switched to it.
See: drivers/clk/clk-fractional-divider.c
So no need keep our private clk-frac-divider copy now which functions
the same, delete it.

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-38 clk: imx: clk-composite: code cleanup and improvement
Dong Aisheng [Wed, 13 Sep 2017 14:46:03 +0000 (22:46 +0800)]
MLK-17491-38 clk: imx: clk-composite: code cleanup and improvement

1) reorder headfile
2) remove unused headfile
3) remove unused macro
4) replace magic number by macro
5) fix code indent issue
6) reorder local variables
7) remove unnessary error message

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-37 clk: imx: clk-composite: using kernel fractional divider instead of...
Dong Aisheng [Thu, 7 Sep 2017 06:47:08 +0000 (14:47 +0800)]
MLK-17491-37 clk: imx: clk-composite: using kernel fractional divider instead of our own

Kernel already supports fractional divider.
See: drivers/clk/clk-fractional-divider.c

After patch: ("clk: fractional-divider: add CLK_FRAC_DIVIDER_ZERO_BASED
flag support"), it can supports ZERO based dividers now which be used by
IMX ULP.

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-36 clk: reparent orphans after critical clocks enabled
Dong Aisheng [Sat, 13 May 2017 07:59:15 +0000 (15:59 +0800)]
MLK-17491-36 clk: reparent orphans after critical clocks enabled

The orphan clocks reparent operation should be moved after the critical
clocks enabled, otherwise it may get a chance to disable a newly
registered critical clock which triggers the following warning.

Assuming we have two clocks: A and B, B is the parent of A.
Clock A has flag: CLK_OPS_PARENT_ENABLE
Clock B has flag: CLK_IS_CRITICAL

Step 1:
Clock A is registered, then it becomes orphan.

Step 2:
Clock B is registered. Before clock B reach the critical clock enable
operation, orphan A will find the newly registered parent B and do
reparent operation, then parent B will be finally disabled in
__clk_set_parent_after() due to CLK_OPS_PARENT_ENABLE flag as there's
still no users of B which will then trigger the following warning.

[    0.000000] WARNING: CPU: 0 PID: 0 at drivers/clk/clk.c:597 clk_core_disable+0xb4/0xe0
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.11.0-rc1-00056-gdff1f66-dirty #1373
[    0.000000] Hardware name: Generic DT based system
[    0.000000] Backtrace:
[    0.000000] [<c010c4bc>] (dump_backtrace) from [<c010c764>] (show_stack+0x18/0x1c)
[    0.000000]  r6:600000d3 r5:00000000 r4:c0e26358 r3:00000000
[    0.000000] [<c010c74c>] (show_stack) from [<c040599c>] (dump_stack+0xb4/0xe8)
[    0.000000] [<c04058e8>] (dump_stack) from [<c0125c94>] (__warn+0xd8/0x104)
[    0.000000]  r10:c0c21cd0 r9:c048aa78 r8:00000255 r7:00000009 r6:c0c1cd90 r5:00000000
[    0.000000]  r4:00000000 r3:c0e01d34
[    0.000000] [<c0125bbc>] (__warn) from [<c0125d74>] (warn_slowpath_null+0x28/0x30)
[    0.000000]  r9:00000000 r8:ef00bf80 r7:c165ac4c r6:ef00bf80 r5:ef00bf80 r4:ef00bf80
[    0.000000] [<c0125d4c>] (warn_slowpath_null) from [<c048aa78>] (clk_core_disable+0xb4/0xe0)
[    0.000000] [<c048a9c4>] (clk_core_disable) from [<c048be88>] (clk_core_disable_lock+0x20/0x2c)
[    0.000000]  r4:000000d3 r3:c0e0af00
[    0.000000] [<c048be68>] (clk_core_disable_lock) from [<c048c224>] (clk_core_disable_unprepare+0x14/0x28)
[    0.000000]  r5:00000000 r4:ef00bf80
[    0.000000] [<c048c210>] (clk_core_disable_unprepare) from [<c048c270>] (__clk_set_parent_after+0x38/0x54)
[    0.000000]  r4:ef00bd80 r3:000010a0
[    0.000000] [<c048c238>] (__clk_set_parent_after) from [<c048daa8>] (clk_register+0x4d0/0x648)
[    0.000000]  r6:ef00d500 r5:ef00bf80 r4:ef00bd80 r3:ef00bfd4
[    0.000000] [<c048d5d8>] (clk_register) from [<c048dc30>] (clk_hw_register+0x10/0x1c)
[    0.000000]  r9:00000000 r8:00000003 r7:00000000 r6:00000824 r5:00000001 r4:ef00d500
[    0.000000] [<c048dc20>] (clk_hw_register) from [<c048e698>] (_register_divider+0xcc/0x120)
[    0.000000] [<c048e5cc>] (_register_divider) from [<c048e730>] (clk_register_divider+0x44/0x54)
[    0.000000]  r10:00000004 r9:00000003 r8:00000001 r7:00000000 r6:00000003 r5:00000001
[    0.000000]  r4:f0810030
[    0.000000] [<c048e6ec>] (clk_register_divider) from [<c0d3ff58>] (imx7ulp_clocks_init+0x558/0xe98)
[    0.000000]  r7:c0e296f8 r6:c165c808 r5:00000000 r4:c165c808
[    0.000000] [<c0d3fa00>] (imx7ulp_clocks_init) from [<c0d24db0>] (of_clk_init+0x118/0x1e0)
[    0.000000]  r10:00000001 r9:c0e01f68 r8:00000000 r7:c0e01f60 r6:ef7f8974 r5:ef0035c0
[    0.000000]  r4:00000006
[    0.000000] [<c0d24c98>] (of_clk_init) from [<c0d04a50>] (time_init+0x2c/0x38)
[    0.000000]  r10:efffed40 r9:c0d61a48 r8:c0e78000 r7:c0e07900 r6:ffffffff r5:c0e78000
[    0.000000]  r4:00000000
[    0.000000] [<c0d04a24>] (time_init) from [<c0d00b8c>] (start_kernel+0x218/0x394)
[    0.000000] [<c0d00974>] (start_kernel) from [<6000807c>] (0x6000807c)
[    0.000000]  r10:00000000 r9:410fc075 r8:6000406a r7:c0e0c930 r6:c0d61a44 r5:c0e07918
[    0.000000]  r4:c0e78294
[    0.000000] ---[ end trace 0000000000000000 ]---

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-35 clk: fractional-divider: add CLK_FRAC_DIVIDER_ZERO_BASED flag support
Dong Aisheng [Sat, 13 May 2017 08:03:19 +0000 (16:03 +0800)]
MLK-17491-35 clk: fractional-divider: add CLK_FRAC_DIVIDER_ZERO_BASED flag support

Adding CLK_FRAC_DIVIDER_ZERO_BASED flag to indicate the numerator and
denominator value in register are start from 0.

This can be used to support frac dividers like below:
Divider output clock = Divider input clock x [(frac +1) / (div +1)]
where frac/div in register is:
000b - Divide by 1.
001b - Divide by 2.
010b - Divide by 3.

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-34 clk: clk-divider: add CLK_DIVIDER_ZERO_GATE clk support
Dong Aisheng [Sat, 13 May 2017 07:52:31 +0000 (15:52 +0800)]
MLK-17491-34 clk: clk-divider: add CLK_DIVIDER_ZERO_GATE clk support

For dividers with zero indicating clock is disabled, instead of giving a
warning each time like "clkx: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not
set" in exist code, we'd like to introduce enable/disable function for it.
e.g.
000b - Clock disabled
001b - Divide by 1
010b - Divide by 2
...

Set rate when the clk is disabled will cache the rate request and only
when the clk is enabled will the driver actually program the hardware to
have the requested divider value. Similarly, when the clk is disabled we'll
write a 0 there, but when the clk is enabled we'll restore whatever rate
(divider) was chosen last.

It does mean that recalc rate will be sort of odd, because when the clk is
off it will return 0, and when the clk is on it will return the right rate.
So to make things work, we'll need to return the cached rate in recalc rate
when the clk is off and read the hardware when the clk is on.

NOTE for the default off divider, the recalc rate will still return 0 as
there's still no proper preset rate. Enable such divider will give user
a reminder error message.

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-33 clk: imx: clk-pfdv2: need wait lock stable for PFD
Dong Aisheng [Thu, 7 Sep 2017 06:34:36 +0000 (14:34 +0800)]
MLK-17491-33 clk: imx: clk-pfdv2: need wait lock stable for PFD

Add the required wait lock stable for PLL.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-32 clk: imx: clk-pfdv2: fix the possible sychronization issue
Dong Aisheng [Thu, 7 Sep 2017 06:30:14 +0000 (14:30 +0800)]
MLK-17491-32 clk: imx: clk-pfdv2: fix the possible sychronization issue

Clk core using different locks for clk_enable/disable and clk_set_rate.
Driver should protect them if accessing the same resource.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-31 clk: imx: clk-pfdv2: add error checking for invalid pfd index
Dong Aisheng [Thu, 7 Sep 2017 12:08:42 +0000 (20:08 +0800)]
MLK-17491-31 clk: imx: clk-pfdv2: add error checking for invalid pfd index

Give a warning when get an invalid pfd index.

Cc: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-30 clk: imx: clk-pfdv2: improve the code readability
Dong Aisheng [Thu, 7 Sep 2017 06:24:39 +0000 (14:24 +0800)]
MLK-17491-30 clk: imx: clk-pfdv2: improve the code readability

Remove the complicated and unreadable arithmetic calculation code.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-29 clk: imx: clk-pfdv2: fix the wrong pfd rate exported
Dong Aisheng [Thu, 7 Sep 2017 06:15:11 +0000 (14:15 +0800)]
MLK-17491-29 clk: imx: clk-pfdv2: fix the wrong pfd rate exported

There's no meaning to fake a wrong rate to recalc.
Instread, simply return 0 for this case.

Before:
    spll_pre_sel                          1            1    24000000          0 0
       spll_pre_div                       1            1    24000000          0 0
          spll                            2            2   531648000          0 0
             spll_pfd3                    0            0   979729408          0 0
             spll_pfd2                    0            0   979729408          0 0
             spll_pfd1                    0            0   979729408          0 0
             spll_pfd0                    1            1   416072347          0 0

After:
    spll_pre_sel                          1            1    24000000          0 0
       spll_pre_div                       1            1    24000000          0 0
          spll                            2            2   531648000          0 0
             spll_pfd3                    0            0           0          0 0
             spll_pfd2                    0            0           0          0 0
             spll_pfd1                    0            0           0          0 0
             spll_pfd0                    1            1   416072347          0 0

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-28 clk: imx: clk-pfdv2: add missing CLK_SET_RATE_GATE flag
Dong Aisheng [Thu, 7 Sep 2017 05:57:49 +0000 (13:57 +0800)]
MLK-17491-28 clk: imx: clk-pfdv2: add missing CLK_SET_RATE_GATE flag

According to reference manual, pfdv2 can't set rate without gating clock.
So we should add CLK_SET_RATE_GATE flag accordingly.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-27 clk: imx: clk-pllv4: need wait lock stable for PLL
Dong Aisheng [Thu, 7 Sep 2017 05:18:29 +0000 (13:18 +0800)]
MLK-17491-27 clk: imx: clk-pllv4: need wait lock stable for PLL

Add the required wait lock stable for PLL.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-26 clk: imx: clk-pllv4: fix the multiplier name
Dong Aisheng [Thu, 7 Sep 2017 05:06:40 +0000 (13:06 +0800)]
MLK-17491-26 clk: imx: clk-pllv4: fix the multiplier name

Currently using 'div' name for the PLL multiplier defined in RM which is a
bit confusing. So fix it.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-25 clk: imx: clk-pllv4: remove meaningless register members
Dong Aisheng [Thu, 7 Sep 2017 05:02:53 +0000 (13:02 +0800)]
MLK-17491-25 clk: imx: clk-pllv4: remove meaningless register members

There's no meaning to add members for fixed register offset and mask.
This using seems to be derived from MX6 PLL code but not suitable for
ULP up till now.

Cc: Anson Huang <Anson.Huang@nxp.com>
Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-24 clk: imx: clk-pllv4: fix the wrong mult values used
Dong Aisheng [Thu, 7 Sep 2017 04:50:13 +0000 (12:50 +0800)]
MLK-17491-24 clk: imx: clk-pllv4: fix the wrong mult values used

According to reference manual, the Valid MULT values are 33, 27, 22,
20, 17, 16. Not the ranges from 16 to 30 currently used.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-23 clk: imx: clk-pllv4: fix wrong return of clk_pllv4_is_enabled
Dong Aisheng [Thu, 7 Sep 2017 04:40:38 +0000 (12:40 +0800)]
MLK-17491-23 clk: imx: clk-pllv4: fix wrong return of clk_pllv4_is_enabled

PLL_EN bit set means pll enabled, not disabled.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-22 clk: imx: clk-pllv4: add the missing CLK_SET_RATE_GATE
Dong Aisheng [Thu, 7 Sep 2017 12:37:19 +0000 (20:37 +0800)]
MLK-17491-22 clk: imx: clk-pllv4: add the missing CLK_SET_RATE_GATE

According to reference manual, this pll can't set rate without gating
clock. So we should add CLK_SET_RATE_GATE flag accordingly.

Cc: Anson Huang <Anson.Huang@nxp.com>
Cc: Bai Ping <ping.bai@nxp.com>
Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-21 clk: imx7ulp: fix RTC OSC clock name
Dong Aisheng [Wed, 6 Sep 2017 14:35:44 +0000 (22:35 +0800)]
MLK-17491-21 clk: imx7ulp: fix RTC OSC clock name

'CKIL' clock name is derived from MX6 SoC series which is invalid for
MX7ULP (can't find it from RM). Changing it to the correct 'ROSC'
which is defined in RM.

The exist 'OSC' name is also changed accordingly which should be SOSC
(System OSC).

Fixes: aacf0b70af26 ("MLK-13441-6 ARM: imx: add i.mx7ulp clock driver")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-20 clocksource: imx-tpm: code cleanup and improvement
Dong Aisheng [Wed, 6 Sep 2017 13:28:05 +0000 (21:28 +0800)]
MLK-17491-20 clocksource: imx-tpm: code cleanup and improvement

1) replace magic number with macros
2) add more code comments
3) replace setup_irq with request_irq as no need use setup_irq
4) replace __raw_readl which has endian issue with readl
(so far endian issue not exist on IMX, but better write more robust code
in advance)
5) remove the last meaningless timer_base read

No function level change.

Cc: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-19 clocksource: imx-tpm: fix error checks
Dong Aisheng [Wed, 6 Sep 2017 13:13:25 +0000 (21:13 +0800)]
MLK-17491-19 clocksource: imx-tpm: fix error checks

Note we shouldn't use BUG_ON here as there might be alternative timers.

Cc: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-18 clocksource: imx-tpm: add missing ipg clock
Dong Aisheng [Wed, 6 Sep 2017 13:05:07 +0000 (21:05 +0800)]
MLK-17491-18 clocksource: imx-tpm: add missing ipg clock

According to reference mannual, there should be also an ipg clock,
so add it.

Cc: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-17 dts: imx7ulp: add ipg clock for tpm timer
Dong Aisheng [Wed, 6 Sep 2017 12:56:34 +0000 (20:56 +0800)]
MLK-17491-17 dts: imx7ulp: add ipg clock for tpm timer

According to reference mannual, there should be also an ipg clock,
so add it.

Cc: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-16 dt-bindings: timer: add nxp tpm timer binding doc
Dong Aisheng [Fri, 12 May 2017 14:30:31 +0000 (22:30 +0800)]
MLK-17491-16 dt-bindings: timer: add nxp tpm timer binding doc

Adding NXP Low Power Timer/Pulse Width Modulation Module (TPM)
binding doc.

Cc: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-15 dts: imx7ulp: add necessary clock for gpio node
Dong Aisheng [Wed, 6 Sep 2017 14:25:22 +0000 (22:25 +0800)]
MLK-17491-15 dts: imx7ulp: add necessary clock for gpio node

On MX7ULP, GPIO controller needs two necessary clocks:
Port module clock and GPIO module clock.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-14 gpio-vf610: add getting necessary clocks support
Dong Aisheng [Tue, 15 Aug 2017 03:32:18 +0000 (11:32 +0800)]
MLK-17491-14 gpio-vf610: add getting necessary clocks support

On MX7ULP, GPIO controller needs two necessary clocks:
Port module clock and GPIO module clock.

Add them as optional clocks to use.

Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-13 dts: imx7ulp: improve the gpio using
Dong Aisheng [Wed, 6 Sep 2017 13:47:14 +0000 (21:47 +0800)]
MLK-17491-13 dts: imx7ulp: improve the gpio using

Currently people have no idea on which pad is correspding to which gpio
controller as there's no hints in dts. Let's add a proper prefix for gpio
nodes as follows in dts to make it much easier to use.
gpio0 = &gpio_ptc;
gpio1 = &gpio_ptd;
gpio2 = &gpio_pte;
gpio3 = &gpio_ptf;

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-12 gpio: gpio-vf610: put gpio direction setting in vf610_gpio_direction_output
Dong Aisheng [Wed, 6 Sep 2017 12:31:28 +0000 (20:31 +0800)]
MLK-17491-12 gpio: gpio-vf610: put gpio direction setting in vf610_gpio_direction_output

The gpio direction setting is better to be put in vf610_gpio_direction_output
rather than vf610_gpio_set where the later one is only for value set.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-11 dt-bindings: gpio-vf610: add missing imx7ulp binding doc support
Dong Aisheng [Sun, 14 May 2017 10:19:09 +0000 (18:19 +0800)]
MLK-17491-11 dt-bindings: gpio-vf610: add missing imx7ulp binding doc support

The Rapid General-Purpose Input and Output with 2 Ports (RGPIO2P)
on MX7ULP is similar to GPIO on Vibrid, except it has an extra
Port Data Direction Register (PDDR) used to configure the individual
port pins for input or output.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-10 pinctrl: imx: remove gpio_set_direction_scu
Dong Aisheng [Wed, 6 Sep 2017 08:02:56 +0000 (16:02 +0800)]
MLK-17491-10 pinctrl: imx: remove gpio_set_direction_scu

There's no meaning to add gpio_set_direction-scu function as 1) current
pinctrl binding does not claim any GPIO direction setting capbility and
2) no GPIO driver actually uses it.

And current implementation also simply return a -EINVAL error which is
meainingless too.

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Fixes: 5d7a13220ade ("MLK-15128-3 pinctrl: freescale: support scu and memmap pinctrl together")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-9 pinctrl: imx: cleanup gpio_set_direction
Dong Aisheng [Wed, 6 Sep 2017 07:46:00 +0000 (15:46 +0800)]
MLK-17491-9 pinctrl: imx: cleanup gpio_set_direction

First of all, the design of using CONFIG_IBE_OBE is wrong as both VF and
IMX has IBE and OBE while current code defined it in common code but for
only IMX which causes a bit confusing.

Second, remove the following invalid comments as we will clear IBE.
"IBE always enabled allows us to read the value on the wire"

Last, replace the complicated "if else" statement with a much simpler one.

Cc: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Fixes: 07787c40ff3b ("MLK-13485-3 pinctrl: imx: modify the imx pinctrl to support imx7ulp gpio")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-8 pinctrl: imx: remove gpio_request_enable and gpio_disable_free
Dong Aisheng [Tue, 5 Sep 2017 12:35:16 +0000 (20:35 +0800)]
MLK-17491-8 pinctrl: imx: remove gpio_request_enable and gpio_disable_free

gpio_request_enable/disable_free actually are not quite necessary as
standard IMX pinctrl binding already sets GPIO mux from device tree,
e.g. VF610_PAD_PTB20__GPIO_42 or MX7D_PAD_SD2_CD_B__GPIO5_IO9
No need to do it again in gpio_request_enable.

Fixes: 5d7a13220ade ("MLK-15128-3 pinctrl: freescale: support scu and memmap pinctrl together")
Fixes: 07787c40ff3b ("MLK-13485-3 pinctrl: imx: modify the imx pinctrl to support imx7ulp gpio")
Cc: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-7 pinctrl: imx: remove unnecessary fsl,mux_mask property
Dong Aisheng [Tue, 5 Sep 2017 10:07:38 +0000 (18:07 +0800)]
MLK-17491-7 pinctrl: imx: remove unnecessary fsl,mux_mask property

Remove unnecessary fsl,mux_mask property which is also not documented in
binding doc. As we already have imx_pinctrl_soc_info structure which
represents the SoC specific properties, encode in it instead.

The patch also simplies the code a bit by removing the mux_shift
calculation code which is not necessary as well.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-6 pinctrl: imx: fix debug message for SHARE_MUX_CONF_REG case
Dong Aisheng [Fri, 19 May 2017 07:05:41 +0000 (15:05 +0800)]
MLK-17491-6 pinctrl: imx: fix debug message for SHARE_MUX_CONF_REG case

The original implemented debug message does not work for
SHARE_MUX_CONF_REG case. This patch fixes it.

[ Aisheng: fix merge conflict ]

Fixes: bf5a530971af ("pinctrl: imx: add VF610 support to imx pinctrl framework")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
7 years agoMLK-17491-5 dts: imx7ulp-evk: remove unneccesary bootargs in chosen node
Dong Aisheng [Wed, 6 Sep 2017 11:30:01 +0000 (19:30 +0800)]
MLK-17491-5 dts: imx7ulp-evk: remove unneccesary bootargs in chosen node

Earlycon can be simply turned on by adding "earlycon" in bootargs,
then of earlycon core will automatically find the matching earlycon device
via stdout-path during early boot. No need specify address and baudrate
which is hard to use.

Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-4 serial: fsl_lpuart: fix earlycon compatible string
Dong Aisheng [Wed, 6 Sep 2017 11:51:26 +0000 (19:51 +0800)]
MLK-17491-4 serial: fsl_lpuart: fix earlycon compatible string

"fsl,lpuart" is wrong and has never been used in our dts.
Actually it should be "fsl,imx7ulp-lpuart".
With this fixed, user can simply specify "earlycon" in bootargs to turn on
early console.

Fixes: 917aacd37919 ("MLK-13911-12 tty: serial: fsl: add earlycon support")
Cc: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-3 serial: fsl_lpuart: lpuart32_serial_setbrg cleanup and handle error
Dong Aisheng [Tue, 5 Sep 2017 09:06:29 +0000 (17:06 +0800)]
MLK-17491-3 serial: fsl_lpuart: lpuart32_serial_setbrg cleanup and handle error

1) Add code comments for the algorithm idea
2) code cleanups
3) Give a warn one find unacceptable baud rate difference of more
than 3%

No function level change.

Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-2 serial: fsl_lpuart: improve the baud setting algorithm
Dong Aisheng [Tue, 5 Sep 2017 08:31:50 +0000 (16:31 +0800)]
MLK-17491-2 serial: fsl_lpuart: improve the baud setting algorithm

If "baud_diff == 0", it means we already found the exact matching baud
rate and no need try looping the left possible baud rates anymore.

So in this patch, we break out immediately once we find the right baud
rate to avoid the left meaningless loops.

Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17491-1 serial: fsl_lpuart: fix the invalid comments
Dong Aisheng [Tue, 5 Sep 2017 08:16:01 +0000 (16:16 +0800)]
MLK-17491-1 serial: fsl_lpuart: fix the invalid comments

This part of code is derived from Kinetis and is obviously invalid for ULP,
So delete it to avoid confusing.

Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17490-2 drm/imx: dec400d: fix wrong path to define 'dcss_dec400d_write()'
Fancy Fang [Thu, 1 Feb 2018 11:22:07 +0000 (19:22 +0800)]
MLK-17490-2 drm/imx: dec400d: fix wrong path to define 'dcss_dec400d_write()'

The macro 'USE_CTXLD' usage in function 'dcss_dec400d_write()'
is opposite to the real defintion path.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-17490-1 drm/imx: dec400d: fix incorrect register base passed to context loader
Fancy Fang [Thu, 1 Feb 2018 11:19:34 +0000 (19:19 +0800)]
MLK-17490-1 drm/imx: dec400d: fix incorrect register base passed to context loader

The register base of DEC400D which is passed to context loader
should be the physical address but not the ioremaped virtual
address.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-17486 arm64: dts: imx8mq-evk-m4: Disable QSPI and SAI2 for M4
Ye Li [Wed, 31 Jan 2018 14:14:30 +0000 (06:14 -0800)]
MLK-17486 arm64: dts: imx8mq-evk-m4: Disable QSPI and SAI2 for M4

Since M4 will use QSPI and SAI2, disable the relevant nodes in M4
dedicated DTB.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17473-7 drm/imx: dec400d: avoid shadow trigger when bypass dec400d
Fancy Fang [Wed, 31 Jan 2018 11:52:40 +0000 (19:52 +0800)]
MLK-17473-7 drm/imx: dec400d: avoid shadow trigger when bypass dec400d

Do not really do shadow regiters trigger in'dcss_dec400d_shadow_trig()'
when dec400d is bypassed, since in 'dcss_dec400d_bypass()', the shadow
registers have already been triggerd.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMGS-3632-2: drm: imx: dcss: adjust DPR MAX_BYTES_PREQ depending on resolution
Laurentiu Palcu [Tue, 23 Jan 2018 07:49:31 +0000 (09:49 +0200)]
MGS-3632-2: drm: imx: dcss: adjust DPR MAX_BYTES_PREQ depending on resolution

Current setting uses a 256 bytes/request for anything less than 1080p.
This works when DTRC is not involved. However, with DTRC, the
MAX_BYTES_PREQ needs to be fine tuned a little.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMGS-3632-1: drm: imx: dcss: adjust ratio when WR_SCL kicks in
Laurentiu Palcu [Fri, 26 Jan 2018 08:31:50 +0000 (10:31 +0200)]
MGS-3632-1: drm: imx: dcss: adjust ratio when WR_SCL kicks in

Using WRSCL for downscaling ratios between 3 and 5 can lead to more
DDR bandwidth beeing used (~400MB/s).

Hence, use WR_SCL only for downscaling ratios from 5 to 7.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17473-6 drm/imx: dcss: remove 'allow_fb_modifiers' assignment
Fancy Fang [Tue, 30 Jan 2018 07:36:50 +0000 (15:36 +0800)]
MLK-17473-6 drm/imx: dcss: remove 'allow_fb_modifiers' assignment

Since the 'allow_fb_modifiers' has been assigned to be true in
imx drm core driver in bind(), it is not necessary to set this
flag again here.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-17473-5 drm/imx: core: allow fb modifiers for DCSS
Fancy Fang [Thu, 25 Jan 2018 10:43:24 +0000 (18:43 +0800)]
MLK-17473-5 drm/imx: core: allow fb modifiers for DCSS

Set the 'allow_fb_modifiers' flag to be true when DCSS
exists to make the format modifiers blob data can be
created correctly during the plane initialization.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-17473-4 drm/imx: dcss: handle tiled and compressed layout for primary plane
Fancy Fang [Tue, 23 Jan 2018 14:17:23 +0000 (22:17 +0800)]
MLK-17473-4 drm/imx: dcss: handle tiled and compressed layout for primary plane

Add handling code to support tiled and compressed pixel source
layout. The tiled only layout will bypass DEC400D and be resolved
by DPR, since DEC400D is only responsible for decompression.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-17473-3 drm/imx: dcss: remove 'dcss_plane_mod_supported()'
Fancy Fang [Mon, 22 Jan 2018 08:44:45 +0000 (16:44 +0800)]
MLK-17473-3 drm/imx: dcss: remove 'dcss_plane_mod_supported()'

The 'dcss_plane_mod_supported()' function is duplicated with
another function 'dcss_plane_format_mod_supported()'. So remove
it and use 'dcss_plane_format_mod_supported()' to replace its
calling.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-17473-2 drm/imx: dcss: add modifiers support for primary plane
Fancy Fang [Thu, 18 Jan 2018 06:30:51 +0000 (14:30 +0800)]
MLK-17473-2 drm/imx: dcss: add modifiers support for primary plane

Add four possible modifiers 'linear', 'tiled', 'super tiled'
and 'compressed super tiled' for the primary plane which can
be de-compressed by DEC400D and de-tiled by DPR. And also
change the 'dcss_plane_format_mod_supported()' to handle these
modifiers.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-17473-1 drm/fourcc: add modifier for vivante compressed tiled layout
Fancy Fang [Wed, 17 Jan 2018 09:00:23 +0000 (17:00 +0800)]
MLK-17473-1 drm/fourcc: add modifier for vivante compressed tiled layout

Add a new fb modifier for Vivante compressed and tiled
pixle layout which can be decompressed by DEC400D module
in DCSS.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-15033-1: ASoC: fsl: Change rate constraints in TDM mode for AK4458
Cosmin-Gabriel Samoila [Wed, 31 Jan 2018 09:20:01 +0000 (11:20 +0200)]
MLK-15033-1: ASoC: fsl: Change rate constraints in TDM mode for AK4458

When in TDM mode, change constraints for rate and allow only
rates in [8KHz, 96KHz] due to the limitations of SAI master
clock. If rate is higher than 96KHz, the TX rate cannot be
obtained using only a 49MHz SAI clock.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMGS-3255: gpu-viv: enable command commit worker for 6.2.4.p1
Xianzhong [Sat, 16 Dec 2017 23:31:09 +0000 (07:31 +0800)]
MGS-3255: gpu-viv: enable command commit worker for 6.2.4.p1

This feature is initialy created and enabled for 6.2.4 GPU driver,
Need re-enable GPU command commit worker for 6.2.4.p1 driver version.

i.MX8QM dual GPU SW workaround since no command sharing HW fix in B0,
optimized driver to improve GPU benchmark with better performance.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit 2b20dff2514aa7f8f18a6c42451e43b637425e40)

7 years agoMLK-17455: ARM64: dts: correct the pinctrl setting for audio peripheral
Shengjiu Wang [Wed, 31 Jan 2018 02:57:35 +0000 (10:57 +0800)]
MLK-17455: ARM64: dts: correct the pinctrl setting for audio peripheral

According to the Reference manual, the bit 1-4 of PAD setting is reserved.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17475-07 ARM64: defconfig: enable TJA1100 PHY config
Fugang Duan [Tue, 30 Jan 2018 10:58:39 +0000 (18:58 +0800)]
MLK-17475-07 ARM64: defconfig: enable TJA1100 PHY config

Enable CONFIG_NXP_TJA110X_PHY config to support NXP TJA1100 net card
for i.MX8QM/QXP platforms.

Reviewed-by: Pandy Gao <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17475-06 ARM64: dts: imx8qm/qxp: add tja1100 net card support for mek and arm2...
Fugang Duan [Tue, 30 Jan 2018 08:41:17 +0000 (16:41 +0800)]
MLK-17475-06 ARM64: dts: imx8qm/qxp: add tja1100 net card support for mek and arm2 boards

Add NXP TJA1100 net card support for mek and arm2 boards.

For i.MX8QXP MEK/ARM2 board,disable enet1 port due to below issues:
- TJA1100 net card PHY address conflict with enet1 PHY1.
- TJA1100 net card attach on enet2 and use enet2 mdio bus.

For i.MX8QM MEK/ARM2 board, enet1 PHY address shoule be reworked to 2,
otherwise port1 don't work. Of course, the *-tja1100.dtb file focus on
verifying TJA1100 net card.

Reviewed-by: Pandy Gao <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17475-05 net: phy: tja110x: add lock to protect .suspend/.resume()
Fugang Duan [Tue, 30 Jan 2018 08:22:56 +0000 (16:22 +0800)]
MLK-17475-05 net: phy: tja110x: add lock to protect .suspend/.resume()

Add phydev->lock to protect phy register access in .suspend()/.resume().

Reviewed-by: Pandy Gao <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17475-04 net: phy: tja110x: clean up the debug error message
Fugang Duan [Tue, 30 Jan 2018 07:53:55 +0000 (15:53 +0800)]
MLK-17475-04 net: phy: tja110x: clean up the debug error message

Some code slices have handled the code logic in correctly, it should
not print out the error message. So clean up them.

Reviewed-by: Pandy Gao <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17475-03 net: phy: tja110x: add quirk for refclk_in selection
Fugang Duan [Tue, 30 Jan 2018 06:37:36 +0000 (14:37 +0800)]
MLK-17475-03 net: phy: tja110x: add quirk for refclk_in selection

When RMII signaling using an external crystal, refclk can output 50Mhz
to MAC as reference clock. When RMII signaling using an externally generated
reference clock refclk pin is input with 50Mhz.

Add one quirk to select the RMII refclk mode that depends on board design.

Reviewed-by: Pandy Gao <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17475-02 net: phy: tja110x: remove phy config_init in phy device probe()
Fugang Duan [Tue, 30 Jan 2018 06:29:22 +0000 (14:29 +0800)]
MLK-17475-02 net: phy: tja110x: remove phy config_init in phy device probe()

It is not necessary to config phy during phy device probe since it
will be called when do phy connect like below follow:
...
of_phy_connect()->
phy_attach_direct()->
phy_init_hw()->
config_init()
...

Reviewed-by: Pandy Gao <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17475-01 net: phy: tja110x: add NXP TJA110X PHY driver
Christian Herber [Tue, 30 Jan 2018 05:33:33 +0000 (13:33 +0800)]
MLK-17475-01 net: phy: tja110x: add NXP TJA110X PHY driver

The TJA1100 is IEEE 100BASE-T1 compliant, is single port Ethernet PHY Transceiver
is designed and fully qualified for automotive applications. It supports 100Mbit/s
transmit and receive capability up to at least 15 m of UTP cables.

TJA1100 PHY detail infomation refer to:
https://www.nxp.com/products/analog/interfaces/in-vehicle-network/ethernet/
automotive-phy-transceivers/ieee-100base-t1-compliant-automotive-ethernet-
phy-transceiver:TJA1100HN

The original driver is based on kernel 4.1:
https://source.codeaurora.org/external/autoivnsw/tja110x_linux_phydev
(Author: Christian Herber)

Porting the driver to kernel 4.9 and to support i.MX8 series platforms.
(Author: Fugang Duan)

Reviewed-by: Pandy Gao <pandy.gao@nxp.com>
Signed-off-by: Christian Herber <christian.herber@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMGS-3627 [#imx-911] "Could not open egl display" when run monkey test case for long...
Yuchou Gan [Wed, 31 Jan 2018 10:05:04 +0000 (18:05 +0800)]
MGS-3627 [#imx-911] "Could not open egl display" when run monkey test case for long time.

The root cause is that each time an application runs, the gpu driver will map reserved memory 128M to
the application virtual memory space, which means it need the system have at least 128M physical memory available,
otherwise the shmem_zero_setup will fail. Add MAP_NORESERVE flag to fix this problem.

Date: Jan 30, 2017
Signed-off-by: Yuchou Gan yuchou.gan@nxp.com
7 years agoASoC: imx-ak5558: Add support for 384KHz and 768KHz
Daniel Baluta [Mon, 29 Jan 2018 17:43:30 +0000 (19:43 +0200)]
ASoC: imx-ak5558: Add support for 384KHz and 768KHz

In normal mode we need to test SAI capability of supporting
higher rates so adjust constraints list to allow 384KHz
and 768KHz.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-15033: ASoC: fsl: Change constraints for AK4458
Cosmin-Gabriel Samoila [Tue, 30 Jan 2018 09:42:02 +0000 (11:42 +0200)]
MLK-15033: ASoC: fsl: Change constraints for AK4458

Add 384KHz and 768KHz as supported rates and add
different constraints for number of channels when
in tdm mode.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17462-4: ARM64: dts : support TDM mode for audio board.
Cosmin-Gabriel Samoila [Tue, 30 Jan 2018 09:38:43 +0000 (11:38 +0200)]
MLK-17462-4: ARM64: dts : support TDM mode for audio board.

Use a separate dts for tdm mode for ak4458.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-15033: ASoC: fsl: Add TDM support in machine driver for AK4458
Cosmin-Gabriel Samoila [Tue, 30 Jan 2018 09:31:49 +0000 (11:31 +0200)]
MLK-15033: ASoC: fsl: Add TDM support in machine driver for AK4458

TDM mode is enabled when "fsl,tdm" property is added in machine
driver dts node. When using TDM mode, SND_SOC_DAIFMT_DSP_B format
is used and the tdm slot_width is set to 32.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-15033: ASoC: codecs: Add TDM support for AK4458
Cosmin-Gabriel Samoila [Tue, 30 Jan 2018 09:18:33 +0000 (11:18 +0200)]
MLK-15033: ASoC: codecs: Add TDM support for AK4458

Based on slot_width and params_width, we will set
the format and TDM mode as specified in AK4458
datasheet.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17472: ASoC: imx-wm8962: fix build warning
Shengjiu Wang [Tue, 30 Jan 2018 02:36:05 +0000 (10:36 +0800)]
MLK-17472: ASoC: imx-wm8962: fix build warning

sound/soc/fsl/imx-wm8962.c: In function ‘imx_wm8962_probe’:
sound/soc/fsl/imx-wm8962.c:810:2: warning: ‘cpu_np’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  of_node_put(cpu_np);
  ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17289-9: dts: Add cec property to imx8mq dts
Sandor Yu [Mon, 25 Dec 2017 08:38:01 +0000 (16:38 +0800)]
MLK-17289-9: dts: Add cec property to imx8mq dts

Add cec property to imx8mq dts.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17289-8: dts: Remove hdmi_cec property
Sandor Yu [Mon, 25 Dec 2017 08:36:30 +0000 (16:36 +0800)]
MLK-17289-8: dts: Remove hdmi_cec property

hdmi cec function is implement hdmi driver.
so remove hdmi_cec property in imx8qm dts files.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17289-7: dts: Add cec property to imx8qm mek dts
Sandor Yu [Mon, 25 Dec 2017 08:34:44 +0000 (16:34 +0800)]
MLK-17289-7: dts: Add cec property to imx8qm mek dts

Add cec property to imx8qm mek dts.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17289-6: hdp drm: Add cec register/unregister function
Sandor Yu [Fri, 22 Dec 2017 10:09:29 +0000 (18:09 +0800)]
MLK-17289-6: hdp drm: Add cec register/unregister function

Add cec register/unregister function in hdp drm driver.
Add is_cec variable to check cec function setting in dtb.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17289-5: hdmi cec: change cec driver architecture
Sandor Yu [Fri, 22 Dec 2017 10:10:31 +0000 (18:10 +0800)]
MLK-17289-5: hdmi cec: change cec driver architecture

Change hdmi cec driver architecture.
Embedded cec function to hdmi driver.
Rewrite cec_read and cec_write fucntion
to support both imx8qm and imx8mq cec.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17289-4: hdp api: Add hdmi cec base address
Sandor Yu [Fri, 22 Dec 2017 10:08:24 +0000 (18:08 +0800)]
MLK-17289-4: hdp api: Add hdmi cec base address

Add hdmi cec base address.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17289-3: hdmi fb: change mem variable type
Sandor Yu [Fri, 22 Dec 2017 10:07:53 +0000 (18:07 +0800)]
MLK-17289-3: hdmi fb: change mem variable type

Change mem variable type.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17289-2: hdp drm: Add mem variable
Sandor Yu [Fri, 22 Dec 2017 10:06:43 +0000 (18:06 +0800)]
MLK-17289-2: hdp drm: Add mem variable

Add mem variable in struct imx_hdp,
and move regs_base and ss_base to struct mem.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17289-1: hdp: change struct mem variable type to pointer
Sandor Yu [Fri, 22 Dec 2017 10:04:58 +0000 (18:04 +0800)]
MLK-17289-1: hdp: change struct mem variable type to pointer

Change struct mem variable type to pointer in struct state.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17108-4 staging: typec: tcpci: correct read data msg length
Li Jun [Thu, 25 Jan 2018 12:01:46 +0000 (20:01 +0800)]
MLK-17108-4 staging: typec: tcpci: correct read data msg length

Per tcpci spec, the TCPC_RX_BYTE_CNT is the number of bytes in the
RX_BUFFER_DATA_OBJECTS plus three (for the RX_BUF_FRAME_TYPE and
RX_BUF_HEADER), so after read out the header, we should only read
TCPC_RX_BYTE_CNT-3 bytes for data if this is a data message.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-17108-3 staging: typec: tcpci: don't do force discharge if enable vbus sink
Li Jun [Thu, 25 Jan 2018 11:45:10 +0000 (19:45 +0800)]
MLK-17108-3 staging: typec: tcpci: don't do force discharge if enable vbus sink

We use vbus force discharge to have a quick vbus off for power role swap,
which works like this: enable vbus force discharge and wait the vbus fall
below vbus low threshold, when reaches, an alarm generated and tcpm can go
forward. but current code do vbus force discharge in any disable source
vbus case, in enable vbus charge case, we firstly disable source vbus and
then turn on vbus sink, in between, vbus force discharge should not be
enabled.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-17108-2 staging: typec: support dead battery charging
Jun Li [Thu, 18 Jan 2018 19:16:00 +0000 (03:16 +0800)]
MLK-17108-2 staging: typec: support dead battery charging

If the vbus is aready on and remote cc state is Rp while typec init, we
think it's a dead battery case, this needs the PD session already setup
by bootloader,  so kernel can negotiate a new power session by soft reset,
this patch use the exsiting flag vbus_never_low as boot from dead battery
flag, but update the condition of setting it: not only check vbus, also
the cc status to make sure remote is a power source, if yes, bypass the
vbus sink disable. If the vbus is from local, we will still disable vbus
charge so original code intention is kept.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-17108-1 ARM64: dts: imx8mq-evk: increase i2c1 clock to be 400K
Li Jun [Thu, 25 Jan 2018 11:38:45 +0000 (19:38 +0800)]
MLK-17108-1 ARM64: dts: imx8mq-evk: increase i2c1 clock to be 400K

As the typec port controller interface(TCPCI) spec requires the i2c clock
at least to be 400K, so here increase it to be 400K to meet timing
requirement.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16224-6: ASoC: fsl_sai: fix DSD suspend/resume
Viorel Suman [Mon, 29 Jan 2018 14:04:44 +0000 (16:04 +0200)]
MLK-16224-6: ASoC: fsl_sai: fix DSD suspend/resume

With the existing implementation the SAI pinctrl state is restored to
default after resume - this breaks DSD playback after resume.
Restore DSD pinctrl state in snd_soc_dai_driver resume callback.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17462-4: ARM64: dts : support TDM mode for audio board.
Shengjiu Wang [Fri, 26 Jan 2018 05:52:53 +0000 (13:52 +0800)]
MLK-17462-4: ARM64: dts : support TDM mode for audio board.

Use a separate dts for tdm mode for ak5558.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17462-3: ASoC: imx-ak5558: support TDM mode
Shengjiu Wang [Fri, 26 Jan 2018 05:52:33 +0000 (13:52 +0800)]
MLK-17462-3: ASoC: imx-ak5558: support TDM mode

add fsl,tdm property, in tdm mode, the slot_width is fixed to
32 bit.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17462-2: ASoC: ak5558: support SND_SOC_DAIFMT_DSP_B format for TDM
Shengjiu Wang [Fri, 26 Jan 2018 02:53:08 +0000 (10:53 +0800)]
MLK-17462-2: ASoC: ak5558: support SND_SOC_DAIFMT_DSP_B format for TDM

Add set_tdm_slot function for TDM mode, and support
SND_SOC_DAIFMT_DSP_B format

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17462-1: ASoC: AK5558: revert the fix for 8k and 16kHz.
Shengjiu Wang [Thu, 25 Jan 2018 02:35:49 +0000 (10:35 +0800)]
MLK-17462-1: ASoC: AK5558: revert the fix for 8k and 16kHz.

Revert commit 38078b6549c7 ("MLK-17428-4: ASoC: AK5558: fix
issue for 8k and 16kHz")

With this patch, there will be issue with PDM mode, cause the codec can't
work sometimes, the phenomenon is the register read failed.

So we revert this patch, and we will enable the pm_runtime function, which
should also fix the 8k and 16khz can't work issue in normal mode.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17470: ASoC: ak4497: automatically select dsdsel in driver
Shengjiu Wang [Fri, 26 Jan 2018 08:44:08 +0000 (16:44 +0800)]
MLK-17470: ASoC: ak4497: automatically select dsdsel in driver

automatically select dsdsel in driver according to the frequency

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17467: ASoC: fsl_sai: fix typo for fsl_sai
Shengjiu Wang [Fri, 26 Jan 2018 08:44:19 +0000 (16:44 +0800)]
MLK-17467: ASoC: fsl_sai: fix typo for fsl_sai

Fix build warning

sound/soc/fsl/fsl_sai.c: In function ‘fsl_sai_trigger’:
sound/soc/fsl/fsl_sai.c:736:3: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation]
   while (tx && i < channels)
   ^~~~~
sound/soc/fsl/fsl_sai.c:742:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘while’
    j++;
    ^
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17445: ASoC: ak4497: let codec start/stop properly
Viorel Suman [Mon, 29 Jan 2018 10:35:09 +0000 (12:35 +0200)]
MLK-17445: ASoC: ak4497: let codec start/stop properly

Let the codec start/stop properly before syncing
regmap with codec registers.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17389: drm/panel: rm67191: Fix power on/off logic
Robert Chiras [Mon, 22 Jan 2018 08:16:03 +0000 (10:16 +0200)]
MLK-17389: drm/panel: rm67191: Fix power on/off logic

On remove, the panel driver was only calling rad_panel_disable, which
only updates the brightness. During a reboot, the panel may remain
powered which will cause the whole screen to be bright white (sometimes
flashing).
This patch also calls the rad_panel_unprepare, which puts the panel to
sleep and also sets the DSI_EN gpio to LOW (which is the proper power
off sequence).
While powering on the sleeps are too high, so reduce them according to
the sample driver received from vendor.
Also, fixed the reading of display-timings property: this property is
optional, but will dump some error messages into the console log by
directly calling of_get_videomode() when this property is missing. To
avoid the error messages, first check if we really have this property
first.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17468-2: hdp: Enable imx8qm hdmi/dp 4kp30 support
Sandor Yu [Mon, 29 Jan 2018 08:43:16 +0000 (16:43 +0800)]
MLK-17468-2: hdp: Enable imx8qm hdmi/dp 4kp30 support

Add link rate select function.
Change max support pixel clock rate to 297MHz(4kp30).

Because edid read function is not enabled.
For such TV that max support 1080p60 or 720p60,
the followed cmdline mode should be added to kernel boot args:
video=HDMI-A-1:1920x1080-32@60 or
video=HDMI-A-1:1280x720-32@60

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17468-1: dptx: remove CDN_API_Get_PIXEL_FREQ_KHZ_ClosetVal
Sandor Yu [Mon, 29 Jan 2018 08:41:21 +0000 (16:41 +0800)]
MLK-17468-1: dptx: remove CDN_API_Get_PIXEL_FREQ_KHZ_ClosetVal

Remove CDN_API_Get_PIXEL_FREQ_KHZ_ClosetVal function,
replace with vic_table.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17469 ARM: dts: imx7ulp-evk: add USB support for RevB board
Peter Chen [Fri, 15 Sep 2017 01:42:41 +0000 (09:42 +0800)]
MLK-17469 ARM: dts: imx7ulp-evk: add USB support for RevB board

There are Type-C chip PTN5150 and connector are on it, and dual-role
mode are supported.

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-17463: ASoC: codecs: ak5558: Add runtime PM support
Daniel Baluta [Thu, 25 Jan 2018 17:10:55 +0000 (19:10 +0200)]
MLK-17463: ASoC: codecs: ak5558: Add runtime PM support

Based on latest power management design in MLK-17074,
every driver need to enter runtime suspend state before
entering system suspend, so the driver should call the
pm_runtime_force_suspend in suspend.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMGS-3622 [#imx-905] fix gpu gc_hal_kernel_platform_imx.c license error
Yuchou Gan [Mon, 29 Jan 2018 11:22:06 +0000 (19:22 +0800)]
MGS-3622 [#imx-905] fix gpu gc_hal_kernel_platform_imx.c license error

The GPU kernel driver file gc_hal_kernel_platform_imx.c license is incorrect,
Need fix it with GPL and MIT license statement.

Date: Jan 29, 2017
Signed-off-by: Yuchou Gan yuchou.gan@nxp.com
7 years agoMLK-17461-4: dts: reparent dpu/hdmi pixel clock from av_pll_bypass
Sandor Yu [Thu, 25 Jan 2018 08:23:25 +0000 (16:23 +0800)]
MLK-17461-4: dts: reparent dpu/hdmi pixel clock from av_pll_bypass

Reparent dpu and hdmi pixel clock from av_pll_bypass.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
7 years agoMLK-17461-3: hdp: Remove pixel clock root setting
Sandor Yu [Thu, 25 Jan 2018 08:27:54 +0000 (16:27 +0800)]
MLK-17461-3: hdp: Remove pixel clock root setting

HDMI pixel clock reparent function have implemented in dts,
remove clock root set function from hdp driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
7 years agoMLK-17461-2: clk: create imx8qm hdmi_pixel_select clocks
Sandor Yu [Thu, 25 Jan 2018 08:18:31 +0000 (16:18 +0800)]
MLK-17461-2: clk: create imx8qm hdmi_pixel_select clocks

Add hdmi_pxl_sel clocks.
Add av_pll_bypass clock.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
7 years agoMLK-17461-1: clk: define hdmi pixel select clock
Sandor Yu [Thu, 25 Jan 2018 08:21:52 +0000 (16:21 +0800)]
MLK-17461-1: clk: define hdmi pixel select clock

Define hdmi pixel select clocks.
Define av_pll_bypass clock.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
7 years agoMGS-3617 [#ccc] Disable the depth compression for imx8 board
Yuchou Gan [Fri, 26 Jan 2018 15:44:02 +0000 (23:44 +0800)]
MGS-3617 [#ccc] Disable the depth compression for imx8 board

This is the requirement for MGS-2914, but will cause cts failure and be reverted later.
New gpu driver 6.2.4.p1.pre2 has fixed the cts failure issue so we disable it again.

Date: Jan 26, 2017
Signed-off-by: Yuchou Gan yuchou.gan@nxp.com