linux.git
6 years agoMLK-16692-2: mipi_csi: Add S_PARM and G_PARM ioctl
Guoniu.Zhou [Thu, 2 Nov 2017 01:33:14 +0000 (09:33 +0800)]
MLK-16692-2: mipi_csi: Add S_PARM and G_PARM ioctl

Add VIDIOC_S_PARM and VIDIOC_G_PARM ioctl to support
to get and set camera parameters

Reviewed-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 9ff408ace21f64d528f2abb37614889fe7a624fc)

6 years agoMLK-16692-1: csi: Identify which camera really connect to interface
Guoniu.Zhou [Tue, 31 Oct 2017 01:57:25 +0000 (09:57 +0800)]
MLK-16692-1: csi: Identify which camera really connect to interface

There maybe 0-4 cameras can connected to interface at
the same time. Add this ioctl to identify which camera
really connect to the interface.

Reviewed-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 785fbbd10c8a484b7f70488234c3a03e9aee9992)

6 years agoMLK-16062-2: i.MX8 imaging: Add debug log to imaging SS driver
Sandor Yu [Fri, 28 Jul 2017 03:08:27 +0000 (11:08 +0800)]
MLK-16062-2: i.MX8 imaging: Add debug log to imaging SS driver

Add debug log to imaging SS drivers.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-15124-04: image ss: Add mx8 image subsystem driver
Sandor Yu [Tue, 20 Jun 2017 07:37:16 +0000 (15:37 +0800)]
MLK-15124-04: image ss: Add mx8 image subsystem driver

Add mxc media device driver.
Add mx8 isi device driver.
Add mx8 mipi csi device driver.
Add max9286 sensor driver.
mxc isi driver support CSC and scaling function.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-21228-05 dmaengine: imx-sdma: support uart rom sdma script
Fugang Duan [Fri, 22 Mar 2019 06:15:39 +0000 (14:15 +0800)]
MLK-21228-05 dmaengine: imx-sdma: support uart rom sdma script

Switch uart ram script to rom sdma script that drop
idle timer support.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoserial: imx: fix error handling in console_setup
Stefan Agner [Wed, 14 Nov 2018 17:49:38 +0000 (18:49 +0100)]
serial: imx: fix error handling in console_setup

The ipg clock only needs to be unprepared in case preparing
per clock fails. The ipg clock has already disabled at the point.

Fixes: 1cf93e0d5488 ("serial: imx: remove the uart_console() check")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMLK-21228-04 tty: serial: imx: no need to clear AWAKE bit again
Fugang Duan [Thu, 21 Mar 2019 09:33:52 +0000 (17:33 +0800)]
MLK-21228-04 tty: serial: imx: no need to clear AWAKE bit again

No need to clear AWAKE bit again, so remove the dummy code.
That is introduced by commit 010e9572194d (MLK-17739 tty: serial:
imx: clear wakeup flag before enable wakeup interrupt) during
kernel upgrade.

Signed-off-by: Fugang Duan <B38611@freescale.com>
6 years agoMLK-21228-03 tty: serial: imx: convert to dma implementation based on rom script
Fugang Duan [Thu, 21 Mar 2019 06:39:44 +0000 (14:39 +0800)]
MLK-21228-03 tty: serial: imx: convert to dma implementation based on rom script

Since upstreaming dma implementation based on rom script also work,
now drop to support ram script to align with upstreaming's code.

Signed-off-by: Fugang Duan <B38611@freescale.com>
6 years agoMLK-21228-02 tty: serial: imx: remove wakeup enable in .suspend()
Fugang Duan [Wed, 20 Mar 2019 10:03:46 +0000 (18:03 +0800)]
MLK-21228-02 tty: serial: imx: remove wakeup enable in .suspend()

Remove wakeup enable in .suspend() that is dummy code that is
introduced by commit 527fc6e2113d(MLK-13798 tty: serial: imx:
Only poke at suspend wakeup bits in noirq phase).

Signed-off-by: Fugang Duan <B38611@freescale.com>
6 years agoMLK-21228-01 tty: serial: imx: clean up .imx_uart_stop_rx()
Fugang Duan [Wed, 20 Mar 2019 09:50:55 +0000 (17:50 +0800)]
MLK-21228-01 tty: serial: imx: clean up .imx_uart_stop_rx()

clean up .imx_uart_stop_rx() function, currently there have some
dummy setting introduced by commit de09e42393e5(MLK-11258 tty:
serial: imx: disable overrun interrupt during uart port shutdown)

Signed-off-by: Fugang Duan <B38611@freescale.com>
6 years agoMLK-21120-2 arm64: defconfig: Enable KEYBOARD_IMX_SC_PWRKEY
Leonard Crestez [Tue, 26 Mar 2019 14:03:42 +0000 (16:03 +0200)]
MLK-21120-2 arm64: defconfig: Enable KEYBOARD_IMX_SC_PWRKEY

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Anson Huang <Anson.Huang@nxp.com>
6 years agoMLK-21120-1 input: keyboard: imx_sc_pwrkey: Fix building against fresh SCFW
Leonard Crestez [Tue, 26 Mar 2019 18:01:07 +0000 (20:01 +0200)]
MLK-21120-1 input: keyboard: imx_sc_pwrkey: Fix building against fresh SCFW

The imx_4.19.y branch has a fresh import of SCFW and there are a few
tiny changes required to build this driver.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Anson Huang <Anson.Huang@nxp.com>
6 years agoMLK-21116-2 arm64: defconfig: Enable CONFIG_EXTCON_PTN5150
Leonard Crestez [Tue, 26 Mar 2019 14:05:00 +0000 (16:05 +0200)]
MLK-21116-2 arm64: defconfig: Enable CONFIG_EXTCON_PTN5150

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
6 years agoMLK-21116-1 extcon: ptn5150: Fix build on imx_4.19.y
Leonard Crestez [Tue, 26 Mar 2019 18:02:52 +0000 (20:02 +0200)]
MLK-21116-1 extcon: ptn5150: Fix build on imx_4.19.y

Only needs including an extra header.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
6 years agoMLK-21058 video: fbdev: dcss: remove DCSS FBDEV driver
Fancy Fang [Sat, 23 Mar 2019 03:41:31 +0000 (11:41 +0800)]
MLK-21058 video: fbdev: dcss: remove DCSS FBDEV driver

Since the DCSS FBDEV driver is not used in any platform
or board, clean this up completely is better.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-20203-4 soc: imx: fix coverity issue
Anson Huang [Sat, 3 Nov 2018 04:17:31 +0000 (12:17 +0800)]
MLK-20203-4 soc: 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>
(cherry picked from commit ed044f6d78156ae603dd732f15c5268d3f545605)

6 years agoMLK-20136-03 driver: soc: imx: add 100mts support for imx8mq low bus mode
Bai Ping [Wed, 31 Oct 2018 01:59:37 +0000 (09:59 +0800)]
MLK-20136-03 driver: soc: imx: add 100mts support for imx8mq low bus mode

The 100MTS low bus mode can be only supported by i.MX8MQ Rev2.1 and
future TO. So necessary check is added to identify the chip revision
when doing busfreq mode switch.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit a906afb17d445b40f6c70fa2a2c3b6707ada0e47)

6 years agoMLK-18427-03 driver: soc: add busfreq driver support for imx8mm
Bai Ping [Tue, 17 Jul 2018 05:27:17 +0000 (13:27 +0800)]
MLK-18427-03 driver: soc: add busfreq driver support for imx8mm

add busfreq support on i.MX8MM. when system is running at low bus or
audio bus mode, the dram & bus clock will be reduced to a lower rate:
   NOC: 150MHZ, AXI: 24MHz, AXI 20MHZ, DRAM core clock: 25MHz.

when system is running at high bus mode, all the bus clock and dram
clock will be restore to the highest one.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit 4984e653a6e86f7b6e2e6c195be53da8dcb5f8fd)

6 years agoMLK-17590-02 driver: soc: imx: update the busfreq flow on imx8mq
Bai Ping [Mon, 5 Feb 2018 08:32:07 +0000 (16:32 +0800)]
MLK-17590-02 driver: soc: imx: update the busfreq flow on imx8mq

Currently, on imx8mq evk board, we only support 3200mts and 667mts
frequency setpoints. So the DDR DVFS flow need to be updated accordingly.

The dram pll and dram apb clock rate is changed in ATF when doing frequency,
in kernel side, we need to call the clk API to update the clock rate info
in clock tree.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit a69c3794f52d826762642cbdcf978a85784f386a)

6 years agoMLK-17447 drivers: soc: imx: Fix busfreq mutex unlock twice on imx8mq
Bai Ping [Mon, 8 Jan 2018 08:06:55 +0000 (16:06 +0800)]
MLK-17447 drivers: soc: imx: Fix busfreq mutex unlock twice on imx8mq

A 'return' statement is missed before, So the mutex will be unlocked
twice, in some corner case, one core will unlock the mutex that locked
by anohter core wrongly. Then lead to concurrent access to the DVFS
at the same time.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit 659615af4d35c7f118b7cf346624d423a3b15797)

6 years agoMLK-17190 driver: soc: Fix audio bus mode clock rate on imx8mq
Bai Ping [Wed, 13 Dec 2017 05:18:42 +0000 (13:18 +0800)]
MLK-17190 driver: soc: Fix audio bus mode clock rate on imx8mq

If the system is currently in low bus mode, if the audio device
request the audio bus mode, the NOC, AHB and AXI bus clock rate
will be set wrongly, then bus will run at very low frequency, then
lead to audio playback underrun.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Tested-by: Anson Huang <anson.huang@nxp.com>
(cherry picked from commit 3a2a988cc02823297d14aa9001f013adbd15f6e8)

6 years agoMLK-16804-08 driver: soc: Reduce NOC/AHB/MAIN_AXI to save SOC power for audio playback
Anson Huang [Wed, 8 Nov 2017 10:17:22 +0000 (18:17 +0800)]
MLK-16804-08 driver: soc: Reduce NOC/AHB/MAIN_AXI to save SOC power for audio playback

reduce the NOC, main AXI and AHB bus clock frequency to save power when DDR enter low
frequency mode. VDDSOC is ~195mA during video play, and ~180mA in idle.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit e109b34d30f0b4628a41ca9715eea689cc8c2a56)

6 years agoMLK-16804-06 driver: soc: Optimize the DDR frequency in audio playback case
Bai Ping [Wed, 8 Nov 2017 09:58:00 +0000 (17:58 +0800)]
MLK-16804-06 driver: soc: Optimize the DDR frequency in audio playback case

If audio device is the only that access to ddr memory, the DDR
frequency can be reduce to 25MHz to save power. when DDR run in
25MHz frequency, the memory bandwidth is about 66MB/s, it can
meet the performance requirement for audio only case.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
(cherry picked from commit 7c2389b6dca053ae4b4a56b3588978909769008c)

6 years agoMLK-16689-03 driver: soc: Add busfreq driver for imx8mq
Bai Ping [Mon, 30 Oct 2017 08:27:02 +0000 (16:27 +0800)]
MLK-16689-03 driver: soc: Add busfreq driver for imx8mq

Add busfreq driver support on i.MX8MQ. The busfreq driver is
mainly used for dynamic DDR frequency change for power saving
feature. When there is no peripheral or DMA device has direct
access to DDR memory, we can lower the DDR frequency to save
power. Currently, we support frequency setpoint for LPDDR4:

    (1): 3200mts, the DDRC core clock is sourced from 800MHz
         dram_pll, the DDRC apb clock is 200MHz.

    (2): 400mts, the DDRC core clock is source from sys1_pll_400m,
         the DDRC apb clock is is sourced from sys1_pll_40m.

    (3): 100mts, the DDRC core clock is sourced from sys1_pll_100m,
         the DDRC apb clock is sourced from sys1_pll_40m.

In our busfreq driver, we have three mode supported:
    * high bus mode  <-----> 3200mts;
    * audio bus mode <-----> 400mts;
    * low bus mode   <-----> 100mts;

The actual DDR frequency is done in ARM trusted firmware by calling
the SMCC SiP service call.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit 60a2002f752404b5fc30b374bc71a3975902eb7a)
Use CONFIG_HAVE_IMX_BUSFREQ instead of just CONFIG_ARCH_FSL_IMX8MQ
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21239-5: drm/imx: nwl_dsi-imx: Fix config
Robert Chiras [Fri, 22 Mar 2019 12:34:03 +0000 (14:34 +0200)]
MLK-21239-5: drm/imx: nwl_dsi-imx: Fix config

The config DRM_IMX_NWL_DSI depends on DRM_IMX, while DRM_IMX config
depends on IMX_IPUV3_CORE. Since DRM_IMX_NWL_DSI can be used without
IMX_IPUV3_CORE, remove this depend from DRM_IMX.
Also, change the depend on DRM_IMX from DRM_IMX_NWL_DSI to select so
DRM_IMX will be automatically selected (no need to manually add it to
defconfig).

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-21239-4: drm/imx: nwl_dsi-imx: Adapt to DRM changes in 4.19
Robert Chiras [Fri, 22 Mar 2019 12:32:37 +0000 (14:32 +0200)]
MLK-21239-4: drm/imx: nwl_dsi-imx: Adapt to DRM changes in 4.19

Function signature changes:
int drm_bridge_add() -> void drm_bridge_add()

This patch adapts the nwl_dsi-imx DRM encoder to the above changes.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-21239-3: drm/bridge: nwl-dsi: Adapt to DRM changes in 4.19
Robert Chiras [Fri, 22 Mar 2019 12:28:47 +0000 (14:28 +0200)]
MLK-21239-3: drm/bridge: nwl-dsi: Adapt to DRM changes in 4.19

