Lines Matching +full:rate +full:- +full:np +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0
3 // ak4642.c -- AK4642/AK4643 ALSA Soc Audio driver
23 #include <linux/clk-provider.h>
85 #define MS (1 << 3) /* master/slave select */ macro
102 #define LOPS (1 << 6) /* Stero Line-out Power Save Mode */
153 * min : 0xFE : -115.0 dB
156 static const DECLARE_TLV_DB_SCALE(out_tlv, -11550, 50, 1);
177 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in ak4642_lout_event()
280 int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in ak4642_dai_startup()
281 struct snd_soc_component *component = dai->component; in ak4642_dai_startup()
323 int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in ak4642_dai_shutdown()
324 struct snd_soc_component *component = dai->component; in ak4642_dai_shutdown()
338 struct snd_soc_component *component = codec_dai->component; in ak4642_dai_set_sysclk()
375 return -EINVAL; in ak4642_dai_set_sysclk()
378 if (extended_freq && !priv->drvdata->extended_frequencies) in ak4642_dai_set_sysclk()
379 return -EINVAL; in ak4642_dai_set_sysclk()
388 struct snd_soc_component *component = dai->component; in ak4642_dai_set_fmt()
398 data |= MS; in ak4642_dai_set_fmt()
404 return -EINVAL; in ak4642_dai_set_fmt()
406 snd_soc_component_update_bits(component, PW_MGMT2, MS | MCKO | PMPLL, data); in ak4642_dai_set_fmt()
422 return -EINVAL; in ak4642_dai_set_fmt()
471 struct snd_soc_component *component = dai->component; in ak4642_dai_hw_params()
473 u32 rate = clk_get_rate(priv->mcko); in ak4642_dai_hw_params() local
475 if (!rate) in ak4642_dai_hw_params()
476 rate = params_rate(params) * 256; in ak4642_dai_hw_params()
478 return ak4642_set_mcko(component, rate); in ak4642_dai_hw_params()
505 .name = "ak4642-hifi",
524 struct regmap *regmap = dev_get_regmap(component->dev, NULL); in ak4642_suspend()
533 struct regmap *regmap = dev_get_regmap(component->dev, NULL); in ak4642_resume()
543 if (priv->mcko) in ak4642_probe()
544 ak4642_set_mcko(component, clk_get_rate(priv->mcko)); in ak4642_probe()
607 struct device_node *np = dev->of_node; in ak4642_of_parse_mcko() local
609 const char *clk_name = np->name; in ak4642_of_parse_mcko()
611 u32 rate; in ak4642_of_parse_mcko() local
613 if (of_property_read_u32(np, "clock-frequency", &rate)) in ak4642_of_parse_mcko()
616 if (of_property_read_bool(np, "clocks")) in ak4642_of_parse_mcko()
617 parent_clk_name = of_clk_get_parent_name(np, 0); in ak4642_of_parse_mcko()
619 of_property_read_string(np, "clock-output-names", &clk_name); in ak4642_of_parse_mcko()
621 clk = clk_register_fixed_rate(dev, clk_name, parent_clk_name, 0, rate); in ak4642_of_parse_mcko()
623 of_clk_add_provider(np, of_clk_src_simple_get, clk); in ak4642_of_parse_mcko()
633 struct device *dev = &i2c->dev; in ak4642_i2c_probe()
647 return dev_err_probe(dev, -EINVAL, "Unknown device type\n"); in ak4642_i2c_probe()
651 return -ENOMEM; in ak4642_i2c_probe()
653 priv->drvdata = drvdata; in ak4642_i2c_probe()
654 priv->mcko = mcko; in ak4642_i2c_probe()
658 regmap = devm_regmap_init_i2c(i2c, drvdata->regmap_config); in ak4642_i2c_probe()
667 { .compatible = "asahi-kasei,ak4642", .data = &ak4642_drvdata},
668 { .compatible = "asahi-kasei,ak4643", .data = &ak4643_drvdata},
669 { .compatible = "asahi-kasei,ak4648", .data = &ak4648_drvdata},
684 .name = "ak4642-codec",