From patchwork Thu Jul 30 02:24:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 6897971 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 578AF9F380 for ; Thu, 30 Jul 2015 02:24:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70CC920591 for ; Thu, 30 Jul 2015 02:24:30 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1E1082058A for ; Thu, 30 Jul 2015 02:24:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8F527265A72; Thu, 30 Jul 2015 04:24:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 31D91260688; Thu, 30 Jul 2015 04:24:20 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4F1EF265A23; Thu, 30 Jul 2015 04:24:18 +0200 (CEST) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by alsa0.perex.cz (Postfix) with ESMTP id 19402260687 for ; Thu, 30 Jul 2015 04:24:10 +0200 (CEST) Received: by pdbnt7 with SMTP id nt7so15759300pdb.0 for ; Wed, 29 Jul 2015 19:24:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=U1bQGOyJ/Oyy+y1ReNg7DELzLFZw9iNMNerRl8LKp6o=; b=c/lSkuPCf7VRVFJJ3pn45XEC7nDWD4AE2kesC/TQ963rGO1qv8pQoYf9I/0TfPmnOT NMihgv/ZdPPcgdPQJVeRQ7qZfC+KOopVngCPU6fK2Aw8GBCNG8ZL8zgn/kxpCDWrH0s3 pb1v/5O6nkhVb9/ZJHePc3gFygwIygYwt3gCjDe9T3j3TzL8Bqg7fyoXBLhwcPSw8cuv vw6a+DD9vkTyWrLvuCOqFaLKL+c/6DyKxRlLF6tPy2sTczREHeZjkLqxVTj//PfBzUjK LVvbM6evgggyfbrq8HSR6HKamOqwr5TBKA9mtW0kQDmcz+zhrB3K+wNyRPapCdvHG1sh V4AA== X-Gm-Message-State: ALoCoQkdHLpxNUrf5BhI0ZryEuywakJ0lyqTjECQoDUIHjC490+WuWNNAhcuxhjnqNP4+XNS1PYv X-Received: by 10.70.87.231 with SMTP id bb7mr100797402pdb.70.1438223049400; Wed, 29 Jul 2015 19:24:09 -0700 (PDT) Received: from phoenix.local (36-239-223-128.dynamic-ip.hinet.net. [36.239.223.128]) by smtp.gmail.com with ESMTPSA id ex13sm43325459pac.17.2015.07.29.19.24.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2015 19:24:08 -0700 (PDT) Message-ID: <1438223043.17273.0.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Thu, 30 Jul 2015 10:24:03 +0800 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Cc: Charles Keepax , patches@opensource.wolfsonmicro.com, Liam Girdwood , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] ASoC: wm8741: Simplify wm8741_set_dai_sysclk implementation X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Axel Lin Acked-by: Charles Keepax --- sound/soc/codecs/wm8741.c | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c index 430fa7d..9723e44 100644 --- a/sound/soc/codecs/wm8741.c +++ b/sound/soc/codecs/wm8741.c @@ -278,51 +278,38 @@ static int wm8741_set_dai_sysclk(struct snd_soc_dai *codec_dai, switch (freq) { case 0: wm8741->sysclk_constraints = NULL; - wm8741->sysclk = freq; - return 0; - + break; case 11289600: wm8741->sysclk_constraints = &constraints_11289; - wm8741->sysclk = freq; - return 0; - + break; case 12288000: wm8741->sysclk_constraints = &constraints_12288; - wm8741->sysclk = freq; - return 0; - + break; case 16384000: wm8741->sysclk_constraints = &constraints_16384; - wm8741->sysclk = freq; - return 0; - + break; case 16934400: wm8741->sysclk_constraints = &constraints_16934; - wm8741->sysclk = freq; - return 0; - + break; case 18432000: wm8741->sysclk_constraints = &constraints_18432; - wm8741->sysclk = freq; - return 0; - + break; case 22579200: case 33868800: wm8741->sysclk_constraints = &constraints_22579; - wm8741->sysclk = freq; - return 0; - + break; case 24576000: wm8741->sysclk_constraints = &constraints_24576; - wm8741->sysclk = freq; - return 0; - + break; case 36864000: wm8741->sysclk_constraints = &constraints_36864; - wm8741->sysclk = freq; - return 0; + break; + default: + return -EINVAL; } - return -EINVAL; + + wm8741->sysclk = freq; + return 0; } static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,