ret = regmap_read(chip->regmap, ISL29028_REG_ALSIR_L, &lsb);
if (ret < 0) {
dev_err(dev,
- "Error in reading register ALSIR_L err %d\n", ret);
+ "%s(): Error %d reading register ALSIR_L\n",
+ __func__, ret);
return ret;
}
ret = regmap_read(chip->regmap, ISL29028_REG_ALSIR_U, &msb);
if (ret < 0) {
dev_err(dev,
- "Error in reading register ALSIR_U err %d\n", ret);
+ "%s(): Error %d reading register ALSIR_U\n",
+ __func__, ret);
return ret;
}
ret = regmap_read(chip->regmap, ISL29028_REG_PROX_DATA, &data);
if (ret < 0) {
- dev_err(dev, "Error in reading register %d, error %d\n",
- ISL29028_REG_PROX_DATA, ret);
+ dev_err(dev, "%s(): Error %d reading register PROX_DATA\n",
+ __func__, ret);
return ret;
}
ret = isl29028_set_als_ir_mode(chip, ISL29028_MODE_ALS);
if (ret < 0) {
- dev_err(dev, "Error in enabling ALS mode err %d\n", ret);
+ dev_err(dev, "%s(): Error %d enabling ALS mode\n", __func__,
+ ret);
return ret;
}
ret = isl29028_set_als_ir_mode(chip, ISL29028_MODE_IR);
if (ret < 0) {
- dev_err(dev, "Error in enabling IR mode err %d\n", ret);
+ dev_err(dev, "%s(): Error %d enabling IR mode\n", __func__,
+ ret);
return ret;
}
case IIO_PROXIMITY:
if (mask != IIO_CHAN_INFO_SAMP_FREQ) {
dev_err(dev,
- "proximity: mask value 0x%08lx not supported\n",
- mask);
+ "%s(): proximity: Mask value 0x%08lx is not supported\n",
+ __func__, mask);
break;
}
if (val < 1 || val > 100) {
dev_err(dev,
- "Samp_freq %d is not in range[1:100]\n", val);
+ "%s(): proximity: Sampling frequency %d is not in the range [1:100]\n",
+ __func__, val);
break;
}
case IIO_LIGHT:
if (mask != IIO_CHAN_INFO_SCALE) {
dev_err(dev,
- "light: mask value 0x%08lx not supported\n",
- mask);
+ "%s(): light: Mask value 0x%08lx is not supported\n",
+ __func__, mask);
break;
}
if ((val != 125) && (val != 2000)) {
dev_err(dev,
- "lux scale %d is invalid [125, 2000]\n", val);
+ "%s(): light: Lux scale %d is not in the set {125, 2000}\n",
+ __func__, val);
break;
}
ret = isl29028_set_als_scale(chip, val);
break;
default:
- dev_err(dev, "Unsupported channel type\n");
+ dev_err(dev, "%s(): Unsupported channel type %x\n",
+ __func__, chan->type);
break;
}
ret = IIO_VAL_INT;
break;
default:
- dev_err(dev, "mask value 0x%08lx not supported\n", mask);
+ dev_err(dev, "%s(): mask value 0x%08lx is not supported\n",
+ __func__, mask);
break;
}
ret = regmap_write(chip->regmap, ISL29028_REG_CONFIGURE, 0x0);
if (ret < 0) {
- dev_err(dev, "%s(): write to reg %d failed, err = %d\n",
- __func__, ISL29028_REG_CONFIGURE, ret);
+ dev_err(dev, "%s(): Error %d clearing the CONFIGURE register\n",
+ __func__, ret);
return ret;
}
chip->regmap = devm_regmap_init_i2c(client, &isl29028_regmap_config);
if (IS_ERR(chip->regmap)) {
ret = PTR_ERR(chip->regmap);
- dev_err(&client->dev, "regmap initialization failed: %d\n",
- ret);
+ dev_err(&client->dev, "%s: Error %d initializing regmap\n",
+ __func__, ret);
return ret;
}
ret = regmap_write(chip->regmap, ISL29028_REG_TEST1_MODE, 0x0);
if (ret < 0) {
dev_err(&client->dev,
- "%s(): write to reg %d failed, err = %d\n", __func__,
- ISL29028_REG_TEST1_MODE, ret);
+ "%s(): Error %d writing to TEST1_MODE register\n",
+ __func__, ret);
return ret;
}
ret = regmap_write(chip->regmap, ISL29028_REG_TEST2_MODE, 0x0);
if (ret < 0) {
dev_err(&client->dev,
- "%s(): write to reg %d failed, err = %d\n", __func__,
- ISL29028_REG_TEST2_MODE, ret);
+ "%s(): Error %d writing to TEST2_MODE register\n",
+ __func__, ret);
return ret;
}
ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev);
if (ret < 0) {
dev_err(&client->dev,
- "iio registration fails with error %d\n",
- ret);
+ "%s(): iio registration failed with error %d\n",
+ __func__, ret);
return ret;
}