diff options
Diffstat (limited to 'drivers/media/tuners/tea5767.c')
| -rw-r--r-- | drivers/media/tuners/tea5767.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/drivers/media/tuners/tea5767.c b/drivers/media/tuners/tea5767.c index 36e85d81acb2..ef4acb1f1bfa 100644 --- a/drivers/media/tuners/tea5767.c +++ b/drivers/media/tuners/tea5767.c @@ -1,14 +1,13 @@ -/* - * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview - * I2C address is allways 0xC0. - * - * - * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@infradead.org) - * This code is placed under the terms of the GNU General Public License - * - * tea5767 autodetection thanks to Torsten Seeboth and Atsushi Nakagawa - * from their contributions on DScaler. - */ +// SPDX-License-Identifier: GPL-2.0 +// For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview +// I2C address is always 0xC0. +// +// Copyright (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org> +// +// tea5767 autodetection thanks to Torsten Seeboth and Atsushi Nakagawa +// from their contributions on DScaler. + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/i2c.h> #include <linux/slab.h> @@ -45,7 +44,7 @@ struct tea5767_priv { /* Third register */ -/* Station search from botton to up */ +/* Station search from bottom to up */ #define TEA5767_SEARCH_UP 0x80 /* Searches with ADC output = 10 */ @@ -184,7 +183,7 @@ static void tea5767_status_dump(struct tea5767_priv *priv, (buffer[4] & TEA5767_RESERVED_MASK)); } -/* Freq should be specifyed at 62.5 Hz */ +/* Freq should be specified at 62.5 Hz */ static int set_radio_freq(struct dvb_frontend *fe, struct analog_parameters *params) { @@ -370,17 +369,18 @@ int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr) { struct tuner_i2c_props i2c = { .adap = i2c_adap, .addr = i2c_addr }; unsigned char buffer[7] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + int rc; if ((rc = tuner_i2c_xfer_recv(&i2c, buffer, 7))< 5) { - printk(KERN_WARNING "It is not a TEA5767. Received %i bytes.\n", rc); + pr_warn("It is not a TEA5767. Received %i bytes.\n", rc); return -EINVAL; } /* If all bytes are the same then it's a TV tuner and not a tea5767 */ if (buffer[0] == buffer[1] && buffer[0] == buffer[2] && buffer[0] == buffer[3] && buffer[0] == buffer[4]) { - printk(KERN_WARNING "All bytes are equal. It is not a TEA5767\n"); + pr_warn("All bytes are equal. It is not a TEA5767\n"); return -EINVAL; } @@ -390,7 +390,7 @@ int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr) * Byte 5: bit 7:0 : == 0 */ if (((buffer[3] & 0x0f) != 0x00) || (buffer[4] != 0x00)) { - printk(KERN_WARNING "Chip ID is not zero. It is not a TEA5767\n"); + pr_warn("Chip ID is not zero. It is not a TEA5767\n"); return -EINVAL; } @@ -398,12 +398,10 @@ int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr) return 0; } -static int tea5767_release(struct dvb_frontend *fe) +static void tea5767_release(struct dvb_frontend *fe) { kfree(fe->tuner_priv); fe->tuner_priv = NULL; - - return 0; } static int tea5767_get_frequency(struct dvb_frontend *fe, u32 *frequency) @@ -423,7 +421,7 @@ static int tea5767_set_config (struct dvb_frontend *fe, void *priv_cfg) return 0; } -static struct dvb_tuner_ops tea5767_tuner_ops = { +static const struct dvb_tuner_ops tea5767_tuner_ops = { .info = { .name = "tea5767", // Philips TEA5767HN FM Radio }, @@ -471,5 +469,5 @@ EXPORT_SYMBOL_GPL(tea5767_attach); EXPORT_SYMBOL_GPL(tea5767_autodetection); MODULE_DESCRIPTION("Philips TEA5767 FM tuner driver"); -MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); -MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); +MODULE_LICENSE("GPL v2"); |
