linux.git
6 years agoMLK-19510: ISI: fix isi cann't restore to original size after resize
Guoniu.Zhou [Mon, 17 Sep 2018 03:33:22 +0000 (11:33 +0800)]
MLK-19510: ISI: fix isi cann't restore to original size after resize

1. add CHNL_SCL_IMG_CFG register that is new added in QXP/QM B0
2. according to isi owner's comments, CHNL_SCL_IMG_CFG need to
equal to CHNL_IMG_CFG when scaling disabled and equal to scaled
image size when scaling enabled, so add configuration for this
register.
3. Becuse isi software reset can't reset isi register to default
, so it need to manual clear if there is no scaling.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-19514-2: ISI: use ping-pong buffer of ISI
Guoniu.Zhou [Tue, 4 Sep 2018 10:05:38 +0000 (18:05 +0800)]
MLK-19514-2: ISI: use ping-pong buffer of ISI

1. Use ping-pong buffer of isi.
2. Add multi-plane support for m2m out queue. When
V4L2 m2m device support multi-plane, it should be
applied for both input and output, so add it.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-19343: ISI: add memory to memory support for qm and qxp
Guoniu.Zhou [Mon, 27 Aug 2018 10:28:23 +0000 (18:28 +0800)]
MLK-19343: ISI: add memory to memory support for qm and qxp

Add memory to memory support for qm and qxp. Because only
ISI channel0 can support memory to memory feature so this
feature only support one channel. User can use channel 0
as other function when it isn't used for m2m.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
6 years agoMLK-18772: ISI: correct isi RGB to YUV conversion coefficients
Guoniu.Zhou [Thu, 9 Aug 2018 09:44:35 +0000 (17:44 +0800)]
MLK-18772: ISI: correct isi RGB to YUV conversion coefficients

Correct RGB to YUV conversion coefficients and change csc mode
to RGB to YCbCr

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
6 years agoMLK-19007-1: camera: add "QCIF, QVGA, NTSC, PAL, XGA, QSXGA" support
Guoniu.Zhou [Wed, 25 Jul 2018 02:46:00 +0000 (10:46 +0800)]
MLK-19007-1: camera: add "QCIF, QVGA, NTSC, PAL, XGA, QSXGA" support

1. add resolution "QCIF, QVGA, NTSC, PAL, XGA, QSXGA" support for
parallel camera sensor driver

2. enable ISI channel line buffer chain when image having higher
than 2048 horizontal resolution

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
6 years agoMLK-18439: ISI: fix image tearing issue
Guoniu.Zhou [Mon, 16 Jul 2018 01:03:19 +0000 (09:03 +0800)]
MLK-18439: ISI: fix image tearing issue

When there is no free buffer in driver as isi output, isi
will still write buffer which has been dequeue to userspace
and the buffer maybe is being scanning out by DC. So add a
temporary buffer as its output when the case happen

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
6 years agoMLK-18517-1: ISI: fix system reboot stress test from nfs fail
Guoniu.Zhou [Thu, 28 Jun 2018 01:47:54 +0000 (09:47 +0800)]
MLK-18517-1: ISI: fix system reboot stress test from nfs fail

1. System will dump painc message and hang when do system
reboot stress test. It caused by ISI HW reset function. When
user open the video device, it will get the device and driver
will turn on ISI power domain, but after that, ISI HW reset
will first turn off and then turn on it's power. During this
time, the process which open ISI channel 0 maybe sleep and
the other process which open other ISI channel will active but
the other channel power domain depend on channel 0. It leads to
system panic. So change msleep to udelay and move HW reset to
other place.

2. Refine ISI system and runtime suspend/resume.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-17885-2: camera: add nv12 output format support
Guoniu.Zhou [Thu, 22 Mar 2018 02:42:44 +0000 (10:42 +0800)]
MLK-17885-2: camera: add nv12 output format support

Add NV12 output format support. Because nv12 is multi
planes format, so driver need add device for every planes

Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-17230-8: camera: add CI_PI in camera device framework
Guoniu.Zhou [Mon, 5 Feb 2018 08:26:38 +0000 (16:26 +0800)]
MLK-17230-8: camera: add CI_PI in camera device framework

Add CI_PI and ov5640 camera sensor support in camera device
framework. The data flow is "ov5640->ci_pi->isi_ch0". Disable
the other channels of ISI.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 37bc5d225e8a3eeb21fef5d94335d1edb2036988)

6 years agoMLK-17019 Correct Copyright
Peng Fan [Wed, 29 Nov 2017 03:48:04 +0000 (11:48 +0800)]
MLK-17019 Correct Copyright

Correct Copyright

Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-16046: mx8 imaging SS: Fix build warning
Sandor Yu [Fri, 21 Jul 2017 04:07:44 +0000 (12:07 +0800)]
MLK-16046: mx8 imaging SS: Fix build warning

Fix build warning:
warning: missing braces around initializer [-Wmissing-braces]

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-20694: media: m2m: add control for querying minimum buffer for capture and output
Guoniu.Zhou [Tue, 19 Mar 2019 09:29:01 +0000 (17:29 +0800)]
MLK-20694: media: m2m: add control for querying minimum buffer for capture and output

Add V4L2_CID_MIN_BUFFERS_FOR_CAPTURE and V4L2_CID_MIN_BUFFERS_FOR_OUTPUT control
ID for querying minimum buffer for capture and output

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-20923: ISI: improve ISI memory to memory performance
Guoniu.Zhou [Wed, 13 Feb 2019 10:50:39 +0000 (18:50 +0800)]
MLK-20923: ISI: improve ISI memory to memory performance

Refer to ISI validataion code, there is no need to enable ISI
mem2mem read done interrupt and driver can handle buffers in
frame received interrupt service

Remove 50ms delay when enable ISI AXI read, it will improve
performance obviously

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit bdabe035cd5c57d713f824e61f120213ed9357ba)
(cherry picked from commit 7dd4c6affaaceefd80e6b4a033c21f6b26303902)

6 years agoMLK-20595-2: camera: check camera's running state before suspend
Guoniu.Zhou [Mon, 17 Dec 2018 02:16:55 +0000 (10:16 +0800)]
MLK-20595-2: camera: check camera's running state before suspend

Check camera's running state before suspend for imx8qm/qxp
and don't support suspend when camera's running

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-20529-1: camera: remove V4L2 limitation when the number of sensors connected...
Guoniu.Zhou [Thu, 6 Dec 2018 05:34:55 +0000 (13:34 +0800)]
MLK-20529-1: camera: remove V4L2 limitation when the number of sensors connected is less than the required in dtb

1. create links between entities when the number of sensors
connected is less than the required in dtb
2. unregister the video device which sensors are not connected

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 33234cc31362b5ee23be34ce2a00947e0dc96acb)

6 years agoMLK-20326-2: ISI: enable horizonal and vertical flip for mem2mem
Guoniu.Zhou [Fri, 9 Nov 2018 10:48:13 +0000 (18:48 +0800)]
MLK-20326-2: ISI: enable horizonal and vertical flip for mem2mem

Eanble horizonal and vertical flip for memory to memory function
of ISI

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-19514-2: ISI: use ping-pong buffer of ISI
Guoniu.Zhou [Tue, 4 Sep 2018 10:05:38 +0000 (18:05 +0800)]
MLK-19514-2: ISI: use ping-pong buffer of ISI

1. Use ping-pong buffer of isi.
2. Add multi-plane support for m2m out queue. When
V4L2 m2m device support multi-plane, it should be
applied for both input and output, so add it.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-19343: ISI: add memory to memory support for qm and qxp
Guoniu.Zhou [Mon, 27 Aug 2018 10:28:23 +0000 (18:28 +0800)]
MLK-19343: ISI: add memory to memory support for qm and qxp

