Lines Matching refs:tas6424

76 	struct tas6424_data *tas6424 = snd_soc_component_get_drvdata(component);  in tas6424_dac_event()  local
85 tas6424->last_fault1 = 0; in tas6424_dac_event()
86 tas6424->last_fault2 = 0; in tas6424_dac_event()
87 tas6424->last_warn = 0; in tas6424_dac_event()
88 schedule_delayed_work(&tas6424->fault_check_work, in tas6424_dac_event()
92 cancel_delayed_work_sync(&tas6424->fault_check_work); in tas6424_dac_event()
258 struct tas6424_data *tas6424 = snd_soc_component_get_drvdata(component); in tas6424_mute() local
263 if (tas6424->mute_gpio) { in tas6424_mute()
264 gpiod_set_value_cansleep(tas6424->mute_gpio, mute); in tas6424_mute()
280 struct tas6424_data *tas6424 = snd_soc_component_get_drvdata(component); in tas6424_power_off() local
285 regcache_cache_only(tas6424->regmap, true); in tas6424_power_off()
286 regcache_mark_dirty(tas6424->regmap); in tas6424_power_off()
288 ret = regulator_bulk_disable(ARRAY_SIZE(tas6424->supplies), in tas6424_power_off()
289 tas6424->supplies); in tas6424_power_off()
300 struct tas6424_data *tas6424 = snd_soc_component_get_drvdata(component); in tas6424_power_on() local
306 if (!regmap_read(tas6424->regmap, TAS6424_DC_DIAG_CTRL1, &reg_val)) in tas6424_power_on()
309 ret = regulator_bulk_enable(ARRAY_SIZE(tas6424->supplies), in tas6424_power_on()
310 tas6424->supplies); in tas6424_power_on()
316 regcache_cache_only(tas6424->regmap, false); in tas6424_power_on()
318 ret = regcache_sync(tas6424->regmap); in tas6424_power_on()
324 if (tas6424->mute_gpio) { in tas6424_power_on()
325 gpiod_set_value_cansleep(tas6424->mute_gpio, 0); in tas6424_power_on()
405 struct tas6424_data *tas6424 = container_of(work, struct tas6424_data, in tas6424_fault_check_work() local
407 struct device *dev = tas6424->dev; in tas6424_fault_check_work()
411 ret = regmap_read(tas6424->regmap, TAS6424_CHANNEL_FAULT, &reg); in tas6424_fault_check_work()
418 tas6424->last_cfault = reg; in tas6424_fault_check_work()
428 if ((reg & TAS6424_FAULT_OC_CH1) && !(tas6424->last_cfault & TAS6424_FAULT_OC_CH1)) in tas6424_fault_check_work()
431 if ((reg & TAS6424_FAULT_OC_CH2) && !(tas6424->last_cfault & TAS6424_FAULT_OC_CH2)) in tas6424_fault_check_work()
434 if ((reg & TAS6424_FAULT_OC_CH3) && !(tas6424->last_cfault & TAS6424_FAULT_OC_CH3)) in tas6424_fault_check_work()
437 if ((reg & TAS6424_FAULT_OC_CH4) && !(tas6424->last_cfault & TAS6424_FAULT_OC_CH4)) in tas6424_fault_check_work()
440 if ((reg & TAS6424_FAULT_DC_CH1) && !(tas6424->last_cfault & TAS6424_FAULT_DC_CH1)) in tas6424_fault_check_work()
443 if ((reg & TAS6424_FAULT_DC_CH2) && !(tas6424->last_cfault & TAS6424_FAULT_DC_CH2)) in tas6424_fault_check_work()
446 if ((reg & TAS6424_FAULT_DC_CH3) && !(tas6424->last_cfault & TAS6424_FAULT_DC_CH3)) in tas6424_fault_check_work()
449 if ((reg & TAS6424_FAULT_DC_CH4) && !(tas6424->last_cfault & TAS6424_FAULT_DC_CH4)) in tas6424_fault_check_work()
453 tas6424->last_cfault = reg; in tas6424_fault_check_work()
456 ret = regmap_read(tas6424->regmap, TAS6424_GLOB_FAULT1, &reg); in tas6424_fault_check_work()
475 tas6424->last_fault1 = reg; in tas6424_fault_check_work()
479 if ((reg & TAS6424_FAULT_PVDD_OV) && !(tas6424->last_fault1 & TAS6424_FAULT_PVDD_OV)) in tas6424_fault_check_work()
482 if ((reg & TAS6424_FAULT_VBAT_OV) && !(tas6424->last_fault1 & TAS6424_FAULT_VBAT_OV)) in tas6424_fault_check_work()
485 if ((reg & TAS6424_FAULT_PVDD_UV) && !(tas6424->last_fault1 & TAS6424_FAULT_PVDD_UV)) in tas6424_fault_check_work()
488 if ((reg & TAS6424_FAULT_VBAT_UV) && !(tas6424->last_fault1 & TAS6424_FAULT_VBAT_UV)) in tas6424_fault_check_work()
492 tas6424->last_fault1 = reg; in tas6424_fault_check_work()
495 ret = regmap_read(tas6424->regmap, TAS6424_GLOB_FAULT2, &reg); in tas6424_fault_check_work()
508 tas6424->last_fault2 = reg; in tas6424_fault_check_work()
512 if ((reg & TAS6424_FAULT_OTSD) && !(tas6424->last_fault2 & TAS6424_FAULT_OTSD)) in tas6424_fault_check_work()
515 if ((reg & TAS6424_FAULT_OTSD_CH1) && !(tas6424->last_fault2 & TAS6424_FAULT_OTSD_CH1)) in tas6424_fault_check_work()
518 if ((reg & TAS6424_FAULT_OTSD_CH2) && !(tas6424->last_fault2 & TAS6424_FAULT_OTSD_CH2)) in tas6424_fault_check_work()
521 if ((reg & TAS6424_FAULT_OTSD_CH3) && !(tas6424->last_fault2 & TAS6424_FAULT_OTSD_CH3)) in tas6424_fault_check_work()
524 if ((reg & TAS6424_FAULT_OTSD_CH4) && !(tas6424->last_fault2 & TAS6424_FAULT_OTSD_CH4)) in tas6424_fault_check_work()
528 tas6424->last_fault2 = reg; in tas6424_fault_check_work()
531 ret = regmap_read(tas6424->regmap, TAS6424_WARN, &reg); in tas6424_fault_check_work()
546 tas6424->last_warn = reg; in tas6424_fault_check_work()
550 if ((reg & TAS6424_WARN_VDD_UV) && !(tas6424->last_warn & TAS6424_WARN_VDD_UV)) in tas6424_fault_check_work()
553 if ((reg & TAS6424_WARN_VDD_POR) && !(tas6424->last_warn & TAS6424_WARN_VDD_POR)) in tas6424_fault_check_work()
556 if ((reg & TAS6424_WARN_VDD_OTW) && !(tas6424->last_warn & TAS6424_WARN_VDD_OTW)) in tas6424_fault_check_work()
559 if ((reg & TAS6424_WARN_VDD_OTW_CH1) && !(tas6424->last_warn & TAS6424_WARN_VDD_OTW_CH1)) in tas6424_fault_check_work()
562 if ((reg & TAS6424_WARN_VDD_OTW_CH2) && !(tas6424->last_warn & TAS6424_WARN_VDD_OTW_CH2)) in tas6424_fault_check_work()
565 if ((reg & TAS6424_WARN_VDD_OTW_CH3) && !(tas6424->last_warn & TAS6424_WARN_VDD_OTW_CH3)) in tas6424_fault_check_work()
568 if ((reg & TAS6424_WARN_VDD_OTW_CH4) && !(tas6424->last_warn & TAS6424_WARN_VDD_OTW_CH4)) in tas6424_fault_check_work()
572 tas6424->last_warn = reg; in tas6424_fault_check_work()
575 ret = regmap_write_bits(tas6424->regmap, TAS6424_MISC_CTRL3, in tas6424_fault_check_work()
580 ret = regmap_write_bits(tas6424->regmap, TAS6424_MISC_CTRL3, in tas6424_fault_check_work()
587 schedule_delayed_work(&tas6424->fault_check_work, in tas6424_fault_check_work()
689 struct tas6424_data *tas6424; in tas6424_i2c_probe() local
693 tas6424 = devm_kzalloc(dev, sizeof(*tas6424), GFP_KERNEL); in tas6424_i2c_probe()
694 if (!tas6424) in tas6424_i2c_probe()
696 dev_set_drvdata(dev, tas6424); in tas6424_i2c_probe()
698 tas6424->dev = dev; in tas6424_i2c_probe()
700 tas6424->regmap = devm_regmap_init_i2c(client, &tas6424_regmap_config); in tas6424_i2c_probe()
701 if (IS_ERR(tas6424->regmap)) { in tas6424_i2c_probe()
702 ret = PTR_ERR(tas6424->regmap); in tas6424_i2c_probe()
713 tas6424->standby_gpio = devm_gpiod_get_optional(dev, "standby", in tas6424_i2c_probe()
715 if (IS_ERR(tas6424->standby_gpio)) { in tas6424_i2c_probe()
716 if (PTR_ERR(tas6424->standby_gpio) == -EPROBE_DEFER) in tas6424_i2c_probe()
719 PTR_ERR(tas6424->standby_gpio)); in tas6424_i2c_probe()
720 tas6424->standby_gpio = NULL; in tas6424_i2c_probe()
729 tas6424->mute_gpio = devm_gpiod_get_optional(dev, "mute", in tas6424_i2c_probe()
731 if (IS_ERR(tas6424->mute_gpio)) { in tas6424_i2c_probe()
732 if (PTR_ERR(tas6424->mute_gpio) == -EPROBE_DEFER) in tas6424_i2c_probe()
735 PTR_ERR(tas6424->mute_gpio)); in tas6424_i2c_probe()
736 tas6424->mute_gpio = NULL; in tas6424_i2c_probe()
739 for (i = 0; i < ARRAY_SIZE(tas6424->supplies); i++) in tas6424_i2c_probe()
740 tas6424->supplies[i].supply = tas6424_supply_names[i]; in tas6424_i2c_probe()
741 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(tas6424->supplies), in tas6424_i2c_probe()
742 tas6424->supplies); in tas6424_i2c_probe()
748 ret = regulator_bulk_enable(ARRAY_SIZE(tas6424->supplies), in tas6424_i2c_probe()
749 tas6424->supplies); in tas6424_i2c_probe()
756 ret = regmap_update_bits(tas6424->regmap, TAS6424_MODE_CTRL, in tas6424_i2c_probe()
763 INIT_DELAYED_WORK(&tas6424->fault_check_work, tas6424_fault_check_work); in tas6424_i2c_probe()
778 struct tas6424_data *tas6424 = dev_get_drvdata(dev); in tas6424_i2c_remove() local
781 cancel_delayed_work_sync(&tas6424->fault_check_work); in tas6424_i2c_remove()
784 if (tas6424->standby_gpio) in tas6424_i2c_remove()
785 gpiod_set_value_cansleep(tas6424->standby_gpio, 1); in tas6424_i2c_remove()
787 ret = regulator_bulk_disable(ARRAY_SIZE(tas6424->supplies), in tas6424_i2c_remove()
788 tas6424->supplies); in tas6424_i2c_remove()