2014-04-15 00:55:12 +00:00
|
|
|
/*
|
|
|
|
* Silicon Labs Si2168 DVB-T/T2/C demodulator driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Antti Palosaari <crope@iki.fi>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2014-04-11 01:00:50 +00:00
|
|
|
#include "si2168_priv.h"
|
|
|
|
|
|
|
|
static const struct dvb_frontend_ops si2168_ops;
|
|
|
|
|
|
|
|
/* execute firmware command */
|
2014-11-25 20:31:43 +00:00
|
|
|
static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd)
|
2014-04-11 01:00:50 +00:00
|
|
|
{
|
2014-11-25 20:31:43 +00:00
|
|
|
struct si2168_dev *dev = i2c_get_clientdata(client);
|
2014-04-11 01:00:50 +00:00
|
|
|
int ret;
|
|
|
|
unsigned long timeout;
|
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
mutex_lock(&dev->i2c_mutex);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
if (cmd->wlen) {
|
|
|
|
/* write cmd and args for firmware */
|
2014-11-25 20:53:21 +00:00
|
|
|
ret = i2c_master_send(client, cmd->args, cmd->wlen);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret < 0) {
|
|
|
|
goto err_mutex_unlock;
|
|
|
|
} else if (ret != cmd->wlen) {
|
|
|
|
ret = -EREMOTEIO;
|
|
|
|
goto err_mutex_unlock;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cmd->rlen) {
|
|
|
|
/* wait cmd execution terminate */
|
2014-12-08 08:30:44 +00:00
|
|
|
#define TIMEOUT 70
|
2014-04-11 01:00:50 +00:00
|
|
|
timeout = jiffies + msecs_to_jiffies(TIMEOUT);
|
|
|
|
while (!time_after(jiffies, timeout)) {
|
2014-11-25 20:53:21 +00:00
|
|
|
ret = i2c_master_recv(client, cmd->args, cmd->rlen);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret < 0) {
|
|
|
|
goto err_mutex_unlock;
|
|
|
|
} else if (ret != cmd->rlen) {
|
|
|
|
ret = -EREMOTEIO;
|
|
|
|
goto err_mutex_unlock;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* firmware ready? */
|
|
|
|
if ((cmd->args[0] >> 7) & 0x01)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_dbg(&client->dev, "cmd execution took %d ms\n",
|
2014-04-11 01:00:50 +00:00
|
|
|
jiffies_to_msecs(jiffies) -
|
|
|
|
(jiffies_to_msecs(timeout) - TIMEOUT));
|
|
|
|
|
2014-06-13 14:08:25 +00:00
|
|
|
if (!((cmd->args[0] >> 7) & 0x01)) {
|
2014-04-11 01:00:50 +00:00
|
|
|
ret = -ETIMEDOUT;
|
|
|
|
goto err_mutex_unlock;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-05 17:30:44 +00:00
|
|
|
mutex_unlock(&dev->i2c_mutex);
|
|
|
|
return 0;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
err_mutex_unlock:
|
2014-11-25 19:46:16 +00:00
|
|
|
mutex_unlock(&dev->i2c_mutex);
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_dbg(&client->dev, "failed=%d\n", ret);
|
2014-04-11 01:00:50 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int si2168_read_status(struct dvb_frontend *fe, fe_status_t *status)
|
|
|
|
{
|
2014-11-25 20:31:43 +00:00
|
|
|
struct i2c_client *client = fe->demodulator_priv;
|
|
|
|
struct si2168_dev *dev = i2c_get_clientdata(client);
|
2014-04-11 23:35:27 +00:00
|
|
|
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
|
2014-04-11 01:00:50 +00:00
|
|
|
int ret;
|
|
|
|
struct si2168_cmd cmd;
|
|
|
|
|
|
|
|
*status = 0;
|
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
if (!dev->active) {
|
2014-04-11 01:00:50 +00:00
|
|
|
ret = -EAGAIN;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2014-04-11 23:35:27 +00:00
|
|
|
switch (c->delivery_system) {
|
|
|
|
case SYS_DVBT:
|
2014-07-09 22:36:58 +00:00
|
|
|
memcpy(cmd.args, "\xa0\x01", 2);
|
2014-04-11 23:35:27 +00:00
|
|
|
cmd.wlen = 2;
|
|
|
|
cmd.rlen = 13;
|
|
|
|
break;
|
2014-04-12 04:58:32 +00:00
|
|
|
case SYS_DVBC_ANNEX_A:
|
2014-07-09 22:36:58 +00:00
|
|
|
memcpy(cmd.args, "\x90\x01", 2);
|
2014-04-12 04:58:32 +00:00
|
|
|
cmd.wlen = 2;
|
|
|
|
cmd.rlen = 9;
|
|
|
|
break;
|
2014-04-11 23:35:27 +00:00
|
|
|
case SYS_DVBT2:
|
2014-07-09 22:36:58 +00:00
|
|
|
memcpy(cmd.args, "\x50\x01", 2);
|
2014-04-11 23:35:27 +00:00
|
|
|
cmd.wlen = 2;
|
|
|
|
cmd.rlen = 14;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ret = -EINVAL;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-04-23 00:36:32 +00:00
|
|
|
switch ((cmd.args[2] >> 1) & 0x03) {
|
|
|
|
case 0x01:
|
2014-04-11 01:00:50 +00:00
|
|
|
*status = FE_HAS_SIGNAL | FE_HAS_CARRIER;
|
|
|
|
break;
|
2014-04-23 00:36:32 +00:00
|
|
|
case 0x03:
|
2014-04-11 01:00:50 +00:00
|
|
|
*status = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI |
|
|
|
|
FE_HAS_SYNC | FE_HAS_LOCK;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
dev->fe_status = *status;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-07-09 23:22:27 +00:00
|
|
|
if (*status & FE_HAS_LOCK) {
|
|
|
|
c->cnr.len = 1;
|
|
|
|
c->cnr.stat[0].scale = FE_SCALE_DECIBEL;
|
|
|
|
c->cnr.stat[0].svalue = cmd.args[3] * 1000 / 4;
|
|
|
|
} else {
|
|
|
|
c->cnr.len = 1;
|
|
|
|
c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
|
|
|
|
}
|
|
|
|
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_dbg(&client->dev, "status=%02x args=%*ph\n",
|
2014-08-05 11:54:08 +00:00
|
|
|
*status, cmd.rlen, cmd.args);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
err:
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_dbg(&client->dev, "failed=%d\n", ret);
|
2014-04-11 01:00:50 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int si2168_set_frontend(struct dvb_frontend *fe)
|
|
|
|
{
|
2014-11-25 20:31:43 +00:00
|
|
|
struct i2c_client *client = fe->demodulator_priv;
|
|
|
|
struct si2168_dev *dev = i2c_get_clientdata(client);
|
2014-04-11 01:00:50 +00:00
|
|
|
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
|
|
|
|
int ret;
|
|
|
|
struct si2168_cmd cmd;
|
2014-04-11 23:35:27 +00:00
|
|
|
u8 bandwidth, delivery_system;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_dbg(&client->dev,
|
2014-12-05 18:57:03 +00:00
|
|
|
"delivery_system=%u modulation=%u frequency=%u bandwidth_hz=%u symbol_rate=%u inversion=%u stream_id=%u\n",
|
|
|
|
c->delivery_system, c->modulation, c->frequency,
|
|
|
|
c->bandwidth_hz, c->symbol_rate, c->inversion,
|
|
|
|
c->stream_id);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
if (!dev->active) {
|
2014-04-11 01:00:50 +00:00
|
|
|
ret = -EAGAIN;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2014-04-11 23:35:27 +00:00
|
|
|
switch (c->delivery_system) {
|
|
|
|
case SYS_DVBT:
|
|
|
|
delivery_system = 0x20;
|
|
|
|
break;
|
2014-04-12 04:58:32 +00:00
|
|
|
case SYS_DVBC_ANNEX_A:
|
|
|
|
delivery_system = 0x30;
|
|
|
|
break;
|
2014-04-11 23:35:27 +00:00
|
|
|
case SYS_DVBT2:
|
|
|
|
delivery_system = 0x70;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ret = -EINVAL;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2014-04-12 04:58:32 +00:00
|
|
|
if (c->bandwidth_hz <= 5000000)
|
2014-04-11 23:35:27 +00:00
|
|
|
bandwidth = 0x05;
|
2014-04-12 04:58:32 +00:00
|
|
|
else if (c->bandwidth_hz <= 6000000)
|
2014-04-11 23:35:27 +00:00
|
|
|
bandwidth = 0x06;
|
2014-04-12 04:58:32 +00:00
|
|
|
else if (c->bandwidth_hz <= 7000000)
|
2014-04-11 23:35:27 +00:00
|
|
|
bandwidth = 0x07;
|
2014-04-12 04:58:32 +00:00
|
|
|
else if (c->bandwidth_hz <= 8000000)
|
2014-04-11 23:35:27 +00:00
|
|
|
bandwidth = 0x08;
|
2014-04-12 04:58:32 +00:00
|
|
|
else if (c->bandwidth_hz <= 9000000)
|
|
|
|
bandwidth = 0x09;
|
|
|
|
else if (c->bandwidth_hz <= 10000000)
|
|
|
|
bandwidth = 0x0a;
|
|
|
|
else
|
|
|
|
bandwidth = 0x0f;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
/* program tuner */
|
|
|
|
if (fe->ops.tuner_ops.set_params) {
|
|
|
|
ret = fe->ops.tuner_ops.set_params(fe);
|
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
|
|
|
memcpy(cmd.args, "\x88\x02\x02\x02\x02", 5);
|
|
|
|
cmd.wlen = 5;
|
|
|
|
cmd.rlen = 5;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-04-11 23:35:27 +00:00
|
|
|
/* that has no big effect */
|
|
|
|
if (c->delivery_system == SYS_DVBT)
|
|
|
|
memcpy(cmd.args, "\x89\x21\x06\x11\xff\x98", 6);
|
2014-04-12 04:58:32 +00:00
|
|
|
else if (c->delivery_system == SYS_DVBC_ANNEX_A)
|
|
|
|
memcpy(cmd.args, "\x89\x21\x06\x11\x89\xf0", 6);
|
2014-04-11 23:35:27 +00:00
|
|
|
else if (c->delivery_system == SYS_DVBT2)
|
|
|
|
memcpy(cmd.args, "\x89\x21\x06\x11\x89\x20", 6);
|
2014-04-11 01:00:50 +00:00
|
|
|
cmd.wlen = 6;
|
|
|
|
cmd.rlen = 3;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-08-16 21:33:14 +00:00
|
|
|
if (c->delivery_system == SYS_DVBT2) {
|
|
|
|
/* select PLP */
|
|
|
|
cmd.args[0] = 0x52;
|
|
|
|
cmd.args[1] = c->stream_id & 0xff;
|
|
|
|
cmd.args[2] = c->stream_id == NO_STREAM_ID_FILTER ? 0 : 1;
|
|
|
|
cmd.wlen = 3;
|
|
|
|
cmd.rlen = 1;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-08-16 21:33:14 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2014-04-11 01:00:50 +00:00
|
|
|
memcpy(cmd.args, "\x51\x03", 2);
|
|
|
|
cmd.wlen = 2;
|
|
|
|
cmd.rlen = 12;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
memcpy(cmd.args, "\x12\x08\x04", 3);
|
|
|
|
cmd.wlen = 3;
|
|
|
|
cmd.rlen = 3;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
memcpy(cmd.args, "\x14\x00\x0c\x10\x12\x00", 6);
|
|
|
|
cmd.wlen = 6;
|
2014-07-11 13:40:29 +00:00
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
memcpy(cmd.args, "\x14\x00\x06\x10\x24\x00", 6);
|
|
|
|
cmd.wlen = 6;
|
2014-07-11 13:40:29 +00:00
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
memcpy(cmd.args, "\x14\x00\x07\x10\x00\x24", 6);
|
|
|
|
cmd.wlen = 6;
|
2014-07-11 13:40:29 +00:00
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
memcpy(cmd.args, "\x14\x00\x0a\x10\x00\x00", 6);
|
2014-04-11 23:35:27 +00:00
|
|
|
cmd.args[4] = delivery_system | bandwidth;
|
2014-04-11 01:00:50 +00:00
|
|
|
cmd.wlen = 6;
|
2014-07-11 13:40:29 +00:00
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-07-17 17:31:28 +00:00
|
|
|
/* set DVB-C symbol rate */
|
|
|
|
if (c->delivery_system == SYS_DVBC_ANNEX_A) {
|
|
|
|
memcpy(cmd.args, "\x14\x00\x02\x11", 4);
|
2014-12-05 17:54:14 +00:00
|
|
|
cmd.args[4] = ((c->symbol_rate / 1000) >> 0) & 0xff;
|
2014-07-17 17:31:28 +00:00
|
|
|
cmd.args[5] = ((c->symbol_rate / 1000) >> 8) & 0xff;
|
|
|
|
cmd.wlen = 6;
|
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-07-17 17:31:28 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2014-04-11 01:00:50 +00:00
|
|
|
memcpy(cmd.args, "\x14\x00\x0f\x10\x10\x00", 6);
|
|
|
|
cmd.wlen = 6;
|
2014-07-11 13:40:29 +00:00
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-11-14 21:22:10 +00:00
|
|
|
memcpy(cmd.args, "\x14\x00\x09\x10\xe3\x08", 6);
|
2014-11-25 19:46:16 +00:00
|
|
|
cmd.args[5] |= dev->ts_clock_inv ? 0x00 : 0x10;
|
2014-04-11 01:00:50 +00:00
|
|
|
cmd.wlen = 6;
|
2014-07-11 13:40:29 +00:00
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-11-14 21:22:10 +00:00
|
|
|
memcpy(cmd.args, "\x14\x00\x08\x10\xd7\x05", 6);
|
2014-11-25 19:46:16 +00:00
|
|
|
cmd.args[5] |= dev->ts_clock_inv ? 0x00 : 0x10;
|
2014-04-11 01:00:50 +00:00
|
|
|
cmd.wlen = 6;
|
2014-07-11 13:40:29 +00:00
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
memcpy(cmd.args, "\x14\x00\x01\x12\x00\x00", 6);
|
|
|
|
cmd.wlen = 6;
|
2014-07-11 13:40:29 +00:00
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-07-17 18:43:27 +00:00
|
|
|
memcpy(cmd.args, "\x14\x00\x01\x03\x0c\x00", 6);
|
|
|
|
cmd.wlen = 6;
|
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-07-17 18:43:27 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-07-09 22:36:58 +00:00
|
|
|
memcpy(cmd.args, "\x85", 1);
|
2014-04-11 01:00:50 +00:00
|
|
|
cmd.wlen = 1;
|
|
|
|
cmd.rlen = 1;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
dev->delivery_system = c->delivery_system;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
err:
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_dbg(&client->dev, "failed=%d\n", ret);
|
2014-04-11 01:00:50 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int si2168_init(struct dvb_frontend *fe)
|
|
|
|
{
|
2014-11-25 20:31:43 +00:00
|
|
|
struct i2c_client *client = fe->demodulator_priv;
|
|
|
|
struct si2168_dev *dev = i2c_get_clientdata(client);
|
2014-04-11 01:00:50 +00:00
|
|
|
int ret, len, remaining;
|
|
|
|
const struct firmware *fw = NULL;
|
2014-07-13 13:52:18 +00:00
|
|
|
u8 *fw_file;
|
2014-04-11 01:00:50 +00:00
|
|
|
const unsigned int i2c_wr_max = 8;
|
|
|
|
struct si2168_cmd cmd;
|
2014-07-13 22:22:19 +00:00
|
|
|
unsigned int chip_id;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_dbg(&client->dev, "\n");
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-08-25 18:07:04 +00:00
|
|
|
/* initialize */
|
2014-07-09 22:36:58 +00:00
|
|
|
memcpy(cmd.args, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", 13);
|
2014-04-11 01:00:50 +00:00
|
|
|
cmd.wlen = 13;
|
|
|
|
cmd.rlen = 0;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
if (dev->fw_loaded) {
|
2014-08-25 18:07:04 +00:00
|
|
|
/* resume */
|
|
|
|
memcpy(cmd.args, "\xc0\x06\x08\x0f\x00\x20\x21\x01", 8);
|
|
|
|
cmd.wlen = 8;
|
|
|
|
cmd.rlen = 1;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-08-25 18:07:04 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
memcpy(cmd.args, "\x85", 1);
|
|
|
|
cmd.wlen = 1;
|
|
|
|
cmd.rlen = 1;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-08-25 18:07:04 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
goto warm;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* power up */
|
2014-07-09 22:36:58 +00:00
|
|
|
memcpy(cmd.args, "\xc0\x06\x01\x0f\x00\x20\x20\x01", 8);
|
2014-04-11 01:00:50 +00:00
|
|
|
cmd.wlen = 8;
|
|
|
|
cmd.rlen = 1;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-07-13 13:52:18 +00:00
|
|
|
/* query chip revision */
|
2014-07-09 22:36:58 +00:00
|
|
|
memcpy(cmd.args, "\x02", 1);
|
2014-04-11 01:00:50 +00:00
|
|
|
cmd.wlen = 1;
|
|
|
|
cmd.rlen = 13;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-07-13 22:22:19 +00:00
|
|
|
chip_id = cmd.args[1] << 24 | cmd.args[2] << 16 | cmd.args[3] << 8 |
|
|
|
|
cmd.args[4] << 0;
|
|
|
|
|
2014-07-17 22:43:37 +00:00
|
|
|
#define SI2168_A20 ('A' << 24 | 68 << 16 | '2' << 8 | '0' << 0)
|
2014-07-13 22:22:19 +00:00
|
|
|
#define SI2168_A30 ('A' << 24 | 68 << 16 | '3' << 8 | '0' << 0)
|
|
|
|
#define SI2168_B40 ('B' << 24 | 68 << 16 | '4' << 8 | '0' << 0)
|
|
|
|
|
|
|
|
switch (chip_id) {
|
2014-07-17 22:43:37 +00:00
|
|
|
case SI2168_A20:
|
|
|
|
fw_file = SI2168_A20_FIRMWARE;
|
|
|
|
break;
|
2014-07-13 22:22:19 +00:00
|
|
|
case SI2168_A30:
|
2014-07-13 13:52:18 +00:00
|
|
|
fw_file = SI2168_A30_FIRMWARE;
|
2014-07-13 22:22:19 +00:00
|
|
|
break;
|
|
|
|
case SI2168_B40:
|
|
|
|
fw_file = SI2168_B40_FIRMWARE;
|
|
|
|
break;
|
|
|
|
default:
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_err(&client->dev,
|
2014-08-05 11:54:08 +00:00
|
|
|
"unknown chip version Si21%d-%c%c%c\n",
|
|
|
|
cmd.args[2], cmd.args[1],
|
2014-07-13 22:22:19 +00:00
|
|
|
cmd.args[3], cmd.args[4]);
|
2014-07-13 13:52:18 +00:00
|
|
|
ret = -EINVAL;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2014-04-11 01:00:50 +00:00
|
|
|
/* cold state - try to download firmware */
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_info(&client->dev, "found a '%s' in cold state\n",
|
2014-08-05 11:54:08 +00:00
|
|
|
si2168_ops.info.name);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
/* request the firmware, this will block and timeout */
|
2014-11-25 20:53:21 +00:00
|
|
|
ret = request_firmware(&fw, fw_file, &client->dev);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret) {
|
2014-07-13 22:22:19 +00:00
|
|
|
/* fallback mechanism to handle old name for Si2168 B40 fw */
|
|
|
|
if (chip_id == SI2168_B40) {
|
2014-07-13 13:52:18 +00:00
|
|
|
fw_file = SI2168_B40_FIRMWARE_FALLBACK;
|
2014-11-25 20:53:21 +00:00
|
|
|
ret = request_firmware(&fw, fw_file, &client->dev);
|
2014-07-13 13:52:18 +00:00
|
|
|
}
|
2014-07-13 22:22:19 +00:00
|
|
|
|
|
|
|
if (ret == 0) {
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_notice(&client->dev,
|
2014-08-05 11:54:08 +00:00
|
|
|
"please install firmware file '%s'\n",
|
|
|
|
SI2168_B40_FIRMWARE);
|
2014-07-13 22:22:19 +00:00
|
|
|
} else {
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_err(&client->dev,
|
2014-08-05 11:54:08 +00:00
|
|
|
"firmware file '%s' not found\n",
|
|
|
|
fw_file);
|
2014-12-05 17:54:14 +00:00
|
|
|
goto err_release_firmware;
|
2014-07-13 13:52:18 +00:00
|
|
|
}
|
2014-04-11 01:00:50 +00:00
|
|
|
}
|
|
|
|
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_info(&client->dev, "downloading firmware from file '%s'\n",
|
2014-08-05 11:54:08 +00:00
|
|
|
fw_file);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-27 19:42:23 +00:00
|
|
|
if ((fw->size % 17 == 0) && (fw->data[0] > 5)) {
|
|
|
|
/* firmware is in the new format */
|
|
|
|
for (remaining = fw->size; remaining > 0; remaining -= 17) {
|
|
|
|
len = fw->data[fw->size - remaining];
|
|
|
|
memcpy(cmd.args, &fw->data[(fw->size - remaining) + 1], len);
|
|
|
|
cmd.wlen = len;
|
|
|
|
cmd.rlen = 1;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-11-27 19:42:23 +00:00
|
|
|
if (ret) {
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_err(&client->dev,
|
2014-11-27 19:42:23 +00:00
|
|
|
"firmware download failed=%d\n",
|
|
|
|
ret);
|
2014-12-05 17:54:14 +00:00
|
|
|
goto err_release_firmware;
|
2014-11-27 19:42:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* firmware is in the old format */
|
|
|
|
for (remaining = fw->size; remaining > 0; remaining -= i2c_wr_max) {
|
|
|
|
len = remaining;
|
|
|
|
if (len > i2c_wr_max)
|
|
|
|
len = i2c_wr_max;
|
|
|
|
|
|
|
|
memcpy(cmd.args, &fw->data[fw->size - remaining], len);
|
|
|
|
cmd.wlen = len;
|
|
|
|
cmd.rlen = 1;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-11-27 19:42:23 +00:00
|
|
|
if (ret) {
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_err(&client->dev,
|
2014-11-27 19:42:23 +00:00
|
|
|
"firmware download failed=%d\n",
|
|
|
|
ret);
|
2014-12-05 17:54:14 +00:00
|
|
|
goto err_release_firmware;
|
2014-11-27 19:42:23 +00:00
|
|
|
}
|
2014-04-11 01:00:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
release_firmware(fw);
|
|
|
|
fw = NULL;
|
|
|
|
|
2014-07-09 22:36:58 +00:00
|
|
|
memcpy(cmd.args, "\x01\x01", 2);
|
2014-04-11 01:00:50 +00:00
|
|
|
cmd.wlen = 2;
|
|
|
|
cmd.rlen = 1;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-11-27 19:42:22 +00:00
|
|
|
/* query firmware version */
|
|
|
|
memcpy(cmd.args, "\x11", 1);
|
|
|
|
cmd.wlen = 1;
|
|
|
|
cmd.rlen = 10;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-11-27 19:42:22 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-12-05 18:04:12 +00:00
|
|
|
dev_info(&client->dev, "firmware version: %c.%c.%d\n",
|
2014-11-27 19:42:22 +00:00
|
|
|
cmd.args[6], cmd.args[7], cmd.args[8]);
|
|
|
|
|
2014-08-11 19:58:10 +00:00
|
|
|
/* set ts mode */
|
|
|
|
memcpy(cmd.args, "\x14\x00\x01\x10\x10\x00", 6);
|
2014-11-25 19:46:16 +00:00
|
|
|
cmd.args[4] |= dev->ts_mode;
|
2014-08-11 19:58:10 +00:00
|
|
|
cmd.wlen = 6;
|
|
|
|
cmd.rlen = 4;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-08-11 19:58:10 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
dev->fw_loaded = true;
|
2014-08-25 18:07:04 +00:00
|
|
|
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_info(&client->dev, "found a '%s' in warm state\n",
|
2014-08-25 18:07:04 +00:00
|
|
|
si2168_ops.info.name);
|
2014-11-03 21:28:39 +00:00
|
|
|
warm:
|
2014-11-25 19:46:16 +00:00
|
|
|
dev->active = true;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
return 0;
|
2014-12-05 17:54:14 +00:00
|
|
|
err_release_firmware:
|
2014-11-19 22:23:15 +00:00
|
|
|
release_firmware(fw);
|
|
|
|
err:
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_dbg(&client->dev, "failed=%d\n", ret);
|
2014-04-11 01:00:50 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int si2168_sleep(struct dvb_frontend *fe)
|
|
|
|
{
|
2014-11-25 20:31:43 +00:00
|
|
|
struct i2c_client *client = fe->demodulator_priv;
|
|
|
|
struct si2168_dev *dev = i2c_get_clientdata(client);
|
2014-07-09 21:45:31 +00:00
|
|
|
int ret;
|
|
|
|
struct si2168_cmd cmd;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_dbg(&client->dev, "\n");
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
dev->active = false;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-07-09 21:45:31 +00:00
|
|
|
memcpy(cmd.args, "\x13", 1);
|
|
|
|
cmd.wlen = 1;
|
|
|
|
cmd.rlen = 0;
|
2014-11-25 20:31:43 +00:00
|
|
|
ret = si2168_cmd_execute(client, &cmd);
|
2014-07-09 21:45:31 +00:00
|
|
|
if (ret)
|
|
|
|
goto err;
|
|
|
|
|
2014-04-11 01:00:50 +00:00
|
|
|
return 0;
|
2014-07-09 21:45:31 +00:00
|
|
|
err:
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_dbg(&client->dev, "failed=%d\n", ret);
|
2014-07-09 21:45:31 +00:00
|
|
|
return ret;
|
2014-04-11 01:00:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int si2168_get_tune_settings(struct dvb_frontend *fe,
|
|
|
|
struct dvb_frontend_tune_settings *s)
|
|
|
|
{
|
|
|
|
s->min_delay_ms = 900;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* I2C gate logic
|
|
|
|
* We must use unlocked i2c_transfer() here because I2C lock is already taken
|
|
|
|
* by tuner driver.
|
|
|
|
*/
|
|
|
|
static int si2168_select(struct i2c_adapter *adap, void *mux_priv, u32 chan)
|
|
|
|
{
|
2014-11-25 20:31:43 +00:00
|
|
|
struct i2c_client *client = mux_priv;
|
|
|
|
struct si2168_dev *dev = i2c_get_clientdata(client);
|
2014-04-11 01:00:50 +00:00
|
|
|
int ret;
|
|
|
|
struct i2c_msg gate_open_msg = {
|
2014-11-25 20:53:21 +00:00
|
|
|
.addr = client->addr,
|
2014-04-11 01:00:50 +00:00
|
|
|
.flags = 0,
|
|
|
|
.len = 3,
|
|
|
|
.buf = "\xc0\x0d\x01",
|
|
|
|
};
|
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
mutex_lock(&dev->i2c_mutex);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
/* open tuner I2C gate */
|
2014-11-25 20:53:21 +00:00
|
|
|
ret = __i2c_transfer(client->adapter, &gate_open_msg, 1);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret != 1) {
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_warn(&client->dev, "i2c write failed=%d\n", ret);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret >= 0)
|
|
|
|
ret = -EREMOTEIO;
|
|
|
|
} else {
|
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int si2168_deselect(struct i2c_adapter *adap, void *mux_priv, u32 chan)
|
|
|
|
{
|
2014-11-25 20:31:43 +00:00
|
|
|
struct i2c_client *client = mux_priv;
|
|
|
|
struct si2168_dev *dev = i2c_get_clientdata(client);
|
2014-04-11 01:00:50 +00:00
|
|
|
int ret;
|
|
|
|
struct i2c_msg gate_close_msg = {
|
2014-11-25 20:53:21 +00:00
|
|
|
.addr = client->addr,
|
2014-04-11 01:00:50 +00:00
|
|
|
.flags = 0,
|
|
|
|
.len = 3,
|
|
|
|
.buf = "\xc0\x0d\x00",
|
|
|
|
};
|
|
|
|
|
|
|
|
/* close tuner I2C gate */
|
2014-11-25 20:53:21 +00:00
|
|
|
ret = __i2c_transfer(client->adapter, &gate_close_msg, 1);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret != 1) {
|
2014-11-25 20:53:21 +00:00
|
|
|
dev_warn(&client->dev, "i2c write failed=%d\n", ret);
|
2014-04-11 01:00:50 +00:00
|
|
|
if (ret >= 0)
|
|
|
|
ret = -EREMOTEIO;
|
|
|
|
} else {
|
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
mutex_unlock(&dev->i2c_mutex);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct dvb_frontend_ops si2168_ops = {
|
2014-04-12 04:58:32 +00:00
|
|
|
.delsys = {SYS_DVBT, SYS_DVBT2, SYS_DVBC_ANNEX_A},
|
2014-04-11 01:00:50 +00:00
|
|
|
.info = {
|
|
|
|
.name = "Silicon Labs Si2168",
|
2014-11-25 19:26:49 +00:00
|
|
|
.symbol_rate_min = 1000000,
|
|
|
|
.symbol_rate_max = 7200000,
|
2014-04-11 01:00:50 +00:00
|
|
|
.caps = FE_CAN_FEC_1_2 |
|
|
|
|
FE_CAN_FEC_2_3 |
|
|
|
|
FE_CAN_FEC_3_4 |
|
|
|
|
FE_CAN_FEC_5_6 |
|
|
|
|
FE_CAN_FEC_7_8 |
|
|
|
|
FE_CAN_FEC_AUTO |
|
|
|
|
FE_CAN_QPSK |
|
|
|
|
FE_CAN_QAM_16 |
|
|
|
|
FE_CAN_QAM_32 |
|
|
|
|
FE_CAN_QAM_64 |
|
|
|
|
FE_CAN_QAM_128 |
|
|
|
|
FE_CAN_QAM_256 |
|
|
|
|
FE_CAN_QAM_AUTO |
|
|
|
|
FE_CAN_TRANSMISSION_MODE_AUTO |
|
|
|
|
FE_CAN_GUARD_INTERVAL_AUTO |
|
|
|
|
FE_CAN_HIERARCHY_AUTO |
|
|
|
|
FE_CAN_MUTE_TS |
|
2014-09-23 16:53:09 +00:00
|
|
|
FE_CAN_2G_MODULATION |
|
|
|
|
FE_CAN_MULTISTREAM
|
2014-04-11 01:00:50 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
.get_tune_settings = si2168_get_tune_settings,
|
|
|
|
|
|
|
|
.init = si2168_init,
|
|
|
|
.sleep = si2168_sleep,
|
|
|
|
|
|
|
|
.set_frontend = si2168_set_frontend,
|
|
|
|
|
|
|
|
.read_status = si2168_read_status,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int si2168_probe(struct i2c_client *client,
|
|
|
|
const struct i2c_device_id *id)
|
|
|
|
{
|
|
|
|
struct si2168_config *config = client->dev.platform_data;
|
2014-11-25 19:46:16 +00:00
|
|
|
struct si2168_dev *dev;
|
2014-04-11 01:00:50 +00:00
|
|
|
int ret;
|
|
|
|
|
2014-08-05 11:54:08 +00:00
|
|
|
dev_dbg(&client->dev, "\n");
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
|
|
|
if (!dev) {
|
2014-04-11 01:00:50 +00:00
|
|
|
ret = -ENOMEM;
|
2014-08-05 11:54:08 +00:00
|
|
|
dev_err(&client->dev, "kzalloc() failed\n");
|
2014-12-05 19:02:42 +00:00
|
|
|
goto err;
|
2014-04-11 01:00:50 +00:00
|
|
|
}
|
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
mutex_init(&dev->i2c_mutex);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
/* create mux i2c adapter for tuner */
|
2014-11-25 20:31:43 +00:00
|
|
|
dev->adapter = i2c_add_mux_adapter(client->adapter, &client->dev,
|
|
|
|
client, 0, 0, 0, si2168_select, si2168_deselect);
|
2014-11-25 19:46:16 +00:00
|
|
|
if (dev->adapter == NULL) {
|
2014-07-17 19:38:08 +00:00
|
|
|
ret = -ENODEV;
|
2014-12-05 17:54:14 +00:00
|
|
|
goto err_kfree;
|
2014-07-17 19:38:08 +00:00
|
|
|
}
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
/* create dvb_frontend */
|
2014-11-25 19:46:16 +00:00
|
|
|
memcpy(&dev->fe.ops, &si2168_ops, sizeof(struct dvb_frontend_ops));
|
2014-11-25 20:31:43 +00:00
|
|
|
dev->fe.demodulator_priv = client;
|
2014-11-25 19:46:16 +00:00
|
|
|
*config->i2c_adapter = dev->adapter;
|
|
|
|
*config->fe = &dev->fe;
|
|
|
|
dev->ts_mode = config->ts_mode;
|
|
|
|
dev->ts_clock_inv = config->ts_clock_inv;
|
|
|
|
dev->fw_loaded = false;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
i2c_set_clientdata(client, dev);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-12-05 17:54:14 +00:00
|
|
|
dev_info(&client->dev, "Silicon Labs Si2168 successfully attached\n");
|
2014-04-11 01:00:50 +00:00
|
|
|
return 0;
|
2014-12-05 17:54:14 +00:00
|
|
|
err_kfree:
|
2014-11-25 19:46:16 +00:00
|
|
|
kfree(dev);
|
2014-12-05 19:02:42 +00:00
|
|
|
err:
|
2014-08-05 11:54:08 +00:00
|
|
|
dev_dbg(&client->dev, "failed=%d\n", ret);
|
2014-04-11 01:00:50 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int si2168_remove(struct i2c_client *client)
|
|
|
|
{
|
2014-11-25 19:46:16 +00:00
|
|
|
struct si2168_dev *dev = i2c_get_clientdata(client);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-08-05 11:54:08 +00:00
|
|
|
dev_dbg(&client->dev, "\n");
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
i2c_del_mux_adapter(dev->adapter);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
dev->fe.ops.release = NULL;
|
|
|
|
dev->fe.demodulator_priv = NULL;
|
2014-04-11 01:00:50 +00:00
|
|
|
|
2014-11-25 19:46:16 +00:00
|
|
|
kfree(dev);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-12-05 17:54:14 +00:00
|
|
|
static const struct i2c_device_id si2168_id_table[] = {
|
2014-04-11 01:00:50 +00:00
|
|
|
{"si2168", 0},
|
|
|
|
{}
|
|
|
|
};
|
2014-12-05 17:54:14 +00:00
|
|
|
MODULE_DEVICE_TABLE(i2c, si2168_id_table);
|
2014-04-11 01:00:50 +00:00
|
|
|
|
|
|
|
static struct i2c_driver si2168_driver = {
|
|
|
|
.driver = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.name = "si2168",
|
|
|
|
},
|
|
|
|
.probe = si2168_probe,
|
|
|
|
.remove = si2168_remove,
|
2014-12-05 17:54:14 +00:00
|
|
|
.id_table = si2168_id_table,
|
2014-04-11 01:00:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module_i2c_driver(si2168_driver);
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
|
|
|
|
MODULE_DESCRIPTION("Silicon Labs Si2168 DVB-T/T2/C demodulator driver");
|
|
|
|
MODULE_LICENSE("GPL");
|
2014-07-17 22:43:37 +00:00
|
|
|
MODULE_FIRMWARE(SI2168_A20_FIRMWARE);
|
2014-07-13 19:09:03 +00:00
|
|
|
MODULE_FIRMWARE(SI2168_A30_FIRMWARE);
|
2014-07-13 13:52:18 +00:00
|
|
|
MODULE_FIRMWARE(SI2168_B40_FIRMWARE);
|