Lines Matching full:regmap
17 #include <linux/regmap.h>
39 static bool nau8821_is_jack_inserted(struct regmap *regmap);
279 if (!component->regmap) in nau8821_biq_coeff_get()
282 regmap_raw_read(component->regmap, NAU8821_R21_BIQ0_COF1, in nau8821_biq_coeff_get()
295 if (!component->regmap) in nau8821_biq_coeff_put()
303 regmap_raw_write(component->regmap, NAU8821_R21_BIQ0_COF1, in nau8821_biq_coeff_put()
375 regmap_read(nau8821->regmap, NAU8821_R03_CLK_DIVIDER, in dmic_clock_control()
394 regmap_update_bits(nau8821->regmap, NAU8821_R13_DMIC_CTRL, in dmic_clock_control()
411 regmap_update_bits(nau8821->regmap, NAU8821_R01_ENA_CTRL, in nau8821_left_adc_event()
415 regmap_update_bits(nau8821->regmap, in nau8821_left_adc_event()
435 regmap_update_bits(nau8821->regmap, NAU8821_R01_ENA_CTRL, in nau8821_right_adc_event()
439 regmap_update_bits(nau8821->regmap, in nau8821_right_adc_event()
461 regmap_update_bits(nau8821->regmap, NAU8821_R80_CHARGE_PUMP, in nau8821_pump_event()
465 regmap_update_bits(nau8821->regmap, NAU8821_R80_CHARGE_PUMP, in nau8821_pump_event()
485 regmap_update_bits(nau8821->regmap, NAU8821_R66_BIAS_ADJ, in nau8821_output_dac_event()
489 regmap_update_bits(nau8821->regmap, NAU8821_R66_BIAS_ADJ, in nau8821_output_dac_event()
513 if (nau8821_is_jack_inserted(nau8821->regmap)) { in system_clock_control()
679 regmap_read(nau8821->regmap, NAU8821_R2C_DAC_CTRL1, &osr); in nau8821_get_osr()
685 regmap_read(nau8821->regmap, NAU8821_R2B_ADC_RATE, &osr); in nau8821_get_osr()
730 regmap_update_bits(nau8821->regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_hw_params()
734 regmap_update_bits(nau8821->regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_hw_params()
739 regmap_read(nau8821->regmap, NAU8821_R1D_I2S_PCM_CTRL2, &ctrl_val); in nau8821_hw_params()
752 regmap_update_bits(nau8821->regmap, NAU8821_R1D_I2S_PCM_CTRL2, in nau8821_hw_params()
774 regmap_update_bits(nau8821->regmap, NAU8821_R1C_I2S_PCM_CTRL1, in nau8821_hw_params()
827 regmap_update_bits(nau8821->regmap, NAU8821_R1C_I2S_PCM_CTRL1, in nau8821_set_dai_fmt()
830 regmap_update_bits(nau8821->regmap, NAU8821_R1D_I2S_PCM_CTRL2, in nau8821_set_dai_fmt()
846 return regmap_update_bits(nau8821->regmap, in nau8821_digital_mute()
882 static bool nau8821_is_jack_inserted(struct regmap *regmap) in nau8821_is_jack_inserted() argument
887 regmap_read(regmap, NAU8821_R0D_JACK_DET_CTRL, &jkdet); in nau8821_is_jack_inserted()
889 regmap_read(regmap, NAU8821_R82_GENERAL_STATUS, &status); in nau8821_is_jack_inserted()
897 static void nau8821_int_status_clear_all(struct regmap *regmap) in nau8821_int_status_clear_all() argument
904 regmap_read(regmap, NAU8821_R10_IRQ_STATUS, &active_irq); in nau8821_int_status_clear_all()
908 regmap_write(regmap, in nau8821_int_status_clear_all()
916 struct regmap *regmap = nau8821->regmap; in nau8821_eject_jack() local
920 regmap_update_bits(regmap, NAU8821_R74_MIC_BIAS, in nau8821_eject_jack()
923 regmap_update_bits(regmap, NAU8821_R0D_JACK_DET_CTRL, in nau8821_eject_jack()
929 nau8821_int_status_clear_all(regmap); in nau8821_eject_jack()
934 regmap_update_bits(regmap, NAU8821_R12_INTERRUPT_DIS_CTRL, in nau8821_eject_jack()
938 regmap_update_bits(regmap, NAU8821_R0F_INTERRUPT_MASK, in nau8821_eject_jack()
942 regmap_update_bits(regmap, NAU8821_R0D_JACK_DET_CTRL, in nau8821_eject_jack()
950 regmap_update_bits(regmap, NAU8821_R2B_ADC_RATE, in nau8821_eject_jack()
953 regmap_update_bits(regmap, NAU8821_R0F_INTERRUPT_MASK, in nau8821_eject_jack()
958 regmap_update_bits(regmap, in nau8821_eject_jack()
974 struct regmap *regmap = nau8821->regmap; in nau8821_jdet_work() local
981 regmap_read(regmap, NAU8821_R58_I2C_DEVICE_ID, &jack_status_reg); in nau8821_jdet_work()
988 regmap_update_bits(regmap, NAU8821_R74_MIC_BIAS, in nau8821_jdet_work()
993 regmap_update_bits(regmap, NAU8821_R2B_ADC_RATE, in nau8821_jdet_work()
996 regmap_update_bits(regmap, NAU8821_R0F_INTERRUPT_MASK, in nau8821_jdet_work()
999 regmap_update_bits(regmap, in nau8821_jdet_work()
1017 struct regmap *regmap = nau8821->regmap; in nau8821_setup_inserted_irq() local
1028 regmap_update_bits(regmap, NAU8821_R1D_I2S_PCM_CTRL2, in nau8821_setup_inserted_irq()
1030 regmap_update_bits(regmap, NAU8821_R1D_I2S_PCM_CTRL2, in nau8821_setup_inserted_irq()
1034 regmap_update_bits(regmap, NAU8821_R0D_JACK_DET_CTRL, in nau8821_setup_inserted_irq()
1037 regmap_update_bits(regmap, NAU8821_R0F_INTERRUPT_MASK, in nau8821_setup_inserted_irq()
1039 regmap_update_bits(regmap, NAU8821_R12_INTERRUPT_DIS_CTRL, in nau8821_setup_inserted_irq()
1046 struct regmap *regmap = nau8821->regmap; in nau8821_interrupt() local
1049 if (regmap_read(regmap, NAU8821_R10_IRQ_STATUS, &active_irq)) { in nau8821_interrupt()
1058 regmap_update_bits(regmap, NAU8821_R71_ANALOG_ADC_1, in nau8821_interrupt()
1072 regmap_update_bits(regmap, NAU8821_R71_ANALOG_ADC_1, in nau8821_interrupt()
1074 if (nau8821_is_jack_inserted(regmap)) { in nau8821_interrupt()
1079 regmap_update_bits(regmap, in nau8821_interrupt()
1083 regmap_update_bits(regmap, in nau8821_interrupt()
1098 regmap_write(regmap, NAU8821_R11_INT_CLR_KEY_STATUS, clear_irq); in nau8821_interrupt()
1201 struct regmap *regmap = nau8821->regmap; in nau8821_fll_apply() local
1203 regmap_update_bits(regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_fll_apply()
1207 regmap_update_bits(regmap, NAU8821_R04_FLL1, in nau8821_fll_apply()
1211 regmap_write(regmap, NAU8821_R0A_FLL7, in nau8821_fll_apply()
1213 regmap_write(regmap, NAU8821_R0B_FLL8, fll_param->fll_frac & 0xffff); in nau8821_fll_apply()
1215 regmap_update_bits(regmap, NAU8821_R06_FLL3, in nau8821_fll_apply()
1218 regmap_update_bits(regmap, NAU8821_R07_FLL4, in nau8821_fll_apply()
1223 regmap_update_bits(regmap, NAU8821_R08_FLL5, in nau8821_fll_apply()
1226 regmap_update_bits(regmap, in nau8821_fll_apply()
1230 regmap_update_bits(regmap, NAU8821_R08_FLL5, in nau8821_fll_apply()
1235 regmap_update_bits(regmap, NAU8821_R09_FLL6, in nau8821_fll_apply()
1240 regmap_update_bits(regmap, NAU8821_R08_FLL5, in nau8821_fll_apply()
1243 regmap_update_bits(regmap, NAU8821_R09_FLL6, in nau8821_fll_apply()
1283 regmap_update_bits(nau8821->regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_set_fll()
1289 static void nau8821_configure_mclk_as_sysclk(struct regmap *regmap) in nau8821_configure_mclk_as_sysclk() argument
1291 regmap_update_bits(regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_configure_mclk_as_sysclk()
1293 regmap_update_bits(regmap, NAU8821_R09_FLL6, in nau8821_configure_mclk_as_sysclk()
1296 regmap_update_bits(regmap, NAU8821_R04_FLL1, in nau8821_configure_mclk_as_sysclk()
1303 struct regmap *regmap = nau8821->regmap; in nau8821_configure_sysclk() local
1308 nau8821_configure_mclk_as_sysclk(regmap); in nau8821_configure_sysclk()
1311 nau8821_configure_mclk_as_sysclk(regmap); in nau8821_configure_sysclk()
1313 regmap_update_bits(regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_configure_sysclk()
1317 if (nau8821_is_jack_inserted(regmap)) { in nau8821_configure_sysclk()
1318 regmap_update_bits(regmap, NAU8821_R09_FLL6, in nau8821_configure_sysclk()
1320 regmap_update_bits(regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_configure_sysclk()
1325 regmap_update_bits(regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_configure_sysclk()
1327 regmap_update_bits(regmap, NAU8821_R04_FLL1, in nau8821_configure_sysclk()
1330 regmap_update_bits(regmap, NAU8821_R09_FLL6, in nau8821_configure_sysclk()
1339 regmap_update_bits(regmap, NAU8821_R06_FLL3, in nau8821_configure_sysclk()
1350 regmap_update_bits(regmap, NAU8821_R06_FLL3, in nau8821_configure_sysclk()
1362 regmap_update_bits(regmap, NAU8821_R06_FLL3, in nau8821_configure_sysclk()
1388 struct regmap *regmap = nau8821->regmap; in nau8821_resume_setup() local
1394 nau8821_int_status_clear_all(regmap); in nau8821_resume_setup()
1399 regmap_update_bits(regmap, NAU8821_R0F_INTERRUPT_MASK, in nau8821_resume_setup()
1401 regmap_update_bits(regmap, NAU8821_R0D_JACK_DET_CTRL, in nau8821_resume_setup()
1404 regmap_update_bits(regmap, NAU8821_R12_INTERRUPT_DIS_CTRL, in nau8821_resume_setup()
1415 struct regmap *regmap = nau8821->regmap; in nau8821_set_bias_level() local
1433 regmap_update_bits(regmap, NAU8821_R0D_JACK_DET_CTRL, in nau8821_set_bias_level()
1439 regmap_update_bits(regmap, NAU8821_R74_MIC_BIAS, in nau8821_set_bias_level()
1445 regmap_write(regmap, in nau8821_set_bias_level()
1447 regmap_update_bits(regmap, NAU8821_R0F_INTERRUPT_MASK, in nau8821_set_bias_level()
1469 regcache_cache_only(nau8821->regmap, true); in nau8821_suspend()
1470 regcache_mark_dirty(nau8821->regmap); in nau8821_suspend()
1479 regcache_cache_only(nau8821->regmap, false); in nau8821_resume()
1480 regcache_sync(nau8821->regmap); in nau8821_resume()
1538 static void nau8821_reset_chip(struct regmap *regmap) in nau8821_reset_chip() argument
1540 regmap_write(regmap, NAU8821_R00_RESET, 0xffff); in nau8821_reset_chip()
1541 regmap_write(regmap, NAU8821_R00_RESET, 0xffff); in nau8821_reset_chip()
1606 struct regmap *regmap = nau8821->regmap; in nau8821_init_regs() local
1609 regmap_update_bits(regmap, NAU8821_R66_BIAS_ADJ, in nau8821_init_regs()
1611 regmap_update_bits(regmap, NAU8821_R76_BOOST, in nau8821_init_regs()
1618 regmap_update_bits(regmap, NAU8821_R66_BIAS_ADJ, in nau8821_init_regs()
1623 regmap_update_bits(regmap, NAU8821_R1E_LEFT_TIME_SLOT, in nau8821_init_regs()
1626 regmap_update_bits(regmap, NAU8821_R76_BOOST, in nau8821_init_regs()
1632 regmap_update_bits(regmap, NAU8821_R4B_CLASSG_CTRL, in nau8821_init_regs()
1636 regmap_update_bits(regmap, NAU8821_R6A_ANALOG_CONTROL_2, in nau8821_init_regs()
1642 regmap_update_bits(regmap, NAU8821_R80_CHARGE_PUMP, in nau8821_init_regs()
1645 regmap_update_bits(regmap, NAU8821_R73_RDAC, in nau8821_init_regs()
1650 regmap_update_bits(regmap, NAU8821_R74_MIC_BIAS, in nau8821_init_regs()
1655 regmap_update_bits(regmap, NAU8821_R2B_ADC_RATE, in nau8821_init_regs()
1657 regmap_update_bits(regmap, NAU8821_R2C_DAC_CTRL1, in nau8821_init_regs()
1663 struct regmap *regmap = nau8821->regmap; in nau8821_setup_irq() local
1666 regmap_update_bits(regmap, NAU8821_R1A_GPIO12_CTRL, in nau8821_setup_irq()
1669 regmap_update_bits(regmap, NAU8821_R1A_GPIO12_CTRL, in nau8821_setup_irq()
1672 regmap_update_bits(regmap, NAU8821_R1A_GPIO12_CTRL, in nau8821_setup_irq()
1675 regmap_update_bits(regmap, NAU8821_R0D_JACK_DET_CTRL, in nau8821_setup_irq()
1679 regmap_update_bits(regmap, NAU8821_R0D_JACK_DET_CTRL, in nau8821_setup_irq()
1683 regmap_update_bits(regmap, NAU8821_R0D_JACK_DET_CTRL, in nau8821_setup_irq()
1688 regmap_update_bits(regmap, NAU8821_R0F_INTERRUPT_MASK, in nau8821_setup_irq()
1694 regmap_update_bits(regmap, NAU8821_R0F_INTERRUPT_MASK, 0x3f5, 0x3f5); in nau8821_setup_irq()
1713 nau8821->regmap = devm_regmap_init_i2c(i2c, &nau8821_regmap_config); in nau8821_i2c_probe()
1714 if (IS_ERR(nau8821->regmap)) in nau8821_i2c_probe()
1715 return PTR_ERR(nau8821->regmap); in nau8821_i2c_probe()
1721 nau8821_reset_chip(nau8821->regmap); in nau8821_i2c_probe()
1722 ret = regmap_read(nau8821->regmap, NAU8821_R58_I2C_DEVICE_ID, &value); in nau8821_i2c_probe()