Commit graph

361032 commits

Author SHA1 Message Date
Kevin Baradon 26ccbec44a [media] media/rc/imon.c: make send_packet() delay larger for 15c2:0036
Some imon devices (like 15c2:0036) need a higher delay between
send_packet calls.

Default value is still 5ms to avoid regressions on already working
hardware.

Also use interruptible wait to avoid load average going too high (and
let caller handle signals).

Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:34:25 -03:00
Federico Fuga 15170025ee [media] Corrected Oops on omap_vout when no manager is connected
If no manager is connected to the vout device, the omapvid_init() function
fails. No error condition is checked, and the device is started. Later on,
when irq is serviced, a NULL pointer dereference occurs.
Also, the isr routine must be registered only if no error occurs, otherwise
the isr triggers without the proper setup, and the kernel oops again.
To prevent this, the error condition is checked, and the streamon function
exits with error. Also the isr registration call is moved after the setup
procedure is completed.

Reviewed-by: Prabhakar Lad <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:31:51 -03:00
Dmitri Belimov 01ae72866d [media] xc5000: fix incorrect debug printnk
I found very small bug in xc5000 source. When set option debug=1 and
listen a radio we see in dmesg xc5000: xc_SetTVStandard()
Standard = M/N-NTSC/PAL-BTSC at all times. However, it should be, instead
"FM Radio-INPUT1_MONO".

That happens because xc5000_set_radio_freq() gets the correct value for
VideoMode and AudioMode for radio and calls xc_SetTVStandard() where name
of standard comes from the incorrect place priv->video_standard.

This incorrect debug message makes debugging  a little difficult.

