Commit graph

3208 commits

Author SHA1 Message Date
Michael Krufky 6e1ce98df1 [media] dib0700: fix WARNING: suspect code indent for conditional statements
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-21 10:05:00 -03:00
Michael Krufky e3e59b085e [media] dib0700: fix WARNING: please, no spaces at the start of a line
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-21 10:04:48 -03:00
Michael Krufky 1251312a5c [media] mxl111sf: use adap->num_frontends_initialized to determine which frontend is being attached
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-21 10:04:35 -03:00
Antti Palosaari de8e420350 [media] tda10071: NXP TDA10071 DVB-S/S2 driver
NXP TDA10071 DVB-S/S2 demodulator & Conexant CX24118A tuner combo driver

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-21 10:01:16 -03:00
Antti Palosaari 85bc9b510a [media] a8293: Allegro A8293 SEC driver
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-21 09:59:06 -03:00
Mauro Carvalho Chehab 7577911244 Merge tag 'v3.1-rc6' into staging/for_v3.2
* tag 'v3.1-rc6': (1902 commits)
  Linux 3.1-rc6
  ioctl: register LTTng ioctl
  fuse: fix memory leak
  fuse: fix flock breakage
  Btrfs: add dummy extent if dst offset excceeds file end in
  Btrfs: calc file extent num_bytes correctly in file clone
  btrfs: xattr: fix attribute removal
  Btrfs: fix wrong nbytes information of the inode
  Btrfs: fix the file extent gap when doing direct IO
  Btrfs: fix unclosed transaction handle in btrfs_cont_expand
  Btrfs: fix misuse of trans block rsv
  Btrfs: reset to appropriate block rsv after orphan operations
  Btrfs: skip locking if searching the commit root in csum lookup
  btrfs: fix warning in iput for bad-inode
  Btrfs: fix an oops when deleting snapshots
  [media] vp7045: fix buffer setup
  [media] nuvoton-cir: simplify raw IR sample handling
  [media] [Resend] viacam: Don't explode if pci_find_bus() returns NULL
  [media] v4l2: Fix documentation of the codec device controls
  [media] gspca - sonixj: Fix the darkness of sensor om6802 in 320x240
  ...
2011-09-17 10:29:49 -03:00
Florian Mickler fc61ccd35f [media] vp7045: fix buffer setup
dvb_usb_device_init calls the frontend_attach method of this driver which
uses vp7045_usb_ob. In order to have a buffer ready in vp7045_usb_op, it has to
be allocated before that happens.

Luckily we can use the whole private data as the buffer as it gets separately
allocated on the heap via kzalloc in dvb_usb_device_init and is thus apt for
use via usb_control_msg.

This fixes a
	BUG: unable to handle kernel paging request at 0000000000001e78

reported by Tino Keitel and diagnosed by Dan Carpenter.

Cc: stable@kernel.org # For v3.0 and upper
Tested-by: Tino Keitel <tino.keitel@tikei.de>
Signed-off-by: Florian Mickler <florian@mickler.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-11 09:33:41 -03:00
Michael Krufky 2d04c13a50 [media] dvb-usb: improve sanity check of adap->active_fe in dvb_usb_ctrl_feed
The check for (adap->active_fe < 0) at the top of dvb_usb_ctrl_feed is a sanity
check to ensure that adap->active_fe is valid.  Improve that sanity check
by also checking for (adap->active_fe >= adap->num_frontends_initialized)

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-09 15:28:04 -03:00
Michael Krufky 4b5d01e9f6 [media] dvb-usb: fix streaming failure on channel change
This fixes a bug introduced by a previous changeset entitled,
[media] dvb-usb: refactor MFE code for individual streaming config per frontend

As reported by Antti Palosaari, This error is shown by VLC when channel changed:

[0x7f1bbc000cd0] dvb access error: DMXSetFilter: failed with -1 (Invalid argument)
[0x7f1bbc000cd0] dvb access error: DMXSetFilter failed
[0x7f1bbc32f910] main stream error: cannot pre fill buffer

After my own investigations, I've determined that this error case occurs when
the application stops streaming but leaves the frontend and dvr devices open.
A typical example of this usage would be a channel change operation while
watching live television. The error occurs when the application attempts to
stream after tuning to the new channel.

To prevent this error, don't set adap->active_fe to -1 unless the application
closes the device.

Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-09 15:11:55 -03:00
Hans Verkuil 94238e9b19 [media] dvb_frontend: fix compile warning
Andreas Oberritter <obi@linuxtv.org> has looked at this and agreed that it is
safe to remove the 'timeout' variable.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:46:59 -03:00
Hans Verkuil 23aefb7e0e [media] drxd_hard: fix compiler warnings
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:45:43 -03:00
Hans Verkuil 7ed67f15f4 [media] mantis: fix compiler warnings
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:45:20 -03:00
Hans Verkuil db3ca1d5f1 [media] az6027: fix compiler warnings
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:45:02 -03:00
Hans Verkuil 4c04b7a1ad [media] af9005-fe: fix compiler warning
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:43:59 -03:00
Hans Verkuil 2122eaf64a [media] ddbridge: fix compiler warnings
'off' was unused and 'ret' really had to be used to return -EFAULT.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:42:59 -03:00
Michael Krufky 77eed219fe [media] dvb-usb: refactor MFE code for individual streaming config per frontend
refactor MFE code to allow for individual streaming configuration
for each frontend

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:21:42 -03:00
Michael Krufky 4c66c9205c [media] dvb-usb: add ATSC support for the Hauppauge WinTV-Aero-M
Adds new driver, mxl111sf, to support the WinTV-Aero-M

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Reviewed-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-06 14:21:17 -03:00
Edward Sheldrake f8a26f052a [media] drxd: fix divide error
Fix division by zero in drxd triggered by running "femon" before any DVB
tuning has been done (by "scandvb" or anything else).

Signed-off-by: Edward Sheldrake <ejsheldrake@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-04 11:17:11 -03:00
Andreas Oberritter 42f4e774a3 [media] DVB: dvb_frontend: check function pointers on reinitialize
Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-04 10:56:08 -03:00
Joe Perches 44d0b80e5f [media] saa7146: Use current logging styles
Standardize the mechanisms to emit logging messages.

A few other modules used an #include from saa7146,
convert those at the same time.

Add pr_fmt.
Convert printks to pr_<level>
Convert printks without KERN_<level> to appropriate pr_<level>.
Convert logging macros requiring multiple parentheses to normal style.
Removed embedded prefixes when pr_fmt was added.
Whitespace cleanups when around other conversions.
Use printf extension %pM to print mac address.
Coalesce format strings.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Michael Hunold <michael@mihu.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 20:54:14 -03:00
Chris Rankin 0b8bd83cf3 [media] em28xx: don't sleep on disconnect
The DVB framework will try to power-down an adapter that no-one is using
any more, but this assumes that the adapter is still connected to the
machine. That's not always true for a USB adapter, so disable the sleep
operations when the adapter has been physically unplugged.

This prevents I2C write failures with error -19 from appearing
occasionally in the dmesg log.

Signed-off-by: Chris Rankin <rankincj@yahoo.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 20:50:22 -03:00
Andreas Oberritter 674ce34333 [media] DVB: dvb_frontend: remove static assignments from dtv_property_cache_sync()
dtv_property_cache_init().
  dtv_property_process_get().
  overwritten with invalid values, leading to partially incorrect
  results when calling FE_GET_PROPERTY.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 19:06:58 -03:00
Arnaud Lacombe 3f5c14d3d3 [media] drivers/media: do not use EXTRA_CFLAGS
Usage of these flags has been deprecated for nearly 4 years by:

    commit f77bf01425
    Author: Sam Ravnborg <sam@neptun.(none)>
    Date:   Mon Oct 15 22:25:06 2007 +0200

        kbuild: introduce ccflags-y, asflags-y and ldflags-y

Moreover, these flags (at least EXTRA_CFLAGS) have been documented for command
line use. By default, gmake(1) do not override command line setting, so this is
likely to result in build failure or unexpected behavior.

Replace their usage by Kbuild's `{as,cc,ld}flags-y'.

Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: linux-media@vger.kernel.org
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:50:59 -03:00
Dan Carpenter e9013fb6eb [media] ddbridge: fix ddb_ioctl()
There were a several problems in this function:

1) Potential integer overflow in the comparison:
	if (fio.write_len + fio.read_len > 1028) {

2) If the user gave bogus values for write_len and read_len then
   returning -EINVAL is more appropriate than returning -ENOMEM.

3) wbuf was set to the address of an array and could never be NULL
   so I removed the pointless NULL check.

4) The call to vfree(wbuf) was improper.  That array is part of a
   larger struct and isn't allocated by itself.

5) flashio() can't actually fail, but we may as well add error
   handling in case this changes later.

6) In the default case where an ioctl is not implemented then
   returning -ENOTTY is more appropriate than returning -EFAULT.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:23:42 -03:00
Steve Kerrison 0db4bf42ba [media] CXD2820R: Replace i2c message translation with repeater gate control
This patch implements an i2c_gate_ctrl op for the cxd2820r. Thanks to Robert
Schlabbach for identifying the register address and field to set.

The old i2c intercept code that prefixed messages with a passthrough byte has
been removed and the PCTV nanoStick T2 290e entry in em28xx-dvb has been
updated appropriately.

Tested for DVB-T2 use; I would appreciate it if somebody with DVB-C capabilities
could test it as well - from inspection I cannot see any problems.

This is patch v2. It fixes some schoolboy style errors and removes superfluous
i2c entries in cxd2820r.h.

Signed-off-by: Steve Kerrison <steve@stevekerrison.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:13:41 -03:00
Andreas Oberritter 8fc74fdb0f [media] DVB: gp8psk-fe: use SYS_TURBO
Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:07:20 -03:00
Andreas Oberritter 14f55794b2 [media] DVB: dvb_frontend: Fix compatibility criteria for satellite receivers
identify a satellite receiver by its 'delivery_system' instead of
  'modulation', which may overlap between different delivery systems.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:07:18 -03:00
Dan Carpenter 2f098cb1c8 [media] dib9000: return error code on failure
The ret = -EIO needs to be before the goto.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 13:08:20 -03:00
Dan Carpenter 0c61cc3ba4 [media] dib7000p: return error code on allocation failure
The goto needs to be moved after the assignment.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 13:03:52 -03:00
Mauro Carvalho Chehab 8513e14457 [media] dvb-core, tda18271c2dd: define get_if_frequency() callback
Tuners in general convert a high frequency carrier into an Intermediate
Frequency (IF).

Digital tuners like tda18271, xc3028, etc. generally allow changing the IF
frequency, although they generally have recommented settings for the IF.
Analog tuners, have a fixed IF frequency, that depends on the physical
characteristics of some analog components.

For digital tuners, it makes sense to have ways to configure IF,
via the tuner's configuration structure, like what's done inside the
tda18271-fe maps.

The demods need to know what IF is used by the tuner, as it will need
to convert internally from IF into baseband. Currently, the bridge driver
needs to fill a per-demod configuration struct for it, or pass it via
a dvb_attach parameter.

The tda18271 datasheet recommends to use different IF's for different
delivery system types and for different bandwidths.

The DRX-K demod also needs to know the IF frequency in order to work,
just like all other demods. However, as it accepts different delivery
systems (DVB-C and DVB-T), the IF may change if the standard and/or
bandwidth is changed.

So, the usual procedure of passing it via a config struct doesn't work.

One might try to code it as two separate IF frequencies, or even as a
table in function of the delivery system and the bandwidth, but this
will be messy.

So, it is better and simpler to just add a new callback for it and
require the tuners that can be used with MFE frontends like drx-k
to implement a new callback to return the used IF.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Antti Palosaari <crope@iki.fi>
2011-09-03 12:46:33 -03:00
Andreas Oberritter 77b1e2fbbd [media] DVB: dvb_frontend: update locking in dvb_frontend_{add, get_event}
- fepriv->parameters_out isn't protected by events->mtx, so
    move the call to fe->ops.get_frontend out of the locked area.
  - move the assignment of e->status into the locked area.

  - use direct assignment instead of memcpy.

  - use mutex_lock instead of mutex_lock_interruptible, because
    all code paths protected by this mutex won't block.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 08:49:07 -03:00
Andreas Oberritter 20640bea87 [media] DVB: dvb_frontend: clear stale events on FE_SET_FRONTEND
the first event after an attempt to tune.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 08:48:12 -03:00
Andreas Oberritter 5c9f480bdb [media] DVB: dvb_frontend: avoid possible race condition on first event
enqueued before the frontend thread wakes up.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 08:47:33 -03:00
Andreas Oberritter 56ce5ac41a [media] DVB: dvb_frontend: fix stale parameters on initial frontend event
Modify it to use the data given by the user.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 08:46:59 -03:00
Jose Alberto Reguero c9f88aa976 [media] ttusb2: add support for the dvb-t part of CT-3650 v3
Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:44:49 -03:00
Antti Palosaari f68baeff45 [media] af9015: use logic or instead of sum numbers
Style issue.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:43 -03:00
Antti Palosaari 4c0cfa24f7 [media] af9015: map remote for Leadtek WinFast DTV2000DS
Thanks to Thomas Gutzler for reporting this.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: Thomas Gutzler <thomas.gutzler@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:32 -03:00
Julia Lawall eb28dc39d3 [media] drivers/media/dvb/dvb-usb/usb-urb.c: adjust array index
Convert array index from the loop bound to the loop index.

A simplified version of the semantic patch that fixes this problem is as

// <smpl>
@@
expression e1,e2,ar;
@@

