I'm trying to capture image using v4l2-ctl command and isl79987 on custom board with imx8mp. I got the following error. It seems imx8-isi-cap.c error. How do I fix this?
root@imx8mp-lpddr4-evk:~# v4l2-ctl --list-devices
():
/dev/v4l-subdev0
mxc-isi-cap (platform:32e00000.isi:cap_devic):
/dev/video3
mxc-isi-m2m (platform:32e00000.isi:m2m_devic):
/dev/video2
FSL Capture Media Device (platform:mxc-md):
/dev/media0
root@imx8mp-lpddr4-evk:~# v4l2-ctl --device /dev/video3 --set-fmt-video=width=720,height=480,pixelformat=YUYV --stream-mmap --stream-count=1 --stream-to=file.raw
[ 1522.506654] mxc_isi.0: Call subdev s_power fail!
VIDIOC_STREAMON returned -1 (Inappropriate ioctl for device)
we don't have any sample code for isl79987 support on imx8mp, because isl79987 is the 4 virtual channel TVin chip, but imx8mp doesn't support this, for your use case what format do you use? BT656 or mipi data? your information is limited, and I don't have isl7998pls to debug, pls dump the detailed register information and add more debug information in the driver to further debug, it's hard to find root cause just one error message, current bsp doesn't support bt656 data, if you want to setup ISL79987, you need set the chip as mipi data output to test again
root@imx8mp-lpddr4-evk:~# i2cdump -y -f 2 0x44
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 82 85 a0 18 e4 40 61 2b 0a 00 62 00 00 00 6c 10 ?????@a+?.b...l?
10: 05 a4 76 17 0e 36 12 f6 00 03 0a 61 7a 0f 8c 06 ??v??6??.??az???
20: 00 0c 00 00 07 ff 07 00 01 0e 00 00 00 f1 00 f1 .?..?.?.??...?.?
30: 00 00 00 40 06 07 00 00 03 c0 06 b3 00 f1 00 00 ...@??..????.?..
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ...............?
mxc-mipi-csi2.0: is_entity_link_setup, No remote pad found!
diff --git a/drivers/staging/media/imx/isl7998x.c b/drivers/staging/media/imx/isl7998x.c
index d9dbc810ed9b..7ed4748726e3 100644
--- a/drivers/staging/media/imx/isl7998x.c
+++ b/drivers/staging/media/imx/isl7998x.c
@@ -1342,11 +1342,23 @@ static const struct regmap_config isl7998x_regmap = {
.cache_type = REGCACHE_RBTREE,
};
+static int isl7998x_link_setup(struct media_entity *entity,
+ const struct media_pad *local,
+ const struct media_pad *remote, u32 flags)
+{
+ return 0;
+}
+
+static const struct media_entity_operations isl7998x_sd_entity_ops = {
+ .link_setup = isl7998x_link_setup,
+};
Then I got another error.
root@imx8mp-lpddr4-evk:~# v4l2-ctl --device /dev/video3 --set-fmt-video=width=1280,height=720,pixelformat=YUYV --stream-mmap --stream-count=1 --stream-to=file.jpg
[ 1193.284927] mxc_isi.0: Call subdev s_power fail!
VIDIOC_STREAMON returned -1 (Inappropriate ioctl for device)
root@imx8mp-lpddr4-evk:~# dmesg | grep -e i79sl -e csi -e isi
[ 0.157417] SoC: i.MX8MP revision 1.1
[ 1.300433] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
[ 1.706729] optee: revision 3.19 (00919403)
[ 2.207059] i2c 2-0044: Fixing up cyclic dependency with 32e40000.csi
[ 2.293007] mxc-mipi-csi2-sam 32e40000.csi: supply mipi-phy not found, using dummy regulator
[ 2.301767] : mipi_csis_imx8mp_phy_reset, No remote pad found!
[ 2.313204] mxc-mipi-csi2-sam 32e40000.csi: lanes: 1, hs_settle: 0, clk_settle: 0, wclk: 0, freq: 500000000
[ 2.324517] isi-capture 32e00000.isi:cap_device: deferring 32e00000.isi:cap_device device registration
[ 2.334538] mxc-isi 32e00000.isi: mxc_isi.0 registered successfully
[ 2.462552] isi-m2m 32e00000.isi:m2m_device: Register m2m success for ISI.0
[ 5.163846] mx8-img-md: Registered mxc_isi.0.capture as /dev/video3
[ 5.188668] mx8-img-md: created link [mxc_isi.0] => [mxc_isi.0.capture]
[ 5.196407] mx8-img-md: created link [mxc-mipi-csi2.0] => [mxc_isi.0]
[ 5.209598] mx8-img-md: created link [isl7998x 2-0044] => [mxc-mipi-csi2.0]
[ 1158.866567] mxc_isi.0: Call subdev s_power fail!
[ 1193.284927] mxc_isi.0: Call subdev s_power fail!
I've attached my log and isl79987 registers.
I don't have ISL79987 data sheet, you need check what format your ISL79987 output, if this is NTSC interlaced format, you also need set mipi csi to de-interlace feature, because imx8mp mipi csi doesn't support multi VC, so for the capture video from ISL79987, maybe you need split them into different video by SW, but I don't know how your ISL79987 driver settings, current driver is for imx8qxp, which has muti vc, can enable 4 ISI, if you use imx8mp, I think you need change this
you should dump ISI and MIPI CSI registers to double check your settings, I don't know how you set your ISL79987, but I suggest that you can dump mipi csi registers and ISI registers to further debug
no example for imx8mp, only for imx8qxp, few solution about ISL79987 with imx8mp since imx8mp doesn't have multi-vc support
unfortunately imx8mp doesn't support this