Add memory to memory support for qm and qxp. Because only
ISI channel0 can support memory to memory feature so this
feature only support one channel. User can use channel 0
as other function when it isn't used for m2m.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
6 years agoMLK-19108: ISI: fix isi hang issue when open it many times
Guoniu.Zhou [Tue, 31 Jul 2018 07:58:41 +0000 (15:58 +0800)]
MLK-19108: ISI: fix isi hang issue when open it many times

When one ISI channel is receiving data, if an other process
just open it at the same time and then close, it will lead
to this channel hang. The reason is soft reset in release
callback, so it make the channel stop work. Add an counter
for open isi channel and really soft reset the channel when
the counter equal to zero.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
6 years agoMLK-18439: ISI: fix image tearing issue
Guoniu.Zhou [Mon, 16 Jul 2018 01:03:19 +0000 (09:03 +0800)]
MLK-18439: ISI: fix image tearing issue

When there is no free buffer in driver as isi output, isi
will still write buffer which has been dequeue to userspace
and the buffer maybe is being scanning out by DC. So add a
temporary buffer as its output when the case happen

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
6 years agoMLK-18517-1: ISI: fix system reboot stress test from nfs fail
Guoniu.Zhou [Thu, 28 Jun 2018 01:47:54 +0000 (09:47 +0800)]
MLK-18517-1: ISI: fix system reboot stress test from nfs fail

1. System will dump painc message and hang when do system
reboot stress test. It caused by ISI HW reset function. When
user open the video device, it will get the device and driver
will turn on ISI power domain, but after that, ISI HW reset
will first turn off and then turn on it's power. During this
time, the process which open ISI channel 0 maybe sleep and
the other process which open other ISI channel will active but
the other channel power domain depend on channel 0. It leads to
system panic. So change msleep to udelay and move HW reset to
other place.

2. Refine ISI system and runtime suspend/resume.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-17230-8: camera: add CI_PI in camera device framework
Guoniu.Zhou [Mon, 5 Feb 2018 08:26:38 +0000 (16:26 +0800)]
MLK-17230-8: camera: add CI_PI in camera device framework

Add CI_PI and ov5640 camera sensor support in camera device
framework. The data flow is "ov5640->ci_pi->isi_ch0". Disable
the other channels of ISI.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 37bc5d225e8a3eeb21fef5d94335d1edb2036988)

6 years agoMLK-16823-2: mipi_csi: Add runtime suspend/resume
Guoniu.Zhou [Wed, 15 Nov 2017 12:13:30 +0000 (20:13 +0800)]
MLK-16823-2: mipi_csi: Add runtime suspend/resume

Add runtime suspend/resume support for ISI. For saving
power, the ISI turn off it's power domain after probe.

Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit d0cf6f32660c5b03fda5083fee578579f22c4d3b)

6 years agoMLK-17019 Correct Copyright
Peng Fan [Wed, 29 Nov 2017 03:48:04 +0000 (11:48 +0800)]
MLK-17019 Correct Copyright

Correct Copyright

Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-16695-2: mipi_csi: Add pm suspend and resume support
Guoniu.Zhou [Fri, 10 Nov 2017 03:01:46 +0000 (11:01 +0800)]
MLK-16695-2: mipi_csi: Add pm suspend and resume support

Add power manager suspend and resume support for ISI

Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@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-20192-2: ISI: Coverity: remove the dead code
Guoniu.Zhou [Thu, 20 Dec 2018 02:28:42 +0000 (10:28 +0800)]
MLK-20192-2: ISI: Coverity: remove the dead code

Because the address of an object is never null and the if
statement will never true so remove the dead code

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-20595-2: camera: check camera's running state before suspend
Guoniu.Zhou [Mon, 17 Dec 2018 02:16:55 +0000 (10:16 +0800)]
MLK-20595-2: camera: check camera's running state before suspend

Check camera's running state before suspend for imx8qm/qxp
and don't support suspend when camera's running

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-20529-1: camera: remove V4L2 limitation when the number of sensors connected...
Guoniu.Zhou [Thu, 6 Dec 2018 05:34:55 +0000 (13:34 +0800)]
MLK-20529-1: camera: remove V4L2 limitation when the number of sensors connected is less than the required in dtb

