linux.git
6 years agoMLK-21140 i2c: rpmsg: ensure received bus_id and addr is same as sent
Clark Wang [Thu, 14 Mar 2019 07:28:59 +0000 (15:28 +0800)]
MLK-21140 i2c: rpmsg: ensure received bus_id and addr is same as sent

For some chips may need long time to get the response from M4 sometimes,
enlarge timeout to 500ms.

Add a judgement to check if the received data is the current transfer
wanted.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
(cherry picked from commit 222e201b520cbd01b611fc45ae2f6b2f0b9d73a1)

6 years agoMLK-21023 i2c: rpmsg-imx: add mutex lock when transfer i2c messages
Clark Wang [Tue, 5 Mar 2019 06:56:55 +0000 (14:56 +0800)]
MLK-21023 i2c: rpmsg-imx: add mutex lock when transfer i2c messages

I2c_lock_bus function in i2c-core-base will not stop the transfer to
different devices on different buses at the same time.

Since the multiple rpmsg i2c buses share one rpmsg channel, so it has to
add mutex to protect rpmsg resource accessing.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
(cherry picked from commit d592afe9018e193f675b8c710fb1e66e44851ec8)

6 years agoMLK-20993 i2c: rpmsg: add a BUG_ON to catch alias id issue
Peng Fan [Wed, 27 Feb 2019 01:35:35 +0000 (09:35 +0800)]
MLK-20993 i2c: rpmsg: add a BUG_ON to catch alias id issue

The alias ID must be defined in device tree, because
that will be used as BUS ID to Cortex M4. If the alias ID
not defined, linux kernel will automatically allocate one
ID which might not be the same number used in Cortex M4 and
Cortex M4 will not send msg to I2C controller.

So let's add BUG_ON to catch issue as earlier as possible to avoid
wasting efforts.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Clark Wang <xiaoning.wang@nxp.com>
(cherry picked from commit b9ff20355040d4bece8357a0af31bc5fca191cee)

6 years agoMLK-20940-1 i2c: busses: Add virtual i2c driver based on rpmsg
Clark Wang [Mon, 18 Feb 2019 08:55:09 +0000 (16:55 +0800)]
MLK-20940-1 i2c: busses: Add virtual i2c driver based on rpmsg

Add virtual i2c driver to send SRTM i2c messages to M4.
Each virtual I2C bus has a specal bus id, which is abstracted by M4.
Each SRTM message include a bus id for the bus which the device is on.

Virtual i2c rpmsg bus will bind rpbus nodes with compatible string
"fsl,i2c-rpbus". And "rpmsg-i2c-channel" will probe only one rpmsg
channel for all rpbuses.

This virtual i2c driver depends on CONFIG_I2C and CONFIG_RPMSG.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
(cherry picked from commit 9feeac93a7d91ce67537a8a6c67e624eb7986a01)

6 years agoMLK-21279 drm/bridge: it6263: Staticize it6263_mode_valid()
Liu Ying [Thu, 28 Mar 2019 09:44:49 +0000 (17:44 +0800)]
MLK-21279 drm/bridge: it6263: Staticize it6263_mode_valid()

It is only used in this file, so staticize it.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit e293f8671509ed54c83a51b40da53da3bdf216f5)

6 years agoMLK-21027 drm/bridge: it6263: Reset LVDS some times to wait for in-video stable
Liu Ying [Tue, 5 Mar 2019 07:30:41 +0000 (15:30 +0800)]
MLK-21027 drm/bridge: it6263: Reset LVDS some times to wait for in-video stable

Unstable/low quality input video signal is likely to cause the transmitter
to fail to wait for input video stable, and thus, no HDMI/DVI video output.
It turns out resetting LVDS part logics may help prevent the issue from
happening.

Cc: Sandor Yu <Sandor.yu@nxp.com>
Cc: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 5d09098ed14b1199fd1983be8824517c843d46b2)

6 years agoMLK-19485 drm/bridge: it6263: Change LVDS I2C device to be dummy
Liu Ying [Mon, 10 Sep 2018 05:54:37 +0000 (13:54 +0800)]
MLK-19485 drm/bridge: it6263: Change LVDS I2C device to be dummy

The it6263 bridge contains two I2C devices on the same I2C bus
to control HDMI and LVDS modules respectively.  However, they
have different I2C addresses.  Thus, one of the two devices should
be registered as dummy device and bound with dummy driver.  This
is what the helper i2c_new_dummy() is designed for.  The HDMI I2C
device is normally registered as a real I2C device and bound with
a real driver, so the LVDS I2C device should be dummy.

This patch fixes the issue to access the LVDS I2C device's sys nodes,
like /sys/kernel/debug/regmap/2-0033/name.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit f6b3131538de3f25e60a25d85d05d99a4fda680a)

6 years agoMLK-18507 drm/bridge: it6263: Filter out known bad display modes
Liu Ying [Thu, 14 Jun 2018 09:41:58 +0000 (17:41 +0800)]
MLK-18507 drm/bridge: it6263: Filter out known bad display modes

It turns out the following display modes are not well supported
by the bridge - 1600x900@60, 1280x1024@60, 1280x720@30/25/24
and 1152x864@75.  Fortunately, they are not that widely used.
So, list them as the known bad display modes and filter them out
in ->mode_valid().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit c44ed03cf3b85d7f5bc8325ffeec9fd07f66aa87)
(cherry picked from commit 20e29dd98823a19ec3e38fbdcf86b6983268c657)

6 years agoMLK-18297 drm/bridge: it6263: Sleep between status reads in connector detect
Leonard Crestez [Mon, 14 May 2018 03:24:30 +0000 (11:24 +0800)]
MLK-18297 drm/bridge: it6263: Sleep between status reads in connector detect

There are some issues with the HDMI connection on it6263 being slow to
come up. There is a hack there which reads the register multiple times
but it doesn't seem to be sufficient. This is particularly a problem
when inside a xen guest.

Improve this workaround by reading the status multiple times every few
5-10ms and returning connector_status_connected if any of those reads
sees HPDETECT.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 699ccad27c5476746e0b2c5da25c5a98e6ffab3f)

6 years agoMLK-17275-2: drm/bridge: it6263: Add support for OF_DYNAMIC
Robert Chiras [Thu, 21 Dec 2017 09:04:22 +0000 (11:04 +0200)]
MLK-17275-2: drm/bridge: it6263: Add support for OF_DYNAMIC

When CONFIG_OF_DYNAMIC is used, and this driver is enabled in
devicetree, but fails to probe a physical i2c client, it should disable
it's remote endpoint, so that the DRM master device won't fail to bind
the other available devices.
Usually, the remote endpoint of this device is a DRM encoder. If a DRM
encoder fails to bind, the DRM master device will also fail to bind.
This is why, we should disable the encoder node dynamically in
devicetree.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
(cherry picked from commit de618474e2edebad2c35df322057b6267cd1685b)

