Lines Matching refs:nau8540

236 	struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component);  in nau8540_fepga_event()  local
240 regmap_update_bits(nau8540->regmap, NAU8540_REG_FEPGA2, in nau8540_fepga_event()
257 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in nau8540_precharge_event() local
261 regmap_update_bits(nau8540->regmap, NAU8540_REG_REFERENCE, in nau8540_precharge_event()
264 regmap_update_bits(nau8540->regmap, NAU8540_REG_REFERENCE, in nau8540_precharge_event()
266 regmap_update_bits(nau8540->regmap, NAU8540_REG_FEPGA2, in nau8540_precharge_event()
279 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in adc_power_control() local
284 regmap_update_bits(nau8540->regmap, NAU8540_REG_POWER_MANAGEMENT, in adc_power_control()
286 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL1, in adc_power_control()
288 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL2, in adc_power_control()
291 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL1, in adc_power_control()
293 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL2, in adc_power_control()
295 regmap_update_bits(nau8540->regmap, NAU8540_REG_POWER_MANAGEMENT, in adc_power_control()
305 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in aiftx_power_control() local
308 regmap_write(nau8540->regmap, NAU8540_REG_RST, 0x0001); in aiftx_power_control()
309 regmap_write(nau8540->regmap, NAU8540_REG_RST, 0x0000); in aiftx_power_control()
405 nau8540_get_osr(struct nau8540 *nau8540) in nau8540_get_osr() argument
409 regmap_read(nau8540->regmap, NAU8540_REG_ADC_SAMPLE_RATE, &osr); in nau8540_get_osr()
420 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in nau8540_dai_startup() local
423 osr = nau8540_get_osr(nau8540); in nau8540_dai_startup()
436 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in nau8540_hw_params() local
446 osr = nau8540_get_osr(nau8540); in nau8540_hw_params()
451 regmap_update_bits(nau8540->regmap, NAU8540_REG_CLOCK_SRC, in nau8540_hw_params()
472 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL0, in nau8540_hw_params()
481 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in nau8540_set_fmt() local
525 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL0, in nau8540_set_fmt()
528 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL1, in nau8540_set_fmt()
530 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL2, in nau8540_set_fmt()
552 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in nau8540_set_tdm_slot() local
565 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL4, in nau8540_set_tdm_slot()
568 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL1, in nau8540_set_tdm_slot()
570 regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL2, in nau8540_set_tdm_slot()
581 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in nau8540_dai_trigger() local
582 struct regmap *regmap = nau8540->regmap; in nau8540_dai_trigger()
598 dev_dbg(nau8540->dev, "1.ADC CH1 peak data %x", val); in nau8540_dai_trigger()
607 dev_dbg(nau8540->dev, "2.ADC CH1 peak data %x", val); in nau8540_dai_trigger()
609 dev_err(nau8540->dev, "Channel recovery failed!!"); in nau8540_dai_trigger()
760 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in nau8540_set_pll() local
766 regmap_update_bits(nau8540->regmap, NAU8540_REG_FLL3, in nau8540_set_pll()
772 regmap_update_bits(nau8540->regmap, NAU8540_REG_FLL3, in nau8540_set_pll()
779 regmap_update_bits(nau8540->regmap, NAU8540_REG_FLL3, in nau8540_set_pll()
786 dev_err(nau8540->dev, "Invalid clock id (%d)\n", pll_id); in nau8540_set_pll()
789 dev_dbg(nau8540->dev, "Sysclk is %dHz and clock id is %d\n", in nau8540_set_pll()
795 dev_err(nau8540->dev, "Unsupported input clock %d\n", freq_in); in nau8540_set_pll()
798 dev_dbg(nau8540->dev, "mclk_src=%x ratio=%x fll_frac=%x fll_int=%x clk_ref_div=%x\n", in nau8540_set_pll()
802 nau8540_fll_apply(nau8540->regmap, &fll_param); in nau8540_set_pll()
804 regmap_update_bits(nau8540->regmap, NAU8540_REG_CLOCK_SRC, in nau8540_set_pll()
813 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in nau8540_set_sysclk() local
818 regmap_update_bits(nau8540->regmap, NAU8540_REG_CLOCK_SRC, in nau8540_set_sysclk()
820 regmap_update_bits(nau8540->regmap, NAU8540_REG_FLL6, in nau8540_set_sysclk()
825 regmap_update_bits(nau8540->regmap, NAU8540_REG_FLL6, in nau8540_set_sysclk()
827 regmap_update_bits(nau8540->regmap, NAU8540_REG_CLOCK_SRC, in nau8540_set_sysclk()
832 dev_err(nau8540->dev, "Invalid clock id (%d)\n", clk_id); in nau8540_set_sysclk()
836 dev_dbg(nau8540->dev, "Sysclk is %dHz and clock id is %d\n", in nau8540_set_sysclk()
848 static void nau8540_init_regs(struct nau8540 *nau8540) in nau8540_init_regs() argument
850 struct regmap *regmap = nau8540->regmap; in nau8540_init_regs()
887 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in nau8540_suspend() local
889 regcache_cache_only(nau8540->regmap, true); in nau8540_suspend()
890 regcache_mark_dirty(nau8540->regmap); in nau8540_suspend()
897 struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); in nau8540_resume() local
899 regcache_cache_only(nau8540->regmap, false); in nau8540_resume()
900 regcache_sync(nau8540->regmap); in nau8540_resume()
939 struct nau8540 *nau8540 = dev_get_platdata(dev); in nau8540_i2c_probe() local
942 if (!nau8540) { in nau8540_i2c_probe()
943 nau8540 = devm_kzalloc(dev, sizeof(*nau8540), GFP_KERNEL); in nau8540_i2c_probe()
944 if (!nau8540) in nau8540_i2c_probe()
947 i2c_set_clientdata(i2c, nau8540); in nau8540_i2c_probe()
949 nau8540->regmap = devm_regmap_init_i2c(i2c, &nau8540_regmap_config); in nau8540_i2c_probe()
950 if (IS_ERR(nau8540->regmap)) in nau8540_i2c_probe()
951 return PTR_ERR(nau8540->regmap); in nau8540_i2c_probe()
952 ret = regmap_read(nau8540->regmap, NAU8540_REG_I2C_DEVICE_ID, &value); in nau8540_i2c_probe()
959 nau8540->dev = dev; in nau8540_i2c_probe()
960 nau8540_reset_chip(nau8540->regmap); in nau8540_i2c_probe()
961 nau8540_init_regs(nau8540); in nau8540_i2c_probe()