1
0
Fork 0
Commit Graph

27 Commits (5b5e0928f742cfa853b2411400a1b19fa379d758)

Author SHA1 Message Date
Alexey Dobriyan 5b5e0928f7 lib/vsprintf.c: remove %Z support
Now that %z is standartised in C99 there is no reason to support %Z.
Unlike %L it doesn't even make format strings smaller.

Use BUILD_BUG_ON in a couple ATM drivers.

In case anyone didn't notice lib/vsprintf.o is about half of SLUB which
is in my opinion is quite an achievement.  Hopefully this patch inspires
someone else to trim vsprintf.c more.

Link: http://lkml.kernel.org/r/20170103230126.GA30170@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:47 -08:00
Piotr Oleszczyk 430ae1261c [media] add Hama Hybrid DVB-T Stick support
Adding Hama Hybrid DVB-T Stick support. Technically it's the same
device what Terratec Cinergy HT USB XE is.

Signed-off-by: Piotr Oleszczyk <piotr.oleszczyk@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-08 10:54:58 -02:00
Mauro Carvalho Chehab f319ed911c [media] dvb-usb: don't break long lines
Due to the 80-cols restrictions, and latter due to checkpatch
warnings, several strings were broken into multiple lines. This
is not considered a good practice anymore, as it makes harder
to grep for strings at the source code.

As we're right now fixing other drivers due to KERN_CONT, we need
to be able to identify what printk strings don't end with a "\n".
It is a way easier to detect those if we don't break long lines.

So, join those continuation lines.

The patch was generated via the script below, and manually
adjusted if needed.

</script>
use Text::Tabs;
while (<>) {
	if ($next ne "") {
		$c=$_;
		if ($c =~ /^\s+\"(.*)/) {
			$c2=$1;
			$next =~ s/\"\n$//;
			$n = expand($next);
			$funpos = index($n, '(');
			$pos = index($c2, '",');
			if ($funpos && $pos > 0) {
				$s1 = substr $c2, 0, $pos + 2;
				$s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2;
				$s2 =~ s/^\s+//;

				$s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne "");

				print unexpand("$next$s1\n");
				print unexpand("$s2\n") if ($s2 ne "");
			} else {
				print "$next$c2\n";
			}
			$next="";
			next;
		} else {
			print $next;
		}
		$next="";
	} else {
		if (m/\"$/) {
			if (!m/\\n\"$/) {
				$next=$_;
				next;
			}
		}
	}
	print $_;
}
</script>

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21 09:39:51 -02:00
Mauro Carvalho Chehab bd1f976cc9 [media] dib0700: be sure that dib0700_ctrl_rd() users can do DMA
dib0700_ctrl_rd() takes a RX and a TX pointer. Be sure that
both will point to a memory allocated via kmalloc().

Reviewed-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-14 12:37:47 -03:00
Alejandro Torrado ec788795dd [media] dib0700: add USB ID for another STK8096-PVR ref design based card
USB_PID_DIBCOM_STK8096GP also comes with USB_VID_DIBCOM vendor ID.

Signed-off-by: Alejandro Torrado <aletorrado@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-05-09 14:57:31 -03:00
Nicolas Sugino 91be260faa [media] dib8000: Add support for Mygica/Geniatech S2870
MyGica/Geniatech S2870 is very similar to the S870 but with dual tuner. The card is recognised as Geniatech STK8096-PVR.

[mchehab@osg.samsung.com: Fix some checkpatch.pl issues]
Signed-off-by: Nicolas Sugino <nsugino@3way.com.ar>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-25 12:19:23 -02:00
Mauro Carvalho Chehab 0df289a209 [media] dvb: Get rid of typedev usage for enums
The DVB API was originally defined using typedefs. This is against
Kernel CodingStyle, and there's no good usage here. While we can't
remove its usage on userspace, we can avoid its usage in Kernelspace.

So, let's do it.

This patch was generated by this shell script:

	for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done

While here, make CodingStyle fixes on the affected lines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> # for drivers/media/firewire/*
2015-06-09 17:47:35 -03:00
Mauro Carvalho Chehab 0fae1997f0 [media] dib0700: avoid the risk of forgetting to add the adapter's size
For every frontend entry, we need to add the adapter's size. There
are already two patches fixing it. So, it doesn't seem trivial to
keep it there at the right place.

Also, currently, the indentation is wrong on all places.

So, it seems that keeping it right is not too trivial.

Better to use a macro that would do it for us, at least while
this is not converted to dvb-usb-v2.

