Joe Perches [Sun, 21 Aug 2011 22:56:50 +0000 (19:56 -0300)]
[media] et61x251: Use current logging styles
Add pr_fmt and convert printks to pr_<level>
Remove explicit prefixes from logging messages.
One of the prefixes was defective, a copy/paste error.
Use ##__VA_ARGS__ for variadic macros.
Whitespace neatening.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Joe Perches [Sun, 21 Aug 2011 22:56:48 +0000 (19:56 -0300)]
[media] bt8xx: Use current logging styles
This converts some messages that were emitted at
KERN_INFO to KERN_DEBUG. All of these messages
were guarded by bttv_debug tests.
Add pr_fmt.
Convert printks to pr_<level>
Convert printks without KERN_<level> to appropriate pr_<level>.
Removed embedded prefixes when pr_fmt was added.
Whitespace cleanups when around other conversions.
Macros coded with if statements should be do { if... } while (0)
so the macros can be used in other if tests.
Use ##__VA_ARGS__ for variadic macro as well.
Coalesce format strings.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Joe Perches [Sun, 21 Aug 2011 22:56:44 +0000 (19:56 -0300)]
[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>
Chris Rankin [Sat, 20 Aug 2011 19:01:26 +0000 (16:01 -0300)]
[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>
Chris Rankin [Sat, 20 Aug 2011 11:28:17 +0000 (08:28 -0300)]
[media] em28xx: clean up resources should init fail
This patch ensures that the em28xx_init_dev() function cleans up after itself,
in the event that it fails. This isimportant because the struct em28xx will be
deallocated if em28xx_init_dev() returns an error.
[mchehab@redhat.com: Fix merge conflicts and simplify the goto labels] Signed-off-by: Chris Rankin <rankincj@yahoo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Chris Rankin [Sat, 20 Aug 2011 11:21:03 +0000 (08:21 -0300)]
[media] em28xx: use atomic bit operations for devices-in-use mask
Use atomic bit operations for the em28xx_devused mask, to prevent an
unlikely race condition should two adapters be plugged in
simultaneously. The operations also clearer than explicit bit
manipulation anyway.
Signed-off-by: Chris Rankin <rankincj@yahoo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[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>
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'.
Chris Rankin [Sun, 14 Aug 2011 12:18:46 +0000 (09:18 -0300)]
[media] Add missing OK key to PCTV IR keymap
Hi,
The following patch adds the IR code for the missing "OK" key to the Pinnacle
PCTV HD map. This map is now used by the PCTV 290e DVB-T2 device, whose remote
control has 26 buttons.
Steve Kerrison [Tue, 9 Aug 2011 10:16:21 +0000 (07:16 -0300)]
[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>
[media] DVB: improve documentation for satellite delivery systems
- Move voltage and tone to DVB-S.
- Add turbo code.
- In DVB-S2 and turbo code sections, refer to DVB-S, as both
are extensions to DVB-S.
- Add modulation to DVB-S2.
Signed-off-by: Andreas Oberritter <obi@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>
Jarod Wilson [Thu, 14 Jul 2011 22:06:08 +0000 (19:06 -0300)]
[media] em28xx: add em28xx_ prefix to functions
Makes it more straight-forward to follow stack traces if the functions
don't have generic names. Using this as a crutch while trying to better
understand the lockdep warnings I get when loading the em28xx driver.
Jonathan Corbet [Thu, 14 Jul 2011 21:10:44 +0000 (18:10 -0300)]
[media] videobuf2: Do not unconditionally map S/G buffers into kernel space
The one in-tree videobuf2-dma-sg driver (mmp-camera) has no need for a
kernel-space mapping of the buffers; one suspects that most other drivers
would not either. The videobuf2-dma-sg module does the right thing if
buf->vaddr == NULL - it maps the buffer on demand if somebody needs it. So
let's not map the buffer at allocation time; that will save a little CPU
time and a lot of address space in the vmalloc range.
Signed-off-by: Jonathan Corbet <corbet@lwn.net> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[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>
The dev->int_in USB interfaces is used by some devices for the
Remote Controller. Not all devices seem to define this interface,
so, tm6000_reset should not try to set the interface to it on
such devices.
Thierry Reding [Thu, 4 Aug 2011 07:14:11 +0000 (04:14 -0300)]
[media] tm6000: Properly count device usage
When the USB device is disconnected, the device usage bit is not cleared
properly. This leads to errors when a device is unplugged and replugged
several times until all TM6000_MAXBOARDS bits are used and keeps the
driver from binding to the device.
Thierry Reding [Thu, 4 Aug 2011 07:14:10 +0000 (04:14 -0300)]
[media] tm6000: Add locking for USB transfers
This commit introduces the usb_lock mutex to ensure that a USB request
always gets the proper response. While this is currently not really
necessary it will become important as there are more users.
Thierry Reding [Thu, 4 Aug 2011 07:14:09 +0000 (04:14 -0300)]
[media] tm6000: Rework standard register tables
This commit uses sentinel entries to terminate the TV standard register
tables instead of hard-coding their size, allowing further entries to be
added more easily. It is also more space-efficient if the tables have a
varying number of entries.
Thierry Reding [Thu, 4 Aug 2011 07:14:08 +0000 (04:14 -0300)]
[media] tm6000: Disable video interface in radio mode
Video data is useless in radio mode, so the corresponding interface can
be safely disabled. This should reduce the amount of isochronous traffic
noticeably.
[media] tuner/xc2028: Fix frequency offset for radio mode
In radio mode, no frequency offset should be used.
Instead of taking Thierry's patch that creates a separate function
to calculate the digital offset, it seemed better to just keep
everything at the same place.
Thierry Reding [Thu, 4 Aug 2011 07:13:59 +0000 (04:13 -0300)]
[media] tuner/xc2028: Add I2C flush callback
When loading the firmware, complete each chunk by sending an I2C flush
command to the frontend. Some devices like the tm6000 seem to require
this to properly flush the I2C buffers.
The current code in tm6000 executes the flush command once after each
I2C transfer, which slows down the firmware loading especially when
loading large BASE type images.
Sakari Ailus [Wed, 15 Jun 2011 18:58:48 +0000 (15:58 -0300)]
[media] omap3isp: ccdc: Use generic frame sync event instead of private HS_VS event
The ccdc block in the omap3isp produces events whenever it starts receiving
a new frame. A private HS_VS event was used for this previously. Now, the
generic V4L2_EVENT_FRAME_SYNC event is being used for the purpose.
This patch also provides the frame sequence number to user space.
[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>
This patch reduces the number of available choices for the notch filter type control
so that the standard-specific filter types cannot be selected. It is now limited to
being either 0 (4xFsc, the default) or 1 (square pixel optimized).
The patch also removes the initialization of this control from cx88_reset(), since
that is already done by init_controls(), which is called by cx8800_initdev().
[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>
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).
Matches up perfectly with the table in Microsoft's docs.
Of course, I've noticed on one of my devices that the MS-recommended
default value of 1 for carrier pre-scaler and 66 for carrier period was
butchered, and instead of converting 66 to hex (0x42 like above), they
put in 0x66, so the hardware reports a default carrier of 24390Hz.
Fortunately, I guess, this particular device is rx-only, but I wouldn't
put it past other hw to screw up here too.
Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Mon, 18 Jul 2011 19:54:26 +0000 (16:54 -0300)]
[media] mceusb: get misc port data from hardware
According to the specs, you can read the number of tx ports, number of
rx sensors, which tx ports have cables plugged into them, and which rx
sensors are active. In practice, most of my devices do seem to report
sane values for tx ports and rx sensors (but not all -- one without any
tx ports reports having them), and most report the active sensor
correctly, but only one of eight reports cabled tx ports correctly. So
for the most part, this is just for informational purposes.
Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Mon, 18 Jul 2011 19:54:25 +0000 (16:54 -0300)]
[media] mceusb: query device for firmware emulator version
Supposedly, there are essentially three different classes of devices
that are compatible with Microsoft's specs. First are the "legacy"
devices, which are built using Microsoft-provided hardware specs and
firmware. Second are "emulator" devices, which are built using custom
hardware and firmware, written to emulate Microsoft's firmware. Third
are "port" devices, which have their own device driver and firmware,
which provides compatible data to higher levels of the stack.
>From what I can tell, things like nuvoton-cir and fintek-cir are
essentially "port" devices -- their raw IR buffer format is very similar
to that of the mceusb devices. Now, within the mceusb driver, we have
three different "generations", which at first, seemed like maybe they
mapped to emulator versions. Unfortuantely, every single device I have
responds "illegal command" to the query to get firmware emulator version
from the hardware, which means they're either all emulator version 1, or
they're legacy devices, and our different "generations" aren't at all
related here. Though in theory, its possible the gen1 devices are
"legacy" devices and the rest are emulator v1. There are some useful
features of the v2 interface I was hoping to play with, but alas...
Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Mon, 18 Jul 2011 19:54:24 +0000 (16:54 -0300)]
[media] mceusb: issue device resume cmd when needed
According to MS docs, the device firmware may halt after receiving an
unknown instruction, but that it should be possible to tell the firmware
to continue running by simply sending a device resume command. So lets
do that.
Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Mon, 18 Jul 2011 19:54:23 +0000 (16:54 -0300)]
[media] mceusb: set wakeup bits for IR-based resume
Its not uncommon for folks to force these bits enabled, because people
do want to wake their htpc kit via their remote. Lets just set the bits
for 'em.
Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Mon, 18 Jul 2011 19:54:22 +0000 (16:54 -0300)]
[media] mceusb: give hardware time to reply to cmds
Sometimes the init routine is blasting commands out to the hardware
faster than it can reply. Throw a brief delay in there to give the
hardware a chance to reply before we send the next command.
Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Mon, 18 Jul 2011 19:54:21 +0000 (16:54 -0300)]
[media] mceusb: command/response updates from MS docs
I was recently pointed to the document titled
Windows-Media-Center-RC-IR-Collection-Green-Button-Specification-03-08-2011-V2.pdf
which as of this writing, is publicly available from
download.microsoft.com. It covers a LOT of the gaps in the mceusb
driver, which to this point, was written almost entirely by
reverse-engineering. First up, I'm updating the defines for all the MCE
commands and responses to match their names in the spec. More to come...
Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] tda827x: improve recection with limit frequencies
tda827x is currently taking the demod IF frequency into account while
seeking for the proper tuner range. This is wrong, as the demod IF
frequency has nothing to do with the tuner PLL.
Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
When migrating from Slackware 13.1 to 13.37 (kernel 2.6.33.x to
2.6.37.6), there was some sort of regression with the external webcam
installed at the notebook (0x45:6128, SN9C325+OM6802).
In the version 2.6.37.6, the images got *very* dark, making the webcam
almost unusable, unless if used with direct sunlight.
Tracing back what happened, I concluded that changeset 0e4d413af
caused some sort of odd effects - including this - to this specific model.
Jarod Wilson [Thu, 14 Jul 2011 17:20:46 +0000 (14:20 -0300)]
[media] imon: rate-limit send_packet spew
There are folks with flaky imon hardware out there that doesn't always
respond to requests to write to their displays for some reason, which
can flood logs quickly when something like lcdproc is trying to
constantly update the display, so lets rate-limit all that error spew.
Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Ming Lei [Sat, 16 Jul 2011 03:51:00 +0000 (00:51 -0300)]
[media] uvcvideo: Set alternate setting 0 on resume if the bus has been reset
If the bus has been reset on resume, set the alternate setting to 0.
This should be the default value, but some devices crash or otherwise
misbehave if they don't receive a SET_INTERFACE request before any other
video control request.
Microdia's 0c45:6437 camera has been found to require this change or it
will stop sending video data after resume.
uvc_video.c]
Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: stable@kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] tuner_xc2028: Allow selection of the frequency adjustment code for XC3028
This device is not using the proper demod IF. Instead of using the
IF macro, it is specifying a IF frequency. This doesn't work, as xc3028
needs to load an specific SCODE for the tuner. In this case, there's
no IF table for 5 MHz.