for(e1 = 0; e1 < e2; e1++) { <...
  ar[
- e2
+ e1
  ]
  ...> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:15 -03:00
Julian Scheel 93165b7774 [media] Add support for new revision of KNC 1 DVB-C cards. Using tda10024 instead of tda10023, which is compatible to tda10023 driver
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 10:41:46 -03:00
Malcolm Priestley f6d8735493 [media] it913x: Driver for Kworld UB499-2T (id 1b80:e409) v1.05
Driver for Kworld UB499-2T (id 1b80:e409)

The device driver has been named it913x, so that support for other family members
can be added later.

TODOs
Firmware support for other it913x devices.
Remote control support, there are two known types.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
[mchehab@redhat.com: Fix a merge conflict]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 10:35:21 -03:00
Malcolm Priestley 3dbbf82f49 [media] it913x_fe: frontend and tuner driver v1.05
Fronted and Tuner Driver for ITE IT913x Series with inital support for
IT9137 integrated demodulator and tuner device.

The driver is loosely based on AF9035 series. However, support is not intended for
this device specificity.

The IT9137 tuner has been tested on UHF bands, but VHF has only been simulated.

Possible TODO the tuner sections may be separated from the main driver. All future devices
should use the it913x_fe_script_loader for other tuner devices.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
[mchehab@redhat.com: Fix an issue at the Kconfig help]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 10:29:20 -03:00
Doron Cohen ea3709435c [media] siano: apply debug flag to module level
Siano modules already had sms_dbg flag which is a module parameter which
sets the debug mode so module prints messages to dmesg for debugging.
The variable was static therefore apply only to the file which defines
the module. In modules as smsmdtv.ko that contain a few files, the debug
flag applied only for functions in that main file.
flag was changed to be non-static and therefore can be accessed by all
module files (although it is still not exported out of the module).

Signed-off-by: Doron Cohen <doronc@siano-ms.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 09:56:06 -03:00
Jiri Pirko afc4b13df1 net: remove use of ndo_set_multicast_list in drivers
replace it by ndo_set_rx_mode

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-17 20:22:03 -07:00
Olivier Grenie 680417bb31 [media] dib0700: correct error message
The goal of this patch is to correct a previous patch. In case of error,
the err() function should be used instead of dprintk() function.

[mchehab@redhat.com: as I've replaced dprintk by deb_info, on the the
 previous patch, to avoid breaking bisect, I had to fix a merge conflict
 on this one]
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 09:40:09 -03:00
Olivier Grenie bff469f416 [media] dib0700: protect the dib0700 buffer access
This patch protects the common buffer access inside the dib0700 in order
to manage concurrent access. This protection is done using mutex.

Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Florian Mickler <florian@mickler.org>
Cc: stable@kernel.org
Signed-off-by: Javier Marcet <javier@marcet.info>
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
[mchehab@redhat.com: dprint requires 3 arguments. Replaced by dib_info]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 09:31:36 -03:00
Patrick Boettcher 79fcce3230 [media] DiBcom: protect the I2C bufer access
This patch protects the I2C buffer access in order to manage concurrent
access. This protection is done using mutex.
Furthermore, for the dib9000, if a pid filtering command is
received during the tuning, this pid filtering command is delayed to
avoid any concurrent access issue.

Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Florian Mickler <florian@mickler.org>
Cc: stable@kernel.org
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <Patrick.Boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 09:25:15 -03:00
Antti Palosaari 449d1a0ad1 [media] anysee: use multi-frontend (MFE)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 01:42:40 -03:00
Antti Palosaari 9bd9e3bd2c [media] dvb-usb: multi-frontend support (MFE)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 01:41:32 -03:00
Antti Palosaari bfd4500c9a [media] dvb-usb: prepare for multi-frontend support (MFE)
Change adapter FE pointer as array of FE pointers.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 01:26:41 -03:00
Linus Torvalds 664a41b8a9 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (430 commits)
  [media] ir-mce_kbd-decoder: include module.h for its facilities
  [media] ov5642: include module.h for its facilities
  [media] em28xx: Fix DVB-C maxsize for em2884
  [media] tda18271c2dd: Fix saw filter configuration for DVB-C @6MHz
  [media] v4l: mt9v032: Fix Bayer pattern
  [media] V4L: mt9m111: rewrite set_pixfmt
  [media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear
  [media] V4L: initial driver for ov5642 CMOS sensor
  [media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails
  [media] V4L: soc-camera: remove soc-camera bus and devices on it
  [media] V4L: soc-camera: un-export the soc-camera bus
  [media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier
  [media] V4L: add media bus configuration subdev operations
  [media] V4L: soc-camera: group struct field initialisations together
  [media] V4L: soc-camera: remove now unused soc-camera specific PM hooks
  [media] V4L: pxa-camera: switch to using standard PM hooks
  [media] NetUP Dual DVB-T/C CI RF: force card hardware revision by module param
  [media] Don't OOPS if videobuf_dvb_get_frontend return NULL
  [media] NetUP Dual DVB-T/C CI RF: load firmware according card revision
  [media] omap3isp: Support configurable HS/VS polarities
  ...

Fix up conflicts:
 - arch/arm/mach-omap2/board-rx51-peripherals.c:
     cleanup regulator supply definitions in mach-omap2
   vs
     OMAP3: RX-51: define vdds_csib regulator supply
 - drivers/staging/tm6000/tm6000-alsa.c (trivial)
2011-07-30 00:08:53 -07:00
Mauro Carvalho Chehab cf845297d5 [media] tda18271c2dd: Fix saw filter configuration for DVB-C @6MHz
Currently, the driver assumes that all QAM carriers are spaced with
8MHz. This is wrong, and may decrease QoS on Countries like Brazil,
that have DVB-C carriers with 6MHz-spaced.

Fortunately, both ITU-T J-83 and EN 300 429 specifies a way to
associate the symbol rate with the bandwidth needed for it.

For ITU-T J-83 2007 annex A, the maximum symbol rate for 6 MHz is:
	6 MHz / 1.15 = 5217391 Bauds
For  ITU-T J-83 2007 annex C, the maximum symbol rate for 6 MHz is:
	6 MHz / 1.13 = 5309735 Bauds.

As this tuner is currently used only for DRX-K, and it is currently
hard-coded to annex A, I've opted to use the roll-off factor of 0.15,
instead of 0.13.

If we ever support annex C, the better would be to add a DVB S2API
call to allow changing between Annex A and C, and add the 0.13 roll-off
factor to it.

This code is currently being used on other frontends, so I think we
should later add a core function with this code, to warrant that
it will be properly implemented everywhere.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-28 17:09:46 -03:00
Devin Heitmueller d749fb663e [media] au8522: set signal field to 100% when signal present
The signal state field in G_TUNER is typically scaled from 0-100%.  Since we
don't know the signal level, we really would prefer the field to contain 100%
than 1/256, which in many utilities (such as v4l2-ctl) rounds to 0% even when
a signal is actually present.

This patch makes the behavior consistent with other drivers.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:05 -03:00
Mauro Carvalho Chehab 119faf90ed [media] drxk: Fix the logic that selects between DVB-C annex A and C
Fix the DRX-K logic that selects between DVB-C annex A and C

Fix a typo where DVB-C annex type is set via setEnvParameters, but
the driver, uses, instead, setParamParameters[2].

While here, cleans up the code, fixing a bad identation at the fallback
code for other types of firmware, and put the multiple-line comments
into the Linux CodingStyle.

Acked-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:04 -03:00
Mauro Carvalho Chehab f07a0bc111 [media] drxk: Fix read debug message
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:03 -03:00
Mauro Carvalho Chehab e716adacef [media] drxk: Fix error return code during drxk init
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:03 -03:00
Mauro Carvalho Chehab ab12f41f62 [media] drxk: Remove goto/break after return
After return, we don't need any other statement to change the
function flux ;)

Reported-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:03 -03:00
Mauro Carvalho Chehab 320ed23ebf [media] drxk: Fix a bug at some switches that broke DVB-T
The error propagation changeset c23bf4402 broke the DVB-T
code.

The legacy way for propagate errors was:

do {
	status = foo_func()
	if (status < 0)
		break;
} while (0);
return status;

However, on a few places, it was doing:
do {
	switch(foo) {
	case bar:
		status = foo_func()
		if (status < 0)
			break;
		break;
	}
	switch(foo2) {
	case bar:
		status = foo_func()
		if (status < 0)
			break;
		break;
	}
	...
} while (0);
return (status)

The inner error break were not working, as it were breaking only
the switch, instead of the do. The solution used were to do a
s/break/goto error/ at the inner breaks, but preserving the last
break. Onfortunately, on a few switches, the replacement were
applied also to the final break for the case statements.

Fix the broken logic, by reverting them to break, where pertinent,
in order to fix DVB-T support.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:03 -03:00
Mauro Carvalho Chehab c4c3a3d32a [media] Remove the double symbol increment hack from drxk_hard
Both ngene and ddbrige calls dvb_attach once for drxk_attach.
The logic used there, and by tda18271c2dd driver is different
from similar logic on other frontends.

The right fix is to change them to use the same logic, but,
while we don't do that, we need to patch em28xx-dvb in order
to do cope with ngene/ddbridge magic.

While here, document why drxk_t_release should do nothing.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:03 -03:00
Mauro Carvalho Chehab 106ff9e013 Revert "[media] DVB: dvb_frontend: off by one in dtv_property_dump()"
This reverts commit a3e4adf274f86b2363fedaa964297cb38526cef0.

As pointed by Andread Oberritter <obi@linuxtv.org>:

	That's wrong, because the array size is DTV_MAX_COMMAND + 1.
	Using the ARRAY_SIZE macro instead might reduce the confusion.

Also, changeset 3995223038 already fixed this issue.

Reported-by: Andread Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:02 -03:00
Emilio David Diaus Lopez a062d04bb9 [media] af9015: add support for Sveon STV22 [1b80:e401]
Signed-off-by: Emilio David Diaus Lopez <reality_es@yahoo.es>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:58 -03:00
Antti Palosaari 713d9b5d98 [media] af9015: remove 2nd I2C-adapter
It is useless. There is only one physical I2C-adapter.

2nd adapter was added originally due to some plans for allowing only one
demod to access bus at time. But I never implemented proper locking...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:58 -03:00
Antti Palosaari 3509cbdfac [media] af9015: remove old FW based IR polling code
Remove old code which is not used anymore since IR code is read
directly from memory nowadays.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:58 -03:00
Antti Palosaari 709d92083a [media] af9015: add more I2C msg checks
Return EOPNOTSUPP for too long messages.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:57 -03:00
Antti Palosaari 16b2dc2a8b [media] af9015: small optimization
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:57 -03:00
Antti Palosaari ae81aab3fa [media] af9015: map remote for MSI DIGIVOX Duo
Reported-by: Jacek M. Holeczek <jacek.m.holeczek@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:56 -03:00
Juergen Lock 879b0d7957 [media] af9015: setup rc keytable for LC-Power LC-USB-DVBT
That's this tuner:

The credit card sized remote more or less works if I set remote=4,
so I added the hash to get it autodetected.  (`more or less' there
meaning sometimes buttons are `stuck on repeat', i.e. ir-keytable -t
keeps repeating the same scancode until i press another button.)

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:56 -03:00
Jesper Juhl 8afe9119e2 [media] media, Micronas dvb-t: Fix mem leaks, don't needlessly zero mem, fix spelling
In drivers/media/dvb/frontends/drxd_hard.c::load_firmware() I see 3
small issues:

 1) When the 'fw' variable goes out of scope we'll leak the memory
 allocated to it by request_firmware() by neglecting to call
 release_firmware().

 2) After a successful request_firmware() we allocate fw->size bytes
 of memory using kzalloc() only to immediately overwrite all that
 memory with memcpy(), so asking for zeroed memory seems like wasted
 effort - just use kmalloc().

 3) In one of the error messages "no memory" lacks a space and is
 written as "nomemory".

This patch fixes all 3 issues.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:56 -03:00
Dan Carpenter bca3ba7904 [media] DVB: dvb_frontend: off by one in dtv_property_dump()
If the tvp->cmd == DTV_MAX_COMMAND then we read past the end of the
array.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:55 -03:00
Mauro Carvalho Chehab 01434faf6d tda18271c2dd: Fix compilation when module is not selected
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:53 -03:00
Mauro Carvalho Chehab ea4d03d138 [media] tda18271c2dd.h: Don't add the same symbol twice
Should be folded with the next patch when sending upstream

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:52 -03:00
Mauro Carvalho Chehab fd0b0814a4 [media] dvb: don't cause missing symbols for drxk/tda18271c2dd
If those demods are unselected, but a bridge driver requires them,
produce a runtime message, instead of missing symbols.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:52 -03:00
Mauro Carvalho Chehab f165f60d42 [media] drxk: remove a now unused variable
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:51 -03:00
Mauro Carvalho Chehab 5eee2bb270 [media] drxk: Add a fallback method for QAM parameter setting
The QAM standard is set using this scu_command:
	SCU_RAM_COMMAND_STANDARD_QAM |
	SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM

The driver implements a version that has 4 parameters, however,
Terratec H5 needs to break this into two separate commands, otherwise,
DVB-C doesn't work.

