Lines Matching refs:max98390
166 struct max98390_priv *max98390 = in max98390_dai_set_fmt() local
179 max98390->provider = true; in max98390_dai_set_fmt()
187 regmap_update_bits(max98390->regmap, in max98390_dai_set_fmt()
203 regmap_update_bits(max98390->regmap, in max98390_dai_set_fmt()
226 regmap_update_bits(max98390->regmap, in max98390_dai_set_fmt()
252 struct max98390_priv *max98390 = in max98390_set_clock() local
265 if (max98390->provider) { in max98390_set_clock()
269 if (rate_table[i] >= max98390->sysclk) in max98390_set_clock()
277 regmap_update_bits(max98390->regmap, in max98390_set_clock()
283 if (!max98390->tdm_mode) { in max98390_set_clock()
292 regmap_update_bits(max98390->regmap, in max98390_set_clock()
306 struct max98390_priv *max98390 = in max98390_dai_hw_params() local
329 regmap_update_bits(max98390->regmap, in max98390_dai_hw_params()
372 regmap_update_bits(max98390->regmap, in max98390_dai_hw_params()
387 struct max98390_priv *max98390 = in max98390_dai_tdm_slot() local
394 max98390->tdm_mode = false; in max98390_dai_tdm_slot()
396 max98390->tdm_mode = true; in max98390_dai_tdm_slot()
399 "Tdm mode : %d\n", max98390->tdm_mode); in max98390_dai_tdm_slot()
409 regmap_update_bits(max98390->regmap, in max98390_dai_tdm_slot()
431 regmap_update_bits(max98390->regmap, in max98390_dai_tdm_slot()
436 regmap_write(max98390->regmap, in max98390_dai_tdm_slot()
439 regmap_write(max98390->regmap, in max98390_dai_tdm_slot()
444 regmap_write(max98390->regmap, in max98390_dai_tdm_slot()
447 regmap_write(max98390->regmap, in max98390_dai_tdm_slot()
458 struct max98390_priv *max98390 = in max98390_dai_set_sysclk() local
461 max98390->sysclk = freq; in max98390_dai_set_sysclk()
477 struct max98390_priv *max98390 = in max98390_dac_event() local
482 regmap_update_bits(max98390->regmap, in max98390_dac_event()
485 regmap_update_bits(max98390->regmap, in max98390_dac_event()
490 regmap_update_bits(max98390->regmap, in max98390_dac_event()
493 regmap_update_bits(max98390->regmap, in max98390_dac_event()
539 struct max98390_priv *max98390 = in max98390_ref_rdc_put() local
542 max98390->ref_rdc_value = ucontrol->value.integer.value[0]; in max98390_ref_rdc_put()
544 regmap_write(max98390->regmap, DSM_TPROT_RECIP_RDC_ROOM_BYTE0, in max98390_ref_rdc_put()
545 max98390->ref_rdc_value & 0x000000ff); in max98390_ref_rdc_put()
546 regmap_write(max98390->regmap, DSM_TPROT_RECIP_RDC_ROOM_BYTE1, in max98390_ref_rdc_put()
547 (max98390->ref_rdc_value >> 8) & 0x000000ff); in max98390_ref_rdc_put()
548 regmap_write(max98390->regmap, DSM_TPROT_RECIP_RDC_ROOM_BYTE2, in max98390_ref_rdc_put()
549 (max98390->ref_rdc_value >> 16) & 0x000000ff); in max98390_ref_rdc_put()
559 struct max98390_priv *max98390 = in max98390_ref_rdc_get() local
562 ucontrol->value.integer.value[0] = max98390->ref_rdc_value; in max98390_ref_rdc_get()
572 struct max98390_priv *max98390 = in max98390_ambient_temp_put() local
575 max98390->ambient_temp_value = ucontrol->value.integer.value[0]; in max98390_ambient_temp_put()
577 regmap_write(max98390->regmap, DSM_TPROT_ROOM_TEMPERATURE_BYTE1, in max98390_ambient_temp_put()
578 (max98390->ambient_temp_value >> 8) & 0x000000ff); in max98390_ambient_temp_put()
579 regmap_write(max98390->regmap, DSM_TPROT_ROOM_TEMPERATURE_BYTE0, in max98390_ambient_temp_put()
580 (max98390->ambient_temp_value) & 0x000000ff); in max98390_ambient_temp_put()
590 struct max98390_priv *max98390 = in max98390_ambient_temp_get() local
593 ucontrol->value.integer.value[0] = max98390->ambient_temp_value; in max98390_ambient_temp_get()
615 struct max98390_priv *max98390 = in max98390_adaptive_rdc_get() local
618 regmap_read(max98390->regmap, THERMAL_RDC_RD_BACK_BYTE1, &rdc); in max98390_adaptive_rdc_get()
619 regmap_read(max98390->regmap, THERMAL_RDC_RD_BACK_BYTE0, &rdc0); in max98390_adaptive_rdc_get()
636 struct max98390_priv *max98390 = snd_soc_component_get_drvdata(component); in max98390_dsm_calib_put() local
642 regmap_read(max98390->regmap, MAX98390_R23FF_GLOBAL_EN, &val); in max98390_dsm_calib_put()
645 regmap_update_bits(max98390->regmap, MAX98390_R203A_AMP_EN, in max98390_dsm_calib_put()
647 regmap_update_bits(max98390->regmap, MAX98390_R23FF_GLOBAL_EN, in max98390_dsm_calib_put()
651 regmap_read(max98390->regmap, THERMAL_RDC_RD_BACK_BYTE1, &rdc); in max98390_dsm_calib_put()
652 regmap_read(max98390->regmap, THERMAL_RDC_RD_BACK_BYTE0, &rdc_cal_result); in max98390_dsm_calib_put()
653 regmap_read(max98390->regmap, MAX98390_MEAS_ADC_CH2_READ, &temp); in max98390_dsm_calib_put()
657 regmap_update_bits(max98390->regmap, MAX98390_R23FF_GLOBAL_EN, in max98390_dsm_calib_put()
659 regmap_update_bits(max98390->regmap, MAX98390_R203A_AMP_EN, in max98390_dsm_calib_put()
667 max98390->ref_rdc_value = 268435456U / rdc_cal_result; in max98390_dsm_calib_put()
669 max98390->ambient_temp_value = temp * 52 - 1188; in max98390_dsm_calib_put()
795 struct max98390_priv *max98390 = in max98390_dsm_init() local
803 if (!strcmp(max98390->dsm_param_name, "default")) { in max98390_dsm_init()
812 max98390->dsm_param_name); in max98390_dsm_init()
845 regmap_write(max98390->regmap, MAX98390_R203A_AMP_EN, 0x80); in max98390_dsm_init()
847 regmap_bulk_write(max98390->regmap, param_start_addr, in max98390_dsm_init()
849 regmap_write(max98390->regmap, MAX98390_R23E1_DSP_GLOBAL_EN, 0x01); in max98390_dsm_init()
859 struct max98390_priv *max98390 = in max98390_init_regs() local
862 regmap_write(max98390->regmap, MAX98390_CLK_MON, 0x6f); in max98390_init_regs()
863 regmap_write(max98390->regmap, MAX98390_DAT_MON, 0x00); in max98390_init_regs()
864 regmap_write(max98390->regmap, MAX98390_PWR_GATE_CTL, 0x00); in max98390_init_regs()
865 regmap_write(max98390->regmap, MAX98390_PCM_RX_EN_A, 0x03); in max98390_init_regs()
866 regmap_write(max98390->regmap, MAX98390_ENV_TRACK_VOUT_HEADROOM, 0x0e); in max98390_init_regs()
867 regmap_write(max98390->regmap, MAX98390_BOOST_BYPASS1, 0x46); in max98390_init_regs()
868 regmap_write(max98390->regmap, MAX98390_FET_SCALING3, 0x03); in max98390_init_regs()
871 regmap_write(max98390->regmap, in max98390_init_regs()
873 (max98390->i_l_slot << 4 | in max98390_init_regs()
874 max98390->v_l_slot)&0xFF); in max98390_init_regs()
876 if (max98390->v_l_slot < 8) { in max98390_init_regs()
877 regmap_update_bits(max98390->regmap, in max98390_init_regs()
879 1 << max98390->v_l_slot, 0); in max98390_init_regs()
880 regmap_update_bits(max98390->regmap, in max98390_init_regs()
882 1 << max98390->v_l_slot, in max98390_init_regs()
883 1 << max98390->v_l_slot); in max98390_init_regs()
885 regmap_update_bits(max98390->regmap, in max98390_init_regs()
887 1 << (max98390->v_l_slot - 8), 0); in max98390_init_regs()
888 regmap_update_bits(max98390->regmap, in max98390_init_regs()
890 1 << (max98390->v_l_slot - 8), in max98390_init_regs()
891 1 << (max98390->v_l_slot - 8)); in max98390_init_regs()
894 if (max98390->i_l_slot < 8) { in max98390_init_regs()
895 regmap_update_bits(max98390->regmap, in max98390_init_regs()
897 1 << max98390->i_l_slot, 0); in max98390_init_regs()
898 regmap_update_bits(max98390->regmap, in max98390_init_regs()
900 1 << max98390->i_l_slot, in max98390_init_regs()
901 1 << max98390->i_l_slot); in max98390_init_regs()
903 regmap_update_bits(max98390->regmap, in max98390_init_regs()
905 1 << (max98390->i_l_slot - 8), 0); in max98390_init_regs()
906 regmap_update_bits(max98390->regmap, in max98390_init_regs()
908 1 << (max98390->i_l_slot - 8), in max98390_init_regs()
909 1 << (max98390->i_l_slot - 8)); in max98390_init_regs()
915 struct max98390_priv *max98390 = in max98390_probe() local
918 regmap_write(max98390->regmap, MAX98390_SOFTWARE_RESET, 0x01); in max98390_probe()
928 if (max98390->ref_rdc_value) { in max98390_probe()
929 regmap_write(max98390->regmap, DSM_TPROT_RECIP_RDC_ROOM_BYTE0, in max98390_probe()
930 max98390->ref_rdc_value & 0x000000ff); in max98390_probe()
931 regmap_write(max98390->regmap, DSM_TPROT_RECIP_RDC_ROOM_BYTE1, in max98390_probe()
932 (max98390->ref_rdc_value >> 8) & 0x000000ff); in max98390_probe()
933 regmap_write(max98390->regmap, DSM_TPROT_RECIP_RDC_ROOM_BYTE2, in max98390_probe()
934 (max98390->ref_rdc_value >> 16) & 0x000000ff); in max98390_probe()
936 if (max98390->ambient_temp_value) { in max98390_probe()
937 regmap_write(max98390->regmap, DSM_TPROT_ROOM_TEMPERATURE_BYTE1, in max98390_probe()
938 (max98390->ambient_temp_value >> 8) & 0x000000ff); in max98390_probe()
939 regmap_write(max98390->regmap, DSM_TPROT_ROOM_TEMPERATURE_BYTE0, in max98390_probe()
940 (max98390->ambient_temp_value) & 0x000000ff); in max98390_probe()
949 struct max98390_priv *max98390 = dev_get_drvdata(dev); in max98390_suspend() local
953 regcache_cache_only(max98390->regmap, true); in max98390_suspend()
954 regcache_mark_dirty(max98390->regmap); in max98390_suspend()
961 struct max98390_priv *max98390 = dev_get_drvdata(dev); in max98390_resume() local
965 regcache_cache_only(max98390->regmap, false); in max98390_resume()
966 regcache_sync(max98390->regmap); in max98390_resume()
1001 struct max98390_priv *max98390) in max98390_slot_config() argument
1007 max98390->v_l_slot = value & 0xF; in max98390_slot_config()
1009 max98390->v_l_slot = 0; in max98390_slot_config()
1012 max98390->i_l_slot = value & 0xF; in max98390_slot_config()
1014 max98390->i_l_slot = 1; in max98390_slot_config()
1022 struct max98390_priv *max98390 = NULL; in max98390_i2c_probe() local
1034 max98390 = devm_kzalloc(&i2c->dev, sizeof(*max98390), GFP_KERNEL); in max98390_i2c_probe()
1035 if (!max98390) { in max98390_i2c_probe()
1039 i2c_set_clientdata(i2c, max98390); in max98390_i2c_probe()
1042 &max98390->ambient_temp_value); in max98390_i2c_probe()
1048 &max98390->ref_rdc_value); in max98390_i2c_probe()
1056 __func__, max98390->ref_rdc_value, in max98390_i2c_probe()
1057 max98390->ambient_temp_value); in max98390_i2c_probe()
1060 &max98390->dsm_param_name); in max98390_i2c_probe()
1062 max98390->dsm_param_name = "default"; in max98390_i2c_probe()
1065 max98390_slot_config(i2c, max98390); in max98390_i2c_probe()
1068 max98390->regmap = devm_regmap_init_i2c(i2c, &max98390_regmap); in max98390_i2c_probe()
1069 if (IS_ERR(max98390->regmap)) { in max98390_i2c_probe()
1070 ret = PTR_ERR(max98390->regmap); in max98390_i2c_probe()
1088 ret = regmap_read(max98390->regmap, in max98390_i2c_probe()