6 years agoMLK-16524 drm/bridge: it6263: Fix incorrect colors
Oliver Brown [Thu, 21 Sep 2017 12:39:18 +0000 (07:39 -0500)]
MLK-16524 drm/bridge: it6263: Fix incorrect colors

This addresses a problem with colors that are sometimes incorrect after
startup. Now the AVI packet is initialized with RGB color space rather
than relying on the default.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
(cherry picked from commit c1f73434f6d1ab4421020350ef0524d3ac30c703)

6 years agoMLK-16240 drm/bridge: it6263: Don't use freed edid structure in ->get_modes()
Liu Ying [Tue, 22 Aug 2017 07:54:57 +0000 (15:54 +0800)]
MLK-16240 drm/bridge: it6263: Don't use freed edid structure in ->get_modes()

We call the helper drm_detect_hdmi_monitor() to check if the EDID blob read
from a monitor indicates the monitor is connected via HDMI or not.  We pass
an edid structure to the helper.  However, the structure has been freed
before we use it.  This patch moves the helper up before the structure is
freed to fix the issue.

Fixes: a5c01aa91842 ("MLK-15001-25 drm/bridge: Add ITE IT6263 LVDS to HDMI transmitter support")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 3522359b02888370d910aa59646bac5824f7a0d3)

6 years agoMLK-16207-2 drm/bridge: it6263: 2nd time to workaround cable detection failure
Liu Ying [Thu, 17 Aug 2017 05:55:53 +0000 (13:55 +0800)]
MLK-16207-2 drm/bridge: it6263: 2nd time to workaround cable detection failure

There is cable detection failure issue on i.MX8qxp MEK platform at boot
time when we use single LVDS to HDMI display.  The workaround is to read
the cable detection status for even more times.  Based on experiments, it
looks reading for 90 times works.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 5ac4dfb7b6b2a75f1167cf773e4cef00ed49124a)

6 years agoMLK-16207-1 drm/bridge: it6263: Add gpio reset support
Liu Ying [Tue, 15 Aug 2017 07:59:44 +0000 (15:59 +0800)]
MLK-16207-1 drm/bridge: it6263: Add gpio reset support

A low pulse whose width is at least 40ms on pin SYSRSTN
may reset the bridge, according to the chip maker.
This patch adds gpio reset support for the bridge.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 2e120abcef4da663bc63f42a017697c937205598)

6 years agoMLK-16183 drm/bridge: it6263: Workaround cable detection failure at boot time
Liu Ying [Thu, 10 Aug 2017 07:26:09 +0000 (15:26 +0800)]
MLK-16183 drm/bridge: it6263: Workaround cable detection failure at boot time

There is cable detection failure issue on i.MX8qxp arm2 platform
at boot time when we avoid imx-drm deferral probe entirely(i2c
bus driver probe needs to be before the it6263 driver probe).
The workaround is to read the cable detection status multiple
times.  Based on experiments, it looks reading for 40 times works.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit fb719c95e4b7e157c48022eb0295ef517166d944)

6 years agoMLK-15001-25 drm/bridge: Add ITE IT6263 LVDS to HDMI transmitter support
Liu Ying [Mon, 27 Mar 2017 09:26:59 +0000 (17:26 +0800)]
MLK-15001-25 drm/bridge: Add ITE IT6263 LVDS to HDMI transmitter support

This patch adds IT6263 video support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit bf1acefa6ef424caa4c0b37ae022d25c1028984f)

6 years agoMLK-20702 drm/panel: simple: Fix a minor typo in a piece of comment
Liu Ying [Wed, 9 Jan 2019 02:40:45 +0000 (10:40 +0800)]
MLK-20702 drm/panel: simple: Fix a minor typo in a piece of comment

s/in pratical/in practice

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 15bcff90136b55cc91678ff6e92de6ee1cc3e884)

6 years agoMLK-17022 drm/panel: panel-simple: Correct JDI TX26D202VM0BWA panel display timing...
Liu Ying [Wed, 29 Nov 2017 06:10:16 +0000 (14:10 +0800)]
MLK-17022 drm/panel: panel-simple: Correct JDI TX26D202VM0BWA panel display timing flags

The JDI TX26D202VM0BWA panel works in data enable(DE) mode.
Apparently, the panel's data enable signal is active high
according to the panel spec.  This patch corrects the DE
signal polarity from active low to active high.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit ed0230ec262dd0db3cd4c0fac0777e19424a8c30)

6 years agoMLK-16973-2 drm/panel: simple: Add support for JDI TX26D202VM0BWA panel
Liu Ying [Mon, 20 Nov 2017 07:40:19 +0000 (15:40 +0800)]
MLK-16973-2 drm/panel: simple: Add support for JDI TX26D202VM0BWA panel

This patch adds support for Japan Display Inc. 10.1" TX26D202VM0BWA
WUXGA(1920x1200) TFT LCD panel with LVDS interface.
The panel has dual LVDS channels.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 6e097872d23cb5a50e273bf9f17dbafb225ab03a)

6 years agoMLK-20486 drm/imx: ldb: Cleanup enc&conn in ->unbind() if necessary
Liu Ying [Wed, 28 Nov 2018 08:54:08 +0000 (16:54 +0800)]
MLK-20486 drm/imx: ldb: Cleanup enc&conn in ->unbind() if necessary

When the master imx-drm-core binding fails, component_bind_all()
in imx-drm-core ->bind() callback will unbind all bound components
first and then call drm_mode_config_cleanup().  Since the encoder
and connector(located in imx_ldb.imx_ldb_channel) are freed after
the ldb ->unbind() callback, drm_mode_config_cleanup() would
accidentally access the freed encoder and connector again.  To fix
this issue, we should cleanup the encoder and connector, i.e.,
remove them from the global encoder and connector lists, in the
->unbind() callback, so that, drm_mode_config_cleanup() won't find
them again in the lists.  However, we have to make sure they exist
before the cleanup in the ->unbind() callback, because imx-drm-core
->unbind() calls drm_mode_config_cleanup() first and then unbinds
all components via component_unbind_all().  Moreover, the connector
isn't created at the first place if a bridge exists, so the check
before the cleanup makes sense for this reason as well.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit a39bb207c172f678ce8a0aec697770dd1bdb0652)

6 years agoMLK-20287 drm/imx: ldb: Check retval of sc_misc_set_control in ldb_pixel_link_init
Liu Ying [Thu, 8 Nov 2018 09:01:56 +0000 (17:01 +0800)]
MLK-20287 drm/imx: ldb: Check retval of sc_misc_set_control in ldb_pixel_link_init

The return value of sc_misc_set_control() should be checked in
ldb_pixel_link_init(), instead of being ignored.  This patch
fixes this issue.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 7c902e398dc3a4d6a77ba87b1ea1aaed906c8c50)

6 years agoMLK-20152 drm/imx: ldb: Correct ch0/1_mode for variants without mux
Liu Ying [Tue, 6 Nov 2018 07:46:40 +0000 (15:46 +0800)]
MLK-20152 drm/imx: ldb: Correct ch0/1_mode for variants without mux

Unlike i.MX6qdl and i.MX53 LDB variants, the i.MX8 LDB variants(i.MX8qxp
and i.MX8qm) in existence don't have frontend mux, thus, we should split
the logic to program the ch0/1_mode for variants w/wo the mux.  It turns
out LDB_CH0_MODE_EN_TO_DI0 can be used for channel0 in both LDB single
mode and LDB split mode for the i.MX8 LDB variants.  However, based on
test results, for i.MX8qm LDB channel1, LDB_CH1_MODE_EN_TO_DI1 has to be
used in single mode, while, i.MX8qxp may work with LDB_CH1_MODE_EN_TO_DI0
or LDB_CH1_MODE_EN_TO_DI1.  With LDB_CH1_MODE_EN_TO_DI0, i.MX8qm LDB
channel1 would output wrong image in single mode(it looks like color
is wrong based on test results).  The i.MX8 LDB variants channel1 mode
can still be LDB_CH1_MODE_EN_TO_DI0 in split mode(the patch doesn't
touch this).  In essence, this patch fixes the channel1 single mode for
i.MX8qm LDB by correcting the ch1_mode, while all other features
should work as before.  Note that due to hardware issue, we didn't test
the channel1 single mode for i.MX8qm.  We need to populate several
resistors to enable the connectors driven by channel1 in single mode
for either ARM2 platform or MEK board.  Tests are done with IT6263
LVDS to HDMI transmitter driven by LDB0 channel1 after r206, r207, r208
and r209 are populated on the i.MX8qm MEK board.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit d9b35ed0a10275e41bbcc4981c69167159bd2bb4)

6 years agoMLK-18576-3 drm/imx: ldb: Add dual channel mode support for i.MX8dx/dxp/qxp
Liu Ying [Thu, 4 Apr 2019 03:32:01 +0000 (11:32 +0800)]
MLK-18576-3 drm/imx: ldb: Add dual channel mode support for i.MX8dx/dxp/qxp

i.MX8dx/dxp/qxp use two LDBs(one primary, one auxiliary) to support
dual channel mode.  This patch adds the dual channel mode support
for i.MX8dx/dxp/qxp.  Note that the drivers contain specific sequence
needed by this mode - LDB VSYNC polarity and channel selection settings
should be configured into the register a bit earlier in ->atomic_mode_set
instead of in ->enable, and DC subsystem pixel link enablement is moved
from the DPU driver to the LDB driver to make sure it happens later
than LDB clocks enablement in ->enable.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 3b6fc6c957cd937b281f937fdf1a207ec4a35313)

6 years agoMLK-18576-1 dt-bindings: display: imx: ldb: Add aux prop descriptions
Liu Ying [Tue, 12 Jun 2018 07:18:12 +0000 (15:18 +0800)]
MLK-18576-1 dt-bindings: display: imx: ldb: Add aux prop descriptions

i.MX8qxp uses two LDB(one primary, one auxiliary) to support dual
channel mode.  This patch adds DT property descriptions for those
properties needed by this case.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit d07d63c135b18000cee1d14be2e257d2f791e574)

6 years agoMLK-17023 drm/imx: ldb: Align HSYNC and VSYNC polarities with PHY in DE mode
Liu Ying [Wed, 29 Nov 2017 06:19:46 +0000 (14:19 +0800)]
MLK-17023 drm/imx: ldb: Align HSYNC and VSYNC polarities with PHY in DE mode

When an external display device works in data enable(DE) mode,
it usually provides video mode(s) without HSYNC and VSYNC
polarities via display flags.  In this case, the controller(LDB)
and the LVDS PHY still need to align the two signal polarities
with each other respectively.  Otherwise, polarities generated
by default register values may cause mismatch polarities and
display artifacts.  With the DE mode JDI TX26D202VM0BWA panel,
we see vertical lines(very likely, only one) at the left boundary
are missing sometimes, which is caused by this mismatch.  This
patch replaces the default polarity status with explicit active
high in DE mode to fix the issue.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 69f6ca59c538653dc0d27135b3654809a178ef52)

6 years agoMLK-16812 drm/imx: ldb: Let system PM behave properly when we are unbinded
Liu Ying [Tue, 14 Nov 2017 05:28:41 +0000 (13:28 +0800)]
MLK-16812 drm/imx: ldb: Let system PM behave properly when we are unbinded

The system power management operations should get correct driver data
before going on to further handling.  When the component is unbinded,
driver data should be set to NULL so that the system power management
may be bypassed(return early).  This way, we may prevent the system power
management from using any invalid driver data.

Fixes: 915ac0ad7369 ("MLK-16581-7 drm/imx: ldb: Add system power management support")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 91033d8707a92e089fbe0b9cb48565d2c8581659)

6 years agoMLK-16581-7 drm/imx: ldb: Add system power management support
Liu Ying [Fri, 13 Oct 2017 05:22:16 +0000 (13:22 +0800)]
MLK-16581-7 drm/imx: ldb: Add system power management support

This patch adds system power management support for imx-ldb drm driver
by proper PHY power/exit/init handling where necessary and pixel link
re-initialization in the resume operation.  The driver depends on the
imx-drm core driver to handle ldb bridge power management operations.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 1e83202addd99f1b064a346c00cda75cdd611fd0)

6 years agoMLK-16581-3 drm/imx: ldb: Get bypass & pixel clock rates before setting their rates
Liu Ying [Fri, 13 Oct 2017 04:30:46 +0000 (12:30 +0800)]
MLK-16581-3 drm/imx: ldb: Get bypass & pixel clock rates before setting their rates

Due to i.MX8 clock issue, we need to get bypass and pixel clock rates
before setting their rates when system resumes back from PM sleep mode,
otherwise, we'll fail to set the clock rates.  So, this is a workaround
and it can be removed when the clock issue is properly fixed.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 17b68807bd789e4efccda7f06d2268e845527f9e)

6 years agoMLK-16036 drm/imx: ldb: Avoid early return when getting aux PHY in dual mode
Liu Ying [Thu, 20 Jul 2017 02:19:43 +0000 (10:19 +0800)]
MLK-16036 drm/imx: ldb: Avoid early return when getting aux PHY in dual mode

In dual mode, we return too early from ->bind when we get
the auxiliary channel's PHY.  This causes we miss the logics
to set driver data, get ldb alias id and initialize pixel
link(if necessary).  This patch fixes the issue here by
tweaking the driver logic to do component binding properly.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 94bf9cef6af433f88aedd618e01db348dadfa053)

6 years agoMLK-16015-6 drm/imx: ldb: Add pixel link validate/invalidate logics
Liu Ying [Tue, 18 Jul 2017 07:10:55 +0000 (15:10 +0800)]
MLK-16015-6 drm/imx: ldb: Add pixel link validate/invalidate logics

To enable or disable a display safely, we need to validate pixel link
after the relevant ldb channel is enabled and invalidate pixel link
before the channel is disabled.  These operations are recommended
by the design team.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 5fab9a747137eaec8562897800abccd1da5dbc11)

6 years agoMLK-16015-5 drm/imx: ldb: Specify pixel link quirks to be initialization related
Liu Ying [Tue, 18 Jul 2017 07:19:16 +0000 (15:19 +0800)]
MLK-16015-5 drm/imx: ldb: Specify pixel link quirks to be initialization related

This patch specifies the existing pixel link quirks is initialization related.
This may help us distinguish between the pixel link quirks and another one
up-coming which is validation and invalidation related.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 8433571e4f3db66fc07b990fd0e33de547e0aef7)

6 years agoMLK-17750: drm/imx: ldb: Fix build on imx6/7
Leonard Crestez [Fri, 9 Feb 2018 14:54:55 +0000 (16:54 +0200)]
MLK-17750: drm/imx: ldb: Fix build on imx6/7

This code is enabled in upstream imx_v6_v7_defconfig but fails to build
because of sc api calls. Fix this by adding ifdef checks to pixel_link
code.

Check for CONFIG_HAVE_IMX8_SOC becuase it is selected by both 8qm and
8qx.

These calls are already guarded at runtime with checks for devtype
pixel_link_valid_quirks so the empty ifdefed functions will never get
called anyway.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
It might make sense to add a dedicated config option for SC api
like CONFIG_HAVE_IMX_SCU, right now drivers/soc/imx/sc is guarded by
CONFIG_ARCH_FSL_IMX8QM which means you can't build 8qxp separately.

(cherry picked from commit a928239dffb3bf5232340eeb24fb583e4b2635b6)

6 years agoMLK-15001-23 drm/imx: ldb: Add i.MX8qxp LDB support
Liu Ying [Mon, 12 Jun 2017 05:34:26 +0000 (13:34 +0800)]
MLK-15001-23 drm/imx: ldb: Add i.MX8qxp LDB support

This patch adds i.MX8qxp LDB support.
Logics are added to make i.MX8qxp LDB cope with Mixel LVDS combo PHY.
Also, logics are added to handle pixel link quirks for i.MX8qxp LDB.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 086248a0dc2a4291577c3b3eb58fb0b17669d037)

6 years agoMLK-15001-21 drm/imx: ldb: Add i.MX8qm LDB support
Liu Ying [Fri, 2 Jun 2017 09:46:12 +0000 (17:46 +0800)]
MLK-15001-21 drm/imx: ldb: Add i.MX8qm LDB support

This patch adds i.MX8qm LDB support.
Logics are added to make i.MX8qm LDB cope with Mixel LVDS PHY.
Also, logics are added to handle pixel link padding quirks for i.MX8qm LDB.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit d8e089c7a45ce66c34db8682435bf31ad7be148a)

6 years agoRevert "drm/imx: imx-ldb: disable LDB on driver bind"
Jason Liu [Mon, 29 Oct 2018 02:50:30 +0000 (10:50 +0800)]
Revert "drm/imx: imx-ldb: disable LDB on driver bind"

This reverts commit a43eac2d855be9f441b0c6e277bdaf878b07a370.
This patch break the i.MX8, revert it firstly.

(cherry picked from commit a1bfd5b69de88fad01de507c09e69e9a5c590f40)

6 years agoMLK-16581-2 phy: mixel-lvds-combo: Get PHY clock rate before setting it's rate
Liu Ying [Fri, 13 Oct 2017 03:47:51 +0000 (11:47 +0800)]
MLK-16581-2 phy: mixel-lvds-combo: Get PHY clock rate before setting it's rate

Due to i.MX8 clock issue, we need to get PHY clock rate
before setting it's rate when system resumes back from
PM sleep mode, otherwise, we'll fail to set the clock rate.
So, this is a workaround and it can be removed when
the clock issue is properly fixed.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit fca3d4b1074fbc3ca74db040f6abdf9b614df819)

6 years agoMLK-16581-1 phy: mixel-lvds: Get PHY clock rate before setting it's rate
Liu Ying [Fri, 13 Oct 2017 03:37:18 +0000 (11:37 +0800)]
MLK-16581-1 phy: mixel-lvds: Get PHY clock rate before setting it's rate

Due to i.MX8 clock issue, we need to get PHY clock rate
before setting it's rate when system resumes back from
PM sleep mode, otherwise, we'll fail to set the clock rate.
So, this is a workaround and it can be removed when
the clock issue is properly fixed.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit f9709fbf36495c7139ac55a0ecc01b30303b427b)

6 years agoMLK-21378-5 gpu: imx: Add dpu KMS support
Liu Ying [Wed, 3 Apr 2019 07:36:25 +0000 (15:36 +0800)]
MLK-21378-5 gpu: imx: Add dpu KMS support

Fast-forward dpu KMS driver from imx_4.14.y.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21378-4 gpu: imx: Add dpu common support
Liu Ying [Wed, 3 Apr 2019 07:13:43 +0000 (15:13 +0800)]
MLK-21378-4 gpu: imx: Add dpu common support

Fast-forward dpu common driver from imx_4.14.y.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21378-3 gpu: imx: Add imx8_pc support
Liu Ying [Wed, 3 Apr 2019 07:06:12 +0000 (15:06 +0800)]
MLK-21378-3 gpu: imx: Add imx8_pc support

Fast-forward imx8_pc driver from imx_4.14.y.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21378-2 gpu: imx: Add imx8_dprc support
Liu Ying [Wed, 3 Apr 2019 06:48:39 +0000 (14:48 +0800)]
MLK-21378-2 gpu: imx: Add imx8_dprc support

Fast-forward imx8_dprc driver from imx_4.14.y.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21378-1 gpu: imx: Add imx8_prg support
Liu Ying [Wed, 3 Apr 2019 06:13:10 +0000 (14:13 +0800)]
MLK-21378-1 gpu: imx: Add imx8_prg support

Fast-forward imx8_prg driver from imx_4.14.y.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21296 clk: imx8mm: Remove CLK_SET_RATE_GATE from arm_a53_div
Leonard Crestez [Tue, 2 Apr 2019 12:39:15 +0000 (15:39 +0300)]
MLK-21296 clk: imx8mm: Remove CLK_SET_RATE_GATE from arm_a53_div

On recent kernels clks which are marked with CLK_SET_RATE_GATE are
"protected" against further changes at clk_prepare time. This
clk_core_rate_protect propagates up the clk tree and causes cpufreq
switches to fail later on.

See drivers/clk/clk.c around line 770.

Fix this by removing the CLK_SET_RATE_GATE flag for this specific clk.
This is safe because a53 clks are always only manipulated through
cpufreq.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
6 years agoMLK-20191-2: media: mxc: fix potential null pointer dereferencing
Guoniu.Zhou [Wed, 3 Apr 2019 08:21:56 +0000 (16:21 +0800)]
MLK-20191-2: media: mxc: fix potential null pointer dereferencing

CID 17797 and 3275140: fix potential null pointer dereferencing.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-20191-1: media: mxc: fix unsigned compare
Guoniu.Zhou [Wed, 3 Apr 2019 08:13:44 +0000 (16:13 +0800)]
MLK-20191-1: media: mxc: fix unsigned compare

Fix coverity CID 17388, 17389 and 17363 issue
Because the type of variable is unsigned, so compare with zero is no
effect

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-21317 drm/imx: core: fix dangling pointer use of 'drm_device'
Fancy Fang [Wed, 3 Apr 2019 07:57:34 +0000 (15:57 +0800)]
MLK-21317 drm/imx: core: fix dangling pointer use of 'drm_device'

When any fail happens during master's '>bind()' function, the
drm_device' pointer data which is set to the device driver data
will be put and freed. But if later, system suspend is called,
the freed 'drm_device' pointer will be used again.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-21309: dma: engine: sdma: add uart rom script
Robin Gong [Tue, 2 Apr 2019 07:19:43 +0000 (15:19 +0800)]
MLK-21309: dma: engine: sdma: add uart rom script

For syncing with unstreaming kernel on UART driver from 4.19 changed
to rom script for uart rx path, and the compatiblity of legacy kernel
using ram script, add both uart rom and ram script support, so add
rom script address.

ram script:
uart_2_mcu_fix_addr
uartsh_2_mcu_fix_addr /* through spba bus */
rom script:
uart_2_mcu_addr
uartsh_2_mcu_addr /* through spba bus */

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
6 years agoMLK-21252 drm/bridge: sec-dsim: resolve OVERFLOW_BEFORE_WIDEN warns
Fancy Fang [Sat, 30 Mar 2019 14:47:54 +0000 (22:47 +0800)]
MLK-21252 drm/bridge: sec-dsim: resolve OVERFLOW_BEFORE_WIDEN warns

Coverity reports the 'OVERFLOW_BEFORE_WIDEN' warns which can
cause potential expression overflow for multiplying two 32bit
integers and assign the result to a 64bit integer, since no
automatic integer type promotion exists before the multiply
operation, so requires explicit type casting for either one
of operands.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-21299 ARM64: dts: imx8mm-evk: add interrupt support for ADV7535
Fancy Fang [Fri, 29 Mar 2019 12:31:59 +0000 (20:31 +0800)]
MLK-21299 ARM64: dts: imx8mm-evk: add interrupt support for ADV7535

Add interrupt and related pinctrl properties for ADV7535,
the interrupt can be used for hotplug, edid ready and etc
in the adv bridge driver.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoASoC: fsl_spdif: add missing PLL initialization part
Viorel Suman [Tue, 2 Apr 2019 06:59:46 +0000 (09:59 +0300)]
ASoC: fsl_spdif: add missing PLL initialization part

Add missing PLL initialization part in probe.

Fixes: bbbb22d49397774e1a009f1023e6b66e72e5ccf7
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoMLK-18574: ASoC: fsl_spdif: support 192kHz for rx in imx8
Shengjiu Wang [Mon, 11 Jun 2018 07:54:03 +0000 (15:54 +0800)]
MLK-18574: ASoC: fsl_spdif: support 192kHz for rx in imx8

The ipg clock is higher enough to support 192kHz in imx8

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 8b43702a18134ce837e36650d6b6e4ddffd12cea)

6 years agoMLK-18574: ASoC: fsl_spdif: specify the spdif in imx8mm
Shengjiu Wang [Tue, 12 Jun 2018 07:46:27 +0000 (15:46 +0800)]
MLK-18574: ASoC: fsl_spdif: specify the spdif in imx8mm

specify the spdif in imx8mm for the ipg clock is higher that
it can support 192kHz

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit bfae9cfe49f5176ad816bf98d076ba7b0fc95593)

6 years agoMLK-17089-4: ASoC: fsl_spdif: support suspend & resume for imx8
Shengjiu Wang [Wed, 6 Dec 2017 02:42:30 +0000 (10:42 +0800)]
MLK-17089-4: ASoC: fsl_spdif: support suspend & resume for imx8

Base on latest power management design in MLK-17074, every driver
need to enter runtime suspend state in suspend, so the driver should
call the pm_runtime_force_suspend in suspend. with this implementation
the suspend function almost same as runtime suspend function. so remove
the suspend function, just use pm_runtime_force_suspend instead.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 506b53cd11020024bf444167781b3a590348434c)

6 years agoASoC: fsl: micfil: use component API
Viorel Suman [Mon, 1 Apr 2019 14:15:33 +0000 (17:15 +0300)]
ASoC: fsl: micfil: use component API

Use component API.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoMLKU-24 ASoC: micfil: fix identation issue
Cosmin-Gabriel Samoila [Thu, 13 Dec 2018 13:09:46 +0000 (15:09 +0200)]
MLKU-24 ASoC: micfil: fix identation issue

Fix identation issue.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit f6869d289a3d1bbbb38eefaf79e458fb620f887d)

6 years agoMLKU-24-10 sound: asoc: change License comment to SPDX format
Cosmin-Gabriel Samoila [Wed, 21 Nov 2018 09:20:33 +0000 (11:20 +0200)]
MLKU-24-10 sound: asoc: change License comment to SPDX format

Change source and header License comment to SPDX format.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit a0953e2a808fc3dbdacdfb959f121d24d7ddf4c2)

6 years agoMLKU-24-9 sound: soc: fix unused warning
Cosmin-Gabriel Samoila [Tue, 20 Nov 2018 12:21:45 +0000 (14:21 +0200)]
MLKU-24-9 sound: soc: fix unused warning

When CONFIG_PM is not defined, the runtime suspend and resume
are unused so we should use __maybe_unused attribute.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 2d68f7ccaae4e787072724445af3a46e51aba3ad)

