2017-12-01 20:47:09 +07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
// For Philips TEA5761 FM Chip
|
|
|
|
// I2C address is always 0x20 (0x10 at 7-bit mode).
|
|
|
|
//
|
MAINTAINERS & files: Canonize the e-mails I use at files
From now on, I'll start using my @kernel.org as my development e-mail.
As such, let's remove the entries that point to the old
mchehab@s-opensource.com at MAINTAINERS file.
For the files written with a copyright with mchehab@s-opensource,
let's keep Samsung on their names, using mchehab+samsung@kernel.org,
in order to keep pointing to my employer, with sponsors the work.
For the files written before I join Samsung (on July, 4 2013),
let's just use mchehab@kernel.org.
For bug reports, we can simply point to just kernel.org, as
this will reach my mchehab+samsung inbox anyway.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Brian Warner <brian.warner@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-04-25 16:34:48 +07:00
|
|
|
// Copyright (c) 2005-2007 Mauro Carvalho Chehab <mchehab@kernel.org>
|
2007-04-08 11:09:11 +07:00
|
|
|
|
|
|
|
#include <linux/i2c.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 15:04:11 +07:00
|
|
|
#include <linux/slab.h>
|
2007-04-08 11:09:11 +07:00
|
|
|
#include <linux/delay.h>
|
2009-02-20 03:31:17 +07:00
|
|
|
#include <linux/videodev2.h>
|
2007-04-08 11:09:11 +07:00
|
|
|
#include <media/tuner.h>
|
2007-08-28 07:23:40 +07:00
|
|
|
#include "tuner-i2c.h"
|
|
|
|
#include "tea5761.h"
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2008-04-23 00:41:48 +07:00
|
|
|
static int debug;
|
2007-08-28 07:23:40 +07:00
|
|
|
module_param(debug, int, 0644);
|
|
|
|
MODULE_PARM_DESC(debug, "enable verbose debug messages");
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-08-21 11:24:42 +07:00
|
|
|
struct tea5761_priv {
|
|
|
|
struct tuner_i2c_props i2c_props;
|
2007-08-28 07:23:40 +07:00
|
|
|
|
|
|
|
u32 frequency;
|
2011-02-15 03:53:12 +07:00
|
|
|
bool standby;
|
2007-08-21 11:24:42 +07:00
|
|
|
};
|
|
|
|
|
2007-04-08 11:09:11 +07:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
/***************************
|
|
|
|
* TEA5761HN I2C registers *
|
|
|
|
***************************/
|
|
|
|
|
|
|
|
/* INTREG - Read: bytes 0 and 1 / Write: byte 0 */
|
|
|
|
|
|
|
|
/* first byte for reading */
|
|
|
|
#define TEA5761_INTREG_IFFLAG 0x10
|
|
|
|
#define TEA5761_INTREG_LEVFLAG 0x8
|
|
|
|
#define TEA5761_INTREG_FRRFLAG 0x2
|
|
|
|
#define TEA5761_INTREG_BLFLAG 0x1
|
|
|
|
|
|
|
|
/* second byte for reading / byte for writing */
|
|
|
|
#define TEA5761_INTREG_IFMSK 0x10
|
|
|
|
#define TEA5761_INTREG_LEVMSK 0x8
|
|
|
|
#define TEA5761_INTREG_FRMSK 0x2
|
|
|
|
#define TEA5761_INTREG_BLMSK 0x1
|
|
|
|
|
|
|
|
/* FRQSET - Read: bytes 2 and 3 / Write: byte 1 and 2 */
|
|
|
|
|
|
|
|
/* First byte */
|
|
|
|
#define TEA5761_FRQSET_SEARCH_UP 0x80 /* 1=Station search from botton to up */
|
|
|
|
#define TEA5761_FRQSET_SEARCH_MODE 0x40 /* 1=Search mode */
|
|
|
|
|
|
|
|
/* Bits 0-5 for divider MSB */
|
|
|
|
|
|
|
|
/* Second byte */
|
|
|
|
/* Bits 0-7 for divider LSB */
|
|
|
|
|
|
|
|
/* TNCTRL - Read: bytes 4 and 5 / Write: Bytes 3 and 4 */
|
|
|
|
|
|
|
|
/* first byte */
|
|
|
|
|
|
|
|
#define TEA5761_TNCTRL_PUPD_0 0x40 /* Power UP/Power Down MSB */
|
|
|
|
#define TEA5761_TNCTRL_BLIM 0X20 /* 1= Japan Frequencies, 0= European frequencies */
|
|
|
|
#define TEA5761_TNCTRL_SWPM 0x10 /* 1= software port is FRRFLAG */
|
|
|
|
#define TEA5761_TNCTRL_IFCTC 0x08 /* 1= IF count time 15.02 ms, 0= IF count time 2.02 ms */
|
|
|
|
#define TEA5761_TNCTRL_AFM 0x04
|
|
|
|
#define TEA5761_TNCTRL_SMUTE 0x02 /* 1= Soft mute */
|
|
|
|
#define TEA5761_TNCTRL_SNC 0x01
|
|
|
|
|
|
|
|
/* second byte */
|
|
|
|
|
|
|
|
#define TEA5761_TNCTRL_MU 0x80 /* 1=Hard mute */
|
|
|
|
#define TEA5761_TNCTRL_SSL_1 0x40
|
|
|
|
#define TEA5761_TNCTRL_SSL_0 0x20
|
|
|
|
#define TEA5761_TNCTRL_HLSI 0x10
|
|
|
|
#define TEA5761_TNCTRL_MST 0x08 /* 1 = mono */
|
|
|
|
#define TEA5761_TNCTRL_SWP 0x04
|
|
|
|
#define TEA5761_TNCTRL_DTC 0x02 /* 1 = deemphasis 50 us, 0 = deemphasis 75 us */
|
|
|
|
#define TEA5761_TNCTRL_AHLSI 0x01
|
|
|
|
|
|
|
|
/* FRQCHECK - Read: bytes 6 and 7 */
|
|
|
|
/* First byte */
|
|
|
|
|
|
|
|
/* Bits 0-5 for divider MSB */
|
|
|
|
|
|
|
|
/* Second byte */
|
|
|
|
/* Bits 0-7 for divider LSB */
|
|
|
|
|
|
|
|
/* TUNCHECK - Read: bytes 8 and 9 */
|
|
|
|
|
|
|
|
/* First byte */
|
|
|
|
#define TEA5761_TUNCHECK_IF_MASK 0x7e /* IF count */
|
|
|
|
#define TEA5761_TUNCHECK_TUNTO 0x01
|
|
|
|
|
|
|
|
/* Second byte */
|
|
|
|
#define TEA5761_TUNCHECK_LEV_MASK 0xf0 /* Level Count */
|
|
|
|
#define TEA5761_TUNCHECK_LD 0x08
|
|
|
|
#define TEA5761_TUNCHECK_STEREO 0x04
|
|
|
|
|
|
|
|
/* TESTREG - Read: bytes 10 and 11 / Write: bytes 5 and 6 */
|
|
|
|
|
|
|
|
/* All zero = no test mode */
|
|
|
|
|
|
|
|
/* MANID - Read: bytes 12 and 13 */
|
|
|
|
|
|
|
|
/* First byte - should be 0x10 */
|
|
|
|
#define TEA5767_MANID_VERSION_MASK 0xf0 /* Version = 1 */
|
|
|
|
#define TEA5767_MANID_ID_MSB_MASK 0x0f /* Manufacurer ID - should be 0 */
|
|
|
|
|
|
|
|
/* Second byte - Should be 0x2b */
|
|
|
|
|
|
|
|
#define TEA5767_MANID_ID_LSB_MASK 0xfe /* Manufacturer ID - should be 0x15 */
|
|
|
|
#define TEA5767_MANID_IDAV 0x01 /* 1 = Chip has ID, 0 = Chip has no ID */
|
|
|
|
|
|
|
|
/* Chip ID - Read: bytes 14 and 15 */
|
|
|
|
|
|
|
|
/* First byte - should be 0x57 */
|
|
|
|
|
|
|
|
/* Second byte - should be 0x61 */
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#define FREQ_OFFSET 0 /* for TEA5767, it is 700 to give the right freq */
|
|
|
|
static void tea5761_status_dump(unsigned char *buffer)
|
|
|
|
{
|
|
|
|
unsigned int div, frq;
|
|
|
|
|
|
|
|
div = ((buffer[2] & 0x3f) << 8) | buffer[3];
|
|
|
|
|
|
|
|
frq = 1000 * (div * 32768 / 1000 + FREQ_OFFSET + 225) / 4; /* Freq in KHz */
|
|
|
|
|
2008-04-23 00:41:53 +07:00
|
|
|
printk(KERN_INFO "tea5761: Frequency %d.%03d KHz (divider = 0x%04x)\n",
|
2007-04-08 11:09:11 +07:00
|
|
|
frq / 1000, frq % 1000, div);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Freq should be specifyed at 62.5 Hz */
|
2011-02-15 03:53:12 +07:00
|
|
|
static int __set_radio_freq(struct dvb_frontend *fe,
|
|
|
|
unsigned int freq,
|
|
|
|
bool mono)
|
2007-04-08 11:09:11 +07:00
|
|
|
{
|
2007-08-28 07:23:40 +07:00
|
|
|
struct tea5761_priv *priv = fe->tuner_priv;
|
2011-02-15 03:53:12 +07:00
|
|
|
unsigned int frq = freq;
|
2007-04-08 11:09:11 +07:00
|
|
|
unsigned char buffer[7] = {0, 0, 0, 0, 0, 0, 0 };
|
|
|
|
unsigned div;
|
|
|
|
int rc;
|
|
|
|
|
2007-08-28 07:23:40 +07:00
|
|
|
tuner_dbg("radio freq counter %d\n", frq);
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2011-02-15 03:53:12 +07:00
|
|
|
if (priv->standby) {
|
2007-04-08 11:09:11 +07:00
|
|
|
tuner_dbg("TEA5761 set to standby mode\n");
|
|
|
|
buffer[5] |= TEA5761_TNCTRL_MU;
|
|
|
|
} else {
|
|
|
|
buffer[4] |= TEA5761_TNCTRL_PUPD_0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-02-15 03:53:12 +07:00
|
|
|
if (mono) {
|
2007-04-08 11:09:11 +07:00
|
|
|
tuner_dbg("TEA5761 set to mono\n");
|
|
|
|
buffer[5] |= TEA5761_TNCTRL_MST;
|
|
|
|
} else {
|
|
|
|
tuner_dbg("TEA5761 set to stereo\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
div = (1000 * (frq * 4 / 16 + 700 + 225) ) >> 15;
|
|
|
|
buffer[1] = (div >> 8) & 0x3f;
|
|
|
|
buffer[2] = div & 0xff;
|
|
|
|
|
2007-08-28 07:23:40 +07:00
|
|
|
if (debug)
|
2007-04-08 11:09:11 +07:00
|
|
|
tea5761_status_dump(buffer);
|
|
|
|
|
2007-08-21 11:24:42 +07:00
|
|
|
if (7 != (rc = tuner_i2c_xfer_send(&priv->i2c_props, buffer, 7)))
|
2007-04-08 11:09:11 +07:00
|
|
|
tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc);
|
2007-08-28 07:23:40 +07:00
|
|
|
|
|
|
|
priv->frequency = frq * 125 / 2;
|
|
|
|
|
|
|
|
return 0;
|
2007-04-08 11:09:11 +07:00
|
|
|
}
|
|
|
|
|
2011-02-15 03:53:12 +07:00
|
|
|
static int set_radio_freq(struct dvb_frontend *fe,
|
|
|
|
struct analog_parameters *params)
|
|
|
|
{
|
|
|
|
struct tea5761_priv *priv = fe->analog_demod_priv;
|
|
|
|
|
|
|
|
priv->standby = false;
|
|
|
|
|
|
|
|
return __set_radio_freq(fe, params->frequency,
|
|
|
|
params->audmode == V4L2_TUNER_MODE_MONO);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int set_radio_sleep(struct dvb_frontend *fe)
|
|
|
|
{
|
|
|
|
struct tea5761_priv *priv = fe->analog_demod_priv;
|
|
|
|
|
|
|
|
priv->standby = true;
|
|
|
|
|
|
|
|
return __set_radio_freq(fe, priv->frequency, false);
|
|
|
|
}
|
|
|
|
|
2007-09-01 02:39:57 +07:00
|
|
|
static int tea5761_read_status(struct dvb_frontend *fe, char *buffer)
|
2007-04-08 11:09:11 +07:00
|
|
|
{
|
2007-08-28 07:23:40 +07:00
|
|
|
struct tea5761_priv *priv = fe->tuner_priv;
|
2007-09-01 02:39:57 +07:00
|
|
|
int rc;
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-09-01 02:39:57 +07:00
|
|
|
memset(buffer, 0, 16);
|
|
|
|
if (16 != (rc = tuner_i2c_xfer_recv(&priv->i2c_props, buffer, 16))) {
|
|
|
|
tuner_warn("i2c i/o error: rc == %d (should be 16)\n", rc);
|
|
|
|
return -EREMOTEIO;
|
|
|
|
}
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-09-01 02:39:57 +07:00
|
|
|
return 0;
|
2007-04-08 11:09:11 +07:00
|
|
|
}
|
|
|
|
|
2007-09-01 02:39:57 +07:00
|
|
|
static inline int tea5761_signal(struct dvb_frontend *fe, const char *buffer)
|
2007-04-08 11:09:11 +07:00
|
|
|
{
|
2007-08-28 07:23:40 +07:00
|
|
|
struct tea5761_priv *priv = fe->tuner_priv;
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-09-01 02:39:57 +07:00
|
|
|
int signal = ((buffer[9] & TEA5761_TUNCHECK_LEV_MASK) << (13 - 4));
|
|
|
|
|
|
|
|
tuner_dbg("Signal strength: %d\n", signal);
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-09-01 02:39:57 +07:00
|
|
|
return signal;
|
|
|
|
}
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-09-01 02:39:57 +07:00
|
|
|
static inline int tea5761_stereo(struct dvb_frontend *fe, const char *buffer)
|
|
|
|
{
|
|
|
|
struct tea5761_priv *priv = fe->tuner_priv;
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-09-01 02:39:57 +07:00
|
|
|
int stereo = buffer[9] & TEA5761_TUNCHECK_STEREO;
|
|
|
|
|
|
|
|
tuner_dbg("Radio ST GET = %02x\n", stereo);
|
|
|
|
|
|
|
|
return (stereo ? V4L2_TUNER_SUB_STEREO : 0);
|
2007-04-08 11:09:11 +07:00
|
|
|
}
|
|
|
|
|
2007-08-28 07:23:40 +07:00
|
|
|
static int tea5761_get_status(struct dvb_frontend *fe, u32 *status)
|
|
|
|
{
|
2007-09-01 02:39:57 +07:00
|
|
|
unsigned char buffer[16];
|
2007-08-28 07:23:40 +07:00
|
|
|
|
|
|
|
*status = 0;
|
|
|
|
|
2007-09-01 02:39:57 +07:00
|
|
|
if (0 == tea5761_read_status(fe, buffer)) {
|
|
|
|
if (tea5761_signal(fe, buffer))
|
|
|
|
*status = TUNER_STATUS_LOCKED;
|
|
|
|
if (tea5761_stereo(fe, buffer))
|
|
|
|
*status |= TUNER_STATUS_STEREO;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int tea5761_get_rf_strength(struct dvb_frontend *fe, u16 *strength)
|
|
|
|
{
|
|
|
|
unsigned char buffer[16];
|
|
|
|
|
|
|
|
*strength = 0;
|
2007-08-28 07:23:40 +07:00
|
|
|
|
2007-09-01 02:39:57 +07:00
|
|
|
if (0 == tea5761_read_status(fe, buffer))
|
|
|
|
*strength = tea5761_signal(fe, buffer);
|
2007-08-28 07:23:40 +07:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int tea5761_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr)
|
2007-04-08 11:09:11 +07:00
|
|
|
{
|
|
|
|
unsigned char buffer[16];
|
|
|
|
int rc;
|
2007-08-28 07:23:40 +07:00
|
|
|
struct tuner_i2c_props i2c = { .adap = i2c_adap, .addr = i2c_addr };
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-08-21 11:24:42 +07:00
|
|
|
if (16 != (rc = tuner_i2c_xfer_recv(&i2c, buffer, 16))) {
|
2007-08-28 07:23:40 +07:00
|
|
|
printk(KERN_WARNING "it is not a TEA5761. Received %i chars.\n", rc);
|
2008-04-24 03:27:27 +07:00
|
|
|
return -EINVAL;
|
2007-04-08 11:09:11 +07:00
|
|
|
}
|
|
|
|
|
2008-04-24 03:27:27 +07:00
|
|
|
if ((buffer[13] != 0x2b) || (buffer[14] != 0x57) || (buffer[15] != 0x061)) {
|
[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-19 02:44:26 +07:00
|
|
|
printk(KERN_WARNING "Manufacturer ID= 0x%02x, Chip ID = %02x%02x. It is not a TEA5761\n",
|
2008-04-24 03:27:27 +07:00
|
|
|
buffer[13], buffer[14], buffer[15]);
|
|
|
|
return -EINVAL;
|
2007-04-08 11:09:11 +07:00
|
|
|
}
|
[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-19 02:44:26 +07:00
|
|
|
printk(KERN_WARNING "tea5761: TEA%02x%02x detected. Manufacturer ID= 0x%02x\n",
|
2008-04-24 03:27:27 +07:00
|
|
|
buffer[14], buffer[15], buffer[13]);
|
|
|
|
|
2007-08-28 07:23:40 +07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-11-19 05:30:51 +07:00
|
|
|
static void tea5761_release(struct dvb_frontend *fe)
|
|
|
|
{
|
|
|
|
kfree(fe->tuner_priv);
|
|
|
|
fe->tuner_priv = NULL;
|
|
|
|
}
|
|
|
|
|
2007-08-28 07:23:40 +07:00
|
|
|
static int tea5761_get_frequency(struct dvb_frontend *fe, u32 *frequency)
|
2007-08-21 11:24:42 +07:00
|
|
|
{
|
2007-08-28 07:23:40 +07:00
|
|
|
struct tea5761_priv *priv = fe->tuner_priv;
|
|
|
|
*frequency = priv->frequency;
|
|
|
|
return 0;
|
2007-08-21 11:24:42 +07:00
|
|
|
}
|
|
|
|
|
2016-09-11 21:44:13 +07:00
|
|
|
static const struct dvb_tuner_ops tea5761_tuner_ops = {
|
2007-08-28 07:23:40 +07:00
|
|
|
.info = {
|
|
|
|
.name = "tea5761", // Philips TEA5761HN FM Radio
|
|
|
|
},
|
|
|
|
.set_analog_params = set_radio_freq,
|
2011-02-15 03:53:12 +07:00
|
|
|
.sleep = set_radio_sleep,
|
2016-11-19 05:30:51 +07:00
|
|
|
.release = tea5761_release,
|
2007-08-28 07:23:40 +07:00
|
|
|
.get_frequency = tea5761_get_frequency,
|
|
|
|
.get_status = tea5761_get_status,
|
2007-09-01 02:39:57 +07:00
|
|
|
.get_rf_strength = tea5761_get_rf_strength,
|
2007-06-07 02:16:29 +07:00
|
|
|
};
|
|
|
|
|
2007-08-28 07:23:40 +07:00
|
|
|
struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
|
|
|
|
struct i2c_adapter* i2c_adap,
|
|
|
|
u8 i2c_addr)
|
2007-04-08 11:09:11 +07:00
|
|
|
{
|
2007-08-21 11:24:42 +07:00
|
|
|
struct tea5761_priv *priv = NULL;
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2008-05-12 05:51:07 +07:00
|
|
|
if (tea5761_autodetection(i2c_adap, i2c_addr) != 0)
|
2007-08-28 07:23:40 +07:00
|
|
|
return NULL;
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-08-21 11:24:42 +07:00
|
|
|
priv = kzalloc(sizeof(struct tea5761_priv), GFP_KERNEL);
|
|
|
|
if (priv == NULL)
|
2007-08-28 07:23:40 +07:00
|
|
|
return NULL;
|
|
|
|
fe->tuner_priv = priv;
|
2007-08-21 11:24:42 +07:00
|
|
|
|
2007-08-28 07:23:40 +07:00
|
|
|
priv->i2c_props.addr = i2c_addr;
|
|
|
|
priv->i2c_props.adap = i2c_adap;
|
2008-04-23 00:41:53 +07:00
|
|
|
priv->i2c_props.name = "tea5761";
|
2007-08-21 11:24:42 +07:00
|
|
|
|
2007-08-28 07:23:40 +07:00
|
|
|
memcpy(&fe->ops.tuner_ops, &tea5761_tuner_ops,
|
|
|
|
sizeof(struct dvb_tuner_ops));
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-08-28 07:23:40 +07:00
|
|
|
tuner_info("type set to %s\n", "Philips TEA5761HN FM Radio");
|
2007-04-08 11:09:11 +07:00
|
|
|
|
2007-08-28 07:23:40 +07:00
|
|
|
return fe;
|
2007-04-08 11:09:11 +07:00
|
|
|
}
|
2007-08-28 07:23:40 +07:00
|
|
|
|
|
|
|
|
|
|
|
EXPORT_SYMBOL_GPL(tea5761_attach);
|
|
|
|
EXPORT_SYMBOL_GPL(tea5761_autodetection);
|
|
|
|
|
|
|
|
MODULE_DESCRIPTION("Philips TEA5761 FM tuner driver");
|
MAINTAINERS & files: Canonize the e-mails I use at files
From now on, I'll start using my @kernel.org as my development e-mail.
As such, let's remove the entries that point to the old
mchehab@s-opensource.com at MAINTAINERS file.
For the files written with a copyright with mchehab@s-opensource,
let's keep Samsung on their names, using mchehab+samsung@kernel.org,
in order to keep pointing to my employer, with sponsors the work.
For the files written before I join Samsung (on July, 4 2013),
let's just use mchehab@kernel.org.
For bug reports, we can simply point to just kernel.org, as
this will reach my mchehab+samsung inbox anyway.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Brian Warner <brian.warner@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-04-25 16:34:48 +07:00
|
|
|
MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>");
|
2017-12-01 20:47:09 +07:00
|
|
|
MODULE_LICENSE("GPL v2");
|