Lines Matching refs:chip

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
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
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()
727 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_rate_show() local
728 return sprintf(buf, "%d\n", chip->arate); in apds990x_rate_show()
731 static int apds990x_set_arate(struct apds990x_chip *chip, int rate) in apds990x_set_arate() argument
743 chip->lux_persistence = apersis[i]; in apds990x_set_arate()
744 chip->arate = arates_hz[i]; in apds990x_set_arate()
747 if (pm_runtime_suspended(&chip->client->dev)) in apds990x_set_arate()
751 return apds990x_write_byte(chip, APDS990X_PERS, in apds990x_set_arate()
752 (chip->lux_persistence << APDS990X_APERS_SHIFT) | in apds990x_set_arate()
753 (chip->prox_persistence << APDS990X_PPERS_SHIFT)); in apds990x_set_arate()
760 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_rate_store() local
768 mutex_lock(&chip->mutex); in apds990x_rate_store()
769 ret = apds990x_set_arate(chip, value); in apds990x_rate_store()
770 mutex_unlock(&chip->mutex); in apds990x_rate_store()
786 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_show() local
787 if (pm_runtime_suspended(dev) || !chip->prox_en) in apds990x_prox_show()
790 mutex_lock(&chip->mutex); in apds990x_prox_show()
791 ret = sprintf(buf, "%d\n", chip->prox_data); in apds990x_prox_show()
792 mutex_unlock(&chip->mutex); in apds990x_prox_show()
809 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_enable_show() local
810 return sprintf(buf, "%d\n", chip->prox_en); in apds990x_prox_enable_show()
817 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_enable_store() local
825 mutex_lock(&chip->mutex); in apds990x_prox_enable_store()
827 if (!chip->prox_en) in apds990x_prox_enable_store()
828 chip->prox_data = 0; in apds990x_prox_enable_store()
831 chip->prox_en++; in apds990x_prox_enable_store()
832 else if (chip->prox_en > 0) in apds990x_prox_enable_store()
833 chip->prox_en--; in apds990x_prox_enable_store()
836 apds990x_mode_on(chip); in apds990x_prox_enable_store()
837 mutex_unlock(&chip->mutex); in apds990x_prox_enable_store()
849 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_reporting_mode_show() local
851 reporting_modes[!!chip->prox_continuous_mode]); in apds990x_prox_reporting_mode_show()
858 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_reporting_mode_store() local
861 chip->prox_continuous_mode = 0; in apds990x_prox_reporting_mode_store()
863 chip->prox_continuous_mode = 1; in apds990x_prox_reporting_mode_store()
886 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_above_show() local
887 return sprintf(buf, "%d\n", chip->lux_thres_hi); in apds990x_lux_thresh_above_show()
893 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_below_show() local
894 return sprintf(buf, "%d\n", chip->lux_thres_lo); in apds990x_lux_thresh_below_show()
897 static ssize_t apds990x_set_lux_thresh(struct apds990x_chip *chip, u32 *target, in apds990x_set_lux_thresh() argument
910 mutex_lock(&chip->mutex); in apds990x_set_lux_thresh()
916 if (!chip->lux_wait_fresh_res) in apds990x_set_lux_thresh()
917 apds990x_refresh_athres(chip); in apds990x_set_lux_thresh()
918 mutex_unlock(&chip->mutex); in apds990x_set_lux_thresh()
927 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_above_store() local
928 int ret = apds990x_set_lux_thresh(chip, &chip->lux_thres_hi, buf); in apds990x_lux_thresh_above_store()
938 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_lux_thresh_below_store() local
939 int ret = apds990x_set_lux_thresh(chip, &chip->lux_thres_lo, buf); in apds990x_lux_thresh_below_store()
956 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_threshold_show() local
957 return sprintf(buf, "%d\n", chip->prox_thres); in apds990x_prox_threshold_show()
964 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_prox_threshold_store() local
976 mutex_lock(&chip->mutex); in apds990x_prox_threshold_store()
977 chip->prox_thres = value; in apds990x_prox_threshold_store()
979 apds990x_force_p_refresh(chip); in apds990x_prox_threshold_store()
980 mutex_unlock(&chip->mutex); in apds990x_prox_threshold_store()
999 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_power_state_store() local
1009 mutex_lock(&chip->mutex); in apds990x_power_state_store()
1010 chip->lux_wait_fresh_res = true; in apds990x_power_state_store()
1011 apds990x_force_a_refresh(chip); in apds990x_power_state_store()
1012 apds990x_force_p_refresh(chip); in apds990x_power_state_store()
1013 mutex_unlock(&chip->mutex); in apds990x_power_state_store()
1028 struct apds990x_chip *chip = dev_get_drvdata(dev); in apds990x_chip_id_show() local
1029 return sprintf(buf, "%s %d\n", chip->chipname, chip->revision); in apds990x_chip_id_show()
1061 struct apds990x_chip *chip; in apds990x_probe() local
1064 chip = kzalloc(sizeof *chip, GFP_KERNEL); in apds990x_probe()
1065 if (!chip) in apds990x_probe()
1068 i2c_set_clientdata(client, chip); in apds990x_probe()
1069 chip->client = client; in apds990x_probe()
1071 init_waitqueue_head(&chip->wait); in apds990x_probe()
1072 mutex_init(&chip->mutex); in apds990x_probe()
1073 chip->pdata = client->dev.platform_data; in apds990x_probe()
1075 if (chip->pdata == NULL) { in apds990x_probe()
1081 if (chip->pdata->cf.ga == 0) { in apds990x_probe()
1083 chip->cf.ga = 1966; /* 0.48 * APDS_PARAM_SCALE */ in apds990x_probe()
1084 chip->cf.cf1 = 4096; /* 1.00 * APDS_PARAM_SCALE */ in apds990x_probe()
1085 chip->cf.irf1 = 9134; /* 2.23 * APDS_PARAM_SCALE */ in apds990x_probe()
1086 chip->cf.cf2 = 2867; /* 0.70 * APDS_PARAM_SCALE */ in apds990x_probe()
1087 chip->cf.irf2 = 5816; /* 1.42 * APDS_PARAM_SCALE */ in apds990x_probe()
1088 chip->cf.df = 52; in apds990x_probe()
1090 chip->cf = chip->pdata->cf; in apds990x_probe()
1094 chip->rcf.afactor = in apds990x_probe()
1095 (chip->cf.irf1 - chip->cf.irf2) * APDS_PARAM_SCALE / in apds990x_probe()
1096 (chip->cf.cf1 - chip->cf.cf2); in apds990x_probe()
1097 chip->rcf.cf1 = APDS_PARAM_SCALE * APDS_PARAM_SCALE / in apds990x_probe()
1098 chip->cf.cf1; in apds990x_probe()
1099 chip->rcf.irf1 = chip->cf.irf1 * APDS_PARAM_SCALE / in apds990x_probe()
1100 chip->cf.cf1; in apds990x_probe()
1101 chip->rcf.cf2 = APDS_PARAM_SCALE * APDS_PARAM_SCALE / in apds990x_probe()
1102 chip->cf.cf2; in apds990x_probe()
1103 chip->rcf.irf2 = chip->cf.irf2 * APDS_PARAM_SCALE / in apds990x_probe()
1104 chip->cf.cf2; in apds990x_probe()
1107 chip->lux_thres_hi = APDS_LUX_DEF_THRES_HI; in apds990x_probe()
1108 chip->lux_thres_lo = APDS_LUX_DEF_THRES_LO; in apds990x_probe()
1109 chip->lux_calib = APDS_LUX_NEUTRAL_CALIB_VALUE; in apds990x_probe()
1111 chip->prox_thres = APDS_PROX_DEF_THRES; in apds990x_probe()
1112 chip->pdrive = chip->pdata->pdrive; in apds990x_probe()
1113 chip->pdiode = APDS_PDIODE_IR; in apds990x_probe()
1114 chip->pgain = APDS_PGAIN_1X; in apds990x_probe()
1115 chip->prox_calib = APDS_PROX_NEUTRAL_CALIB_VALUE; in apds990x_probe()
1116 chip->prox_persistence = APDS_DEFAULT_PROX_PERS; in apds990x_probe()
1117 chip->prox_continuous_mode = false; in apds990x_probe()
1119 chip->regs[0].supply = reg_vcc; in apds990x_probe()
1120 chip->regs[1].supply = reg_vled; in apds990x_probe()
1123 ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1129 err = regulator_bulk_enable(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1137 err = apds990x_detect(chip); in apds990x_probe()
1145 apds990x_configure(chip); in apds990x_probe()
1146 apds990x_set_arate(chip, APDS_LUX_DEFAULT_RATE); in apds990x_probe()
1147 apds990x_mode_on(chip); in apds990x_probe()
1151 if (chip->pdata->setup_resources) { in apds990x_probe()
1152 err = chip->pdata->setup_resources(); in apds990x_probe()
1159 err = sysfs_create_group(&chip->client->dev.kobj, in apds990x_probe()
1162 dev_err(&chip->client->dev, "Sysfs registration failed\n"); in apds990x_probe()
1170 "apds990x", chip); in apds990x_probe()
1178 sysfs_remove_group(&chip->client->dev.kobj, in apds990x_probe()
1181 if (chip->pdata && chip->pdata->release_resources) in apds990x_probe()
1182 chip->pdata->release_resources(); in apds990x_probe()
1184 regulator_bulk_disable(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1186 regulator_bulk_free(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_probe()
1188 kfree(chip); in apds990x_probe()
1194 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_remove() local
1196 free_irq(client->irq, chip); in apds990x_remove()
1197 sysfs_remove_group(&chip->client->dev.kobj, in apds990x_remove()
1200 if (chip->pdata && chip->pdata->release_resources) in apds990x_remove()
1201 chip->pdata->release_resources(); in apds990x_remove()
1204 apds990x_chip_off(chip); in apds990x_remove()
1209 regulator_bulk_free(ARRAY_SIZE(chip->regs), chip->regs); in apds990x_remove()
1211 kfree(chip); in apds990x_remove()
1219 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_suspend() local
1221 apds990x_chip_off(chip); in apds990x_suspend()
1228 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_resume() local
1234 apds990x_chip_on(chip); in apds990x_resume()
1244 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_runtime_suspend() local
1246 apds990x_chip_off(chip); in apds990x_runtime_suspend()
1253 struct apds990x_chip *chip = i2c_get_clientdata(client); in apds990x_runtime_resume() local
1255 apds990x_chip_on(chip); in apds990x_runtime_resume()