From patchwork Fri Oct 24 06:00:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Hsu X-Patchwork-Id: 39408 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5366520341 for ; Fri, 24 Oct 2014 06:01:17 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id mc6sf430098lab.8 for ; Thu, 23 Oct 2014 23:01:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=LuHqQT1hAwww9u09lfouHdPwvgclMKkSRY2sw6nMKU4=; b=FPDMk97Wm+rxoyyDSgvr1JQNdwTCSm4Fct2oaMeO+pBmW7W2lIfBUiGHckHWNWDN1f 6kkU5bYqfnHE2BKGh6x0hL0MbiECIY+3qt1gsN9wEFq4V94s8Q63DVq1QIm0P5Csqg8u jt/cHdcdCVilLff3sOUPF4j0cHMitjRd0B/+YSb+NI7ofj0G/VTIL0Ap5GAfMNJn0Uzd xfobsDj/oXIlmQPQidwYNPp+BY1a9dw4r3sus1AjoW3XL013m4Eb6zcbpZPpKumPZ2xe 1CC34SP4QSpQho+Jvml6EqGJAJP39+584vfrHZBXjmKDyOPVs7LZEd0gdTyU2aF4K5j0 BNww== X-Gm-Message-State: ALoCoQleQIzqXXCbSN89fi8+qDoQKpaWp668b97ZupkdZykO0wyYKfrLUTg8D/FRJ5jydvaIksRS X-Received: by 10.112.147.131 with SMTP id tk3mr1997345lbb.2.1414130476131; Thu, 23 Oct 2014 23:01:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.134 with SMTP id s6ls88529las.27.gmail; Thu, 23 Oct 2014 23:01:15 -0700 (PDT) X-Received: by 10.152.205.103 with SMTP id lf7mr2189098lac.2.1414130475903; Thu, 23 Oct 2014 23:01:15 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id wx5si5375387lbb.123.2014.10.23.23.01.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Oct 2014 23:01:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id gf13so646602lab.22 for ; Thu, 23 Oct 2014 23:01:15 -0700 (PDT) X-Received: by 10.152.116.102 with SMTP id jv6mr2148367lab.40.1414130475455; Thu, 23 Oct 2014 23:01:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.84.229 with SMTP id c5csp374997lbz; Thu, 23 Oct 2014 23:01:14 -0700 (PDT) X-Received: by 10.70.20.66 with SMTP id l2mr2509824pde.106.1414130473938; Thu, 23 Oct 2014 23:01:13 -0700 (PDT) Received: from Kraken ([124.219.7.128]) by mx.google.com with ESMTP id a6si3401694pdk.105.2014.10.23.23.01.12 for ; Thu, 23 Oct 2014 23:01:13 -0700 (PDT) Received-SPF: temperror (google.com: error in processing during lookup of xavier@kraken: DNS timeout) client-ip=124.219.7.128; Received: by Kraken (Postfix, from userid 1011) id 8F8F76A27AA; Fri, 24 Oct 2014 14:01:03 +0800 (CST) From: Xavier Hsu To: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, patches@linaro.org Cc: lars@metafoo.de, ckeepax@opensource.wolfsonmicro.com, Xavier Hsu , Andy Green Subject: [PATCHv5 7/9] ASOC: wm8971: use msleep to replace work queue Date: Fri, 24 Oct 2014 14:00:33 +0800 Message-Id: <1414130435-14183-7-git-send-email-xavier.hsu@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414130435-14183-1-git-send-email-xavier.hsu@linaro.org> References: <1414130435-14183-1-git-send-email-xavier.hsu@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: xavier.hsu@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We use msleep to replace work queue. "As suggested by Mark Brown" Signed-off-by: Xavier Hsu Signed-off-by: Andy Green --- sound/soc/codecs/wm8971.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c index 7663de4..85314fb 100755 --- a/sound/soc/codecs/wm8971.c +++ b/sound/soc/codecs/wm8971.c @@ -36,8 +36,6 @@ #define WM8971_REG_COUNT 43 -static struct workqueue_struct *wm8971_workq; - /* codec private data */ struct wm8971_priv { /* MCLK */ @@ -779,16 +777,6 @@ static struct snd_soc_dai_driver wm8971_dai = { .ops = &wm8971_dai_ops, }; -static void wm8971_work(struct work_struct *work) -{ - struct snd_soc_dapm_context *dapm = - container_of(work, struct snd_soc_dapm_context, - delayed_work.work); - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); - - wm8971_set_bias_level(codec, codec->dapm.bias_level); -} - static int wm8971_suspend(struct snd_soc_codec *codec) { wm8971_set_bias_level(codec, SND_SOC_BIAS_OFF); @@ -806,8 +794,8 @@ static int wm8971_resume(struct snd_soc_codec *codec) reg = snd_soc_read(codec, WM8971_PWR1) & 0xfe3e; snd_soc_write(codec, WM8971_PWR1, reg | 0x01c0); codec->dapm.bias_level = SND_SOC_BIAS_ON; - queue_delayed_work(wm8971_workq, &codec->dapm.delayed_work, - msecs_to_jiffies(1000)); + msleep(1000); + wm8971_set_bias_level(codec, codec->dapm.bias_level); } return 0; @@ -818,19 +806,14 @@ static int wm8971_probe(struct snd_soc_codec *codec) int ret = 0; u16 reg; - INIT_DELAYED_WORK(&codec->dapm.delayed_work, wm8971_work); - wm8971_workq = create_workqueue("wm8971"); - if (wm8971_workq == NULL) - return -ENOMEM; - wm8971_reset(codec); /* charge output caps - set vmid to 5k for quick power up */ reg = snd_soc_read(codec, WM8971_PWR1) & 0xfe3e; snd_soc_write(codec, WM8971_PWR1, reg | 0x01c0); codec->dapm.bias_level = SND_SOC_BIAS_STANDBY; - queue_delayed_work(wm8971_workq, &codec->dapm.delayed_work, - msecs_to_jiffies(1000)); + msleep(1000); + wm8971_set_bias_level(codec, codec->dapm.bias_level); /* set the update bits */ snd_soc_update_bits(codec, WM8971_LDAC, 0x0100, 0x0100); @@ -850,8 +833,6 @@ static int wm8971_remove(struct snd_soc_codec *codec) { wm8971_set_bias_level(codec, SND_SOC_BIAS_OFF); - if (wm8971_workq) - destroy_workqueue(wm8971_workq); return 0; }