Commit Graph

16 Commits

Author SHA1 Message Date
Gustavo A. R. Silva 1771e9fb67 media: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-08-29 08:35:27 +02:00
Thomas Gleixner 74ba9207e1 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version this program is distributed in the
  hope that it will be useful but without any warranty without even
  the implied warranty of merchantability or fitness for a particular
  purpose see the gnu general public license for more details you
  should have received a copy of the gnu general public license along
  with this program if not write to the free software foundation inc
  675 mass ave cambridge ma 02139 usa

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 441 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-24 17:36:45 +02:00
Mauro Carvalho Chehab dda1bb4e97 media: tuners: fix several typos
Use codespell to fix lots of typos over frontends.

Manually verified to avoid false-positives.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-03-01 09:40:29 -05:00
Mauro Carvalho Chehab a3f90c75b8 media: dvb: convert tuner_info frequencies to Hz
Right now, satellite tuner drivers specify frequencies in kHz,
while terrestrial/cable ones specify in Hz. That's confusing
for developers.

However, the main problem is that universal tuners capable
of handling both satellite and non-satelite delivery systems
are appearing. We end by needing to hack the drivers in
order to support such hybrid tuners.

So, convert everything to specify tuner frequencies in Hz.

Plese notice that a similar patch is also needed for frontends.

Tested-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Acked-by: Michael Büsch <m@bues.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-02 16:14:50 -04:00
Mauro Carvalho Chehab 06eeefe8e3 [media] media drivers: annotate fall-through
Avoid warnings like those:

drivers/media/pci/ddbridge/ddbridge-core.c: In function 'dvb_input_detach':
drivers/media/pci/ddbridge/ddbridge-core.c:787:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (input->fe) {
      ^
drivers/media/pci/ddbridge/ddbridge-core.c:792:2: note: here
  case 4:
  ^~~~
...

On several cases, it is just that gcc 7.1 is not capable of
understanding the comment, but on other places, we need an
annotation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-05-19 07:10:03 -03:00
Max Kellermann 194ced7a5a [media] dvb_frontend: tuner_ops.release returns void
It is not clear what this return value means.  All implemenations
return 0, and the one caller ignores the value.  Let's remove this
useless return value completely.

Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-18 15:07:26 -02:00
Mauro Carvalho Chehab 8ca2e927eb [media] tuners: 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 10:08:13 -02:00
Mauro Carvalho Chehab 36dba13bda [media] tda18271: use prefix on all printk messages
Some messages have a hardcoded prefix; others not. Use the
pr_fmt() to ensure that all messages will use the same prefix.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-05 15:26:28 -03:00
Hans Verkuil 215cedec37 [media] media: remove emacs editor variables
1) This is not allowed by the kernel coding style
2) Just configure your editor correctly
3) It's really ugly

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-22 17:52:20 -02:00
Ondrej Zary 1bacb2df3b [media] tda8290: change magic LNA config values to enum
Use enum instead of magic values for LNA config in tda8290.
Update tda827x, tda18271 and saa7134 to use the enum too.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08 07:05:15 -03:00
Frank Schäfer 4e791048e0 [media] tda18271: add missing entries for qam_7 to tda18271_update_std_map() and tda18271_dump_std_map()
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-12-18 17:15:03 -02:00
Michael Krufky 351d18786e [media] tda18271: properly report read errors in tda18271_get_id
Until now, if there is a read error in tda18271_get_id, the driver
reports "Unknown device..."  Instead, check the return value of
tda18271_read_regs and display the appropriate error message.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-02 15:17:46 -03:00
Michael Krufky 6b82e0cfc1 [media] tda18271: delay IR & RF calibration until init() if delay_cal is set
if the configuration option 'delay_cal' is set, delay both IR & RF
calibration until init() is called.
both module option 'cal' or configuration option 'rf_cal_on_startup'
will override this delay. it makes no sense to mix 'delay_cal' with
'rf_cal_on_startup' as these options conflict with each other.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-02 15:16:04 -03:00
Michael Krufky 4cfae67515 [media] tda18271: make 'low-power standby mode after attach' multi-instance safe
Ensure that unnecessary features are powered down at the end of the
attach() function on attach of the tuner's first instance. If the
configuration requires the loop thru or xtout features, they will
remain enabled.
This must *only* be done after attaching the first instance of the tuner.
If there are multiple instances of the tuner, the bridge driver will need
to maintain power managament by itself.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 17:26:06 -03:00
Michael Krufky 185e4768b8 [media] tda18271: enter low-power standby mode at the end of tda18271_attach()
Ensure that unnecessary features are powered down at the end of the
attach() function.  If the configuration requires the loop thru or
xtout features, they will remain enabled.
Thanks to Antti Palosaari for noticing the additional power consumption.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01 17:25:39 -03:00
Mauro Carvalho Chehab ccae7af2bf [media] common: move media/common/tuners to media/tuners
Move the tuners one level up, as the "common" directory will be used
by drivers that are shared between more than one driver.

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