1. create links between entities when the number of sensors
connected is less than the required in dtb
2. unregister the video device which sensors are not connected

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 33234cc31362b5ee23be34ce2a00947e0dc96acb)

6 years agoMLK-20325: ISI: fix reference count error when camera is not connected
Guoniu.Zhou [Mon, 12 Nov 2018 08:17:44 +0000 (16:17 +0800)]
MLK-20325: ISI: fix reference count error when camera is not connected

If camera is not connected and user try to use mem2mem function,
driver will return error but isi channel0 reference counter is
still increased by one. This will lead to mem2mem driver return
EBUSY error when user open mem2mem device, so correct this bug
in this patch.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-20326-3: ISI: enable alpha insertion feature for camera
Guoniu.Zhou [Fri, 9 Nov 2018 10:52:46 +0000 (18:52 +0800)]
MLK-20326-3: ISI: enable alpha insertion feature for camera

Enable global alpha insertion feature for camera

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-20326-1: ISI: enable horizonal and vertical flip for camera
Guoniu.Zhou [Fri, 9 Nov 2018 10:37:09 +0000 (18:37 +0800)]
MLK-20326-1: ISI: enable horizonal and vertical flip for camera

Enable horizonal and vertical flip for camera image

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-19291: ISI: correct color mapping between V4L2 and ISI
Guoniu.Zhou [Thu, 8 Nov 2018 11:25:44 +0000 (19:25 +0800)]
MLK-19291: ISI: correct color mapping between V4L2 and ISI

Correct color mapping between V4L2 and ISI

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-20123-1: camera: add automatic selection mode for mipi ov5640
Guoniu.Zhou [Tue, 30 Oct 2018 06:58:48 +0000 (14:58 +0800)]
MLK-20123-1: camera: add automatic selection mode for mipi ov5640

There is two methods to select different mode for camera sensor, one
is setting mode by VIDIOC_S_PARM ioctl and the other is automatic
selection through resolution. If resolution match one of camera sensor
supported, driver will select the corresponding mode. If not, driver
will select the max resolution supported by sensor and use ISI to
resize to the target resolution.

This patch is for mipi interface of ov5640 sensor

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 4c560890906f7df33e68a65372f60778cb1406b7)

6 years agoMLK-20046-2: ISI: add YUV444M format support
Guoniu.Zhou [Thu, 25 Oct 2018 03:14:52 +0000 (11:14 +0800)]
MLK-20046-2: ISI: add YUV444M format support

add YUV444M format support

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit e424d16926d0320b31850bdd293e77c164a80661)

6 years agoMLK-20046-1: ISI: correct RGB24 and BGR24 format configuration
Guoniu.Zhou [Wed, 24 Oct 2018 07:26:20 +0000 (15:26 +0800)]
MLK-20046-1: ISI: correct RGB24 and BGR24 format configuration

According to V4L2 doc, RGB24 and BGR24 should have three bytes
for each pixel rather than four, so correct it.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 3694f7ffe2443d86ae740f12393edc007c997a98)

6 years agoMMFMWK-8296: ISI: return error code when user try to do upscale
Guoniu.Zhou [Mon, 22 Oct 2018 07:48:00 +0000 (15:48 +0800)]
MMFMWK-8296: ISI: return error code when user try to do upscale

Return error code when user try to do upscale since isi don't support.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 59949e29dcd996c50cae43bc5ff3f89907761c1b)

6 years agoMMFMWK-8297: ISI: return error when ISI chan0 is busy
Guoniu.Zhou [Mon, 22 Oct 2018 07:19:27 +0000 (15:19 +0800)]
MMFMWK-8297: ISI: return error when ISI chan0 is busy

When ISI channel0 is used to recevice camera data, it can
not be used to mem2mem. So return -EBUSY error code when
user try to use them at the same time.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit c6d5bf866819deaaf4900ae47d575c5a36d30a66)

