- Apr 17, 2019
-
-
Gao Pan authored
use subsys_initcall for i2c driver to improve i2c driver probe priority Signed-off-by:
Gao Pan <pandy.gao@nxp.com> (cherry picked from commit 3661eef8)
-
Liu Ying authored
This patch fixes a trivial typo to remove a superfluous ";". Fixes: 5bed4df1a154 ("MLK-21397 drm/imx: dpu: kms: Put possible pipe states properly") Signed-off-by:
Liu Ying <victor.liu@nxp.com>
-
Liu Ying authored
We should put possible pipe states after we've finished assigning resources for all pipes. This makes sure the pipe states which should be put are all eventually put. Without this patch, disabled crtc(s) or enabled crtc(s) without any plane upon will be accidentally left in the atomic state when commit operations only happen for other pipe(s), because we skip the put operations when we see the relevant active plane number is zero. It's good to put pipe states for those crtcs, otherwise, we'll depend on atomic helper core behavior to handle the crtcs. Signed-off-by:
Liu Ying <victor.liu@nxp.com>
-
Anson Huang authored
This patch updates SCFW API to v1.7, based on below commit: 252281d48647 ("SCF-105: Update wiki.") Signed-off-by:
Anson Huang <Anson.Huang@nxp.com> Reviewed-by:
Bai Ping <ping.bai@nxp.com> (cherry picked from commit d6262556)
-
Anson Huang authored
The power mode operation ONLY checks whether the resource being powered OFF is a wakeup source, and skip power OFF operation if it is a wakeup source, but it does NOT consider the power tree status, if any of its children is a wakeup source, it needs to be kept powered ON for its children's wakeup capability. For example, on i.MX8QXP, CAN1 shares CAN0's power, if CAN1 is enabled as wakeup source, CAN0's power needs to be ON even it is NOT a wakeup source, this patch adds support for such scenario. As it uses recursion, to avoid overhead during runtime power management, introduce a variable to make sure this logic is ONLY enabled during suspend/resume. The generic power domain framework for handling device power according to wakeup status does NOT consider the virtual devices, e.g., if debug uart is enabled as wakeup source, the device wakeup capability check for uart device returns false, ONLY the ttydev has wakeup capability, that will cause resume_needed() return false and uart device power will be OFF even its child device "ttydev" is enabeld as wakeup source. Signed-off-by:
Anson Huang <Anson.Huang@nxp.com> Tested-by:
Joakim Zhang <qiangqing.zhang@nxp.com> Reviewed-by:
Bai Ping <ping.bai@nxp.com> (cherry picked from commit 459db9c5)
-
Clark Wang authored
Add the missing complete operations for dma_completion to fix the problem of blocking at the wait_for_completion_interruptible() function in some situations. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit a19a00c5)
-
kbuild test robot authored
Fixes: 944c01a8 ("spi: lpspi: enable runtime pm for lpspi") Signed-off-by:
kbuild test robot <lkp@intel.com> Signed-off-by:
Mark Brown <broonie@kernel.org> (cherry picked from commit 04f7ee7c)
-
Clark Wang authored
Because we add the partition reboot function, and assign all flexcan pins to M4, A core cannot access flexcan pins for now. LPUART3 uses flexcan pins before, so disable it to avoid this error: imx8qxp-pinctrl iomuxc: pin_config_set op failed for pin 110 Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit be821a84c44f6d8cf6e9a2573d214de91739dfdf)
-
Clark Wang authored
Add dma support for lpspi0 and lpspi2 modules on i.MX8QXP board. Ensure the lpspi does not use cs-gpio in slave mode. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 7f69223a715301c69f02fbac8cc6096215e500de)
-
Clark Wang authored
Related issues have been fixed by (e0e542ae MLK-20060-1 spi: lpspi: fix wrong transmission when don't use CONT). However, the delay between sending and receiving in slave mode. This causes the value of FSR_RXCOUNT cannot reflect whether there is still data not sent timely. So do this judgement by FSR_TXCOUNT. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 1a260d13aa3724b9919a2d8e2f53b4ad26ccf372)
-
Clark Wang authored
These CAN related regulators will be handled when kernel boots. However, these regulators which aren't used by any devices will be disabled by the regulator framework. So, the pins in these regulators will be non-active status. This causes the CAN module cannot be used in M4 side. So, disable these regualtors for 8QM/QXP, and let M4 handles these. Suggested-by:
Fugang Duan <fugang.duan@nxp.com> Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 5c40db9cb2074c0c148d677acda55b0637c0c764)
-
Clark Wang authored
Enable RPBUS(i2c-rpmsg-imx.c) and RPMSG functions. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit f47caf1254b93ffe7caca003f5d8f60f5b9070a0)
-
Clark Wang authored
cs42xx8 will call regcache_sync to refresh its register cache. However, it will send a long msg which length is greater than the max buffer size of virtual i2c driver. It will cause the regcache_sync operation failed. So, use the single read/write to send i2c msg in regcache functions. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 0153e60c26a0fdcf463fb16b090511da7e52df0c)
-
Clark Wang authored
The spi_transfer *t will be used in one transfer whatever. If t is NULL, there has no need to try sending data, so add an error return here. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> Acked-by:
Fugang Duan <Fugang.duan@nxp.com> (cherry picked from commit 68b253138f23754706d3ec16007f2327e1910654)
-
Clark Wang authored
Add dma configurations in dts files, for imx7ulp and imx8qm. There is no "edma0" node in fsl-imx8qm-mek(or lpddr4-arm2)-domu.dts. lpspi0 node has been deleted in these dts files, so delete lpspi3 node. Add edma0a and edma0d for lpspi0 and lpspi3, and enable lpspi0/3 for xen. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> Acked-by:
Fugang Duan <Fugang.duan@nxp.com> (cherry picked from commit d256a5005243efb4557c9acee0c8a42f07b99ff2)
-
Clark Wang authored
Add dma mode support for LPSPI. Any frame longer than half txfifosize will be sent by dma mode. For now, there are some limits: 1. The maximum transfer speed in master mode depends on the slave device, at least 40MHz(tested by spi-nor on 8qm-lpddr4-arm2 base board); 2. The maximum transfer speed in slave mode is 15MHz(imx7ulp), 22MHz(8qm/qxp). Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> Acked-by:
Fugang Duan <Fugang.duan@nxp.com> (cherry picked from commit 1693fd1628108e47fa7700218fc2b3aa1e9b83ee)
-
Clark Wang authored
Use the default implementation of transfer_one_msg/chipselect/setup functions in spi core to implement cs-gpio control. Use fsl_lpspi_prepare_message to init the cs_gpio pin. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> Acked-by:
Fugang Duan <Fugang.duan@nxp.com> (cherry picked from commit 8f0f0df824fc113eade82f929e3e78b8f4d2ac55)
-
Clark Wang authored
Add a error info when set a speed which greater than half of per-clk of spi module. The minimum SCK period is 2 cycles(CCR[SCKDIV]). So the maximum transfer speed is half of spi per-clk. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> Acked-by:
Fugang Duan <Fugang.duan@nxp.com> (cherry picked from commit d13f9515c1378d778e82a72c24a99892389710c4)
-
Clark Wang authored
Add judgment on SR_MBF and FSR_RXCOUNT. In PIO mode, if don't use CONT to keep cs selected in one transfer, the transfer will go wrong. FCIE will be set after one frame transfer finish. If use CONT, the frame refer to the whole data in one transfer. If don't use CONT, the frame refer to one byte of whole data. This will cause the transfer ending early. This patch add a register reading in isr function, it might lead to a slight decrease in the max transmission speed in PIO mode. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> Acked-by:
Fugang Duan <Fugang.duan@nxp.com> (cherry picked from commit 0e31af06088acb5751e0ecfef4ae2acc38f6c749)
-
Clark Wang authored
According the e7805 in Errata, the SCK low level period should be less than 1.3us. The other series platform use this same IP can match the errata, and ensure the low level period longer than 1.3us when the speed set to 400KHz. However, only at imx7d platform, the low level period is less than 1.3us in the same situation. Therefore, limit the maximum transfer speed to 384KHz when probe at imx7d platform. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 19f553846e872b5c379b37ed029132b79566cab0)
-
Clark Wang authored
Fix the Coverity warning "divide_by_zero". If "rext" is incorrectly set as zero in dts file, "divide_by_zero" will happen at line 960. So add a judgment condition here, and let "rext" uses default value when it is equal to zero. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 999f94e0d7524640381eb4b3f6590f213533679e)
-
Clark Wang authored
Add cs-gpio feature. Use fsl_lpspi_prepare_message() and fsl_lpspi_unprepare_message() to enable and control cs line. These two functions will be only called at the beginning and the ending of a message transfer. Still can use the mode without cs-gpio. The two ways can refer to fsl-imx8qm-lpddr4-arm2-lpspi.dts for setting the lpspi configration in dts file. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 245d353cdf0a461ddcd2dcc36793571aae1069b0)
-
Mirela Rabulea authored
Adjust the driver to use the "mplane" flavor of v4l2 structures: "mplane" flavor ioctls for format negotiation in mxc_jpeg_ioctl_ops, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE instead of V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE instead of V4L2_BUF_TYPE_VIDEO_OUTPUT, V4L2_CAP_VIDEO_M2M_MPLANE instead of V4L2_CAP_VIDEO_M2M, pix_mp member of struct v4l2_format, instead of pix (previously, the pix_mp was sometimes used wrongly for single-plane). Adjust the sizeimage & bytesperline members of mxc_jpeg_q_data as MXC_JPEG_MAX_PLANES elements arrays, to accommodate maximum 2 planes. In case of YUV420, which is the only multi-planar format supported, use the first plane address as buf_base0 and the second plane address as buf_base1, to configure the CAST IP. Previously, the buf_base1 was calculated as an offset to buf_base0, in mxc_jpeg_addrs. After decoding, set the payload for both planes via vb2_set_plane_payload. Multi-planar support current status: -gst-launch with filesink & fbdevsink always pass -gst-launch with waylandsink & kmssink sometimes fail for resolutions where height is multiple of 256 (1024 x 256, 1024 x 512). Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com> Reviewed-by:
Robert Chiras <robert.chiras@nxp.com>
-
Mirela Rabulea authored
Unlock hw_lock before calling v4l2_m2m_job_finish to avoid deadlock: v4l2_m2m_job_finish -> v4l2_m2m_try_schedule -> job_ready locks hw_lock v4l2_m2m_job_finish -> v4l2_m2m_try_run -> device_run locks hw_lock Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com> Reviewed-by:
Laurentiu Palcu <laurentiu.palcu@nxp.com>
-
Mirela Rabulea authored
Make sure V4L2_EVENT_SOURCE_CHANGE is only sent at init phase. It was wrongly sent for every frame, causing gst-launch to DQBUF only for the first frame. Removed a dev_dbg from mxc_jpeg_try_fmt, too many prints with gst. Fix for "Driver bug detected, stride (%d) is too small for the width (%d)" warning in gst-launch. Fixed by providing the stride in bytesperline, in mxc_jpeg_g_fmt_vid_cap function. Clean-up in mxc_jpeg_qbuf. Tested with gst-launch and v4l2video0jpegdec plugin: gst-launch-1.0 filesrc location=mjpeg_64x64_4frames.avi ! jpegparse ! v4l2video0jpegdec ! waylandsink Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com>
-
Mirela Rabulea authored
Add notify_eos function to enqueue V4L2_EVENT_EOS for the application. Call notify_eos after V4L2_DEC_CMD_STOP was received, or, if there still are source buffers to process, later in dqbuf. Add mxc_jpeg_dqbuf and send V4L2_EVENT_EOS if needed. Fix for "Driver should never set v4l2_buffer.field to ANY" warning in gst-launch, by setting V4L2_FIELD_NONE in mxc_jpeg_dqbuf. Tested with gst-launch and v4l2video0jpegdec plugin: gst-launch-1.0 filesrc location=<image.jpg> ! jpegparse ! v4l2video5jpegdec ! waylandsink Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com>
-
Mirela Rabulea authored
Return int from get_sof (-1 for error), the result is later on compared with -1 literal. Fix memory leak from print_nbuf_to_eoi, when !mxc_jpeg_tracing. Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com> Reviewed-by:
Robert Chiras <robert.chiras@nxp.com>
-
Mirela Rabulea authored
The context is released after FRM_DONE interrupt is received, but for some small images, after FRM_DONE, a HALF_BUF interrupt keeps coming, and cannot be cleared. A soft reset helps (resets only the decoder internal state, not registers). Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com>
-
Mirela Rabulea authored
Add debug function print_nbuf_to_eoi, to print the decoder input frame. Add module parameter mxc_jpeg_tracing. Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com> Reviewed-by:
Laurentiu Palcu <laurentiu.palcu@nxp.com, Robert Chiras <robert.chiras@nxp.com>
-
Mirela Rabulea authored
Set allow_zero_bytesused, to let gst-launch work, this lead to the need to implement V4L2_DEC_CMD_STOP, dummy for now. Implement g_fmt_vid_cap, called by gst-launch before queuing any capture buffers, this also required some fixes in jpeg_parse and buf_queue, which wrongly assumed capture buffers are enqueued before output buffers. So, import the resolution and pixel-format from the output queue, if the capture queue is not set-up yet. Add release_active_buffers and use it in stop_streaming to properly clean-up active buffers, this fixes warning at gst-launch stop with Ctrl+C Check for decoding/encoding error in interrupt handler and print CAST IP error status, found some yuv422 images with errors in SOS marker. Partially implemented subscribe_event, V4L2_EVENT_EOS is not working yet, will be addressed in a subsequent fix. Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com> Reviewed-by:
Laurentiu Palcu <laurentiu.palcu@nxp.com, Robert Chiras <robert.chiras@nxp.com>
-
Mirela Rabulea authored
Validate the component ID's when parsing the jpeg headers, print error and don't continue the decoding, avoid getting stuck. Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com>
-
Mirela Rabulea authored
Remove hardcodings for encoder (configuration stream especially). This fix also requires a fixed version of the test applications, encoder_test.out/decoder_test.out (linux-test repo). Also fixed MLK-19453: Add support for YUV420 format in jpeg decoder YUV420 is generally working on encoder/decoder, but for some particular small files the decoder enters infinite error: "Instance released before the end of transaction". RGB24 is working, but the colors are strange in jpeg. Since YUV444 and RGB24 have the same subsampling, a RGB24 raw file can be encoded/decoded as YUV444 with the same results. Fixes for invalid pixel formats. Full battery of tests run. Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com>
-
Mirela Rabulea authored
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>
-
Mirela Rabulea authored
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>
-
Mirela Rabulea authored
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>
-
Mirela Rabulea authored
Fix proposed by Bing Song. Signed-off-by:
Mirela Rabulea <mirela.rabulea@nxp.com>
-
Mirela Rabulea authored
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>
-
Frank Li authored
Support run time pm Signed-off-by:
Frank Li <Frank.Li@nxp.com> Acked-by:
Sandor Yu <sandor.yu@nxp.com>
-
Jason Liu authored
The patch fixes the following build warnnings by removing unused function: drivers/media/platform/imx8/mxc-jpeg.c:228:13: warning: ‘print_output’ defined but not used [-Wunused-function] static void print_output(void *addr) ^~~~~~~~~~~~ This patch also does the minor clean up by removing some commented-out code Signed-off-by:
Jason Liu <jason.hui.liu@nxp.com> Acked-by:
Fugang Duan <fugang.duan@nxp.com>
-
Frank Li authored
Signed-off-by:
Frank Li <Frank.Li@nxp.com> Acked-by:
Sandor Yu <sandor.yu@nxp.com>
-