Compile-tested only.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-14 19:31:34 -03:00
Thomas Reitmayr e989a73ebd [media] media: Fix regression in some more dib0700 based devices
Fix an oops during device initialization by correctly setting size_of_priv
instead of leaving it 0.
The regression was introduced by 8abe4a0a3f ("[media] dib7000:
export just one symbol") and only fixed for one type of dib0700 based
devices in 9e334c7564 ("[media] Fix regression in some dib0700
based devices").

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=92301

Fixes: 8abe4a0a3f ("[media] dib7000: export just one symbol")

Cc: stable@vger.kernel.org # for version 3.17+
Signed-off-by: Thomas Reitmayr <treitmayr@devbase.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-13 18:18:39 -03:00
Mauro Carvalho Chehab 316c46b8f3 [media] dib0700: fix bad indentation
drivers/media/usb/dvb-usb/dib0700_devices.c:864 dib7770_set_param_override() warn: inconsistent indenting

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-01 06:26:05 -03:00
Luis de Bethencourt 67a260f1eb [media] dib0700: remove unused macros
Remove unused macros RC_REPEAT_DELAY and RC_REPEAT_DELAY_V1_20

Signed-off-by: Luis de Bethencourt <luis.bg@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 08:33:13 -03:00
Mauro Carvalho Chehab 09628b2c21 [media] dib0700_devices: Use c99 initializers for structures.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@

struct i1 {
 fs
 T fld;
 ...};

@bad@
identifier decl.i1,i2;
expression e;
initializer list[decl.n] is;
@@

struct i1 i2 = { is,
+ .fld = e
- e
 ,...};
// </smpl>

Not sure why, but some tables are still using the old way,
but at least several of them got fixed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-22 19:00:28 -03:00
James Harper 9e334c7564 [media] Fix regression in some dib0700 based devices
Fix regression in some dib0700 based devices.
Set size_of_priv, and don't call dvb_detach unnecessarily.
This resolves the oops(s) for my "Leadtek Winfast DTV Dongle (STK7700P based)"

Signed-off-by: James Harper <james.harper@ejbdigital.com.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-26 00:51:02 -03:00
David Härdeman 120703f9eb [media] rc-core: document the protocol type
Right now the protocol information is not preserved, rc-core gets handed a
scancode but has no idea which protocol it corresponds to.

This patch (which required reading through the source/keymap for all drivers,
not fun) makes the protocol information explicit which is important
documentation and makes it easier to e.g. support multiple protocols with one
decoder (think rc5 and rc-streamzap). The information isn't used yet so there
should be no functional changes.

[m.chehab@samsung.com: rebased, added cxusb and removed bad whitespacing]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-23 21:50:48 -03:00
Mauro Carvalho Chehab 40d1a7c3de [media] dib0700: better document struct init
Instead of using anonymous initialization for dib0896 structs,
identify each field by name. That helps to understand what's
being initialized.

No functional changes.

Acked-By: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-07 09:56:37 -03:00
Mauro Carvalho Chehab d44913c1e5 [media] dib8000: export just one symbol
Exporting multiple symbols don't work as it causes compilation
breakages, due to the way dvb_attach() works.

The bug happens when:
        CONFIG_DVB_DIB8000=m
	CONFIG_DVB_USB_DIB0700=y

As a bonus, dib8000 won't be loaded anymore if the device uses
a different frontend, reducing the memory footprint.

Tested with both Pixelview PV-D231 and MyGica S870.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-06-17 12:04:50 -03:00
Mauro Carvalho Chehab b9bc7d59b7 [media] dib8000: rename dib8000_attach to dib8000_init
Well, what we call as "foo_attach" is the method that should
be called by the dvb_attach() macro.

It should be noticed that the name "dvb_attach" is really a
bad name and don't express what it does.

dvb_attach() basically does three things, if the frontend is
compiled as a module:
- It lookups for the module that it is known to have the
  given symbol name and requests such module;
- It increments the module usage (anonymously - so lsmod
  doesn't print who loaded the module);
- after loading the module, it runs the function associated
  with the dynamic symbol.

When compiled as builtin, it just calls the function given to it.

As dvb_attach() increments refcount, it can't be (easily)
called more than once for the same module, or the kernel
will deny to remove the module, because refcount will never
be zeroed.

In other words, the function name given to dvb_attach()
should be one single symbol that will always be called
before any other function on that module to be used.

For almost all DVB frontends, there's just one function,
but, on dib8000, there are several exported symbols.

We need to get rid of all those direct calls, because they
cause compilation breakages when bridge is builtin and
frontend is module, we'll need to add a new function that
will be the first one to be called, whatever initialization
is needed.

So, let's rename this function, in order to prepare for
a next patch that will add a new attach() function that
will be the only one exported by this module.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-06-17 12:04:49 -03:00
Mauro Carvalho Chehab 8abe4a0a3f [media] dib7000: export just one symbol
Exporting multiple symbols don't work as it causes compilation
breakages, due to the way dvb_attach() works.

This were reported several times, like:

   drivers/built-in.o: In function `cxusb_dualdig4_rev2_tuner_attach':
>> cxusb.c:(.text+0x27d4b5): undefined reference to `dib7000p_get_i2c_master'
   drivers/built-in.o: In function `dib7070_set_param_override':
   cxusb.c:(.text+0x27d5a5): undefined reference to `dib0070_wbd_offset'
>> cxusb.c:(.text+0x27d5be): undefined reference to `dib7000p_set_wbd_ref'
   drivers/built-in.o: In function `dib7070_tuner_reset':
>> cxusb.c:(.text+0x27d5f9): undefined reference to `dib7000p_set_gpio'
   drivers/built-in.o: In function `cxusb_dualdig4_rev2_frontend_attach':
>> cxusb.c:(.text+0x27df5c): undefined reference to `dib7000p_i2c_enumeration'

In this specific report:
	CONFIG_DVB_USB_CXUSB=y
	CONFIG_DVB_DIB7000P=m

But the same type of bug can happen if:
	CONFIG_DVB_DIB7000P=m
and one of the bridge drivers is compiled builtin (cxusb, cx23885-dvb
and/or dib0700).

As a bonus, dib7000p won't be loaded anymore if the device uses
a different frontend, reducing the memory footprint.

Tested with Hauppauge Nova-TD (2 frontends).

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-06-17 12:04:49 -03:00
Mauro Carvalho Chehab 7f67d96ab1 [media] dib7000p: rename dib7000p_attach to dib7000p_init
Well, what we call as "foo_attach" is the method that should
be called by the dvb_attach() macro.

It should be noticed that the name "dvb_attach" is really a
bad name and don't express what it does.

dvb_attach() basically does three things, if the frontend is
compiled as a module:
- It lookups for the module that it is known to have the
  given symbol name and requests such module;
- It increments the module usage (anonymously - so lsmod
  doesn't print who loaded the module);
- after loading the module, it runs the function associated
  with the dynamic symbol.

When compiled as builtin, it just calls the function given to it.

As dvb_attach() increments refcount, it can't be (easily)
called more than once for the same module, or the kernel
will deny to remove the module, because refcount will never
be zeroed.

In other words, the function name given to dvb_attach()
should be one single symbol that will always be called
before any other function on that module to be used.

For almost all DVB frontends, there's just one function.

However, the dib7000p initialization can require up to 3
functions to be called:
	- dib7000p_get_i2c_master;
	- dib7000p_i2c_enumeration;
	- dib7000p_init (before this patch dib7000_attach).

(plus a bunch of other functions that the bridge driver will
need to call).

As we need to get rid of all those direct calls, because they
cause compilation breakages when bridge is builtin and
frontend is module, we'll need to add a new function that
will be the first one to be called, whatever initialization
is needed.

So, let's rename the function that probes and init the hardware
to dib7000p_init.

A latter patch will add a new dib7000p_attach that will be
used as originally conceived by dvb_attach() way.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-06-17 12:04:48 -03:00
Mauro Carvalho Chehab c4018fa2e4 [media] dib0700: fix RC support on Hauppauge Nova-TD
The RC support o Nova-TD is broken, as the RC endpoint there
is an interrupt endpoint.

That produces an ugly calltrace at the Kernel logs:

	WARNING: CPU: 2 PID: 56 at drivers/usb/core/urb.c:450 usb_submit_urb+0x1fd/0x5c0()
	usb 1-1.2: BOGUS urb xfer, pipe 3 != type 1
	Modules linked in: rc_dib0700_rc5(OF) dvb_usb_dib0700(OF) dib9000(OF) dib8000(OF) dib7000m(OF) dib0090(OF) dib0070(OF) dib7000p(OF) dib3000mc(OF) dibx000_common(OF) dvb_usb(OF) rc_core(OF) snd_usb_audio snd_usbmidi_lib snd_hwdep snd_rawmidi snd_seq snd_seq_device snd_pcm snd_timer snd soundcore bnep bluetooth 6lowpan_iphc rfkill au0828(OF) xc5000(OF) au8522_dig(OF) au8522_common(OF) tveeprom(OF) dvb_core(OF) nouveau i915 mxm_wmi ttm i2c_algo_bit drm_kms_helper drm r8169 mii i2c_core video wmi [last unloaded: au0828]
	CPU: 2 PID: 56 Comm: khubd Tainted: GF          O 3.14.2-200.fc20.x86_64 #1
	Hardware name: SAMSUNG ELECTRONICS CO., LTD. 550P5C/550P7C/SAMSUNG_NP1234567890, BIOS P05ABI.016.130917.dg 09/17/2013
	 0000000000000000 00000000610866bc ffff880223703860 ffffffff816eec92
	 ffff8802237038a8 ffff880223703898 ffffffff8108a1bd ffff8800916a2180
	 ffff8801d5b16000 0000000000000003 0000000000000003 0000000000000020
	Call Trace:
	 [<ffffffff816eec92>] dump_stack+0x45/0x56
	 [<ffffffff8108a1bd>] warn_slowpath_common+0x7d/0xa0
	 [<ffffffff8108a23c>] warn_slowpath_fmt+0x5c/0x80
	 [<ffffffff814e3ebd>] usb_submit_urb+0x1fd/0x5c0
	 [<ffffffffa0445925>] dib0700_rc_setup+0xb5/0x120 [dvb_usb_dib0700]
	 [<ffffffffa0445a58>] dib0700_probe+0xc8/0x130 [dvb_usb_dib0700]
	...

Fix it by detecting if the endpoint is bulk or interrupt.

Tested with both Hauppauge Nova-TD model 52009 (interrupt) and with a
		 Prolink Pixelview SBTVD model PV-D231U (bulk).

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25 17:44:19 -03:00
Michael Krufky c859e6ef33 [media] dib0700: add support for PCTV 2002e & PCTV 2002e SE
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-07-22 07:48:11 -03:00
Olivier Grenie 59501bb792 [media] dib7090p: improve the support of the dib7090 and dib7790
The intend of this patch is to improve the support of the dib7090 and
dib7790. The AGC1 min value is set to 32768 by default. The actual AGC1 min
and the external attenuation are controled depending on the received RF
level.

Signed-off-by: Olivier Grenie <olivier.grenie@parrot.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@parrot.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-22 17:15:52 -03:00
Olivier Grenie f45f513a93 [media] dib7090p: remove the support for the dib7090E
The intend of this patch is to remove the support for the dib7090E. The
DiB7090E-package has never left prototype state and never made it to
mass-prod-state.

Signed-off-by: Olivier Grenie <olivier.grenie@parrot.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@parrot.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-22 17:15:26 -03:00
Olivier Grenie 5e9c85d983 [media] dib8096: enhancement
The intend of this patch is to improve the support of the dib8096. The PLL
parameters are not automatically computed. The limit to set/unset external
diode for attenuation has been updated. The TFE8096P board is using the
new I2C API.

Signed-off-by: Olivier Grenie <olivier.grenie@parrot.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@parrot.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-22 17:15:07 -03:00
Patrick Boettcher 173a64cb3f [media] dib8000: enhancement
The intend of this patch is to improve the support of the dib8000.

Signed-off-by: Olivier Grenie <olivier.grenie@parrot.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@parrot.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-22 16:58:16 -03:00
David Härdeman c003ab1bed [media] rc-core: add separate defines for protocol bitmaps and numbers
The RC_TYPE_* defines are currently used both where a single protocol is
expected and where a bitmap of protocols is expected.

Functions like rc_keydown() and functions which add/remove entries to the
keytable want a single protocol. Future userspace APIs would also
benefit from numeric protocols (rather than bitmap ones). Keytables are
smaller if they can use a small(ish) integer rather than a bitmap.

Other functions or struct members (e.g. allowed_protos,
enabled_protocols, etc) accept multiple protocols and need a bitmap.

Using different types reduces the risk of programmer error. Using a
protocol enum whereever possible also makes for a more future-proof
user-space API as we don't need to worry about a sufficient number of
bits being available (e.g. in structs used for ioctl() calls).

The use of both a number and a corresponding bit is dalso one in e.g.
the input subsystem as well (see all the references to set/clear bit when
changing keytables for example).

This patch separate the different usages in preparation for
upcoming patches.

Where a single protocol is expected, enum rc_type is used; where one or more
protocol(s) are expected, something like u64 is used.

The patch has been rewritten so that the format of the sysfs "protocols"
file is no longer altered (at the loss of some detail). The file itself
should probably be deprecated in the future though.

Signed-off-by: David Härdeman <david@hardeman.nu>
Cc: Andy Walls <awalls@md.metrocast.net>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Antti Palosaari <crope@iki.fi>
Cc: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-27 11:49:51 -02:00
Mauro Carvalho Chehab 786baecfe7 [media] dvb-usb: move it to drivers/media/usb/dvb-usb
As media/dvb will be removed, move it to a proper place.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13 23:26:31 -03:00