aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/common/tuners
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-06-14 16:35:59 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-13 23:40:28 -0300
commitccae7af2bf07dfef69cc2eb6ebc9e1ff15addfbd (patch)
treef33391cf2efe9038c13b88ca4049317728a7ebf0 /drivers/media/common/tuners
parent3785bc170f79ef04129731582b468c28e1326d6d (diff)
[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>
Diffstat (limited to 'drivers/media/common/tuners')
-rw-r--r--drivers/media/common/tuners/Kconfig243
-rw-r--r--drivers/media/common/tuners/Makefile37
-rw-r--r--drivers/media/common/tuners/fc0011.c524
-rw-r--r--drivers/media/common/tuners/fc0011.h41
-rw-r--r--drivers/media/common/tuners/fc0012-priv.h43
-rw-r--r--drivers/media/common/tuners/fc0012.c467
-rw-r--r--drivers/media/common/tuners/fc0012.h44
-rw-r--r--drivers/media/common/tuners/fc0013-priv.h44
-rw-r--r--drivers/media/common/tuners/fc0013.c634
-rw-r--r--drivers/media/common/tuners/fc0013.h57
-rw-r--r--drivers/media/common/tuners/fc001x-common.h39
-rw-r--r--drivers/media/common/tuners/max2165.c433
-rw-r--r--drivers/media/common/tuners/max2165.h48
-rw-r--r--drivers/media/common/tuners/max2165_priv.h60
-rw-r--r--drivers/media/common/tuners/mc44s803.c372
-rw-r--r--drivers/media/common/tuners/mc44s803.h46
-rw-r--r--drivers/media/common/tuners/mc44s803_priv.h208
-rw-r--r--drivers/media/common/tuners/mt2060.c403
-rw-r--r--drivers/media/common/tuners/mt2060.h43
-rw-r--r--drivers/media/common/tuners/mt2060_priv.h104
-rw-r--r--drivers/media/common/tuners/mt2063.c2307
-rw-r--r--drivers/media/common/tuners/mt2063.h32
-rw-r--r--drivers/media/common/tuners/mt20xx.c670
-rw-r--r--drivers/media/common/tuners/mt20xx.h37
-rw-r--r--drivers/media/common/tuners/mt2131.c301
-rw-r--r--drivers/media/common/tuners/mt2131.h54
-rw-r--r--drivers/media/common/tuners/mt2131_priv.h48
-rw-r--r--drivers/media/common/tuners/mt2266.c353
-rw-r--r--drivers/media/common/tuners/mt2266.h37
-rw-r--r--drivers/media/common/tuners/mxl5005s.c4109
-rw-r--r--drivers/media/common/tuners/mxl5005s.h135
-rw-r--r--drivers/media/common/tuners/mxl5007t.c928
-rw-r--r--drivers/media/common/tuners/mxl5007t.h104
-rw-r--r--drivers/media/common/tuners/qt1010.c480
-rw-r--r--drivers/media/common/tuners/qt1010.h53
-rw-r--r--drivers/media/common/tuners/qt1010_priv.h104
-rw-r--r--drivers/media/common/tuners/tda18212.c319
-rw-r--r--drivers/media/common/tuners/tda18212.h52
-rw-r--r--drivers/media/common/tuners/tda18218.c342
-rw-r--r--drivers/media/common/tuners/tda18218.h45
-rw-r--r--drivers/media/common/tuners/tda18218_priv.h108
-rw-r--r--drivers/media/common/tuners/tda18271-common.c703
-rw-r--r--drivers/media/common/tuners/tda18271-fe.c1345
-rw-r--r--drivers/media/common/tuners/tda18271-maps.c1317
-rw-r--r--drivers/media/common/tuners/tda18271-priv.h236
-rw-r--r--drivers/media/common/tuners/tda18271.h134
-rw-r--r--drivers/media/common/tuners/tda827x.c917
-rw-r--r--drivers/media/common/tuners/tda827x.h68
-rw-r--r--drivers/media/common/tuners/tda8290.c874
-rw-r--r--drivers/media/common/tuners/tda8290.h56
-rw-r--r--drivers/media/common/tuners/tda9887.c717
-rw-r--r--drivers/media/common/tuners/tda9887.h38
-rw-r--r--drivers/media/common/tuners/tea5761.c348
-rw-r--r--drivers/media/common/tuners/tea5761.h47
-rw-r--r--drivers/media/common/tuners/tea5767.c475
-rw-r--r--drivers/media/common/tuners/tea5767.h66
-rw-r--r--drivers/media/common/tuners/tua9001.c215
-rw-r--r--drivers/media/common/tuners/tua9001.h46
-rw-r--r--drivers/media/common/tuners/tua9001_priv.h34
-rw-r--r--drivers/media/common/tuners/tuner-i2c.h182
-rw-r--r--drivers/media/common/tuners/tuner-simple.c1155
-rw-r--r--drivers/media/common/tuners/tuner-simple.h39
-rw-r--r--drivers/media/common/tuners/tuner-types.c1883
-rw-r--r--drivers/media/common/tuners/tuner-xc2028-types.h141
-rw-r--r--drivers/media/common/tuners/tuner-xc2028.c1509
-rw-r--r--drivers/media/common/tuners/tuner-xc2028.h72
-rw-r--r--drivers/media/common/tuners/xc4000.c1757
-rw-r--r--drivers/media/common/tuners/xc4000.h67
-rw-r--r--drivers/media/common/tuners/xc5000.c1366
-rw-r--r--drivers/media/common/tuners/xc5000.h74
70 files changed, 0 insertions, 30389 deletions
diff --git a/drivers/media/common/tuners/Kconfig b/drivers/media/common/tuners/Kconfig
deleted file mode 100644
index 94c6ff7a5da..00000000000
--- a/drivers/media/common/tuners/Kconfig
+++ /dev/null
@@ -1,243 +0,0 @@
-config MEDIA_ATTACH
- bool "Load and attach frontend and tuner driver modules as needed"
- depends on MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT
- depends on MODULES
- default y if !EXPERT
- help
- Remove the static dependency of DVB card drivers on all
- frontend modules for all possible card variants. Instead,
- allow the card drivers to only load the frontend modules
- they require.
-
- Also, tuner module will automatically load a tuner driver
- when needed, for analog mode.
-
- This saves several KBytes of memory.
-
- Note: You will need module-init-tools v3.2 or later for this feature.
-
- If unsure say Y.
-
-config MEDIA_TUNER
- tristate
- depends on (MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT) && I2C
- default y
- select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE
- select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMISE
- select MEDIA_TUNER_XC4000 if !MEDIA_TUNER_CUSTOMISE
- select MEDIA_TUNER_MT20XX if !MEDIA_TUNER_CUSTOMISE
- select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE
- select MEDIA_TUNER_TEA5761 if !MEDIA_TUNER_CUSTOMISE && MEDIA_RADIO_SUPPORT && EXPERIMENTAL
- select MEDIA_TUNER_TEA5767 if !MEDIA_TUNER_CUSTOMISE && MEDIA_RADIO_SUPPORT
- select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE
- select MEDIA_TUNER_TDA9887 if !MEDIA_TUNER_CUSTOMISE
- select MEDIA_TUNER_MC44S803 if !MEDIA_TUNER_CUSTOMISE
-
-config MEDIA_TUNER_CUSTOMISE
- bool "Customize analog and hybrid tuner modules to build"
- depends on MEDIA_TUNER
- default y if EXPERT
- help
- This allows the user to deselect tuner drivers unnecessary
- for their hardware from the build. Use this option with care
- as deselecting tuner drivers which are in fact necessary will
- result in V4L/DVB devices which cannot be tuned due to lack of
- driver support
-
- If unsure say N.
-
-menu "Customize TV tuners"
- visible if MEDIA_TUNER_CUSTOMISE
- depends on MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT
-
-config MEDIA_TUNER_SIMPLE
- tristate "Simple tuner support"
- depends on MEDIA_SUPPORT && I2C
- select MEDIA_TUNER_TDA9887
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Say Y here to include support for various simple tuners.
-
-config MEDIA_TUNER_TDA8290
- tristate "TDA 8290/8295 + 8275(a)/18271 tuner combo"
- depends on MEDIA_SUPPORT && I2C
- select MEDIA_TUNER_TDA827X
- select MEDIA_TUNER_TDA18271
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Say Y here to include support for Philips TDA8290+8275(a) tuner.
-
-config MEDIA_TUNER_TDA827X
- tristate "Philips TDA827X silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A DVB-T silicon tuner module. Say Y when you want to support this tuner.
-
-config MEDIA_TUNER_TDA18271
- tristate "NXP TDA18271 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A silicon tuner module. Say Y when you want to support this tuner.
-
-config MEDIA_TUNER_TDA9887
- tristate "TDA 9885/6/7 analog IF demodulator"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Say Y here to include support for Philips TDA9885/6/7
- analog IF demodulator.
-
-config MEDIA_TUNER_TEA5761
- tristate "TEA 5761 radio tuner (EXPERIMENTAL)"
- depends on MEDIA_SUPPORT && I2C
- depends on EXPERIMENTAL
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Say Y here to include support for the Philips TEA5761 radio tuner.
-
-config MEDIA_TUNER_TEA5767
- tristate "TEA 5767 radio tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Say Y here to include support for the Philips TEA5767 radio tuner.
-
-config MEDIA_TUNER_MT20XX
- tristate "Microtune 2032 / 2050 tuners"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Say Y here to include support for the MT2032 / MT2050 tuner.
-
-config MEDIA_TUNER_MT2060
- tristate "Microtune MT2060 silicon IF tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A driver for the silicon IF tuner MT2060 from Microtune.
-
-config MEDIA_TUNER_MT2063
- tristate "Microtune MT2063 silicon IF tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A driver for the silicon IF tuner MT2063 from Microtune.
-
-config MEDIA_TUNER_MT2266
- tristate "Microtune MT2266 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A driver for the silicon baseband tuner MT2266 from Microtune.
-
-config MEDIA_TUNER_MT2131
- tristate "Microtune MT2131 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A driver for the silicon baseband tuner MT2131 from Microtune.
-
-config MEDIA_TUNER_QT1010
- tristate "Quantek QT1010 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A driver for the silicon tuner QT1010 from Quantek.
-
-config MEDIA_TUNER_XC2028
- tristate "XCeive xc2028/xc3028 tuners"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Say Y here to include support for the xc2028/xc3028 tuners.
-
-config MEDIA_TUNER_XC5000
- tristate "Xceive XC5000 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A driver for the silicon tuner XC5000 from Xceive.
- This device is only used inside a SiP called together with a
- demodulator for now.
-
-config MEDIA_TUNER_XC4000
- tristate "Xceive XC4000 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A driver for the silicon tuner XC4000 from Xceive.
- This device is only used inside a SiP called together with a
- demodulator for now.
-
-config MEDIA_TUNER_MXL5005S
- tristate "MaxLinear MSL5005S silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A driver for the silicon tuner MXL5005S from MaxLinear.
-
-config MEDIA_TUNER_MXL5007T
- tristate "MaxLinear MxL5007T silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A driver for the silicon tuner MxL5007T from MaxLinear.
-
-config MEDIA_TUNER_MC44S803
- tristate "Freescale MC44S803 Low Power CMOS Broadband tuners"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Say Y here to support the Freescale MC44S803 based tuners
-
-config MEDIA_TUNER_MAX2165
- tristate "Maxim MAX2165 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- A driver for the silicon tuner MAX2165 from Maxim.
-
-config MEDIA_TUNER_TDA18218
- tristate "NXP TDA18218 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- NXP TDA18218 silicon tuner driver.
-
-config MEDIA_TUNER_FC0011
- tristate "Fitipower FC0011 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Fitipower FC0011 silicon tuner driver.
-
-config MEDIA_TUNER_FC0012
- tristate "Fitipower FC0012 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Fitipower FC0012 silicon tuner driver.
-
-config MEDIA_TUNER_FC0013
- tristate "Fitipower FC0013 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Fitipower FC0013 silicon tuner driver.
-
-config MEDIA_TUNER_TDA18212
- tristate "NXP TDA18212 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- NXP TDA18212 silicon tuner driver.
-
-config MEDIA_TUNER_TUA9001
- tristate "Infineon TUA 9001 silicon tuner"
- depends on MEDIA_SUPPORT && I2C
- default m if MEDIA_TUNER_CUSTOMISE
- help
- Infineon TUA 9001 silicon tuner driver.
-endmenu
diff --git a/drivers/media/common/tuners/Makefile b/drivers/media/common/tuners/Makefile
deleted file mode 100644
index 112aeee9020..00000000000
--- a/drivers/media/common/tuners/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Makefile for common V4L/DVB tuners
-#
-
-tda18271-objs := tda18271-maps.o tda18271-common.o tda18271-fe.o
-
-obj-$(CONFIG_MEDIA_TUNER_XC2028) += tuner-xc2028.o
-obj-$(CONFIG_MEDIA_TUNER_SIMPLE) += tuner-simple.o
-# tuner-types will be merged into tuner-simple, in the future
-obj-$(CONFIG_MEDIA_TUNER_SIMPLE) += tuner-types.o
-obj-$(CONFIG_MEDIA_TUNER_MT20XX) += mt20xx.o
-obj-$(CONFIG_MEDIA_TUNER_TDA8290) += tda8290.o
-obj-$(CONFIG_MEDIA_TUNER_TEA5767) += tea5767.o
-obj-$(CONFIG_MEDIA_TUNER_TEA5761) += tea5761.o
-obj-$(CONFIG_MEDIA_TUNER_TDA9887) += tda9887.o
-obj-$(CONFIG_MEDIA_TUNER_TDA827X) += tda827x.o
-obj-$(CONFIG_MEDIA_TUNER_TDA18271) += tda18271.o
-obj-$(CONFIG_MEDIA_TUNER_XC5000) += xc5000.o
-obj-$(CONFIG_MEDIA_TUNER_XC4000) += xc4000.o
-obj-$(CONFIG_MEDIA_TUNER_MT2060) += mt2060.o
-obj-$(CONFIG_MEDIA_TUNER_MT2063) += mt2063.o
-obj-$(CONFIG_MEDIA_TUNER_MT2266) += mt2266.o
-obj-$(CONFIG_MEDIA_TUNER_QT1010) += qt1010.o
-obj-$(CONFIG_MEDIA_TUNER_MT2131) += mt2131.o
-obj-$(CONFIG_MEDIA_TUNER_MXL5005S) += mxl5005s.o
-obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o
-obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o
-obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o
-obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o
-obj-$(CONFIG_MEDIA_TUNER_TDA18212) += tda18212.o
-obj-$(CONFIG_MEDIA_TUNER_TUA9001) += tua9001.o
-obj-$(CONFIG_MEDIA_TUNER_FC0011) += fc0011.o
-obj-$(CONFIG_MEDIA_TUNER_FC0012) += fc0012.o
-obj-$(CONFIG_MEDIA_TUNER_FC0013) += fc0013.o
-
-ccflags-y += -I$(srctree)/drivers/media/dvb-core
-ccflags-y += -I$(srctree)/drivers/media/dvb-frontends
diff --git a/drivers/media/common/tuners/fc0011.c b/drivers/media/common/tuners/fc0011.c
deleted file mode 100644
index e4882546c28..00000000000
--- a/drivers/media/common/tuners/fc0011.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * Fitipower FC0011 tuner driver
- *
- * Copyright (C) 2012 Michael Buesch <m@bues.ch>
- *
- * Derived from FC0012 tuner driver:
- * Copyright (C) 2012 Hans-Frieder Vogt <hfvogt@gmx.net>
- *
- * 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.
- */
-
-#include "fc0011.h"
-
-
-/* Tuner registers */
-enum {
- FC11_REG_0,
- FC11_REG_FA, /* FA */
- FC11_REG_FP, /* FP */
- FC11_REG_XINHI, /* XIN high 8 bit */
- FC11_REG_XINLO, /* XIN low 8 bit */
- FC11_REG_VCO, /* VCO */
- FC11_REG_VCOSEL, /* VCO select */
- FC11_REG_7, /* Unknown tuner reg 7 */
- FC11_REG_8, /* Unknown tuner reg 8 */
- FC11_REG_9,
- FC11_REG_10, /* Unknown tuner reg 10 */
- FC11_REG_11, /* Unknown tuner reg 11 */
- FC11_REG_12,
- FC11_REG_RCCAL, /* RC calibrate */
- FC11_REG_VCOCAL, /* VCO calibrate */
- FC11_REG_15,
- FC11_REG_16, /* Unknown tuner reg 16 */
- FC11_REG_17,
-
- FC11_NR_REGS, /* Number of registers */
-};
-
-enum FC11_REG_VCOSEL_bits {
- FC11_VCOSEL_2 = 0x08, /* VCO select 2 */
- FC11_VCOSEL_1 = 0x10, /* VCO select 1 */
- FC11_VCOSEL_CLKOUT = 0x20, /* Fix clock out */
- FC11_VCOSEL_BW7M = 0x40, /* 7MHz bw */
- FC11_VCOSEL_BW6M = 0x80, /* 6MHz bw */
-};
-
-enum FC11_REG_RCCAL_bits {
- FC11_RCCAL_FORCE = 0x10, /* force */
-};
-
-enum FC11_REG_VCOCAL_bits {
- FC11_VCOCAL_RUN = 0, /* VCO calibration run */
- FC11_VCOCAL_VALUEMASK = 0x3F, /* VCO calibration value mask */
- FC11_VCOCAL_OK = 0x40, /* VCO calibration Ok */
- FC11_VCOCAL_RESET = 0x80, /* VCO calibration reset */
-};
-
-
-struct fc0011_priv {
- struct i2c_adapter *i2c;
- u8 addr;
-
- u32 frequency;
- u32 bandwidth;
-};
-
-
-static int fc0011_writereg(struct fc0011_priv *priv, u8 reg, u8 val)
-{
- u8 buf[2] = { reg, val };
- struct i2c_msg msg = { .addr = priv->addr,
- .flags = 0, .buf = buf, .len = 2 };
-
- if (i2c_transfer(priv->i2c, &msg, 1) != 1) {
- dev_err(&priv->i2c->dev,
- "I2C write reg failed, reg: %02x, val: %02x\n",
- reg, val);
- return -EIO;
- }
-
- return 0;
-}
-
-static int fc0011_readreg(struct fc0011_priv *priv, u8 reg, u8 *val)
-{
- u8 dummy;
- struct i2c_msg msg[2] = {
- { .addr = priv->addr,
- .flags = 0, .buf = &reg, .len = 1 },
- { .addr = priv->addr,
- .flags = I2C_M_RD, .buf = val ? : &dummy, .len = 1 },
- };
-
- if (i2c_transfer(priv->i2c, msg, 2) != 2) {
- dev_err(&priv->i2c->dev,
- "I2C read failed, reg: %02x\n", reg);
- return -EIO;
- }
-
- return 0;
-}
-
-static int fc0011_release(struct dvb_frontend *fe)
-{
- kfree(fe->tuner_priv);
- fe->tuner_priv = NULL;
-
- return 0;
-}
-
-static int fc0011_init(struct dvb_frontend *fe)
-{
- struct fc0011_priv *priv = fe->tuner_priv;
- int err;
-
- if (WARN_ON(!fe->callback))
- return -EINVAL;
-
- err = fe->callback(priv->i2c, DVB_FRONTEND_COMPONENT_TUNER,
- FC0011_FE_CALLBACK_POWER, priv->addr);
- if (err) {
- dev_err(&priv->i2c->dev, "Power-on callback failed\n");
- return err;
- }
- err = fe->callback(priv->i2c, DVB_FRONTEND_COMPONENT_TUNER,
- FC0011_FE_CALLBACK_RESET, priv->addr);
- if (err) {
- dev_err(&priv->i2c->dev, "Reset callback failed\n");
- return err;
- }
-
- return 0;
-}
-
-/* Initiate VCO calibration */
-static int fc0011_vcocal_trigger(struct fc0011_priv *priv)
-{
- int err;
-
- err = fc0011_writereg(priv, FC11_REG_VCOCAL, FC11_VCOCAL_RESET);
- if (err)
- return err;
- err = fc0011_writereg(priv, FC11_REG_VCOCAL, FC11_VCOCAL_RUN);
- if (err)
- return err;
-
- return 0;
-}
-
-/* Read VCO calibration value */
-static int fc0011_vcocal_read(struct fc0011_priv *priv, u8 *value)
-{
- int err;
-
- err = fc0011_writereg(priv, FC11_REG_VCOCAL, FC11_VCOCAL_RUN);
- if (err)
- return err;
- usleep_range(10000, 20000);
- err = fc0011_readreg(priv, FC11_REG_VCOCAL, value);
- if (err)
- return err;
-
- return 0;
-}
-
-static int fc0011_set_params(struct dvb_frontend *fe)
-{
- struct dtv_frontend_properties *p = &fe->dtv_property_cache;
- struct fc0011_priv *priv = fe->tuner_priv;
- int err;
- unsigned int i, vco_retries;
- u32 freq = p->frequency / 1000;
- u32 bandwidth = p->bandwidth_hz / 1000;
- u32 fvco, xin, xdiv, xdivr;
- u16 frac;
- u8 fa, fp, vco_sel, vco_cal;
- u8 regs[FC11_NR_REGS] = { };
-
- regs[FC11_REG_7] = 0x0F;
- regs[FC11_REG_8] = 0x3E;
- regs[FC11_REG_10] = 0xB8;
- regs[FC11_REG_11] = 0x80;
- regs[FC11_REG_RCCAL] = 0x04;
- err = fc0011_writereg(priv, FC11_REG_7, regs[FC11_REG_7]);
- err |= fc0011_writereg(priv, FC11_REG_8, regs[FC11_REG_8]);
- err |= fc0011_writereg(priv, FC11_REG_10, regs[FC11_REG_10]);
- err |= fc0011_writereg(priv, FC11_REG_11, regs[FC11_REG_11]);
- err |= fc0011_writereg(priv, FC11_REG_RCCAL, regs[FC11_REG_RCCAL]);
- if (err)
- return -EIO;
-
- /* Set VCO freq and VCO div */
- if (freq < 54000) {
- fvco = freq * 64;
- regs[FC11_REG_VCO] = 0x82;
- } else if (freq < 108000) {
- fvco = freq * 32;
- regs[FC11_REG_VCO] = 0x42;
- } else if (freq < 216000) {
- fvco = freq * 16;
- regs[FC11_REG_VCO] = 0x22;
- } else if (freq < 432000) {
- fvco = freq * 8;
- regs[FC11_REG_VCO] = 0x12;