6 years agoMLKU-24-8 sound:asoc: change soc_enum array to single enums
Cosmin-Gabriel Samoila [Wed, 14 Nov 2018 12:50:26 +0000 (14:50 +0200)]
MLKU-24-8 sound:asoc: change soc_enum array to single enums

It is error prone to use soc_enum array for controls because introducing
new controls must always be done at the end of array or it will add
offset to existing controls.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 08004f69efadd4b0631c2759a171811885ac8bbd)

6 years agoMLKU-24-7 sound:asoc: fix checkpatch paranthesis error
Cosmin-Gabriel Samoila [Wed, 14 Nov 2018 13:09:31 +0000 (15:09 +0200)]
MLKU-24-7 sound:asoc: fix checkpatch paranthesis error

Remove paranthesis that are not needed.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 24f3cee476a47145a30b2d1bf5ac315ae803c176)

6 years agoMLKU-24-6 sound:asoc: remove comented code
Cosmin-Gabriel Samoila [Wed, 14 Nov 2018 13:07:06 +0000 (15:07 +0200)]
MLKU-24-6 sound:asoc: remove comented code

Remove unused commented code.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 16ffacb71902f787af4e6195d2c0877fa39a1501)

6 years agoMLKU-24-5 sound:asoc: remove multiple empty rows
Cosmin-Gabriel Samoila [Wed, 14 Nov 2018 13:06:10 +0000 (15:06 +0200)]
MLKU-24-5 sound:asoc: remove multiple empty rows

Fix checkpatch error by removin extra empty rows.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit ac19946a883a754f65143f40b448719c9d4b1164)

6 years agoMLKU-24-4 sound:asoc: fix checkpatch braces error
Cosmin-Gabriel Samoila [Wed, 14 Nov 2018 13:04:31 +0000 (15:04 +0200)]
MLKU-24-4 sound:asoc: fix checkpatch braces error

Braces {} are not necessary for single statement blocks.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 70bb5d3352894c145f3aa8959963a061d023c769)

6 years agoMLKU-24-3 sound:asoc: fix missing space after if checkpatch errors
Cosmin-Gabriel Samoila [Wed, 14 Nov 2018 13:01:23 +0000 (15:01 +0200)]
MLKU-24-3 sound:asoc: fix missing space after if checkpatch errors

In order to upstream the micfil driver, we need to fix
missing space after if errors and warnings reported
by checkpatch.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit d24e03b63cd428e0ba1e79f617f48106d11bb3db)

6 years agoMLKU-24-2 sound:asoc: fix line over 80 char errors
Cosmin-Gabriel Samoila [Wed, 14 Nov 2018 12:58:46 +0000 (14:58 +0200)]
MLKU-24-2 sound:asoc: fix line over 80 char errors

In order to upstream the micfil driver, we need to fix
line over 80 characters errors and warnings reported
by checkpatch.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 5c09dded509ff579cba4897db336765de795196b)

6 years agoMLKU-24-1 sound:asoc: fix alignment and code indent errors
Cosmin-Gabriel Samoila [Wed, 14 Nov 2018 12:55:15 +0000 (14:55 +0200)]
MLKU-24-1 sound:asoc: fix alignment and code indent errors

In order to upstream the micfil driver, we need to fix allignment
and code indent errors and warnings reported by checkpatch.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit b044c83f592617b2d3011a1759db90f378ccd645)

6 years agoMLK-20308 sound:asoc: fix re-enablement bug
Cosmin-Gabriel Samoila [Tue, 13 Nov 2018 12:34:36 +0000 (14:34 +0200)]
MLK-20308 sound:asoc: fix re-enablement bug

When hwvad is enabled, if you try to re-enable it again, it should fail.
However, we were also double setting state to OFF on fail, which is
wrong because it resets the state and allows the second retry to enable
even if it wasn't disabled before.
Now we only return EBUSY.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
(cherry picked from commit 1ef8c4696c0b0c1e4a0f384dd7300d4dab293f3b)

6 years agoMLK-20189 sound: asoc: fix unsigned compared against 0
Cosmin-Gabriel Samoila [Tue, 13 Nov 2018 12:05:56 +0000 (14:05 +0200)]
MLK-20189 sound: asoc: fix unsigned compared against 0

An unsigned value can never be negative, so this test will always
evaluate the same way.

Fixes Coverity issue CID3618200

Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
(cherry picked from commit 3055c2dfd959a72464efcc225861e398f666c4dd)

6 years agoMLK-20189 sound: asoc: fix dereference before null check
Cosmin-Gabriel Samoila [Tue, 13 Nov 2018 11:35:45 +0000 (13:35 +0200)]
MLK-20189 sound: asoc: fix dereference before null check

There may be a null pointer dereference, or else the comparison against
null is unnecessary.

Fixes Coverity issue CID5327850

Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
(cherry picked from commit 5e9a805edcd8e07d3587480ffb89a27ad5bc0248)

6 years agoMLK-20253 sound: asoc: remove verbose messages from micfil
Cosmin-Gabriel Samoila [Tue, 6 Nov 2018 11:34:46 +0000 (13:34 +0200)]
MLK-20253 sound: asoc: remove verbose messages from micfil

Enable and disable procedures contain info and warn prints. This
introduces delay in initialization / disablement procedures and we have
kept only the necessary prints in case of error.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 2ca09a02c25c72b6aa47fab90d4a91b07d5694e6)

6 years agoMLK-20100 sound: asoc: make hwvad work after system suspend/resume
Cosmin-Gabriel Samoila [Wed, 31 Oct 2018 15:00:02 +0000 (17:00 +0200)]
MLK-20100 sound: asoc: make hwvad work after system suspend/resume

Implemented system suspend resume functions to call hwvad enable/disable
then do runtime_force_suspend/resume.
Since hwvad can run independently, when user calls enable/disable, we
will have to increment/decrement usage counter by calling
runtime_*_sync but to avoid doing this when disable/enable is called
from system_suspend/resume since we called pm_runtime functions - this
is why we have added the sync parameter in enable/disable_hwvad.
However, we ignore the busy flag because the module wasn't designed to
work with arecord and hwvad in parralel and we only print a warning.
Since hwvad and recording share the same clock and initialization
procedures require module to be disabled, the busy flag will be set
when having both features enabled.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit a73d9054a42b159e68b56b93f8834b121e82cde5)

6 years agoMLK-20102 sound: asoc: fix VAD channel select
Cosmin-Gabriel Samoila [Tue, 30 Oct 2018 11:54:11 +0000 (13:54 +0200)]
MLK-20102 sound: asoc: fix VAD channel select

