kobject_init_and_add will alloc memory for kobj->name, so in br_add_if
error path, simply use kobject_del will not free memory for kobj->name.
Fix by using kobject_put instead, kobject_put will internally calls
kobject_del and frees memory for kobj->name.
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Andrea Gallo <andrea.gallo@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
The use of a static buffer in rose2asc() to return its result is not
threadproof and can result in corruption if multiple threads are trying
to use one of the procfs files based on rose2asc().
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
io[i] is read before the bounds check on i, order should be reversed
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
io[i] is read before the bounds check on i, order should be reversed
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
loop bound looks to be wrong, for an array of length 8
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
phy_idx is checked to be < 4, but np->phys[] is 2 elements long
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
* fix/hda:
ALSA: hda - Fix mute control with some ALC262 models
ALSA: hda - Restore GPIO1 properly at resume with AD1984A
ALSA: hda - Use snprintf() to be safer
If trace_printk_on_oops is set we lose interesting trace information
when the tracer is enabled across oops handling and printing. We want
the trace which might give us information _WHY_ we oopsed.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
When enabling debug with v4l_debug set to 2 or greater, the driver
OOPS's on startup. Checks dev pointer before dereferencing, in
order to prevent this OOPS.
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
IOCTLS will never get handled if we dont connect
video_ioctl2 to mpeg_fops.ioctl
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Both tvaudio and the tuner share i2c address 0x42. The tvaudio module can
check whether it really is a tda9840, but the tuner can't. So the tvaudio
module must be loaded before the tuner module. This was also the case for
2.6.29, but the order was swapped in 2.6.30.
Thanks to Krzysztof Grygiencz for reporting and testing this.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
A recent patch didn't take into account that frontends can be compiled into
the kernel. Or that frontends compiled as modules can't be used by the
b2c2 driver if it is not a module itself.
Some frontends require multiple drivers, e.g. a demod driver and a tuner
driver. The code for the frontend support was getting added if the demod
driver was available. Change this to also require any needed tuner or SEC
drivers as well.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This is not just pure cosmetic, since the order affects the out-of-tree
module build at the -hg development tree.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Request demodulator auto-detect transmission parameters in case of
garbage parameters provided by application for compatibility.
That's needed at least for MPlayer compatibility currently.
Thanks to Jelle de Jong for reporting issue and providing SSH access to
Devin for debugging.
Thanks to Devin Heitmueller for hard debug work he did to find that bug.
Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Jelle de Jong <jelledejong@powercraft.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The bug was introduced when adding the light frequency control
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
When the change was introduced in the zl10353 for the i2c gate behavior, this
broke the HVR-900 which was not behind a gate. Use a version of the zl10353
config profile that indicates the tuner is not behind such a gate.
Without this patch the first tune succeeds, but subsequent tuning attempts
will fail.
The change also renames the terratec zl10353 profile I wrote to be more
generic, since it is shared by the non-terratec device.
Thanks to Michael Krufky for providing a HVR-900 and DVB-T environment to test
with.
Cc: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The Pinnacle Hybrid Pro 320e was missing a demod config for the xc3028, which
is required for digital tuning to work properly. Add the missing profile.
Thanks to Andreas Lunderhage for testing patches and providing a remote debug
environment.
Cc: Andreas Lunderhage <lunderhage@home.se>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
In cases where the device has a generic Empia USB ID, the call in the
precard setup phase did not set the tuner GPIO. As a result, the tuner may
not be taken out of reset before attempting initialization in the analog
driver.
This problem was not seen before with the EVGA inDtube, since that particular
board has the analog GPIO setup to include taking the tuner out of reset.
Thanks to Andreas Lunderhage for testing patches and providing a remote debug
environment for the Pinnacle 320e.
Cc: Andreas Lunderhage <lunderhage@home.se>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Set the GPIO properly for the analog side of the Pinnacle Hybrid Pro, or else
the emp202 doesn't get detected properly.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Setup the GPIOs properly and enable support for the DVB side of the Pinnacle
Hybrid Pro USB stick.
Thanks to Andreas Lunderhage for testing patches and providing a remote debug
environment.
Cc: Andreas Lunderhage <lunderhage@home.se>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy walls pointed out that we were passing 0x5d to the TUNER_GO register,
instead of 0x01. Set the register properly (note the code did still work with
the incorrect value, so this does not address a regression).
Thanks to Andy Walls for noticing the issue.
Cc: Andy Walls <awalls@radix.net>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The Terratec Cinergy T XS USB can have either a zl10353 or an mt352. Add
support for the MT352 variant.
Thanks to Jelle de Jong for providing a unit to test/debug with.
Cc: Jelle de Jong <jelledejong@powercraft.nl>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Depending on the video input format, vinmode/vinctl needs adjustments.
For TV, this is not relevant, since the supported decoders output data
at the same format. However, webcam sensors may have different formats,
so, this needs to be adjusted based on the device.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
In order to properly estimate fps, mt9v011 sensor driver needs to know
what is the used frequency on the sensor cristal. Adds the proper fields
and initialization code for specifying the cristal frequency.
Also, based on experimentation, it was noticed that the Silvercrest is
outputing data at 7 fps. This means that it should be using a 6.3 MHz
cristal. This information needs to be double checked later, by opening
the device. Anyway, by using this value for xtal, at least now we have
the correct fps report.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Since frames per second is a function of cristal frequency, and this is
device-specific, add a function that allows adjusting it, via
subdev->core->s_config callback.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
It is possible to adjust the fps rate by changing some register values.
This is function of the connected Xtal at the camera sensor, being a 27
MHz cristal needed, in order to support 640x480 at 30 fps.
For now, it will only calculate the values for fps. Later patches may
introduce V4L2 ioctls, to allow frequency rate adjustments.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
While trying to fix an mt9v001 webcam, I noticed that HSCALE/VSCALE do
work with em28xx + webcam. The issue is that the scaling setup depends
on the number of visible rows/cols of the input image.
With mt9v011 (Silvercrest), the resolution is 640x480. So, the scaling
is different from a normal TV image (720x480 on NTSC). This were causing
a wrong scaling and a previous patch disabled scaling.
As each sensor have their different resolution setting, the xres/yres
should be adjusted accordingly with the input sensor.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
With the previous approach, autodetection were working only for the two
generic entries (em275x and em2820 unknown ones). So, if someone would
try to force probing an specific device, the code would not properly run
the autodetection code.
With the new approach, the sensor autodetection will be run not only for
the two generic entries, but also do webcam specific ones.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Instead of using em28xx board decoder field for storing sensor information,
let's use instead a separate field for it.
Also, as sensors are currently autodetected, there's no need of having
it at the boards description. So, move it to the main em28xx struct.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Webcams in general don't have eeprom. So, the sensor hint code should be
called to properly detect what sensor is inside.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
By having the webcam devices marked as such, it will help the em28xx
driver to do the right thing on those devices.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Just renames the flag, to use a clearer name. Later patches will use
this flag to properly set some drivers behaviors for webcams.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
A couple of erroneous register writes snuck in that made the image go haywire. Remove these.
Many thanks to Grégory Lardière for finding this out
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
All hdcs registers use bit 0 as a read/write flag and needs to be shifted one bit to the left. This wasn't accounted for when doing a sequence of writes.
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The master mute switch is wrongly implemented as checking the pointer
instead of its value, thus it can be never muted. This patch fixes
the issue.
Reference: Novell bnc#404873
https://bugzilla.novell.com/show_bug.cgi?id=404873
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
Every time a request is enqueued or there is some work outstanding
from the ap_tasklet, the ap_poll_timer is scheduled again.
Unfortunately it was permanently called. It looked as if it was
started in the past and thus imediately expired.
This has been changed. First it is checked if the hrtimer is already
expired. Then the expiring time is forwarded and the timer restarted.
Signed-off-by: Felix Beck <felix.beck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>