Lines Matching +full:in4 +full:- +full:in5
1 // SPDX-License-Identifier: GPL-2.0
28 "vdd-a",
29 "vdd-io",
112 struct regmap *regmap = cs530x->regmap; in cs530x_put_volsw_vu()
130 static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -1270, 50, 0);
133 "Min Phase Slow Roll-off",
134 "Min Phase Fast Roll-off",
135 "Linear Phase Slow Roll-off",
136 "Linear Phase Fast Roll-off",
203 SOC_SINGLE_EXT_TLV("IN4 Volume", CS530X_IN_VOL_CTRL2_1, 0, 255, 1,
211 SOC_SINGLE_EXT_TLV("IN5 Volume", CS530X_IN_VOL_CTRL3_0, 0, 255, 1,
229 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in cs530x_adc_event()
231 struct regmap *regmap = cs530x->regmap; in cs530x_adc_event()
235 cs530x->adc_pairs_count++; in cs530x_adc_event()
239 (w->shift * 2), CS530X_IN_MUTE); in cs530x_adc_event()
241 ((w->shift+1) * 2), CS530X_IN_MUTE); in cs530x_adc_event()
243 cs530x->adc_pairs_count--; in cs530x_adc_event()
244 if (!cs530x->adc_pairs_count) { in cs530x_adc_event()
252 (w->shift * 2), CS530X_IN_MUTE); in cs530x_adc_event()
254 ((w->shift+1) * 2), CS530X_IN_MUTE); in cs530x_adc_event()
258 return -EINVAL; in cs530x_adc_event()
301 SND_SOC_DAPM_INPUT("IN4"),
312 SND_SOC_DAPM_INPUT("IN5"),
351 { "ADC34 Enable", "Switch", "IN4" },
367 { "ADC56 Enable", "Switch", "IN5" },
421 struct regmap *regmap = cs530x->regmap; in cs530x_set_bclk()
442 dev_err(component->dev, "Invalid BCLK frequency %d\n", freq); in cs530x_set_bclk()
443 return -EINVAL; in cs530x_set_bclk()
446 dev_dbg(component->dev, "BCLK frequency is %d\n", freq); in cs530x_set_bclk()
456 struct regmap *regmap = priv->regmap; in cs530x_set_pll_refclk()
477 dev_err(component->dev, "Invalid PLL refclk %d\n", freq); in cs530x_set_pll_refclk()
478 return -EINVAL; in cs530x_set_pll_refclk()
489 struct snd_soc_component *component = dai->component; in cs530x_hw_params()
491 struct regmap *regmap = cs530x->regmap; in cs530x_hw_params()
521 dev_err(component->dev, "Invalid sample rate %d\n", fs); in cs530x_hw_params()
522 return -EINVAL; in cs530x_hw_params()
525 cs530x->fs = fs; in cs530x_hw_params()
532 dev_dbg(component->dev, "Configuring for %d %d bit TDM slots\n", in cs530x_hw_params()
533 cs530x->tdm_slots, cs530x->tdm_width); in cs530x_hw_params()
535 cs530x->tdm_width, in cs530x_hw_params()
536 cs530x->tdm_slots, in cs530x_hw_params()
554 struct snd_soc_component *component = dai->component; in cs530x_set_fmt()
556 struct regmap *regmap = priv->regmap; in cs530x_set_fmt()
566 return -EINVAL; in cs530x_set_fmt()
580 return -EINVAL; in cs530x_set_fmt()
590 return -EINVAL; in cs530x_set_fmt()
611 dev_err(component->dev, "Invalid MCLK %d\n", freq); in cs530x_check_mclk_freq()
619 struct snd_soc_component *component = dai->component; in cs530x_set_tdm_slot()
621 struct regmap *regmap = cs530x->regmap; in cs530x_set_tdm_slot()
656 dev_err(component->dev, "Invalid TX slot(s) 0x%x\n", tx_mask); in cs530x_set_tdm_slot()
657 return -EINVAL; in cs530x_set_tdm_slot()
660 cs530x->tdm_width = slot_width; in cs530x_set_tdm_slot()
661 cs530x->tdm_slots = slots; in cs530x_set_tdm_slot()
675 .name = "cs530x-dai",
693 struct regmap *regmap = cs530x->regmap; in cs530x_set_pll()
706 return -EINVAL; in cs530x_set_pll()
716 dev_err(component->dev, "Invalid PLL source %d\n", source); in cs530x_set_pll()
717 return -EINVAL; in cs530x_set_pll()
733 switch (cs530x->devtype) { in cs530x_component_probe()
769 dev_err(component->dev, "Invalid device type %d\n", in cs530x_component_probe()
770 cs530x->devtype); in cs530x_component_probe()
771 return -EINVAL; in cs530x_component_probe()
781 struct regmap *regmap = cs530x->regmap; in cs530x_set_sysclk()
786 dev_err(component->dev, "Invalid MCLK source rate %d\n", in cs530x_set_sysclk()
788 return -EINVAL; in cs530x_set_sysclk()
791 cs530x->mclk_rate = freq; in cs530x_set_sysclk()
796 dev_err(component->dev, "Invalid clock id %d\n", clk_id); in cs530x_set_sysclk()
797 return -EINVAL; in cs530x_set_sysclk()
828 struct device *dev = cs530x->dev; in cs530x_check_device_id()
832 ret = regmap_read(cs530x->regmap, CS530X_DEVID, &dev_id); in cs530x_check_device_id()
836 ret = regmap_read(cs530x->regmap, CS530X_REVID, &rev); in cs530x_check_device_id()
844 cs530x->num_adcs = 2; in cs530x_check_device_id()
847 cs530x->num_adcs = 4; in cs530x_check_device_id()
850 cs530x->num_adcs = 8; in cs530x_check_device_id()
853 return dev_err_probe(dev, -EINVAL, "Invalid device ID 0x%x\n", in cs530x_check_device_id()
862 struct regmap *regmap = cs530x->regmap; in cs530x_parse_device_properties()
863 struct device *dev = cs530x->dev; in cs530x_parse_device_properties()
866 switch (cs530x->num_adcs) { in cs530x_parse_device_properties()
868 if (device_property_read_bool(dev, "cirrus,in-hiz-pin78")) in cs530x_parse_device_properties()
871 if (device_property_read_bool(dev, "cirrus,in-hiz-pin56")) in cs530x_parse_device_properties()
876 if (device_property_read_bool(dev, "cirrus,in-hiz-pin34")) in cs530x_parse_device_properties()
881 if (device_property_read_bool(dev, "cirrus,in-hiz-pin12")) in cs530x_parse_device_properties()
886 return dev_err_probe(dev, -EINVAL, in cs530x_parse_device_properties()
888 cs530x->num_adcs); in cs530x_parse_device_properties()
894 struct device *dev = cs530x->dev; in cs530x_probe()
897 cs530x->dev_dai = devm_kmemdup(dev, &cs530x_dai, in cs530x_probe()
898 sizeof(*(cs530x->dev_dai)), in cs530x_probe()
900 if (!cs530x->dev_dai) in cs530x_probe()
901 return -ENOMEM; in cs530x_probe()
903 for (i = 0; i < ARRAY_SIZE(cs530x->supplies); i++) in cs530x_probe()
904 cs530x->supplies[i].supply = cs530x_supply_names[i]; in cs530x_probe()
906 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(cs530x->supplies), in cs530x_probe()
907 cs530x->supplies); in cs530x_probe()
911 ret = regulator_bulk_enable(ARRAY_SIZE(cs530x->supplies), in cs530x_probe()
912 cs530x->supplies); in cs530x_probe()
916 cs530x->reset_gpio = devm_gpiod_get_optional(dev, "reset", in cs530x_probe()
918 if (IS_ERR(cs530x->reset_gpio)) { in cs530x_probe()
919 ret = dev_err_probe(dev, PTR_ERR(cs530x->reset_gpio), in cs530x_probe()
924 if (cs530x->reset_gpio) { in cs530x_probe()
926 gpiod_set_value_cansleep(cs530x->reset_gpio, 0); in cs530x_probe()
934 if (!cs530x->reset_gpio) { in cs530x_probe()
935 ret = regmap_write(cs530x->regmap, CS530X_SW_RESET, in cs530x_probe()
947 cs530x->dev_dai->capture.channels_max = cs530x->num_adcs; in cs530x_probe()
950 &soc_component_dev_cs530x, cs530x->dev_dai, 1); in cs530x_probe()
959 gpiod_set_value_cansleep(cs530x->reset_gpio, 1); in cs530x_probe()
962 regulator_bulk_disable(ARRAY_SIZE(cs530x->supplies), in cs530x_probe()
963 cs530x->supplies); in cs530x_probe()