All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ki-Seok Jo <kiseok.jo@irondevice.com>
To: Mark Brown <broonie@kernel.org>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Application <application@irondevice.com>
Subject: RE: [PATCH v2 1/2] ASoC: sma1303: Add driver for Iron Device SMA1303 Amp
Date: Wed, 25 Jan 2023 02:12:58 +0000	[thread overview]
Message-ID: <SLXP216MB007747CCA6C43D139712535C8CCE9@SLXP216MB0077.KORP216.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <Y8konjHXimUfm4NH@sirena.org.uk>


On Thu, Jan 19, 2023 at 08:16:52AM +0000, Ki-Seok Jo wrote:

> > > > +	if (!(sma1303->amp_power_status)) {
> > > > +		dev_info(component->dev, "%s : %s\n",
> > > > +			__func__, "Already AMP Shutdown");
> > > > +		return ret;
> > > > +	}
> > > > +
> > > > +	cancel_delayed_work_sync(&sma1303->check_fault_work);
> > > > +
> > > > +	msleep(55);

> > > That sleep looks odd - what are we delaying after?  

> > It need for IC(Amp) issue.

> Right, but what is the issue?  It's not clear what event we're delaying for so it's not clear it'll work properly.

This device requires a delay from mute to power off. If it is turned off while the signal is coming out, it takes some time to become muted. (need to about 50ms). So, this delay is required to turn off the power after completely muting. If the time is too long, we can reduce the delay a bit.

> > > > +static void sma1303_check_fault_worker(struct work_struct *work) {
> > > > +	struct sma1303_priv *sma1303 =
> > > > +		container_of(work, struct sma1303_priv, check_fault_work.work);
> > > > +	int ret = 0;
> > > > +	unsigned int over_temp, ocp_val, uvlo_val;
> > > > +
> > > > +	mutex_lock(&sma1303->lock);

> > > It looks like this mutex is only taken in this function, is it needed?

> > This function is in workqueue. So, I think it can be done at the same time. 

> A given work_struct should only be schedulable once.

Oh, I was wrong. I should remove this. After receiving feedback on the previously sent V3 or if there is no problem, I will include this in V4 and send it. Thanks!

  reply	other threads:[~2023-01-25  2:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  9:14 [PATCH v2 1/2] ASoC: sma1303: Add driver for Iron Device SMA1303 Amp Kiseok Jo
2023-01-09  9:14 ` [PATCH v2 2/2] ASoC: dt-bindings: sma1303: " Kiseok Jo
2023-01-13 15:35   ` Mark Brown
2023-01-13 15:34 ` [PATCH v2 1/2] ASoC: sma1303: Add driver for " Mark Brown
2023-01-19  8:16   ` Ki-Seok Jo
2023-01-19 11:25     ` Mark Brown
2023-01-25  2:12       ` Ki-Seok Jo [this message]
2023-01-25 11:46         ` Mark Brown
2023-01-26  1:28           ` Ki-Seok Jo
2023-01-26  1:34             ` Mark Brown

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=SLXP216MB007747CCA6C43D139712535C8CCE9@SLXP216MB0077.KORP216.PROD.OUTLOOK.COM \
    --to=kiseok.jo@irondevice.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=application@irondevice.com \
    --cc=broonie@kernel.org \
    /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.