Function name changes:
drm_mode_connector_attach_encoder() -> drm_connector_attach_encoder()

Function signature changes:
int drm_bridge_add() -> void drm_bridge_add()

This patch adapts the nwl-dsi DRM bridge to the above changes.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-21239-2: drm/imx: Extract IPUv3 specific KMS functions to ipuv3-kms.c
Liu Ying [Thu, 8 Jun 2017 02:47:08 +0000 (10:47 +0800)]
MLK-21239-2: drm/imx: Extract IPUv3 specific KMS functions to ipuv3-kms.c

Since we want to add i.MX DPU support into imx-drm, the imx-drm core
driver should be no more IPUv3 specific.  Let's make imx-drm more generic
and extract IPUv3 specific KMS functions to ipuv3-kms.c.

This is a backport from linux-next, that makes possible to use
DRM_IMX whithout the needs of having also IPU built.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21239-1: Revert "drm/imx: merge imx-drm-core and ipuv3-crtc in one module"
Leonard Crestez [Wed, 28 Mar 2018 18:18:01 +0000 (21:18 +0300)]
MLK-21239-1: Revert "drm/imx: merge imx-drm-core and ipuv3-crtc in one module"

This reverts commit 3d1df96ad46856ce850be5ac112eab919cbe1cab.

This is a backport from linux-next, that makes possible to use
DRM_IMX whithout the needs of having also IPU built.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-16540: include: mfd: Add MX8 MQ IOMUXC GPR header
Robert Chiras [Wed, 27 Sep 2017 10:24:13 +0000 (13:24 +0300)]
MLK-16540: include: mfd: Add MX8 MQ IOMUXC GPR header

Add header file for the i.MX8mq IOMUXC GPR register offsets definitions.
Also, include definition for the GPR_MIPI_MUX_SEL from GPR13, needed by
MIPI-DSI driver.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-16698-5: arm64: defconfig: Build in RM67191 panel driver
Robert Chiras [Wed, 25 Oct 2017 13:56:37 +0000 (16:56 +0300)]
MLK-16698-5: arm64: defconfig: Build in RM67191 panel driver

Enable the Raydium RM67171 drm panel driver as built-in in defconfig.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoFix for_each_new_crtc_in_state
Robert Chiras [Thu, 21 Mar 2019 12:50:00 +0000 (14:50 +0200)]
Fix for_each_new_crtc_in_state

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-16347-9: arm64: defconfig: Build in NWL IMX DSI driver
Robert Chiras [Mon, 16 Oct 2017 12:33:46 +0000 (15:33 +0300)]
MLK-16347-9: arm64: defconfig: Build in NWL IMX DSI driver

Enable the MIPI-DSI drm driver as built-in in defconfig.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17537-8: drm/mxsfb: Add support for mode_valid
Robert Chiras [Mon, 26 Nov 2018 12:12:07 +0000 (14:12 +0200)]
MLK-17537-8: drm/mxsfb: Add support for mode_valid

Implement mode_valid and check functions from
drm_simple_display_pipe_funcs such that we can filter-out modes that
cannot be driven by this controller.
Add 3 new clocks:
- video_pll: this is the PLL that provides the pixel clock; it's rate
  needs to be set such that the pixel clock can be achieved
- osc_25: this is an oscillater that can be used as source clock for the
  video_pll; default freq is 25MHz
- osc_27: same as above, but with freq of 27MHz

Depending on the display mode used, the video_pll needs to have it's
clock source a 25MHz or 27MHz oscillator. Also, the video_pll rate needs
to be set to a rate that can be evenly divided to obtain the required
pixel clock. All these settings (clock source and video_pll rate) are
saved in mode_valid, then applied before mode needs to be set in the
check function.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-20561: drm/mxsfb: Clear OUTSTANDING_REQS bits
Robert Chiras [Mon, 10 Dec 2018 10:46:49 +0000 (12:46 +0200)]
MLK-20561: drm/mxsfb: Clear OUTSTANDING_REQS bits

Bit 21 can alter the CTRL2_OUTSTANDING_REQS value right after the eLCDIF
is enabled, since it comes up with default value of 1.
In order to fix this, clear CTRL2_OUTSTANDING_REQS bits before setting
its value.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-20181-10: Improve the axi clock usage
Robert Chiras [Wed, 7 Nov 2018 11:12:20 +0000 (13:12 +0200)]
MLK-20181-10: Improve the axi clock usage

Currently, the enable of the axi clock return status is ignored, causing
issues when the enable fails then we try to disable it. Therefore, it is
better to check the return status and disable it only when enable
succeeded.
Also, remove the helper functions around clk_axi, since we can directly
use the clk API function for enable/disable the clock. Those functions
are already checking for NULL clk and returning 0 if that's the case.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>i
Acked-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-20181-8: drm/mxsfb: Cleanup after upstream backport
Robert Chiras [Wed, 7 Nov 2018 10:36:37 +0000 (12:36 +0200)]
MLK-20181-8: drm/mxsfb: Cleanup after upstream backport

Patches related to suspend/resume have been backported from upstream
kernel, therefore some of the mxsfb_drm_private members are no longer
needed, so remove them, among with the code around them.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Acked-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-20181-7: drm/mxsfb: Switch to drm_atomic_helper_commit_tail_rpm
Leonard Crestez [Mon, 17 Sep 2018 13:42:15 +0000 (16:42 +0300)]
MLK-20181-7: drm/mxsfb: Switch to drm_atomic_helper_commit_tail_rpm

The lcdif block is only powered on when display is active so plane
updates when not enabled are not valid. Writing to an unpowered IP block
is mostly ignored but can trigger bus errors on some chips.

Prevent this situation by switching to drm_atomic_helper_commit_tail_rpm
and having the drm core ensure atomic_plane_update is only called while
the crtc is active. This avoids having to keep track of "enabled" bits
inside the mxsfb driver.

This also requires handling the vblank event for disable from
mxsfb_pipe_disable.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Suggested-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/c19c0c00ed42e8e8f7965aa4821ac295abc5cd05.1537191359.git.leonard.crestez@nxp.com
6 years agoMLK-20181-6: drm/mxsfb: Add PM_SLEEP support
Leonard Crestez [Mon, 17 Sep 2018 13:42:14 +0000 (16:42 +0300)]
MLK-20181-6: drm/mxsfb: Add PM_SLEEP support

Since power to the lcdif block can be lost on suspend implement
PM_SLEEP_OPS using drm_mode_config_helper_suspend/resume to save/restore
the current mode.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/cfa1a4083eefd112362e640deeb2e120584ac3f5.1537191359.git.leonard.crestez@nxp.com
6 years agoMLK-20181-3: drm/mxsfb: Add pm_runtime calls to pipe_enable/disable
Leonard Crestez [Mon, 17 Sep 2018 13:42:13 +0000 (16:42 +0300)]
MLK-20181-3: drm/mxsfb: Add pm_runtime calls to pipe_enable/disable

