Commit graph

8 commits

Author SHA1 Message Date
Mauro Carvalho Chehab 004e45d736 [media] tuner-core: handle errors when getting signal strength/afc
If those callbacks fail, it should return zero, and not a random
value. The previous code assumed that all drivers would only change
signal strength if it succeeds, but this may not be true.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:43 -03:00
Mauro Carvalho Chehab 6f8ca0b541 [media] tuner-core: Remove the now uneeded checks at fe_has_signal/get_afc
Now that those functions are only used when the corresponding
function calls are defined, we don't need to check if those
function calls are present at the structure before using it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:42 -03:00
Mauro Carvalho Chehab 383730c364 [media] tuner-core: return afc instead of zero
While the driver gets AFC from the tuner, it doesn't return it
back via V4L2 API due to a mistake at the return. fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:40 -03:00
Hans Verkuil 106cf649d0 [media] tuner-core: don't set has_signal/get_afc if not supported
If the tuner frontend does not support get_rf_strength, then don't set
the has_signal callback. Ditto for get_afc.
Both callbacks overwrite the signal and afc fields of struct v4l2_tuner
but that should only happen if the tuner can actually detect this. If
it can't, then it should leave those fields alone so other subdevices
can try and detect the signal/afc.
This fixes the bug where the au8522 detected a signal and then tuner-core
overwrote it with 0 since the xc5000 tuner does not support get_rf_strength.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:39 -03:00
Hans Verkuil 2f73c7c582 [media] v4l2: add const to argument of write-only s_tuner ioctl
This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 06:31:23 -03:00
Hans Verkuil b530a447bb [media] v4l2: add const to argument of write-only s_frequency ioctl
This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 06:25:34 -03:00
Hans Verkuil ba1066d2e9 [media] tuner-core: map audmode to STEREO for radio devices
Fixes a v4l2-compliance error: setting audmode to a value other than mono
or stereo for a radio device should map to MODE_STEREO.
The spec specifies that for radio devices only mono and stereo audmodes are
valid. If the user specifies another audmode in v4l2_tuner, then that should
be mapped to valid audmode. That didn't happen here.
Note that tuner drivers might decide to limit the possible audmode even
further if it only supports mono. In that case the tuner driver can set
audmode to mono. However, that new value wasn't copied back to t->audmode,
and that has been fixed as well in this patch.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 16:55:38 -02:00
Mauro Carvalho Chehab 5bc3cb743b [media] v4l: move v4l2 core into a separate directory
Currently, the v4l2 core is mixed together with other non-core drivers.
Move them into a separate directory.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:02:38 -03:00
Renamed from drivers/media/video/tuner-core.c (Browse further)