Signed-off-by: Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 16:46:05 -03:00
Paul Bolle b3d9a15d9a [media] soc_camera: remove two outdated selects
Release v2.6.30 removed the MT9M001_PCA9536_SWITCH and
MT9V022_PCA9536_SWITCH Kconfig symbols, in commits
36034dc325 ("V4L/DVB (11032): mt9m001:
allow setting of bus width from board code") and
e958e27ade ("V4L/DVB (11033): mt9v022:
allow setting of bus width from board code").
These two commits removed all gpio related code from these two drivers.
But they skipped removing their two selects of GPIO_PCA953X. Remove
these now as they are outdated. Their dependencies can never evaluate to
true anyhow.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:36:05 -03:00
Sachin Kamat b3fd87bc35 [media] sh_vou: Use module_platform_driver_probe macro
module_platform_driver_probe() eliminates the boilerplate and simplifies
the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:35:50 -03:00
Sachin Kamat 6647b9c003 [media] sh_veu: Use module_platform_driver_probe macro
module_platform_driver_probe() eliminates the boilerplate and simplifies
the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:35:39 -03:00
Sachin Kamat bd3b4a3fde [media] soc_camera/mx1_camera: Use module_platform_driver_probe macro
module_platform_driver_probe() eliminates the boilerplate and simplifies
the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:35:27 -03:00
Sachin Kamat f2b4dc1a0f [media] sh_veu.c: Convert to devm_ioremap_resource()
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:35:14 -03:00
Sachin Kamat 8efdb13543 [media] soc_camera/pxa_camera: Convert to devm_ioremap_resource()
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:34:35 -03:00
Sachin Kamat 2e2d612d80 [media] soc_camera/sh_mobile_csi2: Convert to devm_ioremap_resource()
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:33:31 -03:00
Sachin Kamat 15a0934201 [media] soc_camera/sh_mobile_ceu_camera: Convert to devm_ioremap_resource()
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:33:08 -03:00
Andrei Andreyanau bff7993936 [media] mt9v022 driver: send valid HORIZONTAL_BLANKING values to mt9v024 soc camera
This patch fixes the issue that appears when mt9v024 camera is used with the
mt9v022 soc camera driver. The minimum total row time is 690 columns
(horizontal width + horizontal blanking). The minimum horizontal
blanking is 61. Thus, when the window width is set below 627, horizontal blanking must
be increased. For the mt9v024 camera the values above are correct and
for the mt9v022 camera the correct values are in the existing kernel driver.

Signed-off-by: Andrei Andreyanau <a.andreyanau@sam-solutions.net>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:19:50 -03:00
Guennadi Liakhovetski 4a1313c447 [media] mt9m111: fix Oops - initialise context before dereferencing
A recent commit "[media] soc-camera: Push probe-time power management to
drivers" causes an Oops during mt9m111 driver probing because its .ctx
private data field is now dereferenced before it is initialised. Fix this
by initialising the field earlier.

Reported-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:19:03 -03:00
Benoît Thébaudeau cbaa5c54cb [media] soc-camera: mt9m111: Fix auto-exposure control
Commit f9bd584365 changed V4L2_CID_EXPOSURE_AUTO
from boolean to enum, and commit af8425c54b
changed the creation of this control into a menu for the mt9m111. However,
mt9m111_set_autoexposure() is still interpreting the value set for this control
as a boolean, which also conflicts with the default value of this control set to
V4L2_EXPOSURE_AUTO (0).
This patch makes mt9m111_set_autoexposure() interpret the value set for
V4L2_CID_EXPOSURE_AUTO as defined by enum v4l2_exposure_auto_type.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:18:38 -03:00
Paul Bolle d65fcbb000 [media] ts2020: use customise option correctly
The Kconfig entry for "TS2020 based tuners" defaults to modular if
DVB_FE_CUSTOMISE is set. But that Kconfig symbol was replaced with
MEDIA_SUBDRV_AUTOSELECT as of v3.7. So use the new symbol. And negate
the logic, so we are in line with all the similar entries in this file.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:11:12 -03:00
Manjunath Hadli 5b38b0f88d [media] media: tvp514x: enable TVP514X for media controller based usage
add support for TVP514x as a media entity and support for
pad operations. The decoder supports 1 output pad.
The default format code was V4L2_MBUS_FMT_YUYV10_2X10
changed it to V4L2_MBUS_FMT_UYVY8_2X8.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:06:29 -03:00
Manjunath Hadli e64171b97b [media] media: add support for decoder as one of media entity types
A lot of SOCs including Texas Instruments Davinci family mainly use
video decoders as input devices. This patch adds a flag
'MEDIA_ENT_T_V4L2_SUBDEV_DECODER' media entity type for decoder's.
Along side updates the documentation for this media entity type.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:05:31 -03:00
Lad, Prabhakar 88da0183eb [media] media: ths7353: add support for ths7353 video amplifier
The patch adds support for THS7353 video amplifier.
The the THS7353 amplifier is very much similar to the
existing THS7303 video amplifier driver.
This patch appropriately makes changes to the existing
ths7303 driver and adds support for the THS7353.
This patch also adds V4L2_IDENT_THS7353 for the THS7353
chip and appropriate changes to Kconfig file for building.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:04:47 -03:00
Sachin Kamat 18ace0e273 [media] davinci_vpfe: Use module_platform_driver macro
module_platform_driver() eliminates the boilerplate and simplifies
the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:02:37 -03:00
Alexandru Gheorghiu 01c8132303 [media] Drivers: staging: media: davinci_vpfe: Use resource_size function
Use resource_size function on resource object instead of explicit
computation.

Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 13:50:00 -03:00
Ismael Luceno 70b8ff3c3d [media] solo6x10: Update TODO (maintainer change)
Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 13:48:44 -03:00
Hans Verkuil ffdc78efe1 [media] vb2-dma-sg: add debug module option
This prevents the kernel log from being spammed with these messages.
By turning on the debug option you will see them again.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 13:25:15 -03:00
Hans Verkuil b6ba2057f7 [media] videobuf2: add gfp_flags
Some drivers have special memory requirements for their buffers, usually
related to DMA (e.g. GFP_DMA or __GFP_DMA32). Make it possible to specify
additional GFP flags for those buffers by adding a gfp_flags field to
vb2_queue.
Note that this field will be replaced in the future with a different
mechanism, but that is still work in progress and we need this feature
now so we won't be able to convert drivers with such requirements to vb2.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 13:17:51 -03:00
Mauro Carvalho Chehab 808d24d6c0 [media] dvb-core: don't clear stats at DTV_CLEAR
The stats are cleared by the frontend. Don't do it at DTV_CLEAR.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:27:35 -03:00
Mauro Carvalho Chehab 340e76965c [media] drxk: Fix bogus signal strength indicator
The DVBv3 signal strength indicator is bogus: it doesn't range
from 0 to 65535 as it would be expected. Also, 0 means the max
signal strength.
Now that a better way to estimate it was added, use the new
way.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:27:21 -03:00
Mauro Carvalho Chehab 59a7a23c47 [media] drxk: use a better calculus for RF strength
The AZ6007 driver released by Terratec has a better way to
estimate the signal strength, at CtrlSigStrength(). Port it
to the driver.
It should be noticed that there are two parameters there that
are tuner-specific.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:27:05 -03:00
Mauro Carvalho Chehab 8f3741e028 [media] drxk: Add pre/post BER and PER/UCB stats
The original az6007 driver has the code to calculate such
stats. Add it to the driver, reporting them via DVBv5
stats API.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:26:50 -03:00
Mauro Carvalho Chehab 2b0e1f3afd [media] drxk: remove dummy BER read code
The BER code does nothing but filling it with zero. Remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:25:59 -03:00
Mauro Carvalho Chehab 2bf0f93e0d [media] siano: make some functions static
drivers/media/common/siano/smsdvb-debugfs.c:51:6: warning: no previous prototype for 'smsdvb_print_dvb_stats' [-Wmissing-prototypes]
drivers/media/common/siano/smsdvb-debugfs.c:154:6: warning: no previous prototype for 'smsdvb_print_isdb_stats' [-Wmissing-prototypes]
drivers/media/common/siano/smsdvb-debugfs.c:244:6: warning: no previous prototype for 'smsdvb_print_isdb_stats_ex' [-Wmissing-prototypes]
drivers/media/common/siano/smscoreapi.c:832:5: warning: no previous prototype for 'smscore_configure_board' [-Wmissing-prototypes]
drivers/media/common/siano/smscoreapi.c:1301:5: warning: no previous prototype for 'smscore_init_device' [-Wmissing-prototypes]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:04:01 -03:00
Mauro Carvalho Chehab 05ad412a63 [media] siano: Fix the remaining checkpatch.pl compliants
Fix all other remaining checkpatch.pl compliants on the Siano driver,
except for the 80-cols (soft) limit. Those are harder to fix, and
probably not worth to do right now.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:53 -03:00
Mauro Carvalho Chehab 28a59df4d7 [media] siano: remove the remaining CamelCase compliants
Remove the remaining CamelCase checkpatch.pl compliants.
There are still a few left, but those are due to USB and
DVB APIs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:45 -03:00
Mauro Carvalho Chehab 90414248bf [media] siano: fix checkpatch.pl compliants on smscoreapi.h
Fix the remaining checkpatch.pl compliants at smscoreapi.h,
except by the "line over 80 characters" on comments. Fixing those
would require more time, as the better is to convert them into the
struct descriptions used inside the kernel, as described at:
	Documentation/kernel-doc-nano-HOWTO.txt

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:34 -03:00
Mauro Carvalho Chehab cf0e9cfcc7 [media] siano: convert structure names to lowercase
There are several structures defined in uppercase. Convert them
to lowercase, and simplify their names, when possible.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:27 -03:00
Mauro Carvalho Chehab dfef84fc13 [media] siano: get rid of CammelCase from smscoreapi.h
It is almost impossible to see a compliant with checkpatch.pl
on those Siano drivers, as there are simply too much violations
on it. So, now that a big change was done, the better is to
cleanup the checkpatch compliants.

Let's first replace all CammelCase symbols found at smscoreapi.h
using camel_case namespace. That removed 144 checkpatch.pl
compliants on this file. Of course, the other files need to be
fixed accordingly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:16 -03:00
Mauro Carvalho Chehab c8b8fdb39d [media] siano: add MODULE_FIRMWARE() macros
This driver can use several firmwares. Provide such info at
module firmware metadata.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:54:21 -03:00
Mauro Carvalho Chehab 11ad03a563 [media] siano: use defines for firmware names
There are too many firmwares there. As we need to add
MODULE_FIMWARE() macros, the better is to define their names
on just one place and use the macros for both cards/device type
tables and MODULE_FIRMWARE().

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:54:13 -03:00
Mauro Carvalho Chehab d8a18e88c9 [media] siano: Remove bogus complain about MSG_SMS_DVBT_BDA_DATA
When the driver is tuned into chanel, and it is removed/reinserted,
the message stream data may be arriving during device probe:
	[ 5680.162004] smscore_set_device_mode: set device mode to 6
	[ 5680.162267] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.162391] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.162641] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.162891] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.163016] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.163266] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.163516] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.163640] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.163891] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.164016] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.164265] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.164515] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.164519] smscore_onresponse: Firmware id 6 prots 0x40 ver 8.1
	[ 5680.164766] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.166018] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.166438] DVB: registering new adapter (Siano Rio Digital Receiver)