Adding lcdif nodes to a power domain currently results in
black/corrupted screens or hangs because power is not correctly enabled
when required.

Ensure power is on when display is active by adding
pm_runtime_get/put_sync to mxsfb_pipe_enable/disable.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/ee88148399c63494cda4129b05444b0ac331b7a7.1537191359.git.leonard.crestez@nxp.com
6 years agoMLK-20181-2: drm/mxsfb: Fix initial corrupt frame when activating display
Leonard Crestez [Mon, 17 Sep 2018 13:42:12 +0000 (16:42 +0300)]
MLK-20181-2: drm/mxsfb: Fix initial corrupt frame when activating display

LCDIF will repeatedly display data from CUR_BUF and set CUR_BUF to
NEXT_BUF when done. Since we are only ever writing to NEXT_BUF the
display will show an initial corrupt frame.

Fix by writing the FB paddr to both CUR_BUF and NEXT_BUF when
activating the CRTC.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/7cdac9c064cc2b8a3d237934f186da98cefe6cb3.1537191359.git.leonard.crestez@nxp.com
6 years agoMLK-20181-1: drm/mxsfb: Move axi clk enable/disable to crtc enable/disable
Leonard Crestez [Mon, 17 Sep 2018 13:42:11 +0000 (16:42 +0300)]
MLK-20181-1: drm/mxsfb: Move axi clk enable/disable to crtc enable/disable

The main axi clk is disabled at the end of mxsfb_crtc_mode_set_nofb and
immediately reenabled in mxsfb_enable_controller.

Avoid this by moving the handling of axi clk one level up to
mxsfb_crtc_enable. Do the same for mxsfb_crtc_disable for symmetry.

This shouldn't have any functional effect.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/985c1f1cad250bd9ca154b3e4b3f913c310eeabd.1537191359.git.leonard.crestez@nxp.com
6 years agoMLK-18789-4: drm/mxsfb: Update mxsfb to support LCD reset
Robert Chiras [Fri, 27 Jul 2018 12:52:48 +0000 (15:52 +0300)]
MLK-18789-4: drm/mxsfb: Update mxsfb to support LCD reset

The eLCDIF controller has control pin for the external LCD reset pin.
Add support for it and assert this pin in enable and de-assert it in
disable.
Also, correct the pm_runtime_enable call, since it was made too early in
the probe, causing issues to DRM enable routines.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18106: drm/mxsfb: Fix mxsfb_create_output
Robert Chiras [Thu, 19 Apr 2018 08:18:18 +0000 (11:18 +0300)]
MLK-18106: drm/mxsfb: Fix mxsfb_create_output

Since MXSFB driver now also supports a bridge, this object needs to be
passed to the drm_of_find_panel_or_bridge function.
This fixes a bug created during kernel 4.14 rebase process.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17543-1: drm/mxsfb: Signal mode changed when bpp changed
Mirela Rabulea [Mon, 19 Mar 2018 13:25:46 +0000 (15:25 +0200)]
MLK-17543-1: drm/mxsfb: Signal mode changed when bpp changed

Add mxsfb_atomic_helper_check to signal mode changed when bpp changed.
This will trigger the execution of disable/enable on
a modeset with different bpp than the current one.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
6 years agoMLK-17684-3: drm/mxsfb: Add support for new pixel formats in eLCDIF
Mirela Rabulea [Wed, 7 Mar 2018 08:48:21 +0000 (10:48 +0200)]
MLK-17684-3: drm/mxsfb: Add support for new pixel formats in eLCDIF

Add support for the following pixel formats:
16 bpp: RG16 ,BG16, XR15, XB15, AR15, AB15
Set the bus format based on input from the user and panel capabilities.
Save the bus format in crtc->mode.private_flags, the DSI will use it.
Use drm_get_format_name instead of locally defined fourcc_to_str.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
6 years agoMA-10971 [8M-EVK]system cannot resume with mipi display
guoyin.chen [Thu, 28 Dec 2017 13:20:45 +0000 (21:20 +0800)]
MA-10971 [8M-EVK]system cannot resume with mipi display

In andorid UI framework, we will send DRM_MODE_DPMS_OFF
to drm driver before we request kernel into suspend sate
And send DRM_MODE_DPMS_ON after we resume kernel. mxsfb_resume
should just recover the sate before kernel into suspend.
Otherwise the mxsfb->connector is reset for DRM_MODE_DPMS_OFF,
mxsfb drm driver have below kernel panic when resuming from suspend

