mirror of https://gitee.com/openkylin/linux.git
[media] si2168: rename few things
Rename some goto labels and more. No functionality changes. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
4affbe1d08
commit
346d4900f0
|
@ -115,17 +115,6 @@ static int si2168_read_status(struct dvb_frontend *fe, fe_status_t *status)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
/*
|
|
||||||
* Possible values seen, in order from strong signal to weak:
|
|
||||||
* 16 0001 0110 full lock
|
|
||||||
* 1e 0001 1110 partial lock
|
|
||||||
* 1a 0001 1010 partial lock
|
|
||||||
* 18 0001 1000 no lock
|
|
||||||
*
|
|
||||||
* [b3:b1] lock bits
|
|
||||||
* [b4] statistics ready? Set in a few secs after lock is gained.
|
|
||||||
*/
|
|
||||||
|
|
||||||
switch ((cmd.args[2] >> 1) & 0x03) {
|
switch ((cmd.args[2] >> 1) & 0x03) {
|
||||||
case 0x01:
|
case 0x01:
|
||||||
*status = FE_HAS_SIGNAL | FE_HAS_CARRIER;
|
*status = FE_HAS_SIGNAL | FE_HAS_CARRIER;
|
||||||
|
@ -291,7 +280,7 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
|
||||||
/* set DVB-C symbol rate */
|
/* set DVB-C symbol rate */
|
||||||
if (c->delivery_system == SYS_DVBC_ANNEX_A) {
|
if (c->delivery_system == SYS_DVBC_ANNEX_A) {
|
||||||
memcpy(cmd.args, "\x14\x00\x02\x11", 4);
|
memcpy(cmd.args, "\x14\x00\x02\x11", 4);
|
||||||
cmd.args[4] = (c->symbol_rate / 1000) & 0xff;
|
cmd.args[4] = ((c->symbol_rate / 1000) >> 0) & 0xff;
|
||||||
cmd.args[5] = ((c->symbol_rate / 1000) >> 8) & 0xff;
|
cmd.args[5] = ((c->symbol_rate / 1000) >> 8) & 0xff;
|
||||||
cmd.wlen = 6;
|
cmd.wlen = 6;
|
||||||
cmd.rlen = 4;
|
cmd.rlen = 4;
|
||||||
|
@ -455,7 +444,7 @@ static int si2168_init(struct dvb_frontend *fe)
|
||||||
dev_err(&client->dev,
|
dev_err(&client->dev,
|
||||||
"firmware file '%s' not found\n",
|
"firmware file '%s' not found\n",
|
||||||
fw_file);
|
fw_file);
|
||||||
goto error_fw_release;
|
goto err_release_firmware;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,7 +463,7 @@ static int si2168_init(struct dvb_frontend *fe)
|
||||||
dev_err(&client->dev,
|
dev_err(&client->dev,
|
||||||
"firmware download failed=%d\n",
|
"firmware download failed=%d\n",
|
||||||
ret);
|
ret);
|
||||||
goto error_fw_release;
|
goto err_release_firmware;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -492,7 +481,7 @@ static int si2168_init(struct dvb_frontend *fe)
|
||||||
dev_err(&client->dev,
|
dev_err(&client->dev,
|
||||||
"firmware download failed=%d\n",
|
"firmware download failed=%d\n",
|
||||||
ret);
|
ret);
|
||||||
goto error_fw_release;
|
goto err_release_firmware;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -535,8 +524,7 @@ static int si2168_init(struct dvb_frontend *fe)
|
||||||
dev->active = true;
|
dev->active = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
err_release_firmware:
|
||||||
error_fw_release:
|
|
||||||
release_firmware(fw);
|
release_firmware(fw);
|
||||||
err:
|
err:
|
||||||
dev_dbg(&client->dev, "failed=%d\n", ret);
|
dev_dbg(&client->dev, "failed=%d\n", ret);
|
||||||
|
@ -684,7 +672,7 @@ static int si2168_probe(struct i2c_client *client,
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
dev_err(&client->dev, "kzalloc() failed\n");
|
dev_err(&client->dev, "kzalloc() failed\n");
|
||||||
goto err;
|
goto err_kfree;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_init(&dev->i2c_mutex);
|
mutex_init(&dev->i2c_mutex);
|
||||||
|
@ -694,13 +682,12 @@ static int si2168_probe(struct i2c_client *client,
|
||||||
client, 0, 0, 0, si2168_select, si2168_deselect);
|
client, 0, 0, 0, si2168_select, si2168_deselect);
|
||||||
if (dev->adapter == NULL) {
|
if (dev->adapter == NULL) {
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto err;
|
goto err_kfree;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create dvb_frontend */
|
/* create dvb_frontend */
|
||||||
memcpy(&dev->fe.ops, &si2168_ops, sizeof(struct dvb_frontend_ops));
|
memcpy(&dev->fe.ops, &si2168_ops, sizeof(struct dvb_frontend_ops));
|
||||||
dev->fe.demodulator_priv = client;
|
dev->fe.demodulator_priv = client;
|
||||||
|
|
||||||
*config->i2c_adapter = dev->adapter;
|
*config->i2c_adapter = dev->adapter;
|
||||||
*config->fe = &dev->fe;
|
*config->fe = &dev->fe;
|
||||||
dev->ts_mode = config->ts_mode;
|
dev->ts_mode = config->ts_mode;
|
||||||
|
@ -709,10 +696,9 @@ static int si2168_probe(struct i2c_client *client,
|
||||||
|
|
||||||
i2c_set_clientdata(client, dev);
|
i2c_set_clientdata(client, dev);
|
||||||
|
|
||||||
dev_info(&client->dev,
|
dev_info(&client->dev, "Silicon Labs Si2168 successfully attached\n");
|
||||||
"Silicon Labs Si2168 successfully attached\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
err:
|
err_kfree:
|
||||||
kfree(dev);
|
kfree(dev);
|
||||||
dev_dbg(&client->dev, "failed=%d\n", ret);
|
dev_dbg(&client->dev, "failed=%d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -734,11 +720,11 @@ static int si2168_remove(struct i2c_client *client)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct i2c_device_id si2168_id[] = {
|
static const struct i2c_device_id si2168_id_table[] = {
|
||||||
{"si2168", 0},
|
{"si2168", 0},
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(i2c, si2168_id);
|
MODULE_DEVICE_TABLE(i2c, si2168_id_table);
|
||||||
|
|
||||||
static struct i2c_driver si2168_driver = {
|
static struct i2c_driver si2168_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
|
@ -747,7 +733,7 @@ static struct i2c_driver si2168_driver = {
|
||||||
},
|
},
|
||||||
.probe = si2168_probe,
|
.probe = si2168_probe,
|
||||||
.remove = si2168_remove,
|
.remove = si2168_remove,
|
||||||
.id_table = si2168_id,
|
.id_table = si2168_id_table,
|
||||||
};
|
};
|
||||||
|
|
||||||
module_i2c_driver(si2168_driver);
|
module_i2c_driver(si2168_driver);
|
||||||
|
|
|
@ -36,14 +36,12 @@ struct si2168_config {
|
||||||
struct i2c_adapter **i2c_adapter;
|
struct i2c_adapter **i2c_adapter;
|
||||||
|
|
||||||
/* TS mode */
|
/* TS mode */
|
||||||
|
#define SI2168_TS_PARALLEL 0x06
|
||||||
|
#define SI2168_TS_SERIAL 0x03
|
||||||
u8 ts_mode;
|
u8 ts_mode;
|
||||||
|
|
||||||
/* TS clock inverted */
|
/* TS clock inverted */
|
||||||
bool ts_clock_inv;
|
bool ts_clock_inv;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SI2168_TS_PARALLEL 0x06
|
|
||||||
#define SI2168_TS_SERIAL 0x03
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue