Commit Graph

574464 Commits

Author SHA1 Message Date
Mauro Carvalho Chehab 55a1a9f189 [media] pt3: fix device identification
As warned by smatch:
	drivers/media/pci/pt3/pt3.c:398 pt3_attach_fe() error: strncmp() '"tc90522sat"' too small (11 vs 20)

Clearly, the logic is doing the wrong thing, as it is not comparing the strings
on the right way.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-01 12:01:45 -03:00
Mauro Carvalho Chehab 5d0f2df471 [media] technisat-usb2: don't do DMA on the stack
As warned by smatch:
	drivers/media/usb/dvb-usb/technisat-usb2.c:263 technisat_usb2_set_led() error: doing dma on the stack (led)
	drivers/media/usb/dvb-usb/technisat-usb2.c:280 technisat_usb2_set_led_timer() error: doing dma on the stack (&b)
	drivers/media/usb/dvb-usb/technisat-usb2.c:341 technisat_usb2_identify_state() error: doing dma on the stack (version)
	drivers/media/usb/dvb-usb/technisat-usb2.c:609 technisat_usb2_get_ir() error: doing dma on the stack (buf)
	drivers/media/usb/dvb-usb/technisat-usb2.c:619 technisat_usb2_get_ir() error: doing dma on the stack (buf)

Create a buffer at the device state and use it for all the DMA
transfers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-01 12:00:34 -03:00
Mauro Carvalho Chehab 57bcbde9a1 [media] dib0090: Do the right check for state->rf_ramp
Smatch with -pkernel --no-data keeps complaining about rf_ramp:
	drivers/media/dvb-frontends/dib0090.c:1119 dib0090_pwm_gain_reset() error: we previously assumed 'state->rf_ramp' could be null (see line 1086)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-01 11:49:52 -03:00
Mauro Carvalho Chehab b6554ea551 [media] drxj: don't do math if not needed
While there's no risk of divison by zero, the logic there is akward, as it
does the calculus for the numerator and denominator before checking
if this will be used.

Change the order to check first if the denominator is zero, and only
calculating the numerator/denominator if not.

This should also avoid those smatch errors:
	drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
	drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
	drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
	drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
	drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-01 10:55:55 -03:00
Mauro Carvalho Chehab f6f7b58ef0 [media] airspy: fix bit set/clean mess on s->flags
As warned by smatch:
	drivers/media/usb/airspy/airspy.c:541 airspy_start_streaming() warn: test_bit() takes a bit number
	drivers/media/usb/airspy/airspy.c:569 airspy_start_streaming() warn: test_bit() takes a bit number
	drivers/media/usb/airspy/airspy.c:605 airspy_stop_streaming() warn: test_bit() takes a bit number

set_bit/clear_bit argument is the bit number, and not 1 << bit.

Thankfully, one of the bits was not used (URB_BUF), with would
otherwise cause a driver misfunctioning.

Clean this mess by always using set_bit/clear_bit/test_bit and
removing the unused bit.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-01 10:48:17 -03:00
Hans de Goede b44d366934 [media] gspca: Remove unused ovfx2_vga_mode/ovfx2_cif_mode arrays
Remove the unused ovfx2_vga_mode/ovfx2_cif_mode arrays from the ov519
driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-01 10:44:28 -03:00
Wesley Post f7c7ac480d [media] gspca: Fix ov519 i2c r/w not working when connected to a xhci host
Fix the ov519 driver not working (unable to talk to the sensor) when
plugged into a xhci host. The root cause here is that uhci/ohci/ehci
hosts typically will send any pending async requests every milli-second
and then go to sleep for the rest if the milli-second, where as xhci hosts
send them immediately, causing things to go too fast for the ov519 bridge.

This commit adds a few delays fixing this.

Signed-off-by: Wesley Post <pa4wdh@xs4all.nl>
[hdegoede@redhat.com: Also add delays to w996Xcf.c, as that needs them too]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-01 10:40:14 -03:00
Hans de Goede 5c915c6876 [media] bttv: Width must be a multiple of 16 when capturing planar formats
On my bttv card "Hauppauge WinTV [card=10]" capturing in YV12 fmt at max
size results in a solid green rectangle being captured (all colors 0 in
YUV).

This turns out to be caused by max-width (924) not being a multiple of 16.

We've likely never hit this problem before since normally xawtv / tvtime,
etc. will prefer packed pixel formats. But when using a video card which
is using xf86-video-modesetting + glamor, only planar XVideo fmts are
available, and xawtv will chose a matching capture format to avoid needing
to do conversion, triggering the solid green window problem.

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-03-01 10:36:24 -03:00
Shuah Khan b19581a94f [media] media: au0828 video change to use v4l_enable_media_source()
Change au0828 to check if tuner is free or not before changing tuner
configuration.

vidioc_g_tuner(), and au0828_v4l2_close() now call v4l-core interface
v4l_enable_media_source() before changing tuner configuration.

Remove au0828_enable_analog_tuner() as it is no longer needed because
v4l2-core implements common interfaces to check for media source
availability.

In addition, queue_setup() no longer needs the tuner availability check
since v4l2-core does it.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 09:35:18 -03:00
Shuah Khan 68ff5767dd [media] media: dvb-frontend invoke enable/disable_source handlers
Change dvb frontend to check if tuner is free when device opened in RW
mode.

Call to enable_source handler either returns with an active pipeline to
tuner or error if tuner is busy.

Tuner is released when frontend is released calling the disable_source
handler.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 09:34:06 -03:00
Shuah Khan c94903f1f7 [media] media: au0828 add enable, disable source handlers
Add enable_source and disable_source handlers. The enable source handler
is called from v4l2-core, dvb-core, and ALSA drivers to check if the
shared media source is free.

The disable source handler is called to release the shared media
source.

[mchehab@osg.samsung.com: fix merge conflicts]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 09:29:20 -03:00
Shuah Khan f90c5d79e5 [media] media: au0828-core register entity_notify hook
Register entity_notify async hook to create links between existing
bridge driver entities and a newly added non-bridge driver entities. For
example, this handler creates link between V4L decoder entity and ALSA
mixer entity.

[mchehab@osg.samsung.com: fix merge conflicts and make
 au0828_media_graph_notify static to shut up a warning]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 09:15:34 -03:00
Shuah Khan b176965176 [media] media: au0828 disable tuner to demod link
Change au0828_create_media_graph() to find and disable
tuner and demod link. This helps avoid an additional
disable step when tuner is requested by video or audio.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 09:11:46 -03:00
Shuah Khan 2926d7f445 [media] media: au0828 create tuner to decoder link in disabled state
Create tuner to demod pad link in disabled state to avoid disable step
when tuner resource is requested by dvb.

[mchehab@osg.samsung.com: fix a merge conflict]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 09:09:52 -03:00
Shuah Khan 7b12adf6f5 [media] media: au0828 handle media_init and media_register window
Media device initialization and registration steps are split. There is a
window between media device init and media device register during usb
probe.

au0828 bridge driver and snd-usb-audio could try to initialize the media
device, if they simply checked, whether the device has been registered.
They also need to check whether the device has been initialized.

Change the au0828-core to check if media device is already initialized
during initialization step and check if media device is already
registered during the registration step.

[mchehab@osg.samsung.com: fix a merge conflict]
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 09:06:06 -03:00
Shuah Khan 182dde7c5d [media] media: au0828 change to use Managed Media Controller API
Change au0828 to use Managed Media Controller API to share media device
and coordinate creating/deleting the shared media device with the
snd-usb-audio driver. The shared media device is created as device
resource of the parent usb device of the two drivers.

Populate media device model with USB Device product name instead of
au0828 device board name. This change is necessary because, if the media
device is registered by the snd-usb-audio driver first, and it doesn't
know the au0828 board name.

[mchehab@osg.samsung.com: Fix merge conflicts]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:55:15 -03:00
Shuah Khan 77fa4e0729 [media] media: Change v4l-core to check if source is free
Change s_input, s_fmt, s_tuner, s_frequency, querystd, s_hw_freq_seek,
and vb2_core_streamon interfaces that alter the tuner configuration to
check if it is free, by calling v4l_enable_media_source().

If source isn't free, return -EBUSY.

v4l_disable_media_source() is called from v4l2_fh_exit() to release
tuner (source).

vb2_core_streamon() uses v4l_vb2q_enable_media_source().

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:46:55 -03:00
Shuah Khan 50512333f2 [media] media: au0828 Use au8522_media_pads enum for pad defines
Change au0828-core to use au8522_media_pads enum defines
instead of hard-coding the pad values.

[mchehab@osg.samsung.com: patch rebased, as the code was
 moved to au0828-video.c. Also added AU8522_PAD_INPUT to the list
 of pad number replacements]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:45:43 -03:00
Shuah Khan 82410a98bd [media] media: au8522 change to create MC pad for ALSA Audio Out
Add new pad for ALSA Audio Out to au8522_media_pads.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:34:10 -03:00
Shuah Khan 4c4ada7306 [media] media: Move au8522_media_pads enum to au8522.h from au8522_priv.h
Move the au8522_media_pads enum to au8522.h from au8522_priv.h to export
them. This will allow au0828-core to use these defines instead of
hard-coding them them.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:33:30 -03:00
Shuah Khan d0a164f593 [media] media: v4l-core add enable/disable source common interfaces
Add a new interfaces to be used by v4l-core to invoke enable
source and disable_source handlers in the media_device. The
enable_source helper function invokes the enable_source handler
to find media source entity connected to the entity and check
is it is available or busy. If source is available, link is
activated and pipeline is started. The disable_source helper
function invokes the disable_source handler to deactivate and
stop the pipeline.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:33:29 -03:00
Shuah Khan fb49f20438 [media] media: Media Controller non-locking __media_entity_pipeline_start/stop()
Add non-locking __media_entity_pipeline_start/stop()
interfaces to be called from code paths that hold the
graph_mutex.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:33:28 -03:00
Shuah Khan efc702784f [media] media: Media Controller export non locking __media_entity_setup_link()
Export __media_entity_setup_link() to be used from code paths
that hold the graph_mutex.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:33:27 -03:00
Shuah Khan cd87ce873f [media] media: Media Controller enable/disable source handler API
Add new fields to struct media_device to add enable_source, and
disable_source handlers, and source_priv to stash driver private
data that is used to run these handlers. The enable_source handler
finds source entity for the passed in entity and checks if it is
available. When link is found, it activates it. Disable source
handler deactivates the link.

Bridge driver is expected to implement and set these handlers.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:33:26 -03:00
Shuah Khan afcbdb5589 [media] media: Media Controller register/unregister entity_notify API
Add new interfaces to register and unregister entity_notify
hook to media device. These interfaces allow drivers to add
hooks to take appropriate actions when new entities get added
to a shared media device. For example, au0828 bridge driver
registers an entity_notify hook to create links as needed
between media graph nodes.

[mchehab@osg.samsung.com: simple comments should be /* and not /**]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:33:25 -03:00
Shuah Khan 7a2eba12ff [media] media: Add ALSA Media Controller function entities
Add ALSA Media Controller capture, playback, and mixer
function entity defines.

[mchehab@osg.samsung.com: fix a trivial merge conflict and start
 MEDIA_ENT_AUDIO_F from 3000]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:32:54 -03:00
Shuah Khan 1161350995 [media] Docbook: media-types.xml: Add Audio Function Entities
Add Audio Function Entities

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:14:44 -03:00
Shuah Khan 5af557a6d2 [media] uapi/media.h: Declare interface types for ALSA
Declare the interface types to be used on alsa for
the new G_TOPOLOGY ioctl.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:14:44 -03:00
Shuah Khan ecd353a3b2 [media] Docbook: media-types.xml: Add ALSA Media Controller Intf types
Add ALSA Media Controller Intf types

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:14:43 -03:00
Hans Verkuil 85e510a1f9 [media] tc358743: use - instead of non-ascii wide-dash character
smatch complains about non-ascii characters. It turns out that a wide-dash character
was used instead of the more common '-' character.

Replace those dashes with -.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-27 08:14:43 -03:00
Mauro Carvalho Chehab 3915d36793 [media] ttpci: cleanup a bogus smatch warning
Cleanup this bogus smatch warning:
	drivers/media/pci/ttpci/budget.c:635 frontend_init() warn: missing break? reassigning 'budget->dvb_frontend'

And document the fall through logic at the switch().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:26:22 -03:00
Mauro Carvalho Chehab d4c71d7a38 [media] av7110: remove a bogus smatch warning
Remove this bogus smatch warning:
	drivers/media/pci/ttpci/av7110.c:2211 frontend_init() warn: missing break? reassigning 'av7110->fe'

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:25:21 -03:00
Mauro Carvalho Chehab 54c8cdd4ab [media] drxj: set_param_parameters array is too short
Fixes this smatch warning:
	drivers/media/dvb-frontends/drx39xyj/drxj.c:4151 drxj_dap_scu_atomic_read_write_block() error: buffer overflow 'set_param_parameters' 15 <= 17

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:24:46 -03:00
Mauro Carvalho Chehab 88d0518c0d [media] dib9000: read16/write16 could return an error code
Both dib9000_read16_attr and dib9000_write16_attr can return an
error code. However, they currently return an u16. This produces the
following warnings on smatch:

	drivers/media/dvb-frontends/dib9000.c:262 dib9000_read16_attr() warn: signedness bug returning '(-121)'
	drivers/media/dvb-frontends/dib9000.c:321 dib9000_write16_attr() warn: signedness bug returning '(-22)'
	drivers/media/dvb-frontends/dib9000.c:353 dib9000_write16_attr() warn: signedness bug returning '(-121)'

Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:24:17 -03:00
Mauro Carvalho Chehab 4c2f7f72b8 [media] ivtv: steal could be NULL
ivtv_flush_queues() calls ivtv_queue_move() with steal == NULL.
However, part of the code assumes that steal could be not null, as
pointed by smatch:
	drivers/media/pci/ivtv/ivtv-queue.c:145 ivtv_queue_move() error: we previously assumed 'steal' could be null (see line 138)

This has the potential of causing an OOPS when the queue is
flushed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:22:22 -03:00
Mauro Carvalho Chehab d079e36d94 [media] stv0900: avoid going past array
Fix the following smatch warnings:
	drivers/media/dvb-frontends/stv0900_core.c:1183 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
	drivers/media/dvb-frontends/stv0900_core.c:1185 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
	drivers/media/dvb-frontends/stv0900_core.c:1187 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
	drivers/media/dvb-frontends/stv0900_core.c:1189 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
	drivers/media/dvb-frontends/stv0900_core.c:1191 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13

Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:21:42 -03:00
Mauro Carvalho Chehab 2e158d45fe [media] pvrusb2: don't go past buf array
That fixes the following smatch warning:
	drivers/media/usb/pvrusb2/pvrusb2-hdw.c:4909 pvr2_hdw_state_log_state() error: buffer overflow 'buf' 256 <= 4294967294

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:20:47 -03:00
Mauro Carvalho Chehab 19409c8969 [media] pvrusb2-io: no need to check if sp is not NULL
The buffer_complete() routine assumes that sp is not NULL,
otherwise it will fail completely. Btw, this is also
assumed at pvr2_buffer_queue(), with is the routine that
setups the URB handling.

So, remove the bogus for the callback at buffer_complete.

This fix this smatch warning:
	drivers/media/usb/pvrusb2/pvrusb2-io.c:476 buffer_complete() warn: variable dereferenced before check 'sp' (see line 472)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:20:07 -03:00
Mauro Carvalho Chehab 6cf5dad17e [media] media_device: move allocation out of media_device_*_init
Right now, media_device_pci_init and media_device_usb_init does
media_device allocation internaly. That preents its usage when
the media_device struct is embedded on some other structure.

Move memory allocation outside it, to make it more generic.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:19:39 -03:00
Mauro Carvalho Chehab 41b44e35ba [media] media-device: move PCI/USB helper functions from v4l2-mc
Those ancillary functions could be called even when compiled
without V4L2 support, as warned by ktest build robot:

All errors (new ones prefixed by >>):

>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb/dvb-usb.ko] undefined!
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb-v2/dvb_usb_v2.ko] undefined!
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/au0828/au0828.ko] undefined!

Also, there's nothing there that are specific to V4L2. So, move
those ancillary functions to MC core.

No functional changes. Just function rename.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:18:45 -03:00
Benoit Parrot 2ddf22eec4 [media] media: ti-vpe: cal: Fix warning: variable dereference before being checked
As reported ctx->sensor is being dereferenced before being checked
in cal_get_external_info(). That being the case it was also checked
twice in multiple other location where v4l2_subdev_call is already
checking it so no need to explicitly check it again.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:17:27 -03:00
Benoit Parrot 7f67c587cf [media] media: ti-vpe: cal: Fix unreachable code in enum_frame_interval
As reported, the current cal_enum_frameintervals() is confusing
and does not have the intended behavior.
Fix this by re-implementing to properly propagate the enum_frame_interval
request to the subdevice.

[mchehab@osg.samsung.com: remove a now bogus "ret = 0" statement]
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:17:07 -03:00
Mauro Carvalho Chehab e76bea9abd [media] dib0090: do the right thing if rf_ramp is NULL
As warned by smatch:
	drivers/media/dvb-frontends/dib0090.c:1118 dib0090_pwm_gain_reset() error: we previously assumed 'state->rf_ramp' could be null (see line 1086)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:16:37 -03:00
Mauro Carvalho Chehab 55d066a4c7 [media] saa7134: fix detection of external decoders
As warned by smatch:
	drivers/media/pci/saa7134/saa7134-core.c:840 saa7134_create_entities() info: ignoring unreachable code.
	drivers/media/pci/saa7134/saa7134-core.c:843 saa7134_create_entities() warn: curly braces intended?

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:16:06 -03:00
Mauro Carvalho Chehab 60ad768933 [media] tvp5150: don't go past decoder->input_ent array
drivers/media/i2c/tvp5150.c:1394 tvp5150_parse_dt() warn: buffer overflow 'decoder->input_ent' 3 <= 3

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:15:29 -03:00
Mauro Carvalho Chehab 8e9a8b1212 [media] v4l2-mc: fix hardware version for PCI devices
It should be a bitwise or, and not a logical one. Also, add
parenthesis, to make sure it will be applied in the right order.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:14:50 -03:00
Mauro Carvalho Chehab dfa7ba5f61 [media] xc4000: shut up a bogus smatch message
smatch complains about:
	drivers/media/tuners/xc4000.c:1511 xc4000_get_signal() warn: '~value << 3' 524280 can't fit into 65535 'value'

Remove the bogus complain.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23 07:14:02 -03:00
Sakari Ailus f7b5dff0b5 [media] media: Use all bits of an enumeration
The allocation takes place in longs. Assign the size of the enum
accordingly.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-19 11:45:03 -02:00
Mauro Carvalho Chehab 3df0a7ee0a [media] vsp1_drm.h: add missing prototypes
drivers/media/platform/vsp1/vsp1_drm.c:47:5: warning: no previous prototype for 'vsp1_du_init' [-Wmissing-prototypes]
 int vsp1_du_init(struct device *dev)
     ^
drivers/media/platform/vsp1/vsp1_drm.c:76:5: warning: no previous prototype for 'vsp1_du_setup_lif' [-Wmissing-prototypes]
 int vsp1_du_setup_lif(struct device *dev, unsigned int width,
     ^
drivers/media/platform/vsp1/vsp1_drm.c:221:6: warning: no previous prototype for 'vsp1_du_atomic_begin' [-Wmissing-prototypes]
 void vsp1_du_atomic_begin(struct device *dev)
      ^
drivers/media/platform/vsp1/vsp1_drm.c:273:5: warning: no previous prototype for 'vsp1_du_atomic_update' [-Wmissing-prototypes]
 int vsp1_du_atomic_update(struct device *dev, unsigned int rpf_index,
     ^
drivers/media/platform/vsp1/vsp1_drm.c:451:6: warning: no previous prototype for 'vsp1_du_atomic_flush' [-Wmissing-prototypes]
 void vsp1_du_atomic_flush(struct device *dev)
      ^

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-19 10:08:51 -02:00
Laurent Pinchart 5aa2eb3c86 [media] v4l: vsp1: Configure device based on IP version
The IP version number carries enough information to identify the exact
device instance features. Drop the related DT properties and use the IP
version instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-19 09:43:46 -02:00