Mauro Carvalho Chehab [Fri, 23 Mar 2018 12:54:22 +0000 (08:54 -0400)]
media: fimc-capture: get rid of two warnings
Smatch produces two warnings when building this file:
./arch/x86/include/asm/bitops.h:433:22: warning: asm output is not an lvalue
./arch/x86/include/asm/bitops.h:433:22: warning: asm output is not an lvalue
On some asm instructions.
I suspect that those asm instructions might not be producing the
right code, so, better to use two intermediate vars, get rid of
the warnings and of the risk of producing a wrong code.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 12:43:47 +0000 (08:43 -0400)]
media: dvb-usb-v2: fix a missing dependency of I2C_MUX
Now that af9015 requires I2C_MUX, all drivers that select
it should also depend on it.
drivers/media/dvb-frontends/af9013.o: In function `af9013_remove':
>> drivers/media/dvb-frontends/af9013.c:1560: undefined reference to `i2c_mux_del_adapters'
drivers/media/dvb-frontends/af9013.o: In function `af9013_probe':
>> drivers/media/dvb-frontends/af9013.c:1488: undefined reference to `i2c_mux_alloc'
>> drivers/media/dvb-frontends/af9013.c:1495: undefined reference to `i2c_mux_add_adapter'
drivers/media/dvb-frontends/af9013.c:1544: undefined reference to `i2c_mux_del_adapters'
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 12:23:23 +0000 (08:23 -0400)]
media: uvc: to the right check at uvc_ioctl_enum_framesizes()
While the logic there is correct, it tricks both humans and
machines, a the check if "i" var is not zero is actually to
validate if the "frames" var was initialized when the loop
ran for the first time.
That produces the following warning:
drivers/media/usb/uvc/uvc_v4l2.c:1192 uvc_ioctl_enum_framesizes() error: potentially dereferencing uninitialized 'frame'.
Change the logic to do the right test instead.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:51:07 +0000 (07:51 -0400)]
media: cec-core: fix a bug at cec_error_inj_write()
If the adapter doesn't have error_inj_parse_line() ops, the
write() logic won't return -EINVAL, but, instead, it will keep
looping, because "count" is a non-negative number.
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:48:08 +0000 (07:48 -0400)]
media: tda9840: cleanup a warning
There's a false positive warning there:
drivers/media/i2c/tda9840.c:79 tda9840_status() error: uninitialized symbol 'byte'.
Change the code to match our coding style, in order to fix it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:42:32 +0000 (07:42 -0400)]
media: tm6000: avoid casting just to print pointer address
Instead of casting, just use %p.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:33:22 +0000 (07:33 -0400)]
media: em28xx-input: improve error handling code
The current I2C error handling logic makes static analyzers
confused:
drivers/media/usb/em28xx/em28xx-input.c:96 em28xx_get_key_terratec() error: uninitialized symbol 'b'.
Change it to match the coding style we're using elsewhere.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:31:59 +0000 (07:31 -0400)]
media: zr364xx: avoid casting just to print pointer address
Instead of casting, just use %p.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:30:03 +0000 (07:30 -0400)]
media: vivid-radio-rx: add a cast to avoid a warning
The logic at vivid_radio_rx_g_tuner() is producint an overflow
warning:
drivers/media/platform/vivid/vivid-radio-rx.c:250 vivid_radio_rx_g_tuner() warn: potential negative subtraction from max '65535 - (__builtin_choose_expr( == || == , , __builtin_choose_expr( == || == , , __builtin_choose_expr( == || == , , __builtin_choose_expr( == || == , , __builtin_choose_expr( == || == , , __builtin_choose_expr( == , , (0))))))) * 65535) / delta'
Add a cast to prevent that.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:27:21 +0000 (07:27 -0400)]
media: saa7134-alsa: don't use casts to print a buffer address
Change the logic there to avoid casting, solving this warning:
drivers/media/pci/saa7134/saa7134-alsa.c:276 saa7134_alsa_dma_init() warn: argument 3 to %08lx specifier is cast from pointer
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:24:16 +0000 (07:24 -0400)]
media: solo6x10: get rid of an address space warning
Instead of using an ancillary function to avoid duplicating
a small portion of code that copies data either to kernelspace
or between userspace-kernelspace, duplicate the code,
as it prevents static analyzers to complain about it:
drivers/media/pci/solo6x10/solo6x10-g723.c:260:46: warning: cast removes address space of expression
The hole idea of using __user is to make sure that the code is
doing the right thing with address space, so there's no
sense on use casting.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:17:19 +0000 (07:17 -0400)]
media: zoran: don't cast pointers to print them
drivers/media/pci/zoran/zoran_driver.c:242 v4l_fbuffer_alloc() warn: argument 5 to %lx specifier is cast from pointer
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:13:06 +0000 (07:13 -0400)]
media: ir-kbd-i2c: change the if logic to avoid a warning
While the code is correct, it produces this warning:
drivers/media/i2c/ir-kbd-i2c.c:593 zilog_ir_format() error: buffer overflow 'code_block->codes' 61 <= 173
As static analyzers may be tricked by arithmetic expressions on
comparisions. So, change the order, in order to shut up this
false-positive warning.
That also makes easier for humans to understand that it won't
be trying to go past buffer size.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:10:12 +0000 (07:10 -0400)]
media: ir-kbd-i2c: improve error handling code
The current I2C error handling logic makes static analyzers
confused, and it doesn't follow the coding style we're using:
drivers/media/i2c/ir-kbd-i2c.c:180 get_key_pixelview() error: uninitialized symbol 'b'.
drivers/media/i2c/ir-kbd-i2c.c:224 get_key_knc1() error: uninitialized symbol 'b'.
drivers/media/i2c/ir-kbd-i2c.c:226 get_key_knc1() error: uninitialized symbol 'b'.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 11:03:51 +0000 (07:03 -0400)]
media: saa7134-input: improve error handling
Currently, the code produces those false-positives:
drivers/media/pci/saa7134/saa7134-input.c:203 get_key_msi_tvanywhere_plus() error: uninitialized symbol 'b'.
drivers/media/pci/saa7134/saa7134-input.c:251 get_key_kworld_pc150u() error: uninitialized symbol 'b'.
drivers/media/pci/saa7134/saa7134-input.c:275 get_key_purpletv() error: uninitialized symbol 'b'.
Improve the error handling code, making it to look like our
coding style.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 10:56:55 +0000 (06:56 -0400)]
media: s2255drv: fix a casting warning
drivers/media/usb/s2255/s2255drv.c:651 s2255_fillbuff() warn: argument 3 to %08lx specifier is cast from pointer
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 10:52:25 +0000 (06:52 -0400)]
media: ivtvfb: Cleanup some warnings
drivers/media/pci/ivtv/ivtvfb.c:349 ivtvfb_prep_frame() warn: argument 3 to %08lx specifier is cast from pointer
drivers/media/pci/ivtv/ivtvfb.c:360 ivtvfb_prep_frame() warn: argument 3 to %08lx specifier is cast from pointer
drivers/media/pci/ivtv/ivtvfb.c:363 ivtvfb_prep_frame() warn: argument 4 to %08lx specifier is cast from pointer
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 19:00:32 +0000 (15:00 -0400)]
media: videobuf-dma-sg: Fix a weird cast
Just use %p. Fixes this warning:
drivers/media/v4l2-core/videobuf-dma-sg.c:247 videobuf_dma_init_kernel() warn: argument 2 to %08lx specifier is cast from pointer
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 10:33:36 +0000 (06:33 -0400)]
soc_camera: fix a weird cast on printk
drivers/media/platform/soc_camera/soc_camera.c:790 soc_camera_mmap() warn: argument 4 to %08lx specifier is cast from pointer
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 19:16:25 +0000 (15:16 -0400)]
media: cx23885: fix a warning
drivers/media/pci/cx23885/cx23885-alsa.c:92 cx23885_alsa_dma_init() warn: argument 3 to %08lx specifier is cast from pointer
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 18:56:01 +0000 (14:56 -0400)]
media: cx88: fix two warnings
drivers/media/pci/cx88/cx88-alsa.c:295 cx88_alsa_dma_init() warn: argument 3 to %08lx specifier is cast from pointer
drivers/media/pci/cx88/cx88-alsa.c:669 snd_cx88_wm8775_volume_put() warn: potential negative subtraction from max '65535 - (32768 * left) / right'
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 10:48:07 +0000 (06:48 -0400)]
media: solo6x10: simplify the logic at solo_p2m_dma_desc()
The logic with gets a p2m_id is more complex than needed,
causing false positives with static analyzers:
drivers/media/pci/solo6x10/solo6x10-p2m.c:81 solo_p2m_dma_desc() error: buffer overflow 'solo_dev->p2m_dev' 4 <= s32max
Make it simpler and use unsigned int.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 10:36:26 +0000 (06:36 -0400)]
media: bttv-input: better handle errors at I2C transfer
The error handling logic at get_key_pv951() is a little bit
akward, with produces this false positive warning:
drivers/media/pci/bt8xx/bttv-input.c:344 get_key_pv951() error: uninitialized symbol 'b'.
Do a cleanup. As a side effect, it also improves its coding
style.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Fri, 23 Mar 2018 10:23:23 +0000 (06:23 -0400)]
media: tvaudio: improve error handling
The error handling logic at tvaudio is broken on several ways,
as it doesn't really check right when an error occurs.
Change it to return the proper error code from read/write
routines and fix the errors on reads.
Shuts up the following warnings:
drivers/media/i2c/tvaudio.c:222 chip_read() error: uninitialized symbol 'buffer'.
drivers/media/i2c/tvaudio.c:223 chip_read() error: uninitialized symbol 'buffer'.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 19:13:58 +0000 (15:13 -0400)]
media: sp887x: fix a warning
drivers/media/dvb-frontends/sp887x.c:179 sp887x_initial_setup() error: memcpy() '&buf[2]' too small (30 vs 16384)
This is actually a false alarm, but reverting the check order
makes not only for humans to review the code, but also cleans
the warning.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 18:02:21 +0000 (14:02 -0400)]
media: v4l2-ioctl: fix some "too small" warnings
While the code there is right, it produces three false positives:
drivers/media/v4l2-core/v4l2-ioctl.c:2868 video_usercopy() error: copy_from_user() 'parg' too small (128 vs 16383)
drivers/media/v4l2-core/v4l2-ioctl.c:2868 video_usercopy() error: copy_from_user() 'parg' too small (128 vs 16383)
drivers/media/v4l2-core/v4l2-ioctl.c:2876 video_usercopy() error: memset() 'parg' too small (128 vs 16383)
Store the ioctl size on a cache var, in order to suppress those.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 17:54:18 +0000 (13:54 -0400)]
media: v4l2-tpg-core: avoid buffer overflows
Fix the following warnings:
drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1146 gen_twopix() error: buffer overflow 'buf[1]' 8 <= 8
drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1152 gen_twopix() error: buffer overflow 'buf[1]' 8 <= 8
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 17:44:33 +0000 (13:44 -0400)]
media: ov5670: get rid of a series of __be warnings
There are some troubles on this driver with respect to the usage
of __be16 and __b32 macros:
drivers/media/i2c/ov5670.c:1857:27: warning: incorrect type in initializer (different base types)
drivers/media/i2c/ov5670.c:1857:27: expected unsigned short [unsigned] [usertype] reg_addr_be
drivers/media/i2c/ov5670.c:1857:27: got restricted __be16 [usertype] <noident>
drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
drivers/media/i2c/ov5670.c:1901:13: warning: incorrect type in assignment (different base types)
drivers/media/i2c/ov5670.c:1901:13: expected unsigned int [unsigned] [usertype] val
drivers/media/i2c/ov5670.c:1901:13: got restricted __be32 [usertype] <noident>
Fix them.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 17:22:27 +0000 (13:22 -0400)]
media: rca: declare formats var as static
As warned:
drivers/media/platform/rockchip/rga/rga.c:210:16: warning: symbol 'formats' was not declared. Should it be static?
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 17:19:22 +0000 (13:19 -0400)]
media: vpss: fix annotations for vpss_regs_base2
Fix those warnings:
drivers/media/platform/davinci/vpss.c:510:25: warning: incorrect type in argument 1 (different address spaces)
drivers/media/platform/davinci/vpss.c:510:25: expected void volatile [noderef] <asn:2>*addr
drivers/media/platform/davinci/vpss.c:510:25: got unsigned int [usertype] *static [toplevel] [assigned] vpss_regs_base2
drivers/media/platform/davinci/vpss.c:520:34: warning: incorrect type in assignment (different address spaces)
drivers/media/platform/davinci/vpss.c:520:34: expected unsigned int [usertype] *static [toplevel] [assigned] vpss_regs_base2
drivers/media/platform/davinci/vpss.c:520:34: got void [noderef] <asn:2>*
drivers/media/platform/davinci/vpss.c:522:54: warning: incorrect type in argument 2 (different address spaces)
drivers/media/platform/davinci/vpss.c:522:54: expected void volatile [noderef] <asn:2>*addr
drivers/media/platform/davinci/vpss.c:522:54: got unsigned int [usertype] *static [toplevel] [assigned] vpss_regs_base2
Weird enough, vpss_regs_base0 and vpss_regs_base1 were
properly annotated.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 15:40:15 +0000 (11:40 -0400)]
media: dvb_frontend: add proper __user annotations
Solves those warnings:
drivers/media/dvb-core/dvb_frontend.c:2297:39: warning: incorrect type in argument 1 (different address spaces)
drivers/media/dvb-core/dvb_frontend.c:2297:39: expected void const [noderef] <asn:1>*<noident>
drivers/media/dvb-core/dvb_frontend.c:2297:39: got struct dtv_property *props
drivers/media/dvb-core/dvb_frontend.c:2331:39: warning: incorrect type in argument 1 (different address spaces)
drivers/media/dvb-core/dvb_frontend.c:2331:39: expected void const [noderef] <asn:1>*<noident>
drivers/media/dvb-core/dvb_frontend.c:2331:39: got struct dtv_property *props
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 13:11:20 +0000 (09:11 -0400)]
media: imx-media-utils: fix a warning
The logic at find_format() is a little bit confusing even for
humans, and it tricks static code analyzers:
drivers/staging/media/imx/imx-media-utils.c:259 find_format() error: buffer overflow 'array' 14 <= 20
Rewrite the logic in a way that it makes it clearer to understand,
while prevent static analyzers to produce false positives.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 13:01:11 +0000 (09:01 -0400)]
media: dvbdev: handle ENOMEM error at dvb_module_probe()
If allocation of struct board_info fails, return NULL from
dvb_module_probe().
Fix this warning:
drivers/media/dvb-core/dvbdev.c:958 dvb_module_probe() error: potential null dereference 'board_info'. (kzalloc returns null)
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 21 Mar 2018 17:28:47 +0000 (13:28 -0400)]
media: debugfs-cec-error-inj: document CEC error inj debugfs ABI
Document the core of the debugfs CEC error injection ABI.
The driver specific commands are documented elsewhere and
this file points to that documentation.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Thu, 8 Feb 2018 16:25:15 +0000 (11:25 -0500)]
media: cec-pin-error-inj.rst: document CEC Pin Error Injection
The CEC Pin framework adds support for Error Injection.
Document all the error injections commands and how to use it.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 6 Mar 2018 21:20:00 +0000 (16:20 -0500)]
media: cec: improve CEC pin event handling
It turns out that the struct cec_fh event buffer size of 64 events
(64 for CEC_EVENT_PIN_CEC_LOW and 64 for _HIGH) is too small. It's
about 160 ms worth of events and if the Raspberry Pi is busy, then it
might take too long for the application to be scheduled so that it can
drain the pending events. Increase these buffers to 800 events which
is at least 2 seconds worth of events.
There is also a FIFO in between the interrupt and the cec-pin thread.
The thread passes the events on to the CEC core. It is important that
should this FIFO fill up the cec core will be informed that events
have been lost so this can be communicated to the user by setting
CEC_EVENT_FL_DROPPED_EVENTS.
It is very hard to debug CEC problems if events were lost without
informing the user of that fact.
If events were dropped due to the FIFO filling up, then the debugfs
status file will let you know how many events were dropped.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Thu, 1 Mar 2018 07:02:24 +0000 (02:02 -0500)]
media: cec-pin: improve status log
Keep track of the number of short or long start bits, the number
of short or long data bits and the number of initiated or detected
low drive conditions.
Show this information in the status debugfs log.
Helpful when debugging, particularly when doing error injection
as well.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 31 Oct 2017 13:55:09 +0000 (09:55 -0400)]
media: cec-pin: add error injection support
Implement all the error injection commands.
The state machine gets new states for the various error situations,
helper functions are added to detect whether an error injection is
active and the actual error injections are implemented.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 31 Oct 2017 13:55:09 +0000 (09:55 -0400)]
media: cec-pin-error-inj: parse/show error injection
Add support to the CEC Pin framework to parse error injection commands
and to show them.
The next patch will do the actual implementation of this.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 31 Oct 2017 13:55:09 +0000 (09:55 -0400)]
media: cec-pin: create cec_pin_start_timer() function
This function will be needed for injecting a custom pulse.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Sun, 25 Feb 2018 11:05:55 +0000 (06:05 -0500)]
media: cec-core.rst: document the error injection ops
Document the new core error injection callbacks.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 31 Oct 2017 13:55:09 +0000 (09:55 -0400)]
media: cec: add core error injection support
Add two new ops (error_inj_show and error_inj_parse_line) to support
error injection functionality for CEC adapters. If both are present,
then the core will add a new error-inj debugfs file that can be used
to see the current error injection commands and to set error injection
commands.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sean Young [Thu, 22 Mar 2018 10:41:16 +0000 (06:41 -0400)]
media: rc docs: fix warning for RC_PROTO_IMON
This protocol was recently added and causes warnings.
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 11:23:48 +0000 (07:23 -0400)]
media: s5p_mfc_enc: get rid of new warnings
The values of enc_y_addr and enc_c_addr are initialized by
s5p_mfc_hw_call(), but, in thesis, this macro might be doing
nothing, if the get_enc_frame_buffer() is not declared.
That causes those GCC warnings:
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c:1242 enc_post_frame_start() error: uninitialized symbol 'enc_y_addr'.
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c:1243 enc_post_frame_start() error: uninitialized symbol 'enc_c_addr'.
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c:1256 enc_post_frame_start() error: uninitialized symbol 'enc_y_addr'.
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c:1257 enc_post_frame_start() error: uninitialized symbol 'enc_c_addr'.
Change the logic by initializing those constants to zero,
with should hopefully do the right thing.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sylwester Nawrocki [Mon, 19 Mar 2018 14:29:58 +0000 (10:29 -0400)]
media: s5p-mfc: Amend initial min, max values of HEVC hierarchical coding QP controls
Valid range for those controls is specified in documentation as [0, 51],
so initialize the controls to such range rather than [INT_MIN, INT_MAX].
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sylwester Nawrocki [Mon, 19 Mar 2018 14:29:16 +0000 (10:29 -0400)]
media: s5p-mfc: Ensure HEVC QP controls range is properly updated
When value of V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP or V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP
controls is changed we should update range of a set of HEVC quantization
parameter v4l2 controls as specified in the HEVC controls documentation.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Marek Szyprowski [Tue, 13 Mar 2018 10:27:10 +0000 (06:27 -0400)]
media: s5p-mfc: Use real device for request_firmware() call
Provide proper (real) struct device to request_firmware() call. This fixes
following error messages:
(NULL device *): Direct firmware load for s5p-mfc-v6-v2.fw failed with error -2
(NULL device *): Direct firmware load for s5p-mfc-v6.fw failed with error -2
into a bit more meaningful ones:
s5p-mfc
11000000.codec: Direct firmware load for s5p-mfc-v6-v2.fw failed with error -2
s5p-mfc
11000000.codec: Direct firmware load for s5p-mfc-v6.fw failed with error -2
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:47 +0000 (07:25 -0500)]
media: s5p-mfc: Add support for HEVC encoder
Add HEVC encoder support and necessary registers, V4L2 CIDs,
and hevc encoder parameters
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:45 +0000 (07:25 -0500)]
media: s5p-mfc: Add VP9 decoder support
Add support for codec definition and corresponding buffer
requirements for VP9 decoder.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:44 +0000 (07:25 -0500)]
media: s5p-mfc: Add support for HEVC decoder
Add support for codec definition and corresponding buffer
requirements for HEVC decoder.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:40 +0000 (07:25 -0500)]
media: s5p-mfc: Support MFCv10.10 buffer requirements
Aligning the luma_dpb_size, chroma_dpb_size, mv_size and me_buffer_size
for MFCv10.10.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Kamil Debski <kamil@wypas.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:39 +0000 (07:25 -0500)]
media: s5p-mfc: Use min scratch buffer size as provided by F/W
After MFC v8.0, mfc f/w lets the driver know how much scratch buffer
size is required for decoder. If mfc f/w has the functionality,
E_MIN_SCRATCH_BUFFER_SIZE, driver can know how much scratch buffer size
is required for encoder too.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:38 +0000 (07:25 -0500)]
media: s5p-mfc: Adding initial support for MFC v10.10
Adding the support for MFC v10.10, with new register file and
necessary hw control, decoder, encoder and structural changes.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:37 +0000 (07:25 -0500)]
media: s5p-mfc: Rename IS_MFCV8 macro
This patch renames macro IS_MFCV8 to IS_MFCV8_PLUS so that the MFCv8
code can be resued for MFCv10.10 support. Since the MFCv8 specific code
holds good for MFC v10.10 also.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 22 Mar 2018 10:47:46 +0000 (06:47 -0400)]
media: extended-controls.rst: don't use adjustbox
LaTeX adjustbox is known to cause pdf documentation build breakages
with some newer Sphinx versions. So, don't use it.
While here, adjust table sizes in order to better produce the
pdf output.
Fixes:
c0da55b95bd9 ("media: v4l2: Documentation for HEVC CIDs")
Cc: Smitha T Murthy <smitha.t@samsung.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:48 +0000 (07:25 -0500)]
media: v4l2: Documentation for HEVC CIDs
Added V4L2 controls for HEVC encoder.
with V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 to match the code.
[s.nawrocki@samsung.com]: Replaced V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN10
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:46 +0000 (07:25 -0500)]
media: v4l2: Add v4l2 control IDs for HEVC encoder
Add v4l2 controls for HEVC encoder
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:43 +0000 (07:25 -0500)]
media: v4l2: Documentation of HEVC compressed format
Add V4L2 definition for HEVC compressed format which is also
known as H.265.
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:42 +0000 (07:25 -0500)]
media: v4l2-ioctl: add HEVC format description
HEVC is a video coding format
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Smitha T Murthy [Fri, 2 Feb 2018 12:25:41 +0000 (07:25 -0500)]
media: videodev2.h: Add v4l2 definition for HEVC
Add V4L2 definition for HEVC compressed format
Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Niklas Söderlund [Wed, 14 Mar 2018 02:49:10 +0000 (22:49 -0400)]
media: rcar-vin: use scratch buffer and always run in continuous mode
Instead of switching capture mode depending on how many buffers are
available use a scratch buffer and always run in continuous mode. By
using a scratch buffer the responsiveness of the capture loop is
increased as it can keep running even if there are no buffers available
from userspace.
As soon as a userspace queues a buffer it is inserted into the capture
loop and returned as soon as it is filled. This is a improvement on the
previous logic where the whole capture loop was stopped and switched to
single capture mode if userspace did not feed the VIN driver buffers at
the same time it consumed them. To make matters worse it was difficult
for the driver to reenter continuous mode if it entered single mode even
if userspace started to queue buffers faster. This resulted in
suboptimal performance where if userspace where delayed for a short
period the ongoing capture would be slowed down and run in single mode
until the capturing process where restarted.
An additional effect of this change is that the capture logic can be
made much simple as we know that continuous mode will always be used.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Niklas Söderlund [Wed, 14 Mar 2018 02:49:09 +0000 (22:49 -0400)]
media: rcar-vin: allocate a scratch buffer at stream start
Before starting a capture, allocate a scratch buffer which can be used
by the driver to give to the hardware if no buffers are available from
userspace. The buffer is not used in this patch but prepares for future
refactoring where the scratch buffer can be used to avoid the need to
fallback on single capture mode if userspace can't queue buffers as fast
as the VIN driver consumes them.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 13 Mar 2018 18:34:12 +0000 (14:34 -0400)]
media: pixfmt-v4l2.rst: fix broken enum :c:type
:c:type:: -> :c:type:
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Tue, 13 Mar 2018 18:29:36 +0000 (14:29 -0400)]
media: imx.rst: fix typo
Multpiple -> Multiple
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Arnd Bergmann [Tue, 13 Mar 2018 13:06:03 +0000 (09:06 -0400)]
media: ngene: avoid unused variable warning
The newly added pdev variable is only used in an #ifdef, causing a
build warning without CONFIG_PCI_MSI, unless we move the declaration
inside the same #ifdef:
drivers/media/pci/ngene/ngene-core.c: In function 'ngene_start':
drivers/media/pci/ngene/ngene-core.c:1328:17: error: unused variable 'pdev' [-Werror=unused-variable]
Fixes:
6795bf626482 ("media: ngene: convert kernellog printing from printk() to dev_*() macros")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Arnd Bergmann [Tue, 13 Mar 2018 12:05:36 +0000 (08:05 -0400)]
media: v4l: omap_vout: vrfb: remove an unused variable
We now get a warning after the 'dmadev' variable is no longer used:
drivers/media/platform/omap/omap_vout_vrfb.c: In function 'omap_vout_prepare_vrfb':
drivers/media/platform/omap/omap_vout_vrfb.c:239:21: error: unused variable 'dmadev' [-Werror=unused-variable]
Fixes:
8f0aa38292f2 ("media: v4l: omap_vout: vrfb: Use the wrapper for prep_interleaved_dma()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Scheller [Sat, 10 Mar 2018 12:24:43 +0000 (07:24 -0500)]
media: ttpci: improve printing of encoded MAC address
When loading the budget_av driver for ie. a KNC1 DVB-C TDA10024 card,
which makes use of the ttpci eeprom check functionality (that always
fails on these cards, but that's no issue at all), this is printed
to the kernel log:
[ 10.497333] saa7146 (0): dma buffer size 192512
[ 10.497335] dvbdev: DVB: registering new adapter (KNC1 DVB-C TDA10024)
[ 10.545007] adapter failed MAC signature check
[ 10.545009] encoded MAC from EEPROM was
[ 10.545010] ff:
[ 10.545011] ff:
[ 10.545011] ff:
...
[ 10.545021] ff
[ 10.832422] budget_av: KNC1-4: MAC addr = 00:09:d6:6d:b3:be
with the 'ff' being repeated for a total of 20 times. Improve that by
using the %*phC format specifier instead dprintk()'ing every byte of the
encoded MAC separately. This obsoletes the int i, and the kernel log
looks cleaner:
[ 3234.383153] saa7146 (0): dma buffer size 192512
[ 3234.383154] dvbdev: DVB: registering new adapter (KNC1 DVB-C TDA10024)
[ 3234.428745] adapter failed MAC signature check
[ 3234.428747] encoded MAC from EEPROM was ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff
[ 3234.728194] budget_av: KNC1-0: MAC addr = 00:09:d6:6d:b3:be
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Guennadi Liakhovetski [Fri, 9 Mar 2018 17:01:08 +0000 (12:01 -0500)]
media: V4L: remove myself as soc-camera maintainer
The soc-camera framework is deprecated, patches for it are very rare
and only contain trivial clean up. Further I haven't got any more
soc-camera systems running modern kernels.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Geert Uytterhoeven [Fri, 9 Mar 2018 09:34:40 +0000 (04:34 -0500)]
media: dt-bindings: media: rcar_vin: Use status "okay"
According to the Devicetree Specification, "ok" is not a valid status.
Fixes:
47c71bd61b772cd7 ("[media] rcar_vin: add devicetree support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Wed, 21 Mar 2018 19:48:11 +0000 (15:48 -0400)]
media: v4l2-common: fix a compilation breakage
Clearly, changeset
95ce9c28601a ("media: v4l: common: Add a
function to obtain best size from a list") was never tested, as it
broke compilation with:
drivers/media/platform/vivid/vivid-vid-cap.c: In function ‘vivid_try_fmt_vid_cap’:
drivers/media/platform/vivid/vivid-vid-cap.c:565:34: error: macro "v4l2_find_nearest_size" requer 6 argumentos, mas apenas 5 foram fornecidos
mp->width, mp->height);
^
drivers/media/platform/vivid/vivid-vid-cap.c:564:4: error: ‘v4l2_find_nearest_size’ undeclared (first use in this function); did you mean ‘__v4l2_find_nearest_size’?
v4l2_find_nearest_size(webcam_sizes, width, height,
^~~~~~~~~~~~~~~~~~~~~~
__v4l2_find_nearest_size
drivers/media/platform/vivid/vivid-vid-cap.c:564:4: note: each undeclared identifier is reported only once for each function it appears in
drivers/media/i2c/ov5670.c: In function ‘ov5670_set_pad_format’:
drivers/media/i2c/ov5670.c:2233:48: error: macro "v4l2_find_nearest_size" requer 6 argumentos, mas apenas 5 foram fornecidos
fmt->format.width, fmt->format.height);
^
drivers/media/i2c/ov5670.c:2232:9: error: ‘v4l2_find_nearest_size’ undeclared (first use in this function); did you mean ‘__v4l2_find_nearest_size’?
mode = v4l2_find_nearest_size(supported_modes, width, height,
^~~~~~~~~~~~~~~~~~~~~~
__v4l2_find_nearest_size
drivers/media/i2c/ov13858.c: In function ‘ov13858_set_pad_format’:
drivers/media/i2c/ov13858.c:1379:48: error: macro "v4l2_find_nearest_size" requer 6 argumentos, mas apenas 5 foram fornecidos
fmt->format.width, fmt->format.height);
^
drivers/media/i2c/ov13858.c:1378:9: error: ‘v4l2_find_nearest_size’ undeclared (first use in this function); did you mean ‘__v4l2_find_nearest_size’?
mode = v4l2_find_nearest_size(supported_modes, width, height,
^~~~~~~~~~~~~~~~~~~~~~
__v4l2_find_nearest_size
drivers/media/i2c/ov13858.c:1378:9: note: each undeclared identifier is reported only once for each function it appears in
Basically, v4l2_find_nearest_size() callers pass 5 arguments,
while its definition require 6 args.
Unfortunately, my build process was also broken, as it was reporting me that
the compilation went fine:
$ make ARCH=i386 CF=-D__CHECK_ENDIAN__ CONFIG_DEBUG_SECTION_MISMATCH=y C=1 W=1 CHECK='compile_checks' M=drivers/staging/media
$ make ARCH=i386 CF=-D__CHECK_ENDIAN__ CONFIG_DEBUG_SECTION_MISMATCH=y C=1 W=1 CHECK='compile_checks' M=drivers/media
*** ERRORS ***
*** WARNINGS ***
compilation succeeded
That was due to a change here to use of linux-log-diff script that
provides a diffstat between the errors output. Somehow, the logic
was missing some fatal errors.
Fixes:
95ce9c28601a ("media: v4l: common: Add a function to obtain best size from a list")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Arushi Singhal [Sun, 4 Mar 2018 15:48:26 +0000 (10:48 -0500)]
media: staging: media: Replace "cant" with "can't"
Replace "cant" with "can't".
"cant" is not same as "Can not" or "Can't".
Signed-off-by: Arushi Singhal <arushisinghal19971997@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>
Hans Verkuil [Sun, 25 Feb 2018 11:55:32 +0000 (06:55 -0500)]
media: atomisp_fops.c: disable atomisp_compat_ioctl32
The atomisp_compat_ioctl32() code has problems. This patch disables the
compat_ioctl32 support until those issues have been fixed.
Contact Sakari or me for more details.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v4.12 and up
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Corentin Labbe [Thu, 22 Feb 2018 08:19:25 +0000 (03:19 -0500)]
media: staging: media: atomisp: Remove inclusion of non-existing directories
This patch fix the following build warnings:
CC [M] drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.o
cc1: warning: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bayer_ls/bayer_ls_1.0/: No such file or directory [-Wmissing-include-dirs]
cc1: warning: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/io_ls/plane_io_ls/: No such file or directory [-Wmissing-include-dirs]
cc1: warning: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/io_ls/yuv420_io_ls/: No such file or directory [-Wmissing-include-dirs]
cc1: warning: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ipu2_io_ls/plane_io_ls/: No such file or directory [-Wmissing-include-dirs]
cc1: warning: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ipu2_io_ls/yuv420_io_ls/: No such file or directory [-Wmissing-include-dirs]
cc1: warning: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a_stat_ls/: No such file or directory [-Wmissing-include-dirs]
cc1: warning: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/scale/: No such file or directory [-Wmissing-include-dirs]
cc1: warning: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/scale/scale_1.0/: No such file or directory [-Wmissing-include-dirs]
cc1: warning: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/yuv_ls: No such file or directory [-Wmissing-include-dirs]
cc1: warning: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/yuv_ls/yuv_ls_1.0/: No such file or directory [-Wmissing-include-dirs]
by removing the inclusion of such directories
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jeremy Sowden [Tue, 19 Dec 2017 16:35:13 +0000 (11:35 -0500)]
media: atomisp: convert default struct values to use compound-literals with designated initializers
The CSS API uses a lot of nested anonymous structs defined in object
macros to assign default values to its data-structures. These have been
changed to use compound-literals and designated initializers to make
them more comprehensible and less fragile.
The compound-literals can also be used in assignment, which means we can
get rid of some temporary variables whose only purpose is to be
initialized by one of these anonymous structs and then serve as the
rvalue in an assignment expression.
A lot of the members of the default struct values used by the CSS API
were explicitly initialized to zero values. Designated initializers
have allowed these members, and in some case whole default struct
values, to be removed.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Corentin Labbe [Mon, 29 Jan 2018 13:11:51 +0000 (08:11 -0500)]
media: staging: media: atomisp2: remove unused headers
All thoses headers are not used by any source files.
Lets just remove them.
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Corentin Labbe [Mon, 29 Jan 2018 12:16:07 +0000 (07:16 -0500)]
media: staging: media: remove remains of VIDEO_ATOMISP_OV8858
OV8858 files are left unusable since commit
3a81c7660f80 ("media: staging: atomisp: Remove IMX sensor support")
They are uncompilable since they depends on dw9718.c and vcm.c which was removed.
Remove the OV8858 kconfig and files.
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Colin Ian King [Fri, 26 Jan 2018 14:44:24 +0000 (09:44 -0500)]
media: staging: atomisp: remove redundant assignments to various variables
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>
Arnd Bergmann [Fri, 2 Feb 2018 15:19:41 +0000 (10:19 -0500)]
media: staging: media: atomisp: remove pointless string copy
gcc-8 points out that a string is copied to itself here:
In file included from drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/platform_support.h:25,
from drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_access/memory_access.h:48,
from drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c:16:
In function 'strncpy',
inlined from 'ia_css_debug_pipe_graph_dump_stage' at drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/string_support.h:158:2:
include/linux/string.h:253:9: error: '__builtin_strncpy' source argument is the same as destination [-Werror=restrict]
return __builtin_strncpy(p, q, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This removes the bogus code, leaving the behavior otherwise
unchanged.
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>
Alona Solntseva [Mon, 5 Feb 2018 13:14:52 +0000 (08:14 -0500)]
media: drivers: staging: media: atomisp: pci: atomisp2: css2400: fix misspellings
Misspelled words are fixed in several places.
Signed-off-by: Alona Solntseva <al.solnts@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Mon, 12 Mar 2018 13:43:05 +0000 (09:43 -0400)]
media: MAINTAINERS: Add entry for Aptina MT9T112
Add entry for Aptina/Micron MT9T112 camera sensor. The driver is
maintained by me for "Odd Fixes" only due to lack of suitable hardware
for testing.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Mon, 12 Mar 2018 13:43:04 +0000 (09:43 -0400)]
media: arch: sh: ecovec: Use new renesas-ceu camera driver
SH4 7724 Ecovec platform uses sh_mobile_ceu camera driver, which is now
being replaced by a proper V4L2 camera driver named 'renesas-ceu'.
Get rid of soc_camera defined components used to register sensor drivers
and of platform specific enable/disable routines.
Register GPIOs for sensor drivers and declare memory reserved with
memblock APIs as dma capable to be used for CEU buffers.
While at there re-order include directives to respect alphabetical
ordering.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Mon, 12 Mar 2018 13:43:03 +0000 (09:43 -0400)]
media: i2c: mt9t112: Remove soc_camera dependencies
Remove soc_camera framework dependencies from mt9t112 sensor driver.
- Handle clk, gpios and power routines
- Register async subdev
- Remove deprecated g/s_mbus_config operations
- Remove driver flags
- Change driver interface and add kernel doc
- Adjust build system
- Fix code style issues reported by checkpatch in strict mode
This commit does not remove the original soc_camera based driver as long
as other platforms depends on soc_camera framework.
As I don't have access to a working camera module, this change has only
been compile tested.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Mon, 12 Mar 2018 13:43:02 +0000 (09:43 -0400)]
media: i2c: Copy mt9t112 soc_camera sensor driver
Copy the soc_camera based driver in v4l2 sensor driver directory.
This commit just copies the original file without modifying it.
No modification to KConfig and Makefile as soc_camera framework
dependencies need to be removed first in next commit.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Tue, 13 Mar 2018 23:27:57 +0000 (19:27 -0400)]
media: af9015: correct some coding style issues
Correct coding style issues reported mostly by checkpatch.pl.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Thu, 13 Jul 2017 06:42:52 +0000 (02:42 -0400)]
media: af9015: convert to regmap api
Use regmap for chip register access.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Mon, 10 Jul 2017 19:35:59 +0000 (15:35 -0400)]
media: dvb-usb-v2: add probe/disconnect callbacks
Add probe and disconnect callbacks that behaves similarly than ones
used commonly on Linux driver model. We need those to get early / late
access to driver in order to use normal probe time stuff, like regmap,
extra bus adapters and so.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Thu, 13 Jul 2017 05:56:41 +0000 (01:56 -0400)]
media: af9015: enhance streaming config
Replace static stream settings by one which enables and disables
stream interface when needed (TS streaming control).
1) Configure both TS IF and USB endpoints according to current use case
2) Disable streaming USB endpoints when streaming is stopped and
enable when streaming is started. Reduces sleep power consumption
slightly.
3) Reduce USB buffersize slightly, from 130848 to 98136 bytes
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Mon, 26 Jun 2017 11:15:27 +0000 (07:15 -0400)]
media: af9015: refactor copy firmware to slave demod
Small improvements.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Mon, 26 Jun 2017 10:02:59 +0000 (06:02 -0400)]
media: af9015: refactor firmware download
Small revise, no functional changes.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Mon, 26 Jun 2017 09:02:50 +0000 (05:02 -0400)]
media: af9015: use af9013 demod pid filters
PID filters are moved to af9013 demod driver as those are property of
demod. As pid filters are now implemented correctly by demod driver,
we could enable pid filter support for possible slave demod too on
dual tuner configuration.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Mon, 26 Jun 2017 08:57:09 +0000 (04:57 -0400)]
media: af9013: add pid filter support
af9013 demod has pid filter. Add support for it.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Fri, 23 Jun 2017 09:31:49 +0000 (05:31 -0400)]
media: af9013: remove all legacy media attach releated stuff
No one is binding that driver through media attach so remove it and
all related dead code.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Fri, 23 Jun 2017 09:17:00 +0000 (05:17 -0400)]
media: af9015: attach demod using i2c binding
af9013 demod driver has i2c binding. Use it.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Thu, 22 Jun 2017 16:18:21 +0000 (12:18 -0400)]
media: af9013: add i2c mux adapter for tuner bus
Add muxed i2c adapter for demod tuner i2c bus gate control.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Thu, 22 Jun 2017 08:24:00 +0000 (04:24 -0400)]
media: af9013: convert inittabs suitable for regmap_update_bits
Convert inttabs to format (reg, mask, val) which are suitable
parameters to pass directly for regmap_update_bits.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Wed, 21 Jun 2017 20:55:54 +0000 (16:55 -0400)]
media: af9015: fix logging
Pass correct device to dev_* logging functions, which allows us to
remove redundant KBUILD_MODNAME and __func__ parameters from log format.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Mon, 19 Jun 2017 06:31:56 +0000 (02:31 -0400)]
media: af9013: wrap dvbv3 statistics via dvbv5
Driver has calculated dvbv5 statistics, so use those as a base for
legacy dvbv3 statistics. Wrap and convert needed values to dvbv3,
remove old dvbv3 statistic implementations.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Sun, 18 Jun 2017 17:26:35 +0000 (13:26 -0400)]
media: af9013: dvbv5 ber and per
Implement dvbv5 ber and per.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Sun, 18 Jun 2017 10:23:15 +0000 (06:23 -0400)]
media: af9013: dvbv5 cnr
Implement dvbv5 cnr.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antti Palosaari [Sun, 18 Jun 2017 05:17:49 +0000 (01:17 -0400)]
media: af9013: dvbv5 signal strength
Implement dvbv5 signal strength estimate. We know tuner dependent
-80dBm and -50dBm agc values, construct line equation and use it to
map agc value to signal strength estimate.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>