u8 buf[2 + 4]; /* write a maximum of 4 bytes of data */
if (count + 2 > sizeof(buf)) {
- dev_warn(&state->i2c->dev,
+ dev_warn(&state->client->dev,
"%s: i2c wr reg=%04x: count=%d is too big!\n",
KBUILD_MODNAME, reg, count);
return -EINVAL;
ret = i2c_transfer(state->i2c, &msg, 1);
if (ret != 1) {
- dev_err(&state->i2c->dev, "%s: ret == %d\n", __func__, ret);
+ dev_err(&state->client->dev, "%s: ret == %d\n", __func__, ret);
if (ret < 0)
return ret;
else
ret = i2c_transfer(state->i2c, msg, 2);
if (ret != 2) {
- dev_err(&state->i2c->dev, "%s: error (addr %02x reg %04x error (ret == %i)\n",
+ dev_err(&state->client->dev, "%s: error (addr %02x reg %04x error (ret == %i)\n",
__func__, state->config.i2c_addr, reg, ret);
if (ret < 0)
return ret;
return 0;
usleep_range(1000, 50000);
}
- dev_err(&state->i2c->dev, "%s: init_done was not set\n",
+ dev_err(&state->client->dev, "%s: init_done was not set\n",
KBUILD_MODNAME);
return ret;
}
wordcount = data[offset];
if (wordcount < 1 || data[offset+1] ||
data[offset+2] || data[offset+3]) {
- dev_warn(&state->i2c->dev,
+ dev_warn(&state->client->dev,
"%s: bad fw data[0..3] = %*ph\n",
KBUILD_MODNAME, 4, data);
return -EINVAL;
}
if (offset + 8 + wordcount * 4 > len) {
- dev_warn(&state->i2c->dev,
+ dev_warn(&state->client->dev,
"%s: len is too small for block len=%d, wordcount=%d\n",
KBUILD_MODNAME, len, wordcount);
return -EINVAL;
fw_file = SI2165_FIRMWARE_REV_D;
break;
default:
- dev_info(&state->i2c->dev, "%s: no firmware file for revision=%d\n",
+ dev_info(&state->client->dev, "%s: no firmware file for revision=%d\n",
KBUILD_MODNAME, state->chip_revcode);
return 0;
}
/* request the firmware, this will block and timeout */
- ret = request_firmware(&fw, fw_file, state->i2c->dev.parent);
+ ret = request_firmware(&fw, fw_file, &state->client->dev);
if (ret) {
- dev_warn(&state->i2c->dev, "%s: firmware file '%s' not found\n",
+ dev_warn(&state->client->dev, "%s: firmware file '%s' not found\n",
KBUILD_MODNAME, fw_file);
goto error;
}
data = fw->data;
len = fw->size;
- dev_info(&state->i2c->dev, "%s: downloading firmware from file '%s' size=%d\n",
+ dev_info(&state->client->dev, "%s: downloading firmware from file '%s' size=%d\n",
KBUILD_MODNAME, fw_file, len);
if (len % 4 != 0) {
- dev_warn(&state->i2c->dev, "%s: firmware size is not multiple of 4\n",
+ dev_warn(&state->client->dev, "%s: firmware size is not multiple of 4\n",
KBUILD_MODNAME);
ret = -EINVAL;
goto error;
/* check header (8 bytes) */
if (len < 8) {
- dev_warn(&state->i2c->dev, "%s: firmware header is missing\n",
+ dev_warn(&state->client->dev, "%s: firmware header is missing\n",
KBUILD_MODNAME);
ret = -EINVAL;
goto error;
}
if (data[0] != 1 || data[1] != 0) {
- dev_warn(&state->i2c->dev, "%s: firmware file version is wrong\n",
+ dev_warn(&state->client->dev, "%s: firmware file version is wrong\n",
KBUILD_MODNAME);
ret = -EINVAL;
goto error;
/* start right after the header */
offset = 8;
- dev_info(&state->i2c->dev, "%s: si2165_upload_firmware extracted patch_version=0x%02x, block_count=0x%02x, crc_expected=0x%04x\n",
+ dev_info(&state->client->dev, "%s: si2165_upload_firmware extracted patch_version=0x%02x, block_count=0x%02x, crc_expected=0x%04x\n",
KBUILD_MODNAME, patch_version, block_count, crc_expected);
ret = si2165_upload_firmware_block(state, data, len, &offset, 1);
ret = si2165_upload_firmware_block(state, data, len,
&offset, block_count);
if (ret < 0) {
- dev_err(&state->i2c->dev,
+ dev_err(&state->client->dev,
"%s: firmware could not be uploaded\n",
KBUILD_MODNAME);
goto error;
goto error;
if (val16 != crc_expected) {
- dev_err(&state->i2c->dev,
+ dev_err(&state->client->dev,
"%s: firmware crc mismatch %04x != %04x\n",
KBUILD_MODNAME, val16, crc_expected);
ret = -EINVAL;
goto error;
if (len != offset) {
- dev_err(&state->i2c->dev,
+ dev_err(&state->client->dev,
"%s: firmware len mismatch %04x != %04x\n",
KBUILD_MODNAME, len, offset);
ret = -EINVAL;
if (ret < 0)
goto error;
- dev_info(&state->i2c->dev, "%s: fw load finished\n", KBUILD_MODNAME);
+ dev_info(&state->client->dev, "%s: fw load finished\n", KBUILD_MODNAME);
ret = 0;
state->firmware_loaded = true;
if (ret < 0)
goto error;
if (val != state->config.chip_mode) {
- dev_err(&state->i2c->dev, "%s: could not set chip_mode\n",
+ dev_err(&state->client->dev, "%s: could not set chip_mode\n",
KBUILD_MODNAME);
return -EINVAL;
}
u32 IF = 0;
if (!fe->ops.tuner_ops.get_if_frequency) {
- dev_err(&state->i2c->dev,
+ dev_err(&state->client->dev,
"%s: Error: get_if_frequency() not defined at tuner. Can't work without it!\n",
KBUILD_MODNAME);
return -EINVAL;
if (state->config.ref_freq_Hz < 4000000
|| state->config.ref_freq_Hz > 27000000) {
- dev_err(&state->i2c->dev, "%s: ref_freq of %d Hz not supported by this driver\n",
+ dev_err(&state->client->dev, "%s: ref_freq of %d Hz not supported by this driver\n",
KBUILD_MODNAME, state->config.ref_freq_Hz);
ret = -EINVAL;
goto error;
state->has_dvbc = true;
break;
default:
- dev_err(&state->i2c->dev, "%s: Unsupported Silicon Labs chip (type %d, rev %d)\n",
+ dev_err(&state->client->dev, "%s: Unsupported Silicon Labs chip (type %d, rev %d)\n",
KBUILD_MODNAME, state->chip_type, state->chip_revcode);
goto nodev_error;
}
- dev_info(&state->i2c->dev,
+ dev_info(&state->client->dev,
"%s: Detected Silicon Labs %s-%c (type %d, rev %d)\n",
KBUILD_MODNAME, chip_name, rev_char, state->chip_type,
state->chip_revcode);