Unable to handle kernel NULL pointer dereference at virtual address 000000f4
pgd = ffff8000aa8ea000
[000000f4] *pgd=00000000ea8e9003, *pud=00000000ea4d6003, *pmd=0000000000000000
Internal error: Oops: 96000006 [#1] PREEMPT SMP
Modules linked in: ath10k_pci ath10k_core ath
CPU: 2 PID: 2693 Comm: system_server Not tainted 4.9.68-00922-g707b2da-dirty #35
Hardware name: Freescale i.MX8MQ EVK (DT)
task: ffff8000b92d1b00 task.stack: ffff8000aad60000
PC is at mxsfb_crtc_enable+0xa4/0x538
LR is at mxsfb_crtc_enable+0x4dc/0x538
[<ffff00000871b5cc>] mxsfb_crtc_enable+0xa4/0x538
[<ffff00000871a6fc>] mxsfb_resume+0x68/0x84
[<ffff000008725f08>] platform_pm_resume+0x24/0x4c
[<ffff00000873271c>] dpm_run_callback+0x40/0x1f0
[<ffff0000087336b0>] device_resume+0xac/0x284
[<ffff000008734bec>] dpm_resume+0x11c/0x374
[<ffff00000873526c>] dpm_resume_end+0x14/0x28
[<ffff00000811e558>] suspend_devices_and_enter+0x134/0x2f8
[<ffff00000811ead0>] pm_suspend+0x3b4/0x678
[<ffff00000811ceec>] state_store+0x80/0x9c
[<ffff000008445068>] kobj_attr_store+0x14/0x24
[<ffff0000082c51d8>] sysfs_kf_write+0x40/0x50
[<ffff0000082c43e0>] kernfs_fop_write+0xb0/0x1e0
[<ffff000008242708>] vfs_write+0xac/0x1d0
[<ffff000008243be4>] SyS_write+0x50/0xb0
[<ffff000008082ef0>] el0_svc_naked+0x24/0x28

Change-Id: Ia2c4d0ef42e4a2761209fd678ace35804b40a387
Signed-off-by: guoyin.chen <guoyin.chen@nxp.com>
6 years agoMLK-17149-1: drm/mxsfb: Fix pipe enable
Robert Chiras [Mon, 11 Dec 2017 10:09:36 +0000 (12:09 +0200)]
MLK-17149-1: drm/mxsfb: Fix pipe enable

During enable function, the mxsfb driver is trying to associate with a
connector, when a drm_bridge is used. When accessing the connectors
list, mode_config->mutex might be locked, generating the below WARN.
Since we are not changing the mode_config, we can access the
connector_list directly.

[   16.876991] [<ffff0000086289d4>] mxsfb_pipe_enable+0xec/0xf8
[   16.882650] [<ffff0000085e4de0>] drm_simple_kms_crtc_enable+0x20/0x30
[   16.889090] [<ffff0000085e144c>]
drm_atomic_helper_commit_modeset_enables+0x17c/0x1a0
[   16.896918] [<ffff0000085e42dc>]
drm_atomic_helper_commit_tail+0x3c/0x68
[   16.903617] [<ffff0000085e436c>] commit_tail+0x64/0x80
[   16.908753] [<ffff0000085e4398>] commit_work+0x10/0x18
[   16.913893] [<ffff0000080d4928>] process_one_work+0x1c8/0x380
[   16.919638] [<ffff0000080d4b28>] worker_thread+0x48/0x498
[   16.925035] [<ffff0000080da8f8>] kthread+0xe0/0xf8
[   16.929828] [<ffff000008082e80>] ret_from_fork+0x10/0x50

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17047-1: drm/mxsfb: Fix suspend/resume
Robert Chiras [Fri, 8 Dec 2017 14:19:15 +0000 (16:19 +0200)]
MLK-17047-1: drm/mxsfb: Fix suspend/resume

MXSFB should always request bus_freq when enabled and release bus_freq
when disabled. Also, when suspend/resume occurs, check if the driver is
running, so what we won't enable it by mistake in resume.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17115: drm/mxsfb: Add support for vblank
Robert Chiras [Fri, 8 Dec 2017 08:23:15 +0000 (10:23 +0200)]
MLK-17115: drm/mxsfb: Add support for vblank

Currently, the vblank support is not correctly implemented in MXSFB_DRM
driver. Thix patch addresses this issue, so that vblank will be
supported by MXSFB_DRM driver.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17090: drm/mxsfb: Update mxsfb with additional pixel formats
Robert Chiras [Wed, 6 Dec 2017 15:43:30 +0000 (17:43 +0200)]
MLK-17090: drm/mxsfb: Update mxsfb with additional pixel formats

Since version 4 of eLCDIF, there are some registers that can do
transformations on the input data, like re-arranging the pixel
components. By doing that, we can support more pixel formats.
This patch adds support for X/ABGR and RGBX/A. Although, the local alpha
is not supported by eLCDIF, the alpha pixel formats were added to the
supported pixel formats but it will be ignored. This was necessary since
there are systems (like Android) that requires such pixel formats.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-16986-4: drm/mxsfb: Add max-res property for MXSFB
Robert Chiras [Wed, 6 Dec 2017 09:31:21 +0000 (11:31 +0200)]
MLK-16986-4: drm/mxsfb: Add max-res property for MXSFB

For stability issues, we want to limit the maximum resolution supported
by the MXSFB (eLCDIF) driver.
This patch adds a new property which we can use to impose such
limitation.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com
6 years agoMLK-16986-5: drm: mxsfb_crtc: Fix the framebuffer misplacement
Fabio Estevam [Thu, 2 Feb 2017 21:26:38 +0000 (19:26 -0200)]
MLK-16986-5: drm: mxsfb_crtc: Fix the framebuffer misplacement

Currently the framebuffer content is displayed with incorrect offsets
in both the vertical and horizontal directions.

The fbdev version of the driver does not show this problem. Breno Lima
dumped the eLCDIF controller registers on both the drm and fbdev drivers
and noticed that the VDCTRL3 register is configured incorrectly in the
drm driver.

The fbdev driver calculates the vertical and horizontal wait counts
of the VDCTRL3 register by doing: back porch + sync length.

Looking at the horizontal and vertical timing diagram from
include/drm/drm_modes.h this value corresponds to:

crtc_[hv]total - crtc_[hv]sync_start

So fix the VDCTRL3 register setting accordingly so that the eLCDIF
controller can properly show the framebuffer content in the correct
position.

Reported-by: Breno Lima <breno.lima@nxp.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Breno Lima <breno.lima@nxp.com>
Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-16986-3: drm: mxsfb: fix connector handling
Robert Chiras [Fri, 24 Nov 2017 12:03:51 +0000 (14:03 +0200)]
MLK-16986-3: drm: mxsfb: fix connector handling

Since the MXSFB initially was just a simple display pipe using a
drm_panel, the drm_connector was created "in-house", by mxsfb driver.
But, with latest changes, mxsfb also supports a bridge. In case of a
drm_bridge, the the connector is created and initialized by that bridge.
So, for a proper initialization during start-up, we need to take into
consideration that connector, instead of our "in-house" connector.
The connector created and initialized by mxsfb will be used only when
this driver will have a panel.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16918-16: drm/mxsfb: Add support for suspend/resume
Robert Chiras [Wed, 22 Nov 2017 09:47:18 +0000 (11:47 +0200)]
MLK-16918-16: drm/mxsfb: Add support for suspend/resume

Update the MXSFB DRM driver to support the PM Runtime and System
Sleep suspend/resume routines.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-16918-7: drm/mxsfb: Update mxsfb to support a bridge
Robert Chiras [Thu, 9 Nov 2017 07:36:30 +0000 (09:36 +0200)]
MLK-16918-7: drm/mxsfb: Update mxsfb to support a bridge

Currently, the MXSFB DRM driver only supports a panel. But, its output
display signal can also be redirected to another encoder, like a DSI
controller. In this case, that DSI controller may act like a drm_bridge.
In order support this use-case too, this patch adds support for
drm_bridge in mxsfb.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-20514: Update Raydium panel driver according to upstream reviews
Robert Chiras [Thu, 29 Nov 2018 14:48:14 +0000 (16:48 +0200)]
MLK-20514: Update Raydium panel driver according to upstream reviews

Update the panel driver to be in sync with the suggestion received from
upstream review process.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18605-13 drm/panel: rm67191: enable 'video-mode' config
Fancy Fang [Fri, 13 Jul 2018 11:41:53 +0000 (19:41 +0800)]
MLK-18605-13 drm/panel: rm67191: enable 'video-mode' config

Try to get the 'video-mode' property from dtb to guide
the required video mode configuration. The possible video
modes are:
0. Burst mode
1. Non-burst mode with sync event
2. Non-burst mode with sync pulse

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit e920436e2174d72eac28f0fb09f1fcdc68add9d9)

6 years agoMLK-18816-1 drm/panel: put the RST pin back to high after the reset operation
Haibo Chen [Mon, 9 Jul 2018 11:15:28 +0000 (19:15 +0800)]
MLK-18816-1 drm/panel: put the RST pin back to high after the reset operation

Panel and Touch share the same reset pin, keep reset pin in low will
make touch can't work. This patch make the reset pin keep in low for
over 15ms (to meet the RM requirement), and then put the reset pin
back to high (which will not impact touch).

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
6 years agoMLK-18358: drm/panel: rm67191: Fix initial brightness level
Robert Chiras [Mon, 21 May 2018 12:15:37 +0000 (15:15 +0300)]
MLK-18358: drm/panel: rm67191: Fix initial brightness level

When enabling the panel, the initial brightness level was hard-coded to
0x20. This way, during a suspend/resume cycle, after resume, this
hard-coded brightness was used, instead of the one before suspend.
Removing the hard-coded level and using the one stored in backlight
device.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18177-1: drm/panel: Move the DSI init into enable stage
Robert Chiras [Thu, 12 Apr 2018 13:29:21 +0000 (16:29 +0300)]
MLK-18177-1: drm/panel: Move the DSI init into enable stage

Currently, the DSI panel init sequence is made in the prepare function,
right after the reset pin is asserted. This implies that at this moment,
the DSI host needs to be enabled. If the DSI host is enabled during
panel prepare, there will be DSI signal on the DSI lanes during the
panel reset, which is wrong.

In order to not to have any signal on the DSI data lanes during reset,
the reset sequence must be separated from the init sequence, so move the
init into enable function and leave the reset into the prepare function.

Also:
- removed the calls to panel_disable and panel_unprepare from
  panel_remove, since the panel should be already disabled when this call
  is made
- fixed the call ordering to panel_disable and panel_unprepare from
  rad_panel_shutdown function

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17684-1: drm/panel: rm67191: Add support for new bus formats
Mirela Rabulea [Wed, 7 Mar 2018 08:41:31 +0000 (10:41 +0200)]
MLK-17684-1: drm/panel: rm67191: Add support for new bus formats

Do not hardcode pixel_format to 0x77 but calculate it from dsi->format.
Report all the supported bus formats in get_modes:
        MEDIA_BUS_FMT_RGB888_1X24
        MEDIA_BUS_FMT_RGB666_1X18
        MEDIA_BUS_FMT_RGB565_1X16
Change pixelclock from 120 to 132 MHz, or 16 bpp formats will not work.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
6 years agoMLK-17389: drm/panel: rm67191: Fix power on/off logic
Robert Chiras [Mon, 22 Jan 2018 08:16:03 +0000 (10:16 +0200)]
MLK-17389: drm/panel: rm67191: Fix power on/off logic

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

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17280-1: drm: panel: rm67191: Fix power on sequence
Robert Chiras [Fri, 5 Jan 2018 11:41:44 +0000 (13:41 +0200)]
MLK-17280-1: drm: panel: rm67191: Fix power on sequence

According to the vendor driver sample there is a sleep after the exit
sleep and display on commands, but it seems that these sleeps are only
causing stability issues when the display signal is sent to the panel,
so remove them.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16926-2: drm/panel Update Raydium panel
Robert Chiras [Thu, 16 Nov 2017 11:28:55 +0000 (13:28 +0200)]
MLK-16926-2: drm/panel Update Raydium panel

If a GPIO pin is present, set it to LOW, so that the initial
configuration comes from a LOW value on that pin.
This patch was needed, since the panel driver had issues on MX8MQ.
Also, use the bus specific flags from display timings flags in order to
set them as display_info bus_flags.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16698-1: drm/panel: Add panel driver for Raydium RM67191
Robert Chiras [Mon, 16 Oct 2017 13:24:59 +0000 (16:24 +0300)]
MLK-16698-1: drm/panel: Add panel driver for Raydium RM67191

Add support for the OLED display based on MIPI-DSI protocol from Raydium:
RM67191.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17537-1: drm/bridge: Correct the ADV7533 init
Robert Chiras [Mon, 26 Nov 2018 11:46:14 +0000 (13:46 +0200)]
MLK-17537-1: drm/bridge: Correct the ADV7533 init

According to the Analog Devices configuration script, there are some
steps that need to be made when configuring the ADV for a specific mode.
Some of those steps were missing from driver, so this patch takes care
of this.
Also, in mode_fixup, the driver is trying to reconfigure the DSI lanes
from 4 to 3, when pixel clock is lower than 80MHz, which is not
necessary. the lanes property represents the maximum available lanes on
that devices and should not differ from a mode to another.
The DSI host is the one who should predict how many lanes it could use
to drive a display mode, so remove this from ADV driver.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18877-1: drm/bridge: adv7511: Add debug info for HPD event
Robert Chiras [Thu, 12 Jul 2018 08:49:00 +0000 (11:49 +0300)]
MLK-18877-1: drm/bridge: adv7511: Add debug info for HPD event

Add debug information for the HDP event catched with i2c interrupt.
Also, simplify the code in adv7511_hpd_work.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17650-1: drm/bridge: adv7511: Add support for programmable i2c addresses
Robert Chiras [Fri, 2 Mar 2018 09:31:50 +0000 (11:31 +0200)]
MLK-17650-1: drm/bridge: adv7511: Add support for programmable i2c addresses

The DSI-HDMI converter, ADV7535, driver uses four i2c memory maps: MAIN,
DSI-CEC, EDID and PACKET.
While the MAIN address is hard-coded in the ROM chip, the other three
can be programmed into the MAIN memory map.
Currently, the three memory maps addresses, that can be programmed, are
hard-coded into the code.
In order to avoid conflicts with other i2c clients on the bus, update
the driver to use configurable addresses specified in DTS file.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17275-7: drm/bridge: adv7511: Add dsi-channel property
Robert Chiras [Thu, 21 Dec 2017 12:10:42 +0000 (14:10 +0200)]
MLK-17275-7: drm/bridge: adv7511: Add dsi-channel property

Add a new property "adi,dsi-channel" to allow the user specify the DSI
channel to be used when communicating with DSI peripheral.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17275-1: drm/bridge: adv7511: Add support for OF_DYNAMIC
Robert Chiras [Thu, 21 Dec 2017 08:59:20 +0000 (10:59 +0200)]
MLK-17275-1: drm/bridge: adv7511: 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>
6 years agoMLK-21142-1: drm/imx: nwl_dsi-imx: Assert DPI and MIPI resets in poweron
Oliver Brown [Wed, 13 Mar 2019 19:11:13 +0000 (14:11 -0500)]
MLK-21142-1: drm/imx: nwl_dsi-imx: Assert DPI and MIPI resets in poweron

The resets need to be set in poweron to handle the warm reset case.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-20718-5: drm/imx: nwl_dsi-imx: Correct clk usage
Robert Chiras [Fri, 1 Mar 2019 08:40:10 +0000 (10:40 +0200)]
MLK-20718-5: drm/imx: nwl_dsi-imx: Correct clk usage

