// Copyright (C) 2024-2025 Cirrus Logic, Inc. and
// Cirrus Logic International Semiconductor Ltd.
-#include <sound/core.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/init.h>
-#include <sound/initval.h>
#include <linux/module.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
#include <linux/pm.h>
#include <linux/property.h>
#include <linux/slab.h>
+#include <sound/core.h>
+#include <sound/initval.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>
}
static int cs530x_put_volsw_vu(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
};
static int cs530x_adc_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
+ struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct cs530x_priv *cs530x = snd_soc_component_get_drvdata(component);
break;
case SND_SOC_DAPM_POST_PMU:
regmap_clear_bits(regmap, CS530X_IN_VOL_CTRL1_0 +
- (w->shift * 2), CS530X_IN_MUTE);
+ (w->shift * 2), CS530X_IN_MUTE);
regmap_clear_bits(regmap, CS530X_IN_VOL_CTRL1_0 +
- ((w->shift+1) * 2), CS530X_IN_MUTE);
+ ((w->shift + 1) * 2), CS530X_IN_MUTE);
cs530x->adc_pairs_count--;
if (!cs530x->adc_pairs_count) {
break;
case SND_SOC_DAPM_PRE_PMD:
regmap_set_bits(regmap, CS530X_IN_VOL_CTRL1_0 +
- (w->shift * 2), CS530X_IN_MUTE);
+ (w->shift * 2), CS530X_IN_MUTE);
regmap_set_bits(regmap, CS530X_IN_VOL_CTRL1_0 +
- ((w->shift+1) * 2), CS530X_IN_MUTE);
+ ((w->shift + 1) * 2), CS530X_IN_MUTE);
return regmap_write(regmap, CS530X_IN_VOL_CTRL5,
CS530X_IN_VU);
default:
static const struct snd_kcontrol_new adc12_ctrl =
SOC_DAPM_SINGLE_VIRT("Switch", 1);
-
static const struct snd_kcontrol_new adc34_ctrl =
SOC_DAPM_SINGLE_VIRT("Switch", 1);
-
static const struct snd_kcontrol_new adc56_ctrl =
SOC_DAPM_SINGLE_VIRT("Switch", 1);
-
static const struct snd_kcontrol_new adc78_ctrl =
SOC_DAPM_SINGLE_VIRT("Switch", 1);
-
static const struct snd_kcontrol_new in_hpf_ctrl =
SOC_DAPM_SINGLE_VIRT("Switch", 1);
}
static int cs530x_set_pll_refclk(struct snd_soc_component *component,
- const unsigned int freq)
+ const unsigned int freq)
{
struct cs530x_priv *priv = snd_soc_component_get_drvdata(component);
struct regmap *regmap = priv->regmap;
int ret = 0, fs = params_rate(params), bclk;
unsigned int fs_val;
-
switch (fs) {
case 32000:
fs_val = CS530X_FS_32K;
}
if (!regmap_test_bits(regmap, CS530X_CLK_CFG_0,
- CS530X_PLL_REFCLK_SRC_MASK)) {
+ CS530X_PLL_REFCLK_SRC_MASK)) {
ret = cs530x_set_pll_refclk(component, bclk);
if (ret)
return ret;
}
static int cs530x_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
- unsigned int rx_mask, int slots, int slot_width)
+ unsigned int rx_mask, int slots, int slot_width)
{
struct snd_soc_component *component = dai->component;
struct cs530x_priv *cs530x = snd_soc_component_get_drvdata(component);
};
static int cs530x_set_pll(struct snd_soc_component *component, int pll_id,
- int source, unsigned int freq_in,
- unsigned int freq_out)
+ int source, unsigned int freq_in,
+ unsigned int freq_out)
{
struct cs530x_priv *cs530x = snd_soc_component_get_drvdata(component);
struct regmap *regmap = cs530x->regmap;
cs530x_in_sum_4ch_controls,
num_widgets);
break;
-
case CS5308:
cs530x_add_12_adc_widgets(component);
cs530x_add_34_adc_widgets(component);
}
static int cs530x_set_sysclk(struct snd_soc_component *component, int clk_id,
- int source, unsigned int freq, int dir)
+ int source, unsigned int freq, int dir)
{
struct cs530x_priv *cs530x = snd_soc_component_get_drvdata(component);
struct regmap *regmap = cs530x->regmap;
int ret, i;
cs530x->dev_dai = devm_kmemdup(dev, &cs530x_dai,
- sizeof(*(cs530x->dev_dai)),
- GFP_KERNEL);
+ sizeof(*(cs530x->dev_dai)),
+ GFP_KERNEL);
if (!cs530x->dev_dai)
return -ENOMEM;
return dev_err_probe(dev, ret, "Failed to enable supplies");
cs530x->reset_gpio = devm_gpiod_get_optional(dev, "reset",
- GPIOD_OUT_HIGH);
+ GPIOD_OUT_HIGH);
if (IS_ERR(cs530x->reset_gpio)) {
ret = dev_err_probe(dev, PTR_ERR(cs530x->reset_gpio),
- "Reset gpio not available\n");
+ "Reset gpio not available\n");
goto err_regulator;
}
cs530x->dev_dai->capture.channels_max = cs530x->num_adcs;
ret = devm_snd_soc_register_component(dev,
- &soc_component_dev_cs530x, cs530x->dev_dai, 1);
+ &soc_component_dev_cs530x,
+ cs530x->dev_dai, 1);
if (ret) {
dev_err_probe(dev, ret, "Can't register cs530x component\n");
goto err_reset;