pandora-kernel.git
11 years ago[media] Drivers: staging: media: davinci_vpfe: Use resource_size function
Alexandru Gheorghiu [Sun, 10 Mar 2013 11:14:53 +0000 (08:14 -0300)]
[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>
11 years ago[media] solo6x10: Update TODO (maintainer change)
Ismael Luceno [Sat, 9 Mar 2013 06:25:07 +0000 (03:25 -0300)]
[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>
11 years ago[media] vb2-dma-sg: add debug module option
Hans Verkuil [Sat, 2 Mar 2013 08:12:08 +0000 (05:12 -0300)]
[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>
11 years ago[media] videobuf2: add gfp_flags
Hans Verkuil [Fri, 1 Mar 2013 18:44:20 +0000 (15:44 -0300)]
[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>
11 years ago[media] dvb-core: don't clear stats at DTV_CLEAR
Mauro Carvalho Chehab [Wed, 20 Mar 2013 13:39:31 +0000 (10:39 -0300)]
[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>
11 years ago[media] drxk: Fix bogus signal strength indicator
Mauro Carvalho Chehab [Wed, 20 Mar 2013 11:57:42 +0000 (08:57 -0300)]
[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>
11 years ago[media] drxk: use a better calculus for RF strength
Mauro Carvalho Chehab [Wed, 20 Mar 2013 11:21:52 +0000 (08:21 -0300)]
[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>
11 years ago[media] drxk: Add pre/post BER and PER/UCB stats
Mauro Carvalho Chehab [Wed, 20 Mar 2013 09:15:45 +0000 (06:15 -0300)]
[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>
11 years ago[media] drxk: remove dummy BER read code
Mauro Carvalho Chehab [Wed, 20 Mar 2013 09:36:41 +0000 (06:36 -0300)]
[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>
11 years ago[media] siano: make some functions static
Mauro Carvalho Chehab [Thu, 21 Mar 2013 13:01:47 +0000 (10:01 -0300)]
[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>
11 years ago[media] siano: Fix the remaining checkpatch.pl compliants
Mauro Carvalho Chehab [Thu, 21 Mar 2013 12:40:22 +0000 (09:40 -0300)]
[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>
11 years ago[media] siano: remove the remaining CamelCase compliants
Mauro Carvalho Chehab [Thu, 21 Mar 2013 12:27:37 +0000 (09:27 -0300)]
[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>
11 years ago[media] siano: fix checkpatch.pl compliants on smscoreapi.h
Mauro Carvalho Chehab [Thu, 21 Mar 2013 12:10:22 +0000 (09:10 -0300)]
[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>
11 years ago[media] siano: convert structure names to lowercase
Mauro Carvalho Chehab [Thu, 21 Mar 2013 12:06:03 +0000 (09:06 -0300)]
[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>
11 years ago[media] siano: get rid of CammelCase from smscoreapi.h
Mauro Carvalho Chehab [Thu, 21 Mar 2013 11:49:43 +0000 (08:49 -0300)]
[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>
11 years ago[media] siano: add MODULE_FIRMWARE() macros
Mauro Carvalho Chehab [Tue, 19 Mar 2013 20:46:53 +0000 (17:46 -0300)]
[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>
11 years ago[media] siano: use defines for firmware names
Mauro Carvalho Chehab [Tue, 19 Mar 2013 20:02:54 +0000 (17:02 -0300)]
[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>
11 years ago[media] siano: Remove bogus complain about MSG_SMS_DVBT_BDA_DATA
Mauro Carvalho Chehab [Tue, 19 Mar 2013 16:12:29 +0000 (13:12 -0300)]
[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>
11 years ago[media] siano: remove doubled new line
Mauro Carvalho Chehab [Tue, 19 Mar 2013 16:06:28 +0000 (13:06 -0300)]
[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>
11 years ago[media] siano: remove a bogus printk line
Mauro Carvalho Chehab [Tue, 19 Mar 2013 15:59:50 +0000 (12:59 -0300)]
[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>
11 years ago[media] siano: add a MAINTAINERS entry for it
Mauro Carvalho Chehab [Tue, 19 Mar 2013 15:42:45 +0000 (12:42 -0300)]
[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>
11 years ago[media] siano: reorder smscore_get_fw_filename() function
Mauro Carvalho Chehab [Tue, 19 Mar 2013 15:06:08 +0000 (12:06 -0300)]
[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>
11 years ago[media] siano: remove the bogus firmware lookup code
Mauro Carvalho Chehab [Tue, 19 Mar 2013 15:00:23 +0000 (12:00 -0300)]
[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>
11 years ago[media] siano: honour per-card default mode
Mauro Carvalho Chehab [Thu, 7 Mar 2013 14:40:45 +0000 (11:40 -0300)]
[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>
11 years ago[media] siano: simplify firmware lookup logic
Mauro Carvalho Chehab [Tue, 19 Mar 2013 12:50:17 +0000 (09:50 -0300)]
[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>
11 years ago[media] siano: add support for .poll on debugfs
Mauro Carvalho Chehab [Sun, 17 Mar 2013 13:27:44 +0000 (10:27 -0300)]
[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>
11 years ago[media] siano: fix status report with old firmware and ISDB-T
Mauro Carvalho Chehab [Sun, 17 Mar 2013 00:05:30 +0000 (21:05 -0300)]
[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>
11 years ago[media] siano: Only feed DVB data when there's a feed
Mauro Carvalho Chehab [Fri, 15 Mar 2013 10:22:08 +0000 (07:22 -0300)]
[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>
11 years ago[media] siano: Fix bandwidth report
Mauro Carvalho Chehab [Sun, 10 Mar 2013 22:21:13 +0000 (19:21 -0300)]
[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>
11 years ago[media] siano: fix PER/BER report on DVBv5
Mauro Carvalho Chehab [Sun, 10 Mar 2013 16:38:41 +0000 (13:38 -0300)]
[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>
11 years ago[media] siano: fix signal strength and CNR stats measurements
Mauro Carvalho Chehab [Sun, 10 Mar 2013 15:06:30 +0000 (12:06 -0300)]
[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>
11 years ago[media] siano: don't request statistics too fast
Mauro Carvalho Chehab [Sun, 10 Mar 2013 13:51:25 +0000 (10:51 -0300)]
[media] siano: don't request statistics too fast

As each DVBv3 call may generate an stats overhead, prevent doing
it too fast. This is specially useful if a burst of get stats
DVBv3 call is sent.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: add two missing fields to ISDB-T stats debugfs
Mauro Carvalho Chehab [Sat, 16 Mar 2013 17:32:25 +0000 (14:32 -0300)]
[media] siano: add two missing fields to ISDB-T stats debugfs

Those fields help to identify the version of the ISDB stats.
Useful while debuging the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: split debugfs code into a separate file
Mauro Carvalho Chehab [Sun, 10 Mar 2013 12:04:44 +0000 (09:04 -0300)]
[media] siano: split debugfs code into a separate file

To avoid mixing two different things at the same place, move the
debugfs code into a separate file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: allow showing the complete statistics via debugfs
Mauro Carvalho Chehab [Sun, 10 Mar 2013 01:33:06 +0000 (22:33 -0300)]
[media] siano: allow showing the complete statistics via debugfs

Outputs the result of the statistics responses via debugfs.
That can help to track bugs at the stats filling.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: fix start of statistics
Mauro Carvalho Chehab [Sun, 10 Mar 2013 02:01:48 +0000 (23:01 -0300)]
[media] siano: fix start of statistics

It seems that the first u32 after the header for some stats are used by
something not documented.
The stats struct starts after it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: Convert it to report DVBv5 stats
Mauro Carvalho Chehab [Sat, 9 Mar 2013 22:26:28 +0000 (19:26 -0300)]
[media] siano: Convert it to report DVBv5 stats

While this frontend provides a nice set of statistics, the
way it is currently reported to userspace is poor. Worse than
that, instead of using quality indicators that range from 0 to 65535,
as expected by userspace, most indicators range from 0 to 100.
Improve it by using DVBv5 statistics API. The legacy indicators
are still reported using the very same old way, but they're now
using a proper range (0 to 65535 for quality indicadors; 0.1 dB
for SNR).

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: split debug logic from the status update routine
Mauro Carvalho Chehab [Sat, 9 Mar 2013 18:54:46 +0000 (15:54 -0300)]
[media] siano: split debug logic from the status update routine

It is confusing to merge both status updates with debug stuff.
Also, it is a better idea to move those status updates to
debugfs, instead of doing a large amount of printk's like that.
So, break them into a separate block of routines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: split get_frontend into per-std functions
Mauro Carvalho Chehab [Sat, 9 Mar 2013 15:05:58 +0000 (12:05 -0300)]
[media] siano: split get_frontend into per-std functions

Instead of handling both DVB-T and ISDB-T at the same get_frontend
function, break it intow one function per-delivery system.
That makes the code clearer as we start to add support for DVBv5
statistics, and for ISDB-T get frontend stuff.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: simplify message endianness logic
Mauro Carvalho Chehab [Sat, 9 Mar 2013 14:34:56 +0000 (11:34 -0300)]
[media] siano: simplify message endianness logic

Currently, every time a message is sent or received, the endiannes
need to be fixed on big endian machines. This is currently done
on every call to the send API, and on every msg reception logic.
Instead of doing that, move it to the send/receive functions.
That simplifies the logic and avoids the risk of forgetting to
fix it somewhere.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: call MSG_SMS_INIT_DEVICE_REQ
Mauro Carvalho Chehab [Sat, 9 Mar 2013 13:24:38 +0000 (10:24 -0300)]
[media] siano: call MSG_SMS_INIT_DEVICE_REQ

Newer firmwares seem to require an init device message. Apply
such change from Doron Cohen's patch:
http://patchwork.linuxtv.org/patch/7889/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: Configure board's mtu and xtal
Mauro Carvalho Chehab [Fri, 8 Mar 2013 23:48:42 +0000 (20:48 -0300)]
[media] siano: Configure board's mtu and xtal

Backported from Doron Cohen's patch:
http://patchwork.linuxtv.org/patch/7889/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: add new devices to the Siano Driver
Mauro Carvalho Chehab [Wed, 6 Mar 2013 01:35:44 +0000 (22:35 -0300)]
[media] siano: add new devices to the Siano Driver

This patch is based on Doron Cohen's patches:
http://patchwork.linuxtv.org/patch/7881/
http://patchwork.linuxtv.org/patch/7888/
http://patchwork.linuxtv.org/patch/7883/
It basically merges the above patches, rebasing them to
the macro definitions used upstream, with are different
 than the ones used by them internally.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: use the newer stats message for recent firmwares
Mauro Carvalho Chehab [Fri, 8 Mar 2013 00:58:47 +0000 (21:58 -0300)]
[media] siano: use the newer stats message for recent firmwares

The old statistics request don't work with newer firmwares.
Add a logic to use the newer stats if firmware major is 8.
Note that I have only 2 devices here, one with firmware 2.1
(Hauppauge model 55009 Rev B1F7) and another one with
firmware 8.1. We may need to adjust the firmware minimal
version for the *_EX message variants, as we start finding
firmware versions between 2.x and 8.x.
This patch was based on Doron Cohen patch:
http://patchwork.linuxtv.org/patch/7886/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: add support for LNA on ISDB-T
Mauro Carvalho Chehab [Thu, 7 Mar 2013 19:34:53 +0000 (16:34 -0300)]
[media] siano: add support for LNA on ISDB-T

The very same code also exists for DVB-T. Add it for ISDB-T.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: add support for ISDB-T full-seg
Mauro Carvalho Chehab [Thu, 7 Mar 2013 19:34:06 +0000 (16:34 -0300)]
[media] siano: add support for ISDB-T full-seg

Fix the DVBv5 API handling for ISDB-T and add support
for 13 segments.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: use a separate completion for stats
Mauro Carvalho Chehab [Thu, 7 Mar 2013 19:32:33 +0000 (16:32 -0300)]
[media] siano: use a separate completion for stats

Instead of re-use tune_done also for stats, the better is to use
a different completion.
Also, it was noticed that sometimes, the driver answers with
MSG_SMS_SIGNAL_DETECTED_IND for status request. Fix the code to
also handle those other signal indicators.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: add some new messages to the smscoreapi
Mauro Carvalho Chehab [Thu, 7 Mar 2013 14:53:46 +0000 (11:53 -0300)]
[media] siano: add some new messages to the smscoreapi

Based on Doron Cohen's patch:
http://patchwork.linuxtv.org/patch/7887/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: cleanups at smscoreapi.c
Mauro Carvalho Chehab [Thu, 7 Mar 2013 14:38:57 +0000 (11:38 -0300)]
[media] siano: cleanups at smscoreapi.c

Some cleanups at smscoreapi. Most are just CodingStyle.
Also, use kzalloc when allocating a new buffer, as it initializes
the allocated space with zero.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: always load smsdvb
Mauro Carvalho Chehab [Thu, 7 Mar 2013 14:35:00 +0000 (11:35 -0300)]
[media] siano: always load smsdvb

Without smsdvb, the driver actually does nothing, as it
lacks the userspace API.
While I wrote it independently, in order to make a sms2270 board
I have here to work, this patch is functionally identical to this
patch from Doron Cohen:
http://patchwork.linuxtv.org/patch/7894/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: fix the debug message
Mauro Carvalho Chehab [Thu, 7 Mar 2013 10:32:47 +0000 (07:32 -0300)]
[media] siano: fix the debug message

Instead of displaying this:
[   61.869415] smscore_load_firmware_family2: rc=0, postload=0x          (null)
Display, instead:
[ 1348.441160] smscore_load_firmware_family2: rc=0

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: report the choosed firmware in debug
Mauro Carvalho Chehab [Thu, 7 Mar 2013 09:54:14 +0000 (06:54 -0300)]
[media] siano: report the choosed firmware in debug

Don't keep in the dark: report the firmware file name after
lookup. That helps to debug what's happening when a firmware is not
found.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: make load firmware logic to work with newer firmwares
Mauro Carvalho Chehab [Wed, 6 Mar 2013 15:15:08 +0000 (12:15 -0300)]
[media] siano: make load firmware logic to work with newer firmwares

There are new firmwares for sms2xxx devices. Change the firmware
load logic to handle those newer firmwares and devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: store firmware version
Mauro Carvalho Chehab [Sat, 9 Mar 2013 12:56:27 +0000 (09:56 -0300)]
[media] siano: store firmware version

As there are some changes that seem to be firmware-dependent,
we need to store the firmware version, as we don't want to break
support for existing cards that use a legacy (and sometimes
custom) firmware.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: use USB endpoint descriptors for in/out endp
Mauro Carvalho Chehab [Wed, 6 Mar 2013 12:53:50 +0000 (09:53 -0300)]
[media] siano: use USB endpoint descriptors for in/out endp

Instead of using hardcoded descriptors, detect them from the
USB descriptors.
This patch is rebased form Doron Cohen's patch:
http://patchwork.linuxtv.org/patch/7883/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: add additional attributes to cards entries
Mauro Carvalho Chehab [Wed, 6 Mar 2013 11:33:44 +0000 (08:33 -0300)]
[media] siano: add additional attributes to cards entries

Those attributes will be used by the newer sms2xxx cards.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: Properly initialize board information
Mauro Carvalho Chehab [Wed, 6 Mar 2013 11:42:47 +0000 (08:42 -0300)]
[media] siano: Properly initialize board information

Board #0 is an existing one. Instead of initializing the driver
with it, use a different value to detect if board is unknown.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: add the remaining new defines from new driver
Mauro Carvalho Chehab [Wed, 6 Mar 2013 10:37:47 +0000 (07:37 -0300)]
[media] siano: add the remaining new defines from new driver

Add the remaining new defines/enums from Doron Cohen's patch:
        http://patchwork.linuxtv.org/patch/7882/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: better debug send/receive messages
Mauro Carvalho Chehab [Sat, 9 Mar 2013 12:27:39 +0000 (09:27 -0300)]
[media] siano: better debug send/receive messages

Instead of printing a message for some random messages, print
it for all sent/received ones. That helps a lot to debug
what's going on.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: update message macros
Mauro Carvalho Chehab [Wed, 6 Mar 2013 10:16:19 +0000 (07:16 -0300)]
[media] siano: update message macros

Convert from #define into an enum and add the newer message
macros as found on this patch from Doron Cohen:
http://patchwork.linuxtv.org/patch/7882/
No messages got supressed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: remove a duplicated structure definition
Mauro Carvalho Chehab [Wed, 6 Mar 2013 11:30:08 +0000 (08:30 -0300)]
[media] siano: remove a duplicated structure definition

The same GPIO config struct was declared twice at the
driver, with different names and different macros:
struct smscore_config_gpio
struct smscore_config_gpio
Remove the one that uses CamelCase and fix the references to
its attributes/macros.
No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: Add the new voltage definitions for GPIO
Mauro Carvalho Chehab [Wed, 6 Mar 2013 10:14:51 +0000 (07:14 -0300)]
[media] siano: Add the new voltage definitions for GPIO

Those new definitions came from this patch, from Doron Cohen:
http://patchwork.linuxtv.org/patch/7882/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] siano: Change GPIO voltage setting names
Mauro Carvalho Chehab [Wed, 6 Mar 2013 10:09:54 +0000 (07:09 -0300)]
[media] siano: Change GPIO voltage setting names

Siano changed the namespace on more recent API, and re-used some
of the old names. In order to be able to update the API to support
newer chips, the better is to follow this change.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] davinci: vpbe: fix module build
Lad, Prabhakar [Fri, 8 Mar 2013 09:22:10 +0000 (06:22 -0300)]
[media] davinci: vpbe: fix module build

add a null entry in platform_device_id {}.
This patch fixes following error:
drivers/media/platform/davinci/vpbe_venc: struct platform_device_id is 24 bytes.  The last of 3 is:
0x64 0x6d 0x33 0x35 0x35 0x2c 0x76 0x70 0x62 0x65 0x2d 0x76 0x65 0x6e 0x63 0x00 0x00 0x00 0x00 0x00 0x03 0x00 0x00 0x00
FATAL: drivers/media/platform/davinci/vpbe_venc: struct platform_device_id is not terminated with a NULL entry!
make[1]: *** [__modpost] Error 1

Reported-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] blackfin: replace V4L2_IN/OUT_CAP_CUSTOM_TIMINGS by DV_TIMINGS
Hans Verkuil [Fri, 15 Feb 2013 18:12:01 +0000 (15:12 -0300)]
[media] blackfin: replace V4L2_IN/OUT_CAP_CUSTOM_TIMINGS by DV_TIMINGS

The use of V4L2_IN/OUT_CAP_CUSTOM_TIMINGS is obsolete, use DV_TIMINGS instead.
Note that V4L2_IN/OUT_CAP_CUSTOM_TIMINGS is just a #define for
V4L2_IN/OUT_CAP_DV_TIMINGS.
At some point in the future these CUSTOM_TIMINGS defines might be removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] davinci: more gama -> gamma typo fixes
Hans Verkuil [Mon, 4 Mar 2013 10:24:07 +0000 (07:24 -0300)]
[media] davinci: more gama -> gamma typo fixes

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] davinci/dm644x_ccdc: fix compiler warning
Hans Verkuil [Mon, 4 Mar 2013 10:18:38 +0000 (07:18 -0300)]
[media] davinci/dm644x_ccdc: fix compiler warning

drivers/media/platform/davinci/dm644x_ccdc.c: In function ‘validate_ccdc_param’:
drivers/media/platform/davinci/dm644x_ccdc.c:233:32: warning: comparison between ‘enum ccdc_gama_width’ and ‘enum ccdc_data_size’ [-Wenum-compare]
It took a bit of work, see this thread of an earlier attempt to fix this:
https://patchwork.kernel.org/patch/1923091/
I've chosen not to follow the suggestions in that thread since gamma_width is
really a different property from data_size. What you really want is to know if
gamma_width fits inside data_size and for that you need to translate each
enum into a maximum bit number so you can safely compare the two.
So I put in two static inline translation functions instead, keeping the rest
of the code the same (except for fixing the 'gama' typo).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] davinci/vpfe_capture: remove current_norm
Hans Verkuil [Tue, 19 Feb 2013 16:34:52 +0000 (13:34 -0300)]
[media] davinci/vpfe_capture: remove current_norm

Since vpfe_capture already provided a g_std op setting current_norm
does not actually do anything. Remove it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] davinci/vpbe_display: remove deprecated current_norm
Hans Verkuil [Tue, 19 Feb 2013 16:33:34 +0000 (13:33 -0300)]
[media] davinci/vpbe_display: remove deprecated current_norm

Since vpbe_display already provides a g_std op setting current_norm
didn't do anything. Remove that code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] davinci/vpfe_capture: convert to the control framework
Hans Verkuil [Mon, 4 Mar 2013 08:48:43 +0000 (05:48 -0300)]
[media] davinci/vpfe_capture: convert to the control framework

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] davinci: replace V4L2_OUT_CAP_CUSTOM_TIMINGS by V4L2_OUT_CAP_DV_TIMINGS
Hans Verkuil [Fri, 15 Feb 2013 18:10:45 +0000 (15:10 -0300)]
[media] davinci: replace V4L2_OUT_CAP_CUSTOM_TIMINGS by V4L2_OUT_CAP_DV_TIMINGS

The use of V4L2_OUT_CAP_CUSTOM_TIMINGS is deprecated, use DV_TIMINGS instead.
Note that V4L2_OUT_CAP_CUSTOM_TIMINGS is just a #define for
V4L2_OUT_CAP_DV_TIMINGS.
At some point in the future these CUSTOM_TIMINGS defines might be removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] davinci: remove VPBE_ENC_DV_PRESET and rename VPBE_ENC_CUSTOM_TIMINGS
Hans Verkuil [Fri, 15 Feb 2013 18:06:28 +0000 (15:06 -0300)]
[media] davinci: remove VPBE_ENC_DV_PRESET and rename VPBE_ENC_CUSTOM_TIMINGS

Remove VPBE_ENC_DV_PRESET (the DV_PRESET API is no longer supported) and
VPBE_ENC_CUSTOM_TIMINGS is renamed to VPBE_ENC_DV_TIMINGS since the old
"CUSTOM_TIMINGS" name is deprecated in favor of "DV_TIMINGS".

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] davinci_vpfe: fix copy-paste errors in several comments
Hans Verkuil [Fri, 15 Feb 2013 17:51:23 +0000 (14:51 -0300)]
[media] davinci_vpfe: fix copy-paste errors in several comments

This removes some incorrect dv_preset references left over from copy-and-paste
errors.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] tvp7002: remove dv_preset support
Hans Verkuil [Fri, 15 Feb 2013 17:49:15 +0000 (14:49 -0300)]
[media] tvp7002: remove dv_preset support

Finally remove the dv_preset support from this driver. Note that dv_preset
support was already removed from any bridge drivers that use this i2c
driver, so the dv_preset ops were no longer called and can be removed
safely.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] tvp7002: use dv_timings structs instead of presets
Hans Verkuil [Fri, 15 Feb 2013 17:46:40 +0000 (14:46 -0300)]
[media] tvp7002: use dv_timings structs instead of presets

In the functions tvp7002_mbus_fmt(), tvp7002_log_status and tvp7002_probe()
we should use the dv_timings data structures instead of dv_preset data
structures and functions.
This is the second step towards removing the deprecated preset support of this
driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] tvp7002: replace 'preset' by 'timings' in various structs/variables
Hans Verkuil [Fri, 15 Feb 2013 17:33:51 +0000 (14:33 -0300)]
[media] tvp7002: replace 'preset' by 'timings' in various structs/variables

This is the first step towards removing the deprecated preset support of this
driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] [1/1,dvb-usb] GOTVIEW SatelliteHD card support
Andrey Pavlenko [Thu, 7 Mar 2013 12:36:22 +0000 (09:36 -0300)]
[media] [1/1,dvb-usb] GOTVIEW SatelliteHD card support

Added support for the GOTVIEW SatelliteHD card which is based on
Montage M88DS3000 and works very well with this driver.

Signed-off-by: Andrey Pavlenko <andrey.a.pavlenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] rc-core: rename ir_input_class to rc_class
David Härdeman [Wed, 6 Mar 2013 19:52:10 +0000 (16:52 -0300)]
[media] rc-core: rename ir_input_class to rc_class

The name is already misleading and will be more so in the future as the
connection to the input subsystem is obscured away further.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] rc-core: initialize rc-core earlier if built-in
David Härdeman [Wed, 6 Mar 2013 19:52:15 +0000 (16:52 -0300)]
[media] rc-core: initialize rc-core earlier if built-in

rc-core is a subsystem so it should be registered earlier if built into the
kernel.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] lmedm04: Remove redundant NULL check before kfree
Syam Sidhardhan [Wed, 6 Mar 2013 19:44:46 +0000 (16:44 -0300)]
[media] lmedm04: Remove redundant NULL check before kfree

kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: update cardlist
Mauro Carvalho Chehab [Tue, 19 Mar 2013 18:15:59 +0000 (15:15 -0300)]
[media] em28xx: update cardlist

There's one missing USB ID at the card list. Add it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb_demux: Transport stream continuity check fix
John Smith [Tue, 5 Mar 2013 21:02:43 +0000 (18:02 -0300)]
[media] dvb_demux: Transport stream continuity check fix

This patch avoids incrementing continuity counter
demux->cnt_storage[pid] for TS packets without payload in accordance
with ISO /IEC 13818-1.

[mchehab@redhat.com: unmangle whitespacing and fix CodingStyle.
 Also checked ISO/IEC spec: patch is according with it]
Reviewed-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: John Smith <johns90812@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] redrat3: missing endian conversions and warnings
Sean Young [Sat, 16 Feb 2013 20:25:45 +0000 (17:25 -0300)]
[media] redrat3: missing endian conversions and warnings

Spotted by sparse.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] redrat3: remove memcpys and fix unaligned memory access
Sean Young [Sat, 16 Feb 2013 20:25:44 +0000 (17:25 -0300)]
[media] redrat3: remove memcpys and fix unaligned memory access

In stead of doing a memcpy from #defined offset, declare structs which
describe the incoming and outgoing data accurately.
Tested on first generation RedRat.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] redrat3: limit periods to hardware limits
Sean Young [Sat, 16 Feb 2013 20:25:43 +0000 (17:25 -0300)]
[media] redrat3: limit periods to hardware limits

The redrat hardware cannot handle periods of larger than 32767us,
limit appropriately. Also fix memory leak in redrat3_get_timeout.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: Add ISDB support for c3tech Digital duo
Mauro Carvalho Chehab [Thu, 28 Feb 2013 13:35:56 +0000 (10:35 -0300)]
[media] em28xx: Add ISDB support for c3tech Digital duo

This is an hybrid board. However, for analog, it requires
a new driver for saa7136. So, for now, let's just add
support for Digital TV.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] v4l2-mem2mem: drop rdy_queue on STREAMOFF
John Sheu [Wed, 6 Feb 2013 23:03:01 +0000 (20:03 -0300)]
[media] v4l2-mem2mem: drop rdy_queue on STREAMOFF

When a v4l2-mem2mem context gets a STREAMOFF call on either its CAPTURE
or OUTPUT queues, we should:
* Drop the corresponding rdy_queue, since a subsequent STREAMON expects
  an empty queue.
* Deschedule the context, as it now has at least one empty queue and
  cannot run.

Signed-off-by: John Sheu <sheu@google.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] v4l2-mem2mem: use CAPTURE queue lock
John Sheu [Wed, 6 Feb 2013 23:03:00 +0000 (20:03 -0300)]
[media] v4l2-mem2mem: use CAPTURE queue lock

In v4l2_m2m_try_schedule(), use the CAPTURE queue lock when accessing
the CAPTURE queue, instead of relying on just holding the OUTPUT queue
lock.

Signed-off-by: John Sheu <sheu@google.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] media: implement 32-on-64 bit compat IOCTL handling
Sakari Ailus [Tue, 22 Jan 2013 15:27:56 +0000 (12:27 -0300)]
[media] media: implement 32-on-64 bit compat IOCTL handling

Use the same handlers where the structs are the same. Implement a new
handler for link enumeration since struct media_links_enum is different on
32-bit and 64-bit systems.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] media: Add 64--32 bit compat ioctl handler
Sakari Ailus [Tue, 22 Jan 2013 15:27:55 +0000 (12:27 -0300)]
[media] media: Add 64--32 bit compat ioctl handler

Provide an ioctl handler for 32-bit binaries on 64-bit systems.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx25821: Cleanup filename assignment code
Peter Senna Tschudin [Mon, 17 Sep 2012 07:04:58 +0000 (04:04 -0300)]
[media] cx25821: Cleanup filename assignment code

I'm pasting the original code and my proposal on the commit message for
make it easy to compare the two versions.
Line 62 of cx25821-audio-upstream.h contains:
char *_defaultAudioName = "/root/audioGOOD.wav";
Original code after replace kmemdup for kstrdup, and after fix return error
code:
if (dev->input_audiofilename) {
dev->_audiofilename = kstrdup(dev->input_audiofilename,
      GFP_KERNEL);
if (!dev->_audiofilename) {
err = -ENOMEM;
goto error;
}
/* Default if filename is empty string */
if (strcmp(dev->input_audiofilename, "") == 0)
dev->_audiofilename = "/root/audioGOOD.wav";
} else {
dev->_audiofilename = kstrdup(_defaultAudioName,
      GFP_KERNEL);
if (!dev->_audiofilename) {
err = -ENOMEM;
goto error;
}
}
Code proposed in this patch:
if ((dev->input_audiofilename) &&
    (strcmp(dev->input_audiofilename, "") != 0))
dev->_audiofilename = kstrdup(dev->input_audiofilename,
      GFP_KERNEL);
else
dev->_audiofilename = kstrdup(_defaultAudioName,
      GFP_KERNEL);
if (!dev->_audiofilename) {
err = -ENOMEM;
goto error;
}

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb_frontend: Simplify the emulation logic
Mauro Carvalho Chehab [Mon, 18 Mar 2013 18:25:37 +0000 (15:25 -0300)]
[media] dvb_frontend: Simplify the emulation logic

The current logic was broken and too complex; while it works
fine for DVB-S2/DVB-S, it is broken for ISDB-T.
Make the logic simpler, fixes it for ISDB-T and make it clearer.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb-frontend: split set_delivery_system()
Mauro Carvalho Chehab [Mon, 18 Mar 2013 18:25:36 +0000 (15:25 -0300)]
[media] dvb-frontend: split set_delivery_system()

This function is complex, and has different workflows, one for
DVBv3 calls, and another one for DVBv5 calls. Break it into 3
functions, in order to make easier to understand what each
block does.
No functional changes so far. A few comments got improved.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx-i2c: relax error check in em28xx_i2c_recv_bytes()
Frank Schaefer [Sun, 10 Mar 2013 10:25:25 +0000 (07:25 -0300)]
[media] em28xx-i2c: relax error check in em28xx_i2c_recv_bytes()

It turned out that some devices return less bytes then requested via i2c when
ALL of the following 3 conditions are met:
- i2c bus B is used
- there was no attempt to write to the specified slave address before
- no device present at the specified slave address
With the current code, this triggers an -EIO error and prints a message to the
system log.
Because it can happen very often during device probing, it is better to ignore
this error and bail out silently after the follwing i2c transaction success
check with -ENODEV.

[mchehab@redhat.com: a small CodingStyle fix]
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: set the timestamp type for video and vbi vb2_queues
Frank Schaefer [Sat, 9 Mar 2013 09:53:01 +0000 (06:53 -0300)]
[media] em28xx: set the timestamp type for video and vbi vb2_queues

The em28xx driver obtains the timestamps using function v4l2_get_timestamp(),
which produces a montonic timestamp.
Fixes the warnings appearing in the system log since commit 6aa69f99
"[media] vb2: Add support for non monotonic timestamps"

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: add support for registering multiple i2c buses
Mauro Carvalho Chehab [Tue, 5 Mar 2013 09:55:28 +0000 (06:55 -0300)]
[media] em28xx: add support for registering multiple i2c buses

Register both buses 0 and 1 via I2C API. For now, bus 0 is used
only by eeprom on all known devices. Later patches will be needed
if this changes in the future.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: Add a separate config dir for secondary bus
Mauro Carvalho Chehab [Tue, 5 Mar 2013 09:55:27 +0000 (06:55 -0300)]
[media] em28xx: Add a separate config dir for secondary bus

Prepare to register a separate bus for the second bus.
For now, just add a new field. A latter patch will add the
bits to make it work.
This patch was generated by this script:
perl -e 'while (<>) { if (s/EM2874_I2C_SECONDARY_BUS_SELECT.*\n//) {
printf "\t\t.def_i2c_bus  = 1,\n"; $found = 1; print $_ } else { if ($found) { s/^\s+// }; $found = 0; print $_; } }' \
drivers/media/usb/em28xx/em28xx-cards.c >a && mv a drivers/media/usb/em28xx/em28xx-cards.c

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: Prepare to support 2 different I2C buses
Mauro Carvalho Chehab [Tue, 5 Mar 2013 09:55:26 +0000 (06:55 -0300)]
[media] em28xx: Prepare to support 2 different I2C buses

Newer em28xx devices have 2 buses. Change the logic to allow
using both buses.
This patch was generated by this small script:
for i in drivers/media/usb/em28xx/*.c; do
sed 's,->i2c_adap,->i2c_adap[dev->def_i2c_bus],g;s,->i2c_client,->i2c_client[dev->def_i2c_bus],'
done
Of course, em28xx.h needed manual edit.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] media/v4l2: VIDEOBUF2_DMA_CONTIG should depend on HAS_DMA
Geert Uytterhoeven [Mon, 4 Mar 2013 19:52:36 +0000 (16:52 -0300)]
[media] media/v4l2: VIDEOBUF2_DMA_CONTIG should depend on HAS_DMA

m68k/sun3:
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’
Make VIDEOBUF2_DMA_CONTIG and VIDEO_SH_VEU (which selects the former and
doesn't have a platform dependency) depend on HAS_DMA to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] m920x: let GCC see 'ret' is used initialized
Paul Bolle [Mon, 4 Mar 2013 12:43:20 +0000 (09:43 -0300)]
[media] m920x: let GCC see 'ret' is used initialized

Since commit 7543f344e9b06afe86b55a2620f5c11b38bd5642 ("[media] m920x:
factor out a m920x_write_seq() function") building m920x.o triggers this
GCC warning:
    drivers/media/usb/dvb-usb/m920x.c: In function ‘m920x_probe’:
    drivers/media/usb/dvb-usb/m920x.c:91:6: warning: ‘ret’ may be used uninitialized in this function [-Wuninitialized]
This warning is caused by m920x_write_seq(), which is apparently inlined
into m920x_probe(). It is clear why GCC thinks 'ret' may be used
uninitialized. But in practice the first seq->address will always be
non-zero when this function is called. That means we can change the
while()-do{} loop into a do{}-while() loop. And that suffices to make
GCC see that 'ret' will not be used uninitialized.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>