• Home
  • Raw
  • Download

Lines Matching full:chip

3  * Chip is combined proximity and ambient light sensor.
117 /* Reverse chip factors for threshold calculation */
137 /* Chip parameters */
201 static int apds990x_read_byte(struct apds990x_chip *chip, u8 reg, u8 *data) in apds990x_read_byte() argument
203 struct i2c_client *client = chip->client; in apds990x_read_byte()
214 static int apds990x_read_word(struct apds990x_chip *chip, u8 reg, u16 *data) in apds990x_read_word() argument
216 struct i2c_client *client = chip->client; in apds990x_read_word()
227 static int apds990x_write_byte(struct apds990x_chip *chip, u8 reg, u8 data) in apds990x_write_byte() argument
229 struct i2c_client *client = chip->client; in apds990x_write_byte()
239 static int apds990x_write_word(struct apds990x_chip *chip, u8 reg, u16 data) in apds990x_write_word() argument
241 struct i2c_client *client = chip->client; in apds990x_write_word()
251 static int apds990x_mode_on(struct apds990x_chip *chip) in apds990x_mode_on() argument
257 if (chip->prox_en) in apds990x_mode_on()
260 return apds990x_write_byte(chip, APDS990X_ENABLE, reg); in apds990x_mode_on()
263 static u16 apds990x_lux_to_threshold(struct apds990x_chip *chip, u32 lux) in apds990x_lux_to_threshold() argument
289 lux = lux * (APDS_CALIB_SCALER / 4) / (chip->lux_calib / 4); in apds990x_lux_to_threshold()
292 cpl = ((u32)chip->atime * (u32)again[chip->again_next] * in apds990x_lux_to_threshold()
293 APDS_PARAM_SCALE * 64) / (chip->cf.ga * chip->cf.df); in apds990x_lux_to_threshold()
301 ir = (u32)chip->lux_ir * (u32)again[chip->again_next] / in apds990x_lux_to_threshold()
302 (u32)again[chip->again_meas]; in apds990x_lux_to_threshold()
308 if (chip->lux_clear * APDS_PARAM_SCALE >= in apds990x_lux_to_threshold()
309 chip->rcf.afactor * chip->lux_ir) in apds990x_lux_to_threshold()
310 thres = (chip->rcf.cf1 * thres + chip->rcf.irf1 * ir) / in apds990x_lux_to_threshold()
313 thres = (chip->rcf.cf2 * thres + chip->rcf.irf2 * ir) / in apds990x_lux_to_threshold()
316 if (thres >= chip->a_max_result) in apds990x_lux_to_threshold()
317 thres = chip->a_max_result - 1; in apds990x_lux_to_threshold()
321 static inline int apds990x_set_atime(struct apds990x_chip *chip, u32 time_ms) in apds990x_set_atime() argument
325 chip->atime = time_ms; in apds990x_set_atime()
329 chip->a_max_result = (u16)(256 - reg_value) * APDS990X_TIME_TO_ADC; in apds990x_set_atime()
330 return apds990x_write_byte(chip, APDS990X_ATIME, reg_value); in apds990x_set_atime()
334 static int apds990x_refresh_pthres(struct apds990x_chip *chip, int data) in apds990x_refresh_pthres() argument
338 /* If the chip is not in use, don't try to access it */ in apds990x_refresh_pthres()
339 if (pm_runtime_suspended(&chip->client->dev)) in apds990x_refresh_pthres()
342 if (data < chip->prox_thres) { in apds990x_refresh_pthres()
344 hi = chip->prox_thres; in apds990x_refresh_pthres()
346 lo = chip->prox_thres - APDS_PROX_HYSTERESIS; in apds990x_refresh_pthres()
347 if (chip->prox_continuous_mode) in apds990x_refresh_pthres()
348 hi = chip->prox_thres; in apds990x_refresh_pthres()
353 ret = apds990x_write_word(chip, APDS990X_PILTL, lo); in apds990x_refresh_pthres()
354 ret |= apds990x_write_word(chip, APDS990X_PIHTL, hi); in apds990x_refresh_pthres()
359 static int apds990x_refresh_athres(struct apds990x_chip *chip) in apds990x_refresh_athres() argument
362 /* If the chip is not in use, don't try to access it */ in apds990x_refresh_athres()
363 if (pm_runtime_suspended(&chip->client->dev)) in apds990x_refresh_athres()
366 ret = apds990x_write_word(chip, APDS990X_AILTL, in apds990x_refresh_athres()
367 apds990x_lux_to_threshold(chip, chip->lux_thres_lo)); in apds990x_refresh_athres()
368 ret |= apds990x_write_word(chip, APDS990X_AIHTL, in apds990x_refresh_athres()
369 apds990x_lux_to_threshold(chip, chip->lux_thres_hi)); in apds990x_refresh_athres()
375 static void apds990x_force_a_refresh(struct apds990x_chip *chip) in apds990x_force_a_refresh() argument
378 apds990x_write_word(chip, APDS990X_AILTL, APDS_LUX_DEF_THRES_LO); in apds990x_force_a_refresh()
379 apds990x_write_word(chip, APDS990X_AIHTL, APDS_LUX_DEF_THRES_HI); in apds990x_force_a_refresh()
383 static void apds990x_force_p_refresh(struct apds990x_chip *chip) in apds990x_force_p_refresh() argument
386 apds990x_write_word(chip, APDS990X_PILTL, APDS_PROX_DEF_THRES - 1); in apds990x_force_p_refresh()
387 apds990x_write_word(chip, APDS990X_PIHTL, APDS_PROX_DEF_THRES); in apds990x_force_p_refresh()
391 static int apds990x_calc_again(struct apds990x_chip *chip) in apds990x_calc_again() argument
393 int curr_again = chip->again_meas; in apds990x_calc_again()
394 int next_again = chip->again_meas; in apds990x_calc_again()
398 if (chip->lux_clear == chip->a_max_result) in apds990x_calc_again()
400 else if (chip->lux_clear > chip->a_max_result / 2) in apds990x_calc_again()
402 else if (chip->lux_clear < APDS_LUX_GAIN_LO_LIMIT_STRICT) in apds990x_calc_again()
404 else if (chip->lux_clear < APDS_LUX_GAIN_LO_LIMIT) in apds990x_calc_again()
414 if (chip->lux_clear == chip->a_max_result) in apds990x_calc_again()
418 chip->lux_clear < APDS_LUX_GAIN_LO_LIMIT_STRICT) in apds990x_calc_again()
425 chip->again_next = next_again; in apds990x_calc_again()
426 apds990x_write_byte(chip, APDS990X_CONTROL, in apds990x_calc_again()
427 (chip->pdrive << 6) | in apds990x_calc_again()
428 (chip->pdiode << 4) | in apds990x_calc_again()
429 (chip->pgain << 2) | in apds990x_calc_again()
430 (chip->again_next << 0)); in apds990x_calc_again()
438 apds990x_force_a_refresh(chip); in apds990x_calc_again()
440 apds990x_refresh_athres(chip); in apds990x_calc_again()
446 static int apds990x_get_lux(struct apds990x_chip *chip, int clear, int ir) in apds990x_get_lux() argument
455 iac1 = (chip->cf.cf1 * clear - chip->cf.irf1 * ir) / APDS_PARAM_SCALE; in apds990x_get_lux()
456 iac2 = (chip->cf.cf2 * clear - chip->cf.irf2 * ir) / APDS_PARAM_SCALE; in apds990x_get_lux()
461 lpc = APDS990X_LUX_OUTPUT_SCALE * (chip->cf.df * chip->cf.ga) / in apds990x_get_lux()
462 (u32)(again[chip->again_meas] * (u32)chip->atime); in apds990x_get_lux()
467 static int apds990x_ack_int(struct apds990x_chip *chip, u8 mode) in apds990x_ack_int() argument
469 struct i2c_client *client = chip->client; in apds990x_ack_int()
491 struct apds990x_chip *chip = data; in apds990x_irq() local
494 apds990x_read_byte(chip, APDS990X_STATUS, &status); in apds990x_irq()
495 apds990x_ack_int(chip, status); in apds990x_irq()
497 mutex_lock(&chip->mutex); in apds990x_irq()
498 if (!pm_runtime_suspended(&chip->client->dev)) { in apds990x_irq()
500 apds990x_read_word(chip, APDS990X_CDATAL, in apds990x_irq()
501 &chip->lux_clear); in apds990x_irq()
502 apds990x_read_word(chip, APDS990X_IRDATAL, in apds990x_irq()
503 &chip->lux_ir); in apds990x_irq()
505 chip->again_meas = chip->again_next; in apds990x_irq()
507 chip->lux_raw = apds990x_get_lux(chip, in apds990x_irq()
508 chip->lux_clear, in apds990x_irq()
509 chip->lux_ir); in apds990x_irq()
511 if (apds990x_calc_again(chip) == 0) { in apds990x_irq()
513 chip->lux = chip->lux_raw; in apds990x_irq()
514 chip->lux_wait_fresh_res = false; in apds990x_irq()
515 wake_up(&chip->wait); in apds990x_irq()
516 sysfs_notify(&chip->client->dev.kobj, in apds990x_irq()
521 if ((status & APDS990X_ST_PINT) && chip->prox_en) { in apds990x_irq()
524 apds990x_read_word(chip, APDS990X_CDATAL, &clr_ch); in apds990x_irq()
530 if (chip->again_meas == 0 && in apds990x_irq()
531 clr_ch == chip->a_max_result) in apds990x_irq()
532 chip->prox_data = 0; in apds990x_irq()
534 apds990x_read_word(chip, in apds990x_irq()
536 &chip->prox_data); in apds990x_irq()
538 apds990x_refresh_pthres(chip, chip->prox_data); in apds990x_irq()
539 if (chip->prox_data < chip->prox_thres) in apds990x_irq()
540 chip->prox_data = 0; in apds990x_irq()
541 else if (!chip->prox_continuous_mode) in apds990x_irq()
542 chip->prox_data = APDS_PROX_RANGE; in apds990x_irq()
543 sysfs_notify(&chip->client->dev.kobj, in apds990x_irq()
547 mutex_unlock(&chip->mutex); in apds990x_irq()
551 static int apds990x_configure(struct apds990x_chip *chip) in apds990x_configure() argument
554 apds990x_write_byte(chip, APDS990X_ENABLE, APDS990X_EN_DISABLE_ALL); in apds990x_configure()
557 apds990x_write_byte(chip, APDS990X_PTIME, APDS990X_PTIME_DEFAULT); in apds990x_configure()
558 apds990x_write_byte(chip, APDS990X_WTIME, APDS990X_WTIME_DEFAULT); in apds990x_configure()
559 apds990x_set_atime(chip, APDS_LUX_AVERAGING_TIME); in apds990x_configure()
561 apds990x_write_byte(chip, APDS990X_CONFIG, 0); in apds990x_configure()
564 apds990x_write_byte(chip, APDS990X_PERS, in apds990x_configure()
565 (chip->lux_persistence << APDS990X_APERS_SHIFT) | in apds990x_configure()
566 (chip->prox_persistence << APDS990X_PPERS_SHIFT)); in apds990x_configure()
568 apds990x_write_byte(chip, APDS990X_PPCOUNT, chip->pdata->ppcount); in apds990x_configure()
571 chip->again_meas = 1; in apds990x_configure()
572 chip->again_next = 1; in apds990x_configure()
573 apds990x_write_byte(chip, APDS990X_CONTROL, in apds990x_configure()
574 (chip->pdrive << 6) | in apds990x_configure()
575 (chip->pdiode << 4) | in apds990x_configure()
576 (chip->pgain << 2) | in apds990x_configure()
577 (chip->again_next << 0)); in apds990x_configure()
581 static int apds990x_detect(struct apds990x_chip *chip) in apds990x_detect() argument
583 struct i2c_client *client = chip->client; in apds990x_detect()
587 ret = apds990x_read_byte(chip, APDS990X_ID, &id); in apds990x_detect()
593 ret = apds990x_read_byte(chip, APDS990X_REV, &chip->revision); in apds990x_detect()
603 snprintf(chip->chipname, sizeof(chip->chipname), "APDS-990x"); in apds990x_detect()
613 static int apds990x_chip_on(struct apds990x_chip *chip) in apds990x_chip_on() argument
615 int err = regulator_bulk_enable(ARRAY_SIZE(chip->regs), in apds990x_chip_on()
616 chip->regs); in apds990x_chip_on()
623 chip->prox_data = 0; in apds990x_chip_on()
624 apds990x_configure(chip); in apds990x_chip_on()
625 apds990x_mode_on(chip); in apds990x_chip_on()
630 static int apds990x_chip_off(struct apds990x_chip *chip) in apds990x_chip_off() argument
632 apds990x_write_byte(chip, APDS990X_ENABLE, APDS990X_EN_DISABLE_ALL); in apds990x_chip_off()
633 regulator_bulk_disable(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_chip_off()
640 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_show() local
648 timeout = wait_event_interruptible_timeout(chip->wait, in apds990x_lux_show()
649 !chip->lux_wait_fresh_res, in apds990x_lux_show()
654 mutex_lock(&chip->mutex); in apds990x_lux_show()
655 result = (chip->lux * chip->lux_calib) / APDS_CALIB_SCALER; in apds990x_lux_show()
662 mutex_unlock(&chip->mutex); in apds990x_lux_show()
688 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_calib_show() local
690 return sprintf(buf, "%u\n", chip->lux_calib); in apds990x_lux_calib_show()
697 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_calib_store() local
705 chip->lux_calib = value; in apds990x_lux_calib_store()
728 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_rate_show() local
730 return sprintf(buf, "%d\n", chip->arate); in apds990x_rate_show()
733 static int apds990x_set_arate(struct apds990x_chip *chip, int rate) in apds990x_set_arate() argument
745 chip->lux_persistence = apersis[i]; in apds990x_set_arate()
746 chip->arate = arates_hz[i]; in apds990x_set_arate()
748 /* If the chip is not in use, don't try to access it */ in apds990x_set_arate()
749 if (pm_runtime_suspended(&chip->client->dev)) in apds990x_set_arate()
753 return apds990x_write_byte(chip, APDS990X_PERS, in apds990x_set_arate()
754 (chip->lux_persistence << APDS990X_APERS_SHIFT) | in apds990x_set_arate()
755 (chip->prox_persistence << APDS990X_PPERS_SHIFT)); in apds990x_set_arate()
762 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_rate_store() local
770 mutex_lock(&chip->mutex); in apds990x_rate_store()
771 ret = apds990x_set_arate(chip, value); in apds990x_rate_store()
772 mutex_unlock(&chip->mutex); in apds990x_rate_store()
788 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_show() local
790 if (pm_runtime_suspended(dev) || !chip->prox_en) in apds990x_prox_show()
793 mutex_lock(&chip->mutex); in apds990x_prox_show()
794 ret = sprintf(buf, "%d\n", chip->prox_data); in apds990x_prox_show()
795 mutex_unlock(&chip->mutex); in apds990x_prox_show()
812 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_enable_show() local
814 return sprintf(buf, "%d\n", chip->prox_en); in apds990x_prox_enable_show()
821 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_enable_store() local
829 mutex_lock(&chip->mutex); in apds990x_prox_enable_store()
831 if (!chip->prox_en) in apds990x_prox_enable_store()
832 chip->prox_data = 0; in apds990x_prox_enable_store()
835 chip->prox_en++; in apds990x_prox_enable_store()
836 else if (chip->prox_en > 0) in apds990x_prox_enable_store()
837 chip->prox_en--; in apds990x_prox_enable_store()
840 apds990x_mode_on(chip); in apds990x_prox_enable_store()
841 mutex_unlock(&chip->mutex); in apds990x_prox_enable_store()
853 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_reporting_mode_show() local
856 reporting_modes[!!chip->prox_continuous_mode]); in apds990x_prox_reporting_mode_show()
863 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_reporting_mode_store() local
870 chip->prox_continuous_mode = ret; in apds990x_prox_reporting_mode_store()
891 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_above_show() local
893 return sprintf(buf, "%d\n", chip->lux_thres_hi); in apds990x_lux_thresh_above_show()
899 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_below_show() local
901 return sprintf(buf, "%d\n", chip->lux_thres_lo); in apds990x_lux_thresh_below_show()
904 static ssize_t apds990x_set_lux_thresh(struct apds990x_chip *chip, u32 *target, in apds990x_set_lux_thresh() argument
917 mutex_lock(&chip->mutex); in apds990x_set_lux_thresh()
923 if (!chip->lux_wait_fresh_res) in apds990x_set_lux_thresh()
924 apds990x_refresh_athres(chip); in apds990x_set_lux_thresh()
925 mutex_unlock(&chip->mutex); in apds990x_set_lux_thresh()
934 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_above_store() local
935 int ret = apds990x_set_lux_thresh(chip, &chip->lux_thres_hi, buf); in apds990x_lux_thresh_above_store()
946 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_below_store() local
947 int ret = apds990x_set_lux_thresh(chip, &chip->lux_thres_lo, buf); in apds990x_lux_thresh_below_store()
965 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_threshold_show() local
967 return sprintf(buf, "%d\n", chip->prox_thres); in apds990x_prox_threshold_show()
974 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_threshold_store() local
986 mutex_lock(&chip->mutex); in apds990x_prox_threshold_store()
987 chip->prox_thres = value; in apds990x_prox_threshold_store()
989 apds990x_force_p_refresh(chip); in apds990x_prox_threshold_store()
990 mutex_unlock(&chip->mutex); in apds990x_prox_threshold_store()
1009 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_power_state_store() local
1019 mutex_lock(&chip->mutex); in apds990x_power_state_store()
1020 chip->lux_wait_fresh_res = true; in apds990x_power_state_store()
1021 apds990x_force_a_refresh(chip); in apds990x_power_state_store()
1022 apds990x_force_p_refresh(chip); in apds990x_power_state_store()
1023 mutex_unlock(&chip->mutex); in apds990x_power_state_store()
1038 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_chip_id_show() local
1040 return sprintf(buf, "%s %d\n", chip->chipname, chip->revision); in apds990x_chip_id_show()
1072 struct apds990x_chip *chip; in apds990x_probe() local
1075 chip = kzalloc(sizeof *chip, GFP_KERNEL); in apds990x_probe()
1076 if (!chip) in apds990x_probe()
1079 i2c_set_clientdata(client, chip); in apds990x_probe()
1080 chip->client = client; in apds990x_probe()
1082 init_waitqueue_head(&chip->wait); in apds990x_probe()
1083 mutex_init(&chip->mutex); in apds990x_probe()
1084 chip->pdata = client->dev.platform_data; in apds990x_probe()
1086 if (chip->pdata == NULL) { in apds990x_probe()
1092 if (chip->pdata->cf.ga == 0) { in apds990x_probe()
1094 chip->cf.ga = 1966; /* 0.48 * APDS_PARAM_SCALE */ in apds990x_probe()
1095 chip->cf.cf1 = 4096; /* 1.00 * APDS_PARAM_SCALE */ in apds990x_probe()
1096 chip->cf.irf1 = 9134; /* 2.23 * APDS_PARAM_SCALE */ in apds990x_probe()
1097 chip->cf.cf2 = 2867; /* 0.70 * APDS_PARAM_SCALE */ in apds990x_probe()
1098 chip->cf.irf2 = 5816; /* 1.42 * APDS_PARAM_SCALE */ in apds990x_probe()
1099 chip->cf.df = 52; in apds990x_probe()
1101 chip->cf = chip->pdata->cf; in apds990x_probe()
1104 /* precalculate inverse chip factors for threshold control */ in apds990x_probe()
1105 chip->rcf.afactor = in apds990x_probe()
1106 (chip->cf.irf1 - chip->cf.irf2) * APDS_PARAM_SCALE / in apds990x_probe()
1107 (chip->cf.cf1 - chip->cf.cf2); in apds990x_probe()
1108 chip->rcf.cf1 = APDS_PARAM_SCALE * APDS_PARAM_SCALE / in apds990x_probe()
1109 chip->cf.cf1; in apds990x_probe()
1110 chip->rcf.irf1 = chip->cf.irf1 * APDS_PARAM_SCALE / in apds990x_probe()
1111 chip->cf.cf1; in apds990x_probe()
1112 chip->rcf.cf2 = APDS_PARAM_SCALE * APDS_PARAM_SCALE / in apds990x_probe()
1113 chip->cf.cf2; in apds990x_probe()
1114 chip->rcf.irf2 = chip->cf.irf2 * APDS_PARAM_SCALE / in apds990x_probe()
1115 chip->cf.cf2; in apds990x_probe()
1118 chip->lux_thres_hi = APDS_LUX_DEF_THRES_HI; in apds990x_probe()
1119 chip->lux_thres_lo = APDS_LUX_DEF_THRES_LO; in apds990x_probe()
1120 chip->lux_calib = APDS_LUX_NEUTRAL_CALIB_VALUE; in apds990x_probe()
1122 chip->prox_thres = APDS_PROX_DEF_THRES; in apds990x_probe()
1123 chip->pdrive = chip->pdata->pdrive; in apds990x_probe()
1124 chip->pdiode = APDS_PDIODE_IR; in apds990x_probe()
1125 chip->pgain = APDS_PGAIN_1X; in apds990x_probe()
1126 chip->prox_calib = APDS_PROX_NEUTRAL_CALIB_VALUE; in apds990x_probe()
1127 chip->prox_persistence = APDS_DEFAULT_PROX_PERS; in apds990x_probe()
1128 chip->prox_continuous_mode = false; in apds990x_probe()
1130 chip->regs[0].supply = reg_vcc; in apds990x_probe()
1131 chip->regs[1].supply = reg_vled; in apds990x_probe()
1134 ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1140 err = regulator_bulk_enable(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1148 err = apds990x_detect(chip); in apds990x_probe()
1156 apds990x_configure(chip); in apds990x_probe()
1157 apds990x_set_arate(chip, APDS_LUX_DEFAULT_RATE); in apds990x_probe()
1158 apds990x_mode_on(chip); in apds990x_probe()
1162 if (chip->pdata->setup_resources) { in apds990x_probe()
1163 err = chip->pdata->setup_resources(); in apds990x_probe()
1170 err = sysfs_create_group(&chip->client->dev.kobj, in apds990x_probe()
1173 dev_err(&chip->client->dev, "Sysfs registration failed\n"); in apds990x_probe()
1181 "apds990x", chip); in apds990x_probe()
1189 sysfs_remove_group(&chip->client->dev.kobj, in apds990x_probe()
1192 if (chip->pdata && chip->pdata->release_resources) in apds990x_probe()
1193 chip->pdata->release_resources(); in apds990x_probe()
1195 regulator_bulk_disable(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1197 regulator_bulk_free(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1199 kfree(chip); in apds990x_probe()
1205 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_remove() local
1207 free_irq(client->irq, chip); in apds990x_remove()
1208 sysfs_remove_group(&chip->client->dev.kobj, in apds990x_remove()
1211 if (chip->pdata && chip->pdata->release_resources) in apds990x_remove()
1212 chip->pdata->release_resources(); in apds990x_remove()
1215 apds990x_chip_off(chip); in apds990x_remove()
1220 regulator_bulk_free(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_remove()
1222 kfree(chip); in apds990x_remove()
1230 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_suspend() local
1232 apds990x_chip_off(chip); in apds990x_suspend()
1239 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_resume() local
1245 apds990x_chip_on(chip); in apds990x_resume()
1255 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_runtime_suspend() local
1257 apds990x_chip_off(chip); in apds990x_runtime_suspend()
1264 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_runtime_resume() local
1266 apds990x_chip_on(chip); in apds990x_runtime_resume()