{
int i;
int pos = 0;
+
for (i = 0; i < ARRAY_SIZE(arates_hz); i++)
pos += sprintf(buf + pos, "%d ", arates_hz[i]);
sprintf(buf + pos - 1, "\n");
struct device_attribute *attr, char *buf)
{
struct apds990x_chip *chip = dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", chip->arate);
}
{
ssize_t ret;
struct apds990x_chip *chip = dev_get_drvdata(dev);
+
if (pm_runtime_suspended(dev) || !chip->prox_en)
return -EIO;
struct device_attribute *attr, char *buf)
{
struct apds990x_chip *chip = dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", chip->prox_en);
}
struct device_attribute *attr, char *buf)
{
struct apds990x_chip *chip = dev_get_drvdata(dev);
+
return sprintf(buf, "%s\n",
reporting_modes[!!chip->prox_continuous_mode]);
}
struct device_attribute *attr, char *buf)
{
struct apds990x_chip *chip = dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", chip->lux_thres_hi);
}
struct device_attribute *attr, char *buf)
{
struct apds990x_chip *chip = dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", chip->lux_thres_lo);
}
{
struct apds990x_chip *chip = dev_get_drvdata(dev);
int ret = apds990x_set_lux_thresh(chip, &chip->lux_thres_hi, buf);
+
if (ret < 0)
return ret;
return len;
{
struct apds990x_chip *chip = dev_get_drvdata(dev);
int ret = apds990x_set_lux_thresh(chip, &chip->lux_thres_lo, buf);
+
if (ret < 0)
return ret;
return len;
struct device_attribute *attr, char *buf)
{
struct apds990x_chip *chip = dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", chip->prox_thres);
}
struct device_attribute *attr, char *buf)
{
struct apds990x_chip *chip = dev_get_drvdata(dev);
+
return sprintf(buf, "%s %d\n", chip->chipname, chip->revision);
}