aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-06-05[media] dib0090: Remove a dead codeMauro Carvalho Chehab1-3/+1
As reported by smatch: drivers/media/dvb-frontends/dib0090.c:1710 dib0090_dc_offset_calibration() warn: missing break? reassigning '*tune_state' There's no need to change tune_state there, as the fall though code will change it again to another state. So, simplify it by removing the dead code. While here, fix a typo: Sart => Start Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-05[media] sh_vou: avoid going past arraysMauro Carvalho Chehab1-7/+7
Smatch reports two issues: drivers/media/platform/sh_vou.c:670 vou_adjust_output() error: buffer overflow 'vou_scale_v_num' 3 <= 4 drivers/media/platform/sh_vou.c:670 vou_adjust_output() error: buffer overflow 'vou_scale_v_den' 3 <= 4 It seems that there's actually a bug here: the same var (idx) is used as an index for vertical and horizontal scaling arrays. However, there are 4 elements on the h arrays, and only 3 at the v ones. On the first loop, it may select index 4 for the horizontal array. In this case, if the second loop fails to select an index, the code would keep using 4 for the vertical array, with is past of the array sizes. The intent here seems to use index 0, if the scale is not found. So, use a separate var for the vertical index. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-05[media] em28xx: remove dead codeMauro Carvalho Chehab1-1/+0
As reported by smatch: drivers/media/usb/em28xx/em28xx-video.c:842 get_ressource() info: ignoring unreachable code. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-05[media] drxk: better handle errorsMauro Carvalho Chehab1-3/+4
As reported by smatch: drivers/media/dvb-frontends/drxk_hard.c:3277 dvbt_sc_command() warn: missing break? reassigning 'status' This is basically because the error handling logic there was crappy. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-05[media] vivid: don't use more than 1024 bytes of stackMauro Carvalho Chehab1-16/+17
Remove the following compilation warnings: drivers/media/platform/vivid/vivid-tpg.c: In function 'tpg_gen_text': drivers/media/platform/vivid/vivid-tpg.c:1562:1: warning: the frame size of 1308 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ This seems to be due to some bad optimization done by gcc. Moving the for() loop to happen inside the macro solves the issue. While here, fix CodingStyle at the switch(). Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Hans Verkuil <[email protected]>
2015-06-05[media] media: s5p-mfc: fix sparse warningsMarek Szyprowski2-4/+4
Commits a0f10c131cc49d7d84394beb7903e1f246331224 and 6c9fe765360efa97c63b89af685b620baf5e0012 ("media: s5p-mfc: fix broken pointer cast on 64bit arch") fixed issue with lossy cast on 64-bit architectures. However it also removed __iomem attribute from that cast. This leads to sparse warnings. This patch fixes those warnings by adding __iomem cast in case of v6+ code version and replacing readl/writel by simple u32 load/store operations in case of v5 code (which is called on system memory allocated by dma_alloc_coherent() instead of io registers). Reported-by: Hans Verkuil <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-05[media] media: davinci: vpbe: use v4l2_get_timestamp()Lad, Prabhakar1-7/+2
this patch makes use of helper function v4l2_get_timestamp() to set the timestamp of vb2 buffer. Signed-off-by: Lad, Prabhakar <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-05[media] media: davinci_vpfe: use monotonic timestampLad, Prabhakar1-1/+2
V4L2 drivers should use MONOTONIC timestamps instead of gettimeofday, which is affected by daylight savings time. Signed-off-by: Lad, Prabhakar <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-05[media] media: davinci_vpfe: set minimum required buffers to threeLad, Prabhakar2-14/+3
this patch sets nbuffers to three or more and drops the unset member video_limit which just a copy paste from earlier driver. Signed-off-by: Lad, Prabhakar <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-05[media] media: davinci_vpfe: clear the output_specsLad, Prabhakar1-0/+1
clear of the output_specs before passing it to the configure_resizer_out_params(), so that no garbage values are set. This fixes following build warning: drivers/staging/media/davinci_vpfe/dm365_resizer.c: In function 'resizer_set_stream': drivers/staging/media/davinci_vpfe/dm365_resizer.c:190:46: warning: 'output_specs.vst_c' may be used uninitialized in this function [-Wmaybe-uninitialized] param->ext_mem_param[index].rsz_sdr_ptr_s_c = output->vst_c; ^ drivers/staging/media/davinci_vpfe/dm365_resizer.c:316:30: note: 'output_specs.vst_c' was declared here struct vpfe_rsz_output_spec output_specs; ^ Signed-off-by: Lad, Prabhakar <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-05[media] si2157: implement signal strength statsAntti Palosaari2-1/+40
Implement DVBv5 signal strength stats. Returns dBm. Signed-off-by: Antti Palosaari <[email protected]> Tested-by: Adam Baker <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-05[media] si2168: Implement own I2C adapter lockingAntti Palosaari2-57/+79
We need own I2C locking because of tuner I2C adapter/repeater. Firmware command is executed using I2C send + reply message. Default I2C adapter locking protects only single I2C operation, not whole send + reply sequence as needed. Due to that, it was possible tuner I2C message interrupts firmware command sequence. Reported-by: Adam Baker <[email protected]> Signed-off-by: Antti Palosaari <[email protected]> Reviewed-by: Adam Baker <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-01[media] DocBook: fix FE_SET_PROPERTY ioctl argumentsMauro Carvalho Chehab1-1/+1
FE_SET_PROPERTY/FE_GET_PROPERTY actually expects a struct dtv_properties argument. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-01[media] DocBook: some fixes for DVB FE open()Mauro Carvalho Chehab1-12/+16
The changeset dc9ef7d11207 change the open() ioctl documentation to match the V4L2 open(). However, some cut-and-pasted stuff doesn't match what actually happens at the DVB core. So, fix the documentation entry to be more accurate with the DVB frontend open() specifics. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-01[media] DocBook media: rewrite frontend open/closeHans Verkuil1-122/+159
To fix the last xmllint errors the open and close function reference description was rewritten based on the v4l2 open and close functions. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-01[media] DocBook media: xmllint fixesHans Verkuil13-59/+56
Fixes a large number of xmllint errors. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-06-01[media] DocBook media: fix typosHans Verkuil4-8/+8
satellital -> satellite antena -> antenna Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] uvcvideo: Remove unneeded device disconnected flagLaurent Pinchart3-10/+0
The UVC_DEV_DISCONNECTED flag is set when the USB device is disconnected, and checked in the open() handler to refuse opening a device that has been disconnected. This is inherently racy, but the race condition is taken care of in the V4L2 core, which also fails open() calls when the V4L2 device node has been unregistered. As the uvcvideo USB disconnect handler unregisters all its video device nodes, the UVC_DEV_DISCONNECTED flag doesn't serve any purpose anymore and can be removed. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] uvcvideo: Fix incorrect bandwidth with Chicony device 04f2:b50bLaurent Pinchart1-0/+8
The "TOSHIBA Web Camera - 5M" Chicony device (04f2:b50b) seems to compute the bandwidth on 16 bits and erroneously sign-extend it to 32 bits, resulting in a huge bandwidth value. Detect and fix that condition by setting the 16 MSBs to 0 when they're all equal to 1. Reported-by: Hans de Goede <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] uvcvideo: Implement DMABUF exporter roleLaurent Pinchart3-0/+27
Now that videobuf2-vmalloc supports exporting buffers, add support for the DMABUF exporter role by plugging in the videobuf2 ioctl helper. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] af9035: add USB ID 07ca:0337 AVerMedia HD Volar (A867)Antti Palosaari1-0/+2
It is AF9035 + MxL5007T. Driver reports: prechip_version=00 chip_version=03 chip_type=3802 Not sure if that USB ID is reserved only for HP brand or if it is common, but the stick I have is branded as HP part no. 580715-001 rmn A867. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] m88ds3103: add I2C client bindingAntti Palosaari3-88/+245
Implement I2C client device binding. Wrap media attach to driver I2C probe. Add wrapper from m88ds3103_attach() to m88ds3103_probe() via driver core in order to provide proper I2C client for legacy media attach binding. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] m88ds3103: use jiffies when polling DiSEqC TX readyAntti Palosaari1-19/+34
Use jiffies to set timeout for DiSEqC TX ready polling. Using jiffies is more elegant solution than looping N times with sleep. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] m88ds3103: implement DVBv5 BERAntti Palosaari2-75/+94
Implement DVBv5 BER statistics. Wrap legacy DVBv3 BER to DVBv5 BER. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] m88ds3103: implement DVBv5 CNR statisticsAntti Palosaari1-72/+82
Implement DVBv5 CNR statistics. Wrap legacy DVBv3 SNR to DVBv5 CNR. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] m88ds3103: do not return error from get_frontend() when not readyAntti Palosaari1-1/+1
Do not return error from get_frontend() when status is queried, but the frontend didn't lock yet. The proper behavior is to only update the cache after having a lock. [[email protected]: fix the patch description] Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] gspca: sn9c2028: Add gain and autogain controls Genius Videocam Live v2Vasily Khoruzhick2-3/+137
Autogain algorithm is very simple, if average luminance is low - increase gain, if it's high - decrease gain. Gain granularity is low enough for this algo to stabilize quickly. Signed-off-by: Vasily Khoruzhick <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] gspca: sn9c2028: Add support for Genius Videocam Live v2Vasily Khoruzhick1-1/+118
This cam seems to return different values on long commands, so make status check in sn9c2028_long_command() more tolerant. Anyway, read value isn't used anywhere later. Signed-off-by: Vasily Khoruzhick <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] wl128x: Allow compile test of GPIO consumers if !GPIOLIBGeert Uytterhoeven1-2/+2
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] return BUF_STATE_ERROR if streaming stopped during acquisitionFlorian Echtler1-0/+5
When stop_streaming is called while a frame is currently being retrieved, the buffer being filled will still be returned with BUF_STATE_DONE. By resetting the sequence number and checking before returning the buffer, it can now correctly be returned with BUF_STATE_ERROR. Signed-off-by: Martin Kaltenbrunner <[email protected]> Signed-off-by: Florian Echtler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] add extra debug output, remove noisy warningFlorian Echtler1-1/+8
Add dev_dbg statements for easier future debugging; also change the warning about packet ID mismatches to debug output to avoid flooding the logs. This warning is only important in a very specific/rare use case when trying to correlate input events with video data. Signed-off-by: Martin Kaltenbrunner <[email protected]> Signed-off-by: Florian Echtler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] add frame size/frame rate query functionsFlorian Echtler1-0/+30
Add missing functions to query the single fixed frame size (960x540) and supported frame rates. Technically, the SUR40 supports any arbitrary frame rate up to 60 FPS, as it is polled and not interrupt-driven. For now, we just report 30 and 60 FPS, which is sufficient to make most V4L2 tools work. Signed-off-by: Martin Kaltenbrunner <[email protected]> Signed-off-by: Florian Echtler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] reduce poll interval to allow full 60 FPS framerateFlorian Echtler1-1/+1
The SUR40 hardware can deliver images at up to 60 FPS; at full USB2 bandwidth, one raw frame will take about 11 ms to transmit. If the poll interval is above 5 ms, fully handling one frame will take longer than 16 ms and the overall frame rate will drop below 60 FPS. To get the full frame rate without blocking all the time and still allowing for a bit of timing jitter, we reduce the poll interval to 4 ms. Signed-off-by: Martin Kaltenbrunner <[email protected]> Signed-off-by: Florian Echtler <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] v4l2: correct two SDR format namesAntti Palosaari1-2/+2
U8 and U16LE format human readable names were translated with string containing emulated word. These strings were taken from msi2500 driver, where those formats were emulated (after module parameter is set). But on API correct names should be used, without any special case notes. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] vivid: SDR cap add 'CU08' Complex U8 formatAntti Palosaari4-13/+94
Add complex unsigned 8-bit sample format for SDR capture. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] vivid: use new V4L2_MAP_*_DEFAULT definesHans Verkuil1-42/+9
Use these defines instead of hardcoding this in any driver that needs it. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] videodev2.h: add macros to map colorspace defaultsHans Verkuil1-0/+30
The mapping of COLORSPACE_DEFAULT, YCBCR_ENC_DEFAULT or QUANTIZATION_DEFAULT to proper non-default values is fairly complex, and it is something that needs to be done both in the kernel and in userspace. So add macros that can do this conversion, making this available to both kernel and userspace. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] DocBook/media: document COLORSPACE_RAWHans Verkuil1-0/+7
Document this new colorspace define. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] videodev2.h: add COLORSPACE_RAWHans Verkuil1-0/+3
V4L2_COLORSPACE_RAW is added for raw image formats where the picture is minimally processed and is in the internal colorspace of the sensor. This is typically used in digital cameras where the image processing is done later. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] DocBook/media: document COLORSPACE_DEFAULTHans Verkuil1-0/+5
Document this new colorspace define. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] videodev2.h: add COLORSPACE_DEFAULTHans Verkuil1-0/+6
V4L2_COLORSPACE_DEFAULT is added so we have a specific define for the default case where applications do not set it but leave it to 0. In that case the driver will set the colorspace based on what it captures. This is already used, but we never had a define for the value 0. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] ivtv: fix incorrect audio mode report in log_statusHans Verkuil1-1/+2
The log_status ioctl should report if the audio input has mode Bilingual. However, the check against the itv->dualwatch_stereo_mode is completely wrong and is a left-over from the distant past. Not only is the bitmask obviously wrong, the test itself is broken too since itv->dualwatch_stereo_mode is no longer a bitmask at all. Fix this code properly. Signed-off-by: Hans Verkuil <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] DocBook/media: add missing entry for V4L2_PIX_FMT_Y16_BEHans Verkuil2-0/+82
This format was added but not documented. Do this now. Signed-off-by: Hans Verkuil <[email protected]> Acked-by: Ricardo Ribalda Delgado <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] media/vivid: Add support for Y16_BE formatRicardo Ribalda2-1/+16
Support for V4L2_PIX_FMT_Y16_BE, a 16 bit big endian greyscale format. Signed-off-by: Ricardo Ribalda Delgado <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] media/v4l2-core: Add support for V4L2_PIX_FMT_Y16_BERicardo Ribalda2-1/+3
16 bit greyscale format, structured in Big Endian. Such a format can be converted into a PMN image just by adding a header. Signed-off-by: Ricardo Ribalda Delgado <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] media/videobuf2-dma-vmalloc: Save output from dma_map_sgRicardo Ribalda1-3/+3
dma_map_sg returns the number of areas mapped by the hardware, which could be different than the areas given as an input. The output must be saved to nent. Signed-off-by: Ricardo Ribalda Delgado <[email protected]> Reviewed-by: Marek Szyprowski <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] media/videobuf2-dma-contig: Save output from dma_map_sgRicardo Ribalda1-3/+3
dma_map_sg returns the number of areas mapped by the hardware, which could be different than the areas given as an input. The output must be saved to nent. Signed-off-by: Ricardo Ribalda Delgado <[email protected]> Reviewed-by: Marek Szyprowski <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] media/videobuf2-dma-sg: Fix handling of sg_table structureRicardo Ribalda1-9/+13
When sg_alloc_table_from_pages() does not fail it returns a sg_table structure with nents and nents_orig initialized to the same value. dma_map_sg returns the number of areas mapped by the hardware, which could be different than the areas given as an input. The output must be saved to nent. The output of dma_map, should be used to transverse the scatter list. dma_unmap_sg needs the value passed to dma_map_sg (nents_orig). sg_free_tables uses also orig_nent. This patch fix the file to follow this paradigm. Signed-off-by: Ricardo Ribalda Delgado <[email protected]> Reviewed-by: Marek Szyprowski <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] adv7604/cobalt: missing GPIOLIB dependencyHans Verkuil2-2/+2
The adv7604 driver depends on GPIOLIB, and therefore cobalt depends on it as well. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] saa7164: fix sparse warningHans Verkuil1-1/+1
drivers/media/pci/saa7164/saa7164-i2c.c:45:33: warning: Using plain integer as NULL pointer Signed-off-by: Hans Verkuil <[email protected]> Reviewed-by: Steven Toth <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>