Use snd_soc_jack instead of snd_jack and create the jack in machine
driver and pass the jack pointer to hdac_hdmi driver for jack
reporting.
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
int pcm_id;
struct list_head port_list;
struct hdac_hdmi_cvt *cvt;
int pcm_id;
struct list_head port_list;
struct hdac_hdmi_cvt *cvt;
+ struct snd_soc_jack *jack;
int stream_tag;
int channels;
int format;
int stream_tag;
int channels;
int format;
dev_dbg(&edev->hdac.dev,
"jack report for pcm=%d\n",
pcm->pcm_id);
dev_dbg(&edev->hdac.dev,
"jack report for pcm=%d\n",
pcm->pcm_id);
- snd_jack_report(pcm->jack, SND_JACK_AVOUT);
+ snd_soc_jack_report(pcm->jack, SND_JACK_AVOUT,
+ SND_JACK_AVOUT);
}
pcm->jack_event++;
} else {
}
pcm->jack_event++;
} else {
* to multiple ports.
*/
if (pcm->jack_event == 1)
* to multiple ports.
*/
if (pcm->jack_event == 1)
- snd_jack_report(pcm->jack, 0);
+ snd_soc_jack_report(pcm->jack, 0, SND_JACK_AVOUT);
if (pcm->jack_event > 0)
pcm->jack_event--;
}
if (pcm->jack_event > 0)
pcm->jack_event--;
}
-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)
- char jack_name[NAME_SIZE];
struct snd_soc_codec *codec = dai->codec;
struct hdac_ext_device *edev = snd_soc_codec_get_drvdata(codec);
struct snd_soc_codec *codec = dai->codec;
struct hdac_ext_device *edev = snd_soc_codec_get_drvdata(codec);
- struct snd_soc_dapm_context *dapm =
- snd_soc_component_get_dapm(&codec->component);
struct hdac_hdmi_priv *hdmi = edev->private_data;
struct hdac_hdmi_pcm *pcm;
struct snd_pcm *snd_pcm;
struct hdac_hdmi_priv *hdmi = edev->private_data;
struct hdac_hdmi_pcm *pcm;
struct snd_pcm *snd_pcm;
pcm->pcm_id = device;
pcm->cvt = hdmi->dai_map[dai->id].cvt;
pcm->jack_event = 0;
pcm->pcm_id = device;
pcm->cvt = hdmi->dai_map[dai->id].cvt;
pcm->jack_event = 0;
mutex_init(&pcm->lock);
INIT_LIST_HEAD(&pcm->port_list);
snd_pcm = hdac_hdmi_get_pcm_from_id(dai->component->card, device);
mutex_init(&pcm->lock);
INIT_LIST_HEAD(&pcm->port_list);
snd_pcm = hdac_hdmi_get_pcm_from_id(dai->component->card, device);
list_add_tail(&pcm->head, &hdmi->pcm_list);
list_add_tail(&pcm->head, &hdmi->pcm_list);
- sprintf(jack_name, "HDMI/DP, pcm=%d Jack", device);
-
- return snd_jack_new(dapm->card->snd_card, jack_name,
- SND_JACK_AVOUT, &pcm->jack, true, false);
}
EXPORT_SYMBOL_GPL(hdac_hdmi_jack_init);
}
EXPORT_SYMBOL_GPL(hdac_hdmi_jack_init);
#ifndef __HDAC_HDMI_H__
#define __HDAC_HDMI_H__
#ifndef __HDAC_HDMI_H__
#define __HDAC_HDMI_H__
-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);
#endif /* __HDAC_HDMI_H__ */
#endif /* __HDAC_HDMI_H__ */