From patchwork Mon Dec 1 06:51:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Hsu X-Patchwork-Id: 41751 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6BB3F20672 for ; Mon, 1 Dec 2014 06:52:53 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf2656109lab.5 for ; Sun, 30 Nov 2014 22:52:52 -0800 (PST) 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=CprWUmUqAeVULqC5qjJrzwpIM5c6RFEG25Z9W6wnLjQ=; b=KPqN+s/TCdoMzu0g41wWgW4zRehwr7QSYqvqb6m0SYbC6ZVjFq26E5+EkJqmhUTBFt 7k1O6a8nmr9jcSwSBjubyzfNKiQm8ZPMvL9vi7Uw50Y2mNGePGEGTWZcK42wKnkL3DuR KD1xwGZa2j8+Eyb3oc7AdRYD9Bq54JvoIUqFhgSnASaq5MShiyV6gKoHIKbPQM7UyrdQ Qgwcw9JN2B2HCMXnImSnY4Vaj5Nw0U7QsPz3Dr4d8ouyfbG2SZ5nRnr7Ojiwx8VK/u1J BYt2GOD341JcO0cS5DNh68pf8jSGH/79VGiZ+eSGlDHAvt0YEaD4nugWqcj97bgrUshb AOTw== X-Gm-Message-State: ALoCoQl85UW2ePrXPBgTKt05Q3yVc/akxO+MysYJArRv12cZ0Dg4sIJsHGGhN3i5lUkF0aX9Pu9B X-Received: by 10.112.151.38 with SMTP id un6mr15406452lbb.0.1417416772521; Sun, 30 Nov 2014 22:52:52 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.130 with SMTP id d2ls1229987laf.32.gmail; Sun, 30 Nov 2014 22:52:52 -0800 (PST) X-Received: by 10.152.203.137 with SMTP id kq9mr54930836lac.51.1417416772041; Sun, 30 Nov 2014 22:52:52 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id kz1si16749154lbc.63.2014.11.30.22.52.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 30 Nov 2014 22:52:52 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so8120254lbi.29 for ; Sun, 30 Nov 2014 22:52:52 -0800 (PST) X-Received: by 10.112.38.4 with SMTP id c4mr39604697lbk.46.1417416771968; Sun, 30 Nov 2014 22:52:51 -0800 (PST) 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.184.201 with SMTP id ew9csp236486lbc; Sun, 30 Nov 2014 22:52:49 -0800 (PST) X-Received: by 10.70.33.106 with SMTP id q10mr46295709pdi.120.1417416761375; Sun, 30 Nov 2014 22:52:41 -0800 (PST) Received: from Kraken ([124.219.7.128]) by mx.google.com with ESMTP id r11si27340135pdl.210.2014.11.30.22.52.39 for ; Sun, 30 Nov 2014 22:52:41 -0800 (PST) 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 AE7026A2A50; Mon, 1 Dec 2014 14:52:15 +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: [PATCHv6 7/9] ASOC: wm8971: use msleep to replace work queue Date: Mon, 1 Dec 2014 14:51:59 +0800 Message-Id: <1417416721-17271-7-git-send-email-xavier.hsu@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1417416721-17271-1-git-send-email-xavier.hsu@linaro.org> References: <1417416721-17271-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.217.170 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 1f3abbb..60139bc 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 */ @@ -780,16 +778,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); @@ -807,8 +795,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; @@ -819,19 +807,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); @@ -851,8 +834,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; }