Lines Matching full:als

99  * @config: value of ALS configuration register
102 * @als_avrg_time: ALS averaging time
103 * @als_input_mode: ALS input mode for brightness control
104 * @als_vmin: Minimum ALS voltage
105 * @als_vmax: Maximum ALS voltage
106 * @zone_lo: values of ALS lo ZB(Zone Boundary) registers
107 * @zone_hi: values of ALS hi ZB(Zone Boundary) registers
154 * @als_data: Pointer to the als data struct
449 struct lm3532_als_data *als = priv->als_data; in lm3532_als_configure() local
455 als_vmin = als->als_vmin; in lm3532_als_configure()
456 als_vmax = als->als_vmax; in lm3532_als_configure()
461 als->zones_lo[i] = ((als_vmin + als_vstep + (i * als_vstep)) * in lm3532_als_configure()
463 als->zones_hi[i] = ((als_vmin + LM3532_ALS_OFFSET_mV + in lm3532_als_configure()
467 ret = regmap_write(priv->regmap, zone_reg, als->zones_lo[i]); in lm3532_als_configure()
472 ret = regmap_write(priv->regmap, zone_reg, als->zones_hi[i]); in lm3532_als_configure()
477 als->config = (als->als_avrg_time | (LM3532_ENABLE_ALS) | in lm3532_als_configure()
478 (als->als_input_mode << LM3532_ALS_SEL_SHIFT)); in lm3532_als_configure()
480 return regmap_write(priv->regmap, LM3532_ALS_CONFIG, als->config); in lm3532_als_configure()
485 struct lm3532_als_data *als; in lm3532_parse_als() local
490 als = devm_kzalloc(priv->dev, sizeof(*als), GFP_KERNEL); in lm3532_parse_als()
491 if (als == NULL) in lm3532_parse_als()
494 ret = device_property_read_u32(&priv->client->dev, "ti,als-vmin", in lm3532_parse_als()
495 &als->als_vmin); in lm3532_parse_als()
497 als->als_vmin = 0; in lm3532_parse_als()
499 ret = device_property_read_u32(&priv->client->dev, "ti,als-vmax", in lm3532_parse_als()
500 &als->als_vmax); in lm3532_parse_als()
502 als->als_vmax = LM3532_ALS_WINDOW_mV; in lm3532_parse_als()
504 if (als->als_vmax > LM3532_ALS_WINDOW_mV) { in lm3532_parse_als()
512 als->als1_imp_sel = 0; in lm3532_parse_als()
514 als->als1_imp_sel = lm3532_get_als_imp_index(als_impedance); in lm3532_parse_als()
519 als->als2_imp_sel = 0; in lm3532_parse_als()
521 als->als2_imp_sel = lm3532_get_als_imp_index(als_impedance); in lm3532_parse_als()
523 ret = device_property_read_u32(&priv->client->dev, "ti,als-avrg-time-us", in lm3532_parse_als()
526 als->als_avrg_time = 0; in lm3532_parse_als()
528 als->als_avrg_time = lm3532_get_als_avg_index(als_avg_time); in lm3532_parse_als()
530 ret = device_property_read_u8(&priv->client->dev, "ti,als-input-mode", in lm3532_parse_als()
531 &als->als_input_mode); in lm3532_parse_als()
533 als->als_input_mode = 0; in lm3532_parse_als()
535 if (als->als_input_mode > LM3532_BL_MODE_ALS) { in lm3532_parse_als()
540 priv->als_data = als; in lm3532_parse_als()
632 dev_err(&priv->client->dev, "Failed to parse als\n"); in lm3532_parse_node()