The documentation specifies that VADCHSEL is used to select
the channel number on which hwvad detector will work. However,
we have used this field wrong (similar to the recording where
you can enable, disable multiple channels at the time).
This patch fixes hwvad and you can enable it by writing 0 to 7
in /sys/devices/platform/30080000.micfil/hwvad/enable or any
other number to disable it.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 4fdc1ca670db2f93362e8abde2707d98a7e450ff)

6 years agoMLK-19662 sound: asoc: add support for recording and hwvad in parallel
Cosmin-Gabriel Samoila [Mon, 29 Oct 2018 12:15:05 +0000 (14:15 +0200)]
MLK-19662 sound: asoc: add support for recording and hwvad in parallel

Remove all clock disable from driver suspend/hwvad_disable
to avoid crashing one or another when recording stops or
voice is detected and hwvad is disabled.
Another change done to make this work is to remove atomic
variables that guard mutual exclusion between recording and
VAD.
We have also added a restriction such that recording rate
should be the same as hwvad rate when hwvad is enabled to
avoid changing the mclk rate.
However, the hwvad can be enabled before or after recording
but not when recording is done. On the other hand, recording
can be triggered at any time.
I am not sure we are supposed to support recording and hwvad
in parallel since micfil documentation requires PDM to be
disabled when any initialization or reconfiguration of hwvad
is done. An workaround to make this working is never disabling
the pdm module from hwvad functions and this seems to work,
even we are not following the whole reconfiguration procedure.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit bd0c73a0b4367be6a204667aa9c261a23b13516e)

6 years agoMLK-19936-4: sound: asoc:add clock source control in alsa mixer
Cosmin-Gabriel Samoila [Tue, 16 Oct 2018 12:08:59 +0000 (15:08 +0300)]
MLK-19936-4: sound: asoc:add clock source control in alsa mixer

Add control to select clock source from alasamixer or select
auto mode where clock source is automatically selected.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 8e8f2fb3abf0375b4329f989490bf6cf9c308fc4)

6 years agoMLK-19936-1 : sound: asoc: add support for different sample rates
Cosmin-Gabriel Samoila [Mon, 15 Oct 2018 12:16:49 +0000 (15:16 +0300)]
MLK-19936-1 : sound: asoc: add support for different sample rates

At this moment, using audio_pll1 offers accurate clock for 48KHz only
and audio_pll2 offers accurate clock for 44.1KHz only.
With this patch, we dynamically switch between audio PLL1 and audio
PLL2 to support both 48KHz and 44.1KHZ rates.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit b7971ed41fd9d230706062638e5262b4658e9b5a)

6 years agoMLK-16784-6 arm64: config: add micfil in defconfig
Cosmin-Gabriel Samoila [Thu, 31 May 2018 11:40:01 +0000 (14:40 +0300)]
MLK-16784-6 arm64: config: add micfil in defconfig

Add IMX_MICFIL in arm64 defconfig.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
(cherry picked from commit bf5db2a332b104cae740796f5d07ddb627015fec)

6 years agoMLK-19936-3: sound: asoc: add rate in machine driver hw_params func
Cosmin-Gabriel Samoila [Mon, 15 Oct 2018 12:21:55 +0000 (15:21 +0300)]
MLK-19936-3: sound: asoc: add rate in machine driver hw_params func

Add rate when calling dai sysclk so we can set rate after
we change the pdm_src parrent.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit d9c88e7babb604f07f0dcf099b3f523a839ed20e)

6 years agoMLK-16784-5 sound: asoc: add machine driver for micfil in iMX8MM
Cosmin-Gabriel Samoila [Thu, 31 May 2018 07:40:57 +0000 (10:40 +0300)]
MLK-16784-5 sound: asoc: add machine driver for micfil in iMX8MM

Add machine driver for micfill IP in iMX8MM.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
(cherry picked from commit 3c788dfc51a44bde546572e519cac8cfca3d8f2d)

6 years agoMLK-21209 ARM: dts: imx7s: remove duplicated timer node
Anson Huang [Mon, 1 Apr 2019 01:21:45 +0000 (09:21 +0800)]
MLK-21209 ARM: dts: imx7s: remove duplicated timer node

Remove duplicated timer node to make linux kernel boot up
successfully.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
6 years agoMLK-20546-2: drm/imx/dcss: check status bit when handling interrupts
Laurentiu Palcu [Mon, 25 Mar 2019 12:29:17 +0000 (14:29 +0200)]
MLK-20546-2: drm/imx/dcss: check status bit when handling interrupts

Double check that the DTG IRQ STATUS register bit is set when handling
the vblank and CTXLD kick interrupts to make sure we avoid spurious
interrupts and kick the CTXLD in a bad moment.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-20546-1: drm/imx/dcss: fix crtc enable/disable completion signalling
Laurentiu Palcu [Fri, 18 Jan 2019 07:15:40 +0000 (09:15 +0200)]
MLK-20546-1: drm/imx/dcss: fix crtc enable/disable completion signalling

Using one completion variable is not feasible as we can hit corner cases like
enabling and then quickly disabling DCSS where we end up signaling that DTG was
correctly disabled when, in fact, a VBLANK interrupt was received.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-21249: drm/imx/hdp: do not set BT2020 colorimetry for 8bit color depth
Laurentiu Palcu [Thu, 21 Mar 2019 07:02:53 +0000 (09:02 +0200)]
MLK-21249: drm/imx/hdp: do not set BT2020 colorimetry for 8bit color depth

Currently, we set the colorimetry to BT.2020 even if the color-depth is
8 bit. This is not according to HDMI specification.

This patch makes sure we follow the specs.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Sandor Yu <sandor.yu@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-20195-2 hdp: fix dead code error
Oliver Brown [Fri, 22 Mar 2019 19:42:55 +0000 (14:42 -0500)]
MLK-20195-2 hdp: fix dead code error

Fixed a dead code error reported by Coverity.
CID 1826265: Logically dead code

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-20195-1 hdp: fix uninitialized variables
Oliver Brown [Fri, 22 Mar 2019 19:42:18 +0000 (14:42 -0500)]
MLK-20195-1 hdp: fix uninitialized variables

Fixed two issues resported by Coverity:
CID 343354: Uninitialized scalar variable
CID 343355: Uninitialized scalar variable

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-20209 hdmi: fixed unsigned compare against less than zero
Oliver Brown [Fri, 22 Mar 2019 18:38:20 +0000 (13:38 -0500)]
MLK-20209 hdmi: fixed unsigned compare against less than zero

Fixed CID 17375, Unsigned compared against 0. Removed code with no effect.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-20217-2 drm/imx: imx-tve: Fix build warning
Oliver Brown [Sat, 23 Mar 2019 18:59:49 +0000 (13:59 -0500)]
MLK-20217-2 drm/imx: imx-tve: Fix build warning