Instead of complaining, just silently discard those messages, instead of
complaining.
A proper fix is to put the device on suspend/power down mode when the module
is removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:53:59 -03:00
Mauro Carvalho Chehab 98c3f94e6d [media] siano: remove doubled new line
sms_debug() and sms_info() already adds a '\n' at the printed
strings. No need to add more.
That helps to cleanup stuff like:
	[ 4868.205648] smscore_onresponse: message not handled.
	[ 4868.205898] smscore_onresponse: message not handled.
and:
	[ 5467.959769] smscore_onresponse:
	data rate 143069 bytes/secs
While here, provides the message name, when the message is not
handled by the smsmdtv core.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:53:50 -03:00
Mauro Carvalho Chehab 07bb6bdddf [media] siano: remove a bogus printk line
The logic that detects the types of sms devices is bogus. It returns
	[ 4645.187790] smsusb_init_device: line: 372: Unspecified sms device type!
For several devices, including the one I have (SMS_RIO). In a matter
of fact, the right thing to do there is to print an error only if
the device is really unknown (SMS_UNKNOWN_TYPE).

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:53:42 -03:00
Mauro Carvalho Chehab beb91d461b [media] siano: add a MAINTAINERS entry for it
Nobody is maintaining this driver. The project started by a
developer that used to work at Hauppauge. A Siano developer
assumed its maintainership after that, but he left the company.
Another Siano developer sent several patches updating it, but,
after upstream feedback, it seems he gave up merging the driver,
as he never answered back to the received feedbacks.
As I have a few siano devices here that work with ISDB-T, I
can help to keep it into a good shape. So, better to take its
maintainership.
I don't have any siano SDIO setup here, trough. So, I'll just
apply without any test any patch that looks sane and touches
only drivers/media/mmc/siano. So, let's tag it as "Odd fixes".

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:53:33 -03:00
Mauro Carvalho Chehab 2a7643159d [media] siano: reorder smscore_get_fw_filename() function
Put this function earlier in the code, to avoid the need of
defining a function stub.
No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:53:26 -03:00
Mauro Carvalho Chehab e584f9d61e [media] siano: remove the bogus firmware lookup code
There is an special lookup code that is called when
SMS_BOARD_UNKNOWN. The logic there is bogus and will cause
an oops, as .type is SMS_UNKNOWN_TYPE (-1).
As the code would do:
	return smscore_fw_lkup[type][mode];
That would mean that it would try to go past the
smscore_fw_lkup table.
So, just remove that bogus code, simplifying the logic.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:57 -03:00
Mauro Carvalho Chehab 9711a8a600 [media] siano: honour per-card default mode
Instead of using a global default_mode, passed via modprobe
parameter, use the one defined inside the cards struct.
That will prevent the need of manually specify it for each
board, except, of course, if the user wants to do something
different, on boards that accept multiple types.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:48 -03:00
Mauro Carvalho Chehab 5ac14b6011 [media] siano: simplify firmware lookup logic
There are two ways to specify firmware for siano devices: a
per-device ID and a per-device type.
The per-device type logic is currently made by a 11x9 string
table, sparsely filled. It is very hard to read the table at
the source code, as there are too much "none" filling there
("none" there is a way to tell NULL).
Instead of using such problematic table, convert it into an
easy to read table, where the unused values will be defaulted
to NULL.
While here, also simplifies a little bit the logic and print
a message if an user-selected mode doesn't exist.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:37 -03:00
Mauro Carvalho Chehab 6a28bd94f4 [media] siano: add support for .poll on debugfs
Implement poll() method for debugfs and be sure that the
debug_data won't be freed on ir or on read().
With this change, poll() will return POLLIN if either data was
filled or if data was read. That allows read() to return 0
to indicate EOF in the latter case.
As poll() is now provided, fix support for non-block mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:29 -03:00
Mauro Carvalho Chehab 773adad141 [media] siano: fix status report with old firmware and ISDB-T
This seems to be ever broken. That's the status report with
Firmware 2.1, before adding support for sms2270 is:
[22273.787218] smsdvb_onresponse: MSG_SMS_GET_STATISTICS_RES
[22273.792592] IsRfLocked = 1
[22273.792592] IsDemodLocked = 1
...
[22273.792598] TransmissionMode = -64
...
(all unshown fields are filled with zeros)
Of course, transmission mode being a negative number is wrong.
So, we need to take a deeper look on it.
With the debugfs patches applied, it is possible to see that, instead
of filling StatisticsType with 5, and FullSize with the size of the
payload (this is what happens with sms2270 and firmware 8.1),
those fields are also initialized with zero:
StatisticsType = 0	FullSize = 0
IsRfLocked = 1		IsDemodLocked = 1	IsExternalLNAOn = 0
SNR = 0 dB		RSSI = 0 dBm		InBandPwr = 0 dBm
CarrierOffset = 0	Bandwidth = 0		Frequency = 0 Hz
TransmissionMode = -64	ModemState = 0		GuardInterval = 0
SystemType = 0		PartialReception = 0	NumOfLayers = 0
SmsToHostTxErrors = 0
The data under "TransmissionMode" varies according with the signal,
and it is negative. It also matches the value for InBandPwr when
the tuner is on DVB-T (ok, signal doesn't lock, but the power level
should be about the same with the antena fixed, and measured at about
the same time).
So, there's a very high chance that, when StatisticsType is zero, the
signal strength is at the same position as Transmission Mode.
So, discard all other parameters, and provide only signal/rf lock and
signal strength if StatisticsType is 0, for ISDB-T.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:16 -03:00
Mauro Carvalho Chehab e1b2ac4d1e [media] siano: Only feed DVB data when there's a feed
Right now, the driver sends DVB data even before tunning.
It was noticed that this may lead into some mistakes at DVB
decode, as the PIDs from wrong channels may be associated with
another frequency, as they may already be inside the PID buffers.
So, prevent it by not feeding DVB demux with data while there's no
feed or while the device is not tuned.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:05 -03:00
Mauro Carvalho Chehab 5c3b87435b [media] siano: Fix bandwidth report
It was expected that the bandwidth would be following the defines
at smscoreapi.h. However, this doesn't work. Instead, this field
brings just the bandwidth in MHz. Convert it to Hertz.
It should be noticed that, on ISDB, using the _EX request, the
field TuneBW seems to show the value that matches the bandwidth
code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:51:47 -03:00
Mauro Carvalho Chehab 9671045f4c [media] siano: fix PER/BER report on DVBv5
The check for lock logic is broken. Due to that, no PER/BER
stats will ever be showed, and the DVBV3 events will be wrong.
Also, the per-layer PER/BER stats for ISDB-T are filled with
the wrong index.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:49:32 -03:00
Mauro Carvalho Chehab f5de95e246 [media] siano: fix signal strength and CNR stats measurements
There are a number of small issues with the stats refactoring:
	- InBandPwr better represents the signal strength;
	- Don't zero signal strength /cnr if no lock;
	- Fix signal strength/cnr scale;
	- Don't need to fill PER/BER if not locked, as the
	  code will disable those stats anyway.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:49:17 -03:00