6 years agoMLK-19772: ISI: fill ISI out buffer address before enabling ISI channel
Guoniu.Zhou [Sat, 29 Sep 2018 03:54:03 +0000 (11:54 +0800)]
MLK-19772: ISI: fill ISI out buffer address before enabling ISI channel

1. Before enabling ISI channel, driver need to fill its out buffer
address, so correct this sequence

2. Because ISI use ping-pong buffer and write data to memory with
BUF1->BUF2->BUF1... sequence. If it finish with BUF1 and user start
a new capture process, it will start with BUF2. This will lead the
buffer ready for being read is not equal to buffer written by ISI.So
HW reset ISI, in order to confirm it start with BUF1.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 794ce0cb7d7f129fb46f5d6f38e82cc1e7f2a367)

6 years agoMLK-19730: ISI: correct V4L2_PIX_FMT_RGB32 to V4L2_PIX_FMT_XRGB32
Guoniu.Zhou [Wed, 26 Sep 2018 05:50:43 +0000 (13:50 +0800)]
MLK-19730: ISI: correct V4L2_PIX_FMT_RGB32 to V4L2_PIX_FMT_XRGB32

Because V4L2_PIX_FMT_RGB32 is deprecated and must not
be used by new drivers. V4L2_PIX_FMT_XRGB32 is used to
replace it.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit a6780d01aa9219c6a720177bb85af755ba09a24a)

6 years agoMLK-19514-3: ISI: reorder video device register for m2m
Guoniu.Zhou [Mon, 10 Sep 2018 08:55:41 +0000 (16:55 +0800)]
MLK-19514-3: ISI: reorder video device register for m2m

Register m2m video device after all camera devices

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-19343: ISI: add memory to memory support for qm and qxp
Guoniu.Zhou [Mon, 27 Aug 2018 10:28:23 +0000 (18:28 +0800)]
MLK-19343: ISI: add memory to memory support for qm and qxp

Add memory to memory support for qm and qxp. Because only
ISI channel0 can support memory to memory feature so this
feature only support one channel. User can use channel 0
as other function when it isn't used for m2m.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
6 years agoMLK-19108: ISI: fix isi hang issue when open it many times
Guoniu.Zhou [Tue, 31 Jul 2018 07:58:41 +0000 (15:58 +0800)]
MLK-19108: ISI: fix isi hang issue when open it many times

When one ISI channel is receiving data, if an other process
just open it at the same time and then close, it will lead
to this channel hang. The reason is soft reset in release
callback, so it make the channel stop work. Add an counter
for open isi channel and really soft reset the channel when
the counter equal to zero.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
6 years agoMLK-18439: ISI: fix image tearing issue
Guoniu.Zhou [Mon, 16 Jul 2018 01:03:19 +0000 (09:03 +0800)]
MLK-18439: ISI: fix image tearing issue

When there is no free buffer in driver as isi output, isi
will still write buffer which has been dequeue to userspace
and the buffer maybe is being scanning out by DC. So add a
temporary buffer as its output when the case happen

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
6 years agoMLK-18517-2: CSI: simplified mipi and parallel csi suspend/resume implementation
Guoniu.Zhou [Fri, 29 Jun 2018 03:12:01 +0000 (11:12 +0800)]
MLK-18517-2: CSI: simplified mipi and parallel csi suspend/resume implementation

1. Delete power state maintenance of mipi and parallel csi.
This can simplified driver's resume/suspend implementation.

2. parallel_csi_power_control is a helper function which is
used to turn on/ff power domain of CI_PI. CI_PI will restore
its default parent clock for pixel clock after system resume
and can't be changed when its power is on. This issue is fixed
in scfw, more detail, please refer to "SCF-76". So remove it
in driver.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
6 years agoMLK-18517-1: ISI: fix system reboot stress test from nfs fail
Guoniu.Zhou [Thu, 28 Jun 2018 01:47:54 +0000 (09:47 +0800)]
MLK-18517-1: ISI: fix system reboot stress test from nfs fail