Fixed a build warning for uninitialized variable.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-20217 drm/imx: imx-tve: Fix potential divide by zero
Oliver Brown [Fri, 22 Mar 2019 17:41:47 +0000 (12:41 -0500)]
MLK-20217 drm/imx: imx-tve: Fix potential divide by zero

Coverity reported a potential divide by zero. Adding a check to prevent
a divide by zero.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-21227: drm: imx: hdp: imx8: Change link rate message
Oliver Brown [Fri, 22 Mar 2019 13:29:01 +0000 (08:29 -0500)]
MLK-21227: drm: imx: hdp: imx8: Change link rate message

Changing error message "Link rate is too high - forcing link to lower rate"
to a debug message "Lowering DP link rate from <old rate> to <new rate>".

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-21169: HDP: Fix CDN_API_DPTX_ForceLanes_blocking hang issue
Sandor Yu [Mon, 18 Mar 2019 07:58:24 +0000 (15:58 +0800)]
MLK-21169: HDP: Fix CDN_API_DPTX_ForceLanes_blocking hang issue

Error implement in function CDN_API_DPTX_ForceLanes_blocking,
it should call function CDN_API_DPTX_ForceLanes.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-21028-1 drm/imx: dcss-kms: Use a work queue of it's own for nonblock commits
Liu Ying [Fri, 15 Mar 2019 03:18:18 +0000 (11:18 +0800)]
MLK-21028-1 drm/imx: dcss-kms: Use a work queue of it's own for nonblock commits

DPU KMS would use a freezable and unbound work queue for nonblock commits
to prevent stall from happening during the system suspend operations in the
coming commits.  In order to make sure DCSS KMS has the same nonblock commit
behaviour as before, the two drivers may have a work queue of their own
respectively.  So, let's make the work queues be driver specific.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21093 gpu: imx: dcss: remove "error" from informative message
Oliver Brown [Thu, 14 Mar 2019 14:53:14 +0000 (09:53 -0500)]
MLK-21093 gpu: imx: dcss: remove "error" from informative message

Change the log message to report "difference is" instead of "error is" to
avoid confusion. This message is just reports the actual pixel clock for
informational purposes. It is not an actual error.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-21046-2 drm: imx: hdp: imx8qm: Change the HDMI TX clocks.
Oliver Brown [Mon, 4 Mar 2019 22:30:37 +0000 (16:30 -0600)]
MLK-21046-2 drm: imx: hdp: imx8qm: Change the HDMI TX clocks.

Change the default HDMI clocks to 800 MHz for DPLL, 200 MHz for
core,  and 100MHz for bus.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-21032-2: DP: Add DP link status check
Sandor Yu [Mon, 4 Mar 2019 07:12:39 +0000 (15:12 +0800)]
MLK-21032-2: DP: Add DP link status check

DP driver will hang if driver initialized in un-linked status.
Add DP link status check to avoid system hang.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-21032-1: DP: return correct read size for DPCD read function
Sandor Yu [Mon, 4 Mar 2019 07:53:28 +0000 (15:53 +0800)]
MLK-21032-1: DP: return correct read size for DPCD read function

DPCD read function should return actual read size.
msg->size is the requested read size
so replaced it with read_resp.size.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-20995-2: hdmi: fix avi info frame failed when hdmi in 4kp30
Sandor Yu [Wed, 27 Feb 2019 07:02:14 +0000 (15:02 +0800)]
MLK-20995-2: hdmi: fix avi info frame failed when hdmi in 4kp30

AVI info frame will failed work when hdmi in 4kp30/24/25.
It is caused by the data is overwritten by hdmi vendor info frame.
Change the hdmi vendor info frame to different address.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-20995-1: hdmi: Remove return value check for hdmi_vendor_info function
Sandor Yu [Wed, 27 Feb 2019 06:50:10 +0000 (14:50 +0800)]
MLK-20995-1: hdmi: Remove return value check for hdmi_vendor_info function

hdmi_vendor_info function only valid for HDMI1.4 4K video mode,
remove return value check.
Remove dumplicate hdmi_avi_info_set function call.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-20994: hdmi: Add max tmds clock check in deep color mode
Sandor Yu [Wed, 27 Feb 2019 06:44:37 +0000 (14:44 +0800)]
MLK-20994: hdmi: Add max tmds clock check in deep color mode

Add max tmds clock check in deep color mode.
Make sure tmds clock is not excess hdmi sink capability.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMMFMWK-8413: video/hdmi: Fix DRM info-frame packing
Laurentiu Palcu [Fri, 22 Feb 2019 10:41:19 +0000 (12:41 +0200)]
MMFMWK-8413: video/hdmi: Fix DRM info-frame packing

The hdmi_drm_infoframe_pack() was wrongly packing the HDR metadata. It
was setting the x display primaries followed by the y display primaries.
Instead, in the specifications, each x display primary should be
followed by the corresponding y display primary.

Also, byte 8 of the frame payload was being skipped. Fixed that too.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Reported-by: Jared Hu <jared.hu@nxp.com>
6 years agoMLK-20961 drm: imx: hdp: Check the content protection property first.
Oliver Brown [Thu, 21 Feb 2019 12:44:01 +0000 (06:44 -0600)]
MLK-20961 drm: imx: hdp: Check the content protection property first.

Need to check the content protection property first in
imx_hdp_imx_encoder_enable. The function may return if
drm_hdmi_infoframe_set_hdr_metadata returns an error. This was preventing
iMX8QM from enabling content protection.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-20931: drm/imx/dcss: Add scaler 5 tap filter back for YUV
Laurentiu Palcu [Thu, 14 Feb 2019 08:39:21 +0000 (10:39 +0200)]
MLK-20931: drm/imx/dcss: Add scaler 5 tap filter back for YUV

The following commit:

459a5fac54d - MLK-20263: drm/imx/dcss: fix channel-0 line shift

removed the 5 tap filter for vertical luma/chroma when YUV formats were
used.

Problem is that when the 7 tap filter is used for vertical luma/chroma,
artifacts can be seen on screen when scaling.

RGB can, however, function correctly with only 7 tap filter.

This patch partially reverts the above patch and also does some cosmetic
changes when calling the dcss_scaler_filter_design() using false/true
instead of 0/1 for use_5_taps argument.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-20892-2 drm: imx: hdp: Add support for HDCP
Oliver Brown [Tue, 5 Feb 2019 01:10:01 +0000 (03:10 +0200)]
MLK-20892-2 drm: imx: hdp: Add support for HDCP

Adding support for HDCP 1.4 and 2.2 based upon upstream 4.19 kernel
use of "Content Protection" connector property.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>