With this fix, scan is now properly working and getting the
channel list:
>>> tune to: 609000000:INVERSION_AUTO:5217000:FEC_3_4:QAM_256
>>> tuning status == 0x00
>>> tuning status == 0x07
>>> tuning status == 0x1f

0x0093 0x0026: pmt_pid 0x0758 (null) -- SporTV2 (running, scrambled)
0x0093 0x0027: pmt_pid 0x0748 (null) -- SporTV (running, scrambled)
0x0093 0x0036: pmt_pid 0x0768 (null) -- FX (running, scrambled)
0x0093 0x0052: pmt_pid 0x0788 (null) -- The History Channel (running, scrambled)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:51 -03:00
Mauro Carvalho Chehab 7558977a4a [media] drxk: Improve the scu_command error message
Now, it outputs:

[10927.639641] drxk: SCU_RESULT_INVPAR while sending cmd 0x0203 with params:
[10927.646283] drxk: 02 00 00 00 10 00 07 00 03 02                    ..........

Better than ERROR -3. This happens with Terratec H5 firmware.

It adds 2 new error conditions, and something useful to track
what the heck is that.

I suspect that the scu_command is dependent on the firmware
revision.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:51 -03:00
Mauro Carvalho Chehab f1b829704c [media] drxk: Simplify the DVB-C set mode logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab cf694b141e [media] drxk: Fix driver removal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab 90796acad0 [media] drxk: Improves the UIO handling
The driver is too limited: it assumes that UIO is used only for
controlling the antenna, and that only UIO-1 is in usage. However,
from Terratec H7 driver [1], 3 UIO's can be used. In fact, it seems
that H7 needs to use all 3. So, make the code generic enough to handle
the most complex scenario. For now, only antena GPIO can be specified,
but is is easier now to add the other GPIO/UIO needs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab 9c6e182800 [media] drxk: Print detected configuration
DRX-K configuration is interesting when writing/testing
new devices. Add an info line showing the discovered info.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab 147e110bb6 [media] drxk: Fix the antenna switch logic
Terratec H5 doesn't require to switch mode, but generates
an error due to this logic. Also, GPIO's are board-dependent.

So, add it at the board config struct.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab d6a0540577 [media] drxk: change mode before calling the set mode routines
The set mode routines assume that state were changed to the
new mode, otherwise, they'll fail.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab be44eb283b [media] drxk: Proper handle/propagate the error codes
This driver is very big and complex. An error happening in the middle
of any initialization may cause the frontend to not work. So, it
needs to properly propagate error codes internally and to userspace.

Also, printing the error codes at the places it happened helps to
discover were's a bug at the code.

Before this change, a do { } while (0) loop and lots of breaks inside
were used to propagate errors. While this works, if there are
loops inside other loops, it could be easy to forget to add another
break, causing the error to not abort the function.

Also, as not all functions were reporting errors, it is hard to
discover why something failed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:49 -03:00
Mauro Carvalho Chehab f1fe1b75d6 [media] drxk: Allow to disable I2C Bridge control switch
On em28xx, tda18271C2 is accessible when the i2c port
is not touched. Touching on it breaks the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:49 -03:00
Mauro Carvalho Chehab e4f4f8758b [media] drxk: Add a parameter for the microcode name
The microcode firmware provided on Terratec H5 seems to be
different. Add a parameter to allow specifying a different
firmware per-device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:49 -03:00
Mauro Carvalho Chehab 39624f7ee8 [media] drxk: Print an error if firmware is not loaded
If something bad happens during firmware load, an error
should be printed at dmesg.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:49 -03:00
Mauro Carvalho Chehab bcd2ebb760 [media] drxk: Avoid OOPSes if firmware is corrupted
Don't read paste the buffer, if the firmware is corrupted.
Instead, print an error message.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab e076c92ed6 [media] drxk: Convert an #ifdef logic as a new config parameter
Instead of using #ifdef I2C_LONG_ADR for some devices, convert
it into a parameter. Terratec H5 logs from the original driver
seems to need this mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab 0fc55e81d3 [media] drxk: Move I2C address into a config structure
Currently, the only parameter to be configured is the I2C
address. However, Terratec H5 logs shows that it needs a different
setting for some things, and it has its own firmware.

So, move the addr into a config structure, in order to allow adding
the required configuration bits.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab 5e66b87840 [media] drxk: remove _0 from read/write routines
The normal 16-bits read routine is called as "Read16_0". This is
due to a flags that could optionally be passed. Yet, on no places
at the code, a flag is passed there.

The same happens with 16-bits write and 32-read/write routines,
and with WriteBlock.

Also, using flags, is an exception: there's no place currently using
flags, except for an #ifdef at WriteBlock.

Rename the function as just "read16", and the one that requires flags,
as "read16_flags".

This helps to see where the flags are used, and also avoid using
CamelCase on Kernel.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab 2da6750117 [media] drxk: Add debug printk's
This is a complex driver. Adding support for other devices with drxk
requires to be able to debug it and see where it is failing. So, add
optional printk messages to allow debugging it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab f3d40bd099 [media] tda18271c2dd: add tda18271c2dd prefix to the errors
It is hard to identify the origin for those errors without a
prefix to indicate which driver produced them:

[ 1390.220984] i2c_write error
[ 1390.224133] I2C Write error
[ 1391.284202] i2c_read error
[ 1392.288685] i2c_read error

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab e0e6ecaf3b [media] drxk: add drxk prefix to the errors
It is hard to identify the origin for those errors without a
prefix to indicate which driver produced them:

[ 1390.220984] i2c_write error
[ 1390.224133] I2C Write error
[ 1391.284202] i2c_read error
[ 1392.288685] i2c_read error

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:47 -03:00
Mauro Carvalho Chehab 28d45a5d29 [media] ddbridge: use linux/io.h, instead of asm/io.h
WARNING: Use #include <linux/io.h> instead of <asm/io.h>
+#include <asm/io.h>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:46 -03:00
Mauro Carvalho Chehab 805e687434 [media] ddbridge: Avoid duplicated symbol definition
drivers/media/dvb/ddbridge/built-in.o: In function `my_dvb_dmx_ts_card_init':
/home/v4l/v4l/patchwork/drivers/media/dvb/ddbridge/ddbridge-core.c:718: multiple definition of `my_dvb_dmx_ts_card_init'
drivers/media/dvb/ngene/built-in.o:/home/v4l/v4l/patchwork/drivers/media/dvb/ngene/ngene-dvb.c:227: first defined here
drivers/media/dvb/ddbridge/built-in.o: In function `my_dvb_dmxdev_ts_card_init':
/home/v4l/v4l/patchwork/drivers/media/dvb/ddbridge/ddbridge-core.c:737: multiple definition of `my_dvb_dmxdev_ts_card_init'
drivers/media/dvb/ngene/built-in.o:/home/v4l/v4l/patchwork/drivers/media/dvb/ngene/ngene-dvb.c:246: first defined here

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:46 -03:00
Oliver Endriss f876502d9a [media] ddbridge: Allow compiling of the driver
Driver added to Makefile and Kconfig.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:45 -03:00
Oliver Endriss 4f1f310787 [media] ddbridge: Codingstyle fixes
Codingstyle fixes

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:45 -03:00
Ralph Metzler ccad04578f [media] ddbridge: Initial check-in
Driver support for Digital Devices ddbridge-based cards:
Octopus, Octopus mini, Octopus LE, cineS2(v6)
with DuoFlex S2 and/or DuoFlex CT tuners.

Driver was taken from ddbridge-0.6.1.tar.bz2.

Signed-off-by: Ralph Metzler <rmetzler@digitaldevices.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:45 -03:00
Mauro Carvalho Chehab 1bd09ddcff [media] drxk: fix warning: ‘status’ may be used uninitialized in this function
One of the problems of the old CHECK_ERROR is that it was hiding
the status parameter. Maybe due to that, on a few places, the return
code might lead to return incorrect status:

drivers/media/dvb/frontends/drxk_hard.c: In function ‘load_microcode.clone.0’:
drivers/media/dvb/frontends/drxk_hard.c:1281: warning: ‘status’ may be used uninitialized in this function
drivers/media/dvb/frontends/drxk_hard.c:1281: note: ‘status’ was declared here
drivers/media/dvb/frontends/drxk_hard.c: In function ‘GetLockStatus’:
drivers/media/dvb/frontends/drxk_hard.c:1792: warning: ‘status’ may be used uninitialized in this function
drivers/media/dvb/frontends/drxk_hard.c: In function ‘Start.clone.7’:
drivers/media/dvb/frontends/drxk_hard.c:1734: warning: ‘status’ may be used uninitialized in this function

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:45 -03:00
Mauro Carvalho Chehab e16cede5a8 [media] drxk: Return -EINVAL if an invalid bandwidth is used
drivers/media/dvb/frontends/drxk_hard.c: In function ‘SetDVBT’:
drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_5_MHZ’ not handled in switch
drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_10_MHZ’ not handled in switch
drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_1_712_MHZ’ not handled in switch

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:45 -03:00
Mauro Carvalho Chehab 469ffe0836 [media] tda18271c2dd: Remove the CHK_ERROR macro
The CHK_ERROR macro does a flow control, violating chapter 12
of the Documentation/CodingStyle. Doing flow controls inside
macros is a bad idea, as it hides what's happening. It also
hides the var "status" with is also a bad idea.

The changes were done by this small perl script:
	my $blk=0;
	while (<>) {
		s/^\s+// if ($blk);
		$f =~ s/\s+$// if ($blk && /^\(/);
		$blk = 1 if (!m/\#/ && m/CHK_ERROR/);
		$blk=0 if ($blk && m/\;/);
		s/\n/ / if ($blk);
		$f.=$_;
	};
	$f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;([^\n]*),\n\1status = \2;\3\n\1if (status < 0)\n\1\tbreak;,g;

	print $f;

And manually fixed.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:44 -03:00
Mauro Carvalho Chehab ea90f011fd [media] drxk: Remove the CHK_ERROR macro
The CHK_ERROR macro does a flow control, violating chapter 12
of the Documentation/CodingStyle. Doing flow controls inside
macros is a bad idea, as it hides what's happening. It also
hides the var "status" with is also a bad idea.

The changes were done by this small perl script:
	my $blk=0;
	while (<>) {
		s /^\s+// if ($blk);
		$f =~ s/\s+$// if ($blk && /^\(/);
		$blk = 1 if (!m/\#/ && m/CHK_ERROR/);
		$blk=0 if ($blk && m/\;/);
		s/\n/ / if ($blk);
		$f.=$_;
	};
	$f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;([^\n]*),\n\1status = \2;\3\n\1if (status < 0)\n\1\tbreak;,g;
	print $f;

And manually fixed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:44 -03:00