Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

ASoC: hdac_hdmi/nau8825/rt286/rt298/rt5663/da7219: replace codec to component



Now we can replace Codec to Component. Let's do it.

Because intal/rockchip boards are using multi-codecs in 1 driver,
we need to update these all related drivers in same time.
Otherwise compile error/warning happen

Note:

hdac_hdmi
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 1	->	.idle_bias_on = 0
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

nau8825
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 0	->	.idle_bias_on = 1
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

rt286
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 1	->	.idle_bias_on = 0
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

rt298
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 1	->	.idle_bias_on = 0
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

rt5663
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 1	->	.idle_bias_on = 0
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

da7219
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 0	->	.idle_bias_on = 1
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 29c5b8fd
Loading
Loading
Loading
Loading
+118 −118

File changed.

Preview size limit exceeded, changes collapsed.

+6 −6
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ enum da7219_aad_event_regs {

/* Private data */
struct da7219_aad_priv {
	struct snd_soc_codec *codec;
	struct snd_soc_component *component;
	int irq;

	u8 micbias_pulse_lvl;
@@ -206,14 +206,14 @@ struct da7219_aad_priv {
};

/* AAD control */
void da7219_aad_jack_det(struct snd_soc_codec *codec, struct snd_soc_jack *jack);
void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jack *jack);

/* Suspend/Resume */
void da7219_aad_suspend(struct snd_soc_codec *codec);
void da7219_aad_resume(struct snd_soc_codec *codec);
void da7219_aad_suspend(struct snd_soc_component *component);
void da7219_aad_resume(struct snd_soc_component *component);

/* Init/Exit */
int da7219_aad_init(struct snd_soc_codec *codec);
void da7219_aad_exit(struct snd_soc_codec *codec);
int da7219_aad_init(struct snd_soc_component *component);
void da7219_aad_exit(struct snd_soc_component *component);

#endif /* __DA7219_AAD_H */
+154 −153

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -822,6 +822,6 @@ struct da7219_priv {
	u8 gain_ramp_ctrl;
};

int da7219_set_pll(struct snd_soc_codec *codec, int source, unsigned int fout);
int da7219_set_pll(struct snd_soc_component *component, int source, unsigned int fout);

#endif /* __DA7219_H */
+23 −24
Original line number Diff line number Diff line
@@ -1536,7 +1536,7 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe)
	struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
	struct hdac_hdmi_pin *pin = NULL;
	struct hdac_hdmi_port *hport = NULL;
	struct snd_soc_codec *codec = edev->scodec;
	struct snd_soc_component *component = edev->scodec;
	int i;

	/* Don't know how this mapping is derived */
@@ -1551,7 +1551,7 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe)
	 * connection states are updated in anyway at the end of the resume,
	 * we can skip it when received during PM process.
	 */
	if (snd_power_get_state(codec->component.card->snd_card) !=
	if (snd_power_get_state(component->card->snd_card) !=
			SNDRV_CTL_POWER_D0)
		return;

@@ -1609,10 +1609,10 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card,
	char kc_name[NAME_SIZE], xname[NAME_SIZE];
	char *name;
	int i = 0, j;
	struct snd_soc_codec *codec = edev->scodec;
	struct snd_soc_component *component = edev->scodec;
	struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);

	kc = devm_kcalloc(codec->dev, hdmi->num_ports,
	kc = devm_kcalloc(component->dev, hdmi->num_ports,
				sizeof(*kc), GFP_KERNEL);

	if (!kc)
@@ -1622,11 +1622,11 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card,
		for (j = 0; j < pin->num_ports; j++) {
			snprintf(xname, sizeof(xname), "hif%d-%d Jack",
						pin->nid, pin->ports[j].id);
			name = devm_kstrdup(codec->dev, xname, GFP_KERNEL);
			name = devm_kstrdup(component->dev, xname, GFP_KERNEL);
			if (!name)
				return -ENOMEM;
			snprintf(kc_name, sizeof(kc_name), "%s Switch", xname);
			kc[i].name = devm_kstrdup(codec->dev, kc_name,
			kc[i].name = devm_kstrdup(component->dev, kc_name,
							GFP_KERNEL);
			if (!kc[i].name)
				return -ENOMEM;
@@ -1644,10 +1644,10 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card,
	return snd_soc_add_card_controls(card, kc, i);
}

int hdac_hdmi_jack_port_init(struct snd_soc_codec *codec,
int hdac_hdmi_jack_port_init(struct snd_soc_component *component,
			struct snd_soc_dapm_context *dapm)
{
	struct hdac_ext_device *edev = snd_soc_codec_get_drvdata(codec);
	struct hdac_ext_device *edev = snd_soc_component_get_drvdata(component);
	struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
	struct hdac_hdmi_pin *pin;
	struct snd_soc_dapm_widget *widgets;
@@ -1722,8 +1722,8 @@ EXPORT_SYMBOL_GPL(hdac_hdmi_jack_port_init);
int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int device,
				struct snd_soc_jack *jack)
{
	struct snd_soc_codec *codec = dai->codec;
	struct hdac_ext_device *edev = snd_soc_codec_get_drvdata(codec);
	struct snd_soc_component *component = dai->component;
	struct hdac_ext_device *edev = snd_soc_component_get_drvdata(component);
	struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
	struct hdac_hdmi_pcm *pcm;
	struct snd_pcm *snd_pcm;
@@ -1784,16 +1784,16 @@ static void hdac_hdmi_present_sense_all_pins(struct hdac_ext_device *edev,
	}
}

static int hdmi_codec_probe(struct snd_soc_codec *codec)
static int hdmi_codec_probe(struct snd_soc_component *component)
{
	struct hdac_ext_device *edev = snd_soc_codec_get_drvdata(codec);
	struct hdac_ext_device *edev = snd_soc_component_get_drvdata(component);
	struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
	struct snd_soc_dapm_context *dapm =
		snd_soc_component_get_dapm(&codec->component);
		snd_soc_component_get_dapm(component);
	struct hdac_ext_link *hlink = NULL;
	int ret;

	edev->scodec = codec;
	edev->scodec = component;

	/*
	 * hold the ref while we probe, also no need to drop the ref on
@@ -1834,12 +1834,11 @@ static int hdmi_codec_probe(struct snd_soc_codec *codec)
	return 0;
}

static int hdmi_codec_remove(struct snd_soc_codec *codec)
static void hdmi_codec_remove(struct snd_soc_component *component)
{
	struct hdac_ext_device *edev = snd_soc_codec_get_drvdata(codec);
	struct hdac_ext_device *edev = snd_soc_component_get_drvdata(component);

	pm_runtime_disable(&edev->hdev.dev);
	return 0;
}

#ifdef CONFIG_PM
@@ -1891,10 +1890,12 @@ static void hdmi_codec_complete(struct device *dev)
#define hdmi_codec_complete NULL
#endif

static const struct snd_soc_codec_driver hdmi_hda_codec = {
static const struct snd_soc_component_driver hdmi_hda_codec = {
	.probe			= hdmi_codec_probe,
	.remove			= hdmi_codec_remove,
	.idle_bias_off	= true,
	.use_pmdown_time	= 1,
	.endianness		= 1,
	.non_legacy_dai_naming	= 1,
};

static void hdac_hdmi_get_chmap(struct hdac_device *hdev, int pcm_idx,
@@ -2042,7 +2043,7 @@ static int hdac_hdmi_dev_probe(struct hdac_ext_device *edev)
	snd_hdac_refresh_widgets(hdev, true);

	/* ASoC specific initialization */
	ret = snd_soc_register_codec(&hdev->dev, &hdmi_hda_codec,
	ret = devm_snd_soc_register_component(&hdev->dev, &hdmi_hda_codec,
					hdmi_dais, num_dais);

	snd_hdac_ext_bus_link_put(edev->ebus, hlink);
@@ -2059,8 +2060,6 @@ static int hdac_hdmi_dev_remove(struct hdac_ext_device *edev)
	struct hdac_hdmi_port *port, *port_next;
	int i;

	snd_soc_unregister_codec(&edev->hdev.dev);

	list_for_each_entry_safe(pcm, pcm_next, &hdmi->pcm_list, head) {
		pcm->cvt = NULL;
		if (list_empty(&pcm->port_list))
Loading