From: Takashi Iwai <tiwai@suse.de>
To: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Cc: ALSA ML <alsa-devel@alsa-project.org>,
Patches Audio <patches.audio@intel.com>,
Guneshwor Singh <guneshwor.o.singh@intel.com>,
Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Mark Brown <broonie@kernel.org>, Jeeja KP <jeeja.kp@intel.com>,
Sanyog Kale <sanyog.r.kale@intel.com>
Subject: Re: [PATCH v2] ASoC: hdac_hdmi: Program pin-port-mux during jack report event
Date: Wed, 11 Jul 2018 13:06:49 +0200 [thread overview]
Message-ID: <s5hy3ei9gl2.wl-tiwai@suse.de> (raw)
In-Reply-To: <20180711105603.GA23064@intel.com>
On Wed, 11 Jul 2018 12:56:03 +0200,
Sriram Periyasamy wrote:
>
> On Wed, Jul 11, 2018 at 12:03:14PM +0200, Takashi Iwai wrote:
> > On Wed, 11 Jul 2018 11:25:46 +0200,
> > Sriram Periyasamy wrote:
> > >
> > > On Wed, Jul 11, 2018 at 08:45:05AM +0200, Takashi Iwai wrote:
> > > > On Wed, 11 Jul 2018 08:30:43 +0200,
> > > > Sriram Periyasamy wrote:
> > > > > + if (port->pin->conn_index > 0)
> > > > > + snd_hdac_codec_write(&edev->hdev, port->pin->nid,
> > > > > + 0, AC_VERB_SET_CONNECT_SEL,
> > > > > + port->pin->conn_index - 1);
> > > >
> > > > And, here checks conn_index > 0 while...
> > > >
> > > > > @@ -903,6 +931,9 @@ static int hdac_hdmi_set_pin_port_mux(struct snd_kcontrol *kcontrol,
> > > > > }
> > > > > }
> > > > >
> > > > > + if (ucontrol->value.enumerated.item[0] > 0)
> > > > > + port->pin->conn_index = ucontrol->value.enumerated.item[0];
> > > >
> > > > ... conn_index is set only non-zero here.
> > > >
> > > > That is, once after a non-zero is passed, conn_index can't any longer
> > > > back to zero. I guess it's not intentional?
> > > >
> > >
> > > No, it is intentional. For example, two ports are connected to the
> > > display and user land set mux only for one port. Hence other port's
> > > conn_index is set to default 0. When jack report happens for that port,
> > > we would be writing invalid connection select index which will lead to
> > > undefined hardware behaviour as per the HDA spec.
> > >
> > > Though it is userland's mistake, it is better to take care in the driver.
> >
> > Then wouldn't it be better to remember the last set value in
> > hdac_hdmi_pin_mux_widget_event()? The purpose of the patch is to
> > restore the previous state.
> >
>
> Since hdac_hdmi_pin_mux_widget_event() invoked only for current playback
> pin-port-mux path, we wouldn't restore other port's indices. So
> hdac_hdmi_jack_report() chosen which will restore other ports also in
> all use cases.
Hm, it sounds like really more black magic behind the scene.
Please give more descriptions to the patch and/or codes.
Takashi
prev parent reply other threads:[~2018-07-11 11:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 6:30 [PATCH v2] ASoC: hdac_hdmi: Program pin-port-mux during jack report event Sriram Periyasamy
2018-07-11 6:45 ` Takashi Iwai
2018-07-11 9:25 ` Sriram Periyasamy
2018-07-11 10:03 ` Takashi Iwai
2018-07-11 10:56 ` Sriram Periyasamy
2018-07-11 11:06 ` Takashi Iwai [this message]
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=s5hy3ei9gl2.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=guneshwor.o.singh@intel.com \
--cc=jeeja.kp@intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=patches.audio@intel.com \
--cc=sanyog.r.kale@intel.com \
--cc=sriramx.periyasamy@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.