Commit 81e19912 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] af9033: style related and minor changes

Fix coding style and other small issues.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent c2feb9ff
...@@ -13,10 +13,6 @@ ...@@ -13,10 +13,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "af9033_priv.h" #include "af9033_priv.h"
...@@ -41,18 +37,19 @@ struct af9033_dev { ...@@ -41,18 +37,19 @@ struct af9033_dev {
u64 total_block_count; u64 total_block_count;
}; };
/* write reg val table using reg addr auto increment */ /* Write reg val table using reg addr auto increment */
static int af9033_wr_reg_val_tab(struct af9033_dev *dev, static int af9033_wr_reg_val_tab(struct af9033_dev *dev,
const struct reg_val *tab, int tab_len) const struct reg_val *tab, int tab_len)
{ {
struct i2c_client *client = dev->client;
#define MAX_TAB_LEN 212 #define MAX_TAB_LEN 212
int ret, i, j; int ret, i, j;
u8 buf[1 + MAX_TAB_LEN]; u8 buf[1 + MAX_TAB_LEN];
dev_dbg(&dev->client->dev, "tab_len=%d\n", tab_len); dev_dbg(&client->dev, "tab_len=%d\n", tab_len);
if (tab_len > sizeof(buf)) { if (tab_len > sizeof(buf)) {
dev_warn(&dev->client->dev, "tab len %d is too big\n", tab_len); dev_warn(&client->dev, "tab len %d is too big\n", tab_len);
return -EINVAL; return -EINVAL;
} }
...@@ -72,16 +69,15 @@ static int af9033_wr_reg_val_tab(struct af9033_dev *dev, ...@@ -72,16 +69,15 @@ static int af9033_wr_reg_val_tab(struct af9033_dev *dev,
} }
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
static int af9033_init(struct dvb_frontend *fe) static int af9033_init(struct dvb_frontend *fe)
{ {
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i, len; int ret, i, len;
unsigned int utmp; unsigned int utmp;
...@@ -116,7 +112,9 @@ static int af9033_init(struct dvb_frontend *fe) ...@@ -116,7 +112,9 @@ static int af9033_init(struct dvb_frontend *fe)
{ 0x800045, dev->cfg.adc_multiplier, 0xff }, { 0x800045, dev->cfg.adc_multiplier, 0xff },
}; };
/* program clock control */ dev_dbg(&client->dev, "\n");
/* Main clk control */
utmp = div_u64((u64)dev->cfg.clock * 0x80000, 1000000); utmp = div_u64((u64)dev->cfg.clock * 0x80000, 1000000);
buf[0] = (utmp >> 0) & 0xff; buf[0] = (utmp >> 0) & 0xff;
buf[1] = (utmp >> 8) & 0xff; buf[1] = (utmp >> 8) & 0xff;
...@@ -126,17 +124,15 @@ static int af9033_init(struct dvb_frontend *fe) ...@@ -126,17 +124,15 @@ static int af9033_init(struct dvb_frontend *fe)
if (ret) if (ret)
goto err; goto err;
dev_dbg(&dev->client->dev, "clk=%u clk_cw=%08x\n", dev_dbg(&client->dev, "clk=%u clk_cw=%08x\n", dev->cfg.clock, utmp);
dev->cfg.clock, utmp);
/* program ADC control */ /* ADC clk control */
for (i = 0; i < ARRAY_SIZE(clock_adc_lut); i++) { for (i = 0; i < ARRAY_SIZE(clock_adc_lut); i++) {
if (clock_adc_lut[i].clock == dev->cfg.clock) if (clock_adc_lut[i].clock == dev->cfg.clock)
break; break;
} }
if (i == ARRAY_SIZE(clock_adc_lut)) { if (i == ARRAY_SIZE(clock_adc_lut)) {
dev_err(&dev->client->dev, dev_err(&client->dev, "Couldn't find ADC config for clock %d\n",
"Couldn't find ADC config for clock=%d\n",
dev->cfg.clock); dev->cfg.clock);
goto err; goto err;
} }
...@@ -149,10 +145,10 @@ static int af9033_init(struct dvb_frontend *fe) ...@@ -149,10 +145,10 @@ static int af9033_init(struct dvb_frontend *fe)
if (ret) if (ret)
goto err; goto err;
dev_dbg(&dev->client->dev, "adc=%u adc_cw=%06x\n", dev_dbg(&client->dev, "adc=%u adc_cw=%06x\n",
clock_adc_lut[i].adc, utmp); clock_adc_lut[i].adc, utmp);
/* program register table */ /* Config register table */
for (i = 0; i < ARRAY_SIZE(tab); i++) { for (i = 0; i < ARRAY_SIZE(tab); i++) {
ret = regmap_update_bits(dev->regmap, tab[i].reg, tab[i].mask, ret = regmap_update_bits(dev->regmap, tab[i].reg, tab[i].mask,
tab[i].val); tab[i].val);
...@@ -160,14 +156,14 @@ static int af9033_init(struct dvb_frontend *fe) ...@@ -160,14 +156,14 @@ static int af9033_init(struct dvb_frontend *fe)
goto err; goto err;
} }
/* clock output */ /* Demod clk output */
if (dev->cfg.dyn0_clk) { if (dev->cfg.dyn0_clk) {
ret = regmap_write(dev->regmap, 0x80fba8, 0x00); ret = regmap_write(dev->regmap, 0x80fba8, 0x00);
if (ret) if (ret)
goto err; goto err;
} }
/* settings for TS interface */ /* TS interface */
if (dev->cfg.ts_mode == AF9033_TS_MODE_USB) { if (dev->cfg.ts_mode == AF9033_TS_MODE_USB) {
ret = regmap_update_bits(dev->regmap, 0x80f9a5, 0x01, 0x00); ret = regmap_update_bits(dev->regmap, 0x80f9a5, 0x01, 0x00);
if (ret) if (ret)
...@@ -184,8 +180,8 @@ static int af9033_init(struct dvb_frontend *fe) ...@@ -184,8 +180,8 @@ static int af9033_init(struct dvb_frontend *fe)
goto err; goto err;
} }
/* load OFSM settings */ /* Demod core settings */
dev_dbg(&dev->client->dev, "load ofsm settings\n"); dev_dbg(&client->dev, "load ofsm settings\n");
switch (dev->cfg.tuner) { switch (dev->cfg.tuner) {
case AF9033_TUNER_IT9135_38: case AF9033_TUNER_IT9135_38:
case AF9033_TUNER_IT9135_51: case AF9033_TUNER_IT9135_51:
...@@ -209,8 +205,8 @@ static int af9033_init(struct dvb_frontend *fe) ...@@ -209,8 +205,8 @@ static int af9033_init(struct dvb_frontend *fe)
if (ret) if (ret)
goto err; goto err;
/* load tuner specific settings */ /* Demod tuner specific settings */
dev_dbg(&dev->client->dev, "load tuner specific settings\n"); dev_dbg(&client->dev, "load tuner specific settings\n");
switch (dev->cfg.tuner) { switch (dev->cfg.tuner) {
case AF9033_TUNER_TUA9001: case AF9033_TUNER_TUA9001:
len = ARRAY_SIZE(tuner_init_tua9001); len = ARRAY_SIZE(tuner_init_tua9001);
...@@ -261,7 +257,7 @@ static int af9033_init(struct dvb_frontend *fe) ...@@ -261,7 +257,7 @@ static int af9033_init(struct dvb_frontend *fe)
init = tuner_init_it9135_62; init = tuner_init_it9135_62;
break; break;
default: default:
dev_dbg(&dev->client->dev, "unsupported tuner ID=%d\n", dev_dbg(&client->dev, "unsupported tuner ID=%d\n",
dev->cfg.tuner); dev->cfg.tuner);
ret = -ENODEV; ret = -ENODEV;
goto err; goto err;
...@@ -292,8 +288,8 @@ static int af9033_init(struct dvb_frontend *fe) ...@@ -292,8 +288,8 @@ static int af9033_init(struct dvb_frontend *fe)
goto err; goto err;
} }
dev->bandwidth_hz = 0; /* force to program all parameters */ dev->bandwidth_hz = 0; /* Force to program all parameters */
/* init stats here in order signal app which stats are supported */ /* Init stats here in order signal app which stats are supported */
c->strength.len = 1; c->strength.len = 1;
c->strength.stat[0].scale = FE_SCALE_NOT_AVAILABLE; c->strength.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
c->cnr.len = 1; c->cnr.len = 1;
...@@ -308,19 +304,20 @@ static int af9033_init(struct dvb_frontend *fe) ...@@ -308,19 +304,20 @@ static int af9033_init(struct dvb_frontend *fe)
c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE; c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
static int af9033_sleep(struct dvb_frontend *fe) static int af9033_sleep(struct dvb_frontend *fe)
{ {
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
int ret; int ret;
unsigned int utmp; unsigned int utmp;
dev_dbg(&client->dev, "\n");
ret = regmap_write(dev->regmap, 0x80004c, 0x01); ret = regmap_write(dev->regmap, 0x80004c, 0x01);
if (ret) if (ret)
goto err; goto err;
...@@ -335,9 +332,9 @@ static int af9033_sleep(struct dvb_frontend *fe) ...@@ -335,9 +332,9 @@ static int af9033_sleep(struct dvb_frontend *fe)
if (ret) if (ret)
goto err; goto err;
/* prevent current leak (?) */ /* Prevent current leak by setting TS interface to parallel mode */
if (dev->cfg.ts_mode == AF9033_TS_MODE_SERIAL) { if (dev->cfg.ts_mode == AF9033_TS_MODE_SERIAL) {
/* enable parallel TS */ /* Enable parallel TS */
ret = regmap_update_bits(dev->regmap, 0x00d917, 0x01, 0x00); ret = regmap_update_bits(dev->regmap, 0x00d917, 0x01, 0x00);
if (ret) if (ret)
goto err; goto err;
...@@ -347,10 +344,8 @@ static int af9033_sleep(struct dvb_frontend *fe) ...@@ -347,10 +344,8 @@ static int af9033_sleep(struct dvb_frontend *fe)
} }
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -368,16 +363,17 @@ static int af9033_get_tune_settings(struct dvb_frontend *fe, ...@@ -368,16 +363,17 @@ static int af9033_get_tune_settings(struct dvb_frontend *fe,
static int af9033_set_frontend(struct dvb_frontend *fe) static int af9033_set_frontend(struct dvb_frontend *fe)
{ {
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i; int ret, i;
unsigned int utmp, adc_freq; unsigned int utmp, adc_freq;
u8 tmp, buf[3], bandwidth_reg_val; u8 tmp, buf[3], bandwidth_reg_val;
u32 if_frequency; u32 if_frequency;
dev_dbg(&dev->client->dev, "frequency=%d bandwidth_hz=%d\n", dev_dbg(&client->dev, "frequency=%u bandwidth_hz=%u\n",
c->frequency, c->bandwidth_hz); c->frequency, c->bandwidth_hz);
/* check bandwidth */ /* Check bandwidth */
switch (c->bandwidth_hz) { switch (c->bandwidth_hz) {
case 6000000: case 6000000:
bandwidth_reg_val = 0x00; bandwidth_reg_val = 0x00;
...@@ -389,16 +385,16 @@ static int af9033_set_frontend(struct dvb_frontend *fe) ...@@ -389,16 +385,16 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
bandwidth_reg_val = 0x02; bandwidth_reg_val = 0x02;
break; break;
default: default:
dev_dbg(&dev->client->dev, "invalid bandwidth_hz\n"); dev_dbg(&client->dev, "invalid bandwidth_hz\n");
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
/* program tuner */ /* Program tuner */
if (fe->ops.tuner_ops.set_params) if (fe->ops.tuner_ops.set_params)
fe->ops.tuner_ops.set_params(fe); fe->ops.tuner_ops.set_params(fe);
/* program CFOE coefficients */ /* Coefficients */
if (c->bandwidth_hz != dev->bandwidth_hz) { if (c->bandwidth_hz != dev->bandwidth_hz) {
for (i = 0; i < ARRAY_SIZE(coeff_lut); i++) { for (i = 0; i < ARRAY_SIZE(coeff_lut); i++) {
if (coeff_lut[i].clock == dev->cfg.clock && if (coeff_lut[i].clock == dev->cfg.clock &&
...@@ -407,8 +403,8 @@ static int af9033_set_frontend(struct dvb_frontend *fe) ...@@ -407,8 +403,8 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
} }
} }
if (i == ARRAY_SIZE(coeff_lut)) { if (i == ARRAY_SIZE(coeff_lut)) {
dev_err(&dev->client->dev, dev_err(&client->dev,
"Couldn't find LUT config for clock=%d\n", "Couldn't find config for clock %u\n",
dev->cfg.clock); dev->cfg.clock);
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
...@@ -420,15 +416,15 @@ static int af9033_set_frontend(struct dvb_frontend *fe) ...@@ -420,15 +416,15 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
goto err; goto err;
} }
/* program frequency control */ /* IF frequency control */
if (c->bandwidth_hz != dev->bandwidth_hz) { if (c->bandwidth_hz != dev->bandwidth_hz) {
for (i = 0; i < ARRAY_SIZE(clock_adc_lut); i++) { for (i = 0; i < ARRAY_SIZE(clock_adc_lut); i++) {
if (clock_adc_lut[i].clock == dev->cfg.clock) if (clock_adc_lut[i].clock == dev->cfg.clock)
break; break;
} }
if (i == ARRAY_SIZE(clock_adc_lut)) { if (i == ARRAY_SIZE(clock_adc_lut)) {
dev_err(&dev->client->dev, dev_err(&client->dev,
"Couldn't find ADC clock for clock=%d\n", "Couldn't find ADC clock for clock %u\n",
dev->cfg.clock); dev->cfg.clock);
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
...@@ -438,7 +434,7 @@ static int af9033_set_frontend(struct dvb_frontend *fe) ...@@ -438,7 +434,7 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
if (dev->cfg.adc_multiplier == AF9033_ADC_MULTIPLIER_2X) if (dev->cfg.adc_multiplier == AF9033_ADC_MULTIPLIER_2X)
adc_freq = 2 * adc_freq; adc_freq = 2 * adc_freq;
/* get used IF frequency */ /* Get used IF frequency */
if (fe->ops.tuner_ops.get_if_frequency) if (fe->ops.tuner_ops.get_if_frequency)
fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency); fe->ops.tuner_ops.get_if_frequency(fe, &if_frequency);
else else
...@@ -457,7 +453,7 @@ static int af9033_set_frontend(struct dvb_frontend *fe) ...@@ -457,7 +453,7 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
if (ret) if (ret)
goto err; goto err;
dev_dbg(&dev->client->dev, "if_frequency_cw=%06x\n", utmp); dev_dbg(&client->dev, "if_frequency_cw=%06x\n", utmp);
dev->bandwidth_hz = c->bandwidth_hz; dev->bandwidth_hz = c->bandwidth_hz;
} }
...@@ -484,15 +480,14 @@ static int af9033_set_frontend(struct dvb_frontend *fe) ...@@ -484,15 +480,14 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
ret = regmap_write(dev->regmap, 0x80004b, tmp); ret = regmap_write(dev->regmap, 0x80004b, tmp);
if (ret) if (ret)
goto err; goto err;
/* Reset FSM */
ret = regmap_write(dev->regmap, 0x800000, 0x00); ret = regmap_write(dev->regmap, 0x800000, 0x00);
if (ret) if (ret)
goto err; goto err;
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -500,12 +495,13 @@ static int af9033_get_frontend(struct dvb_frontend *fe, ...@@ -500,12 +495,13 @@ static int af9033_get_frontend(struct dvb_frontend *fe,
struct dtv_frontend_properties *c) struct dtv_frontend_properties *c)
{ {
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
int ret; int ret;
u8 buf[8]; u8 buf[8];
dev_dbg(&dev->client->dev, "\n"); dev_dbg(&client->dev, "\n");
/* read all needed registers */ /* Read all needed TPS registers */
ret = regmap_bulk_read(dev->regmap, 0x80f900, buf, 8); ret = regmap_bulk_read(dev->regmap, 0x80f900, buf, 8);
if (ret) if (ret)
goto err; goto err;
...@@ -616,31 +612,30 @@ static int af9033_get_frontend(struct dvb_frontend *fe, ...@@ -616,31 +612,30 @@ static int af9033_get_frontend(struct dvb_frontend *fe,
} }
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status) static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status)
{ {
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i, tmp = 0; int ret, i, tmp = 0;
u8 buf[7]; u8 buf[7];
unsigned int utmp; unsigned int utmp;
dev_dbg(&dev->client->dev, "\n"); dev_dbg(&client->dev, "\n");
*status = 0; *status = 0;
/* radio channel status, 0=no result, 1=has signal, 2=no signal */ /* Radio channel status: 0=no result, 1=has signal, 2=no signal */
ret = regmap_read(dev->regmap, 0x800047, &utmp); ret = regmap_read(dev->regmap, 0x800047, &utmp);
if (ret) if (ret)
goto err; goto err;
/* has signal */ /* Has signal */
if (utmp == 0x01) if (utmp == 0x01)
*status |= FE_HAS_SIGNAL; *status |= FE_HAS_SIGNAL;
...@@ -654,7 +649,7 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status) ...@@ -654,7 +649,7 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status)
*status |= FE_HAS_SIGNAL | FE_HAS_CARRIER | *status |= FE_HAS_SIGNAL | FE_HAS_CARRIER |
FE_HAS_VITERBI; FE_HAS_VITERBI;
/* full lock */ /* Full lock */
ret = regmap_read(dev->regmap, 0x80f999, &utmp); ret = regmap_read(dev->regmap, 0x80f999, &utmp);
if (ret) if (ret)
goto err; goto err;
...@@ -667,7 +662,7 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status) ...@@ -667,7 +662,7 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status)
dev->fe_status = *status; dev->fe_status = *status;
/* signal strength */ /* Signal strength */
if (dev->fe_status & FE_HAS_SIGNAL) { if (dev->fe_status & FE_HAS_SIGNAL) {
if (dev->is_af9035) { if (dev->is_af9035) {
ret = regmap_read(dev->regmap, 0x80004a, &utmp); ret = regmap_read(dev->regmap, 0x80004a, &utmp);
...@@ -694,14 +689,14 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status) ...@@ -694,14 +689,14 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status)
u32 snr_val, snr_lut_size; u32 snr_val, snr_lut_size;
const struct val_snr *snr_lut = NULL; const struct val_snr *snr_lut = NULL;
/* read value */ /* Read raw SNR value */
ret = regmap_bulk_read(dev->regmap, 0x80002c, buf, 3); ret = regmap_bulk_read(dev->regmap, 0x80002c, buf, 3);
if (ret) if (ret)
goto err; goto err;
snr_val = (buf[2] << 16) | (buf[1] << 8) | (buf[0] << 0); snr_val = (buf[2] << 16) | (buf[1] << 8) | (buf[0] << 0);
/* read superframe number */ /* Read superframe number */
ret = regmap_read(dev->regmap, 0x80f78b, &utmp); ret = regmap_read(dev->regmap, 0x80f78b, &utmp);
if (ret) if (ret)
goto err; goto err;
...@@ -709,7 +704,7 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status) ...@@ -709,7 +704,7 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status)
if (utmp) if (utmp)
snr_val /= utmp; snr_val /= utmp;
/* read current transmission mode */ /* Read current transmission mode */
ret = regmap_read(dev->regmap, 0x80f900, &utmp); ret = regmap_read(dev->regmap, 0x80f900, &utmp);
if (ret) if (ret)
goto err; goto err;
...@@ -729,7 +724,7 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status) ...@@ -729,7 +724,7 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status)
break; break;
} }
/* read current modulation */ /* Read current modulation */
ret = regmap_read(dev->regmap, 0x80f903, &utmp); ret = regmap_read(dev->regmap, 0x80f903, &utmp);
if (ret) if (ret)
goto err; goto err;
...@@ -769,9 +764,9 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status) ...@@ -769,9 +764,9 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status)
/* UCB/PER/BER */ /* UCB/PER/BER */
if (dev->fe_status & FE_HAS_LOCK) { if (dev->fe_status & FE_HAS_LOCK) {
/* outer FEC, 204 byte packets */ /* Outer FEC, 204 byte packets */
u16 abort_packet_count, rsd_packet_count; u16 abort_packet_count, rsd_packet_count;
/* inner FEC, bits */ /* Inner FEC, bits */
u32 rsd_bit_err_count; u32 rsd_bit_err_count;
/* /*
...@@ -810,21 +805,22 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status) ...@@ -810,21 +805,22 @@ static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status)
} }
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
static int af9033_read_snr(struct dvb_frontend *fe, u16 *snr) static int af9033_read_snr(struct dvb_frontend *fe, u16 *snr)
{ {
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
struct dtv_frontend_properties *c = &dev->fe.dtv_property_cache; struct dtv_frontend_properties *c = &dev->fe.dtv_property_cache;
int ret; int ret;
unsigned int utmp; unsigned int utmp;
/* use DVBv5 CNR */ dev_dbg(&client->dev, "\n");
/* Use DVBv5 CNR */
if (c->cnr.stat[0].scale == FE_SCALE_DECIBEL) { if (c->cnr.stat[0].scale == FE_SCALE_DECIBEL) {
/* Return 0.1 dB for AF9030 and 0-0xffff for IT9130. */ /* Return 0.1 dB for AF9030 and 0-0xffff for IT9130. */
if (dev->is_af9035) { if (dev->is_af9035) {
...@@ -834,7 +830,7 @@ static int af9033_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -834,7 +830,7 @@ static int af9033_read_snr(struct dvb_frontend *fe, u16 *snr)
/* 1000x => 1x (1 dB) */ /* 1000x => 1x (1 dB) */
*snr = div_s64(c->cnr.stat[0].svalue, 1000); *snr = div_s64(c->cnr.stat[0].svalue, 1000);
/* read current modulation */ /* Read current modulation */
ret = regmap_read(dev->regmap, 0x80f903, &utmp); ret = regmap_read(dev->regmap, 0x80f903, &utmp);
if (ret) if (ret)
goto err; goto err;
...@@ -859,28 +855,29 @@ static int af9033_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -859,28 +855,29 @@ static int af9033_read_snr(struct dvb_frontend *fe, u16 *snr)
} }
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
static int af9033_read_signal_strength(struct dvb_frontend *fe, u16 *strength) static int af9033_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{ {
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
struct dtv_frontend_properties *c = &dev->fe.dtv_property_cache; struct dtv_frontend_properties *c = &dev->fe.dtv_property_cache;
int ret, tmp, power_real; int ret, tmp, power_real;
unsigned int utmp; unsigned int utmp;
u8 gain_offset, buf[7]; u8 gain_offset, buf[7];
dev_dbg(&client->dev, "\n");
if (dev->is_af9035) { if (dev->is_af9035) {
/* read signal strength of 0-100 scale */ /* Read signal strength of 0-100 scale */
ret = regmap_read(dev->regmap, 0x800048, &utmp); ret = regmap_read(dev->regmap, 0x800048, &utmp);
if (ret) if (ret)
goto err; goto err;
/* scale value to 0x0000-0xffff */ /* Scale value to 0x0000-0xffff */
*strength = utmp * 0xffff / 100; *strength = utmp * 0xffff / 100;
} else { } else {
ret = regmap_read(dev->regmap, 0x8000f7, &utmp); ret = regmap_read(dev->regmap, 0x8000f7, &utmp);
...@@ -910,15 +907,13 @@ static int af9033_read_signal_strength(struct dvb_frontend *fe, u16 *strength) ...@@ -910,15 +907,13 @@ static int af9033_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
else else
tmp = 100; tmp = 100;
/* scale value to 0x0000-0xffff */ /* Scale value to 0x0000-0xffff */
*strength = tmp * 0xffff / 100; *strength = tmp * 0xffff / 100;
} }
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -937,44 +932,43 @@ static int af9033_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) ...@@ -937,44 +932,43 @@ static int af9033_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
*ucblocks = dev->error_block_count; *ucblocks = dev->error_block_count;
return 0; return 0;
} }
static int af9033_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) static int af9033_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{ {
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
int ret; int ret;
dev_dbg(&dev->client->dev, "enable=%d\n", enable); dev_dbg(&client->dev, "enable=%d\n", enable);
ret = regmap_update_bits(dev->regmap, 0x00fa04, 0x01, enable); ret = regmap_update_bits(dev->regmap, 0x00fa04, 0x01, enable);
if (ret) if (ret)
goto err; goto err;
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
static int af9033_pid_filter_ctrl(struct dvb_frontend *fe, int onoff) static int af9033_pid_filter_ctrl(struct dvb_frontend *fe, int onoff)
{ {
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
int ret; int ret;
dev_dbg(&dev->client->dev, "onoff=%d\n", onoff); dev_dbg(&client->dev, "onoff=%d\n", onoff);
ret = regmap_update_bits(dev->regmap, 0x80f993, 0x01, onoff); ret = regmap_update_bits(dev->regmap, 0x80f993, 0x01, onoff);
if (ret) if (ret)
goto err; goto err;
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
...@@ -982,10 +976,11 @@ static int af9033_pid_filter(struct dvb_frontend *fe, int index, u16 pid, ...@@ -982,10 +976,11 @@ static int af9033_pid_filter(struct dvb_frontend *fe, int index, u16 pid,
int onoff) int onoff)
{ {
struct af9033_dev *dev = fe->demodulator_priv; struct af9033_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
int ret; int ret;
u8 wbuf[2] = {(pid >> 0) & 0xff, (pid >> 8) & 0xff}; u8 wbuf[2] = {(pid >> 0) & 0xff, (pid >> 8) & 0xff};
dev_dbg(&dev->client->dev, "index=%d pid=%04x onoff=%d\n", dev_dbg(&client->dev, "index=%d pid=%04x onoff=%d\n",
index, pid, onoff); index, pid, onoff);
if (pid > 0x1fff) if (pid > 0x1fff)
...@@ -1002,15 +997,13 @@ static int af9033_pid_filter(struct dvb_frontend *fe, int index, u16 pid, ...@@ -1002,15 +997,13 @@ static int af9033_pid_filter(struct dvb_frontend *fe, int index, u16 pid,
goto err; goto err;
return 0; return 0;
err: err:
dev_dbg(&dev->client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
return ret; return ret;
} }
static const struct dvb_frontend_ops af9033_ops = { static const struct dvb_frontend_ops af9033_ops = {
.delsys = { SYS_DVBT }, .delsys = {SYS_DVBT},
.info = { .info = {
.name = "Afatech AF9033 (DVB-T)", .name = "Afatech AF9033 (DVB-T)",
.frequency_min = 174000000, .frequency_min = 174000000,
...@@ -1063,23 +1056,33 @@ static int af9033_probe(struct i2c_client *client, ...@@ -1063,23 +1056,33 @@ static int af9033_probe(struct i2c_client *client,
.val_bits = 8, .val_bits = 8,
}; };
/* Allocate memory for the internal state */
/* allocate memory for the internal state */ dev = kzalloc(sizeof(*dev), GFP_KERNEL);
dev = kzalloc(sizeof(struct af9033_dev), GFP_KERNEL); if (!dev) {
if (dev == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
dev_err(&client->dev, "Could not allocate memory for state\n");
goto err; goto err;
} }
/* setup the state */ /* Setup the state */
dev->client = client; dev->client = client;
memcpy(&dev->cfg, cfg, sizeof(struct af9033_config)); memcpy(&dev->cfg, cfg, sizeof(dev->cfg));
switch (dev->cfg.ts_mode) {
case AF9033_TS_MODE_PARALLEL:
dev->ts_mode_parallel = true;
break;
case AF9033_TS_MODE_SERIAL:
dev->ts_mode_serial = true;
break;
case AF9033_TS_MODE_USB:
/* USB mode for AF9035 */
default:
break;
}
if (dev->cfg.clock != 12000000) { if (dev->cfg.clock != 12000000) {
ret = -ENODEV; ret = -ENODEV;
dev_err(&dev->client->dev, dev_err(&client->dev,
"unsupported clock %d Hz, only 12000000 Hz is supported currently\n", "Unsupported clock %u Hz. Only 12000000 Hz is supported currently\n",
dev->cfg.clock); dev->cfg.clock);
goto err_kfree; goto err_kfree;
} }
...@@ -1091,7 +1094,7 @@ static int af9033_probe(struct i2c_client *client, ...@@ -1091,7 +1094,7 @@ static int af9033_probe(struct i2c_client *client,
goto err_kfree; goto err_kfree;
} }
/* firmware version */ /* Firmware version */
switch (dev->cfg.tuner) { switch (dev->cfg.tuner) {
case AF9033_TUNER_IT9135_38: case AF9033_TUNER_IT9135_38:
case AF9033_TUNER_IT9135_51: case AF9033_TUNER_IT9135_51:
...@@ -1115,12 +1118,12 @@ static int af9033_probe(struct i2c_client *client, ...@@ -1115,12 +1118,12 @@ static int af9033_probe(struct i2c_client *client,
if (ret) if (ret)
goto err_regmap_exit; goto err_regmap_exit;
dev_info(&dev->client->dev, dev_info(&client->dev,
"firmware version: LINK %d.%d.%d.%d - OFDM %d.%d.%d.%d\n", "firmware version: LINK %d.%d.%d.%d - OFDM %d.%d.%d.%d\n",
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[0], buf[1], buf[2], buf[3],
buf[7]); buf[4], buf[5], buf[6], buf[7]);
/* sleep */ /* Sleep as chip seems to be partly active by default */
switch (dev->cfg.tuner) { switch (dev->cfg.tuner) {
case AF9033_TUNER_IT9135_38: case AF9033_TUNER_IT9135_38:
case AF9033_TUNER_IT9135_51: case AF9033_TUNER_IT9135_51:
...@@ -1139,22 +1142,8 @@ static int af9033_probe(struct i2c_client *client, ...@@ -1139,22 +1142,8 @@ static int af9033_probe(struct i2c_client *client,
goto err_regmap_exit; goto err_regmap_exit;
} }
/* configure internal TS mode */ /* Create dvb frontend */
switch (dev->cfg.ts_mode) { memcpy(&dev->fe.ops, &af9033_ops, sizeof(dev->fe.ops));
case AF9033_TS_MODE_PARALLEL:
dev->ts_mode_parallel = true;
break;
case AF9033_TS_MODE_SERIAL:
dev->ts_mode_serial = true;
break;
case AF9033_TS_MODE_USB:
/* usb mode for AF9035 */
default:
break;
}
/* create dvb_frontend */
memcpy(&dev->fe.ops, &af9033_ops, sizeof(struct dvb_frontend_ops));
dev->fe.demodulator_priv = dev; dev->fe.demodulator_priv = dev;
*cfg->fe = &dev->fe; *cfg->fe = &dev->fe;
if (cfg->ops) { if (cfg->ops) {
...@@ -1163,7 +1152,8 @@ static int af9033_probe(struct i2c_client *client, ...@@ -1163,7 +1152,8 @@ static int af9033_probe(struct i2c_client *client,
} }
i2c_set_clientdata(client, dev); i2c_set_clientdata(client, dev);
dev_info(&dev->client->dev, "Afatech AF9033 successfully attached\n"); dev_info(&client->dev, "Afatech AF9033 successfully attached\n");
return 0; return 0;
err_regmap_exit: err_regmap_exit:
regmap_exit(dev->regmap); regmap_exit(dev->regmap);
...@@ -1178,12 +1168,9 @@ static int af9033_remove(struct i2c_client *client) ...@@ -1178,12 +1168,9 @@ static int af9033_remove(struct i2c_client *client)
{ {
struct af9033_dev *dev = i2c_get_clientdata(client); struct af9033_dev *dev = i2c_get_clientdata(client);
dev_dbg(&dev->client->dev, "\n"); dev_dbg(&client->dev, "\n");
regmap_exit(dev->regmap); regmap_exit(dev->regmap);
dev->fe.ops.release = NULL;
dev->fe.demodulator_priv = NULL;
kfree(dev); kfree(dev);
return 0; return 0;
......
...@@ -13,18 +13,13 @@ ...@@ -13,18 +13,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef AF9033_H #ifndef AF9033_H
#define AF9033_H #define AF9033_H
/* /*
* I2C address (TODO: are these in 8-bit format?) * I2C address: 0x1c, 0x1d, 0x1e, 0x1f
* 0x38, 0x3a, 0x3c, 0x3e
*/ */
struct af9033_config { struct af9033_config {
/* /*
......
...@@ -13,10 +13,6 @@ ...@@ -13,10 +13,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef AF9033_PRIV_H #ifndef AF9033_PRIV_H
...@@ -70,7 +66,7 @@ static const struct clock_adc clock_adc_lut[] = { ...@@ -70,7 +66,7 @@ static const struct clock_adc clock_adc_lut[] = {
{ 12000000, 20250000 }, { 12000000, 20250000 },
}; };
/* pre-calculated coeff lookup table */ /* Pre-calculated coeff lookup table */
static const struct coeff coeff_lut[] = { static const struct coeff coeff_lut[] = {
/* 12.000 MHz */ /* 12.000 MHz */
{ 12000000, 8000000, { { 12000000, 8000000, {
...@@ -189,6 +185,9 @@ static const struct val_snr qam64_snr_lut[] = { ...@@ -189,6 +185,9 @@ static const struct val_snr qam64_snr_lut[] = {
{ 0xffffff, 32 }, { 0xffffff, 32 },
}; };
/*
* Afatech AF9033 demod init
*/
static const struct reg_val ofsm_init[] = { static const struct reg_val ofsm_init[] = {
{ 0x800051, 0x01 }, { 0x800051, 0x01 },
{ 0x800070, 0x0a }, { 0x800070, 0x0a },
...@@ -300,8 +299,10 @@ static const struct reg_val ofsm_init[] = { ...@@ -300,8 +299,10 @@ static const struct reg_val ofsm_init[] = {
{ 0x80fd8b, 0x00 }, { 0x80fd8b, 0x00 },
}; };
/* Infineon TUA 9001 tuner init /*
AF9033_TUNER_TUA9001 = 0x27 */ * Infineon TUA 9001 tuner init
* AF9033_TUNER_TUA9001 = 0x27
*/
static const struct reg_val tuner_init_tua9001[] = { static const struct reg_val tuner_init_tua9001[] = {
{ 0x800046, 0x27 }, { 0x800046, 0x27 },
{ 0x800057, 0x00 }, { 0x800057, 0x00 },
...@@ -342,8 +343,10 @@ static const struct reg_val tuner_init_tua9001[] = { ...@@ -342,8 +343,10 @@ static const struct reg_val tuner_init_tua9001[] = {
{ 0x80f1e6, 0x00 }, { 0x80f1e6, 0x00 },
}; };
/* Fitipower fc0011 tuner init /*
AF9033_TUNER_FC0011 = 0x28 */ * Fitipower FC0011 tuner init
* AF9033_TUNER_FC0011 = 0x28
*/
static const struct reg_val tuner_init_fc0011[] = { static const struct reg_val tuner_init_fc0011[] = {
{ 0x800046, 0x28 }, { 0x800046, 0x28 },
{ 0x800057, 0x00 }, { 0x800057, 0x00 },
...@@ -403,8 +406,10 @@ static const struct reg_val tuner_init_fc0011[] = { ...@@ -403,8 +406,10 @@ static const struct reg_val tuner_init_fc0011[] = {
{ 0x80f1e6, 0x00 }, { 0x80f1e6, 0x00 },
}; };
/* Fitipower FC0012 tuner init /*
AF9033_TUNER_FC0012 = 0x2e */ * Fitipower FC0012 tuner init
* AF9033_TUNER_FC0012 = 0x2e
*/
static const struct reg_val tuner_init_fc0012[] = { static const struct reg_val tuner_init_fc0012[] = {
{ 0x800046, 0x2e }, { 0x800046, 0x2e },
{ 0x800057, 0x00 }, { 0x800057, 0x00 },
...@@ -446,8 +451,10 @@ static const struct reg_val tuner_init_fc0012[] = { ...@@ -446,8 +451,10 @@ static const struct reg_val tuner_init_fc0012[] = {
{ 0x80f1e6, 0x00 }, { 0x80f1e6, 0x00 },
}; };
/* MaxLinear MxL5007T tuner init /*
AF9033_TUNER_MXL5007T = 0xa0 */ * MaxLinear MxL5007T tuner init
* AF9033_TUNER_MXL5007T = 0xa0
*/
static const struct reg_val tuner_init_mxl5007t[] = { static const struct reg_val tuner_init_mxl5007t[] = {
{ 0x800046, 0x1b }, { 0x800046, 0x1b },
{ 0x800057, 0x01 }, { 0x800057, 0x01 },
...@@ -481,8 +488,10 @@ static const struct reg_val tuner_init_mxl5007t[] = { ...@@ -481,8 +488,10 @@ static const struct reg_val tuner_init_mxl5007t[] = {
{ 0x80f1e6, 0x00 }, { 0x80f1e6, 0x00 },
}; };
/* NXP TDA 18218HN tuner init /*
AF9033_TUNER_TDA18218 = 0xa1 */ * NXP TDA18218HN tuner init
* AF9033_TUNER_TDA18218 = 0xa1
*/
static const struct reg_val tuner_init_tda18218[] = { static const struct reg_val tuner_init_tda18218[] = {
{0x800046, 0xa1}, {0x800046, 0xa1},
{0x800057, 0x01}, {0x800057, 0x01},
...@@ -515,7 +524,10 @@ static const struct reg_val tuner_init_tda18218[] = { ...@@ -515,7 +524,10 @@ static const struct reg_val tuner_init_tda18218[] = {
{0x80f1e6, 0x00}, {0x80f1e6, 0x00},
}; };
/* FCI FC2580 tuner init */ /*
* FCI FC2580 tuner init
* AF9033_TUNER_FC2580 = 0x32
*/
static const struct reg_val tuner_init_fc2580[] = { static const struct reg_val tuner_init_fc2580[] = {
{ 0x800046, 0x32 }, { 0x800046, 0x32 },
{ 0x800057, 0x01 }, { 0x800057, 0x01 },
...@@ -553,6 +565,9 @@ static const struct reg_val tuner_init_fc2580[] = { ...@@ -553,6 +565,9 @@ static const struct reg_val tuner_init_fc2580[] = {
{ 0x80f1e6, 0x01 }, { 0x80f1e6, 0x01 },
}; };
/*
* IT9133 AX demod init
*/
static const struct reg_val ofsm_init_it9135_v1[] = { static const struct reg_val ofsm_init_it9135_v1[] = {
{ 0x800051, 0x01 }, { 0x800051, 0x01 },
{ 0x800070, 0x0a }, { 0x800070, 0x0a },
...@@ -664,8 +679,10 @@ static const struct reg_val ofsm_init_it9135_v1[] = { ...@@ -664,8 +679,10 @@ static const struct reg_val ofsm_init_it9135_v1[] = {
{ 0x80fd8b, 0x00 }, { 0x80fd8b, 0x00 },
}; };
/* ITE Tech IT9135 Omega tuner init /*
AF9033_TUNER_IT9135_38 = 0x38 */ * ITE Tech IT9133 AX Omega tuner init
* AF9033_TUNER_IT9135_38 = 0x38
*/
static const struct reg_val tuner_init_it9135_38[] = { static const struct reg_val tuner_init_it9135_38[] = {
{ 0x800043, 0x00 }, { 0x800043, 0x00 },
{ 0x800046, 0x38 }, { 0x800046, 0x38 },
...@@ -881,8 +898,10 @@ static const struct reg_val tuner_init_it9135_38[] = { ...@@ -881,8 +898,10 @@ static const struct reg_val tuner_init_it9135_38[] = {
{ 0x80fd8b, 0x00 }, { 0x80fd8b, 0x00 },
}; };
/* ITE Tech IT9135 Omega LNA config 1 tuner init /*
AF9033_TUNER_IT9135_51 = 0x51 */ * ITE Tech IT9133 AX Omega LNA config 1 tuner init
* AF9033_TUNER_IT9135_51 = 0x51
*/
static const struct reg_val tuner_init_it9135_51[] = { static const struct reg_val tuner_init_it9135_51[] = {
{ 0x800043, 0x00 }, { 0x800043, 0x00 },
{ 0x800046, 0x51 }, { 0x800046, 0x51 },
...@@ -1098,8 +1117,10 @@ static const struct reg_val tuner_init_it9135_51[] = { ...@@ -1098,8 +1117,10 @@ static const struct reg_val tuner_init_it9135_51[] = {
{ 0x80fd8b, 0x00 }, { 0x80fd8b, 0x00 },
}; };
/* ITE Tech IT9135 Omega LNA config 2 tuner init /*
AF9033_TUNER_IT9135_52 = 0x52 */ * ITE Tech IT9133 AX Omega LNA config 2 tuner init
* AF9033_TUNER_IT9135_52 = 0x52
*/
static const struct reg_val tuner_init_it9135_52[] = { static const struct reg_val tuner_init_it9135_52[] = {
{ 0x800043, 0x00 }, { 0x800043, 0x00 },
{ 0x800046, 0x52 }, { 0x800046, 0x52 },
...@@ -1315,6 +1336,9 @@ static const struct reg_val tuner_init_it9135_52[] = { ...@@ -1315,6 +1336,9 @@ static const struct reg_val tuner_init_it9135_52[] = {
{ 0x80fd8b, 0x00 }, { 0x80fd8b, 0x00 },
}; };
/*
* ITE Tech IT9133 BX demod init
*/
static const struct reg_val ofsm_init_it9135_v2[] = { static const struct reg_val ofsm_init_it9135_v2[] = {
{ 0x800051, 0x01 }, { 0x800051, 0x01 },
{ 0x800070, 0x0a }, { 0x800070, 0x0a },
...@@ -1413,8 +1437,10 @@ static const struct reg_val ofsm_init_it9135_v2[] = { ...@@ -1413,8 +1437,10 @@ static const struct reg_val ofsm_init_it9135_v2[] = {
{ 0x80fd8b, 0x00 }, { 0x80fd8b, 0x00 },
}; };
/* ITE Tech IT9135 Omega v2 tuner init /*
AF9033_TUNER_IT9135_60 = 0x60 */ * ITE Tech IT9133 BX Omega tuner init
* AF9033_TUNER_IT9135_60 = 0x60
*/
static const struct reg_val tuner_init_it9135_60[] = { static const struct reg_val tuner_init_it9135_60[] = {
{ 0x800043, 0x00 }, { 0x800043, 0x00 },
{ 0x800046, 0x60 }, { 0x800046, 0x60 },
...@@ -1627,8 +1653,10 @@ static const struct reg_val tuner_init_it9135_60[] = { ...@@ -1627,8 +1653,10 @@ static const struct reg_val tuner_init_it9135_60[] = {
{ 0x80fd8b, 0x00 }, { 0x80fd8b, 0x00 },
}; };
/* ITE Tech IT9135 Omega v2 LNA config 1 tuner init /*
AF9033_TUNER_IT9135_61 = 0x61 */ * ITE Tech IT9133 BX Omega LNA config 1 tuner init
* AF9033_TUNER_IT9135_61 = 0x61
*/
static const struct reg_val tuner_init_it9135_61[] = { static const struct reg_val tuner_init_it9135_61[] = {
{ 0x800043, 0x00 }, { 0x800043, 0x00 },
{ 0x800046, 0x61 }, { 0x800046, 0x61 },
...@@ -1841,8 +1869,10 @@ static const struct reg_val tuner_init_it9135_61[] = { ...@@ -1841,8 +1869,10 @@ static const struct reg_val tuner_init_it9135_61[] = {
{ 0x80fd8b, 0x00 }, { 0x80fd8b, 0x00 },
}; };
/* ITE Tech IT9135 Omega v2 LNA config 2 tuner init /*
AF9033_TUNER_IT9135_62 = 0x62 */ * ITE Tech IT9133 BX Omega LNA config 2 tuner init
* AF9033_TUNER_IT9135_62 = 0x62
*/
static const struct reg_val tuner_init_it9135_62[] = { static const struct reg_val tuner_init_it9135_62[] = {
{ 0x800043, 0x00 }, { 0x800043, 0x00 },
{ 0x800046, 0x62 }, { 0x800046, 0x62 },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment