linux.git
6 years agoARM: dts: imx6sll: add gpio-ranges property
Anson Huang [Fri, 20 Jul 2018 10:06:57 +0000 (18:06 +0800)]
ARM: dts: imx6sll: add gpio-ranges property

Add "gpio-ranges" property to establish connections between GPIOs
and PINs on i.MX6SLL pinctrl driver, for details, please refer to
Documentation/devicetree/bindings/gpio/gpio.txt of "gpio-ranges"
property.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoRevert "MLK-11495-03 ARM: imx: fix the ARM/IPG ratio when busfreq enabled"
Arulpandiyan Vadivel [Tue, 12 Feb 2019 05:16:01 +0000 (10:46 +0530)]
Revert "MLK-11495-03 ARM: imx: fix the ARM/IPG ratio when busfreq enabled"

This reverts commit 0919938115381fe9a19500af76da640fc18d5851.
Bus frequency fixes workaround changes are already in upstream.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoARM: dts: imx7d-sdb: Add missing lcdif display property
Vipul Kumar [Fri, 8 Feb 2019 06:03:17 +0000 (11:33 +0530)]
ARM: dts: imx7d-sdb: Add missing lcdif display property

As per 'commit 318e04958ffb ("MLK-18583: "Revert ARM: dts: imx7d-sdb: Add
DRM panel support"")', added missing lcdif display property.

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-14283: mxsfb: fix clock definitions for lcdif
Robert Chiras [Mon, 27 Feb 2017 13:19:50 +0000 (15:19 +0200)]
MLK-14283: mxsfb: fix clock definitions for lcdif

The mxsfb framebuffer driver uses three clock definitions, but only two
are defined in DTS for imx7s (also used by imx7d); because of this,
driver fails in probe. Since iMX7D uses only one clock, add the third clock
and make two of them dummy.
Also, add additional error messages for better identification of a
failing probe.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: imx7s: Add CAAM page 0 definition in device tree
Vipul Kumar [Thu, 7 Feb 2019 12:03:29 +0000 (17:33 +0530)]
ARM: imx7s: Add CAAM page 0 definition in device tree

As per 'commit 543560697919 ("MLK-16959: crypto: caam Add CAAM
page 0 definition in device tree")', adding CAAM page 0
definition in imx7s.dtsi

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: dts: imx7d: remove the duplicate entry of crypto
Vipul Kumar [Thu, 7 Feb 2019 11:59:21 +0000 (17:29 +0530)]
ARM: dts: imx7d: remove the duplicate entry of crypto

imx7s.dtsi already having crypto entry so removing duplicate
entry of crypto from imx7d.dtsi

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: dts: imx7d-sdb: fix endpont node name for mipi_sensor
Vipul Kumar [Thu, 7 Feb 2019 11:54:48 +0000 (17:24 +0530)]
ARM: dts: imx7d-sdb: fix endpont node name for mipi_sensor

This fixes the below compilation warnings:

arch/arm/boot/dts/imx7d-sdb.dtb: Warning (graph_endpoint): /soc/aips-bus@30400000/mipi-csi@30750000/port/endpoint1: graph endpont node name should be 'endpoint'
arch/arm/boot/dts/imx7d-sdb.dtb: Warning (graph_endpoint): /soc/aips-bus@30400000/mipi-csi@30750000/port/endpoint2: graph endpont node name should be 'endpoint'

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: dts: imx6dl: fix gpu node address
Vipul Kumar [Thu, 31 Jan 2019 11:49:17 +0000 (17:19 +0530)]
ARM: dts: imx6dl: fix gpu node address

This fixes the below mentioned boot time backtraces:

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.17-gf5efd42140de-dirty #1
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[<8010fc44>] (unwind_backtrace) from [<8010bc80>] (show_stack+0x10/0x14)
[<8010bc80>] (show_stack) from [<80a371fc>] (dump_stack+0x78/0x8c)
[<80a371fc>] (dump_stack) from [<8028b3fc>] (sysfs_warn_dup+0x58/0x64)
[<8028b3fc>] (sysfs_warn_dup) from [<8028b500>] (sysfs_create_dir_ns+0xb4/0xc8)
[<8028b500>] (sysfs_create_dir_ns) from [<80a3bfa0>] (kobject_add_internal+0x9c/0x2bc)
[<80a3bfa0>] (kobject_add_internal) from [<80a3c3b4>] (kobject_add+0x58/0xbc)
[<80a3c3b4>] (kobject_add) from [<80525244>] (device_add+0x100/0x604)
[<80525244>] (device_add) from [<807c98ac>] (of_platform_device_create_pdata+0x90/0xb8)
[<807c98ac>] (of_platform_device_create_pdata) from [<807c9ab4>] (of_platform_bus_create+0x198/0x22c)
[<807c9ab4>] (of_platform_bus_create) from [<807c9b00>] (of_platform_bus_create+0x1e4/0x22c)
[<807c9b00>] (of_platform_bus_create) from [<807c9c78>] (of_platform_populate+0x5c/0xac)
[<807c9c78>] (of_platform_populate) from [<80f0bde0>] (imx6q_init_machine+0x94/0x3c0)
[<80f0bde0>] (imx6q_init_machine) from [<80f038a8>] (customize_machine+0x20/0x30)
[<80f038a8>] (customize_machine) from [<801026b4>] (do_one_initcall+0x7c/0x1a8)
[<801026b4>] (do_one_initcall) from [<80f00e28>] (kernel_init_freeable+0x140/0x1d4)
[<80f00e28>] (kernel_init_freeable) from [<80a4a724>] (kernel_init+0x8/0x110)
[<80a4a724>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xd8073fb0 to 0xd8073ff8)
3fa0:                                     00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fe0: 00000000 00000000 00000000 00000000 00000013 00000000

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: dts: imx6sl.dtsi: fix gpu backtracing
Arulpandiyan Vadivel [Thu, 31 Jan 2019 12:24:40 +0000 (17:54 +0530)]
ARM: dts: imx6sl.dtsi: fix gpu backtracing

Fix below backtraces by adding unique name for each gpu nodes.

sysfs: cannot create duplicate filename '/bus/platform/devices/2200000.gpu'
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.17-03233-g8d8ad8d43f2c-dirty #3
Hardware name: Freescale i.MX6 SoloLite (Device Tree)
[<80112890>] (unwind_backtrace) from [<8010dc64>] (show_stack+0x10/0x14)
[<8010dc64>] (show_stack) from [<80b97fd4>] (dump_stack+0x88/0x9c)
[<80b97fd4>] (dump_stack) from [<802ecad4>] (sysfs_warn_dup+0x5c/0x68)
[<802ecad4>] (sysfs_warn_dup) from [<802ece60>] (sysfs_do_create_link_sd+0xc8/0xcc)
[<802ece60>] (sysfs_do_create_link_sd) from [<805d5db4>] (bus_add_device+0x78/0x130)
[<805d5db4>] (bus_add_device) from [<805d2a18>] (device_add+0x320/0x638)
[<805d2a18>] (device_add) from [<808b249c>] (of_platform_device_create_pdata+0x90/0xb8)
[<808b249c>] (of_platform_device_create_pdata) from [<808b2680>] (of_platform_bus_create+0x1b0/0x348)
[<808b2680>] (of_platform_bus_create) from [<808b26f0>] (of_platform_bus_create+0x220/0x348)
[<808b26f0>] (of_platform_bus_create) from [<808b29c4>] (of_platform_populate+0x80/0x108)
[<808b29c4>] (of_platform_populate) from [<8110c404>] (imx6sl_init_machine+0x30/0xd0)
[<8110c404>] (imx6sl_init_machine) from [<81103de8>] (customize_machine+0x20/0x30)
[<81103de8>] (customize_machine) from [<80102e9c>] (do_one_initcall+0x54/0x314)
[<80102e9c>] (do_one_initcall) from [<811011d8>] (kernel_init_freeable+0x360/0x3f0)
[<811011d8>] (kernel_init_freeable) from [<80bac9d8>] (kernel_init+0x8/0x114)
[<80bac9d8>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xa80b5fb0 to 0xa80b5ff8)

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoARM: dts: imx6sl: fix device tree structure for regulator nodes
Arulpandiyan Vadivel [Thu, 31 Jan 2019 12:20:12 +0000 (17:50 +0530)]
ARM: dts: imx6sl: fix device tree structure for regulator nodes

