All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Libin Yang <libin.yang@linux.intel.com>
Cc: alsa-devel@alsa-project.org, mengdong.lin@linux.intel.com,
	David Henningsson <david.henningsson@canonical.com>
Subject: Re: [PATCH RFC 4/4] ALSA: hda - Use component ops for i915 HDMI/DP audio jack handling
Date: Fri, 13 Nov 2015 16:39:08 +0100	[thread overview]
Message-ID: <s5hvb95gb8j.wl-tiwai@suse.de> (raw)
In-Reply-To: <s5hoaey30ji.wl-tiwai@suse.de>

On Fri, 13 Nov 2015 06:56:17 +0100,
Takashi Iwai wrote:
> 
> On Fri, 13 Nov 2015 02:55:25 +0100,
> Libin Yang wrote:
> > 
> > 
> > On 11/13/2015 12:20 AM, Takashi Iwai wrote:
> > > Since we have a new audio component ops to fetch the current ELD and
> > > state now, we can reduce the usage of unsol event of HDMI/DP pins.
> > > The unsol event isn't only unreliable, but it also needs the power
> > > up/down of the codec and link at each time, which is a significant
> > > power and time loss.
> > >
> > > In this patch, the jack creation and unsol/jack event handling are
> > > modified to use the audio component for the dedicated Intel chips.
> > >
> > > The jack handling got slightly more codes than a simple usage of
> > > hda_jack layer since we need to deal directly with snd_jack object;
> > > the hda_jack layer is basically designed for the pin sense read and
> > > unsol events, both of which aren't used any longer in our case.
> > >
> > > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > > ---
> > >   sound/pci/hda/patch_hdmi.c | 83 ++++++++++++++++++++++++++++++++++++++++++++--
> > >   1 file changed, 81 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> > > index 60cd9e700909..ca1d2d4a295e 100644
> > > --- a/sound/pci/hda/patch_hdmi.c
> > > +++ b/sound/pci/hda/patch_hdmi.c
> > > @@ -83,6 +83,7 @@ struct hdmi_spec_per_pin {
> > >   	struct mutex lock;
> > >   	struct delayed_work work;
> > >   	struct snd_kcontrol *eld_ctl;
> > > +	struct snd_jack *acomp_jack; /* jack via audio component */
> > >   	int repoll_count;
> > >   	bool setup; /* the stream has been set up by prepare callback */
> > >   	int channels; /* current number of channels */
> > > @@ -141,6 +142,7 @@ struct hdmi_spec {
> > >   	struct hdmi_ops ops;
> > >
> > >   	bool dyn_pin_out;
> > > +	bool use_acomp; /* use audio component for ELD notify/update */
> > >
> > >   	/*
> > >   	 * Non-generic VIA/NVIDIA specific
> > > @@ -1530,6 +1532,9 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx)
> > >   	return 0;
> > >   }
> > >
> > > +static void sync_eld_via_acomp(struct hda_codec *codec,
> > > +			       struct hdmi_spec_per_pin *per_pin);
> > > +
> > >   static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
> > >   {
> > >   	struct hda_jack_tbl *jack;
> > > @@ -1551,6 +1556,11 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
> > >   	bool eld_changed = false;
> > >   	bool ret;
> > >
> > > +	if (spec->use_acomp) {
> > > +		sync_eld_via_acomp(codec, per_pin);
> > > +		return false; /* don't call snd_hda_jack_report_sync() */
> > 
> > I think we still need call intel_verify_pin_cvt_connect(), 
> > intel_not_share_assigned_cvt() and hdmi_setup_audio_infoframe() as 
> > before if eld_valid is true.
> 
> Right, also ELD kctl notification is missing, too.
> It implies that we'd better refactor the ELD update code, split the
> code from hdmi_present_sense() to do both commonly.

FYI, I updated the patchset on test/hdmi-jack branch now.
It receives audio_enabled state, and handles ELD update more
properly.


Takashi

  reply	other threads:[~2015-11-13 15:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 16:20 [PATCH RFC 0/4] HDA/i915 jack handling using component Takashi Iwai
2015-11-12 16:20 ` [PATCH RFC 1/4] drm/i915: Add get_eld audio component Takashi Iwai
2015-11-12 16:20 ` [PATCH RFC 2/4] drm/i915: Remove superfluous NULL check Takashi Iwai
2015-11-12 16:20 ` [PATCH RFC 3/4] drm/i915: refactoring audio component functions Takashi Iwai
2015-11-12 16:20 ` [PATCH RFC 4/4] ALSA: hda - Use component ops for i915 HDMI/DP audio jack handling Takashi Iwai
2015-11-13  1:55   ` Libin Yang
2015-11-13  5:56     ` Takashi Iwai
2015-11-13 15:39       ` Takashi Iwai [this message]
2015-11-12 16:44 ` [PATCH RFC 0/4] HDA/i915 jack handling using component David Henningsson
2015-11-12 16:55   ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hvb95gb8j.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=david.henningsson@canonical.com \
    --cc=libin.yang@linux.intel.com \
    --cc=mengdong.lin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.