1. System will dump painc message and hang when do system
reboot stress test. It caused by ISI HW reset function. When
user open the video device, it will get the device and driver
will turn on ISI power domain, but after that, ISI HW reset
will first turn off and then turn on it's power. During this
time, the process which open ISI channel 0 maybe sleep and
the other process which open other ISI channel will active but
the other channel power domain depend on channel 0. It leads to
system panic. So change msleep to udelay and move HW reset to
other place.

2. Refine ISI system and runtime suspend/resume.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-17885-2: camera: add nv12 output format support
Guoniu.Zhou [Thu, 22 Mar 2018 02:42:44 +0000 (10:42 +0800)]
MLK-17885-2: camera: add nv12 output format support

Add NV12 output format support. Because nv12 is multi
planes format, so driver need add device for every planes

Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-18053: camera: Refine VIDIOC_DBG_G_CHIP_IDENT ioctl
Guoniu.Zhou [Tue, 17 Apr 2018 06:48:13 +0000 (14:48 +0800)]
MLK-18053: camera: Refine VIDIOC_DBG_G_CHIP_IDENT ioctl

Driver only return camera name for max9286 before, but
the driver is now supporting ov5640. So refine this ioctl
implement and remove max9286 camera driver private data

Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-17741-2: media: add ov5640 mipi driver
Guoniu.Zhou [Fri, 9 Mar 2018 08:19:37 +0000 (16:19 +0800)]
MLK-17741-2: media: add ov5640 mipi driver

Add driver for ov5640 mipi csi interface.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 860dab368735dcbf248da7b74163ce6048a57514)

6 years agoMLK-17230-8: camera: add CI_PI in camera device framework
Guoniu.Zhou [Mon, 5 Feb 2018 08:26:38 +0000 (16:26 +0800)]
MLK-17230-8: camera: add CI_PI in camera device framework

Add CI_PI and ov5640 camera sensor support in camera device
framework. The data flow is "ov5640->ci_pi->isi_ch0". Disable
the other channels of ISI.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 37bc5d225e8a3eeb21fef5d94335d1edb2036988)

6 years agoMLK-17088: mipi_csi: improve the compatiblility of S_FMT
Guoniu.Zhou [Wed, 13 Dec 2017 07:15:40 +0000 (15:15 +0800)]
MLK-17088: mipi_csi: improve the compatiblility of S_FMT

1) When app call S_FMT ioctl, they may only set width, height
   and format of image. So driver can't determine whether it
   support the specified format by checking the format fourcc
   value and the plane number.

2) Driver should also fill plane and sizeimage member in S_FMT
   ioctl, because some apps use this information after they call
   S_FMT ioctl, such as gstreamer.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-16823-2: mipi_csi: Add runtime suspend/resume
Guoniu.Zhou [Wed, 15 Nov 2017 12:13:30 +0000 (20:13 +0800)]
MLK-16823-2: mipi_csi: Add runtime suspend/resume

Add runtime suspend/resume support for ISI. For saving
power, the ISI turn off it's power domain after probe.

Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit d0cf6f32660c5b03fda5083fee578579f22c4d3b)

6 years agoMLK-17019 Correct Copyright
Peng Fan [Wed, 29 Nov 2017 03:48:04 +0000 (11:48 +0800)]
MLK-17019 Correct Copyright

Correct Copyright

Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-16693-2: mipi_csi: fix null video name setting
Guoniu.Zhou [Thu, 2 Nov 2017 07:01:54 +0000 (15:01 +0800)]
MLK-16693-2: mipi_csi: fix null video name setting

Setting video device name before memset operation
lead to null value of vdev->name

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

6 years agoMLK-16693-1: mipi_csi: Add enum framesize ioctl
Guoniu.Zhou [Thu, 2 Nov 2017 03:18:08 +0000 (11:18 +0800)]
MLK-16693-1: mipi_csi: Add enum framesize ioctl

Enum framesize include VIDIOC_ENUM_FRAMESIZES and
VIDIOC_ENUM_FRAMEINTERVALS cmd.

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

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>