Fix regulator tree structure to avoid address-cell and size-cells conflicts.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agothermal: remove unused function imx_get_sensor_data
Arulpandiyan Vadivel [Wed, 30 Jan 2019 08:55:19 +0000 (14:25 +0530)]
thermal: remove unused function imx_get_sensor_data

Remove unused function imx_get_sensor_data() to fix compilation warnings.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agodrivers: pinctrl: Fix compilation warnings
Arulpandiyan Vadivel [Wed, 30 Jan 2019 05:04:50 +0000 (10:34 +0530)]
drivers: pinctrl: Fix compilation warnings

Fix compilation warnings by removing unused variables and adding missed
qualifiers.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoARM: dts: imx6sll: Fix compilation warnings
Arulpandiyan Vadivel [Tue, 29 Jan 2019 14:10:24 +0000 (19:40 +0530)]
ARM: dts: imx6sll: Fix compilation warnings

Fix below compilation warnings by adding address cells and size cells under
clock node.

Warning (reg_format): /clock-osc-24m:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
Warning (simple_bus_reg): Failed prerequisite 'reg_format'

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20216-4: video/fbdev/imx_dcss: remove useless function call
Laurentiu Palcu [Wed, 14 Nov 2018 12:55:55 +0000 (14:55 +0200)]
MLK-20216-4: video/fbdev/imx_dcss: remove useless function call

This fixes Coverity issue since the function does nothing. The function
only returns some values which are never used.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Fancy Fang <chen.fang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20216-3: video/fbdev/imx_dcss: remove unnecessary BUG_ONs
Laurentiu Palcu [Wed, 14 Nov 2018 12:50:43 +0000 (14:50 +0200)]
MLK-20216-3: video/fbdev/imx_dcss: remove unnecessary BUG_ONs

