1. 04 Apr, 2018 40 commits
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: avoid a warning if 32 bits build · dc9f65cf
      Mauro Carvalho Chehab authored
      Checking if a size_t value is bigger than ULONG_INT only makes
      sense if building on 64 bits, as warned by:
      	drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:697 gmin_get_config_var() warn: impossible condition '(*out_len > (~0)) => (0-u32max > u32max)'
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      dc9f65cf
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: don't access a NULL var · 8b1a2468
      Mauro Carvalho Chehab authored
      Get rid of those warnings:
      	drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:446 gmin_v1p2_ctrl() error: we previously assumed 'gs' could be null (see line 444)
      	drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:480 gmin_v1p8_ctrl() error: we previously assumed 'gs' could be null (see line 478)
      	drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:516 gmin_v2p8_ctrl() error: we previously assumed 'gs' could be null (see line 514)
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      8b1a2468
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: Get rid of *default.host.[ch] · 6dfc6a3f
      Mauro Carvalho Chehab authored
      There are a number of files at atomisp that aren't used anywhere,
      called as "*default.host.[ch]":
      
      	css2400/isp/kernels/dpc2/ia_css_dpc2_default.host.[ch]
      	css2400/isp/kernels/bnlm/ia_css_bnlm_default.host.[ch]
      	css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf_default.host.[ch]
      	css2400/isp/kernels/eed1_8/ia_css_eed1_8_default.host.[ch]
      
      Remove them.
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      6dfc6a3f
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: get rid of an unused function · 319dbc1b
      Mauro Carvalho Chehab authored
      The function __need_realloc_mipi_buffer() is not used anywhere.
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      319dbc1b
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: remove unused set_pd_base() · 849267df
      Mauro Carvalho Chehab authored
      There's an implementation for set_pd_base at sh_mmu logic
      with is said to be mandatory. However, the implementation
      ends by calling a routine that does nothing.
      
      So get rid of this entire nonsense.
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      849267df
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: fix endianess issues · f10127cd
      Mauro Carvalho Chehab authored
      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: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      f10127cd
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: add a missing include · c3a9880f
      Mauro Carvalho Chehab authored
      atomisp_drvfs.c is not including its own header, causing those
      warnings:
      	drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c:185:5: warning: symbol 'atomisp_drvfs_init' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c:201:6: warning: symbol 'atomisp_drvfs_exit' was not declared. Should it be static?
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      c3a9880f
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: get rid of stupid statements · b2fc77bc
      Mauro Carvalho Chehab authored
      It makes no sense to have a do nothing statement like:
      
      	(void)stage;
      
      Fix those warnings:
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:3808 sh_css_param_update_isp_params() error: uninitialized symbol 'stage'.
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c:1444 sh_css_update_host2sp_offline_frame() error: uninitialized symbol 'HIVE_ADDR_host_sp_com'.
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c:1475 sh_css_update_host2sp_mipi_frame() error: uninitialized symbol 'HIVE_ADDR_host_sp_com'.
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c:1502 sh_css_update_host2sp_mipi_metadata() error: uninitialized symbol 'HIVE_ADDR_host_sp_com'.
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c:1522 sh_css_update_host2sp_num_mipi_frames() error: uninitialized symbol 'HIVE_ADDR_host_sp_com'.
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c:1541 sh_css_update_host2sp_cont_num_raw_frames() error: uninitialized symbol 'HIVE_ADDR_host_sp_com'.
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      b2fc77bc
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: declare static vars as such · 89331129
      Mauro Carvalho Chehab authored
      Fix a bunch of warnings:
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/bufq/src/bufq.c:93:23: warning: symbol 'css_queues' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/rmgr/src/rmgr_vbuf.c:27:32: warning: symbol 'handle_table' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/rmgr/src/rmgr_vbuf.c:32:30: warning: symbol 'refpool' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/rmgr/src/rmgr_vbuf.c:43:30: warning: symbol 'writepool' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/rmgr/src/rmgr_vbuf.c:54:30: warning: symbol 'hmmbufferpool' 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/css2400/hive_isp_css_common/host/gp_timer.c:33:1: warning: symbol 'gp_timer_reg_load' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c:74:33: warning: symbol 'sh_css_sp_output' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/debug.c:32:25: warning: symbol 'debug_data' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:32:21: warning: symbol 'IB_BUFFER_NULL' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c:647:24: warning: symbol 'config' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:2894:10: warning: symbol 'g_param_buffer_dequeue_count' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:2895:10: warning: symbol 'g_param_buffer_enqueue_count' was not declared. Should it be static?
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      89331129
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: ia_css_output.host: don't use var before check · a0891a6e
      Mauro Carvalho Chehab authored
      Fix this warning:
      	drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/output/output_1.0/ia_css_output.host.c:64 ia_css_output_config() warn: variable dereferenced before check 'from->info' (see line 63)
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      a0891a6e
    • Mauro Carvalho Chehab's avatar
      media: staging: atomisp: do some coding style improvements · 5e95db4c
      Mauro Carvalho Chehab authored
      Use make coccicheck in patch mode to do some coding style
      improvements. Adjust the results manually.
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      5e95db4c
    • Katsuhiro Suzuki's avatar
      media: dvb_frontend: fix wrong cast in compat_ioctl · 5c6c9c48
      Katsuhiro Suzuki authored
      FE_GET_PROPERTY has always failed as following situations:
        - Use compatible ioctl
        - The array of 'struct dtv_property' has 2 or more items
      
      This patch fixes wrong cast to a pointer 'struct dtv_property' from a
      pointer of 2nd or after item of 'struct compat_dtv_property' array.
      Signed-off-by: default avatarKatsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      5c6c9c48
    • winton.liu's avatar
      media: gspca: fix Kconfig help info · 732a9edc
      winton.liu authored
      Documentation/video4linux/gspca.txt is missing.
      It has moved to Documentation/media/v4l-drivers/gspca-cardlist.rst
      Signed-off-by: default avatarwinton.liu <18502523564@163.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      732a9edc
    • Brad Love's avatar
      media: cx231xx: Increase USB bridge bandwidth · 8b1ca8a0
      Brad Love authored
      The cx231xx USB bridge has issue streaming QAM256 DVB-C channels.
      QAM64 channels were fine, but QAM256 channels produced corrupted
      transport streams.
      
      cx231xx alt mode 4 does not provide enough bandwidth to acommodate
      QAM256 DVB-C channels, most likely DVB-T2 channels would break up
      as well. Alt mode 5 increases bridge bandwidth to 90Mbps, and
      fixes QAM256 DVB-C streaming.
      Signed-off-by: default avatarBrad Love <brad@nextdimension.cc>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      8b1ca8a0
    • Kieran Bingham's avatar
      media: vsp1: Fix BRx conditional path in WPF · 639fa43d
      Kieran Bingham authored
      When a BRx is provided by a pipeline, the WPF must determine the master
      layer. Currently the condition to check this identifies pipe->bru ||
      pipe->num_inputs > 1.
      
      The code then moves on to dereference pipe->bru, thus the check fails
      static analysers on the possibility that pipe->num_inputs could be
      greater than 1 without pipe->bru being set.
      
      The reality is that the pipeline must have a BRx to support more than
      one input, thus this could never cause a fault - however it also
      identifies that the num_inputs > 1 check is redundant.
      
      Remove the redundant check - and always configure the master layer
      appropriately when we have a BRx configured in our pipeline.
      
      Fixes: 6134148f ("v4l: vsp1: Add support for the BRS entity")
      
      Cc: stable@vger.kernel.org
      Suggested-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      639fa43d
    • Akinobu Mita's avatar
      media: ov5640: add missing output pixel format setting · 19ad26f9
      Akinobu Mita authored
      The output pixel format changed by set_fmt() pad operation is not
      correctly applied.  It is intended to be restored by calling
      ov5640_set_framefmt() when the video stream is started.
      
      However, when the device is powered on by s_power subdev operation before
      the video stream is started, the current output mode setting is restored
      by ov5640_restore_mode() that also clears pending_mode_change flag in
      ov5640_set_mode().  So ov5640_set_framefmt() isn't called as intended and
      the output pixel format is not restored.
      
      This change adds the missing output pixel format setting in the
      ov5640_restore_mode() that is called when the device is powered on.
      
      Cc: Steve Longerbeam <slongerbeam@gmail.com>
      Cc: Hugues Fruchet <hugues.fruchet@st.com>
      Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      19ad26f9
    • Fabio Estevam's avatar
      media: ov2685: Remove owner assignment from i2c_driver · 4996c3d4
      Fabio Estevam authored
      Structure i2c_driver does not need to set the owner field, as this will
      be populated by the driver core.
      
      Generated by scripts/coccinelle/api/platform_no_drv_owner.cocci.
      Signed-off-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      4996c3d4
    • Todor Tomov's avatar
      media: ov5645: Use v4l2_find_nearest_size · 5b81c53c
      Todor Tomov authored
      Use v4l2_find_nearest_size instead of a driver specific function to find
      nearest matching size.
      Signed-off-by: default avatarTodor Tomov <todor.tomov@linaro.org>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      5b81c53c
    • Akinobu Mita's avatar
      media: ov5645: add missing of_node_put() in error path · 06fe9323
      Akinobu Mita authored
      The device node obtained with of_graph_get_next_endpoint() should be
      released by calling of_node_put().  But it was not released when
      v4l2_fwnode_endpoint_parse() failed.
      
      This change moves the of_node_put() call before the error check and
      fixes the issue.
      
      Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Acked-by: default avatarTodor Tomov <todor.tomov@linaro.org>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      06fe9323
    • Hugues Fruchet's avatar
      media: ov5640: fix get_/set_fmt colorspace related fields · e6441fde
      Hugues Fruchet authored
      Fix set of missing colorspace related fields in get_/set_fmt.
      Detected by v4l2-compliance tool.
      
      [Sakari Ailus: Rearrange fmt declaration in ov5640_probe()]
      Signed-off-by: default avatarHugues Fruchet <hugues.fruchet@st.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      e6441fde
    • Luca Ceresoli's avatar
    • Chiranjeevi Rapolu's avatar
      media: ov13858: Update to SPDX identifier · 28cab405
      Chiranjeevi Rapolu authored
      Replace GPL v2 license notice with SPDX license identifier.
      Signed-off-by: default avatarChiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      28cab405
    • Chiranjeevi Rapolu's avatar
      media: ov5670: Update to SPDX identifier · a1c3bb0e
      Chiranjeevi Rapolu authored
      Replace GPL v2 license notice with SPDX license identifier.
      Signed-off-by: default avatarChiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      a1c3bb0e
    • Rajmohan Mani's avatar
      media: dw9714: Update to SPDX license identifier · 136fe992
      Rajmohan Mani authored
      Remove the GPL v2 license boilerplate and update with the SPDX license
      identifier.
      Signed-off-by: default avatarRajmohan Mani <rajmohan.mani@intel.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      136fe992
    • Sakari Ailus's avatar
      media: v4l: Bring back array_size parameter to v4l2_find_nearest_size · d2dc57b1
      Sakari Ailus authored
      An older version of the driver patches were merged accidentally which
      resulted in missing the array_size parameter that tells the length of the
      array that contains the different supported sizes.
      
      Bring it back to v4l2_find_nearest size and make the corresponding change
      for the drivers using it as well.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      d2dc57b1
    • Fabio Estevam's avatar
      media: imx-media-csi: Do not propagate the error when pinctrl is not found · dd5747fb
      Fabio Estevam authored
      Since commit 52e17089 ("media: imx: Don't initialize vars that
      won't be used") imx_csi_probe() fails to probe after propagating the
      devm_pinctrl_get_select_default() error.
      
      devm_pinctrl_get_select_default() may return -ENODEV when the CSI pinctrl
      entry is not found, so better not to propagate the error in the -ENODEV
      case to avoid a regression.
      Suggested-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
      Reviewed-by: default avatarSteve Longerbeam <steve_longerbeam@mentor.com>
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      dd5747fb
    • Hans Verkuil's avatar
      media: media-types.rst: rename media-entity-type to media-entity-functions · cccc41fd
      Hans Verkuil authored
      The MEDIA_ENT_F_* defines refer to functions, not types. Update the
      documentation accordingly.
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      cccc41fd
    • Hans Verkuil's avatar
      media: media-ioc-g-topology.rst: fix 'reserved' sizes · 793d2a9e
      Hans Verkuil authored
      The size of the reserved arrays in the documentation is wrong. Sync
      this with the actual header.
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      793d2a9e
    • Hans Verkuil's avatar
      media: pixfmt-v4l2.rst: fix types · a54f2d98
      Hans Verkuil authored
      The v4l2_pix_format documentation still had 'enum's as types.
      Replace by __u32 and add a reference to the enum.
      
      Also put ycbcr_enc and hsv_enc in a union.
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      a54f2d98
    • Hans Verkuil's avatar
      media: pixfmt-v4l2-mplane.rst: fix types · 54f6735a
      Hans Verkuil authored
      The v4l2_pix_format_mplane documentation still had 'enum's as types.
      Replace by __u8 and add a reference to the enum.
      
      Also put ycbcr_enc and hsv_enc in a union.
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      54f6735a
    • Hans Verkuil's avatar
      media: v4l2-tpg-core.c: add space after % · e605e9e3
      Hans Verkuil authored
      I know, it's a measly space, but I can't stand it since the
      V4L2_PIX_FMT_NV24 case before this case does it right.
      
      So add the space in order to restore blessed symmetry and
      consistency and to make the world whole again...
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      e605e9e3
    • Jasmin Jessich's avatar
      media: cec-pin: Fixed ktime_t to ns conversion · 437fba47
      Jasmin Jessich authored
      Older Kernels use a struct for ktime_t, which requires the conversion
      function ktime_to_ns to be used on some places. With this patch it will
      compile now also for older Kernel versions.
      Signed-off-by: default avatarJasmin Jessich <jasmin@anw.at>
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      437fba47
    • Ryder Lee's avatar
      media: vcodec: fix error return value from mtk_jpeg_clk_init() · 648a9576
      Ryder Lee authored
      The error return value should be fixed as it may return EPROBE_DEFER.
      
      Cc: Bin Liu <bin.liu@mediatek.com>
      Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
      Reviewed-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
      Acked-by: default avatarRick Chang <rick.chang@mediatek.com>
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      648a9576
    • Luca Ceresoli's avatar
      media: doc: fix ReST link syntax · eed57565
      Luca Ceresoli authored
      There is a ':' in excess, resulting in an unwanted ':' in the rendered
      output.
      Signed-off-by: default avatarLuca Ceresoli <luca@lucaceresoli.net>
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      eed57565
    • Colin Ian King's avatar
      media: staging: media: davinci_vpfe: fix spelling of resizer_configure_in_continious_mode · 67b6c672
      Colin Ian King authored
      Trivial fix: rename function resizer_configure_in_continious_mode to
      resizer_configure_in_continuous_mode to fix spelling mistake.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      67b6c672
    • Alexandre Courbot's avatar
      media: venus: vdec: fix format enumeration · 82e071e2
      Alexandre Courbot authored
      find_format_by_index() stops enumerating formats as soon as the index
      matches, and returns NULL if venus_helper_check_codec() finds out that
      the format is not supported. This prevents formats to be properly
      enumerated if a non-supported format is present, as the enumeration will
      end with it.
      
      Fix this by moving the call to venus_helper_check_codec() into the loop,
      and keep enumerating when it fails.
      
      Fixes: 29f0133e media: venus: use helper function to check supported codecs
      Signed-off-by: default avatarAlexandre Courbot <acourbot@chromium.org>
      Acked-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      82e071e2
    • Arnd Bergmann's avatar
      media: imx: work around false-positive warning · 890f2769
      Arnd Bergmann authored
      The IS_ERR()/PTR_ERR() combination confuses gcc to the point that it
      cannot prove the upstream_ep variable to be initialized:
      
      drivers/staging/media/imx/imx-media-csi.c: In function 'csi_link_validate':
      drivers/staging/media/imx/imx-media-csi.c:1025:20: error: 'upstream_ep' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        priv->upstream_ep = upstream_ep;
        ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
      drivers/staging/media/imx/imx-media-csi.c:1026:24: error: 'upstream_ep.bus_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        is_csi2 = (upstream_ep.bus_type == V4L2_MBUS_CSI2);
                   ~~~~~~~~~~~^~~~~~~~~
      drivers/staging/media/imx/imx-media-csi.c:127:19: error: 'upstream_ep.bus.parallel.bus_width' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      I could come up with no good way to rewrite this function, as a last
      resort, this adds an explicit zero-intialization of the structure.
      
      Fixes: 52e17089 ("media: imx: Don't initialize vars that won't be used")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      890f2769
    • Mauro Carvalho Chehab's avatar
      media: r820t: don't crash if attach fails · 2e81ae39
      Mauro Carvalho Chehab authored
      As pointed by smatch:
      	drivers/media/tuners/r820t.c:2374 r820t_attach() error: potential null dereference 'priv'.  (kzalloc returns null)
      
      The current function with prints error assumes that the attach
      succeeds. So, don't use it in case of failures.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      2e81ae39
    • Linus Torvalds's avatar
      Merge branch 'userns-linus' of... · 17dec0a9
      Linus Torvalds authored
      Merge branch 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
      
      Pull namespace updates from Eric Biederman:
       "There was a lot of work this cycle fixing bugs that were discovered
        after the merge window and getting everything ready where we can
        reasonably support fully unprivileged fuse. The bug fixes you already
        have and much of the unprivileged fuse work is coming in via other
        trees.
      
        Still left for fully unprivileged fuse is figuring out how to cleanly
        handle .set_acl and .get_acl in the legacy case, and properly handling
        of evm xattrs on unprivileged mounts.
      
        Included in the tree is a cleanup from Alexely that replaced a linked
        list with a statically allocated fix sized array for the pid caches,
        which simplifies and speeds things up.
      
        Then there is are some cleanups and fixes for the ipc namespace. The
        motivation was that in reviewing other code it was discovered that
        access ipc objects from different pid namespaces recorded pids in such
        a way that when asked the wrong pids were returned. In the worst case
        there has been a measured 30% performance impact for sysvipc
        semaphores. Other test cases showed no measurable performance impact.
        Manfred Spraul and Davidlohr Bueso who tend to work on sysvipc
        performance both gave the nod that this is good enough.
      
        Casey Schaufler and James Morris have given their approval to the LSM
        side of the changes.
      
        I simplified the types and the code dealing with sysvipc to pass just
        kern_ipc_perm for all three types of ipc. Which reduced the header
        dependencies throughout the kernel and simplified the lsm code.
      
        Which let me work on the pid fixes without having to worry about
        trivial changes causing complete kernel recompiles"
      
      * 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        ipc/shm: Fix pid freeing.
        ipc/shm: fix up for struct file no longer being available in shm.h
        ipc/smack: Tidy up from the change in type of the ipc security hooks
        ipc: Directly call the security hook in ipc_ops.associate
        ipc/sem: Fix semctl(..., GETPID, ...) between pid namespaces
        ipc/msg: Fix msgctl(..., IPC_STAT, ...) between pid namespaces
        ipc/shm: Fix shmctl(..., IPC_STAT, ...) between pid namespaces.
        ipc/util: Helpers for making the sysvipc operations pid namespace aware
        ipc: Move IPCMNI from include/ipc.h into ipc/util.h
        msg: Move struct msg_queue into ipc/msg.c
        shm: Move struct shmid_kernel into ipc/shm.c
        sem: Move struct sem and struct sem_array into ipc/sem.c
        msg/security: Pass kern_ipc_perm not msg_queue into the msg_queue security hooks
        shm/security: Pass kern_ipc_perm not shmid_kernel into the shm security hooks
        sem/security: Pass kern_ipc_perm not sem_array into the sem security hooks
        pidns: simpler allocation of pid_* caches
      17dec0a9
    • Linus Torvalds's avatar
      Merge branch 'for-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · d92cd810
      Linus Torvalds authored
      Pull workqueue updates from Tejun Heo:
       "rcu_work addition and a couple trivial changes"
      
      * 'for-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
        workqueue: remove the comment about the old manager_arb mutex
        workqueue: fix the comments of nr_idle
        fs/aio: Use rcu_work instead of explicit rcu and work item
        cgroup: Use rcu_work instead of explicit rcu and work item
        RCU, workqueue: Implement rcu_work
      d92cd810