if (cmd->wlen) {
/* write cmd and args for firmware */
- ret = i2c_master_send(dev->client, cmd->args, cmd->wlen);
+ ret = i2c_master_send(client, cmd->args, cmd->wlen);
if (ret < 0) {
goto err_mutex_unlock;
} else if (ret != cmd->wlen) {
#define TIMEOUT 70
timeout = jiffies + msecs_to_jiffies(TIMEOUT);
while (!time_after(jiffies, timeout)) {
- ret = i2c_master_recv(dev->client, cmd->args, cmd->rlen);
+ ret = i2c_master_recv(client, cmd->args, cmd->rlen);
if (ret < 0) {
goto err_mutex_unlock;
} else if (ret != cmd->rlen) {
break;
}
- dev_dbg(&dev->client->dev, "cmd execution took %d ms\n",
+ dev_dbg(&client->dev, "cmd execution took %d ms\n",
jiffies_to_msecs(jiffies) -
(jiffies_to_msecs(timeout) - TIMEOUT));
return 0;
err:
- dev_dbg(&dev->client->dev, "failed=%d\n", ret);
+ dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
}
- dev_dbg(&dev->client->dev, "status=%02x args=%*ph\n",
+ dev_dbg(&client->dev, "status=%02x args=%*ph\n",
*status, cmd.rlen, cmd.args);
return 0;
err:
- dev_dbg(&dev->client->dev, "failed=%d\n", ret);
+ dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
struct si2168_cmd cmd;
u8 bandwidth, delivery_system;
- dev_dbg(&dev->client->dev,
+ dev_dbg(&client->dev,
"delivery_system=%u modulation=%u frequency=%u bandwidth_hz=%u symbol_rate=%u inversion=%u, stream_id=%d\n",
c->delivery_system, c->modulation,
c->frequency, c->bandwidth_hz, c->symbol_rate,
return 0;
err:
- dev_dbg(&dev->client->dev, "failed=%d\n", ret);
+ dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
struct si2168_cmd cmd;
unsigned int chip_id;
- dev_dbg(&dev->client->dev, "\n");
+ dev_dbg(&client->dev, "\n");
/* initialize */
memcpy(cmd.args, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", 13);
fw_file = SI2168_B40_FIRMWARE;
break;
default:
- dev_err(&dev->client->dev,
+ dev_err(&client->dev,
"unknown chip version Si21%d-%c%c%c\n",
cmd.args[2], cmd.args[1],
cmd.args[3], cmd.args[4]);
}
/* cold state - try to download firmware */
- dev_info(&dev->client->dev, "found a '%s' in cold state\n",
+ dev_info(&client->dev, "found a '%s' in cold state\n",
si2168_ops.info.name);
/* request the firmware, this will block and timeout */
- ret = request_firmware(&fw, fw_file, &dev->client->dev);
+ ret = request_firmware(&fw, fw_file, &client->dev);
if (ret) {
/* fallback mechanism to handle old name for Si2168 B40 fw */
if (chip_id == SI2168_B40) {
fw_file = SI2168_B40_FIRMWARE_FALLBACK;
- ret = request_firmware(&fw, fw_file, &dev->client->dev);
+ ret = request_firmware(&fw, fw_file, &client->dev);
}
if (ret == 0) {
- dev_notice(&dev->client->dev,
+ dev_notice(&client->dev,
"please install firmware file '%s'\n",
SI2168_B40_FIRMWARE);
} else {
- dev_err(&dev->client->dev,
+ dev_err(&client->dev,
"firmware file '%s' not found\n",
fw_file);
goto error_fw_release;
}
}
- dev_info(&dev->client->dev, "downloading firmware from file '%s'\n",
+ dev_info(&client->dev, "downloading firmware from file '%s'\n",
fw_file);
if ((fw->size % 17 == 0) && (fw->data[0] > 5)) {
cmd.rlen = 1;
ret = si2168_cmd_execute(client, &cmd);
if (ret) {
- dev_err(&dev->client->dev,
+ dev_err(&client->dev,
"firmware download failed=%d\n",
ret);
goto error_fw_release;
cmd.rlen = 1;
ret = si2168_cmd_execute(client, &cmd);
if (ret) {
- dev_err(&dev->client->dev,
+ dev_err(&client->dev,
"firmware download failed=%d\n",
ret);
goto error_fw_release;
if (ret)
goto err;
- dev_dbg(&dev->client->dev, "firmware version: %c.%c.%d\n",
+ dev_dbg(&client->dev, "firmware version: %c.%c.%d\n",
cmd.args[6], cmd.args[7], cmd.args[8]);
/* set ts mode */
dev->fw_loaded = true;
- dev_info(&dev->client->dev, "found a '%s' in warm state\n",
+ dev_info(&client->dev, "found a '%s' in warm state\n",
si2168_ops.info.name);
warm:
dev->active = true;
error_fw_release:
release_firmware(fw);
err:
- dev_dbg(&dev->client->dev, "failed=%d\n", ret);
+ dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int ret;
struct si2168_cmd cmd;
- dev_dbg(&dev->client->dev, "\n");
+ dev_dbg(&client->dev, "\n");
dev->active = false;
return 0;
err:
- dev_dbg(&dev->client->dev, "failed=%d\n", ret);
+ dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
struct si2168_dev *dev = i2c_get_clientdata(client);
int ret;
struct i2c_msg gate_open_msg = {
- .addr = dev->client->addr,
+ .addr = client->addr,
.flags = 0,
.len = 3,
.buf = "\xc0\x0d\x01",
mutex_lock(&dev->i2c_mutex);
/* open tuner I2C gate */
- ret = __i2c_transfer(dev->client->adapter, &gate_open_msg, 1);
+ ret = __i2c_transfer(client->adapter, &gate_open_msg, 1);
if (ret != 1) {
- dev_warn(&dev->client->dev, "i2c write failed=%d\n", ret);
+ dev_warn(&client->dev, "i2c write failed=%d\n", ret);
if (ret >= 0)
ret = -EREMOTEIO;
} else {
struct si2168_dev *dev = i2c_get_clientdata(client);
int ret;
struct i2c_msg gate_close_msg = {
- .addr = dev->client->addr,
+ .addr = client->addr,
.flags = 0,
.len = 3,
.buf = "\xc0\x0d\x00",
};
/* close tuner I2C gate */
- ret = __i2c_transfer(dev->client->adapter, &gate_close_msg, 1);
+ ret = __i2c_transfer(client->adapter, &gate_close_msg, 1);
if (ret != 1) {
- dev_warn(&dev->client->dev, "i2c write failed=%d\n", ret);
+ dev_warn(&client->dev, "i2c write failed=%d\n", ret);
if (ret >= 0)
ret = -EREMOTEIO;
} else {
goto err;
}
- dev->client = client;
mutex_init(&dev->i2c_mutex);
/* create mux i2c adapter for tuner */
i2c_set_clientdata(client, dev);
- dev_info(&dev->client->dev,
+ dev_info(&client->dev,
"Silicon Labs Si2168 successfully attached\n");
return 0;
err: