Unverified Commit 467a2553 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: codecs: rt*: rename to snd_soc_component_read()



We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87d05z4mce.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6d75dfc3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -508,7 +508,7 @@ static int rt298_adc_event(struct snd_soc_dapm_widget *w,
			VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, nid, 0),
			0x7080, 0x7000);
		 /* If MCLK doesn't exist, reset AD filter */
		if (!(snd_soc_component_read32(component, RT298_VAD_CTRL) & 0x200)) {
		if (!(snd_soc_component_read(component, RT298_VAD_CTRL) & 0x200)) {
			pr_info("NO MCLK\n");
			switch (nid) {
			case RT298_ADC_IN1:
+1 −1
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source,
{
	unsigned int val;

	val = snd_soc_component_read32(snd_soc_dapm_to_component(source->dapm), RT5616_GLB_CLK);
	val = snd_soc_component_read(snd_soc_dapm_to_component(source->dapm), RT5616_GLB_CLK);
	val &= RT5616_SCLK_SRC_MASK;
	if (val == RT5616_SCLK_SRC_PLL1)
		return 1;
+16 −16
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ static unsigned int rt5631_read_index(struct snd_soc_component *component,
	unsigned int value;

	snd_soc_component_write(component, RT5631_INDEX_ADD, reg);
	value = snd_soc_component_read32(component, RT5631_INDEX_DATA);
	value = snd_soc_component_read(component, RT5631_INDEX_DATA);

	return value;
}
@@ -285,7 +285,7 @@ static int check_sysclk1_source(struct snd_soc_dapm_widget *source,
	struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
	unsigned int reg;

	reg = snd_soc_component_read32(component, RT5631_GLOBAL_CLK_CTRL);
	reg = snd_soc_component_read(component, RT5631_GLOBAL_CLK_CTRL);
	return reg & RT5631_SYSCLK_SOUR_SEL_PLL;
}

@@ -303,7 +303,7 @@ static int check_dacl_to_outmixl(struct snd_soc_dapm_widget *source,
	struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
	unsigned int reg;

	reg = snd_soc_component_read32(component, RT5631_OUTMIXER_L_CTRL);
	reg = snd_soc_component_read(component, RT5631_OUTMIXER_L_CTRL);
	return !(reg & RT5631_M_DAC_L_TO_OUTMIXER_L);
}

@@ -313,7 +313,7 @@ static int check_dacr_to_outmixr(struct snd_soc_dapm_widget *source,
	struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
	unsigned int reg;

	reg = snd_soc_component_read32(component, RT5631_OUTMIXER_R_CTRL);
	reg = snd_soc_component_read(component, RT5631_OUTMIXER_R_CTRL);
	return !(reg & RT5631_M_DAC_R_TO_OUTMIXER_R);
}

@@ -323,7 +323,7 @@ static int check_dacl_to_spkmixl(struct snd_soc_dapm_widget *source,
	struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
	unsigned int reg;

	reg = snd_soc_component_read32(component, RT5631_SPK_MIXER_CTRL);
	reg = snd_soc_component_read(component, RT5631_SPK_MIXER_CTRL);
	return !(reg & RT5631_M_DAC_L_TO_SPKMIXER_L);
}

@@ -333,7 +333,7 @@ static int check_dacr_to_spkmixr(struct snd_soc_dapm_widget *source,
	struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
	unsigned int reg;

	reg = snd_soc_component_read32(component, RT5631_SPK_MIXER_CTRL);
	reg = snd_soc_component_read(component, RT5631_SPK_MIXER_CTRL);
	return !(reg & RT5631_M_DAC_R_TO_SPKMIXER_R);
}

@@ -343,7 +343,7 @@ static int check_adcl_select(struct snd_soc_dapm_widget *source,
	struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
	unsigned int reg;

	reg = snd_soc_component_read32(component, RT5631_ADC_REC_MIXER);
	reg = snd_soc_component_read(component, RT5631_ADC_REC_MIXER);
	return !(reg & RT5631_M_MIC1_TO_RECMIXER_L);
}

@@ -353,7 +353,7 @@ static int check_adcr_select(struct snd_soc_dapm_widget *source,
	struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
	unsigned int reg;

	reg = snd_soc_component_read32(component, RT5631_ADC_REC_MIXER);
	reg = snd_soc_component_read(component, RT5631_ADC_REC_MIXER);
	return !(reg & RT5631_M_MIC2_TO_RECMIXER_R);
}

@@ -372,9 +372,9 @@ static void onebit_depop_power_stage(struct snd_soc_component *component, int en
				RT5631_EN_ONE_BIT_DEPOP, 0);

	/* keep soft volume and zero crossing setting */
	soft_vol = snd_soc_component_read32(component, RT5631_SOFT_VOL_CTRL);
	soft_vol = snd_soc_component_read(component, RT5631_SOFT_VOL_CTRL);
	snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, 0);
	hp_zc = snd_soc_component_read32(component, RT5631_INT_ST_IRQ_CTRL_2);
	hp_zc = snd_soc_component_read(component, RT5631_INT_ST_IRQ_CTRL_2);
	snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc & 0xf7ff);
	if (enable) {
		/* config one-bit depop parameter */
@@ -410,9 +410,9 @@ static void onebit_depop_mute_stage(struct snd_soc_component *component, int ena
				RT5631_EN_ONE_BIT_DEPOP, 0);

	/* keep soft volume and zero crossing setting */
	soft_vol = snd_soc_component_read32(component, RT5631_SOFT_VOL_CTRL);
	soft_vol = snd_soc_component_read(component, RT5631_SOFT_VOL_CTRL);
	snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, 0);
	hp_zc = snd_soc_component_read32(component, RT5631_INT_ST_IRQ_CTRL_2);
	hp_zc = snd_soc_component_read(component, RT5631_INT_ST_IRQ_CTRL_2);
	snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc & 0xf7ff);
	if (enable) {
		schedule_timeout_uninterruptible(msecs_to_jiffies(10));
@@ -448,9 +448,9 @@ static void depop_seq_power_stage(struct snd_soc_component *component, int enabl
		RT5631_EN_ONE_BIT_DEPOP, RT5631_EN_ONE_BIT_DEPOP);

	/* keep soft volume and zero crossing setting */
	soft_vol = snd_soc_component_read32(component, RT5631_SOFT_VOL_CTRL);
	soft_vol = snd_soc_component_read(component, RT5631_SOFT_VOL_CTRL);
	snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, 0);
	hp_zc = snd_soc_component_read32(component, RT5631_INT_ST_IRQ_CTRL_2);
	hp_zc = snd_soc_component_read(component, RT5631_INT_ST_IRQ_CTRL_2);
	snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc & 0xf7ff);
	if (enable) {
		/* config depop sequence parameter */
@@ -520,9 +520,9 @@ static void depop_seq_mute_stage(struct snd_soc_component *component, int enable
		RT5631_EN_ONE_BIT_DEPOP, RT5631_EN_ONE_BIT_DEPOP);

	/* keep soft volume and zero crossing setting */
	soft_vol = snd_soc_component_read32(component, RT5631_SOFT_VOL_CTRL);
	soft_vol = snd_soc_component_read(component, RT5631_SOFT_VOL_CTRL);
	snd_soc_component_write(component, RT5631_SOFT_VOL_CTRL, 0);
	hp_zc = snd_soc_component_read32(component, RT5631_INT_ST_IRQ_CTRL_2);
	hp_zc = snd_soc_component_read(component, RT5631_INT_ST_IRQ_CTRL_2);
	snd_soc_component_write(component, RT5631_INT_ST_IRQ_CTRL_2, hp_zc & 0xf7ff);
	if (enable) {
		schedule_timeout_uninterruptible(msecs_to_jiffies(10));
+5 −5
Original line number Diff line number Diff line
@@ -1651,7 +1651,7 @@ static int get_sdp_info(struct snd_soc_component *component, int dai_id)
	if (component == NULL)
		return -EINVAL;

	val = snd_soc_component_read32(component, RT5640_I2S1_SDP);
	val = snd_soc_component_read(component, RT5640_I2S1_SDP);
	val = (val & RT5640_I2S_IF_MASK) >> RT5640_I2S_IF_SFT;
	switch (dai_id) {
	case RT5640_AIF1:
@@ -2081,7 +2081,7 @@ int rt5640_sel_asrc_clk_src(struct snd_soc_component *component,
	snd_soc_component_update_bits(component, RT5640_ASRC_2,
		asrc2_mask, asrc2_value);

	if (snd_soc_component_read32(component, RT5640_ASRC_2)) {
	if (snd_soc_component_read(component, RT5640_ASRC_2)) {
		rt5640->asrc_en = true;
		snd_soc_component_update_bits(component, RT5640_JD_CTRL, 0x3, 0x3);
	} else {
@@ -2146,7 +2146,7 @@ static bool rt5640_micbias1_ovcd(struct snd_soc_component *component)
{
	int val;

	val = snd_soc_component_read32(component, RT5640_IRQ_CTRL2);
	val = snd_soc_component_read(component, RT5640_IRQ_CTRL2);
	dev_dbg(component->dev, "irq ctrl2 %#04x\n", val);

	return (val & RT5640_MB1_OC_STATUS);
@@ -2157,7 +2157,7 @@ static bool rt5640_jack_inserted(struct snd_soc_component *component)
	struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
	int val;

	val = snd_soc_component_read32(component, RT5640_INT_IRQ_ST);
	val = snd_soc_component_read(component, RT5640_INT_IRQ_ST);
	dev_dbg(component->dev, "irq status %#04x\n", val);

	if (rt5640->jd_inverted)
@@ -2484,7 +2484,7 @@ static int rt5640_probe(struct snd_soc_component *component)
	snd_soc_component_update_bits(component, RT5640_MICBIAS, 0x0030, 0x0030);
	snd_soc_component_update_bits(component, RT5640_DSP_PATH2, 0xfc00, 0x0c00);

	switch (snd_soc_component_read32(component, RT5640_RESET) & RT5640_ID_MASK) {
	switch (snd_soc_component_read(component, RT5640_RESET) & RT5640_ID_MASK) {
	case RT5640_ID_5640:
	case RT5640_ID_5642:
		snd_soc_add_component_controls(component,
+8 −8
Original line number Diff line number Diff line
@@ -866,7 +866,7 @@ static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source,
	struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm);
	unsigned int val;

	val = snd_soc_component_read32(component, RT5645_GLB_CLK);
	val = snd_soc_component_read(component, RT5645_GLB_CLK);
	val &= RT5645_SCLK_SRC_MASK;
	if (val == RT5645_SCLK_SRC_PLL1)
		return 1;
@@ -909,7 +909,7 @@ static int is_using_asrc(struct snd_soc_dapm_widget *source,
		return 0;
	}

	val = (snd_soc_component_read32(component, reg) >> shift) & 0xf;
	val = (snd_soc_component_read(component, reg) >> shift) & 0xf;
	switch (val) {
	case 1:
	case 2:
@@ -3121,9 +3121,9 @@ static void rt5645_enable_push_button_irq(struct snd_soc_component *component,
					RT5645_INT_IRQ_ST, 0x8, 0x8);
		snd_soc_component_update_bits(component,
					RT5650_4BTN_IL_CMD2, 0x8000, 0x8000);
		snd_soc_component_read32(component, RT5650_4BTN_IL_CMD1);
		snd_soc_component_read(component, RT5650_4BTN_IL_CMD1);
		pr_debug("%s read %x = %x\n", __func__, RT5650_4BTN_IL_CMD1,
			snd_soc_component_read32(component, RT5650_4BTN_IL_CMD1));
			snd_soc_component_read(component, RT5650_4BTN_IL_CMD1));
	} else {
		snd_soc_component_update_bits(component, RT5650_4BTN_IL_CMD2, 0x8000, 0x0);
		snd_soc_component_update_bits(component, RT5645_INT_IRQ_ST, 0x8, 0x0);
@@ -3216,7 +3216,7 @@ static int rt5645_button_detect(struct snd_soc_component *component)
{
	int btn_type, val;

	val = snd_soc_component_read32(component, RT5650_4BTN_IL_CMD1);
	val = snd_soc_component_read(component, RT5650_4BTN_IL_CMD1);
	pr_debug("val=0x%x\n", val);
	btn_type = val & 0xfff0;
	snd_soc_component_write(component, RT5650_4BTN_IL_CMD1, val);
@@ -3271,10 +3271,10 @@ static void rt5645_jack_detect_work(struct work_struct *work)
				    report, SND_JACK_MICROPHONE);
		return;
	case 4:
		val = snd_soc_component_read32(rt5645->component, RT5645_A_JD_CTRL1) & 0x0020;
		val = snd_soc_component_read(rt5645->component, RT5645_A_JD_CTRL1) & 0x0020;
		break;
	default: /* read rt5645 jd1_1 status */
		val = snd_soc_component_read32(rt5645->component, RT5645_INT_IRQ_ST) & 0x1000;
		val = snd_soc_component_read(rt5645->component, RT5645_INT_IRQ_ST) & 0x1000;
		break;

	}
@@ -3284,7 +3284,7 @@ static void rt5645_jack_detect_work(struct work_struct *work)
	} else if (!val && rt5645->jack_type != 0) {
		/* for push button and jack out */
		btn_type = 0;
		if (snd_soc_component_read32(rt5645->component, RT5645_INT_IRQ_ST) & 0x4) {
		if (snd_soc_component_read(rt5645->component, RT5645_INT_IRQ_ST) & 0x4) {
			/* button pressed */
			report = SND_JACK_HEADSET;
			btn_type = rt5645_button_detect(rt5645->component);
Loading