tree: git://linuxtv.org/sailus/media_tree.git ipu6 head: 308898eb3af1c6530b122a01a5c4b38931717e70 commit: 42597145960da6460ed283f1a588ab07dc97972a [39/50] media: v4l: Support passing sub-device argument to v4l2_get_link_freq() config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240429/202404292348.ODBLhjxb-lkp@xxxxxxxxx/config) compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 5ef5eb66fb428aaf61fb51b709f065c069c11242) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240429/202404292348.ODBLhjxb-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202404292348.ODBLhjxb-lkp@xxxxxxxxx/ All errors (new ones prefixed by >>): In file included from drivers/media/i2c/st-mipid02.c:15: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 547 | val = __raw_readb(PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' 37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ^ In file included from drivers/media/i2c/st-mipid02.c:15: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ In file included from drivers/media/i2c/st-mipid02.c:15: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 584 | __raw_writeb(value, PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ In file included from drivers/media/i2c/st-mipid02.c:15: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:21: In file included from include/linux/mm.h:2208: include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ >> drivers/media/i2c/st-mipid02.c:321:33: error: incompatible pointer types passing 'struct v4l2_ctrl_handler *' to parameter of type 'struct v4l2_subdev *' [-Werror,-Wincompatible-pointer-types] 321 | link_freq = v4l2_get_link_freq(subdev->ctrl_handler, bpp, | ^~~~~~~~~~~~~~~~~~~~ include/media/v4l2-common.h:547:47: note: expanded from macro 'v4l2_get_link_freq' 547 | struct v4l2_subdev *: __v4l2_get_link_freq(sdh, NULL, mul, \ | ^~~ include/media/v4l2-common.h:551:46: note: passing argument to parameter 'sd' here 551 | s64 __v4l2_get_link_freq(struct v4l2_subdev *sd, | ^ 7 warnings and 1 error generated. -- In file included from drivers/media/platform/cadence/cdns-csi2rx.c:10: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 547 | val = __raw_readb(PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' 37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ^ In file included from drivers/media/platform/cadence/cdns-csi2rx.c:10: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ In file included from drivers/media/platform/cadence/cdns-csi2rx.c:10: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 584 | __raw_writeb(value, PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ In file included from drivers/media/platform/cadence/cdns-csi2rx.c:15: In file included from include/linux/phy/phy.h:17: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:21: In file included from include/linux/mm.h:2208: include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ >> drivers/media/platform/cadence/cdns-csi2rx.c:184:33: error: incompatible pointer types passing 'struct v4l2_ctrl_handler *' to parameter of type 'struct v4l2_subdev *' [-Werror,-Wincompatible-pointer-types] 184 | link_freq = v4l2_get_link_freq(csi2rx->source_subdev->ctrl_handler, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/media/v4l2-common.h:547:47: note: expanded from macro 'v4l2_get_link_freq' 547 | struct v4l2_subdev *: __v4l2_get_link_freq(sdh, NULL, mul, \ | ^~~ include/media/v4l2-common.h:551:46: note: passing argument to parameter 'sd' here 551 | s64 __v4l2_get_link_freq(struct v4l2_subdev *sd, | ^ 7 warnings and 1 error generated. -- In file included from drivers/media/platform/nxp/imx8mq-mipi-csi2.c:13: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 547 | val = __raw_readb(PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' 37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ^ In file included from drivers/media/platform/nxp/imx8mq-mipi-csi2.c:13: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ In file included from drivers/media/platform/nxp/imx8mq-mipi-csi2.c:13: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 584 | __raw_writeb(value, PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ In file included from drivers/media/platform/nxp/imx8mq-mipi-csi2.c:23: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:21: In file included from include/linux/mm.h:2208: include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ >> drivers/media/platform/nxp/imx8mq-mipi-csi2.c:302:33: error: incompatible pointer types passing 'struct v4l2_ctrl_handler *' to parameter of type 'struct v4l2_subdev *' [-Werror,-Wincompatible-pointer-types] 302 | link_freq = v4l2_get_link_freq(state->src_sd->ctrl_handler, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/media/v4l2-common.h:547:47: note: expanded from macro 'v4l2_get_link_freq' 547 | struct v4l2_subdev *: __v4l2_get_link_freq(sdh, NULL, mul, \ | ^~~ include/media/v4l2-common.h:551:46: note: passing argument to parameter 'sd' here 551 | s64 __v4l2_get_link_freq(struct v4l2_subdev *sd, | ^ 7 warnings and 1 error generated. -- In file included from drivers/media/platform/nxp/imx-mipi-csis.c:19: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 547 | val = __raw_readb(PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' 37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ^ In file included from drivers/media/platform/nxp/imx-mipi-csis.c:19: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ In file included from drivers/media/platform/nxp/imx-mipi-csis.c:19: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 584 | __raw_writeb(value, PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ In file included from drivers/media/platform/nxp/imx-mipi-csis.c:27: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:21: In file included from include/linux/mm.h:2208: include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ >> drivers/media/platform/nxp/imx-mipi-csis.c:600:33: error: incompatible pointer types passing 'struct v4l2_ctrl_handler *' to parameter of type 'struct v4l2_subdev *' [-Werror,-Wincompatible-pointer-types] 600 | link_freq = v4l2_get_link_freq(csis->src_sd->ctrl_handler, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ include/media/v4l2-common.h:547:47: note: expanded from macro 'v4l2_get_link_freq' 547 | struct v4l2_subdev *: __v4l2_get_link_freq(sdh, NULL, mul, \ | ^~~ include/media/v4l2-common.h:551:46: note: passing argument to parameter 'sd' here 551 | s64 __v4l2_get_link_freq(struct v4l2_subdev *sd, | ^ 7 warnings and 1 error generated. -- In file included from drivers/media/platform/ti/cal/cal-camerarx.c:18: In file included from include/linux/regmap.h:20: In file included from include/linux/iopoll.h:14: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 547 | val = __raw_readb(PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' 37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ^ In file included from drivers/media/platform/ti/cal/cal-camerarx.c:18: In file included from include/linux/regmap.h:20: In file included from include/linux/iopoll.h:14: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ In file included from drivers/media/platform/ti/cal/cal-camerarx.c:18: In file included from include/linux/regmap.h:20: In file included from include/linux/iopoll.h:14: In file included from include/linux/io.h:13: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 584 | __raw_writeb(value, PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ In file included from drivers/media/platform/ti/cal/cal-camerarx.c:21: In file included from include/media/v4l2-ctrls.h:14: In file included from include/media/media-request.h:20: In file included from include/media/media-device.h:16: In file included from include/linux/pci.h:2693: In file included from include/linux/dma-mapping.h:11: In file included from include/linux/scatterlist.h:8: In file included from include/linux/mm.h:2208: include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ >> drivers/media/platform/ti/cal/cal-camerarx.c:68:28: error: incompatible pointer types passing 'struct v4l2_ctrl_handler *' to parameter of type 'struct v4l2_subdev *' [-Werror,-Wincompatible-pointer-types] 68 | freq = v4l2_get_link_freq(phy->source->ctrl_handler, bpp, 2 * num_lanes); | ^~~~~~~~~~~~~~~~~~~~~~~~~ include/media/v4l2-common.h:547:47: note: expanded from macro 'v4l2_get_link_freq' 547 | struct v4l2_subdev *: __v4l2_get_link_freq(sdh, NULL, mul, \ | ^~~ include/media/v4l2-common.h:551:46: note: passing argument to parameter 'sd' here 551 | s64 __v4l2_get_link_freq(struct v4l2_subdev *sd, | ^ 7 warnings and 1 error generated. .. vim +321 drivers/media/i2c/st-mipid02.c 642bb5e88fed89e Mickael Guene 2019-04-09 301 642bb5e88fed89e Mickael Guene 2019-04-09 302 /* 642bb5e88fed89e Mickael Guene 2019-04-09 303 * We need to know link frequency to setup clk_lane_reg1 timings. Link frequency 046ee0e2a4d6022 Alain Volmat 2023-11-25 304 * will be retrieve from connected device via v4l2_get_link_freq, bit per pixel 642bb5e88fed89e Mickael Guene 2019-04-09 305 * and number of lanes. 642bb5e88fed89e Mickael Guene 2019-04-09 306 */ 04d170b288b3404 Alain Volmat 2023-11-25 307 static int mipid02_configure_from_rx_speed(struct mipid02_dev *bridge, 04d170b288b3404 Alain Volmat 2023-11-25 308 struct v4l2_mbus_framefmt *fmt) 642bb5e88fed89e Mickael Guene 2019-04-09 309 { 642bb5e88fed89e Mickael Guene 2019-04-09 310 struct i2c_client *client = bridge->i2c_client; 642bb5e88fed89e Mickael Guene 2019-04-09 311 struct v4l2_subdev *subdev = bridge->s_subdev; 046ee0e2a4d6022 Alain Volmat 2023-11-25 312 struct v4l2_fwnode_endpoint *ep = &bridge->rx; 04d170b288b3404 Alain Volmat 2023-11-25 313 u32 bpp = bpp_from_code(fmt->code); 046ee0e2a4d6022 Alain Volmat 2023-11-25 314 /* 046ee0e2a4d6022 Alain Volmat 2023-11-25 315 * clk_lane_reg1 requires 4 times the unit interval time, and bitrate 046ee0e2a4d6022 Alain Volmat 2023-11-25 316 * is twice the link frequency, hence ui_4 = 1000000000 * 4 / 2 046ee0e2a4d6022 Alain Volmat 2023-11-25 317 */ 046ee0e2a4d6022 Alain Volmat 2023-11-25 318 u64 ui_4 = 2000000000; 046ee0e2a4d6022 Alain Volmat 2023-11-25 319 s64 link_freq; 642bb5e88fed89e Mickael Guene 2019-04-09 320 046ee0e2a4d6022 Alain Volmat 2023-11-25 @321 link_freq = v4l2_get_link_freq(subdev->ctrl_handler, bpp, 046ee0e2a4d6022 Alain Volmat 2023-11-25 322 2 * ep->bus.mipi_csi2.num_data_lanes); 046ee0e2a4d6022 Alain Volmat 2023-11-25 323 if (link_freq < 0) { 6a381d1072f174c Hugues Fruchet 2019-06-17 324 dev_err(&client->dev, "Failed to get link frequency"); 642bb5e88fed89e Mickael Guene 2019-04-09 325 return -EINVAL; 642bb5e88fed89e Mickael Guene 2019-04-09 326 } 642bb5e88fed89e Mickael Guene 2019-04-09 327 046ee0e2a4d6022 Alain Volmat 2023-11-25 328 dev_dbg(&client->dev, "detect link_freq = %lld Hz", link_freq); 046ee0e2a4d6022 Alain Volmat 2023-11-25 329 do_div(ui_4, link_freq); 046ee0e2a4d6022 Alain Volmat 2023-11-25 330 bridge->r.clk_lane_reg1 |= ui_4 << 2; 642bb5e88fed89e Mickael Guene 2019-04-09 331 642bb5e88fed89e Mickael Guene 2019-04-09 332 return 0; 642bb5e88fed89e Mickael Guene 2019-04-09 333 } 642bb5e88fed89e Mickael Guene 2019-04-09 334 :::::: The code at line 321 was first introduced by commit :::::: 046ee0e2a4d602268a49be0d77df8c85559015e3 media: i2c: st-mipid02: add usage of v4l2_get_link_freq :::::: TO: Alain Volmat <alain.volmat@xxxxxxxxxxx> :::::: CC: Hans Verkuil <hverkuil-cisco@xxxxxxxxx> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki