nau8540 237 sound/soc/codecs/nau8540.c struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); nau8540 242 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL1, nau8540 244 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL2, nau8540 247 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL1, nau8540 249 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL2, nau8540 259 sound/soc/codecs/nau8540.c struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); nau8540 262 sound/soc/codecs/nau8540.c regmap_write(nau8540->regmap, NAU8540_REG_RST, 0x0001); nau8540 263 sound/soc/codecs/nau8540.c regmap_write(nau8540->regmap, NAU8540_REG_RST, 0x0000); nau8540 360 sound/soc/codecs/nau8540.c static int nau8540_clock_check(struct nau8540 *nau8540, int rate, int osr) nau8540 366 sound/soc/codecs/nau8540.c dev_err(nau8540->dev, "exceed the maximum frequency of CLK_ADC\n"); nau8540 377 sound/soc/codecs/nau8540.c struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); nau8540 386 sound/soc/codecs/nau8540.c regmap_read(nau8540->regmap, NAU8540_REG_ADC_SAMPLE_RATE, &osr); nau8540 388 sound/soc/codecs/nau8540.c if (nau8540_clock_check(nau8540, params_rate(params), osr)) nau8540 390 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_CLOCK_SRC, nau8540 411 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL0, nau8540 420 sound/soc/codecs/nau8540.c struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); nau8540 464 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL0, nau8540 467 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL1, nau8540 469 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL2, nau8540 491 sound/soc/codecs/nau8540.c struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); nau8540 504 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL4, nau8540 507 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL1, nau8540 509 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL2, nau8540 649 sound/soc/codecs/nau8540.c struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); nau8540 655 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_FLL3, nau8540 661 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_FLL3, nau8540 668 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_FLL3, nau8540 675 sound/soc/codecs/nau8540.c dev_err(nau8540->dev, "Invalid clock id (%d)\n", pll_id); nau8540 678 sound/soc/codecs/nau8540.c dev_dbg(nau8540->dev, "Sysclk is %dHz and clock id is %d\n", nau8540 684 sound/soc/codecs/nau8540.c dev_err(nau8540->dev, "Unsupported input clock %d\n", freq_in); nau8540 687 sound/soc/codecs/nau8540.c dev_dbg(nau8540->dev, "mclk_src=%x ratio=%x fll_frac=%x fll_int=%x clk_ref_div=%x\n", nau8540 691 sound/soc/codecs/nau8540.c nau8540_fll_apply(nau8540->regmap, &fll_param); nau8540 693 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_CLOCK_SRC, nau8540 702 sound/soc/codecs/nau8540.c struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); nau8540 707 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_CLOCK_SRC, nau8540 709 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_FLL6, nau8540 714 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_FLL6, nau8540 716 sound/soc/codecs/nau8540.c regmap_update_bits(nau8540->regmap, NAU8540_REG_CLOCK_SRC, nau8540 721 sound/soc/codecs/nau8540.c dev_err(nau8540->dev, "Invalid clock id (%d)\n", clk_id); nau8540 725 sound/soc/codecs/nau8540.c dev_dbg(nau8540->dev, "Sysclk is %dHz and clock id is %d\n", nau8540 737 sound/soc/codecs/nau8540.c static void nau8540_init_regs(struct nau8540 *nau8540) nau8540 739 sound/soc/codecs/nau8540.c struct regmap *regmap = nau8540->regmap; nau8540 776 sound/soc/codecs/nau8540.c struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); nau8540 778 sound/soc/codecs/nau8540.c regcache_cache_only(nau8540->regmap, true); nau8540 779 sound/soc/codecs/nau8540.c regcache_mark_dirty(nau8540->regmap); nau8540 786 sound/soc/codecs/nau8540.c struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component); nau8540 788 sound/soc/codecs/nau8540.c regcache_cache_only(nau8540->regmap, false); nau8540 789 sound/soc/codecs/nau8540.c regcache_sync(nau8540->regmap); nau8540 830 sound/soc/codecs/nau8540.c struct nau8540 *nau8540 = dev_get_platdata(dev); nau8540 833 sound/soc/codecs/nau8540.c if (!nau8540) { nau8540 834 sound/soc/codecs/nau8540.c nau8540 = devm_kzalloc(dev, sizeof(*nau8540), GFP_KERNEL); nau8540 835 sound/soc/codecs/nau8540.c if (!nau8540) nau8540 838 sound/soc/codecs/nau8540.c i2c_set_clientdata(i2c, nau8540); nau8540 840 sound/soc/codecs/nau8540.c nau8540->regmap = devm_regmap_init_i2c(i2c, &nau8540_regmap_config); nau8540 841 sound/soc/codecs/nau8540.c if (IS_ERR(nau8540->regmap)) nau8540 842 sound/soc/codecs/nau8540.c return PTR_ERR(nau8540->regmap); nau8540 843 sound/soc/codecs/nau8540.c ret = regmap_read(nau8540->regmap, NAU8540_REG_I2C_DEVICE_ID, &value); nau8540 850 sound/soc/codecs/nau8540.c nau8540->dev = dev; nau8540 851 sound/soc/codecs/nau8540.c nau8540_reset_chip(nau8540->regmap); nau8540 852 sound/soc/codecs/nau8540.c nau8540_init_regs(nau8540);