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

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
This diff is collapsed.
...@@ -189,7 +189,7 @@ enum da7219_aad_event_regs { ...@@ -189,7 +189,7 @@ enum da7219_aad_event_regs {
/* Private data */ /* Private data */
struct da7219_aad_priv { struct da7219_aad_priv {
struct snd_soc_codec *codec; struct snd_soc_component *component;
int irq; int irq;
u8 micbias_pulse_lvl; u8 micbias_pulse_lvl;
...@@ -206,14 +206,14 @@ struct da7219_aad_priv { ...@@ -206,14 +206,14 @@ struct da7219_aad_priv {
}; };
/* AAD control */ /* 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 */ /* Suspend/Resume */
void da7219_aad_suspend(struct snd_soc_codec *codec); void da7219_aad_suspend(struct snd_soc_component *component);
void da7219_aad_resume(struct snd_soc_codec *codec); void da7219_aad_resume(struct snd_soc_component *component);
/* Init/Exit */ /* Init/Exit */
int da7219_aad_init(struct snd_soc_codec *codec); int da7219_aad_init(struct snd_soc_component *component);
void da7219_aad_exit(struct snd_soc_codec *codec); void da7219_aad_exit(struct snd_soc_component *component);
#endif /* __DA7219_AAD_H */ #endif /* __DA7219_AAD_H */
This diff is collapsed.
...@@ -822,6 +822,6 @@ struct da7219_priv { ...@@ -822,6 +822,6 @@ struct da7219_priv {
u8 gain_ramp_ctrl; 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 */ #endif /* __DA7219_H */
...@@ -1536,7 +1536,7 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe) ...@@ -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_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
struct hdac_hdmi_pin *pin = NULL; struct hdac_hdmi_pin *pin = NULL;
struct hdac_hdmi_port *hport = NULL; struct hdac_hdmi_port *hport = NULL;
struct snd_soc_codec *codec = edev->scodec; struct snd_soc_component *component = edev->scodec;
int i; int i;
/* Don't know how this mapping is derived */ /* 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) ...@@ -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, * connection states are updated in anyway at the end of the resume,
* we can skip it when received during PM process. * 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) SNDRV_CTL_POWER_D0)
return; return;
...@@ -1609,10 +1609,10 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card, ...@@ -1609,10 +1609,10 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card,
char kc_name[NAME_SIZE], xname[NAME_SIZE]; char kc_name[NAME_SIZE], xname[NAME_SIZE];
char *name; char *name;
int i = 0, j; 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); 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); sizeof(*kc), GFP_KERNEL);
if (!kc) if (!kc)
...@@ -1622,11 +1622,11 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card, ...@@ -1622,11 +1622,11 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card,
for (j = 0; j < pin->num_ports; j++) { for (j = 0; j < pin->num_ports; j++) {
snprintf(xname, sizeof(xname), "hif%d-%d Jack", snprintf(xname, sizeof(xname), "hif%d-%d Jack",
pin->nid, pin->ports[j].id); pin->nid, pin->ports[j].id);
name = devm_kstrdup(codec->dev, xname, GFP_KERNEL); name = devm_kstrdup(component->dev, xname, GFP_KERNEL);
if (!name) if (!name)
return -ENOMEM; return -ENOMEM;
snprintf(kc_name, sizeof(kc_name), "%s Switch", xname); 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); GFP_KERNEL);
if (!kc[i].name) if (!kc[i].name)
return -ENOMEM; return -ENOMEM;
...@@ -1644,10 +1644,10 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card, ...@@ -1644,10 +1644,10 @@ static int create_fill_jack_kcontrols(struct snd_soc_card *card,
return snd_soc_add_card_controls(card, kc, i); 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 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_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
struct hdac_hdmi_pin *pin; struct hdac_hdmi_pin *pin;
struct snd_soc_dapm_widget *widgets; struct snd_soc_dapm_widget *widgets;
...@@ -1722,8 +1722,8 @@ EXPORT_SYMBOL_GPL(hdac_hdmi_jack_port_init); ...@@ -1722,8 +1722,8 @@ EXPORT_SYMBOL_GPL(hdac_hdmi_jack_port_init);
int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int device, int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int device,
struct snd_soc_jack *jack) struct snd_soc_jack *jack)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_component *component = dai->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 hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
struct hdac_hdmi_pcm *pcm; struct hdac_hdmi_pcm *pcm;
struct snd_pcm *snd_pcm; struct snd_pcm *snd_pcm;
...@@ -1784,16 +1784,16 @@ static void hdac_hdmi_present_sense_all_pins(struct hdac_ext_device *edev, ...@@ -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 hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
struct snd_soc_dapm_context *dapm = 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; struct hdac_ext_link *hlink = NULL;
int ret; int ret;
edev->scodec = codec; edev->scodec = component;
/* /*
* hold the ref while we probe, also no need to drop the ref on * 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) ...@@ -1834,12 +1834,11 @@ static int hdmi_codec_probe(struct snd_soc_codec *codec)
return 0; 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); pm_runtime_disable(&edev->hdev.dev);
return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -1891,10 +1890,12 @@ static void hdmi_codec_complete(struct device *dev) ...@@ -1891,10 +1890,12 @@ static void hdmi_codec_complete(struct device *dev)
#define hdmi_codec_complete NULL #define hdmi_codec_complete NULL
#endif #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, .probe = hdmi_codec_probe,
.remove = hdmi_codec_remove, .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, 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) ...@@ -2042,7 +2043,7 @@ static int hdac_hdmi_dev_probe(struct hdac_ext_device *edev)
snd_hdac_refresh_widgets(hdev, true); snd_hdac_refresh_widgets(hdev, true);
/* ASoC specific initialization */ /* 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); hdmi_dais, num_dais);
snd_hdac_ext_bus_link_put(edev->ebus, hlink); snd_hdac_ext_bus_link_put(edev->ebus, hlink);
...@@ -2059,8 +2060,6 @@ static int hdac_hdmi_dev_remove(struct hdac_ext_device *edev) ...@@ -2059,8 +2060,6 @@ static int hdac_hdmi_dev_remove(struct hdac_ext_device *edev)
struct hdac_hdmi_port *port, *port_next; struct hdac_hdmi_port *port, *port_next;
int i; int i;
snd_soc_unregister_codec(&edev->hdev.dev);
list_for_each_entry_safe(pcm, pcm_next, &hdmi->pcm_list, head) { list_for_each_entry_safe(pcm, pcm_next, &hdmi->pcm_list, head) {
pcm->cvt = NULL; pcm->cvt = NULL;
if (list_empty(&pcm->port_list)) if (list_empty(&pcm->port_list))
......
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int pcm, int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int pcm,
struct snd_soc_jack *jack); struct snd_soc_jack *jack);
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 snd_soc_dapm_context *dapm);
#endif /* __HDAC_HDMI_H__ */ #endif /* __HDAC_HDMI_H__ */
...@@ -914,8 +914,8 @@ static bool nau8825_volatile_reg(struct device *dev, unsigned int reg) ...@@ -914,8 +914,8 @@ static bool nau8825_volatile_reg(struct device *dev, unsigned int reg)
static int nau8825_adc_event(struct snd_soc_dapm_widget *w, static int nau8825_adc_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) struct snd_kcontrol *kcontrol, int event)
{ {
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
switch (event) { switch (event) {
case SND_SOC_DAPM_POST_PMU: case SND_SOC_DAPM_POST_PMU:
...@@ -938,8 +938,8 @@ static int nau8825_adc_event(struct snd_soc_dapm_widget *w, ...@@ -938,8 +938,8 @@ static int nau8825_adc_event(struct snd_soc_dapm_widget *w,
static int nau8825_pump_event(struct snd_soc_dapm_widget *w, static int nau8825_pump_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) struct snd_kcontrol *kcontrol, int event)
{ {
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
switch (event) { switch (event) {
case SND_SOC_DAPM_POST_PMU: case SND_SOC_DAPM_POST_PMU:
...@@ -962,8 +962,8 @@ static int nau8825_pump_event(struct snd_soc_dapm_widget *w, ...@@ -962,8 +962,8 @@ static int nau8825_pump_event(struct snd_soc_dapm_widget *w,
static int nau8825_output_dac_event(struct snd_soc_dapm_widget *w, static int nau8825_output_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) struct snd_kcontrol *kcontrol, int event)
{ {
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
switch (event) { switch (event) {
case SND_SOC_DAPM_PRE_PMU: case SND_SOC_DAPM_PRE_PMU:
...@@ -1244,8 +1244,8 @@ static int nau8825_hw_params(struct snd_pcm_substream *substream, ...@@ -1244,8 +1244,8 @@ static int nau8825_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_component *component = dai->component;
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
unsigned int val_len = 0, osr, ctrl_val, bclk_fs, bclk_div; unsigned int val_len = 0, osr, ctrl_val, bclk_fs, bclk_div;
nau8825_sema_acquire(nau8825, 3 * HZ); nau8825_sema_acquire(nau8825, 3 * HZ);
...@@ -1329,8 +1329,8 @@ static int nau8825_hw_params(struct snd_pcm_substream *substream, ...@@ -1329,8 +1329,8 @@ static int nau8825_hw_params(struct snd_pcm_substream *substream,
static int nau8825_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) static int nau8825_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{ {
struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_component *component = codec_dai->component;
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
unsigned int ctrl1_val = 0, ctrl2_val = 0; unsigned int ctrl1_val = 0, ctrl2_val = 0;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
...@@ -1427,10 +1427,10 @@ static struct snd_soc_dai_driver nau8825_dai = { ...@@ -1427,10 +1427,10 @@ static struct snd_soc_dai_driver nau8825_dai = {
* events will be routed to the given jack. Jack can be null to stop * events will be routed to the given jack. Jack can be null to stop
* reporting. * reporting.
*/ */
int nau8825_enable_jack_detect(struct snd_soc_codec *codec, int nau8825_enable_jack_detect(struct snd_soc_component *component,
struct snd_soc_jack *jack) struct snd_soc_jack *jack)
{ {
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
struct regmap *regmap = nau8825->regmap; struct regmap *regmap = nau8825->regmap;
nau8825->jack = jack; nau8825->jack = jack;
...@@ -1952,24 +1952,22 @@ static const struct regmap_config nau8825_regmap_config = { ...@@ -1952,24 +1952,22 @@ static const struct regmap_config nau8825_regmap_config = {
.num_reg_defaults = ARRAY_SIZE(nau8825_reg_defaults), .num_reg_defaults = ARRAY_SIZE(nau8825_reg_defaults),
}; };
static int nau8825_codec_probe(struct snd_soc_codec *codec) static int nau8825_component_probe(struct snd_soc_component *component)
{ {
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
nau8825->dapm = dapm; nau8825->dapm = dapm;
return 0; return 0;
} }
static int nau8825_codec_remove(struct snd_soc_codec *codec) static void nau8825_component_remove(struct snd_soc_component *component)
{ {
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
/* Cancel and reset cross tak suppresstion detection funciton */ /* Cancel and reset cross tak suppresstion detection funciton */
nau8825_xtalk_cancel(nau8825); nau8825_xtalk_cancel(nau8825);
return 0;
} }
/** /**
...@@ -2084,20 +2082,20 @@ static void nau8825_fll_apply(struct nau8825 *nau8825, ...@@ -2084,20 +2082,20 @@ static void nau8825_fll_apply(struct nau8825 *nau8825,
} }
/* freq_out must be 256*Fs in order to achieve the best performance */ /* freq_out must be 256*Fs in order to achieve the best performance */
static int nau8825_set_pll(struct snd_soc_codec *codec, int pll_id, int source, static int nau8825_set_pll(struct snd_soc_component *component, int pll_id, int source,
unsigned int freq_in, unsigned int freq_out) unsigned int freq_in, unsigned int freq_out)
{ {
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
struct nau8825_fll fll_param; struct nau8825_fll fll_param;
int ret, fs; int ret, fs;
fs = freq_out / 256; fs = freq_out / 256;
ret = nau8825_calc_fll_param(freq_in, fs, &fll_param); ret = nau8825_calc_fll_param(freq_in, fs, &fll_param);
if (ret < 0) { if (ret < 0) {
dev_err(codec->dev, "Unsupported input clock %d\n", freq_in); dev_err(component->dev, "Unsupported input clock %d\n", freq_in);
return ret; return ret;
} }
dev_dbg(codec->dev, "mclk_src=%x ratio=%x fll_frac=%x fll_int=%x clk_ref_div=%x\n", dev_dbg(component->dev, "mclk_src=%x ratio=%x fll_frac=%x fll_int=%x clk_ref_div=%x\n",
fll_param.mclk_src, fll_param.ratio, fll_param.fll_frac, fll_param.mclk_src, fll_param.ratio, fll_param.fll_frac,
fll_param.fll_int, fll_param.clk_ref_div); fll_param.fll_int, fll_param.clk_ref_div);
...@@ -2298,10 +2296,10 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id, ...@@ -2298,10 +2296,10 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id,
return 0; return 0;
} }
static int nau8825_set_sysclk(struct snd_soc_codec *codec, int clk_id, static int nau8825_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 nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
return nau8825_configure_sysclk(nau8825, clk_id, freq); return nau8825_configure_sysclk(nau8825, clk_id, freq);
} }
...@@ -2331,10 +2329,10 @@ static int nau8825_resume_setup(struct nau8825 *nau8825) ...@@ -2331,10 +2329,10 @@ static int nau8825_resume_setup(struct nau8825 *nau8825)
return 0; return 0;
} }
static int nau8825_set_bias_level(struct snd_soc_codec *codec, static int nau8825_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) enum snd_soc_bias_level level)
{ {
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
int ret; int ret;
switch (level) { switch (level) {
...@@ -2345,11 +2343,11 @@ static int nau8825_set_bias_level(struct snd_soc_codec *codec, ...@@ -2345,11 +2343,11 @@ static int nau8825_set_bias_level(struct snd_soc_codec *codec,
break; break;
case SND_SOC_BIAS_STANDBY: case SND_SOC_BIAS_STANDBY:
if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) { if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
if (nau8825->mclk_freq) { if (nau8825->mclk_freq) {
ret = clk_prepare_enable(nau8825->mclk); ret = clk_prepare_enable(nau8825->mclk);
if (ret) { if (ret) {
dev_err(nau8825->dev, "Unable to prepare codec mclk\n"); dev_err(nau8825->dev, "Unable to prepare component mclk\n");
return ret; return ret;
} }
} }
...@@ -2383,12 +2381,12 @@ static int nau8825_set_bias_level(struct snd_soc_codec *codec, ...@@ -2383,12 +2381,12 @@ static int nau8825_set_bias_level(struct snd_soc_codec *codec,
return 0; return 0;
} }
static int __maybe_unused nau8825_suspend(struct snd_soc_codec *codec) static int __maybe_unused nau8825_suspend(struct snd_soc_component *component)
{ {
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
disable_irq(nau8825->irq); disable_irq(nau8825->irq);
snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
/* Power down codec power; don't suppoet button wakeup */ /* Power down codec power; don't suppoet button wakeup */
snd_soc_dapm_disable_pin(nau8825->dapm, "SAR"); snd_soc_dapm_disable_pin(nau8825->dapm, "SAR");
snd_soc_dapm_disable_pin(nau8825->dapm, "MICBIAS"); snd_soc_dapm_disable_pin(nau8825->dapm, "MICBIAS");
...@@ -2399,9 +2397,9 @@ static int __maybe_unused nau8825_suspend(struct snd_soc_codec *codec) ...@@ -2399,9 +2397,9 @@ static int __maybe_unused nau8825_suspend(struct snd_soc_codec *codec)
return 0; return 0;
} }
static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec) static int __maybe_unused nau8825_resume(struct snd_soc_component *component)
{ {
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component);
int ret; int ret;
regcache_cache_only(nau8825->regmap, false); regcache_cache_only(nau8825->regmap, false);
...@@ -2415,24 +2413,25 @@ static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec) ...@@ -2415,24 +2413,25 @@ static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec)
return 0; return 0;
} }
static const struct snd_soc_codec_driver nau8825_codec_driver = { static const struct snd_soc_component_driver nau8825_component_driver = {
.probe = nau8825_codec_probe, .probe = nau8825_component_probe,
.remove = nau8825_codec_remove, .remove = nau8825_component_remove,
.set_sysclk = nau8825_set_sysclk, .set_sysclk = nau8825_set_sysclk,
.set_pll = nau8825_set_pll, .set_pll = nau8825_set_pll,
.set_bias_level = nau8825_set_bias_level, .set_bias_level = nau8825_set_bias_level,
.suspend_bias_off = true, .suspend = nau8825_suspend,
.suspend = nau8825_suspend, .resume = nau8825_resume,
.resume = nau8825_resume, .controls = nau8825_controls,
.num_controls = ARRAY_SIZE(nau8825_controls),
.component_driver = { .dapm_widgets = nau8825_dapm_widgets,
.controls = nau8825_controls, .num_dapm_widgets = ARRAY_SIZE(nau8825_dapm_widgets),
.num_controls = ARRAY_SIZE(nau8825_controls), .dapm_routes = nau8825_dapm_routes,
.dapm_widgets = nau8825_dapm_widgets, .num_dapm_routes = ARRAY_SIZE(nau8825_dapm_routes),
.num_dapm_widgets = ARRAY_SIZE(nau8825_dapm_widgets), .suspend_bias_off = 1,
.dapm_routes = nau8825_dapm_routes, .idle_bias_on = 1,
.num_dapm_routes = ARRAY_SIZE(nau8825_dapm_routes), .use_pmdown_time = 1,
}, .endianness = 1,
.non_legacy_dai_naming = 1,
}; };
static void nau8825_reset_chip(struct regmap *regmap) static void nau8825_reset_chip(struct regmap *regmap)
...@@ -2619,13 +2618,13 @@ static int nau8825_i2c_probe(struct i2c_client *i2c, ...@@ -2619,13 +2618,13 @@ static int nau8825_i2c_probe(struct i2c_client *i2c,
if (i2c->irq) if (i2c->irq)
nau8825_setup_irq(nau8825); nau8825_setup_irq(nau8825);
return snd_soc_register_codec(&i2c->dev, &nau8825_codec_driver, return devm_snd_soc_register_component(&i2c->dev,
&nau8825_component_driver,
&nau8825_dai, 1); &nau8825_dai, 1);
} }
static int nau8825_i2c_remove(struct i2c_client *client) static int nau8825_i2c_remove(struct i2c_client *client)
{ {
snd_soc_unregister_codec(&client->dev);
return 0; return 0;
} }
......
...@@ -480,7 +480,7 @@ struct nau8825 { ...@@ -480,7 +480,7 @@ struct nau8825 {
bool xtalk_baktab_initialized; /* True if initialized. */ bool xtalk_baktab_initialized; /* True if initialized. */
}; };
int nau8825_enable_jack_detect(struct snd_soc_codec *codec, int nau8825_enable_jack_detect(struct snd_soc_component *component,
struct snd_soc_jack *jack); struct snd_soc_jack *jack);
......
This diff is collapsed.
...@@ -199,7 +199,7 @@ enum { ...@@ -199,7 +199,7 @@ enum {
RT286_AIFS, RT286_AIFS,
}; };
int rt286_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack); int rt286_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack);
#endif /* __RT286_H__ */ #endif /* __RT286_H__ */
This diff is collapsed.
...@@ -210,7 +210,7 @@ enum { ...@@ -210,7 +210,7 @@ enum {
RT298_AIFS, RT298_AIFS,
}; };
int rt298_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack); int rt298_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack);
#endif /* __RT298_H__ */ #endif /* __RT298_H__ */
This diff is collapsed.
...@@ -1125,9 +1125,9 @@ enum { ...@@ -1125,9 +1125,9 @@ enum {
RT5663_AD_STEREO_FILTER = 0x2, RT5663_AD_STEREO_FILTER = 0x2,
}; };
int rt5663_set_jack_detect(struct snd_soc_codec *codec, int rt5663_set_jack_detect(struct snd_soc_component *component,
struct snd_soc_jack *hs_jack); struct snd_soc_jack *hs_jack);
int rt5663_sel_asrc_clk_src(struct snd_soc_codec *codec, int rt5663_sel_asrc_clk_src(struct snd_soc_component *component,
unsigned int filter_mask, unsigned int clk_src); unsigned int filter_mask, unsigned int clk_src);
#endif /* __RT5663_H__ */ #endif /* __RT5663_H__ */
...@@ -78,7 +78,7 @@ static const struct snd_soc_dapm_route broadwell_rt286_map[] = { ...@@ -78,7 +78,7 @@ static const struct snd_soc_dapm_route broadwell_rt286_map[] = {
static int broadwell_rt286_codec_init(struct snd_soc_pcm_runtime *rtd) static int broadwell_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_component *component = rtd->codec_dai->component;
int ret = 0; int ret = 0;
ret = snd_soc_card_jack_new(rtd->card, "Headset", ret = snd_soc_card_jack_new(rtd->card, "Headset",
SND_JACK_HEADSET | SND_JACK_BTN_0, &broadwell_headset, SND_JACK_HEADSET | SND_JACK_BTN_0, &broadwell_headset,
...@@ -86,7 +86,7 @@ static int broadwell_rt286_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -86,7 +86,7 @@ static int broadwell_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
if (ret) if (ret)
return ret; return ret;
rt286_mic_detect(codec, &broadwell_headset); rt286_mic_detect(component, &broadwell_headset);
return 0; return 0;
} }
...@@ -224,10 +224,9 @@ static int broadwell_suspend(struct snd_soc_card *card){ ...@@ -224,10 +224,9 @@ static int broadwell_suspend(struct snd_soc_card *card){
list_for_each_entry(component, &card->component_dev_list, card_list) { list_for_each_entry(component, &card->component_dev_list, card_list) {
if (!strcmp(component->name, "i2c-INT343A:00")) { if (!strcmp(component->name, "i2c-INT343A:00")) {
struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
dev_dbg(codec->dev, "disabling jack detect before going to suspend.\n"); dev_dbg(component->dev, "disabling jack detect before going to suspend.\n");
rt286_mic_detect(codec, NULL); rt286_mic_detect(component, NULL);
break; break;
} }
} }
...@@ -239,10 +238,9 @@ static int broadwell_resume(struct snd_soc_card *card){ ...@@ -239,10 +238,9 @@ static int broadwell_resume(struct snd_soc_card *card){
list_for_each_entry(component, &card->component_dev_list, card_list) { list_for_each_entry(component, &card->component_dev_list, card_list) {
if (!strcmp(component->name, "i2c-INT343A:00")) { if (!strcmp(component->name, "i2c-INT343A:00")) {
struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
dev_dbg(codec->dev, "enabling jack detect for resume.\n"); dev_dbg(component->dev, "enabling jack detect for resume.\n");
rt286_mic_detect(codec, &broadwell_headset); rt286_mic_detect(component, &broadwell_headset);
break; break;
} }
} }
......
...@@ -169,7 +169,7 @@ static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -169,7 +169,7 @@ static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
{ {
int ret; int ret;
struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_component *component = rtd->codec_dai->component;
/* Configure sysclk for codec */ /* Configure sysclk for codec */
ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK, 19200000, ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK, 19200000,
...@@ -192,7 +192,7 @@ static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -192,7 +192,7 @@ static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
return ret; return ret;
} }
da7219_aad_jack_det(codec, &broxton_headset); da7219_aad_jack_det(component, &broxton_headset);
snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC"); snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
...@@ -522,12 +522,12 @@ static int bxt_card_late_probe(struct snd_soc_card *card) ...@@ -522,12 +522,12 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
{ {
struct bxt_card_private *ctx = snd_soc_card_get_drvdata(card); struct bxt_card_private *ctx = snd_soc_card_get_drvdata(card);
struct bxt_hdmi_pcm *pcm; struct bxt_hdmi_pcm *pcm;
struct snd_soc_codec *codec = NULL; struct snd_soc_component *component = NULL;
int err, i = 0; int err, i = 0;
char jack_name[NAME_SIZE]; char jack_name[NAME_SIZE];
list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
codec = pcm->codec_dai->codec; component = pcm->codec_dai->component;
snprintf(jack_name, sizeof(jack_name), snprintf(jack_name, sizeof(jack_name),
"HDMI/DP, pcm=%d Jack", pcm->device); "HDMI/DP, pcm=%d Jack", pcm->device);
err = snd_soc_card_jack_new(card, jack_name, err = snd_soc_card_jack_new(card, jack_name,
...@@ -545,10 +545,10 @@ static int bxt_card_late_probe(struct snd_soc_card *card) ...@@ -545,10 +545,10 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
i++; i++;
} }
if (!codec) if (!component)
return -EINVAL; return -EINVAL;
return hdac_hdmi_jack_port_init(codec, &card->dapm); return hdac_hdmi_jack_port_init(component, &card->dapm);
} }
/* broxton audio machine driver for SPT + da7219 */ /* broxton audio machine driver for SPT + da7219 */
......
...@@ -167,7 +167,7 @@ static int broxton_rt298_fe_init(struct snd_soc_pcm_runtime *rtd) ...@@ -167,7 +167,7 @@ static int broxton_rt298_fe_init(struct snd_soc_pcm_runtime *rtd)
static int broxton_rt298_codec_init(struct snd_soc_pcm_runtime *rtd) static int broxton_rt298_codec_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_component *component = rtd->codec_dai->component;
int ret = 0; int ret = 0;
ret = snd_soc_card_jack_new(rtd->card, "Headset", ret = snd_soc_card_jack_new(rtd->card, "Headset",
...@@ -178,7 +178,7 @@ static int broxton_rt298_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -178,7 +178,7 @@ static int broxton_rt298_codec_init(struct snd_soc_pcm_runtime *rtd)
if (ret) if (ret)
return ret; return ret;
rt298_mic_detect(codec, &broxton_headset); rt298_mic_detect(component, &broxton_headset);
snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC"); snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
...@@ -496,12 +496,12 @@ static int bxt_card_late_probe(struct snd_soc_card *card) ...@@ -496,12 +496,12 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
{ {
struct bxt_rt286_private *ctx = snd_soc_card_get_drvdata(card); struct bxt_rt286_private *ctx = snd_soc_card_get_drvdata(card);
struct bxt_hdmi_pcm *pcm; struct bxt_hdmi_pcm *pcm;
struct snd_soc_codec *codec = NULL; struct snd_soc_component *component = NULL;
int err, i = 0; int err, i = 0;
char jack_name[NAME_SIZE]; char jack_name[NAME_SIZE];
list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
codec = pcm->codec_dai->codec; component = pcm->codec_dai->component;
snprintf(jack_name, sizeof(jack_name), snprintf(jack_name, sizeof(jack_name),
"HDMI/DP, pcm=%d Jack", pcm->device); "HDMI/DP, pcm=%d Jack", pcm->device);
err = snd_soc_card_jack_new(card, jack_name, err = snd_soc_card_jack_new(card, jack_name,
...@@ -519,10 +519,10 @@ static int bxt_card_late_probe(struct snd_soc_card *card) ...@@ -519,10 +519,10 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
i++; i++;
} }
if (!codec) if (!component)
return -EINVAL; return -EINVAL;
return hdac_hdmi_jack_port_init(codec, &card->dapm); return hdac_hdmi_jack_port_init(component, &card->dapm);
} }
......
...@@ -272,7 +272,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -272,7 +272,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
{ {
int ret; int ret;
struct kbl_rt5663_private *ctx = snd_soc_card_get_drvdata(rtd->card); struct kbl_rt5663_private *ctx = snd_soc_card_get_drvdata(rtd->card);
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_component *component = rtd->codec_dai->component;
struct snd_soc_jack *jack; struct snd_soc_jack *jack;
/* /*
...@@ -294,7 +294,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -294,7 +294,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
rt5663_set_jack_detect(codec, &ctx->kabylake_headset); rt5663_set_jack_detect(component, &ctx->kabylake_headset);
return ret; return ret;
} }
...@@ -448,7 +448,7 @@ static int kabylake_rt5663_hw_params(struct snd_pcm_substream *substream, ...@@ -448,7 +448,7 @@ static int kabylake_rt5663_hw_params(struct snd_pcm_substream *substream,
int ret; int ret;
/* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */ /* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */
rt5663_sel_asrc_clk_src(codec_dai->codec, rt5663_sel_asrc_clk_src(codec_dai->component,
RT5663_DA_STEREO_FILTER | RT5663_AD_STEREO_FILTER, RT5663_DA_STEREO_FILTER | RT5663_AD_STEREO_FILTER,
RT5663_CLK_SEL_I2S1_ASRC); RT5663_CLK_SEL_I2S1_ASRC);
...@@ -898,12 +898,12 @@ static int kabylake_card_late_probe(struct snd_soc_card *card) ...@@ -898,12 +898,12 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
{ {
struct kbl_rt5663_private *ctx = snd_soc_card_get_drvdata(card); struct kbl_rt5663_private *ctx = snd_soc_card_get_drvdata(card);
struct kbl_hdmi_pcm *pcm; struct kbl_hdmi_pcm *pcm;
struct snd_soc_codec *codec = NULL; struct snd_soc_component *component = NULL;
int err, i = 0; int err, i = 0;
char jack_name[NAME_SIZE]; char jack_name[NAME_SIZE];
list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
codec = pcm->codec_dai->codec; component = pcm->codec_dai->component;
snprintf(jack_name, sizeof(jack_name), snprintf(jack_name, sizeof(jack_name),
"HDMI/DP, pcm=%d Jack", pcm->device); "HDMI/DP, pcm=%d Jack", pcm->device);
err = snd_soc_card_jack_new(card, jack_name, err = snd_soc_card_jack_new(card, jack_name,
...@@ -921,10 +921,10 @@ static int kabylake_card_late_probe(struct snd_soc_card *card) ...@@ -921,10 +921,10 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
i++; i++;
} }
if (!codec) if (!component)
return -EINVAL; return -EINVAL;
return hdac_hdmi_jack_port_init(codec, &card->dapm); return hdac_hdmi_jack_port_init(component, &card->dapm);
} }
/* kabylake audio machine driver for SPT + RT5663 */ /* kabylake audio machine driver for SPT + RT5663 */
......
...@@ -178,7 +178,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -178,7 +178,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
{ {
int ret; int ret;
struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card); struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card);
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_component *component = rtd->codec_dai->component;
struct snd_soc_jack *jack; struct snd_soc_jack *jack;
/* /*
...@@ -200,7 +200,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -200,7 +200,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
rt5663_set_jack_detect(codec, &ctx->kabylake_headset); rt5663_set_jack_detect(component, &ctx->kabylake_headset);
ret = snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "DMIC"); ret = snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "DMIC");
if (ret) if (ret)
...@@ -333,7 +333,7 @@ static int kabylake_rt5663_hw_params(struct snd_pcm_substream *substream, ...@@ -333,7 +333,7 @@ static int kabylake_rt5663_hw_params(struct snd_pcm_substream *substream,
int ret; int ret;
/* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */ /* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */
rt5663_sel_asrc_clk_src(codec_dai->codec, rt5663_sel_asrc_clk_src(codec_dai->component,
RT5663_DA_STEREO_FILTER | RT5663_AD_STEREO_FILTER, RT5663_DA_STEREO_FILTER | RT5663_AD_STEREO_FILTER,
RT5663_CLK_SEL_I2S1_ASRC); RT5663_CLK_SEL_I2S1_ASRC);
...@@ -599,12 +599,12 @@ static int kabylake_card_late_probe(struct snd_soc_card *card) ...@@ -599,12 +599,12 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
{ {
struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(card); struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(card);
struct kbl_hdmi_pcm *pcm; struct kbl_hdmi_pcm *pcm;
struct snd_soc_codec *codec = NULL; struct snd_soc_component *component = NULL;
int err, i = 0; int err, i = 0;
char jack_name[NAME_SIZE]; char jack_name[NAME_SIZE];
list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
codec = pcm->codec_dai->codec; component = pcm->codec_dai->component;
snprintf(jack_name, sizeof(jack_name), snprintf(jack_name, sizeof(jack_name),
"HDMI/DP,pcm=%d Jack", pcm->device); "HDMI/DP,pcm=%d Jack", pcm->device);
err = snd_soc_card_jack_new(card, jack_name, err = snd_soc_card_jack_new(card, jack_name,
...@@ -620,10 +620,10 @@ static int kabylake_card_late_probe(struct snd_soc_card *card) ...@@ -620,10 +620,10 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
i++; i++;
} }
if (!codec) if (!component)
return -EINVAL; return -EINVAL;
return hdac_hdmi_jack_port_init(codec, &card->dapm); return hdac_hdmi_jack_port_init(component, &card->dapm);
} }
/* /*
......
...@@ -165,7 +165,7 @@ static int skylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd, ...@@ -165,7 +165,7 @@ static int skylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd) static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
{ {
int ret; int ret;
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_component *component = rtd->codec_dai->component;
/* /*
* Headset buttons map to the google Reference headset. * Headset buttons map to the google Reference headset.
...@@ -180,7 +180,7 @@ static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -180,7 +180,7 @@ static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
return ret; return ret;
} }
nau8825_enable_jack_detect(codec, &skylake_headset); nau8825_enable_jack_detect(component, &skylake_headset);
snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC"); snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
...@@ -592,12 +592,12 @@ static int skylake_card_late_probe(struct snd_soc_card *card) ...@@ -592,12 +592,12 @@ static int skylake_card_late_probe(struct snd_soc_card *card)
{ {
struct skl_nau8825_private *ctx = snd_soc_card_get_drvdata(card); struct skl_nau8825_private *ctx = snd_soc_card_get_drvdata(card);
struct skl_hdmi_pcm *pcm; struct skl_hdmi_pcm *pcm;
struct snd_soc_codec *codec = NULL; struct snd_soc_component *component = NULL;
int err, i = 0; int err, i = 0;
char jack_name[NAME_SIZE]; char jack_name[NAME_SIZE];
list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
codec = pcm->codec_dai->codec; component = pcm->codec_dai->component;
snprintf(jack_name, sizeof(jack_name), snprintf(jack_name, sizeof(jack_name),
"HDMI/DP, pcm=%d Jack", pcm->device); "HDMI/DP, pcm=%d Jack", pcm->device);
err = snd_soc_card_jack_new(card, jack_name, err = snd_soc_card_jack_new(card, jack_name,
...@@ -616,10 +616,10 @@ static int skylake_card_late_probe(struct snd_soc_card *card) ...@@ -616,10 +616,10 @@ static int skylake_card_late_probe(struct snd_soc_card *card)
i++; i++;
} }
if (!codec) if (!component)
return -EINVAL; return -EINVAL;
return hdac_hdmi_jack_port_init(codec, &card->dapm); return hdac_hdmi_jack_port_init(component, &card->dapm);
} }
/* skylake audio machine driver for SPT + NAU88L25 */ /* skylake audio machine driver for SPT + NAU88L25 */
......
...@@ -195,7 +195,7 @@ static int skylake_ssm4567_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -195,7 +195,7 @@ static int skylake_ssm4567_codec_init(struct snd_soc_pcm_runtime *rtd)
static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd) static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
{ {
int ret; int ret;
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_component *component = rtd->codec_dai->component;
/* /*
* 4 buttons here map to the google Reference headset * 4 buttons here map to the google Reference headset
...@@ -210,7 +210,7 @@ static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -210,7 +210,7 @@ static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
return ret; return ret;
} }
nau8825_enable_jack_detect(codec, &skylake_headset); nau8825_enable_jack_detect(component, &skylake_headset);
snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC"); snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
...@@ -643,12 +643,12 @@ static int skylake_card_late_probe(struct snd_soc_card *card) ...@@ -643,12 +643,12 @@ static int skylake_card_late_probe(struct snd_soc_card *card)
{ {
struct skl_nau88125_private *ctx = snd_soc_card_get_drvdata(card); struct skl_nau88125_private *ctx = snd_soc_card_get_drvdata(card);
struct skl_hdmi_pcm *pcm; struct skl_hdmi_pcm *pcm;
struct snd_soc_codec *codec = NULL; struct snd_soc_component *component = NULL;
int err, i = 0; int err, i = 0;
char jack_name[NAME_SIZE]; char jack_name[NAME_SIZE];
list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
codec = pcm->codec_dai->codec; component = pcm->codec_dai->component;
snprintf(jack_name, sizeof(jack_name), snprintf(jack_name, sizeof(jack_name),
"HDMI/DP, pcm=%d Jack", pcm->device); "HDMI/DP, pcm=%d Jack", pcm->device);
err = snd_soc_card_jack_new(card, jack_name, err = snd_soc_card_jack_new(card, jack_name,
...@@ -667,10 +667,10 @@ static int skylake_card_late_probe(struct snd_soc_card *card) ...@@ -667,10 +667,10 @@ static int skylake_card_late_probe(struct snd_soc_card *card)
i++; i++;
} }
if (!codec) if (!component)
return -EINVAL; return -EINVAL;
return hdac_hdmi_jack_port_init(codec, &card->dapm); return hdac_hdmi_jack_port_init(component, &card->dapm);
} }
/* skylake audio machine driver for SPT + NAU88L25 */ /* skylake audio machine driver for SPT + NAU88L25 */
......
...@@ -130,7 +130,7 @@ static int skylake_rt286_fe_init(struct snd_soc_pcm_runtime *rtd) ...@@ -130,7 +130,7 @@ static int skylake_rt286_fe_init(struct snd_soc_pcm_runtime *rtd)
static int skylake_rt286_codec_init(struct snd_soc_pcm_runtime *rtd) static int skylake_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_component *component = rtd->codec_dai->component;
int ret; int ret;
ret = snd_soc_card_jack_new(rtd->card, "Headset", ret = snd_soc_card_jack_new(rtd->card, "Headset",
...@@ -141,7 +141,7 @@ static int skylake_rt286_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -141,7 +141,7 @@ static int skylake_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
if (ret) if (ret)
return ret; return ret;
rt286_mic_detect(codec, &skylake_headset); rt286_mic_detect(component, &skylake_headset);
snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC"); snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
...@@ -478,12 +478,12 @@ static int skylake_card_late_probe(struct snd_soc_card *card) ...@@ -478,12 +478,12 @@ static int skylake_card_late_probe(struct snd_soc_card *card)
{ {
struct skl_rt286_private *ctx = snd_soc_card_get_drvdata(card); struct skl_rt286_private *ctx = snd_soc_card_get_drvdata(card);
struct skl_hdmi_pcm *pcm; struct skl_hdmi_pcm *pcm;
struct snd_soc_codec *codec = NULL; struct snd_soc_component *component = NULL;
int err, i = 0; int err, i = 0;
char jack_name[NAME_SIZE]; char jack_name[NAME_SIZE];
list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
codec = pcm->codec_dai->codec; component = pcm->codec_dai->component;
snprintf(jack_name, sizeof(jack_name), snprintf(jack_name, sizeof(jack_name),
"HDMI/DP, pcm=%d Jack", pcm->device); "HDMI/DP, pcm=%d Jack", pcm->device);
err = snd_soc_card_jack_new(card, jack_name, err = snd_soc_card_jack_new(card, jack_name,
...@@ -501,10 +501,10 @@ static int skylake_card_late_probe(struct snd_soc_card *card) ...@@ -501,10 +501,10 @@ static int skylake_card_late_probe(struct snd_soc_card *card)
i++; i++;
} }
if (!codec) if (!component)
return -EINVAL; return -EINVAL;
return hdac_hdmi_jack_port_init(codec, &card->dapm); return hdac_hdmi_jack_port_init(component, &card->dapm);
} }
/* skylake audio machine driver for SPT + RT286S */ /* skylake audio machine driver for SPT + RT286S */
......
...@@ -176,7 +176,7 @@ static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream, ...@@ -176,7 +176,7 @@ static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream,
static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd) static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_codec *codec = rtd->codec_dais[0]->codec; struct snd_soc_component *component = rtd->codec_dais[0]->component;
struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *codec_dai = rtd->codec_dai;
int ret; int ret;
...@@ -215,7 +215,7 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd) ...@@ -215,7 +215,7 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd)
snd_jack_set_key( snd_jack_set_key(
rockchip_sound_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND); rockchip_sound_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
da7219_aad_jack_det(codec, &rockchip_sound_jack); da7219_aad_jack_det(component, &rockchip_sound_jack);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment