Lines Matching refs:chip

186 static int apds990x_read_byte(struct apds990x_chip *chip, u8 reg, u8 *data)  in apds990x_read_byte()  argument
188 struct i2c_client *client = chip->client; in apds990x_read_byte()
199 static int apds990x_read_word(struct apds990x_chip *chip, u8 reg, u16 *data) in apds990x_read_word() argument
201 struct i2c_client *client = chip->client; in apds990x_read_word()
212 static int apds990x_write_byte(struct apds990x_chip *chip, u8 reg, u8 data) in apds990x_write_byte() argument
214 struct i2c_client *client = chip->client; in apds990x_write_byte()
224 static int apds990x_write_word(struct apds990x_chip *chip, u8 reg, u16 data) in apds990x_write_word() argument
226 struct i2c_client *client = chip->client; in apds990x_write_word()
236 static int apds990x_mode_on(struct apds990x_chip *chip) in apds990x_mode_on() argument
242 if (chip->prox_en) in apds990x_mode_on()
245 return apds990x_write_byte(chip, APDS990X_ENABLE, reg); in apds990x_mode_on()
248 static u16 apds990x_lux_to_threshold(struct apds990x_chip *chip, u32 lux) in apds990x_lux_to_threshold() argument
274 lux = lux * (APDS_CALIB_SCALER / 4) / (chip->lux_calib / 4); in apds990x_lux_to_threshold()
277 cpl = ((u32)chip->atime * (u32)again[chip->again_next] * in apds990x_lux_to_threshold()
278 APDS_PARAM_SCALE * 64) / (chip->cf.ga * chip->cf.df); in apds990x_lux_to_threshold()
286 ir = (u32)chip->lux_ir * (u32)again[chip->again_next] / in apds990x_lux_to_threshold()
287 (u32)again[chip->again_meas]; in apds990x_lux_to_threshold()
293 if (chip->lux_clear * APDS_PARAM_SCALE >= in apds990x_lux_to_threshold()
294 chip->rcf.afactor * chip->lux_ir) in apds990x_lux_to_threshold()
295 thres = (chip->rcf.cf1 * thres + chip->rcf.irf1 * ir) / in apds990x_lux_to_threshold()
298 thres = (chip->rcf.cf2 * thres + chip->rcf.irf2 * ir) / in apds990x_lux_to_threshold()
301 if (thres >= chip->a_max_result) in apds990x_lux_to_threshold()
302 thres = chip->a_max_result - 1; in apds990x_lux_to_threshold()
306 static inline int apds990x_set_atime(struct apds990x_chip *chip, u32 time_ms) in apds990x_set_atime() argument
310 chip->atime = time_ms; in apds990x_set_atime()
314 chip->a_max_result = (u16)(256 - reg_value) * APDS990X_TIME_TO_ADC; in apds990x_set_atime()
315 return apds990x_write_byte(chip, APDS990X_ATIME, reg_value); in apds990x_set_atime()
319 static int apds990x_refresh_pthres(struct apds990x_chip *chip, int data) in apds990x_refresh_pthres() argument
324 if (pm_runtime_suspended(&chip->client->dev)) in apds990x_refresh_pthres()
327 if (data < chip->prox_thres) { in apds990x_refresh_pthres()
329 hi = chip->prox_thres; in apds990x_refresh_pthres()
331 lo = chip->prox_thres - APDS_PROX_HYSTERESIS; in apds990x_refresh_pthres()
332 if (chip->prox_continuous_mode) in apds990x_refresh_pthres()
333 hi = chip->prox_thres; in apds990x_refresh_pthres()
338 ret = apds990x_write_word(chip, APDS990X_PILTL, lo); in apds990x_refresh_pthres()
339 ret |= apds990x_write_word(chip, APDS990X_PIHTL, hi); in apds990x_refresh_pthres()
344 static int apds990x_refresh_athres(struct apds990x_chip *chip) in apds990x_refresh_athres() argument
348 if (pm_runtime_suspended(&chip->client->dev)) in apds990x_refresh_athres()
351 ret = apds990x_write_word(chip, APDS990X_AILTL, in apds990x_refresh_athres()
352 apds990x_lux_to_threshold(chip, chip->lux_thres_lo)); in apds990x_refresh_athres()
353 ret |= apds990x_write_word(chip, APDS990X_AIHTL, in apds990x_refresh_athres()
354 apds990x_lux_to_threshold(chip, chip->lux_thres_hi)); in apds990x_refresh_athres()
360 static void apds990x_force_a_refresh(struct apds990x_chip *chip) in apds990x_force_a_refresh() argument
363 apds990x_write_word(chip, APDS990X_AILTL, APDS_LUX_DEF_THRES_LO); in apds990x_force_a_refresh()
364 apds990x_write_word(chip, APDS990X_AIHTL, APDS_LUX_DEF_THRES_HI); in apds990x_force_a_refresh()
368 static void apds990x_force_p_refresh(struct apds990x_chip *chip) in apds990x_force_p_refresh() argument
371 apds990x_write_word(chip, APDS990X_PILTL, APDS_PROX_DEF_THRES - 1); in apds990x_force_p_refresh()
372 apds990x_write_word(chip, APDS990X_PIHTL, APDS_PROX_DEF_THRES); in apds990x_force_p_refresh()
376 static int apds990x_calc_again(struct apds990x_chip *chip) in apds990x_calc_again() argument
378 int curr_again = chip->again_meas; in apds990x_calc_again()
379 int next_again = chip->again_meas; in apds990x_calc_again()
383 if (chip->lux_clear == chip->a_max_result) in apds990x_calc_again()
385 else if (chip->lux_clear > chip->a_max_result / 2) in apds990x_calc_again()
387 else if (chip->lux_clear < APDS_LUX_GAIN_LO_LIMIT_STRICT) in apds990x_calc_again()
389 else if (chip->lux_clear < APDS_LUX_GAIN_LO_LIMIT) in apds990x_calc_again()
399 if (chip->lux_clear == chip->a_max_result) in apds990x_calc_again()
403 chip->lux_clear < APDS_LUX_GAIN_LO_LIMIT_STRICT) in apds990x_calc_again()
410 chip->again_next = next_again; in apds990x_calc_again()
411 apds990x_write_byte(chip, APDS990X_CONTROL, in apds990x_calc_again()
412 (chip->pdrive << 6) | in apds990x_calc_again()
413 (chip->pdiode << 4) | in apds990x_calc_again()
414 (chip->pgain << 2) | in apds990x_calc_again()
415 (chip->again_next << 0)); in apds990x_calc_again()
423 apds990x_force_a_refresh(chip); in apds990x_calc_again()
425 apds990x_refresh_athres(chip); in apds990x_calc_again()
431 static int apds990x_get_lux(struct apds990x_chip *chip, int clear, int ir) in apds990x_get_lux() argument
440 iac1 = (chip->cf.cf1 * clear - chip->cf.irf1 * ir) / APDS_PARAM_SCALE; in apds990x_get_lux()
441 iac2 = (chip->cf.cf2 * clear - chip->cf.irf2 * ir) / APDS_PARAM_SCALE; in apds990x_get_lux()
446 lpc = APDS990X_LUX_OUTPUT_SCALE * (chip->cf.df * chip->cf.ga) / in apds990x_get_lux()
447 (u32)(again[chip->again_meas] * (u32)chip->atime); in apds990x_get_lux()
452 static int apds990x_ack_int(struct apds990x_chip *chip, u8 mode) in apds990x_ack_int() argument
454 struct i2c_client *client = chip->client; in apds990x_ack_int()
476 struct apds990x_chip *chip = data; in apds990x_irq() local
479 apds990x_read_byte(chip, APDS990X_STATUS, &status); in apds990x_irq()
480 apds990x_ack_int(chip, status); in apds990x_irq()
482 mutex_lock(&chip->mutex); in apds990x_irq()
483 if (!pm_runtime_suspended(&chip->client->dev)) { in apds990x_irq()
485 apds990x_read_word(chip, APDS990X_CDATAL, in apds990x_irq()
486 &chip->lux_clear); in apds990x_irq()
487 apds990x_read_word(chip, APDS990X_IRDATAL, in apds990x_irq()
488 &chip->lux_ir); in apds990x_irq()
490 chip->again_meas = chip->again_next; in apds990x_irq()
492 chip->lux_raw = apds990x_get_lux(chip, in apds990x_irq()
493 chip->lux_clear, in apds990x_irq()
494 chip->lux_ir); in apds990x_irq()
496 if (apds990x_calc_again(chip) == 0) { in apds990x_irq()
498 chip->lux = chip->lux_raw; in apds990x_irq()
499 chip->lux_wait_fresh_res = false; in apds990x_irq()
500 wake_up(&chip->wait); in apds990x_irq()
501 sysfs_notify(&chip->client->dev.kobj, in apds990x_irq()
506 if ((status & APDS990X_ST_PINT) && chip->prox_en) { in apds990x_irq()
509 apds990x_read_word(chip, APDS990X_CDATAL, &clr_ch); in apds990x_irq()
515 if (chip->again_meas == 0 && in apds990x_irq()
516 clr_ch == chip->a_max_result) in apds990x_irq()
517 chip->prox_data = 0; in apds990x_irq()
519 apds990x_read_word(chip, in apds990x_irq()
521 &chip->prox_data); in apds990x_irq()
523 apds990x_refresh_pthres(chip, chip->prox_data); in apds990x_irq()
524 if (chip->prox_data < chip->prox_thres) in apds990x_irq()
525 chip->prox_data = 0; in apds990x_irq()
526 else if (!chip->prox_continuous_mode) in apds990x_irq()
527 chip->prox_data = APDS_PROX_RANGE; in apds990x_irq()
528 sysfs_notify(&chip->client->dev.kobj, in apds990x_irq()
532 mutex_unlock(&chip->mutex); in apds990x_irq()
536 static int apds990x_configure(struct apds990x_chip *chip) in apds990x_configure() argument
539 apds990x_write_byte(chip, APDS990X_ENABLE, APDS990X_EN_DISABLE_ALL); in apds990x_configure()
542 apds990x_write_byte(chip, APDS990X_PTIME, APDS990X_PTIME_DEFAULT); in apds990x_configure()
543 apds990x_write_byte(chip, APDS990X_WTIME, APDS990X_WTIME_DEFAULT); in apds990x_configure()
544 apds990x_set_atime(chip, APDS_LUX_AVERAGING_TIME); in apds990x_configure()
546 apds990x_write_byte(chip, APDS990X_CONFIG, 0); in apds990x_configure()
549 apds990x_write_byte(chip, APDS990X_PERS, in apds990x_configure()
550 (chip->lux_persistence << APDS990X_APERS_SHIFT) | in apds990x_configure()
551 (chip->prox_persistence << APDS990X_PPERS_SHIFT)); in apds990x_configure()
553 apds990x_write_byte(chip, APDS990X_PPCOUNT, chip->pdata->ppcount); in apds990x_configure()
556 chip->again_meas = 1; in apds990x_configure()
557 chip->again_next = 1; in apds990x_configure()
558 apds990x_write_byte(chip, APDS990X_CONTROL, in apds990x_configure()
559 (chip->pdrive << 6) | in apds990x_configure()
560 (chip->pdiode << 4) | in apds990x_configure()
561 (chip->pgain << 2) | in apds990x_configure()
562 (chip->again_next << 0)); in apds990x_configure()
566 static int apds990x_detect(struct apds990x_chip *chip) in apds990x_detect() argument
568 struct i2c_client *client = chip->client; in apds990x_detect()
572 ret = apds990x_read_byte(chip, APDS990X_ID, &id); in apds990x_detect()
578 ret = apds990x_read_byte(chip, APDS990X_REV, &chip->revision); in apds990x_detect()
588 snprintf(chip->chipname, sizeof(chip->chipname), "APDS-990x"); in apds990x_detect()
598 static int apds990x_chip_on(struct apds990x_chip *chip) in apds990x_chip_on() argument
600 int err = regulator_bulk_enable(ARRAY_SIZE(chip->regs), in apds990x_chip_on()
601 chip->regs); in apds990x_chip_on()
608 chip->prox_data = 0; in apds990x_chip_on()
609 apds990x_configure(chip); in apds990x_chip_on()
610 apds990x_mode_on(chip); in apds990x_chip_on()
615 static int apds990x_chip_off(struct apds990x_chip *chip) in apds990x_chip_off() argument
617 apds990x_write_byte(chip, APDS990X_ENABLE, APDS990X_EN_DISABLE_ALL); in apds990x_chip_off()
618 regulator_bulk_disable(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_chip_off()
625 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_show() local
633 timeout = wait_event_interruptible_timeout(chip->wait, in apds990x_lux_show()
634 !chip->lux_wait_fresh_res, in apds990x_lux_show()
639 mutex_lock(&chip->mutex); in apds990x_lux_show()
640 result = (chip->lux * chip->lux_calib) / APDS_CALIB_SCALER; in apds990x_lux_show()
647 mutex_unlock(&chip->mutex); in apds990x_lux_show()
673 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_calib_show() local
675 return sprintf(buf, "%u\n", chip->lux_calib); in apds990x_lux_calib_show()
682 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_calib_store() local
690 chip->lux_calib = value; in apds990x_lux_calib_store()
713 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_rate_show() local
715 return sprintf(buf, "%d\n", chip->arate); in apds990x_rate_show()
718 static int apds990x_set_arate(struct apds990x_chip *chip, int rate) in apds990x_set_arate() argument
730 chip->lux_persistence = apersis[i]; in apds990x_set_arate()
731 chip->arate = arates_hz[i]; in apds990x_set_arate()
734 if (pm_runtime_suspended(&chip->client->dev)) in apds990x_set_arate()
738 return apds990x_write_byte(chip, APDS990X_PERS, in apds990x_set_arate()
739 (chip->lux_persistence << APDS990X_APERS_SHIFT) | in apds990x_set_arate()
740 (chip->prox_persistence << APDS990X_PPERS_SHIFT)); in apds990x_set_arate()
747 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_rate_store() local
755 mutex_lock(&chip->mutex); in apds990x_rate_store()
756 ret = apds990x_set_arate(chip, value); in apds990x_rate_store()
757 mutex_unlock(&chip->mutex); in apds990x_rate_store()
773 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_show() local
775 if (pm_runtime_suspended(dev) || !chip->prox_en) in apds990x_prox_show()
778 mutex_lock(&chip->mutex); in apds990x_prox_show()
779 ret = sprintf(buf, "%d\n", chip->prox_data); in apds990x_prox_show()
780 mutex_unlock(&chip->mutex); in apds990x_prox_show()
797 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_enable_show() local
799 return sprintf(buf, "%d\n", chip->prox_en); in apds990x_prox_enable_show()
806 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_enable_store() local
814 mutex_lock(&chip->mutex); in apds990x_prox_enable_store()
816 if (!chip->prox_en) in apds990x_prox_enable_store()
817 chip->prox_data = 0; in apds990x_prox_enable_store()
820 chip->prox_en++; in apds990x_prox_enable_store()
821 else if (chip->prox_en > 0) in apds990x_prox_enable_store()
822 chip->prox_en--; in apds990x_prox_enable_store()
825 apds990x_mode_on(chip); in apds990x_prox_enable_store()
826 mutex_unlock(&chip->mutex); in apds990x_prox_enable_store()
838 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_reporting_mode_show() local
841 reporting_modes[!!chip->prox_continuous_mode]); in apds990x_prox_reporting_mode_show()
848 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_reporting_mode_store() local
855 chip->prox_continuous_mode = ret; in apds990x_prox_reporting_mode_store()
876 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_above_show() local
878 return sprintf(buf, "%d\n", chip->lux_thres_hi); in apds990x_lux_thresh_above_show()
884 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_below_show() local
886 return sprintf(buf, "%d\n", chip->lux_thres_lo); in apds990x_lux_thresh_below_show()
889 static ssize_t apds990x_set_lux_thresh(struct apds990x_chip *chip, u32 *target, in apds990x_set_lux_thresh() argument
902 mutex_lock(&chip->mutex); in apds990x_set_lux_thresh()
908 if (!chip->lux_wait_fresh_res) in apds990x_set_lux_thresh()
909 apds990x_refresh_athres(chip); in apds990x_set_lux_thresh()
910 mutex_unlock(&chip->mutex); in apds990x_set_lux_thresh()
919 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_above_store() local
920 int ret = apds990x_set_lux_thresh(chip, &chip->lux_thres_hi, buf); in apds990x_lux_thresh_above_store()
931 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_below_store() local
932 int ret = apds990x_set_lux_thresh(chip, &chip->lux_thres_lo, buf); in apds990x_lux_thresh_below_store()
950 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_threshold_show() local
952 return sprintf(buf, "%d\n", chip->prox_thres); in apds990x_prox_threshold_show()
959 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_threshold_store() local
971 mutex_lock(&chip->mutex); in apds990x_prox_threshold_store()
972 chip->prox_thres = value; in apds990x_prox_threshold_store()
974 apds990x_force_p_refresh(chip); in apds990x_prox_threshold_store()
975 mutex_unlock(&chip->mutex); in apds990x_prox_threshold_store()
994 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_power_state_store() local
1004 mutex_lock(&chip->mutex); in apds990x_power_state_store()
1005 chip->lux_wait_fresh_res = true; in apds990x_power_state_store()
1006 apds990x_force_a_refresh(chip); in apds990x_power_state_store()
1007 apds990x_force_p_refresh(chip); in apds990x_power_state_store()
1008 mutex_unlock(&chip->mutex); in apds990x_power_state_store()
1023 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_chip_id_show() local
1025 return sprintf(buf, "%s %d\n", chip->chipname, chip->revision); in apds990x_chip_id_show()
1056 struct apds990x_chip *chip; in apds990x_probe() local
1059 chip = kzalloc(sizeof *chip, GFP_KERNEL); in apds990x_probe()
1060 if (!chip) in apds990x_probe()
1063 i2c_set_clientdata(client, chip); in apds990x_probe()
1064 chip->client = client; in apds990x_probe()
1066 init_waitqueue_head(&chip->wait); in apds990x_probe()
1067 mutex_init(&chip->mutex); in apds990x_probe()
1068 chip->pdata = client->dev.platform_data; in apds990x_probe()
1070 if (chip->pdata == NULL) { in apds990x_probe()
1076 if (chip->pdata->cf.ga == 0) { in apds990x_probe()
1078 chip->cf.ga = 1966; /* 0.48 * APDS_PARAM_SCALE */ in apds990x_probe()
1079 chip->cf.cf1 = 4096; /* 1.00 * APDS_PARAM_SCALE */ in apds990x_probe()
1080 chip->cf.irf1 = 9134; /* 2.23 * APDS_PARAM_SCALE */ in apds990x_probe()
1081 chip->cf.cf2 = 2867; /* 0.70 * APDS_PARAM_SCALE */ in apds990x_probe()
1082 chip->cf.irf2 = 5816; /* 1.42 * APDS_PARAM_SCALE */ in apds990x_probe()
1083 chip->cf.df = 52; in apds990x_probe()
1085 chip->cf = chip->pdata->cf; in apds990x_probe()
1089 chip->rcf.afactor = in apds990x_probe()
1090 (chip->cf.irf1 - chip->cf.irf2) * APDS_PARAM_SCALE / in apds990x_probe()
1091 (chip->cf.cf1 - chip->cf.cf2); in apds990x_probe()
1092 chip->rcf.cf1 = APDS_PARAM_SCALE * APDS_PARAM_SCALE / in apds990x_probe()
1093 chip->cf.cf1; in apds990x_probe()
1094 chip->rcf.irf1 = chip->cf.irf1 * APDS_PARAM_SCALE / in apds990x_probe()
1095 chip->cf.cf1; in apds990x_probe()
1096 chip->rcf.cf2 = APDS_PARAM_SCALE * APDS_PARAM_SCALE / in apds990x_probe()
1097 chip->cf.cf2; in apds990x_probe()
1098 chip->rcf.irf2 = chip->cf.irf2 * APDS_PARAM_SCALE / in apds990x_probe()
1099 chip->cf.cf2; in apds990x_probe()
1102 chip->lux_thres_hi = APDS_LUX_DEF_THRES_HI; in apds990x_probe()
1103 chip->lux_thres_lo = APDS_LUX_DEF_THRES_LO; in apds990x_probe()
1104 chip->lux_calib = APDS_LUX_NEUTRAL_CALIB_VALUE; in apds990x_probe()
1106 chip->prox_thres = APDS_PROX_DEF_THRES; in apds990x_probe()
1107 chip->pdrive = chip->pdata->pdrive; in apds990x_probe()
1108 chip->pdiode = APDS_PDIODE_IR; in apds990x_probe()
1109 chip->pgain = APDS_PGAIN_1X; in apds990x_probe()
1110 chip->prox_calib = APDS_PROX_NEUTRAL_CALIB_VALUE; in apds990x_probe()
1111 chip->prox_persistence = APDS_DEFAULT_PROX_PERS; in apds990x_probe()
1112 chip->prox_continuous_mode = false; in apds990x_probe()
1114 chip->regs[0].supply = reg_vcc; in apds990x_probe()
1115 chip->regs[1].supply = reg_vled; in apds990x_probe()
1118 ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1124 err = regulator_bulk_enable(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1132 err = apds990x_detect(chip); in apds990x_probe()
1140 apds990x_configure(chip); in apds990x_probe()
1141 apds990x_set_arate(chip, APDS_LUX_DEFAULT_RATE); in apds990x_probe()
1142 apds990x_mode_on(chip); in apds990x_probe()
1146 if (chip->pdata->setup_resources) { in apds990x_probe()
1147 err = chip->pdata->setup_resources(); in apds990x_probe()
1154 err = sysfs_create_group(&chip->client->dev.kobj, in apds990x_probe()
1157 dev_err(&chip->client->dev, "Sysfs registration failed\n"); in apds990x_probe()
1165 "apds990x", chip); in apds990x_probe()
1173 sysfs_remove_group(&chip->client->dev.kobj, in apds990x_probe()
1176 if (chip->pdata && chip->pdata->release_resources) in apds990x_probe()
1177 chip->pdata->release_resources(); in apds990x_probe()
1179 regulator_bulk_disable(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1181 regulator_bulk_free(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1183 kfree(chip); in apds990x_probe()
1189 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_remove() local
1191 free_irq(client->irq, chip); in apds990x_remove()
1192 sysfs_remove_group(&chip->client->dev.kobj, in apds990x_remove()
1195 if (chip->pdata && chip->pdata->release_resources) in apds990x_remove()
1196 chip->pdata->release_resources(); in apds990x_remove()
1199 apds990x_chip_off(chip); in apds990x_remove()
1204 regulator_bulk_free(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_remove()
1206 kfree(chip); in apds990x_remove()
1213 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_suspend() local
1215 apds990x_chip_off(chip); in apds990x_suspend()
1222 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_resume() local
1228 apds990x_chip_on(chip); in apds990x_resume()
1238 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_runtime_suspend() local
1240 apds990x_chip_off(chip); in apds990x_runtime_suspend()
1247 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_runtime_resume() local
1249 apds990x_chip_on(chip); in apds990x_runtime_resume()