Commit Graph

3211 Commits

Author SHA1 Message Date
02228658df MLK-19514-1: ISI: correct capture and output meaning
According to V4L2 doc, cap_q_ctx is for "output to memory"
queue and out_q_ctx is for "input from memory", so capature
should represent for output of ISI and output should represent
for ISI's input. But I reversed their relationship, so correct
it.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2019-02-12 10:33:50 +08:00
dd85154a96 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>
2019-02-12 10:33:37 +08:00
eb05eb19cf MLK-18451: mxc-jpeg: Fix jpeg encoder output
Use two chained descriptors for encoder (config desc & encode desc),
they are set-up in new function mxc_jpeg_config_enc_desc.

Refactor function mxc_jpeg_enc_config, in order for the encoder to
function correctly, the CAST_MODE register needs to be written after
the descriptor(s) are ready.

Set-up decoder descriptor in new function mxc_jpeg_config_dec_desc,
this was previously done in mxc_jpeg_device_run, which is
leaner & cleaner now.

Function mxc_jpeg_go cannot be used both for encoder and decoder, because
the CAST IP control registers are different, the decoder has CTRL
(offset 0x34) while the encoder has MODE register (offset 0x0).
So, have two functions instead: mxc_jpeg_go_enc and mxc_jpeg_go_dec.

Function mxc_jpeg_reset had no purpose anymore, instead use
mxc_jpeg_sw_reset, for soft reset.

Add function mxc_jpeg_set_l_endian.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
2019-02-12 10:33:19 +08:00
9709455e36 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>
2019-02-12 10:33:16 +08:00
4574cd4dde MLK-19111: ISI: fix module installation fail issue
If build ISI driver as module and insmod it after system
boot up, it will fail. Because lack of MODULE_LICENSE("GPL")
,insmod isi driver will print many unknown symbol messages

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
2019-02-12 10:33:15 +08:00
1fa45387f5 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>
2019-02-12 10:33:15 +08:00
c999c0af06 MLK-19107: ov10635: add "720P, WVGA, VGA, CIF, QVGA" support for ov10635
Add 30fps "720P, WVGA, VGA, CIF, QVGA" support for ov10635

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
2019-02-12 10:33:15 +08:00
1ea0ed88a4 MLK-19106: camera: add enable attribute to turn on/off color bar
Add analog_test_pattern device attribute for ov16035 in order
to turn on/off its color bar test pattern to debug

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
2019-02-12 10:33:15 +08:00
3e824c3427 MLK-19007-2: camera: add "NTSC, 720P, QSXGA" for mipi ov5640
1. Use ISI channel 2 instead of 1 for mipi ov5640 because if
image line resolution is more than 2k, isi line buffer need
to chain to recevice line data

2. Add 15fps QSXGA, 30fps NTSC and 720P support for mipi ov5640

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
2019-02-12 10:33:15 +08:00
96d6885997 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>
2019-02-12 10:33:15 +08:00
eb1ed0fd33 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>
2019-02-12 10:33:14 +08:00
a5e1f2a6a3 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>
2019-02-12 10:33:14 +08:00
90bb8f4f46 MLK-18451: mxc-jpeg: Fix encoder stuck on second run
Do a soft reset before job run.
Encoder now runs succesivelly without crash or stuck, but outputs 0.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
2019-02-12 10:33:08 +08:00
d3e864c00c MLK-18450: mxc-jpeg: Fix JPEG decoder crash
Fixed decoder crasher by creating a structure to encompass the descriptors
and associated it to the jpeg device, one for each slot.
Removed mxc_jpeg_buf, as writing to its fields was causing
memory corruption sometimes (depending on how src_buf & dst_buf
got allocated, writing to one was overwriting the other).

For now, only slot 0 is used (no regression here, just a TODO).

Note that the decoded image looks ok only on QXP B0, not A0.

The decoder_test application will be patched in linux-test,
the old one should work too, but needed cleanup.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
2019-02-12 10:33:08 +08:00
e1fb2157a7 MLK-18998: mxc-jpeg: Fix jpeg format for gstreamer
Fix proposed by Bing Song.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
2019-02-12 10:33:08 +08:00
413470e79f 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>
2019-02-12 10:33:08 +08:00
282a5e0e24 MLK-18615-3 media: camera: remove the stream on off operation for 5M resolution
if use stream on/off, the 5M resolution has timing problem causing
there's no CSI interrupt coming on some boards. remove them to fix.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
2019-02-12 10:32:34 +08:00
00e5481722 MLK-18482: ISI: fix isi resume fail issue
Driver enable clock will fail in isi system power resume
callback because isi power domain is power off after system
power suspend so driver need to get device before disable
clock in system power suspend/resume callback and then put
device after disable clock.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 668fdea95f)
2019-02-12 10:32:17 +08:00
e6eadee0d7 MLK-18493: mxc-jpeg: Use image settings from jpeg markers inside jpeg decoder
Image information can be extracted from the JPEG SOH marker:
image format (YUV444/YUV420/YUV422/Gray), width & height, precision.
Use that information and apply it to the JPEG-DEC_WRP control registers.
Also fixed the decoder for non-square images.
Replace pr_*() and printk() calls with dev_*().

Currently working image formats: YUV444, YUV422, Gray
Not working formats: YUV420

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>, Sandor Yu <sandor.yu@nxp.com>
2019-02-12 10:32:14 +08:00
eda4286844 MLK-18578: hdmi_rx: wait longer time for audio info frame
The wait time is short that cause recording failed sometimes

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
2019-02-12 10:32:11 +08:00
7a9810af7f MLK-18578: hdmi_rx: fix issue that ARC can't work in 4k.
After changing the deemphasis to 0dB in TX_DIG_CTRL_REG_1
the issue that ARC can't work with 4k resolution is fixed

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
2019-02-12 10:32:10 +08:00
0074b54ca4 MLK-18544 media: camera: correct ov5640 setting for 2592x1944 at 15fps
set scale divider for mipi in reg 0x3035 to 0x11 to achieve 15fps

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2019-02-12 10:32:09 +08:00
86ff2008b5 MLK-18552-2 media: mipi_csi: enable disp_axi and disp_apb before the access
On i.MX8MM, IC design uses registers from CSI to do MIPI PHY reset. Need enable
disp_axi and disp_apb before the access, otherwise meet hang issue.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2019-02-12 10:32:08 +08:00
be07cfbd1c MLK-18440: ISI: fix the first frame black issue
Camera sensor need to be enabled before ISI when
resolution of caputure image is less than 640*480,
but hdmi need to be enabled after ISI, so add this
patch to compatible these two cases

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit c8d17ffcb0)
2019-02-12 10:32:01 +08:00
72a36d6517 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>
2019-02-12 10:32:01 +08:00
9b9c927c85 MLK-18397-1: hdmi_rx: turn on aux_ana for rx arc
turn on aux_ana for rx arc

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-02-12 10:31:57 +08:00
59e5fa6d4e MLK-18362-2 midea: mipi_csi: add mipi phy reset on imx8mm
on imx8mm, use different way rather than via SRC. so use different
device id to distinguish different MIPI-PHY reset method.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
2019-02-12 10:31:57 +08:00
0949eb6a01 MLK-18369: camera: fix boot up have some isi dump error issue
It caused by 10ms delay during isi hardware reset. During this
10ms, runtime PM will call isi runtime suspend/resume callback
but isi is not ready, so delete the 10ms delay.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
(cherry picked from commit 7d0922252f)
2019-02-12 10:31:57 +08:00
72aa88ba95 MLK-18368-5: hdmi_rx: add hdmi rx audio clock
add clock for hdmi audio rx

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-02-12 10:31:56 +08:00
09416efc80 MLK-18368-4: hdmi_rx: add generic hdmi audio rx driver
Register generic hdmi audio rx driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-02-12 10:31:56 +08:00
c54dca5f88 MLK-18366: hdmi_rx: return error when HDMI PHY failed initialized
return error state when HDMI PHY failed initialized.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2019-02-12 10:31:54 +08:00
2e1ed13979 MLK-18355-8: hdmi rx: Add HDMI RX CEC function
Add HDMI RX CEC function in hdmi rx driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2019-02-12 10:31:54 +08:00
d138b8ef80 MLK-18355-7: hdmi_rx: Enable HDMI RX CEC clock
Enable HDMI RX CEC clock when hdmi rx driver initialized.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2019-02-12 10:31:54 +08:00
619f15e2c9 MLK-18355-6: hdmi_rx: move startup function to probe function
Move startup function from s_power to probe function,
HDMI RX controller keep in running state after driver probe.
The startup function should move to cable plugin handle.
When iMX8QM B0 silicon HDMI RX hot plug function is ready.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2019-02-12 10:31:54 +08:00
d470355ddd MLK-18355-5: hdmi_rx: Add timeout for check HDMI 5V
Add timeout for HDMI 5V check.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2019-02-12 10:31:54 +08:00
9ed32af94a MLK-18267-4: hdmi rx: hdmi rx driver for imx8qm
Enable hdmi rx driver for imx8qm.
Driver implement with V4L2 architecture.
RGB32 and YUV444 are verified.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2019-02-12 10:31:46 +08:00
ddf3460245 MLK-18085 camera: Change the OV10635 to use 96 MHz timing.
This issue changes the OV10635 to use the 96 MHz timing. In the one camera the configuration, the 72MHz timing was causing vsync and hsync errors. The 96 MHz timing will work for any number of cameras.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
2019-02-12 10:31:45 +08:00
d310398f65 MLK-18222: CI_PI: fix CI_PI lost half of frame issue
As IC team recommended, it is better to set vsync pulse
width as 2 lines pixels, otherwise ISI will lost half
of frames.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
2019-02-12 10:31:36 +08:00
b62b869572 MLK-18130: camera: add two ov5640 sensor support for QM
Add two ov5640 sensors support for QM since it has two
MIPI CSI controller.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2019-02-12 10:31:29 +08:00
40130feaf2 MLK-18095 media: v4l2: Add VIDIOC_EXPBUF ioctl for DMABUF mode
Add VIDIOC_EXPBUF ioctl which exports a buffer as a DMABUF file descriptor.
After calling VIDIOC_EXPBUF the fd field will be set by a driver. This is a
DMABUF file descriptor. The application may pass it to other DMABUF-aware
devices. See V4L2 spec for more details.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
2019-02-12 10:31:28 +08:00
57e2aa8811 MLK-18098: camera: add MIPI and PARALLEL CSI support in one dtb
1. Divide ov5640_v3.c into two parts, one for parallel csi driver
   and the other for mipi csi driver

2. Add parallel and mipi support in one dtb file. User can select
   one of them without changing the dtb file

Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2019-02-12 10:31:27 +08:00
9c9e28fdfd 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>
2019-02-12 10:31:27 +08:00
5a973b729e MLK-17959-1: media: csi: Add support for dual CSI camera
Each camera will be reconfigured to use a different SCCB_ID
An i2c_new_dummy will be used to reconfigure
the camera's SCCB_ID.
When the default SCCB_ID will be used for one camera,
the other one will fail to reconfigure and remains disabled.
Update log messages, use dev_err/warn/info intead of
pr_err/warn/info.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
2019-02-12 10:31:10 +08:00
0f9e5218ac MLK-17790-2: CI_PI: add system and runtime suspend/resume
1. For QXP, after system suspend and resume, parent of pixel
and per clk will drop, so driver need to restore it. The rate
of pixel and per clk also will miss, so driver have to set it
in resume callback again.

2. I have to power off CI_PI subsystem power domain in resume
callback, otherwise setting clock parent will fail.

3. Driver need free gpio resouce after device do not use it.

Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 986098a52e62b89d6f6f7afdb75d17d77649db59)
2019-02-12 10:31:02 +08:00
a5c07128d0 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)
2019-02-12 10:31:01 +08:00
5473a59b46 MLK-17230-12: camera: fixed enum frame interval issue
when enum frame interval, kernel will be panic. It caused by
an null pointer, so correct the subdev data structure pointer.

ov5640 only support 15fps when mode is 1080P, so add this info
when user enum frame interval.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 4089120ce5fbcb253728a23102a62c849b71c88b)
2019-02-12 10:31:01 +08:00
7485f78895 MLK-17230-10: mipi_csi: add some subdev ops for compatibility
In order to use the same unit test for both mipi csi and parallel
csi, add pad and video subdev ops in mipi csi driver.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit db9ba4cf63351453fb820270b7ece4d597c49072)
2019-02-12 10:31:01 +08:00
0fb8b507cb MLK-17230-9: max9286: delete redundant 15fps support
Delete redundant 15fps statements because max9286 does not
support.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 88089e8a6dd5f0d06c7c61562f5a1942840f23e3)
2019-02-12 10:31:00 +08:00
0050e47e01 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)
2019-02-12 10:31:00 +08:00
103b9f84cb MLK-17230-6: sensor: add driver for ov5640 camera sensor
Add version3.0 driver for ov5640 camera sensor. It works on DVP
mode

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 64d7dd18ac3c768480df8390ab02a35142a220cd)
2019-02-12 10:31:00 +08:00