summaryrefslogtreecommitdiff
path: root/drivers/staging/media/atomisp/i2c/ov5693
AgeCommit message (Collapse)Author
2021-09-30media: staging: atomisp: fix the uninitialized use in gc2235_detect()Yizhuo
Inside function gc2235_detect(), variable "low" could be uninitialized if ov5693_read_reg() returns error, however, it affects the value of variable "id". The "id" is used in the later if statement, which is potentially unsafe. Link: https://lore.kernel.org/linux-media/20210711202334.27959-1-yzhai003@ucr.edu Signed-off-by: Yizhuo <yzhai003@ucr.edu> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-07-12media: atomisp: remove redundant initialization of variable retColin Ian King
The variable ret is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-06-17media: v4l2-subdev: add subdev-wide state structTomi Valkeinen
We have 'struct v4l2_subdev_pad_config' which contains configuration for a single pad used for the TRY functionality, and an array of those structs is passed to various v4l2_subdev_pad_ops. I was working on subdev internal routing between pads, and realized that there's no way to add TRY functionality for routes, which is not pad specific configuration. Adding a separate struct for try-route config wouldn't work either, as e.g. set-fmt needs to know the try-route configuration to propagate the settings. This patch adds a new struct, 'struct v4l2_subdev_state' (which at the moment only contains the v4l2_subdev_pad_config array) and the new struct is used in most of the places where v4l2_subdev_pad_config was used. All v4l2_subdev_pad_ops functions taking v4l2_subdev_pad_config are changed to instead take v4l2_subdev_state. The changes to drivers/media/v4l2-core/v4l2-subdev.c and include/media/v4l2-subdev.h were written by hand, and all the driver changes were done with the semantic patch below. The spatch needs to be applied to a select list of directories. I used the following shell commands to apply the spatch: dirs="drivers/media/i2c drivers/media/platform drivers/media/usb drivers/media/test-drivers/vimc drivers/media/pci drivers/staging/media" for dir in $dirs; do spatch -j8 --dir --include-headers --no-show-diff --in-place --sp-file v4l2-subdev-state.cocci $dir; done Note that Coccinelle chokes on a few drivers (gcc extensions?). With minor changes we can make Coccinelle run fine, and these changes can be reverted after spatch. The diff for these changes is: For drivers/media/i2c/s5k5baf.c: @@ -1481,7 +1481,7 @@ static int s5k5baf_set_selection(struct v4l2_subdev *sd, &s5k5baf_cis_rect, v4l2_subdev_get_try_crop(sd, cfg, PAD_CIS), v4l2_subdev_get_try_compose(sd, cfg, PAD_CIS), - v4l2_subdev_get_try_crop(sd, cfg, PAD_OUT) + v4l2_subdev_get_try_crop(sd, cfg, PAD_OUT), }; s5k5baf_set_rect_and_adjust(rects, rtype, &sel->r); return 0; For drivers/media/platform/s3c-camif/camif-capture.c: @@ -1230,7 +1230,7 @@ static int s3c_camif_subdev_get_fmt(struct v4l2_subdev *sd, *mf = camif->mbus_fmt; break; - case CAMIF_SD_PAD_SOURCE_C...CAMIF_SD_PAD_SOURCE_P: + case CAMIF_SD_PAD_SOURCE_C: /* crop rectangle at camera interface input */ mf->width = camif->camif_crop.width; mf->height = camif->camif_crop.height; @@ -1332,7 +1332,7 @@ static int s3c_camif_subdev_set_fmt(struct v4l2_subdev *sd, } break; - case CAMIF_SD_PAD_SOURCE_C...CAMIF_SD_PAD_SOURCE_P: + case CAMIF_SD_PAD_SOURCE_C: /* Pixel format can be only changed on the sink pad. */ mf->code = camif->mbus_fmt.code; mf->width = crop->width; The semantic patch is: // <smpl> // Change function parameter @@ identifier func; identifier cfg; @@ func(..., - struct v4l2_subdev_pad_config *cfg + struct v4l2_subdev_state *sd_state , ...) { <... - cfg + sd_state ...> } // Change function declaration parameter @@ identifier func; identifier cfg; type T; @@ T func(..., - struct v4l2_subdev_pad_config *cfg + struct v4l2_subdev_state *sd_state , ...); // Change function return value @@ identifier func; @@ - struct v4l2_subdev_pad_config + struct v4l2_subdev_state *func(...) { ... } // Change function declaration return value @@ identifier func; @@ - struct v4l2_subdev_pad_config + struct v4l2_subdev_state *func(...); // Some drivers pass a local pad_cfg for a single pad to a called function. Wrap it // inside a pad_state. @@ identifier func; identifier pad_cfg; @@ func(...) { ... struct v4l2_subdev_pad_config pad_cfg; + struct v4l2_subdev_state pad_state = { .pads = &pad_cfg }; <+... ( v4l2_subdev_call | sensor_call | isi_try_fse | isc_try_fse | saa_call_all ) (..., - &pad_cfg + &pad_state ,...) ...+> } // If the function uses fields from pad_config, access via state->pads @@ identifier func; identifier state; @@ func(..., struct v4l2_subdev_state *state , ...) { <... ( - state->try_fmt + state->pads->try_fmt | - state->try_crop + state->pads->try_crop | - state->try_compose + state->pads->try_compose ) ...> } // If the function accesses the filehandle, use fh->state instead @@ struct v4l2_subdev_fh *fh; @@ - fh->pad + fh->state @@ struct v4l2_subdev_fh fh; @@ - fh.pad + fh.state // Start of vsp1 specific @@ @@ struct vsp1_entity { ... - struct v4l2_subdev_pad_config *config; + struct v4l2_subdev_state *config; ... }; @@ symbol entity; @@ vsp1_entity_init(...) { ... entity->config = - v4l2_subdev_alloc_pad_config + v4l2_subdev_alloc_state (&entity->subdev); ... } @@ symbol entity; @@ vsp1_entity_destroy(...) { ... - v4l2_subdev_free_pad_config + v4l2_subdev_free_state (entity->config); ... } @exists@ identifier func =~ "(^vsp1.*)|(hsit_set_format)|(sru_enum_frame_size)|(sru_set_format)|(uif_get_selection)|(uif_set_selection)|(uds_enum_frame_size)|(uds_set_format)|(brx_set_format)|(brx_get_selection)|(histo_get_selection)|(histo_set_selection)|(brx_set_selection)"; symbol config; @@ func(...) { ... - struct v4l2_subdev_pad_config *config; + struct v4l2_subdev_state *config; ... } // End of vsp1 specific // Start of rcar specific @@ identifier sd; identifier pad_cfg; @@ rvin_try_format(...) { ... - struct v4l2_subdev_pad_config *pad_cfg; + struct v4l2_subdev_state *sd_state; ... - pad_cfg = v4l2_subdev_alloc_pad_config(sd); + sd_state = v4l2_subdev_alloc_state(sd); <... - pad_cfg + sd_state ...> - v4l2_subdev_free_pad_config(pad_cfg); + v4l2_subdev_free_state(sd_state); ... } // End of rcar specific // Start of rockchip specific @@ identifier func =~ "(rkisp1_rsz_get_pad_fmt)|(rkisp1_rsz_get_pad_crop)|(rkisp1_rsz_register)"; symbol rsz; symbol pad_cfg; @@ func(...) { + struct v4l2_subdev_state state = { .pads = rsz->pad_cfg }; ... - rsz->pad_cfg + &state ... } @@ identifier func =~ "(rkisp1_isp_get_pad_fmt)|(rkisp1_isp_get_pad_crop)"; symbol isp; symbol pad_cfg; @@ func(...) { + struct v4l2_subdev_state state = { .pads = isp->pad_cfg }; ... - isp->pad_cfg + &state ... } @@ symbol rkisp1; symbol isp; symbol pad_cfg; @@ rkisp1_isp_register(...) { + struct v4l2_subdev_state state = { .pads = rkisp1->isp.pad_cfg }; ... - rkisp1->isp.pad_cfg + &state ... } // End of rockchip specific // Start of tegra-video specific @@ identifier sd; identifier pad_cfg; @@ __tegra_channel_try_format(...) { ... - struct v4l2_subdev_pad_config *pad_cfg; + struct v4l2_subdev_state *sd_state; ... - pad_cfg = v4l2_subdev_alloc_pad_config(sd); + sd_state = v4l2_subdev_alloc_state(sd); <... - pad_cfg + sd_state ...> - v4l2_subdev_free_pad_config(pad_cfg); + v4l2_subdev_free_state(sd_state); ... } @@ identifier sd_state; @@ __tegra_channel_try_format(...) { ... struct v4l2_subdev_state *sd_state; <... - sd_state->try_crop + sd_state->pads->try_crop ...> } // End of tegra-video specific // </smpl> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-03media: atomisp: fix identation at I2C Kconfig menuMauro Carvalho Chehab
There are several bad whitespacing usage there. Remove them. While here, place all Kconfig options for sensors at the same place. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-07-22Merge tag 'media/v5.8-3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media into master Pull media fixes from Mauro Carvalho Chehab: "A series of fixes for the upcoming atomisp driver. They solve issues when probing atomisp on devices with multiple cameras and get rid of warnings when built with W=1. The diffstat is a bit long, as this driver has several abstractions. The patches that solved the issues with W=1 had to get rid of some duplicated code (there used to have 2 versions of the same code, one for ISP2401 and another one for ISP2400). As this driver is not in 5.7, such changes won't cause regressions" * tag 'media/v5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (38 commits) Revert "media: atomisp: keep the ISP powered on when setting it" media: atomisp: fix mask and shift operation on ISPSSPM0 media: atomisp: move system_local consts into a C file media: atomisp: get rid of version-specific system_local.h media: atomisp: move global stuff into a common header media: atomisp: remove non-used 32-bits consts at system_local media: atomisp: get rid of some unused static vars media: atomisp: Fix error code in ov5693_probe() media: atomisp: Replace trace_printk by pr_info media: atomisp: Fix __func__ style warnings media: atomisp: fix help message for ISP2401 selection media: atomisp: i2c: atomisp-ov2680.c: fixed a brace coding style issue. media: atomisp: make const arrays static, makes object smaller media: atomisp: Clean up non-existing folders from Makefile media: atomisp: Get rid of ACPI specifics in gmin_subdev_add() media: atomisp: Provide Gmin subdev as parameter to gmin_subdev_add() media: atomisp: Use temporary variable for device in gmin_subdev_add() media: atomisp: Refactor PMIC detection to a separate function media: atomisp: Deduplicate return ret in gmin_i2c_write() media: atomisp: Make pointer to PMIC client global ...
2020-07-19media: atomisp: Fix error code in ov5693_probe()Dan Carpenter
If gmin_camera_platform_data() returns NULL then we should return a negative error instead of success. Fixes: 90ebe55ab886 ("media: staging: atomisp: Add driver prefix to Kconfig option and module names") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-13Merge tag 'kbuild-v5.8-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull more Kbuild updates from Masahiro Yamada: - fix build rules in binderfs sample - fix build errors when Kbuild recurses to the top Makefile - covert '---help---' in Kconfig to 'help' * tag 'kbuild-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: treewide: replace '---help---' in Kconfig files with 'help' kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables samples: binderfs: really compile this sample and fix build issues
2020-06-14treewide: replace '---help---' in Kconfig files with 'help'Masahiro Yamada
Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over '---help---'"), the number of '---help---' has been gradually decreasing, but there are still more than 2400 instances. This commit finishes the conversion. While I touched the lines, I also fixed the indentation. There are a variety of indentation styles found. a) 4 spaces + '---help---' b) 7 spaces + '---help---' c) 8 spaces + '---help---' d) 1 space + 1 tab + '---help---' e) 1 tab + '---help---' (correct indentation) f) 1 tab + 1 space + '---help---' g) 1 tab + 2 spaces + '---help---' In order to convert all of them to 1 tab + 'help', I ran the following commend: $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/' Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-11media: Revert "media: atomisp: Add some ACPI detection info"Mauro Carvalho Chehab
This reverts commit 0d64e9420583cbc3c4a3f949ebe38fd8f7769281. As gmin_subdev_add() now takes the ACPI handle directly, we can deprecate the code that were doing this inside each I2C driver. PS.: This also reverts commit c03496b3bd92 ("media: atomisp: add a notice about possible leak resources") Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: add SPDX headersMauro Carvalho Chehab
This driver is licensed under GPL 2.0, as stated inside their headers. Add the proper tag there. We should probably latter cleanup the reduntant licensing text, but this could be done later, after we get rid of other abstraction layers. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: do another round of coding style cleanupMauro Carvalho Chehab
Run checkpatch --fix-inline again, in order to get rid of some additional issues that got introduced (or that checkpatch can now detect). This should help preventing receiving random cleanups, while keeping the code on a better shape. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: add a notice about possible leak resourcesMauro Carvalho Chehab
Calling acpi_bus_get_device() may end allocating resources that aren't freed. So, add a notice about that, as, if those drivers get out of staging, we may need some changes. Fixes: 0d64e9420583 ("media: atomisp: Add some ACPI detection info") Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: better display DMI and EFI found entriesMauro Carvalho Chehab
There are several device-specific data that are obtained either via DMI or EFI, with changes the driver's behavior. Display what has been detected, as such info may help identifying troubles at the driver. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: Add some ACPI detection infoMauro Carvalho Chehab
When someone would report problems with a new device, we need to know the DMI product ID and the ACPI name for the detected sensor. So, print them at dmesg. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: do lots of other coding style cleanupsMauro Carvalho Chehab
Use some auto-reformat tools to make the atomisp style a little better. There are still lots of weird things there, but this will hopefully reduce the number of pure coding style patches submitted upstream. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: fix several coding style issuesMauro Carvalho Chehab
Use checkpatch.pl --fix-inplace --strict to solve several coding style issues, manually reviewing the produced code and fixing some troubles caused by checkpatch. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20Revert "media: staging: atomisp: Remove driver"Mauro Carvalho Chehab
There are some interest on having this driver back, and I can probably dedicate some time to address its issue. So, let's ressurect it. For now, the driver causes a recursive error and doesn't build, so, make it depend on BROKEN. This reverts commit 51b8dc5163d2ff2bf04019f8bf7e3bd0e75bb654. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2018-05-16media: staging: atomisp: Remove driverSakari Ailus
The atomisp driver has a long list of todo items and little has been done to address these lately while more has been added. The driver is also not functional. In other words, the driver would not be getting out of staging in the foreseeable future. At the same time it consumes developer resources in order to maintain the flaky code base. Remove it. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-16media: staging: atomisp: Comment out several unused sensor resolutionsMauro Carvalho Chehab
The register settings for several resolutions aren't used currently. So, comment them out. Fix those warnings: In file included from drivers/staging/media/atomisp/i2c/atomisp-gc2235.c:35:0: drivers/staging/media/atomisp/i2c/gc2235.h:340:32: warning: 'gc2235_960_640_30fps' defined but not used [-Wunused-const-variable=] static struct gc2235_reg const gc2235_960_640_30fps[] = { ^~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/gc2235.h:287:32: warning: 'gc2235_1296_736_30fps' defined but not used [-Wunused-const-variable=] static struct gc2235_reg const gc2235_1296_736_30fps[] = { ^~~~~~~~~~~~~~~~~~~~~ In file included from drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:35:0: drivers/staging/media/atomisp/i2c/ov2722.h:999:32: warning: 'ov2722_720p_30fps' defined but not used [-Wunused-const-variable=] static struct ov2722_reg const ov2722_720p_30fps[] = { ^~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2722.h:787:32: warning: 'ov2722_1M3_30fps' defined but not used [-Wunused-const-variable=] static struct ov2722_reg const ov2722_1M3_30fps[] = { ^~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2722.h:476:32: warning: 'ov2722_VGA_30fps' defined but not used [-Wunused-const-variable=] static struct ov2722_reg const ov2722_VGA_30fps[] = { ^~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2722.h:367:32: warning: 'ov2722_480P_30fps' defined but not used [-Wunused-const-variable=] static struct ov2722_reg const ov2722_480P_30fps[] = { ^~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2722.h:257:32: warning: 'ov2722_QVGA_30fps' defined but not used [-Wunused-const-variable=] static struct ov2722_reg const ov2722_QVGA_30fps[] = { ^~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/atomisp-ov2680.c: In function '__ov2680_set_exposure': In file included from drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:35:0: At top level: drivers/staging/media/atomisp/i2c/ov2680.h:736:33: warning: 'ov2680_1616x1082_30fps' defined but not used [-Wunused-const-variable=] static struct ov2680_reg const ov2680_1616x1082_30fps[] = { ^~~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2680.h:649:33: warning: 'ov2680_1456x1096_30fps' defined but not used [-Wunused-const-variable=] static struct ov2680_reg const ov2680_1456x1096_30fps[]= { ^~~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2680.h:606:33: warning: 'ov2680_1296x976_30fps' defined but not used [-Wunused-const-variable=] static struct ov2680_reg const ov2680_1296x976_30fps[] = { ^~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2680.h:563:33: warning: 'ov2680_720p_30fps' defined but not used [-Wunused-const-variable=] static struct ov2680_reg const ov2680_720p_30fps[] = { ^~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2680.h:520:33: warning: 'ov2680_800x600_30fps' defined but not used [-Wunused-const-variable=] static struct ov2680_reg const ov2680_800x600_30fps[] = { ^~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2680.h:475:33: warning: 'ov2680_720x592_30fps' defined but not used [-Wunused-const-variable=] static struct ov2680_reg const ov2680_720x592_30fps[] = { ^~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2680.h:433:33: warning: 'ov2680_656x496_30fps' defined but not used [-Wunused-const-variable=] static struct ov2680_reg const ov2680_656x496_30fps[] = { ^~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2680.h:389:33: warning: 'ov2680_QVGA_30fps' defined but not used [-Wunused-const-variable=] static struct ov2680_reg const ov2680_QVGA_30fps[] = { ^~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2680.h:346:33: warning: 'ov2680_CIF_30fps' defined but not used [-Wunused-const-variable=] static struct ov2680_reg const ov2680_CIF_30fps[] = { ^~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov2680.h:301:33: warning: 'ov2680_QCIF_30fps' defined but not used [-Wunused-const-variable=] static struct ov2680_reg const ov2680_QCIF_30fps[] = { ^~~~~~~~~~~~~~~~~ In file included from drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:36:0: drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:988:32: warning: 'ov5693_1424x1168_30fps' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_1424x1168_30fps[] = { ^~~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:954:32: warning: 'ov5693_2592x1944_30fps' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_2592x1944_30fps[] = { ^~~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:889:32: warning: 'ov5693_2592x1456_30fps' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_2592x1456_30fps[] = { ^~~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:862:32: warning: 'ov5693_1940x1096' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_1940x1096[] = { ^~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:796:32: warning: 'ov5693_1636p_30fps' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_1636p_30fps[] = { ^~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:758:32: warning: 'ov5693_1296x736' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_1296x736[] = { ^~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:730:32: warning: 'ov5693_976x556' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_976x556[] = { ^~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:672:32: warning: 'ov5693_736x496' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_736x496[] = { ^~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:643:32: warning: 'ov5693_192x160' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_192x160[] = { ^~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:616:32: warning: 'ov5693_368x304' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_368x304[] = { ^~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:587:32: warning: 'ov5693_336x256' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_336x256[] = { ^~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:540:32: warning: 'ov5693_1296x976' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_1296x976[] = { ^~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:509:32: warning: 'ov5693_654x496' defined but not used [-Wunused-const-variable=] static struct ov5693_reg const ov5693_654x496[] = { ^~~~~~~~~~~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-16media: staging: atomisp: reenable warnings for I2CMauro Carvalho Chehab
When atomisp got merged, there were so many warnings with W=1 that we simply disabled the ones that were causing troubles. Since then, several changes got applied to atomisp, and the number of warnings are a way smaller than it used to be. So, let's reenable warnings there and fix the issues. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-04-04media: staging: atomisp: get rid of some static warningsMauro Carvalho Chehab
Get rid of those warnings: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.c:18:15: warning: symbol 'g_pyramid' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/mmu/sh_mmu_mrfld.c:66:23: warning: symbol 'sh_mmu_mrfld' was not declared. Should it be static? drivers/staging/media/atomisp/i2c/gc0310.h:381:26: warning: symbol 'gc0310_res_preview' was not declared. Should it be static? drivers/staging/media/atomisp/i2c/atomisp-gc0310.c:622:25: warning: symbol 'gc0310_controls' was not declared. Should it be static? drivers/staging/media/atomisp/i2c/ov2722.h:1099:26: warning: symbol 'ov2722_res_preview' was not declared. Should it be static? drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:574:25: warning: symbol 'ov2722_controls' was not declared. Should it be static? drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:727:25: warning: symbol 'ov2680_controls' was not declared. Should it be static? drivers/staging/media/atomisp/i2c/ov5693/ov5693.h:1090:26: warning: symbol 'ov5693_res_preview' was not declared. Should it be static? drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:958:5: warning: symbol 'ad5823_t_focus_abs' was not declared. Should it be static? drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:1139:25: warning: symbol 'ov5693_controls' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c:91:6: warning: symbol 'atomisp_css2_hw_store_8' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c:129:10: warning: symbol 'atomisp_css2_hw_load_16' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c:139:10: warning: symbol 'atomisp_css2_hw_load_32' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c:2868:14: warning: symbol 'atomisp_get_pipe_index' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:5165:5: warning: symbol 'configure_pp_input_nop' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:5171:5: warning: symbol 'configure_output_nop' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:5179:5: warning: symbol 'get_frame_info_nop' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:6630:5: warning: symbol 'atomisp_get_pipe_id' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_formatter.c:48:12: warning: symbol 'HIVE_IF_BIN_COPY' was not declared. Should it be static? drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c:1610:6: warning: symbol '__wdt_on_master_slave_sensor' was not declared. Should it be static? Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-04media: staging: atomisp: fix endianess issuesMauro Carvalho Chehab
There are lots of be-related warnings there, as it doesn't properly mark what data uses bigendian. Warnings fixed: drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:134:15: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:134:15: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:134:15: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:140:26: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:140:26: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:140:26: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:140:26: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:144:26: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:144:26: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:144:26: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:144:26: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:144:26: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:144:26: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:256:27: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:256:27: expected unsigned short [unsigned] [usertype] addr drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:256:27: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:302:25: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:302:25: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:302:25: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:306:25: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:306:25: expected unsigned int [unsigned] [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:306:25: got restricted __be32 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:97:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:97:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:97:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:97:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:99:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:99:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:99:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:99:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:99:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:99:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:134:15: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:134:15: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:134:15: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:141:24: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:141:24: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:141:24: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:177:27: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:177:27: expected unsigned short [unsigned] [usertype] addr drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:177:27: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:198:25: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:198:25: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:198:25: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:88:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:88:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:88:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:88:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:90:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:90:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:90:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:90:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:90:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:90:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:125:15: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:125:15: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:125:15: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:132:24: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:132:24: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:132:24: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:168:27: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:168:27: expected unsigned short [unsigned] [usertype] addr drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:168:27: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:189:25: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:189:25: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:189:25: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:176:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:176:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:176:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:176:24: warning: cast to restricted __be16 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:178:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:178:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:178:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:178:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:178:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:178:24: warning: cast to restricted __be32 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:205:13: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:205:13: expected unsigned short [unsigned] [usertype] val drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:205:13: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:276:15: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:276:15: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:276:15: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:283:24: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:283:24: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:283:24: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:319:27: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:319:27: expected unsigned short [unsigned] [usertype] addr drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:319:27: got restricted __be16 [usertype] <noident> drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:340:25: warning: incorrect type in assignment (different base types) drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:340:25: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:340:25: got restricted __be16 [usertype] <noident> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: staging: atomisp: remove redundant assignments to various variablesColin Ian King
There are various assignments that are being made to variables that are not read and the variables are being updated later on, hence the redundant assignments can be removed. Cleans up clang warnings: drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:1950:8: warning: Value stored to 'pdata' during its initialization is never read drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:1853:29: warning: Value stored to 'asd' during its initialization is never read drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c:4505:29: warning: Value stored to 'asd' during its initialization is never read drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c:1139:30: warning: Value stored to 'asd' during its initialization is never read drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:6961:27: warning: Value stored to 'tmp_in_info' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-02-22media: staging: atomisp: i2c: Drop g_parm support in sensor driversSakari Ailus
These drivers already support g_frame_interval. Therefore just dropping g_parm is enough. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-02-22media: staging: atomisp: i2c: Disable non-preview configurationsSakari Ailus
These sensor drivers have use case specific mode lists. This is currently not used nor there is a standard API for selecting the mode list. Disable configurations for non-preview modes until configuration selection is improved so that all the configurations are always usable. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> [hans.verkuil@cisco.com: clarify that this functionality it currently unused] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-02-22media: staging: atomisp: Kill subdev s_parm abuseSakari Ailus
Remove sensor driver's interface for setting the use case specific mode list as well as the mode lists that are related to other than CI_MODE_PREVIEW. This removes s_parm abuse in using driver specific values in v4l2_streamparm.capture.capturemode. The drivers already support [gs]_frame_interval so removing support for [gs]_parm is enough. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: Remove non-ACPI leftoversAndy Shevchenko
Since all drivers are solely requiring ACPI enumeration, there is no need to additionally check for legacy platform data or ACPI handle. Remove leftovers from the sensors and platform code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: fix indentation in atomisp-ov5693Riccardo Schirone
Fix "suspect code indent for conditional statements" checkpatch issue Signed-off-by: Riccardo Schirone <sirmy15@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: improves comparisons readability in atomisp-ov5693Riccardo Schirone
Fix "Comparisons should place the constant on the right side of the test" checkpatch issue. Signed-off-by: Riccardo Schirone <sirmy15@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: improve comments usage in atomisp-ov5693Riccardo Schirone
- Fix "Block comments use a trailing */ on a separate line" checkpatch issue - Fix "Block comments use * on subsequent lines" checkpatch issue Signed-off-by: Riccardo Schirone <sirmy15@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: add missing blank line after declarations in atomisp-ov5693Riccardo Schirone
Fix "Missing a blank line after declarations" warning reported by checkpatch. Signed-off-by: Riccardo Schirone <sirmy15@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-29media: staging: atomisp: convert timestamps to ktime_tArnd Bergmann
timespec overflows in 2038 on 32-bit architectures, and the getnstimeofday() suffers from possible time jumps, so the timestamps here are better done using ktime_get(), which has neither of those problems. In case of ov2680, we don't seem to use the timestamp at all, so I just remove it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-11-15Merge tag 'media/v4.15-1' of ↵Linus Torvalds
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - Documentation for digital TV (both kAPI and uAPI) are now in sync with the implementation (except for legacy/deprecated ioctls). This is a major step, as there were always a gap there - New sensor driver: imx274 - New cec driver: cec-gpio - New platform driver for rockship rga and tegra CEC - New RC driver: tango-ir - Several cleanups at atomisp driver - Core improvements for RC, CEC, V4L2 async probing support and DVB - Lots of drivers cleanup, fixes and improvements. * tag 'media/v4.15-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (332 commits) dvb_frontend: don't use-after-free the frontend struct media: dib0700: fix invalid dvb_detach argument media: v4l2-ctrls: Don't validate BITMASK twice media: s5p-mfc: fix lockdep warning media: dvb-core: always call invoke_release() in fe_free() media: usb: dvb-usb-v2: dvb_usb_core: remove redundant code in dvb_usb_fe_sleep media: au0828: make const array addr_list static media: cx88: make const arrays default_addr_list and pvr2000_addr_list static media: drxd: make const array fastIncrDecLUT static media: usb: fix spelling mistake: "synchronuously" -> "synchronously" media: ddbridge: fix build warnings media: av7110: avoid 2038 overflow in debug print media: Don't do DMA on stack for firmware upload in the AS102 driver media: v4l: async: fix unregister for implicitly registered sub-device notifiers media: v4l: async: fix return of unitialized variable ret media: imx274: fix missing return assignment from call to imx274_mode_regs media: camss-vfe: always initialize reg at vfe_set_xbar_cfg() media: atomisp: make function calls cleaner media: atomisp: get rid of storage_class.h media: atomisp: get rid of wrong stddef.h include ...
2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman
Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01media: atomisp: fix other inconsistent identingMauro Carvalho Chehab
As reported by smatch: drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c:607 pipeline_stage_create() warn: inconsistent indenting drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:255 ov2680_write_reg_array() warn: inconsistent indenting drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:401 __ov2680_set_exposure() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:4269 sh_css_params_write_to_ddr_internal() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c:1008 atomisp_register_entities() warn: inconsistent indenting drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c:1709 ia_css_binary_find() warn: inconsistent indenting Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
2017-10-31media: staging: atomisp: Remove FSF snail addressAndy Shevchenko
Snail address is subject to change, remove it completely from the code. This has been done using the following script: sed -i '/You should/,/02110-1301/d' \ $(git grep -n -w Franklin -- drivers/staging/media/atomisp/ | cut -f1 -d:) No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: staging: atomisp: Remove ->power_ctrl() callbackAndy Shevchenko
There is redundant callback which does nothing in upstreamed version of the driver. Remove it along with user call places. Mostly done with help of coccinelle. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: staging: atomisp: Remove ->gpio_ctrl() callbackAndy Shevchenko
There is redundant callback which does nothing in upstreamed version of the driver. Remove it along with user call places. Mostly done with help of coccinelle. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: staging: atomisp: Remove unneeded gpio.h inclusionAndy Shevchenko
GPIO handling is done only in two modules, the rest do not need to include linux/gpio.h header. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: staging: atomisp: Switch i2c drivers to use ->probe_new()Andy Shevchenko
Since most of the drivers are being used on ACPI enabled platforms there is no need to keep legacy API support for them. Thus, switch to ->probe_new() callback and remove orphaned code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: staging: atomisp: Use module_i2c_driver() macroAndy Shevchenko
This is done using coccinelle semantic patch: //<smpl> @a@ identifier f, x; @@ -static f(...) { return i2c_add_driver(&x); } @b depends on a@ identifier e, a.x; @@ -static e(...) { i2c_del_driver(&x); } @c depends on a && b@ identifier a.f; declarer name module_init; @@ -module_init(f); @d depends on a && b && c@ identifier b.e, a.x; declarer name module_exit; declarer name module_i2c_driver; @@ -module_exit(e); +module_i2c_driver(x); //</smpl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: staging: atomisp: cleanup out of memory messagesAishwarya Pant
Logging of explicit out of memory messages is redundant since memory allocation failures produce a backtrace. Done with the help of the following cocci script: @@ expression ex, ret; statement s; constant char[] c; constant err; identifier f, l; @@ ex = \(kmalloc\|kmalloc_array\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|devm_kzalloc\)(...) ... when != ex if ( ( !ex | unlikely(!ex) ) ) - { - f(..., c, ...); ( return ex; | return; | return err; | goto l; ) - } else s Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-27media: staging: atomisp: Add driver prefix to Kconfig option and module namesSakari Ailus
By adding the "atomisp-" prefix to module names (and "ATOMISP_" to Kconfig options), the staging drivers for e.g. sensors are labelled as being specific to atomisp, which they effectively are. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-09-23media: Staging: media: atomisp: Merge assignment with returnSrishti Sharma
Merge the assignment and the return statements to return the value directly. Done using the following semantic patch by coccinelle. @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-09-23media: staging: media: atomisp: Use tabs in KconfigSakari Ailus
Use tabs in Kconfig for indentation rather than spaces. The patch has been created using the following command: find drivers/staging/media/atomisp/ -name Kconfig| \ xargs perl -i -pe 's/ {8}/\t/g' Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-08-26media: staging: atomisp: imx: remove dead codeArnd Bergmann
Making some functions 'static' has uncovered a few functions that have no caller, through the gcc warnings: atomisp/i2c/imx/imx.c:1111:12: error: 'imx_t_focus_vcm' defined but not used [-Werror=unused-function] atomisp/i2c/imx/imx.c:1103:12: error: 'imx_vcm_init' defined but not used [-Werror=unused-function] atomisp/i2c/imx/imx.c:1095:12: error: 'imx_vcm_power_down' defined but not used [-Werror=unused-function] atomisp/i2c/imx/imx.c:1087:12: error: 'imx_vcm_power_up' defined but not used [-Werror=unused-function] All four of these can be removed. Since they call indirect functions, I also looked at how those are used in turn: - The power_up/power_down callbacks are called from other functions and are still needed. - The t_focus_vcm callbacks pointers are completely unused and can be removed in both imx and ov8858. Some of the handlers are called directly and can now be marked static, the others are dummy implemntations that we can remove. - vcm_init is unused in imx, but dw9718_vcm_init is used in ov8858, but is not used in imx, so that one needs to stay around. The callback pointers in imx can be removed. Fixes: 9a5a6911aa3f ("staging: imx: fix non-static declarations") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-08-08Merge tag 'v4.13-rc4' into patchworkMauro Carvalho Chehab
Linux 4.13-rc4 * tag 'v4.13-rc4': (863 commits) Linux 4.13-rc4 Fix compat_sys_sigpending breakage ext4: fix copy paste error in ext4_swap_extents() ext4: fix overflow caused by missing cast in ext4_resize_fs() ext4, project: expand inode extra size if possible ext4: cleanup ext4_expand_extra_isize_ea() ext4: restructure ext4_expand_extra_isize ext4: fix forgetten xattr lock protection in ext4_expand_extra_isize ext4: make xattr inode reads faster ext4: inplace xattr block update fails to deduplicate blocks ext4: remove unused mode parameter ext4: fix warning about stack corruption ext4: fix dir_nlink behaviour ext4: silence array overflow warning ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize platform/x86: intel-vbtn: match power button on press rather than release ext4: release discard bio after sending discard commands sparc64: Fix exception handling in UltraSPARC-III memcpy. arm64: avoid overflow in VA_START and PAGE_OFFSET arm64: Fix potential race with hardware DBM in ptep_set_access_flags() ...
2017-07-26media: staging: atomisp: array underflow in ioctlDan Carpenter
I noticed an array underflow in ov5693_enum_frame_size(). The code looks like this: int index = fse->index; if (index >= N_RES) retur -EINVAL; fse->index is a u32 that comes from the user. We want negative values to be counted as -EINVAL but they aren't. There are several ways to fix this but I feel like the best fix for future proofing is to change the type of N_RES from int to unsigned long to make it the same as if we were comparing against ARRAY_SIZE(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: staging: atomisp: ov5693: constify acpi_device_idArvind Yadav
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by <acpi/acpi_bus.h> work with const acpi_device_id. So mark the non-const structs as const. File size before: text data bss dec hex filename 20729 3264 0 23993 5db9 drivers/staging/media/atomisp/i2c/ov5693/ov5693.o File size After adding 'const': text data bss dec hex filename 20793 3200 0 23993 5db9 drivers/staging/media/atomisp/i2c/ov5693/ov5693.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: staging: atomisp: i2c: ov5693: Fix style a coding style issueIvan Menshykov
Fix checkpath errors Signed-off-by: Ivan Menshykov <ivan.menshykov@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>