For QM and QXP, the PHY_REF clock was default ON on SCFW so it was not
handled by driver. Since now this clock is OFF in SCFW, it can be
correctly handled by kernel driver.
Now, the PHY_REF clock rate is set by the nwl-dsi bridge driver,
depending on the display mode used.
In this driver, the PIXEL and BYPASS clocks rates were set to the same
rate as the PHY_REF, but their rates need to be set to current display
mode clock.
Also, the order of the clocks matters, so make sure the BYPASS is
enabled before the PIXEL clock.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17537-6: drm/bridge: nwl-dsi: force valid clocks
Robert Chiras [Mon, 4 Feb 2019 13:03:09 +0000 (15:03 +0200)]
MLK-17537-6: drm/bridge: nwl-dsi: force valid clocks

Some pixel clocks are not working with DSI. Until a better solution is
found, just filter-out the display modes by their clocks.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17537-5: drm/bridge: nwl-dsi: correct crtc_clock when panel used
Robert Chiras [Mon, 4 Feb 2019 12:57:36 +0000 (14:57 +0200)]
MLK-17537-5: drm/bridge: nwl-dsi: correct crtc_clock when panel used

Panels can request a higher clock than the one that can actually be
driven by the CRTC, in order to have more time for DSI commands.
If this is the case, make sure that the crtc_clock used is one that can
actually be driven for current chosen phy_ref rate.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17537-4: drm/bridge: nwl-dsi: implement mode_valid()
Robert Chiras [Mon, 4 Feb 2019 12:53:45 +0000 (14:53 +0200)]
MLK-17537-4: drm/bridge: nwl-dsi: implement mode_valid()

This patch removes the exported function nwl_dsi_get_bit_clock that was
used by nwl_dsi-imx driver in order to configure the phy driver speed
and move this configuration directly into the nwl-dsi driver.
This function is now used directly by nwl-dsi to verify which mode can or
cannot be supported by the DSI PHY.
Also, in nwl-dsi, add support for mode_valid and add each supported mode
into a list kept internally so that it can apply the needed
configuration (phyref rate, dsi lanes, bit-clock) later when the mode is
used.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17537-3: drm/bridge: nwl-dsi: Remove some vars
Robert Chiras [Mon, 4 Feb 2019 12:31:31 +0000 (14:31 +0200)]
MLK-17537-3: drm/bridge: nwl-dsi: Remove some vars

Remove the variables 'format', 'vc' and 'dsi_mode_flags' since we can
use the directly from the dsi_device object.
Also, fix the VACTIVE value (currently, -1 is subtracted from it but it
wasn't necessary).

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17537-2: drm/imx: nwl_dsi-imx: Move sync_polarity code
Robert Chiras [Mon, 4 Feb 2019 11:55:41 +0000 (13:55 +0200)]
MLK-17537-2: drm/imx: nwl_dsi-imx: Move sync_polarity code

Move the imx_nwl_update_sync_polarity function content into
imx_nwl_dsi_mode_fixup function.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-20697: drm/bridge: nwl-dsi: Fix EOTP handling
Robert Chiras [Mon, 28 Jan 2019 12:54:36 +0000 (14:54 +0200)]
MLK-20697: drm/bridge: nwl-dsi: Fix EOTP handling

Currently, the DSI controller is configured for AUTOINSERT_EOTP
depending on the CONTINUOUS or NON_CONTINUOUS clock mode, causing
problems to devices that actually need EOTP (End of Transmission
packet).
Fix this by taking into consideration the special flag created in
drm_mipi_dsi API.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-19010: drm/bridge: nwl-dsi: Fix DSI long read
Robert Chiras [Thu, 23 Aug 2018 06:29:32 +0000 (09:29 +0300)]
MLK-19010: drm/bridge: nwl-dsi: Fix DSI long read

On the long read routine, there was a bug when the driver was parsing
the value from RX_PAYLOAD register.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18850: drm/bridge: nwl-dsi: Fix bridge handling
Robert Chiras [Wed, 11 Jul 2018 13:41:42 +0000 (16:41 +0300)]
MLK-18850: drm/bridge: nwl-dsi: Fix bridge handling

When the drm_bridge object, representing the next bridge in chain,
connected to nwl-dsi brigde was attached to encoder, the
"previous_bridge" was wrongly passed, this way the next bridge was not
actually added to the encoder bridge chain.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18543-1: drm/bridge: nwl-dsi: Add pm_runtime support
Robert Chiras [Tue, 12 Jun 2018 11:25:48 +0000 (14:25 +0300)]
MLK-18543-1: drm/bridge: nwl-dsi: Add pm_runtime support

Add support for pm_runtime, so that the assigned power domain state will be
changed accordingly.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18447: drm: imx: Fix nwl_dsi init sequence
Robert Chiras [Tue, 12 Jun 2018 11:20:52 +0000 (14:20 +0300)]
MLK-18447: drm: imx: Fix nwl_dsi init sequence

The init sequence for i.MX8QXP had some flaws, making MIPI1 not working
when MIPI0 was not started.
Also, re-arrange the SC calls for a better stability during power on.
Also, change the poweroff return signature to void, since the disable
return is also void.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18357-2: drm/bridge: nwl-dsi: Add no_clk_reset property
Robert Chiras [Mon, 21 May 2018 12:07:06 +0000 (15:07 +0300)]
MLK-18357-2: drm/bridge: nwl-dsi: Add no_clk_reset property

On some platforms, like the i.MX8M, the Display Controller is not
completely powered off during suspend, just stopped. Since there are
problems if we stop the clocks in DSI sub-system, while the Display
Controller is still powered on, the display clocks will get out of sync.
Adding this new property to specify, on such platforms, not to reset the
clocks.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18357-1: drm/imx: Add no_clk_reset property
Robert Chiras [Mon, 21 May 2018 12:02:07 +0000 (15:02 +0300)]
MLK-18357-1: drm/imx: Add no_clk_reset property

Remove the NO_CLK_RESET define and add a property for this.
On some platforms, like the i.MX8M, the Display Controller is not
completely powered off during suspend, just stopped. Since there are
problems if we stop the clocks in DSI sub-system, while the Display
Controller is still powered on, the display clocks will get out of sync.
Adding this new property to specify, on such platforms, not to reset the
clocks.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17589: gpu/imx: Fix DCSS+DSI suspend/resume
Robert Chiras [Tue, 17 Apr 2018 07:56:41 +0000 (10:56 +0300)]
MLK-17589: gpu/imx: Fix DCSS+DSI suspend/resume

Since the DCSS is not fully powered off when a suspend/blank occurs, the
next time we resume/unblank, the DCSS->DSI pipeline cannot be fully
re-initialized. In order to fix this issue, we should also not
completely power off the DSI too. Just configure it to stop
transmitting, by powering off the PHY.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18177-2: drm/bridge: nwl-dsi: Change init sequence for panel
Robert Chiras [Thu, 12 Apr 2018 13:30:28 +0000 (16:30 +0300)]
MLK-18177-2: drm/bridge: nwl-dsi: Change init sequence for panel

Currently, the DSI panel init sequence is made in the prepare function,
right after the reset pin is asserted. This implies that at this moment,
the DSI host needs to be enabled. If the DSI host is enabled during
panel prepare, there will be DSI signal on the DSI lanes during the
panel reset, which is wrong.

In order to fix this, the init sequence was moved from prepare to
enable, while the reset sequence is made in prepare. Also, the DSI host
intialization has to be updated in such a way that the host won't send
DSI signals on the lanes between the prepare and enable of the panel.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18106: drm/bridge: Fix nwl-dsi bridge handling
Robert Chiras [Thu, 19 Apr 2018 08:25:41 +0000 (11:25 +0300)]
MLK-18106: drm/bridge: Fix nwl-dsi bridge handling

Since the drm_bridge_attach function now supports chained bridges, there
is no need for nwl_dsi_add_bridge and nwl_dsi_del_bridge functions, so
remove them.
Now, we can pass the existent bridge to drm_bridge_attach.

This fixes a bug created during kernel 4.14 rebase process.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18106: drm/imx: Fix nwl_dsi-imx bridge handling
Robert Chiras [Thu, 19 Apr 2018 08:22:08 +0000 (11:22 +0300)]
MLK-18106: drm/imx: Fix nwl_dsi-imx bridge handling

The nwl_dsi-imx which is the platform driver for the NortWest Logic DSI
host controller found on IMX platforms handles the DSI host as a bridge.
Since the drm_bridge_attach function now supports chained bridges, there
is no need for nwl_dsi_add_bridge and nwl_dsi_del_bridge functions.
Just pass the existent bridge to drm_bridge_attach.

This fixes a bug created during kernel 4.14 rebase process.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17684: drm/bridge: nwl-dsi: Propagate DSI format to the attached panel/bridge
Mirela Rabulea [Tue, 20 Mar 2018 11:01:25 +0000 (13:01 +0200)]
MLK-17684: drm/bridge: nwl-dsi: Propagate DSI format to the attached panel/bridge

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
6 years agoMLK-17684-2: drm/bridge: nwl-dsi: Let CRTC dictate the final bus format
Mirela Rabulea [Wed, 7 Mar 2018 08:45:29 +0000 (10:45 +0200)]
MLK-17684-2: drm/bridge: nwl-dsi: Let CRTC dictate the final bus format

Use the bus format that was established by CRTC in
crtc->mode.private_flags.
This will be available during enable phase.

The DSI host will be configured via interface_color_coding
and pixel_format (DPI-2 interface ports).
Previously the interface_color_coding was hardcoded to 24-bit.

Set the DSI pixel format before it is necessary in
nwl_dsi_get_bit_clock, during imx_nwl_dsi_enable.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
6 years agoMLK-17275-4: drm/imx: nwl_dsi-imx: Update driver for reconfig
Robert Chiras [Thu, 21 Dec 2017 09:14:16 +0000 (11:14 +0200)]
MLK-17275-4: drm/imx: nwl_dsi-imx: Update driver for reconfig

Initially, this driver was designed to work with NWL driver as a
drm_bridge and it is required for this to work, otherwise it will defer.
When CONFIG_OF_DYNAMIC is used, the NWL bridge can be disabled by it's
remote endpoint, it that endpoint is an i2c capable device and it fails
to find a physical device on the expected i2c address.
If the NWL drm_bridge is disabled, since this driver it is required by
the master DRM device, just do nothing, so the drm_encoder won't be
created. So, if the NWL drm_bridge is missing, this driver will just do
nothing, in order to not interfere with the other available devices
required by the DRM master.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17275-3: drm/bridge: nwl-dsi: Fix remove/detach
Robert Chiras [Thu, 21 Dec 2017 09:06:44 +0000 (11:06 +0200)]
MLK-17275-3: drm/bridge: nwl-dsi: Fix remove/detach

Add a check in detach function, so that the mipi_dsi_host_unregister
will occur only if the host was registered.
Also, remove the unnecessary calls to host_unregister from probe and
remove functions.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17290-03 drm/bridge: request/free irq in dynamical
Fugang Duan [Tue, 19 Dec 2017 05:36:00 +0000 (13:36 +0800)]
MLK-17290-03 drm/bridge: request/free irq in dynamical

Request/free irq in dynamical can runtime manage the irq domain's
clock and power if irq domain support runtime pm and manage its
clock in its pm callback.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Tested-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Acked-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17137-2: drm/bridge: Fix bridge_detach for nwl-dsi
Robert Chiras [Fri, 8 Dec 2017 13:15:35 +0000 (15:15 +0200)]
MLK-17137-2: drm/bridge: Fix bridge_detach for nwl-dsi

When the bridge is detached from it's parent, we also need to unregister
the dsi_host. Also, in enable, check if we have a panel or a bridge
connected, otherwise enable is not needed.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-17047-2: drm/imx: Fix suspend/resume for nwl_dsi-imx
Robert Chiras [Fri, 8 Dec 2017 14:21:33 +0000 (16:21 +0200)]
MLK-17047-2: drm/imx: Fix suspend/resume for nwl_dsi-imx

This patch addresses two issues:
1. Always request/release bus_freq, not just on suspend/resume routines
2. Check if the driver is running when doing a suspend, so that we won't
enable it by mistake on resume.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-21142-2: phy: mixel-mipi: Assert PHY reset in phy_init
Oliver Brown [Wed, 13 Mar 2019 19:15:49 +0000 (14:15 -0500)]
MLK-21142-2: phy: mixel-mipi: Assert PHY reset in phy_init

The reset needs to be set in phy_init to handle the warm reset case.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-19295: phy: mixel-mipi: Improve MIPI PHY timing parameters
Oliver Brown [Wed, 22 Aug 2018 19:20:16 +0000 (14:20 -0500)]
MLK-19295: phy: mixel-mipi: Improve MIPI PHY timing parameters

Improving the PHY timing parameters by using linear interpolation for the linear parameters.
For, the non-linear parameters, use more frequency steps to improve the accuracy.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18651: phy: Update Mixel MIPI-DSI phy register addresses
Robert Chiras [Thu, 21 Jun 2018 07:00:48 +0000 (10:00 +0300)]
MLK-18651: phy: Update Mixel MIPI-DSI phy register addresses

Some of the Mixel phy (the MIPI DPHY found on 8QM, 8QXP and 8M), have
different addresses, depending on the platform.

Update the driver to have the correct address for a corresponding
platform.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-18178: phy: mixel-mipi: Update the PRG register settings
Robert Chiras [Thu, 12 Apr 2018 13:32:39 +0000 (16:32 +0300)]
MLK-18178: phy: mixel-mipi: Update the PRG register settings

Update the register settings for PRG values to be more accurate,
depending on the timing used.
Also, update the init function to make sure the PHY is powered OFF in
this stage, and the power_on function to correctly power ON the PHY
according to the specification: assert PD_PLL, wait for LOCK, assert
PD_DPHY.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>