Hi, On Tue, 2023-10-24 at 19:29 +0800, bingbu.cao@xxxxxxxxx wrote: > From: Bingbu Cao <bingbu.cao@xxxxxxxxx> > > Intel Image Processing Unit 6th Gen includes input and processing > systems > but the hardware presents itself as a single PCI device in system. > > IPU6 PCI device driver basically does PCI configurations and load > the firmware binary, initialises IPU virtual bus, and sets up > platform > specific variants to support multiple IPU6 devices in single device > driver. > > Signed-off-by: Bingbu Cao <bingbu.cao@xxxxxxxxx> > Reported-by: Hans de Goede <hdegoede@xxxxxxxxxx> > Suggested-by: Andreas Helbech Kleist <andreaskleist@xxxxxxxxx> > --- > .../media/pci/intel/ipu6/ipu6-platform-regs.h | 179 ++++ > drivers/media/pci/intel/ipu6/ipu6.c | 952 > ++++++++++++++++++ > drivers/media/pci/intel/ipu6/ipu6.h | 352 +++++++ > 3 files changed, 1483 insertions(+) > create mode 100644 drivers/media/pci/intel/ipu6/ipu6-platform-regs.h > create mode 100644 drivers/media/pci/intel/ipu6/ipu6.c > create mode 100644 drivers/media/pci/intel/ipu6/ipu6.h ... > +static void ipu6_internal_pdata_init(struct ipu6_device *isp) > +{ > + u8 hw_ver = isp->hw_ver; > + > + isys_ipdata.num_parallel_streams = IPU6_ISYS_NUM_STREAMS; > + isys_ipdata.sram_gran_shift = IPU6_SRAM_GRANULARITY_SHIFT; > + isys_ipdata.sram_gran_size = IPU6_SRAM_GRANULARITY_SIZE; > + isys_ipdata.max_sram_size = IPU6_MAX_SRAM_SIZE; > + isys_ipdata.sensor_type_start = > IPU6_FW_ISYS_SENSOR_TYPE_START; > + isys_ipdata.sensor_type_end = IPU6_FW_ISYS_SENSOR_TYPE_END; > + isys_ipdata.max_streams = IPU6_ISYS_NUM_STREAMS; num_parallel_streams and max_streams are set to the same value here and to another (but also equal) value for ipu6se. num_parallel_streams is then passed through ipu6_fw_isys_init to ipu6_isys_fwcom_cfg_init to then be clamp'ed to 1..max_streams. It seems like they are the same, and thus a lot of code could be removed. /Andreas