Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: imx-mipi-csis: Add num_data_lanes to mipi_csis_device

Add the num_data_lanes field to the mipi_csis_device struct, and set it
equal to csis->bus.num_data_lanes. This is in preparation to support
cases when the data lanes actively used differs from the maximum
supported data lanes.

No functional changes intended by this commit.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Isaac Scott and committed by
Hans Verkuil
5c731dba e10d6d96

+7 -4
+7 -4
drivers/media/platform/nxp/imx-mipi-csis.c
··· 351 351 u32 hs_settle; 352 352 u32 clk_settle; 353 353 354 + unsigned int num_data_lanes; 355 + 354 356 spinlock_t slock; /* Protect events */ 355 357 struct mipi_csis_event events[MIPI_CSIS_NUM_EVENTS]; 356 358 struct dentry *debugfs_root; ··· 575 573 val = mipi_csis_read(csis, MIPI_CSIS_DPHY_CMN_CTRL); 576 574 val &= ~MIPI_CSIS_DPHY_CMN_CTRL_ENABLE; 577 575 if (on) { 578 - mask = (1 << (csis->bus.num_data_lanes + 1)) - 1; 576 + mask = (1 << (csis->num_data_lanes + 1)) - 1; 579 577 val |= (mask & MIPI_CSIS_DPHY_CMN_CTRL_ENABLE); 580 578 } 581 579 mipi_csis_write(csis, MIPI_CSIS_DPHY_CMN_CTRL, val); ··· 625 623 626 624 /* Calculate the line rate from the pixel rate. */ 627 625 link_freq = v4l2_get_link_freq(csis->source.pad, csis_fmt->width, 628 - csis->bus.num_data_lanes * 2); 626 + csis->num_data_lanes * 2); 629 627 if (link_freq < 0) { 630 628 dev_err(csis->dev, "Unable to obtain link frequency: %d\n", 631 629 (int)link_freq); ··· 670 668 const struct v4l2_mbus_framefmt *format, 671 669 const struct csis_pix_format *csis_fmt) 672 670 { 673 - int lanes = csis->bus.num_data_lanes; 671 + int lanes = csis->num_data_lanes; 674 672 u32 val; 675 673 676 674 val = mipi_csis_read(csis, MIPI_CSIS_CMN_CTRL); ··· 1368 1366 } 1369 1367 1370 1368 csis->bus = vep.bus.mipi_csi2; 1369 + csis->num_data_lanes = csis->bus.num_data_lanes; 1371 1370 1372 - dev_dbg(csis->dev, "data lanes: %d\n", csis->bus.num_data_lanes); 1371 + dev_dbg(csis->dev, "max data lanes: %d\n", csis->bus.num_data_lanes); 1373 1372 dev_dbg(csis->dev, "flags: 0x%08x\n", csis->bus.flags); 1374 1373 1375 1374 asd = v4l2_async_nf_add_fwnode_remote(&csis->notifier, ep,