Commit graph

277806 commits

Author SHA1 Message Date
Mauro Carvalho Chehab
8294e3ed41 [media] mt2063: Reorder the code to avoid function prototypes
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:58 -02:00
Mauro Carvalho Chehab
4713e225a5 [media] mt2063: Remove setParm/getParm abstraction layer
This layer just increases the code size for no good reason,
and makes harder to debug.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:48 -02:00
Mauro Carvalho Chehab
3d49700fb1 [media] mt2063: Rework on the publicly-exported functions
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:34 -02:00
Mauro Carvalho Chehab
fad11dbc93 [media] mt2063: Simplify mt2063_setTune logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:27 -02:00
Mauro Carvalho Chehab
31e67faeaf [media] mt2063: simplify lockstatus logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:21 -02:00
Mauro Carvalho Chehab
66aea30d32 [media] mt2063: Remove several unused parameters
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:16 -02:00
Mauro Carvalho Chehab
fd1126cac0 [media] mt2063: Use linux default max function
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:09 -02:00
Mauro Carvalho Chehab
8c64f93285 [media] mt2063: Don't violate the DVB API
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:20:01 -02:00
Mauro Carvalho Chehab
01e0dafc64 [media] mt2063: Simplify device init logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:53 -02:00
Mauro Carvalho Chehab
e930b3a03e [media] mt2063: Simplify some functions
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:44 -02:00
Mauro Carvalho Chehab
e1de3d18d4 [media] mt2063: Rewrite read/write logic at the driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:38 -02:00
Mauro Carvalho Chehab
d0dcc2da26 [media] mt2063: Remove the code for more than one adjacent mt2063 tuners
Such code is disabled via ifdef's. Also, they're ugly and rely
on some static structures. Just remove. If ever needed, the git
log can be used to recover it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:31 -02:00
Mauro Carvalho Chehab
dcd52d20d3 [media] mt2063: Use state for the state structure
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:21 -02:00
Mauro Carvalho Chehab
51f0f7b3ed [media] mt2063: Merge the two state structures into one
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:11 -02:00
Mauro Carvalho Chehab
29a0a4fec5 [media] mt2063: Remove unused data structures
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:19:04 -02:00
Mauro Carvalho Chehab
fdf77a4f8e [media] mt2063: Use Unix standard error handling
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:18:59 -02:00
Mauro Carvalho Chehab
065719a768 [media] mt2063: Remove internal version checks
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:18:49 -02:00
Mauro Carvalho Chehab
6d3d748a62 [media] mt2063: Move data structures to the driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:18:43 -02:00
Mauro Carvalho Chehab
f867695a0f [media] mt2063: get rid of compilation warnings
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:18:32 -02:00
Mauro Carvalho Chehab
059cd82d25 [media] mt2063: Remove unused stuff
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:18:07 -02:00
Mauro Carvalho Chehab
bf97555e08 [media] mt2063: Re-define functions as static
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:17:59 -02:00
Mauro Carvalho Chehab
a0813ea340 [media] mt2063: Remove most of the #if's
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:16:24 -02:00
Mauro Carvalho Chehab
cfde89258a [media] mt2063: Use standard Linux types, instead of redefining them
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:16:23 -02:00
Mauro Carvalho Chehab
b675668aaf [media] mt2063: Fix the driver to make it compile
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:16:22 -02:00
Mauro Carvalho Chehab
0ff4843218 [media] mt2063: Move code from mt2063_cfg.h
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:16:15 -02:00
Mauro Carvalho Chehab
4dca4efc10 [media] mt2063: Fix some Coding styles at mt2063.h
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:16:04 -02:00
Mauro Carvalho Chehab
0e301442d6 [media] mt2063: CodingStyle fixes
convert to Unix eol, run Lindent and remove bad whitespaces

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:13:54 -02:00
Mauro Carvalho Chehab
223c7b05e5 [media] add driver for mt2063
Those files are marked as licensed with GPL, so, it is ok to
merge. They came from Terratec site:

http://linux.terratec.de/files/TERRATEC_H7/20110323_TERRATEC_H7_Linux.tar.gz

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 22:12:41 -02:00
Linus Torvalds
805a6af8db Linux 3.2 2012-01-04 15:55:44 -08:00
Linus Torvalds
869682384e Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  fix CAN MAINTAINERS SCM tree type
  mwifiex: fix crash during simultaneous scan and connect
  b43: fix regression in PIO case
  ath9k: Fix kernel panic in AR2427 in AP mode
  CAN MAINTAINERS update
  net: fsl: fec: fix build for mx23-only kernel
  sch_qfq: fix overflow in qfq_update_start()
  Revert "Bluetooth: Increase HCI reset timeout in hci_dev_do_close"
2012-01-04 15:03:49 -08:00
Al Viro
d6042eac44 minixfs: misplaced checks lead to dentry leak
bitmap size sanity checks should be done *before* allocating ->s_root;
there their cleanup on failure would be correct.  As it is, we do iput()
on root inode, but leak the root dentry...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-04 15:03:06 -08:00
Oleg Nesterov
8a88951b58 ptrace: ensure JOBCTL_STOP_SIGMASK is not zero after detach
This is the temporary simple fix for 3.2, we need more changes in this
area.

1. do_signal_stop() assumes that the running untraced thread in the
   stopped thread group is not possible. This was our goal but it is
   not yet achieved: a stopped-but-resumed tracee can clone the running
   thread which can initiate another group-stop.

   Remove WARN_ON_ONCE(!current->ptrace).

2. A new thread always starts with ->jobctl = 0. If it is auto-attached
   and this group is stopped, __ptrace_unlink() sets JOBCTL_STOP_PENDING
   but JOBCTL_STOP_SIGMASK part is zero, this triggers WANR_ON(!signr)
   in do_jobctl_trap() if another debugger attaches.

   Change __ptrace_unlink() to set the artificial SIGSTOP for report.

   Alternatively we could change ptrace_init_task() to copy signr from
   current, but this means we can copy it for no reason and hide the
   possible similar problems.

Acked-by: Tejun Heo <tj@kernel.org>
Cc: <stable@kernel.org>		[3.1]
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-04 15:01:59 -08:00
Oleg Nesterov
50b8d25748 ptrace: partially fix the do_wait(WEXITED) vs EXIT_DEAD->EXIT_ZOMBIE race
Test-case:

	int main(void)
	{
		int pid, status;

		pid = fork();
		if (!pid) {
			for (;;) {
				if (!fork())
					return 0;
				if (waitpid(-1, &status, 0) < 0) {
					printf("ERR!! wait: %m\n");
					return 0;
				}
			}
		}

		assert(ptrace(PTRACE_ATTACH, pid, 0,0) == 0);
		assert(waitpid(-1, NULL, 0) == pid);

		assert(ptrace(PTRACE_SETOPTIONS, pid, 0,
					PTRACE_O_TRACEFORK) == 0);

		do {
			ptrace(PTRACE_CONT, pid, 0, 0);
			pid = waitpid(-1, NULL, 0);
		} while (pid > 0);

		return 1;
	}

It fails because ->real_parent sees its child in EXIT_DEAD state
while the tracer is going to change the state back to EXIT_ZOMBIE
in wait_task_zombie().

The offending commit is 823b018e which moved the EXIT_DEAD check,
but in fact we should not blame it. The original code was not
correct as well because it didn't take ptrace_reparented() into
account and because we can't really trust ->ptrace.

This patch adds the additional check to close this particular
race but it doesn't solve the whole problem. We simply can't
rely on ->ptrace in this case, it can be cleared if the tracer
is multithreaded by the exiting ->parent.

I think we should kill EXIT_DEAD altogether, we should always
remove the soon-to-be-reaped child from ->children or at least
we should never do the DEAD->ZOMBIE transition. But this is too
complex for 3.2.

Reported-and-tested-by: Denys Vlasenko <vda.linux@googlemail.com>
Tested-by: Lukasz Michalik <lmi@ift.uni.wroc.pl>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: <stable@kernel.org>		[3.0+]
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-04 15:01:59 -08:00
Linus Torvalds
8d9cbf8240 Merge git://git.samba.org/sfrench/cifs-2.6
* git://git.samba.org/sfrench/cifs-2.6:
  [CIFS] default ntlmv2 for cifs mount delayed to 3.3
  cifs: fix bad buffer length check in coalesce_t2
2012-01-04 14:57:55 -08:00
Steven Toth
9c9c3d078b [media] cx23885: Configure the MPEG encoder early to avoid jerky video
Found an odd bug while implementing support for the HVR1850 that
lead to jerky video during the first capture, if the encoder was
not initialized early. I've modied the driver to configure the
encoder early, and this avoids the issue - a reasonable workaround.

Regression tested against the HVR1800 and soon to be added HVR1850

[mchehab@redhat.com: Fix this compilation issue:  drivers/media/video/cx23885/cx23885-417.c:1351:2: error: too few arguments to function ‘cx23885_initialize_codec’]
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 20:51:18 -02:00
Steven Toth
38e3d7ce41 [media] cx23885: Ensure the MPEG encoder height is configured from the norm
Bugfix: The height was not always correctly configured if switching between
different video standards. Change the encode height based on the standard.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 20:48:29 -02:00
Steven Toth
182d29f307 [media] cx23885: Cleanup MPEG encoder GPIO handling
During initialization the prior GPIO's were not being preserved
and restore correctly. Small cleanups to configure the GPIO's
for the HVR1700, HVR1800 and HVR1850.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 20:48:09 -02:00
Steven Toth
4c3764d150 [media] cx25840 / cx23885: Fixing audio/volume regression
Since the conversion to subdev in Oct 2010 the audio controls have
not functioned correctly in the cx23885 driver. Passing values of
0-3f did not translate into meaningfull register writes. I've
converted the cx23885 driver to match the cx25840 volume control
definition and now audio is working reliably again.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 20:47:11 -02:00
matthieu castet
c81c0060ac [media] tm6000: dvb doesn't work on usb1.1
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 20:45:34 -02:00
matthieu castet
3874cd7796 [media] tm6000: improve loading speed on hauppauge 900H
- enable fast usb quirk
- use usleep_range instead on msleep for short sleep
- merge i2c out and usb delay
- do like the windows driver that upload the tuner firmware
  with 80 bytes packets

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
CC: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 20:37:54 -02:00
Mauro Carvalho Chehab
7581e61d8d [media] dvb: Remove ops->info.type from frontends
Now that this field is deprecated, and core generates it for
DVBv3 calls, remove it from the drivers.

It also adds .delsys on the few drivers where this were missed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 17:30:34 -02:00
Mauro Carvalho Chehab
cd7d494d0b [media] dvb: deprecate the usage of ops->info.type
Mark info.type as deprecated inside the header, recommending
the usage of DTV_ENUM_DELSYS DVBv5 command instead.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 17:30:20 -02:00
Mauro Carvalho Chehab
e399ce77e6 [media] dvb: get rid of fepriv->parameters_in
This var were used during DVBv3 times, in order to keep a copy
of the parameters used by the events. This is not needed anymore,
as the parameters are now dynamically generated from the DVBv5
structure.

So, just get rid of it. That means that a DVBv5 pure call won't
use anymore any DVBv3 parameters.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 17:30:02 -02:00
Mauro Carvalho Chehab
a520ca97a5 [media] dvb-core: Fix ISDB-T defaults
using -1 for ISDB-T parameters do the wrong thing. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 17:29:55 -02:00
Mauro Carvalho Chehab
04be0f76a8 [media] dvb_frontend: Fix DVBv3 emulation
For frontends with ISDB-T, DVB-T2, CMDBTH, etc, some code is
needed, in order to provide emulation. Add such code, and check
if the desired delivery system is supported by the frontend.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 17:29:50 -02:00
Mauro Carvalho Chehab
5bfaaddef8 [media] dvb_frontend: Don't use ops->info.type anymore
Get rid of using ops->info.type defined on DVB drivers,
as it doesn't apply anymore.

Currently, one driver (cxd2820) supports more than one different
info.type, as it can be used for DVB-T/T2 and DVB-C. There are more
drivers like that to come. So, the same frontend will have

different DVBv3 types, depending on the current delivery system.

This breaks the existing logic at dvb_frontend, that assumes that
just one delivery system DVBv3 type is supported by all delsys.

In order to easy the DVBv3->DVBv5 conversion, an ancillary function
that maps DVBv3 delivery systems into DVBv5 were added.

Also, on all places, except for the event logic, the DVBv5 cache
will be used to check parameters, instead of the DVBv5 copy.

This patch simplifies the cache sync logic, and warrants that the
cache will be in a clear state at DVB frontend register. This way,
ops->info.type will be filled to reflect the first delivery system,
providing backward compatibility support for it.

For example, in the cases like cxd2820, where the delivery systems
are defined as:
        .delsys = { SYS_DVBT, SYS_DVBT2, SYS_DVBC_ANNEX_A },

A pure DVBv3 will be able to use both DVB-T and DVB-T2, as, at
DVB cache clear, the ops->info.type will be equal to FE_OFDM.

However, DVB-C won't be visible. A quick workaround would be to
do a DVBv5 call to set the delivery system to SYS_DVBC_ANNEX_A.

After such call, ops->info.type will be equal to FE_QAM, and a
DVBv3 application will see the frontend as a DVB-C one.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 17:29:36 -02:00
Mauro Carvalho Chehab
9682cea27e [media] dvb: move dvb_set_frontend logic into a separate routine
This change is there in order to prepare the code to avoid calling
 dvb_frontend_ioctl_legacy() from FE_SET_PROPERTY.

A call to dvb_frontend_ioctl_legacy() would require to update the
DVBv3 cache without need, mangling calls for newer delivery system
without any reason.

No functional changes here.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 17:29:17 -02:00
Mauro Carvalho Chehab
9a27e6a0b7 [media] dvb_frontend: Handle all possible DVBv3 values for bandwidth
Due to DVB-T2, several new possible values for bandwidth were added.
As the DVBv3 struct were updated to handle them, the core needs to
handle all of them, as a DVBv3 application might try to use it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 17:29:01 -02:00
Mauro Carvalho Chehab
26c924febc [media] dvb: Initialize all cache values
By default, initialize the frontend current delivery system with
the first one. This warrants that a DVBv3 application will be able
to tune to it, after the removal of ops->init.type filling at
the drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 17:28:45 -02:00
John W. Linville
d8f46ff110 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem 2012-01-04 11:37:30 -05:00