This fixes Coverity issue since num_pix_x and num_pix_y are unsigned and
the conditions are never true.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Fancy Fang <chen.fang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-3083 [#imx-662] fix kernel build error with kasan config
Xianzhong [Thu, 13 Jul 2017 02:28:14 +0000 (10:28 +0800)]
MGS-3083 [#imx-662] fix kernel build error with kasan config

hal/kernel/gc_hal_kernel_command.c: In function gckCOMMAND_Commit:
hal/kernel/gc_hal_kernel_command.c:2718:1:
error: the frame size of 2288 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

removed _commandBufferObject instrance, use kmalloc to avoid kasan error.

Date: Jul 13, 2017
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit d8d57e43a24bd02b375d7c6bd633ed236db19337)
(cherry picked from commit 484e3073adf47d27581482f268b01fe5fe219d18)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-13450-1 [#ccc] Switch layer memory allocation to virtual pool to improve performance.
Ivan.liu [Thu, 15 Nov 2018 05:58:54 +0000 (13:58 +0800)]
MA-13450-1 [#ccc] Switch layer memory allocation to virtual pool to improve performance.

Add DRM_VIV_GEM_VIRTUAL_POOL flags.
Switch to virtual pool when this flag is set.

Change-Id: I6e1e799cd0b4f81ed1ffbfdabe8f105325fa9644
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
(cherry picked from commit c4bd0fc803409c54d06e3554f4857922d6640925)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20450 Fix Linux NO SMP kernel - GPU
Cedric Neveux [Fri, 23 Nov 2018 10:24:08 +0000 (11:24 +0100)]
MLK-20450 Fix Linux NO SMP kernel - GPU

       - Fix GPU-viv drivers to build without SMP

Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
(cherry picked from commit 6558c2881b0cd1441708933fa1ac397f54b5aa70)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-13467 [#imx-1237] Fix kernel panic when running deqp module.
Ivan.liu [Tue, 20 Nov 2018 05:20:38 +0000 (13:20 +0800)]
MA-13467 [#imx-1237] Fix kernel panic when running deqp module.

Unable to handle kernel paging request at virtual address 1000100
[<ffff000008274ed8>] prefetch_freepointer.isra.37+0x8/0x14
[<ffff0000087bd3b0>] sync_file_create+0x28/0xc0
[<ffff000008b7c7e4>] gckOS_CreateNativeFence+0x74/0x110
[<ffff000008b89a78>] gckKERNEL_Dispatch+0xa54/0x15b0
[<ffff000008b8a8b8>] gckDEVICE_Dispatch+0x2e4/0x2f8
[<ffff000008b81160>] drv_ioctl+0x110/0x21c
[<ffff0000082b4478>] do_vfs_ioctl+0xb8/0x8b0
[<ffff0000082b4cf4>] SyS_ioctl+0x84/0x98

The reference count should be increased in one spin lock cycle.
Move spin lock out of _QueryIntegerId function.
Move signal reference count to gckOS_CreateNativeFence.

Change-Id: I1bf89b4de6055e5d0009baf7287f600696c4a529
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4363 [#imx-1246] fix coverity resource leak issue
Xianzhong [Fri, 16 Nov 2018 18:19:02 +0000 (02:19 +0800)]
MGS-4363 [#imx-1246] fix coverity resource leak issue

CID 3925877: Resource leak (RESOURCE_LEAK)
14. leaked_storage: Variable pages going out of scope leaks the storage it points to.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit a38d1b1ff31ce87a231588de1a2e24a787f87143)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-12928-2 [#imx-1199] Use gcdANDROID MARCO to control android build
Richard Liu [Wed, 31 Oct 2018 13:39:14 +0000 (21:39 +0800)]
MA-12928-2 [#imx-1199] Use gcdANDROID MARCO to control android build

Should use the correct build MARCO gcdANDROID to control android build.

Change-Id: I56a745b228a24ba502dc9771596aad78c1d8d808
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4376 [#imx-1238] fix low performance with CMA allocator
Xianzhong [Fri, 9 Nov 2018 18:37:56 +0000 (02:37 +0800)]
MGS-4376 [#imx-1238] fix low performance with CMA allocator

there are lots of PFNs busy message when run GPU tests:
 [  622.370671] alloc_contig_range: [4ea70, 4ea7c) PFNs busy
 [  626.518072] alloc_contig_range: [4ea90, 4ea9c) PFNs busy

this problem is related with CMA migration for fragments,

move CMA allocator after GFP to avoid memory migration,
also fix CMA preempt for contiguous memory request.

can improve CTS and gpubench benchmarks on M850D.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-13203-2 [#imx-1237] Fix kernel panic when do video plaback with dual display on...
Ivan.liu [Tue, 13 Nov 2018 01:00:17 +0000 (09:00 +0800)]
MA-13203-2 [#imx-1237] Fix kernel panic when do video plaback with dual display on 8mq.

BUG: scheduling while atomic: swapper/0/0/0x00010002
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.62 #1
Call trace:
[<ffff00000808b2e0>] dump_backtrace+0x0/0x414
[<ffff00000808b708>] show_stack+0x14/0x1c
[<ffff000008fbd00c>] dump_stack+0x90/0xb0
[<ffff00000810b8fc>] __schedule_bug+0x50/0x6c
[<ffff000008fd3b18>] __schedule+0x720/0x8a8
[<ffff000008fd3cd8>] schedule+0x38/0x9c
[<ffff000008fd40f0>] schedule_preempt_disabled+0x20/0x38
[<ffff000008fd51d8>] __mutex_lock.isra.9+0x4dc/0x4fc
[<ffff000008fd5208>] __mutex_lock_slowpath+0x10/0x18
[<ffff000008fd5240>] mutex_lock+0x30/0x38
[<ffff000008b79960>] gckOS_DestroySignal+0x30/0xcc
[<ffff000008baa3b8>] viv_fence_release+0x24/0x38
[<ffff0000087babcc>] dma_fence_release+0x38/0xf4
[<ffff0000087bb55c>] dma_fence_array_release+0x78/0xac
[<ffff0000087babcc>] dma_fence_release+0x38/0xf4
[<ffff0000087bb748>] irq_dma_fence_array_work+0x40/0x4c
[<ffff0000081d2878>] irq_work_run_list+0x68/0xa8
[<ffff0000081d28dc>] irq_work_run+0x24/0x40
[<ffff000008092440>] handle_IPI+0x300/0x330
[<ffff00000808197c>] gic_handle_irq+0x8c/0x184

Replace signal mutex lock with spin lock to handle signal in irq.

Change-Id: Id18e68f03bcb96c2aaf3ca8a0055fe6a64e8d10a
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4010 [#imx-919] Vulkan test met gpu hang on wayland
Ya Zhou [Tue, 23 Oct 2018 18:08:48 +0000 (02:08 +0800)]
MGS-4010 [#imx-919] Vulkan test met gpu hang on wayland

These case will generate a huge command object, which was divided into 33 Command Buffers to commit.
It will introduce a context switch within a command object. So add a mutex to avoid the Context switch.

Date: 23th Otc,2018
Signed-off-by Ya Zhou <ya.zhou@nxp.com>

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4338-5 [#imx-1217] remove duplicate query code for debugfs
Xianzhong [Mon, 22 Oct 2018 17:28:57 +0000 (01:28 +0800)]
MGS-4338-5 [#imx-1217] remove duplicate query code for debugfs

remove the duplicate code with gckGALDEVICE_QueryFrequency,
gckHARDWARE_QueryFrequency has correct fix for power management.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4338-3 [#imx-1217] fix kernel panic in gpu clock query
Xianzhong [Mon, 22 Oct 2018 17:28:11 +0000 (01:28 +0800)]
MGS-4338-3 [#imx-1217] fix kernel panic in gpu clock query

gpu clock and power can be turned off by global power management,
add global power semaphore protection to avoid clock-off in query.

also query GPU idle status to turn-off gpu clock/power properly.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4338-2 [#imx-1223] GPU memory optimization for page fault
Xianzhong [Mon, 22 Oct 2018 11:13:15 +0000 (19:13 +0800)]
MGS-4338-2 [#imx-1223] GPU memory optimization for page fault

GPU memory initialization will cause large boot time with 40ms.

If GPU memory is allocated from CMA, memset in cma kernel driver,
It is not necessary to add duplicated memset in GPU kernel driver.

Only GFP allocator need trigger a page fault with a simple write.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4338-1 [#imx-1217] fix GPU probe delay to query frequency
Xianzhong [Mon, 22 Oct 2018 11:56:47 +0000 (19:56 +0800)]
MGS-4338-1 [#imx-1217] fix GPU probe delay to query frequency

it is not necessary to query frequency when hardware initialize,
there are two cases which really need to query frequency,
1. application query (such as openCL initialization) with ioctl,
2. debugfs with "cat /sys/kernel/debug/gc/clk"

removed the query from driver probe, no impact on real cases.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-13121-2 [#imx-1221] Fix kernel panic after reduce gpu reserved memory size.
Ivan.liu [Mon, 22 Oct 2018 01:19:06 +0000 (09:19 +0800)]
MA-13121-2 [#imx-1221] Fix kernel panic after reduce gpu reserved memory size.

Fix uint64_t to pointer conversion issue on 32bit platform.

Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-13121 [#imx-1221] Fix kernel panic after reduce gpu reserved memory size.
Ivan.liu [Thu, 18 Oct 2018 07:48:22 +0000 (15:48 +0800)]
MA-13121 [#imx-1221] Fix kernel panic after reduce gpu reserved memory size.

gckOS_MapPhysical is only used for contiguous memory to do map.
Actually LockVideoMemory already get the virtual address.
Remove gckOS_MapPhysical to support non contiguous memory.

Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-12928 [#imx-1199] Fix kernel panic issue caused by invalid ts_dma_buf pointer.
ivan.liu [Thu, 27 Sep 2018 06:28:27 +0000 (14:28 +0800)]
MA-12928 [#imx-1199] Fix kernel panic issue caused by invalid ts_dma_buf pointer.

There is kernel panic stack which caused by ts_dma_buf pointer.

[  136.041194] [<ffff000008722a8c>] drm_gem_object_init+0x94/0x98
[  136.047028] [<ffff000008748294>] __drm_gem_cma_create+0x40/0xb4
[  136.052950] [<ffff000008748808>] drm_gem_cma_prime_import_sg_table+0x48/0xa8
[  136.060000] [<ffff000008732e0c>] drm_gem_prime_import_dev+0x98/0x134
[  136.066352] [<ffff000008732eb8>] drm_gem_prime_import+0x10/0x18
[  136.072276] [<ffff00000876b144>] dcss_plane_atomic_set_base+0x174/0x2e4
[  136.078889] [<ffff00000876b700>] dcss_plane_atomic_update+0x44c/0x578
[  136.085331] [<ffff0000087134b0>] drm_atomic_helper_commit_planes+0xb4/0x1f0
[  136.092293] [<ffff00000876bea8>] dcss_drm_atomic_commit_tail+0xb4/0xe4
[  136.098820] [<ffff000008716ba8>] commit_tail+0x44/0x84
[  136.103958] [<ffff000008716bf8>] commit_work+0x10/0x18
[  136.109100] [<ffff0000080fa1a4>] process_one_work+0x140/0x3fc
[  136.114846] [<ffff0000080fa598>] worker_thread+0x138/0x3e4
[  136.120334] [<ffff000008101a00>] kthread+0x104/0x130
[  136.125300] [<ffff000008085064>] ret_from_fork+0x10/0x18

ts_dma_buf will become an invalid pointer when user process crashes.
And DRM commit will access invalid ts_dma_buf in kernel thread in async.
Change ts_dma_buf to ts_address to avoid invalid pointer issue.

Signed-off-by: ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20207-3 input: synaptics_dsx_i2c: fix coverity resource leak issue.
Haibo Chen [Tue, 20 Nov 2018 06:44:22 +0000 (14:44 +0800)]
MLK-20207-3 input: synaptics_dsx_i2c: fix coverity resource leak issue.

CID 3869707: Resource leak (RESOURCE_LEAK)
13. leaked_storage: Variable fhandler going out of scope leaks
the storage it points to

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit ddf57217892e9fefc4f04a09988f4b0ed3bf0f07)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20207-2: input: synaptics_dsx_i2c: fix coverity Unsigned compared against 0 issue.
Haibo Chen [Mon, 19 Nov 2018 09:34:44 +0000 (17:34 +0800)]
MLK-20207-2: input: synaptics_dsx_i2c: fix coverity Unsigned compared against 0 issue.

CID 3869705: Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of an
unsigned value is always true. attr_count >= 0.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 7380600ba0d0763b6081c07f5ddcb018a54314ca)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20207-1: input: synaptics_dsx_i2c: fix coverity wrong sizeof argument issue
Haibo Chen [Mon, 19 Nov 2018 09:26:03 +0000 (17:26 +0800)]
MLK-20207-1: input: synaptics_dsx_i2c: fix coverity wrong sizeof argument issue

CID 3869704: Wrong sizeof argument (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument f1a->button_control.txrx_map of
type unsigned char * and argument 8 /* sizeof (f1a->button_control.txrx_map) */
to function synaptics_rmi4_i2c_read is suspicious.

Passing argument should be sizeof(unsigned char) rather than
sizeof(unsigned char *).

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 4583a0bc1ff6684e1d850eb50308ad8ae2fea627)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20203-2 cpufreq: imx7ulp: fix coverity issue
Anson Huang [Sat, 3 Nov 2018 04:16:08 +0000 (12:16 +0800)]
MLK-20203-2 cpufreq: imx7ulp: fix coverity issue

This patch fixes coverity issue of "divide by 0".

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20203-1 cpufreq: imx6q: fix coverity issue
Anson Huang [Sat, 3 Nov 2018 04:15:12 +0000 (12:15 +0800)]
MLK-20203-1 cpufreq: imx6q: fix coverity issue

This patch fixes coverity issue of "unchecked return value".

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20440 dts: ecspi: Add ecspi and its slave dts files for imx6ul
Clark Wang [Wed, 21 Nov 2018 11:13:47 +0000 (19:13 +0800)]
MLK-20440 dts: ecspi: Add ecspi and its slave dts files for imx6ul

For ECSPI test, add these two dts files.
imx6ul-14x14-evk-ecspi.dts: enable ecspi4 function. Because ethernet2
uses the same pins with ecspi4, so disable fec1/fec2.
imx6ul-14x14-evk-ecspi-slave.dts: Add "spi-slave" attribute to enable
slave mode.

Wire Connection:
J1704:
3 - SCS
4 - MOSI
5 - MISO
6 - SCK
7 - GND

Modify "Makefile" to build these two dts files.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20158-2 ARM: dts: imx7ulp-evk: add pinctrl for "sleep" state
Peter Chen [Thu, 1 Nov 2018 07:21:29 +0000 (15:21 +0800)]
MLK-20158-2 ARM: dts: imx7ulp-evk: add pinctrl for "sleep" state

After commit 2911e974c845 ("MLK-19098 ARM: dts: imx7ulp-evk: use OTG
ID function instead of GPIO") , the ID pinctrl is set by chipidea
driver, so we need to restore its setting after system resume
due to pinctrl setting is lost at VLLS state.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20104 driver: cpufreq: remove unnecessary mutex & rcu lock
Bai Ping [Fri, 26 Oct 2018 09:01:38 +0000 (17:01 +0800)]
MLK-20104 driver: cpufreq: remove unnecessary mutex & rcu lock

Remove the unnecessary mutex and rcu lock from i.MX7ULP
cpufreq driver.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
[Arul: Removed only imx7 changes]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20450 Fix Linux NO SMP kernel with OPTEE
Cedric Neveux [Thu, 22 Nov 2018 14:27:09 +0000 (15:27 +0100)]
MLK-20450 Fix Linux NO SMP kernel with OPTEE

   - Fix busfreq optee mode to not install the linux assembly function
   used to synchronize all CPU in case of SMP mode
   - Fix l2cache OPTEE/Linux share mutex operations

Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
(cherry picked from commit 68f47bb3328e56c63d647f855fc654f4736658ce)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20328-2: ARM: dts: imx7ulp: adjust the expected format
Viorel Suman [Wed, 21 Nov 2018 14:25:44 +0000 (16:25 +0200)]
MLK-20328-2: ARM: dts: imx7ulp: adjust the expected format

Default value must be prefixed by "0".

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 4ce702331a6c7b5a84fe4fdc210b62147e04fa84)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20357-2: ARM: dts: add audio routing for wm8960
Shengjiu Wang [Wed, 14 Nov 2018 06:55:37 +0000 (14:55 +0800)]
MLK-20357-2: ARM: dts: add audio routing for wm8960

add audio routing for wm8960 in dts.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20259 ARM: imx: add soc revision check for i.MX7ULP
Anson Huang [Wed, 7 Nov 2018 06:14:11 +0000 (14:14 +0800)]
MLK-20259 ARM: imx: add soc revision check for i.MX7ULP

i.MX7ULP SoC revision is available from B0, the SIM_JTAG_ID
register bit[31:28] indicates SoC revision as below:

4b'0001        B0
4b'0010        B1

This register is NOT available on A0, tested on B1 chip
as below:

root@imx7ulpevk:~# cat /sys/devices/soc0/revision
2.1

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Tested-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20203-3 ARM: imx: fix coverity issue
Anson Huang [Sat, 3 Nov 2018 04:16:51 +0000 (12:16 +0800)]
MLK-20203-3 ARM: imx: fix coverity issue

This patch fixes coverity issue of "divide by 0".

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20023 Move Busfreq support to OPTEE OS
Cedric Neveux [Thu, 18 Oct 2018 11:48:16 +0000 (13:48 +0200)]
MLK-20023 Move Busfreq support to OPTEE OS

  - When OPTEE OS is present and if it support the busfreq
    for the running the i.MX, the busfreq is executed in
    the OPTEE OS by calling a specific SMC function
  - Only a WFE function is copied into the OCRAM to
    synchronize all Cores in multi-core devices
  - OPTEE OS add a DT property 'busfreq=1' in the 'firmware/optee'
    node to indicate the busfreq support

Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-19966 clk: imx: Skip disabling uart clocks if m4 is active
Abel Vesa [Mon, 29 Oct 2018 11:50:18 +0000 (13:50 +0200)]
MLK-19966 clk: imx: Skip disabling uart clocks if m4 is active

No way of knowing when any of the uart clocks is currently
in use by m4 so just skip the gating for all of them.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13869 Revert "ARM: imx: add sleep for pllv3 relock"
Irina Tirdea [Tue, 14 Feb 2017 08:37:56 +0000 (10:37 +0200)]
MLK-13869 Revert "ARM: imx: add sleep for pllv3 relock"

This reverts commit 322503a15740bd9383bb4ed452e5dd5a40598170.
The driver for clk-pllv3 has moved from arch/arm/mach-imx/clk-pllv3.c
to drivers/clk/imx/clk-pllv3.c since the orginal change was made,
so the revert is done to the new file instead.

Signed-off-by: Irina Tirdea <irina.tirdea@nxp.com>
(cherry picked from commit dd50ef8f53be467f59947e4f2b3d03c093ec9783)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoclk: imx: Rename clk-composite clock to clk-composite-7ulp
Abel Vesa [Tue, 2 Oct 2018 13:42:49 +0000 (16:42 +0300)]
clk: imx: Rename clk-composite clock to clk-composite-7ulp

The imx/clk-composite is only used by 7ulp. It makes more sense
to mention that in the name of the file and the register function
since later imx-composite clocks may be added.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20166 can: flexcan: fix CAN can't wakeup system during suspend
Joakim Zhang [Fri, 9 Nov 2018 04:58:48 +0000 (12:58 +0800)]
MLK-20166 can: flexcan: fix CAN can't wakeup system during suspend

The system can be wakeuped only when system is totally suspend, when the
wakeup event comes during suspend will cause the system hang. For the
reason that CAN will not call flexcan_noirq_resume() callback if the wakeup
event comes before noirq suspend stage.

The way to fix the issue is that assure the system to call
flexcan_noirq_suspend() during suspend and then call
flexcan_noirq_resume() during resume.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20351-2 Doc: fsl-imx-cspi: Add a description of dmas cells
Clark Wang [Mon, 19 Nov 2018 02:30:48 +0000 (10:30 +0800)]
MLK-20351-2 Doc: fsl-imx-cspi: Add a description of dmas cells

The description of dmas pointed to the common description of dma,
and the introduction of dmas was unclear. Add a doc link to sdma
introduction.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20446 rpmsg: imx: only use the timeout by the first notify
Richard Zhu [Thu, 22 Nov 2018 06:11:05 +0000 (14:11 +0800)]
MLK-20446 rpmsg: imx: only use the timeout by the first notify

To make sure that the message wound't be discarded when
M4 is running normally or in the suspend mode. Only use
the timeout mechanism by the first notify when the vdev
is registered.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
(cherry picked from commit aaf42a6c2c224aa9bd88b13abcf8f848f2eab073)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20306 gpio: mxc: Skip GPIO_IMR restore in noirq resume
Bai Ping [Fri, 9 Nov 2018 09:11:52 +0000 (17:11 +0800)]
MLK-20306 gpio: mxc: Skip GPIO_IMR restore in noirq resume

During the time window of noirq suspend and noirq resume, if a GPIO
pin is enabled as system wakeup source, the corresponding GPIO line's
IRQ will be unmasked, and GPIO bank will NOT lost power, when GPIO irq
arrives, generic irq handler will mask it until GPIO driver is ready
to handle it, but in GPIO noirq resume callback, current
implementation will restore the IMR register using the value saved in
previous noirq suspend callback which is unmasked, so this GPIO line
with IRQ pending will be unmasked again after GPIO IMR regitster is
restored, ARM will be triggered to handle this IRQ again, because of
the change of commit bf22ff45bed6 ("genirq: Avoid unnecessary low
level irq function calls"), the mask_irq function will check the
status of irq_data to decide whether to mask the irq, in this
scenario, since the GPIO IRQ is being masked before GPIO noirq resume,
IRQD_IRQ_MASKED flag is set, so the second time GPIO IRQ triggered by
restoring GPIO IMR register, the irq_mask callback will be skipped and
cause ARM busy handling the GPIO IRQ come all the way and no response to
user anymore.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit c03d9ec1f861ff7cd04637ef01aa7e14388277b6)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20216-6: video/fbdev/mxc_dcic: fix return value
Laurentiu Palcu [Wed, 14 Nov 2018 13:06:12 +0000 (15:06 +0200)]
MLK-20216-6: video/fbdev/mxc_dcic: fix return value

This fixes Coverity issue where an unsigned variable is tested for
less-than-zero value.

Make val a signed integer instead.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Sandor Yu <sandor.yu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20216-5: video/fbdev/mxc_dcic: remove needless comparison
Laurentiu Palcu [Wed, 14 Nov 2018 13:01:30 +0000 (15:01 +0200)]
MLK-20216-5: video/fbdev/mxc_dcic: remove needless comparison

This fixes less-then-zero comparison Coverity issue. roi_param->roi_n is
unsigned, hence the comparison is not needed.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Sandor Yu <sandor.yu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20052 L2 Cache TEE/Linux shared mutex
Cedric Neveux [Tue, 23 Oct 2018 11:52:54 +0000 (13:52 +0200)]
MLK-20052 L2 Cache TEE/Linux shared mutex

   Modification of the L2 Cache operations to use
   a TEE/Linux Shared mutex

Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20205-3: regulator: core: fix modulo by zero
Robin Gong [Wed, 7 Nov 2018 15:58:45 +0000 (23:58 +0800)]
MLK-20205-3: regulator: core: fix modulo by zero

Fix 'Division or modulo by zero' coverity issue(CID-4159438).
In fact, no need to call set_ramp_delay() in case of ramp_disable
is true, hence, ramp_delay never be 0 while set_ramp_delay() called.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20205-1: dmaengine: fsl-edma-v3: fix NULL pointer dereference
Robin Gong [Wed, 7 Nov 2018 14:19:07 +0000 (22:19 +0800)]
MLK-20205-1: dmaengine: fsl-edma-v3: fix NULL pointer dereference

Fix 'null pointer dereferences issue' reported by coverity(CID-1477441).

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20190-03 brcmfmac: check thre return value of .brcmf_fil_iovar_data_get()
Andy Duan [Wed, 7 Nov 2018 07:06:03 +0000 (15:06 +0800)]
MLK-20190-03 brcmfmac: check thre return value of .brcmf_fil_iovar_data_get()

Check the return value of .brcmf_fil_iovar_data_get() to fix
the coverity issue of "error handling issue".

Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20190-02 brcmfmac: init the wlfc_mode variable before it is used
Andy Duan [Wed, 7 Nov 2018 06:51:52 +0000 (14:51 +0800)]
MLK-20190-02 brcmfmac: init the wlfc_mode variable before it is used

Init the wlfc_mode variable before it is used to fix
coverity issue of "Uninitialized variable".

Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20190-01 ptp: fec: add clock rate zero check
Andy Duan [Wed, 7 Nov 2018 06:10:55 +0000 (14:10 +0800)]
MLK-20190-01 ptp: fec: add clock rate zero check

Add clock rate zero check to fixes coverity issue of "divide by 0".

Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20213-1 soc: imx: gpc: fix coverity issue
Anson Huang [Sat, 3 Nov 2018 04:30:31 +0000 (12:30 +0800)]
MLK-20213-1 soc: imx: gpc: fix coverity issue

This patch fixes coverity issue of "divide by 0".

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20184 input: focaltech_touch: use disable_irq_nosync() in spin lock context
Haibo Chen [Fri, 2 Nov 2018 10:22:44 +0000 (18:22 +0800)]
MLK-20184 input: focaltech_touch: use disable_irq_nosync() in spin lock context

according to the function disable_irq() description, use disable_irq() in
spin lock context may cause deadlock. So change to use disable_irq_nosync().

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20105 staging: typec: tcpm: keep non-PD session for no GoodCRC
Li Jun [Tue, 29 Jan 2019 05:57:58 +0000 (11:27 +0530)]
MLK-20105 staging: typec: tcpm: keep non-PD session for no GoodCRC

In case of vbus_never_low, if source setup a typye-c only session, sink
time out on waiting for source capability message and send soft reset,
the source does not response by goodcrc for the soft reset message, we
don't do hard reset, but keep a non-PD typec session, because the source
maybe PD capable, this hard reset will make the source terminate the
session by turn off vbus, if this type-c port is the system power supply,
the whole system will reboot.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20113 spi: ecspi: add pio spi slave mode for imx6ul
Clark Wang [Fri, 2 Nov 2018 02:56:34 +0000 (10:56 +0800)]
MLK-20113 spi: ecspi: add pio spi slave mode for imx6ul

Add pio spi slave mode support for imx6ul which is based on the patch
cherry-pick from community(71abd29057cb17b6b9532421821dc443427399ed).

Because the original imx6ul is bound to mx51 in the dts file.
However, in the slave mode, the patch in the community only adds two
functions mx53_ecspi_rx_slave/mx53_ecspi_tx_slave. Therefore, configure
mx51/6ul to use these two functions for data transmission and reception
in slave mode.

Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20165-1 mtd: spi-nor: Add flash id for GD25LQ16
Clark Wang [Thu, 1 Nov 2018 10:29:54 +0000 (18:29 +0800)]
MLK-20165-1 mtd: spi-nor: Add flash id for GD25LQ16

iMX8MM DDR3L validation board uses GD25LQ16 as spi-nor chip, but its
id is incorrect in ids table, so add a new id and parameters with the
same name into the ids table. For the same name of the chip info, the
log following we can ignore.

LOG: m25p80 spi0.0: found gd25q16, expected gd25q16

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20171: mtd: flexspi: reset flexspi FLASHxCR2 registers during probe
Han Xu [Thu, 1 Nov 2018 20:01:27 +0000 (15:01 -0500)]
MLK-20171: mtd: flexspi: reset flexspi FLASHxCR2 registers during probe

Flexspi registers cannot be reset to default value, reset all FLASHxCR2
registers to 0 to avoid read data with invalid LUT commands.

Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20170: mtd: flexspi: change the flexspi dummy pad settings
Han Xu [Thu, 1 Nov 2018 20:01:06 +0000 (15:01 -0500)]
MLK-20170: mtd: flexspi: change the flexspi dummy pad settings

The dummy pad settings should be align with data access mode, such as
set to PAD4 for all Quad read.

Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-19787 can: flexcan: fix CAN can't receive remote request frame
Joakim Zhang [Thu, 18 Oct 2018 05:06:19 +0000 (13:06 +0800)]
MLK-19787 can: flexcan: fix CAN can't receive remote request frame

The flexcan driver allocates canfd-skb no matter whether use CAN FD
mode or not, it's unreasonable due to it will affect the parse of the
remote request frame.

To fix the issue, allocating can-skb with "alloc_can_skb()" in normal
mode and canfd-skb with "alloc_canfd_skb()" in fd mode.

Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20004 spi: lpspi: Improve the stability of lpspi data transmission
Xiaoning Wang [Mon, 22 Oct 2018 04:42:57 +0000 (12:42 +0800)]
MLK-20004 spi: lpspi: Improve the stability of lpspi data transmission

Use SR_TDF to judge if need send data, and SR_FCF to judge if
transmission end to replace the waiting after transmission end. This
waiting has no actual meaning, for the real end will set the FCF
flag.

Resolved an issue that could cause a transmission timeout when
transferring large amounts of data.

After making these changes, there is no need to use
fsl_lpspi_txfifo_empty(), so remove it.

Signed-off-by: Xiaoning Wang <xiaoning.wang@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-19899 spi: lpspi: CLK pin becomes low when CR_RST=1
Xiaoning Wang [Mon, 22 Oct 2018 03:01:18 +0000 (11:01 +0800)]
MLK-19899 spi: lpspi: CLK pin becomes low when CR_RST=1

Remove Reset operation in fsl_lpspi_config(). This RST may cause both CLK and
CS pins go from high to low level under cs-gpio mode.
Add fsl_lpspi_reset() function after one message transfer to clear all
flags in use.

Signed-off-by: Xiaoning Wang <xiaoning.wang@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-19952 net: phy: tja110x: avoid PHY driver resume methods to take phydev->lock...
Andy Duan [Tue, 16 Oct 2018 09:46:59 +0000 (17:46 +0800)]
MLK-19952 net: phy: tja110x: avoid PHY driver resume methods to take phydev->lock mutex

commit f5e64032a799 ("net: phy: fix resume handling") and commit 6bccf8962b78
(net: phy: Restore phy_resume() locking assumption) make phy_resume() take
phydev->lock mutex, not PHY driver resume callback take that lock.
(The two commits enter kernel tree after v4.9, so v4.9 has no such issue)

To avoid dead lock, fix it by ensuring that the PHY driver resume methods
do not take the phydev->lock mutex themselves, but phy_resume() only take
that lock.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-19931-2: dmaengine: fsl-edma: fix potential kernel crash in cyclic
Robin Gong [Mon, 15 Oct 2018 17:33:35 +0000 (01:33 +0800)]
MLK-19931-2: dmaengine: fsl-edma: fix potential kernel crash in cyclic

Fix potential kernel crash issue  on fsl-edma as fsl-edma-v3.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-19931-1: dmaengine: fsl-edma-v3: fix potential kernel crash in cyclic
Robin Gong [Mon, 15 Oct 2018 17:06:29 +0000 (01:06 +0800)]
MLK-19931-1: dmaengine: fsl-edma-v3: fix potential kernel crash in cyclic

  There is one potential race condition in virt-dma framework as below:
terminate dma channel after the last dma done interrupt, but before
vchan_complete tasklet scheduled, thus the free-ed 'vd' (free in
fsl_edma3_terminate_all) maybe still be touched in vchan_complete()
which cause NULL pointer crash.
  Kernel community noticed this issue and fix it at virt-dma level:
https://patchwork.kernel.org/patch/10057791/. To avoid backport too
much patches, set 'vc->cyclic = NULL' in terminate dma channel
interfaces to fix such issue easily.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20314: drivers: crypto: caam: alg: Enable GCM for newer LP CAAM
Franck LENORMAND [Fri, 9 Nov 2018 17:21:35 +0000 (18:21 +0100)]
MLK-20314: drivers: crypto: caam: alg: Enable GCM for newer LP CAAM

The iMX6 platform does not support fardware GCM, more
recent iMX does so we enable it.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit 2a4e35399f37caff111d420866a9d4beb494e2e9)
(Vipul: Fixed merge conflicts)
Conflicts:
drivers/crypto/caam/caamalg.c
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19801: Add support of tagged keys in caamalg
Franck LENORMAND [Fri, 5 Oct 2018 14:41:54 +0000 (16:41 +0200)]
MLK-19801: Add support of tagged keys in caamalg

A tagged key is a key which has been tagged with metadata
using tag_object.h API.

We add the support for these keys to caamalg.

For each algo of caamalg which supports tagged keys , it is done by:
 - Creating a modified version of the algo
 - Registering the modified version
 - When the modified transform is used, it gets
   the load parameter of the key.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit 88dee97d985890dbf37cafa7934c476d0ecfd0b3)
(Vipul: Fixed merge conflicts)
Conflicts:
drivers/crypto/caam/caamalg.c
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19801: Add tag functionality
Franck LENORMAND [Fri, 5 Oct 2018 14:08:25 +0000 (16:08 +0200)]
MLK-19801: Add tag functionality

Add functions to tag an object with metadata(configuration).

It is possible to:
 - create metadata:
- init_tag_object_header
- init_blackey_conf
- set_tag_object_conf
 - retrieve metadata:
- get_tag_object_conf
- get_blackey_conf

The API expects an object to be a space a memory
with an address and a size.

The implementation of the tag is currently exposed
but users shouldn't access it directly, they should
use the functions provided.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit ebbb132da8e7f9de7f3d375eff8d87f684feb1eb)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20142-2 PCI: imx: refine codes in the initialization
Richard Zhu [Tue, 29 Jan 2019 10:01:05 +0000 (15:31 +0530)]
MLK-20142-2 PCI: imx: refine codes in the initialization

- replace the sleep by the udelay, since it would be used
in the no_irq_suspend/resume callbacks.
- aligned the retries to the PHY_PLL_LOCK_WAIT_MAX_RETRIES

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
(Vipul: apply manually while rebase on v4.19)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19959 PCI: imx: make sure the sysfile api is add properly
Richard Zhu [Tue, 29 Jan 2019 09:52:15 +0000 (15:22 +0530)]
MLK-19959 PCI: imx: make sure the sysfile api is add properly

Make sure that the sysfile api of the pcie ep is add properly.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: apply manually whilre rebase on v4.19)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20346 usb: chipidea: change power_lost workqueue as freezable
Peter Chen [Fri, 16 Nov 2018 08:40:48 +0000 (16:40 +0800)]
MLK-20346 usb: chipidea: change power_lost workqueue as freezable

Like commit d144dfea8af7 ("usb: chipidea: otg: change workqueue
ci_otg as freezable"), the power_lost work item may try to remove
hcd if controller is powered off during the system suspend, and
the similar deadlock happens, see below dumps.

Meanwhile, with this change, we need to disable USB interrupt
during the work item runs (after driver resume has finished),
otherwise, USB transfer will be timeout (5s) due to USB interrupt
is disabled and IAA watchdog is still not ready at that time.

Workqueue: events ci_power_lost_work
Call trace:
[<ffff000008085c44>] __switch_to+0x8c/0xd0
[<ffff000008d7bbf4>] __schedule+0x19c/0x5d8
[<ffff000008d7c068>] schedule+0x38/0xa0
[<ffff000008d7f3b4>] schedule_timeout+0x19c/0x338
[<ffff000008d7cc10>] wait_for_common+0xa0/0x148
[<ffff000008d7cccc>] wait_for_completion+0x14/0x20
[<ffff0000080e6040>] flush_work+0xd8/0x1f0
[<ffff0000080e61f4>] flush_delayed_work+0x3c/0x48
[<ffff0000081ae1c8>] wb_shutdown+0x90/0xd0
[<ffff0000081ae688>] bdi_unregister+0x58/0x1c0
[<ffff000008413a60>] del_gendisk+0x218/0x228
[<ffff00000871683c>] sd_remove+0x64/0xc0
[<ffff0000086b6eec>] device_release_driver_internal+0x154/0x1f0
[<ffff0000086b6f9c>] device_release_driver+0x14/0x20
[<ffff0000086b5d40>] bus_remove_device+0xc8/0x108
[<ffff0000086b2a08>] device_del+0x1f8/0x300
[<ffff0000087049ec>] __scsi_remove_device+0xec/0x128
[<ffff000008702c70>] scsi_forget_host+0x70/0x78
[<ffff0000086f7ee8>] scsi_remove_host+0xa0/0x140
[<ffff0000088e0588>] usb_stor_disconnect+0x50/0xc0
[<ffff00000887eab8>] usb_unbind_interface+0x78/0x280
[<ffff0000086b6eec>] device_release_driver_internal+0x154/0x1f0
[<ffff0000086b6f9c>] device_release_driver+0x14/0x20
[<ffff0000086b5d40>] bus_remove_device+0xc8/0x108
[<ffff0000086b2a08>] device_del+0x1f8/0x300
[<ffff00000887c364>] usb_disable_device+0xa4/0x210
[<ffff000008872cfc>] usb_disconnect+0x7c/0x240
[<ffff000008872e40>] usb_disconnect+0x1c0/0x240
[<ffff000008878e10>] usb_remove_hcd+0xc0/0x1d8
[<ffff0000088e7bac>] host_stop+0x34/0x90
[<ffff0000088e4088>] ci_handle_id_switch+0x70/0x1d0
[<ffff0000088e3038>] ci_power_lost_work+0x90/0xa8
[<ffff0000080e7100>] process_one_work+0x1e0/0x340
[<ffff0000080e72b0>] worker_thread+0x50/0x458
[<ffff0000080ed32c>] kthread+0xfc/0x128
[<ffff000008084eb8>] ret_from_fork+0x10/0x18

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
(cherry picked from commit d217dacbe793641497b38f48d063a6332242e8a9)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20343 usb: chipidea: udc: using structure ci_hdrc device for runtime PM
Peter Chen [Wed, 14 Nov 2018 08:43:52 +0000 (16:43 +0800)]
MLK-20343 usb: chipidea: udc: using structure ci_hdrc device for runtime PM

At current code, it doesn't maintain ci->gadget.dev's runtime PM
status well. Eg, after system resume, call pm_runtime_put_sync for
ci->dev will cause ci->dev's runtime suspend is called if its
power.usage is 0 even the power.usage is 1 for its child ci->gadget.dev.
at that time. It causes the oops this ticket describes that visiting
clock without AHB clock.

To fix this issue, we use ci_hdrc device instead of ci->gadget.dev
for runtime PM APIs at udc driver, in the way, we handle runtime
PM APIs for single device structure.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
(cherry picked from commit d436b3a0a81b073b195d0ad29e7a4f39a1a532f3)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20158-3 usb: phy: mxs: add wakeup enable for imx7ulp
Peter Chen [Thu, 15 Mar 2018 08:56:41 +0000 (16:56 +0800)]
MLK-20158-3 usb: phy: mxs: add wakeup enable for imx7ulp

This wakeup setting can enable USB wakeup function even the
controller's power is lost, and both A7 and M4 are in VLLS mode.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20158-1 usb: chipidea: ci_hdrc_imx: restore pinctrl
Peter Chen [Thu, 1 Nov 2018 06:47:20 +0000 (14:47 +0800)]
MLK-20158-1 usb: chipidea: ci_hdrc_imx: restore pinctrl

The pinctrl setting may lost during the system suspend
(eg, imx7ulp), we need to restore it after system resume.
Meanwhile, some platforms may need to set special pinctrl
for power comsumption.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19240 usb: chipidea: udc: keep suspended after charger detection
Li Jun [Tue, 30 Oct 2018 01:44:47 +0000 (09:44 +0800)]
MLK-19240 usb: chipidea: udc: keep suspended after charger detection

If the otg port is only for charging, we don't need keep the usb
port active, so let's keep it suspended after charger detection.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20045-2 usb: chipidea: usbmisc_imx: delete the HSIC operation for imx7d
Peter Chen [Wed, 24 Oct 2018 07:21:41 +0000 (15:21 +0800)]
MLK-20045-2 usb: chipidea: usbmisc_imx: delete the HSIC operation for imx7d

For imx7d, no software operation is needed for HSIC controller, so delete
related operation.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20045-1 usb: chipidea: usbmisc_imx: using different .init for imx7ulp
Peter Chen [Wed, 24 Oct 2018 06:41:10 +0000 (14:41 +0800)]
MLK-20045-1 usb: chipidea: usbmisc_imx: using different .init for imx7ulp

imx7ulp uses different USB PHY with imx7d (MXS PHY vs PICO PHY), so the
features are supported by non-core register are a little different.
For example, autoresume feature is supported by all controllers for
imx7ulp, but for imx7d, it is only supported by non-HSIC controller.

Since imx7d has dedicated .init function, so the flag for imx7d PHY
(picophy) can be deleted.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20011-2 usb: chipidea: delete DP pullup for secondary charger detection
Peter Chen [Mon, 22 Oct 2018 08:20:02 +0000 (16:20 +0800)]
MLK-20011-2 usb: chipidea: delete DP pullup for secondary charger detection

Since the DP pullup can be finished at glue layer, we can delete
it at common code, but we still need to keep DP pulldown operation
since the DP may have already pulled up before.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20011-1 usb: chipidea: imx: using non-core register to pull up DP
Peter Chen [Mon, 22 Oct 2018 08:15:16 +0000 (16:15 +0800)]
MLK-20011-1 usb: chipidea: imx: using non-core register to pull up DP

For Samsung PHY SoCs (imx7d/imx845), we used core register usbcmd.rs
to pull up DP to finish the pre-condition for secondary USB charger
detection before. In fact, there are some non-core registers can
fulfill the same task, in that way, we could not touch the common
chipidea registers.

Meanwhile, we delete the secondary charger detection operation and
clean up related code.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19850-6 usb: chipidea: introduce flag for enable USB PHY charger detection
Peter Chen [Mon, 8 Oct 2018 09:43:45 +0000 (17:43 +0800)]
MLK-19850-6 usb: chipidea: introduce flag for enable USB PHY charger detection

Some platforms may want to use USB PHY charger detection function
when VBUS is there, add one flag for it. The user can enable it
at firmware.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19850-5 usb: chipidea: imx: using USB PHY charger structure for detection
Peter Chen [Mon, 8 Oct 2018 09:38:48 +0000 (17:38 +0800)]
MLK-19850-5 usb: chipidea: imx: using USB PHY charger structure for detection

We can assign the charger detection results for common USB PHY
structure directly now, so delete the imx usb charger structure.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
(Vipul: fixed merge conflicts)
Conflicts:
drivers/usb/chipidea/ci_hdrc_imx.c
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19850-4 usb: chipidea: udc: using USB PHY charger framework for detection
Peter Chen [Mon, 8 Oct 2018 09:33:58 +0000 (17:33 +0800)]
MLK-19850-4 usb: chipidea: udc: using USB PHY charger framework for detection

Some platforms (eg, imx6/imx7ulp/imx8qm) which implements charger
detection at USB PHY driver can use framework directly. Other
platforms (eg, imx7d/imx845) which do not implement charger detection
at their USB PHY driver, just assign the charger detection results
for usb_phy structure.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19850-1 usb: phy: mxs: add DCD implementation
Peter Chen [Tue, 29 Jan 2019 07:33:22 +0000 (13:03 +0530)]
MLK-19850-1 usb: phy: mxs: add DCD implementation

The DCD is a hardware IP in USB PHY which is used for USB charger
detection, we use polling method for charger detection in this
design to avoid unknown USB PHY interrupt. Currently, the
imx8qm, imx8qxp and imx7ulp have DCD module.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
(Vipul: apply manually while rebase on v4.19)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-17817-2: ASoC: imx-ak4458: enable 16 channels in TDM mode
Viorel Suman [Tue, 4 Dec 2018 15:03:20 +0000 (17:03 +0200)]
MLK-17817-2: ASoC: imx-ak4458: enable 16 channels in TDM mode

In TDM mode with Daisy Chain enabled (CPLD mode 0x04) DAC1 and DAC2
AK4458 codecs on audio board are able to play 16 channels, so extend
the TDM mode constraint to 16 channels.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit bc8b6a74175c2d120383875b00b5a2a44def9dd0)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-17817-1: ASoC: ak4458: enable daisy chain
Viorel Suman [Tue, 29 Jan 2019 06:54:38 +0000 (12:24 +0530)]
MLK-17817-1: ASoC: ak4458: enable daisy chain

Enable Daisy Chain if in TDM mode and the number of played
channels is bigger than the maximum supported number of channels.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 5ae97f159bfd9c4a37e7e60cd20aa3437041b251)
(Vipul: apply manually whilre rebase on v4.19)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20328-1: ASoC: fsl_sai: map number of pins to dataline masks
Viorel Suman [Wed, 21 Nov 2018 14:09:44 +0000 (16:09 +0200)]
MLK-20328-1: ASoC: fsl_sai: map number of pins to dataline masks

The patch enable mapping the number of pins required to play or record
a specific number of channels to a specific dataline mask.

Three consequent elements in "fsl,dataline" and "fsl,dataline,dsd" defines
a particular mapping, for instance for:
fsl,dataline = "0 0xff 0xff 2 0x11 0x11"
there are two mappings defined:

default (0 pins) "rx" and "tx" dataline masks: 0 0xff 0xff
         2 pins  "rx" and "tx" dataline masks: 2 0x11 0x11

In case if property is missing, then default value "0 0x1 0x1" is
considered.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 707fdf7759c0e11abf84573eb60bba104d681736)
(Vipul: Fixed merge conflicts)
Conflicts:
sound/soc/fsl/fsl_sai.c
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20428-2: ASoC: imx-cs42xx8: The FMT should be same for tx and rx
Shengjiu Wang [Thu, 22 Nov 2018 08:18:04 +0000 (16:18 +0800)]
MLK-20428-2: ASoC: imx-cs42xx8: The FMT should be same for tx and rx

If the FMT of tx and rx is different, there will be issue. for example
tx is working at TDM mode, but rx want to work at I2S mode, this case
is not supported in current ALSA driver, the best way to support this
is to distinguish substream in set_fmt function.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 897e9e8b4e7a59d81048d05f9377b8c68fc7cd64)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20428-1: ASoC: cs42xx8: add constraint for tdm mode
Shengjiu Wang [Wed, 21 Nov 2018 10:55:21 +0000 (18:55 +0800)]
MLK-20428-1: ASoC: cs42xx8: add constraint for tdm mode

TDM mode can only work with codec slave mode, and the mclk
frequency should be 256FS.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 769121ead6ef8919b7f6869defe594be978d82cd)
(Vipul: replace codec wirh component whire rebase on v4.19)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20434: ASoC: fsl_rpmsg_i2s: add more rates in constraint list
Shengjiu Wang [Wed, 21 Nov 2018 06:20:36 +0000 (14:20 +0800)]
MLK-20434: ASoC: fsl_rpmsg_i2s: add more rates in constraint list

add more rates in constraint list, Fixes commit ee959e2c9b18
("MLK-19581-3: ASoC: fsl_rpmsg_i2s: support multipul rate and DSD format")

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit bcc6185a392b46d2b5af315894b06e6ebaff8046)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20357-1: ASoC: imx-rpmsg: add audio routing for wm8960
Shengjiu Wang [Wed, 14 Nov 2018 06:49:34 +0000 (14:49 +0800)]
MLK-20357-1: ASoC: imx-rpmsg: add audio routing for wm8960

The rpmsg wm8960 codec driver is completed to support
full function, not only the volume control. which cause
an issue that there is no sound when recording, the reason
is that the MIC Bias not enabled, and it should be enabled
through audio routing.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoASoC: sgtl5000: avoid division by zero if lo_vag is zero
Colin Ian King [Thu, 6 Sep 2018 10:41:52 +0000 (11:41 +0100)]
ASoC: sgtl5000: avoid division by zero if lo_vag is zero

In the case where lo_vag <= SGTL5000_LINE_OUT_GND_BASE, lo_vag
is set to zero and later vol_quot is computed by dividing by
lo_vag causing a division by zero error.  Fix this by avoiding
a zero division and set vol_quot to zero in this specific case
so that the lowest setting for i is correctly set.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-20189-8: ASoC: fsl_sai: use signed offset variable
Viorel Suman [Tue, 13 Nov 2018 09:36:29 +0000 (11:36 +0200)]
MLK-20189-8: ASoC: fsl_sai: use signed offset variable

Both dataline_off and dataline_off_dsd fields are unsigned,
thus checking negative values make no sense. Use a signed
variable to calculate offset instead.

This fixes Coverity issue: CID1899299

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>