linux-2.6-block.git
11 months agomedia: zoran: increase name size
Hans Verkuil [Sat, 23 Sep 2023 15:20:54 +0000 (17:20 +0200)]
media: zoran: increase name size

Fixes this compiler warning:

drivers/media/pci/zoran/zoran_card.c: In function 'zoran_probe':
drivers/media/pci/zoran/zoran_card.c:1316:62: warning: '%u' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 31 [-Wformat-truncation=]
 1316 |         snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "%s[%u]",
      |                                                              ^~
drivers/media/pci/zoran/zoran_card.c:1316:58: note: directive argument in the range [0, 65535]
 1316 |         snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "%s[%u]",
      |                                                          ^~~~~~~~
drivers/media/pci/zoran/zoran_card.c:1316:9: note: 'snprintf' output between 4 and 39 bytes into a destination of size 32
 1316 |         snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "%s[%u]",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1317 |                  zr->card.name, zr->id);
      |                  ~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: renesas-ceu: keep input name simple
Hans Verkuil [Sat, 23 Sep 2023 15:20:53 +0000 (17:20 +0200)]
media: renesas-ceu: keep input name simple

Just show the Camera index as input name in VIDIOC_ENUM_INPUT,
no need to show the subdev name as well as that is meaningless for
users anyway.

This fixes this compiler warning:

drivers/media/platform/renesas/renesas-ceu.c: In function 'ceu_enum_input':
drivers/media/platform/renesas/renesas-ceu.c:1195:59: warning: '%s' directive output may be truncated writing up to 47 bytes into a region of size between 14 and 23 [-Wformat-truncation=]
 1195 |         snprintf(inp->name, sizeof(inp->name), "Camera%u: %s",
      |                                                           ^~
drivers/media/platform/renesas/renesas-ceu.c:1195:9: note: 'snprintf' output between 10 and 66 bytes into a destination of size 32
 1195 |         snprintf(inp->name, sizeof(inp->name), "Camera%u: %s",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1196 |                  inp->index, ceusd->v4l2_sd->name);
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
11 months agomedia: cec.h: increase input_phys buffer
Hans Verkuil [Sat, 23 Sep 2023 15:20:52 +0000 (17:20 +0200)]
media: cec.h: increase input_phys buffer

Fixes this compiler warning:

drivers/media/cec/core/cec-core.c: In function 'cec_allocate_adapter':
drivers/media/cec/core/cec-core.c:317:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
  317 |                  "%s/input0", adap->name);
      |                     ^~~~~~~
drivers/media/cec/core/cec-core.c:316:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
  316 |         snprintf(adap->input_phys, sizeof(adap->input_phys),
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  317 |                  "%s/input0", adap->name);
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: rc: ati_remote: increase mouse_name buffer size
Hans Verkuil [Sat, 23 Sep 2023 15:20:51 +0000 (17:20 +0200)]
media: rc: ati_remote: increase mouse_name buffer size

Fixes this compiler warning:

drivers/media/rc/ati_remote.c: In function 'ati_remote_probe':
drivers/media/rc/ati_remote.c:876:21: warning: ' mouse' directive output may be truncated writing 6 bytes into a region of size between 1 and 80 [-Wformat-truncation=]
  876 |                  "%s mouse", ati_remote->rc_name);
      |                     ^~~~~~
drivers/media/rc/ati_remote.c:875:9: note: 'snprintf' output between 7 and 86 bytes into a destination of size 80
  875 |         snprintf(ati_remote->mouse_name, sizeof(ati_remote->mouse_name),
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  876 |                  "%s mouse", ati_remote->rc_name);
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Sean Young <sean@mess.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
11 months agomedia: cx18: increase in_workq_name size
Hans Verkuil [Sat, 23 Sep 2023 15:20:50 +0000 (17:20 +0200)]
media: cx18: increase in_workq_name size

Fixes this compiler warning:

drivers/media/pci/cx18/cx18-driver.c: In function 'cx18_init_struct1':
drivers/media/pci/cx18/cx18-driver.c:688:65: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 11 [-Wformat-truncation=]
  688 |         snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",
      |                                                                 ^~
In function 'cx18_create_in_workq',
    inlined from 'cx18_init_struct1' at drivers/media/pci/cx18/cx18-driver.c:724:8:
drivers/media/pci/cx18/cx18-driver.c:688:9: note: 'snprintf' output between 4 and 39 bytes into a destination of size 11
  688 |         snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  689 |                  cx->v4l2_dev.name);
      |                  ~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Arnd Bergmann <arnd@arndb.de>
11 months agomedia: ipu-bridge: increase sensor_name size
Hans Verkuil [Sat, 23 Sep 2023 15:20:49 +0000 (17:20 +0200)]
media: ipu-bridge: increase sensor_name size

Fixes this compiler warning:

In file included from include/linux/property.h:14,
                 from include/linux/acpi.h:16,
                 from drivers/media/pci/intel/ipu-bridge.c:4:
In function 'ipu_bridge_init_swnode_names',
    inlined from 'ipu_bridge_create_connection_swnodes' at drivers/media/pci/intel/ipu-bridge.c:445:2,
    inlined from 'ipu_bridge_connect_sensor' at drivers/media/pci/intel/ipu-bridge.c:656:3:
include/linux/fwnode.h:81:49: warning: '%u' directive output may be truncated writing between 1 and 3 bytes into a region of size 2 [-Wformat-truncation=]
   81 | #define SWNODE_GRAPH_PORT_NAME_FMT              "port@%u"
      |                                                 ^~~~~~~~~
drivers/media/pci/intel/ipu-bridge.c:384:18: note: in expansion of macro 'SWNODE_GRAPH_PORT_NAME_FMT'
  384 |                  SWNODE_GRAPH_PORT_NAME_FMT, sensor->link);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fwnode.h: In function 'ipu_bridge_connect_sensor':
include/linux/fwnode.h:81:55: note: format string is defined here
   81 | #define SWNODE_GRAPH_PORT_NAME_FMT              "port@%u"
      |                                                       ^~
In function 'ipu_bridge_init_swnode_names',
    inlined from 'ipu_bridge_create_connection_swnodes' at drivers/media/pci/intel/ipu-bridge.c:445:2,
    inlined from 'ipu_bridge_connect_sensor' at drivers/media/pci/intel/ipu-bridge.c:656:3:
include/linux/fwnode.h:81:49: note: directive argument in the range [0, 255]
   81 | #define SWNODE_GRAPH_PORT_NAME_FMT              "port@%u"
      |                                                 ^~~~~~~~~
drivers/media/pci/intel/ipu-bridge.c:384:18: note: in expansion of macro 'SWNODE_GRAPH_PORT_NAME_FMT'
  384 |                  SWNODE_GRAPH_PORT_NAME_FMT, sensor->link);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/pci/intel/ipu-bridge.c:382:9: note: 'snprintf' output between 7 and 9 bytes into a destination of size 7
  382 |         snprintf(sensor->node_names.remote_port,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  383 |                  sizeof(sensor->node_names.remote_port),
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  384 |                  SWNODE_GRAPH_PORT_NAME_FMT, sensor->link);
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Arnd Bergmann <arnd@arndb.de>
11 months agomedia: vivid: avoid integer overflow
Hans Verkuil [Sat, 23 Sep 2023 15:20:48 +0000 (17:20 +0200)]
media: vivid: avoid integer overflow

Fixes these compiler warnings:

drivers/media/test-drivers/vivid/vivid-rds-gen.c: In function 'vivid_rds_gen_fill':
drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:56: warning: '.' directive output may be truncated writing 1 byte into a region of size between 0 and 3 [-Wformat-truncation=]
  147 |         snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
      |                                                        ^
drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:52: note: directive argument in the range [0, 9]
  147 |         snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
      |                                                    ^~~~~~~~~
drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:9: note: 'snprintf' output between 9 and 12 bytes into a destination of size 9
  147 |         snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  148 |                  freq / 16, ((freq & 0xf) * 10) / 16);
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Arnd Bergmann <arnd@arndb.de>
11 months agomedia: atomisp: ia_ccs_debug.c: increase enable_info buffer
Hans Verkuil [Sat, 23 Sep 2023 15:20:47 +0000 (17:20 +0200)]
media: atomisp: ia_ccs_debug.c: increase enable_info buffer

Fixes these compiler warnings:

drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c: In function 'ia_css_debug_pipe_graph_dump_stage':
drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2786:66: warning: '\n' directive output may be truncated writing 2 bytes into a region of size between 0 and 198 [-Wformat-truncation=]
 2786 |                                                          "%s\\n%s\\n%s",
      |                                                                  ^~~
drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2785:49: note: 'snprintf' output between 5 and 302 bytes into a destination of size 200
 2785 |                                                 snprintf(enable_info, sizeof(enable_info),
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2786 |                                                          "%s\\n%s\\n%s",
      |                                                          ~~~~~~~~~~~~~~~
 2787 |                                                          enable_info1, enable_info2,
      |                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2788 |                                                          enable_info3);
      |                                                          ~~~~~~~~~~~~~
drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2772:66: warning: '\n' directive output may be truncated writing 2 bytes into a region of size between 0 and 198 [-Wformat-truncation=]
 2772 |                                                          "%s\\n%s\\n%s",
      |                                                                  ^~~
drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2771:49: note: 'snprintf' output between 5 and 302 bytes into a destination of size 200
 2771 |                                                 snprintf(enable_info, sizeof(enable_info),
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2772 |                                                          "%s\\n%s\\n%s",
      |                                                          ~~~~~~~~~~~~~~~
 2773 |                                                          enable_info1, enable_info2,
      |                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2774 |                                                          enable_info3);
      |                                                          ~~~~~~~~~~~~~
drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2749:92: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
 2749 |                                         snprintf(enable_info, sizeof(enable_info), "%s\\n%s",
      |                                                                                            ^
drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2749:41: note: 'snprintf' output between 3 and 201 bytes into a destination of size 200
 2749 |                                         snprintf(enable_info, sizeof(enable_info), "%s\\n%s",
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2750 |                                                  enable_info1, enable_info2);
      |                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
11 months agomedia: cadence: increase buffer size in csi2tx_get_resources()
Hans Verkuil [Sat, 23 Sep 2023 15:20:46 +0000 (17:20 +0200)]
media: cadence: increase buffer size in csi2tx_get_resources()

Fixes this compiler warning:

drivers/media/platform/cadence/cdns-csi2tx.c: In function 'csi2tx_get_resources':
drivers/media/platform/cadence/cdns-csi2tx.c:485:63: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Wformat-truncation=]
  485 |                 snprintf(clk_name, sizeof(clk_name), "pixel_if%u_clk", i);
      |                                                               ^~
drivers/media/platform/cadence/cdns-csi2tx.c:485:54: note: directive argument in the range [0, 4294967294]
  485 |                 snprintf(clk_name, sizeof(clk_name), "pixel_if%u_clk", i);
      |                                                      ^~~~~~~~~~~~~~~~
drivers/media/platform/cadence/cdns-csi2tx.c:485:17: note: 'snprintf' output between 14 and 23 bytes into a destination of size 16
  485 |                 snprintf(clk_name, sizeof(clk_name), "pixel_if%u_clk", i);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
11 months agomedia: allegro-dvt: increase buffer size in msg_type_name()
Hans Verkuil [Sat, 23 Sep 2023 15:20:45 +0000 (17:20 +0200)]
media: allegro-dvt: increase buffer size in msg_type_name()

Fixes this compile error

drivers/media/platform/allegro-dvt/allegro-mail.c: In function 'msg_type_name':
drivers/media/platform/allegro-dvt/allegro-mail.c:37:48: warning: '%04x' directive output may be truncated writing between 4 and 8 bytes into a region of size 6 [-Wformat-truncation=]
   37 |                 snprintf(buf, sizeof(buf), "(0x%04x)", type);
      |                                                ^~~~
drivers/media/platform/allegro-dvt/allegro-mail.c:37:44: note: directive argument in the range [1, 4294967295]
   37 |                 snprintf(buf, sizeof(buf), "(0x%04x)", type);
      |                                            ^~~~~~~~~~
drivers/media/platform/allegro-dvt/allegro-mail.c:37:17: note: 'snprintf' output between 9 and 13 bytes into a destination of size 9
   37 |                 snprintf(buf, sizeof(buf), "(0x%04x)", type);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
11 months agomedia: atomisp: fix 'read beyond size of field'
Hans Verkuil [Tue, 26 Sep 2023 09:27:09 +0000 (11:27 +0200)]
media: atomisp: fix 'read beyond size of field'

If CONFIG_FORTIFY_SOURCE=y, then this warning is produced:

In file included from ./include/linux/string.h:254,
                 from ./include/linux/bitmap.h:11,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/cpumask.h:5,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/processor.h:23,
                 from ./arch/x86/include/asm/cpufeature.h:5,
                 from ./arch/x86/include/asm/thread_info.h:53,
                 from ./include/linux/thread_info.h:60,
                 from ./arch/x86/include/asm/preempt.h:9,
                 from ./include/linux/preempt.h:79,
                 from ./include/linux/spinlock.h:56,
                 from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:7,
                 from ./include/linux/slab.h:16,
                 from ./drivers/staging/media/atomisp//include/hmm/hmm.h:26,
                 from drivers/staging/media/atomisp/pci/sh_css_params.c:26:
In function ‘fortify_memcpy_chk’,
    inlined from ‘sh_css_store_sp_group_to_ddr’ at drivers/staging/media/atomisp/pci/sh_css_params.c:3736:3:
./include/linux/fortify-string.h:592:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()?
[-Wattribute-warning]
  592 |                         __read_overflow2_field(q_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The reason is that the memcpy copies two fields (each a u8), when the source
pointer points to the first field. It's a bit unexpected, so just make this
explicit.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
11 months agomedia: atomisp: Drop atomisp-ov5693 sensor driver
Hans de Goede [Sun, 13 Aug 2023 15:26:45 +0000 (17:26 +0200)]
media: atomisp: Drop atomisp-ov5693 sensor driver

After recent improvements to atomisp driver, the atomisp driver
now works fine with the standard ov5693 driver.

Drop the no longer necessary atomisp specific atomisp-ov5693
sensor driver.

Link: https://lore.kernel.org/r/20230813152645.45834-2-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Disable VCM for OV5693 for now
Hans de Goede [Sun, 13 Aug 2023 15:26:44 +0000 (17:26 +0200)]
media: atomisp: Disable VCM for OV5693 for now

ov5693 sensor modules have a VCM, but for unknown reasons
the sensor fails to start streaming when instantiating
a VCM i2c-client (and the runtime-pm link between VCM
and sensor).

Disable the VCM for now, until this is resolved.

Link: https://lore.kernel.org/r/20230813152645.45834-1-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: gc0310: Stop setting v4l2_subdev.fwnode to the endpoint fwnode
Hans de Goede [Sat, 12 Aug 2023 13:36:28 +0000 (15:36 +0200)]
media: atomisp: gc0310: Stop setting v4l2_subdev.fwnode to the endpoint fwnode

Endpoint matching is now handled by the v4l2-core and drivers no longer
should set v4l2_subdev.fwnode to the endpoint fwnode.

Link: https://lore.kernel.org/r/20230812133628.355812-1-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Drop VIDEO_ATOMISP_ISP2401 Kconfig option
Hans de Goede [Sat, 12 Aug 2023 13:35:23 +0000 (15:35 +0200)]
media: atomisp: Drop VIDEO_ATOMISP_ISP2401 Kconfig option

Drop the VIDEO_ATOMISP_ISP2401 Kconfig option and the -DISP2401
cflags.

This is no longer necessary since all ISP2400 vs ISP2401 differences
are now dealt with at runtime.

Many thanks to Kate Hsuan for all her work on this.

Link: https://lore.kernel.org/r/20230812133523.355581-2-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Drop ia_css_debug_dump_debug_info() and functions only used by it
Hans de Goede [Sat, 12 Aug 2023 13:35:22 +0000 (15:35 +0200)]
media: atomisp: Drop ia_css_debug_dump_debug_info() and functions only used by it

ia_css_debug_dump_debug_info() is defined but never called anywhere,
drop it.

Also drop all the other ia_css_debug_dump_* functions only called by
ia_css_debug_dump_debug_info(), as well as *_get_state() functions only
used by those.

Link: https://lore.kernel.org/r/20230812133523.355581-1-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Simplify some if (IS_ISP2401...) statements
Hans de Goede [Sat, 12 Aug 2023 10:46:12 +0000 (12:46 +0200)]
media: atomisp: Simplify some if (IS_ISP2401...) statements

Replace:

 if (!IS_ISP2401 || (IS_ISP2401 && xxx))

with:

 if (!IS_ISP2401 || xxx)

If the right side of the '||' needs to be evaluated then it is
already known that IS_ISP2401 is true, so no need to check for it.

Link: https://lore.kernel.org/r/20230812104612.38806-1-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: atomisp_v4l2: Removed unnecessary code
Kate Hsuan [Wed, 2 Aug 2023 09:56:06 +0000 (11:56 +0200)]
media: atomisp: atomisp_v4l2: Removed unnecessary code

Here is the last step of #ifdef ISP2401 removal work. Since the driver
became generic, this part of the code was no longer needed and can
be removed.

Link: https://lore.kernel.org/r/20230802095606.1298152-13-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: sh_css: Removed #ifdef ISP2401 to make the driver generic
Kate Hsuan [Wed, 2 Aug 2023 09:56:05 +0000 (11:56 +0200)]
media: atomisp: sh_css: Removed #ifdef ISP2401 to make the driver generic

Removed #ifdef ISP2401 to make the driver generic.

Link: https://lore.kernel.org/r/20230802095606.1298152-12-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: sh_css: Removed #ifdef ISP2401 to make code generic
Kate Hsuan [Wed, 2 Aug 2023 09:56:04 +0000 (11:56 +0200)]
media: atomisp: sh_css: Removed #ifdef ISP2401 to make code generic

Removed #ifdef ISP2401 to allow the destroy function can destroy the
data of both types of ISP.

Link: https://lore.kernel.org/r/20230802095606.1298152-11-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: sh_css: Renamed sh_css_config_input_network()
Kate Hsuan [Wed, 2 Aug 2023 09:56:03 +0000 (11:56 +0200)]
media: atomisp: sh_css: Renamed sh_css_config_input_network()

sh_css_config_input_network() is renamed to
sh_css_config_input_network_2400() and sh_css_config_input_network_2401()
since a generic driver should cover the implementation for both types.

Link: https://lore.kernel.org/r/20230802095606.1298152-10-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: sh_css: Removed #ifdef ISP2401 to make driver generic
Kate Hsuan [Wed, 2 Aug 2023 09:56:02 +0000 (11:56 +0200)]
media: atomisp: sh_css: Removed #ifdef ISP2401 to make driver generic

Removed #ifdef ISP2401 to expose ia_css_stream_configure_rx() for ISP2400.

Link: https://lore.kernel.org/r/20230802095606.1298152-9-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: sh_css_sp: Remove #ifdef ISP2401 to make driver generic
Kate Hsuan [Wed, 2 Aug 2023 09:56:01 +0000 (11:56 +0200)]
media: atomisp: sh_css_sp: Remove #ifdef ISP2401 to make driver generic

Removed #ifdef ISP2401 to make the driver generic. The uncessary codes
were removed and the types of the ISP is determines in runtime.

Link: https://lore.kernel.org/r/20230802095606.1298152-8-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: sh_css: Removed #ifdef ISP2401 to make the driver generic
Kate Hsuan [Wed, 2 Aug 2023 09:56:00 +0000 (11:56 +0200)]
media: atomisp: sh_css: Removed #ifdef ISP2401 to make the driver generic

Removed #ifdef ISP2401 to expose the necessary functions for ISP2401 and
also make the driver generic.

Link: https://lore.kernel.org/r/20230802095606.1298152-7-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: sh_css_mipi: Removed unused code ia_css_mipi_frame_enable_check_on_size()
Kate Hsuan [Wed, 2 Aug 2023 09:55:59 +0000 (11:55 +0200)]
media: atomisp: sh_css_mipi: Removed unused code ia_css_mipi_frame_enable_check_on_size()

ia_css_mipi_frame_enable_check_on_size() wasn't used by any functions.
So, it can be removed.

Link: https://lore.kernel.org/r/20230802095606.1298152-6-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: atomisp_compat_css20: Removed #ifdef ISP2401 to make driver generic
Kate Hsuan [Wed, 2 Aug 2023 09:55:58 +0000 (11:55 +0200)]
media: atomisp: atomisp_compat_css20: Removed #ifdef ISP2401 to make driver generic

Removed #ifdef ISP2401 to make code to be generic. The driver flow is
determined in runtime.

Link: https://lore.kernel.org/r/20230802095606.1298152-5-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: hive_isp_css_include: Removed #ifdef ISP2401 to make driver generic
Kate Hsuan [Wed, 2 Aug 2023 09:55:57 +0000 (11:55 +0200)]
media: atomisp: hive_isp_css_include: Removed #ifdef ISP2401 to make driver generic

Removed #ifdef ISP2401 to make the driver generic.

Link: https://lore.kernel.org/r/20230802095606.1298152-4-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: binary: Removed #ifdef ISP2401 to make driver generic
Kate Hsuan [Wed, 2 Aug 2023 09:55:56 +0000 (11:55 +0200)]
media: atomisp: binary: Removed #ifdef ISP2401 to make driver generic

Removed #ifdef ISP2401 to make the driver generic. The driver flow is
determined in runtime.

Link: https://lore.kernel.org/r/20230802095606.1298152-3-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: ia_css_raw.host: Remove #ifdef ISP2401 to make the driver generic
Kate Hsuan [Wed, 2 Aug 2023 09:55:55 +0000 (11:55 +0200)]
media: atomisp: ia_css_raw.host: Remove #ifdef ISP2401 to make the driver generic

Remove #ifdef from the code and made the code generic. The raw image
configuration was determined during runtime.

Link: https://lore.kernel.org/r/20230802095606.1298152-2-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Mark ia_css_isys_240?_init() static
Hans de Goede [Sat, 15 Jul 2023 17:09:06 +0000 (19:09 +0200)]
media: atomisp: Mark ia_css_isys_240?_init() static

ia_css_isys_240?_init() are only used inside the C file where they are
declared, mark them as static fixing:

drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c:24:20:
   warning: no previous prototype for 'ia_css_isys_2400_init'
   24 | input_system_err_t ia_css_isys_2400_init(void)
      |                    ^~~~~~~~~~~~~~~~~~~~~
drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c:87:20:
   warning: no previous prototype for 'ia_css_isys_2401_init'
   87 | input_system_err_t ia_css_isys_2401_init(void)
      |                    ^~~~~~~~~~~~~~~~~~~~~

Closes: https://lore.kernel.org/oe-kbuild-all/202307152046.rvhFGrbz-lkp@intel.com/
Link: https://lore.kernel.org/r/20230715170906.3627-3-hdegoede@redhat.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Remove aliases for MIPI_FORMAT_2400_CUSTOM0
Hans de Goede [Sat, 15 Jul 2023 17:09:05 +0000 (19:09 +0200)]
media: atomisp: Remove aliases for MIPI_FORMAT_2400_CUSTOM0

isp2400_input_system_local.h defines 2 aliases for MIPI_FORMAT_2400_CUSTOM0
MIPI_FORMAT_JPEG, which is entirely unused and MIPI_FORMAT_BINARY_8 which
is used once in ia_css_isys_2400_set_fmt_type().

Drop these aliases and directly use MIPI_FORMAT_2400_CUSTOM0 in
ia_css_isys_2400_set_fmt_type().

Link: https://lore.kernel.org/r/20230715170906.3627-2-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Remove empty isys_public.h
Hans de Goede [Sat, 15 Jul 2023 17:09:04 +0000 (19:09 +0200)]
media: atomisp: Remove empty isys_public.h

isys_public.h is empty, remove it.

Link: https://lore.kernel.org/r/20230715170906.3627-1-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: isys_init: Initiate atomisp in a generic manner
Kate Hsuan [Thu, 13 Jul 2023 10:02:31 +0000 (12:02 +0200)]
media: atomisp: isys_init: Initiate atomisp in a generic manner

The original implementation distinguishes and initiates atomisp during
compiler time. This commit allows isys_init to initiate isys for both types
of atomisp in a generic manner.

Link: https://lore.kernel.org/r/20230713100231.308923-12-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: rx: Removed #if defined(ISP2401) to make driver generic
Kate Hsuan [Thu, 13 Jul 2023 10:02:30 +0000 (12:02 +0200)]
media: atomisp: rx: Removed #if defined(ISP2401) to make driver generic

The conflicts of variable declarations were resolved through previous
commits so the #if defined(ISP2401) can be removed.

Link: https://lore.kernel.org/r/20230713100231.308923-11-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Compile the object codes for a generic driver
Kate Hsuan [Thu, 13 Jul 2023 10:02:29 +0000 (12:02 +0200)]
media: atomisp: Compile the object codes for a generic driver

Since a generic driver should support every type of atomisp, all the
codes need to be compiled. The ISP2401 flag controls the Makefile to build
the binary file for ISP2400 and ISP2401. Therefore, this section of
Makefile should be removed allowing all the necessary codes can be built.
Moreover, some parts of "removing #ifdef ISP2401" works are related to it
so they were also removed here.

Link: https://lore.kernel.org/r/20230713100231.308923-10-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver generic
Kate Hsuan [Thu, 13 Jul 2023 10:02:28 +0000 (12:02 +0200)]
media: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver generic

Removed #if defined(ISP2401) to make driver generic.

Link: https://lore.kernel.org/r/20230713100231.308923-9-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: pipeline: Removed #if defined(ISP2401) to make driver generic
Kate Hsuan [Thu, 13 Jul 2023 10:02:27 +0000 (12:02 +0200)]
media: atomisp: pipeline: Removed #if defined(ISP2401) to make driver generic

Removed #if defined(ISP2401) to make driver generic.

Link: https://lore.kernel.org/r/20230713100231.308923-8-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to make driver...
Kate Hsuan [Thu, 13 Jul 2023 10:02:26 +0000 (12:02 +0200)]
media: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to make driver generic

Removed #if defined(ISP2401) to make code generic.

Link: https://lore.kernel.org/r/20230713100231.308923-7-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: isys: Removed #if defined(ISP2401) to make driver generic
Kate Hsuan [Thu, 13 Jul 2023 10:02:25 +0000 (12:02 +0200)]
media: atomisp: isys: Removed #if defined(ISP2401) to make driver generic

Removed #if defined(ISP2401) to make code generic.

Link: https://lore.kernel.org/r/20230713100231.308923-6-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the driver generic
Kate Hsuan [Thu, 13 Jul 2023 10:02:24 +0000 (12:02 +0200)]
media: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the driver generic

Removed #if defined(2401) to make the driver generic.

Link: https://lore.kernel.org/r/20230713100231.308923-5-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Included both input system headers
Kate Hsuan [Thu, 13 Jul 2023 10:02:23 +0000 (12:02 +0200)]
media: atomisp: Included both input system headers

Included necessary input system header files (local, private, public
scopes) for both types of atomisp. There is also a conflict of
declaration issue so the unused input_system_state_s is removed.

Link: https://lore.kernel.org/r/20230713100231.308923-4-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Make two individual enum to define the MIPI format
Kate Hsuan [Thu, 13 Jul 2023 10:02:22 +0000 (12:02 +0200)]
media: atomisp: Make two individual enum to define the MIPI format

The original mipi_format_t represents the MIPI format settings for both
atomisp with the same name and the enum member was controlled by #if
defined(ISP2401). However, if we want to make this driver generic, this
enum should be individually defined for them.

Since the format type is redefined, the format setting function
ia_css_isys_set_fmt_type() should be reworked for ISP2400 and ISP2401
called ia_css_isys_2400_set_fmt_type() and ia_css_isys_2401_set_fmt_type()
.

Additionally, the function called is_mipi_format_yuv420() isn't used by any
functions so it can be removed.

Link: https://lore.kernel.org/r/20230713100231.308923-3-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: ia_css_debug: Removed debug codes for dumping status
Kate Hsuan [Thu, 13 Jul 2023 10:02:21 +0000 (12:02 +0200)]
media: atomisp: ia_css_debug: Removed debug codes for dumping status

This portion of debug code was based on a structure for both ISP2400 and
2401 with the same name and controlled by #if defined(ISP2401). This
structure was only used to dump the status of atomisp. So, to make the
driver generic, this part of debug codes can be removed.

Link: https://lore.kernel.org/r/20230713100231.308923-2-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Remove v4l2_ctrl_s_ctrl(asd->run_mode) calls from atomisp_open()
Hans de Goede [Mon, 19 Jun 2023 10:52:12 +0000 (12:52 +0200)]
media: atomisp: Remove v4l2_ctrl_s_ctrl(asd->run_mode) calls from atomisp_open()

The v4l2_ctrl_s_ctrl(asd->run_mode) call in atomisp_subdev_init_struct()
gets immediately overridden by a second call directly after
atomisp_subdev_init_struct() is called.

And the second call in atomisp_open() also is not helpful.
ATOMISP_RUN_MODE_PREVIEW is the default and if changed controls
are supposed to stay changed over an open/close of the /dev/video#
node. So drop both calls.

Link: https://lore.kernel.org/r/20230619105212.303653-7-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Remove support for custom run-mode v4l2-ctrl on sensors
Hans de Goede [Mon, 19 Jun 2023 10:52:11 +0000 (12:52 +0200)]
media: atomisp: Remove support for custom run-mode v4l2-ctrl on sensors

Remove the support to update a V4L2_CID_RUN_MODE run-mode control
on sensors when changing the atomisp run-mode or directly by calling
the custom ATOMISP_IOC_S_SENSOR_RUNMODE IOCTL.

No sensor drivers implement this and having custom controls / IOCTLs
is undesirable.

Even if there was such a control on sensors then userspace should directly
talk to the sensor v4l2-subdev, rather than relying on a custom IOCTLs
on the output /dev/video# node to pass this through to the senor.

Link: https://lore.kernel.org/r/20230619105212.303653-6-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Add some higher resolutions to atomisp_enum_framesizes()
Hans de Goede [Mon, 19 Jun 2023 10:52:10 +0000 (12:52 +0200)]
media: atomisp: Add some higher resolutions to atomisp_enum_framesizes()

Add some higher resolutions to the fixed list of resolutions which
atomisp_enum_framesizes() uses on sensors which can do cropping and can
thus make any resolution that will fit.

This is useful for higher resolution sensors like the 2560x1920 ov5693
sensor.

Note the highest resolutions added here are 1920x<height> because
the atomisp firmware does not support widths > 1920 with the default
asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW setting.

Link: https://lore.kernel.org/r/20230619105212.303653-5-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Change atomisp_enum_framesizes() too small cut off from 2/3th to...
Hans de Goede [Mon, 19 Jun 2023 10:52:09 +0000 (12:52 +0200)]
media: atomisp: Change atomisp_enum_framesizes() too small cut off from 2/3th to 5/8th

Change atomisp_enum_framesizes() cut off for too small resolutions
from 2/3th to 5/8th this results in more resolutions being available
with some sensors.

E.g. this allows using 800x600 with a 1280x960 sensor.

Link: https://lore.kernel.org/r/20230619105212.303653-4-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Clamp width to max 1920 pixels when in ATOMISP_RUN_MODE_PREVIEW
Hans de Goede [Mon, 19 Jun 2023 10:52:08 +0000 (12:52 +0200)]
media: atomisp: Clamp width to max 1920 pixels when in ATOMISP_RUN_MODE_PREVIEW

The pipeline firmware-binaries used in previed mode have
ia_css_binary_xinfo.output.max_width set to 1920.

This causes ia_css_binary_find() to fail when trying to set a higher
resolution resulting in the dump_stack() call in ia_css_binary_find()
triggering and resulting in the try_fmt() or set_fmt() IOCTL failing.

Fix this by clamping the width to max 1920 when in preview mode.

Link: https://lore.kernel.org/r/20230619105212.303653-3-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Fix missing v4l2_fh_release() in atomisp_open() error exit
Hans de Goede [Mon, 19 Jun 2023 10:52:06 +0000 (12:52 +0200)]
media: atomisp: Fix missing v4l2_fh_release() in atomisp_open() error exit

Fix missing v4l2_fh_release() in atomisp_open()'s
"if (pipe->users)" error exit path.

Closes: https://lore.kernel.org/r/202306180511.XWN0Hr7F-lkp@intel.com/
Link: https://lore.kernel.org/r/20230619105212.303653-1-hdegoede@redhat.com
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: sh_css_internal: sh_css_params: Unifying sh_css_sp_group data structure
Kate Hsuan [Mon, 19 Jun 2023 05:24:53 +0000 (07:24 +0200)]
media: atomisp: sh_css_internal: sh_css_params: Unifying sh_css_sp_group data structure

Since some parts of the data structure elements are determined in compile
time, the configuration data structure should be compiled for both two
ISP models. In order to set the configuration for both ISP models in
runtime, The sh_css_sp_group is unified to one data structure for the
configuration to ensure the data structure can be used for both ISP2400
and 2401 in runtime. Also, the unused codes for debug purpose are removed.

Form the aspect of ISP setting, the length and the content of the
configuration structure for ISP2400 and ISP2401 are different. So, we
need to pick up the necessary part of sp_group configuration for both
models and then copy those parts into a temporary buffer. This buffer
is finally written to the ISP with the corresponding length.

Link: https://lore.kernel.org/r/20230619052453.48598-4-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: Removed unused HAS_WATCHDOG_SP_THREAD_DEBUG debug
Kate Hsuan [Mon, 19 Jun 2023 05:24:52 +0000 (07:24 +0200)]
media: atomisp: Removed unused HAS_WATCHDOG_SP_THREAD_DEBUG debug

Since the debug codes around #ifdef HAS_WATCHDOG_SP_THREAD_DEBUG are
no longer used, the debug implementation of this can be removed.

Link: https://lore.kernel.org/r/20230619052453.48598-3-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agomedia: atomisp: ia_css_debug: Removed unused codes for debug
Kate Hsuan [Mon, 19 Jun 2023 05:24:51 +0000 (07:24 +0200)]
media: atomisp: ia_css_debug: Removed unused codes for debug

This portion of the codes was not referenced so it can be completely
removed.

Link: https://lore.kernel.org/r/20230619052453.48598-2-hpa@redhat.com
Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
11 months agodt-bindings: media: Add compatible for Meson-S4 IR Controller
Zelong Dong [Fri, 25 Aug 2023 11:53:09 +0000 (19:53 +0800)]
dt-bindings: media: Add compatible for Meson-S4 IR Controller

Add new compatible for Amlogic's Meson-S4 IR Controller.
Meson IR Controller supports hardware decoder in Meson-S4 and later SoC.

Signed-off-by: Zelong Dong <zelong.dong@amlogic.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: rc: meson-ir: support rc driver type RC_DRIVER_SCANCODE
Zelong Dong [Fri, 25 Aug 2023 11:53:08 +0000 (19:53 +0800)]
media: rc: meson-ir: support rc driver type RC_DRIVER_SCANCODE

Meson IR Controller supports hardware decoder in Meson-S4 and later
SoC. So far, protocol NEC could be decoded by hardware decoder.

Signed-off-by: Zelong Dong <zelong.dong@amlogic.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: rc: remove ir-rx51 in favour of generic pwm-ir-tx
Sean Young [Fri, 1 Sep 2023 14:18:56 +0000 (15:18 +0100)]
media: rc: remove ir-rx51 in favour of generic pwm-ir-tx

The ir-rx51 is a pwm-based TX driver specific to the N900. This can be
handled entirely by the generic pwm-ir-tx driver, and in fact the
pwm-ir-tx driver has been compatible with ir-rx51 from the start.

Note that the suspend code in the ir-rx51 driver is unnecessary, since
during transmit, the process is not in interruptable sleep. The process
is not put to sleep until the transmit completes.

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Sicelo A. Mhlongo <absicsz@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agodt-bindings: media: remove nokia,n900-ir as pwm-ir-tx is compatible
Sean Young [Fri, 1 Sep 2023 14:18:55 +0000 (15:18 +0100)]
dt-bindings: media: remove nokia,n900-ir as pwm-ir-tx is compatible

The generic pwm-ir-tx driver works for the Nokia n900, so nokia,n900-ir
can be removed.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: nuvoton: Add driver for NPCM video capture and encoding engine
Marvin Lin [Fri, 22 Sep 2023 06:24:05 +0000 (14:24 +0800)]
media: nuvoton: Add driver for NPCM video capture and encoding engine

Add driver for Video Capture/Differentiation Engine (VCD) and Encoding
Compression Engine (ECE) present on Nuvoton NPCM SoCs. As described in
the datasheet NPCM750D_DS_Rev_1.0, the VCD can capture frames from
digital video input and compare two frames in memory, and then the ECE
can compress the frame data into HEXTILE format. This driver implements
V4L2 interfaces and provides user controls to support KVM feature, also
tested with VNC Viewer ver.6.22.826 and openbmc/obmc-ikvm.

Signed-off-by: Marvin Lin <milkfafa@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: uapi: Add controls for NPCM video driver
Marvin Lin [Fri, 22 Sep 2023 06:24:04 +0000 (14:24 +0800)]
media: uapi: Add controls for NPCM video driver

Create controls for Nuvoton NPCM video driver to support setting
capture mode of Video Capture/Differentiation (VCD) engine and getting
the count of HEXTILE rectangles that is compressed by Encoding
Compression Engine (ECE).

Signed-off-by: Marvin Lin <milkfafa@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: v4l2-ctrls: Add user control base for Nuvoton NPCM controls
Marvin Lin [Fri, 22 Sep 2023 06:24:03 +0000 (14:24 +0800)]
media: v4l2-ctrls: Add user control base for Nuvoton NPCM controls

Add a control base for Nuvoton NPCM driver controls, and reserve 16
controls.

Signed-off-by: Marvin Lin <milkfafa@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: v4l: Add HEXTILE compressed format
Marvin Lin [Fri, 22 Sep 2023 06:24:02 +0000 (14:24 +0800)]
media: v4l: Add HEXTILE compressed format

Add HEXTILE compressed format which is defined in Remote Framebuffer
Protocol (RFC 6143, chapter 7.7.4 Hextile Encoding) and is used by
Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs.

Signed-off-by: Marvin Lin <milkfafa@gmail.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agodt-bindings: soc: nuvoton: Add NPCM GFXI
Marvin Lin [Fri, 22 Sep 2023 06:24:01 +0000 (14:24 +0800)]
dt-bindings: soc: nuvoton: Add NPCM GFXI

Add dt-bindings document for Graphics Core Information (GFXI) node. It
is used by NPCM video driver to retrieve Graphics core information.

Signed-off-by: Marvin Lin <milkfafa@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: dt-bindings: nuvoton: Add NPCM VCD and ECE engine
Marvin Lin [Fri, 22 Sep 2023 06:24:00 +0000 (14:24 +0800)]
media: dt-bindings: nuvoton: Add NPCM VCD and ECE engine

Add dt-bindings document for Video Capture/Differentiation Engine
(VCD) and Encoding Compression Engine (ECE) present on Nuvoton NPCM
SoCs.

Signed-off-by: Marvin Lin <milkfafa@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: remove the old videobuf framework
Hans Verkuil [Sun, 13 Aug 2023 08:22:54 +0000 (10:22 +0200)]
media: remove the old videobuf framework

The last driver that still used this old framework has been converted
to the videobuf2 framework. So it is now time to delete the old videobuf
code.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
11 months agomedia: atomisp: remove left-over videobuf include
Hans Verkuil [Sun, 13 Aug 2023 08:20:49 +0000 (10:20 +0200)]
media: atomisp: remove left-over videobuf include

This source still included the media/videobuf-vmalloc.h
header, even though it is no longer used.

Since the old videobuf framework is about to be removed,
delete this include first.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
11 months agomedia: imx-jpeg: Remove unused declarations
Yue Haibing [Thu, 17 Aug 2023 13:43:54 +0000 (21:43 +0800)]
media: imx-jpeg: Remove unused declarations

These are never implemented, remove them.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: use struct_size() helper
Yu Liao [Wed, 16 Aug 2023 06:31:43 +0000 (14:31 +0800)]
media: use struct_size() helper

Prefer struct_size() over open-coded versions of idiom:

sizeof(struct-with-flex-array) + sizeof(typeof-flex-array-elements) * count

where count is the max number of items the flexible array is supposed to
contain.

Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: mediatek: vcodec: fix spelling mistake "resonable" -> "reasonable"
Colin Ian King [Tue, 15 Aug 2023 12:14:46 +0000 (13:14 +0100)]
media: mediatek: vcodec: fix spelling mistake "resonable" -> "reasonable"

There are a couple of spelling mistakes in pr_err error messages. Fix them.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: exynos4-is: fimc-is: replace duplicate pmu node with phandle
Krzysztof Kozlowski [Tue, 15 Aug 2023 06:07:39 +0000 (08:07 +0200)]
media: exynos4-is: fimc-is: replace duplicate pmu node with phandle

Devicetree for the FIMC IS camera included duplicated PMU node as its
child like:

  soc@0 {
    system-controller@10020000 { ... }; // Real PMU

    camera@11800000 {
      fimc-is@12000000 {
        // FIMC IS camera node
        pmu@10020000 {
          reg = <0x10020000 0x3000>; // Fake PMU node
        };
      };
    };
  };

This is not a correct representation of the hardware.  Mapping the PMU
(Power Management Unit) IO memory should be via syscon-like phandle
(samsung,pmu-syscon, already used for other drivers), not by duplicating
"pmu" Devicetree node inside the FIMC IS.  Backward compatibility is
preserved.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: dt-bindings: samsung,fimc: correct unit addresses in DTS example
Krzysztof Kozlowski [Tue, 15 Aug 2023 06:07:38 +0000 (08:07 +0200)]
media: dt-bindings: samsung,fimc: correct unit addresses in DTS example

The camera node's ranges property and unit addresses of its children
were not correct.  If camera is @11800000, then its fimc child is @0.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle
Krzysztof Kozlowski [Tue, 15 Aug 2023 06:07:37 +0000 (08:07 +0200)]
media: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle

The FIMC IS camera must access the PMU (Power Management Unit) IO memory
to control camera power.  This was achieved by duplicating the PMU node
as its child like:

  soc@0 {
    system-controller@10020000 { ... }; // Real PMU

    camera@11800000 {
      fimc-is@12000000 {
        // FIMC IS camera node
        pmu@10020000 {
          reg = <0x10020000 0x3000>; // Fake PMU node
        };
      };
    };
  };

This is not a correct representation of the hardware.  Mapping the PMU
(Power Management Unit) IO memory should be via syscon-like phandle
(samsung,pmu-syscon, already used for other drivers), not by duplicating
"pmu" Devicetree node inside the FIMC IS.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: staging: media: sunxi: cedrus: Remove redundant of_match_ptr()
Ruan Jinjie [Fri, 11 Aug 2023 02:49:45 +0000 (10:49 +0800)]
media: staging: media: sunxi: cedrus: Remove redundant of_match_ptr()

The driver depends on CONFIG_OF, it is not necessary to use
of_match_ptr() here.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: nxp: Use devm_kmemdup to replace devm_kmalloc + memcpy
Li Zetao [Thu, 10 Aug 2023 11:52:20 +0000 (19:52 +0800)]
media: nxp: Use devm_kmemdup to replace devm_kmalloc + memcpy

Use the helper function devm_kmemdup() rather than duplicating its
implementation, which helps to enhance code readability.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: cx25840: simplify cx23885_dif_setup()
Hans Verkuil [Thu, 3 Aug 2023 07:42:10 +0000 (09:42 +0200)]
media: cx25840: simplify cx23885_dif_setup()

Instead of creating a huge switch statement (that thoroughly confuses
smatch), create a table of coefficients and use that.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: platform: Use dev_err_probe instead of dev_err
Wang Ming [Wed, 26 Jul 2023 11:51:58 +0000 (19:51 +0800)]
media: platform: Use dev_err_probe instead of dev_err

It is possible that dma_request_chan will return EPROBE_DEFER,
which means that dma->xdev->dev is not ready yet. In this case,
dev_err(dma->xdev->dev), there will be no output. This patch
fixes the bug.

Signed-off-by: Wang Ming <machel@vivo.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: bt8xx: make read-only arrays static
Colin Ian King [Tue, 27 Jun 2023 15:37:38 +0000 (16:37 +0100)]
media: bt8xx: make read-only arrays static

Don't populate the arrays on the stack, instead make them static const.
Also add spaces between values to clean up checkpatch style warnings.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: bttv: Add MODULE_FIRMWARE macro
Juerg Haefliger [Fri, 16 Jun 2023 12:04:06 +0000 (14:04 +0200)]
media: bttv: Add MODULE_FIRMWARE macro

The module loads firmware so add a MODULE_FIRMWARE macro to provide that
information via modinfo.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: bttv: fix use after free error due to btv->timeout timer
Zheng Wang [Thu, 13 Apr 2023 03:49:42 +0000 (11:49 +0800)]
media: bttv: fix use after free error due to btv->timeout timer

There may be some a race condition between timer function
bttv_irq_timeout and bttv_remove. The timer is setup in
probe and there is no timer_delete operation in remove
function. When it hit kfree btv, the function might still be
invoked, which will cause use after free bug.

This bug is found by static analysis, it may be false positive.

Fix it by adding del_timer_sync invoking to the remove function.

cpu0                cpu1
                  bttv_probe
                    ->timer_setup
                      ->bttv_set_dma
                        ->mod_timer;
bttv_remove
  ->kfree(btv);
                  ->bttv_irq_timeout
                    ->USE btv

Fixes: 162e6376ac58 ("media: pci: Convert timers to use timer_setup()")
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov9734: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:17:04 +0000 (21:17 +0300)]
media: i2c: ov9734: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov8856: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:17:03 +0000 (21:17 +0300)]
media: i2c: ov8856: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov5675: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:17:02 +0000 (21:17 +0300)]
media: i2c: ov5675: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov5670: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:17:01 +0000 (21:17 +0300)]
media: i2c: ov5670: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov13b10: Drop stream handling in runtime PM handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:17:00 +0000 (21:17 +0300)]
media: i2c: ov13b10: Drop stream handling in runtime PM handlers

The sensor is guaranteed not to be streaming when the runtime PM resume
handler is called, as the resume handler is only called from the
.s_stream() operation when starting streaming. Similarly, the sensor has
been stopped when the runtime PM suspend handler is called. There is
thus no need for manual stream start/stop from the runtime PM handlers.
Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov2740: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:59 +0000 (21:16 +0300)]
media: i2c: ov2740: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov13858: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:58 +0000 (21:16 +0300)]
media: i2c: ov13858: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov08x40: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:57 +0000 (21:16 +0300)]
media: i2c: ov08x40: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov08d10: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:56 +0000 (21:16 +0300)]
media: i2c: ov08d10: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov02a10: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:55 +0000 (21:16 +0300)]
media: i2c: ov02a10: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ov01a10: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:54 +0000 (21:16 +0300)]
media: i2c: ov01a10: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: og01a1b: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:53 +0000 (21:16 +0300)]
media: i2c: og01a1b: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: imx355: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:52 +0000 (21:16 +0300)]
media: i2c: imx355: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: imx319: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:51 +0000 (21:16 +0300)]
media: i2c: imx319: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: imx258: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:50 +0000 (21:16 +0300)]
media: i2c: imx258: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: imx219: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:49 +0000 (21:16 +0300)]
media: i2c: imx219: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: imx214: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:48 +0000 (21:16 +0300)]
media: i2c: imx214: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: imx208: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:47 +0000 (21:16 +0300)]
media: i2c: imx208: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: hi847: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:46 +0000 (21:16 +0300)]
media: i2c: hi847: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: hi846: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:45 +0000 (21:16 +0300)]
media: i2c: hi846: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

Now that the runtime PM operations are not called from the system PM
handlers, the sensor is guaranteed not to be streaming when the runtime
PM resume handler is called, and to have been stopped already when the
runtime PM suspend handler is called. Drop the manual stream start/stop
from the runtime PM handlers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: hi556: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:44 +0000 (21:16 +0300)]
media: i2c: hi556: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ccs: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:43 +0000 (21:16 +0300)]
media: i2c: ccs: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
11 months agomedia: i2c: ar0521: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:42 +0000 (21:16 +0300)]
media: i2c: ar0521: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Krzysztof Hałasa <khalasa@piap.pl>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>