From patchwork Fri Oct 24 06:00:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Hsu X-Patchwork-Id: 39404 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 43CE220341 for ; Fri, 24 Oct 2014 06:01:04 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id d1sf216176wiv.2 for ; Thu, 23 Oct 2014 23:01:03 -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=ofwK9k9+OVomv/W+QMvK8kFHYc0tFDWPzVYWKvuUF0g=; b=XQnnUcQ9cmJh8xW3kft403iBA9t4MyJOS6EsjB/sNLRwgBMR512K3TjG1soNaCoLup ASR2Oy5M2hVBMvhwsmy/7ao5rrJoncFBoYQdKspnGQhwaiKW9nn1QzprjpDlUt32zAu+ prQ8SVqAvb905quVqOQFxjIeDClVMwn+9jPxmcytwZ57xwRZ+OM7MZPaDGD3lxDYgQ77 L+XFw5AvLFejdYxzZyqZ8rpzxp24NzqB9kyI7Zw6/CLjO5FRNGPVfPRVls9eeMh9QpSE ghVpxArZ6/s5+0TekCnQI7Caz1+EfhgjV6GqvVrS4pMjdB/SePFbjFb8a9tl5106+0Uh TN1Q== X-Gm-Message-State: ALoCoQmcVKgvgb/qadksBaenTcDb0Biz+gIqzCseClvZhOvF12NUK8TDBr7caRBuix5Fvz9cmJUY X-Received: by 10.112.168.40 with SMTP id zt8mr2000482lbb.0.1414130463444; Thu, 23 Oct 2014 23:01:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.134 with SMTP id b6ls350026laa.77.gmail; Thu, 23 Oct 2014 23:01:03 -0700 (PDT) X-Received: by 10.112.16.195 with SMTP id i3mr2093054lbd.72.1414130463301; Thu, 23 Oct 2014 23:01:03 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id bc10si5497685lab.15.2014.10.23.23.01.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Oct 2014 23:01:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id pn19so2294609lab.0 for ; Thu, 23 Oct 2014 23:01:02 -0700 (PDT) X-Received: by 10.152.29.8 with SMTP id f8mr2126999lah.56.1414130462888; Thu, 23 Oct 2014 23:01:02 -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 c5csp374973lbz; Thu, 23 Oct 2014 23:01:01 -0700 (PDT) X-Received: by 10.70.33.73 with SMTP id p9mr2324337pdi.103.1414130461147; Thu, 23 Oct 2014 23:01:01 -0700 (PDT) Received: from Kraken ([124.219.7.128]) by mx.google.com with ESMTP id tp6si3301015pbc.215.2014.10.23.23.00.59 for ; Thu, 23 Oct 2014 23:01:01 -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 2876A6A27A3; Fri, 24 Oct 2014 14:00:50 +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 3/9] ASOC: wm8971: use SOC_ENUM_SINGLE_DECL to replace SOC_ENUM_SINGLE Date: Fri, 24 Oct 2014 14:00:29 +0800 Message-Id: <1414130435-14183-3-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.41 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 uses SOC_ENUM_SINGLE_DECL macro to replace SOC_ENUM_SINGLE macro for easing reading and maintaining. Signed-off-by: Xavier Hsu Signed-off-by: Andy Green --- sound/soc/codecs/wm8971.c | 63 +++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c index 6df0a3b..b8b6be9 100755 --- a/sound/soc/codecs/wm8971.c +++ b/sound/soc/codecs/wm8971.c @@ -183,22 +183,29 @@ static int wm8971_put_deemph(struct snd_kcontrol *kcontrol, return ret; } -static const struct soc_enum wm8971_enum[] = { - SOC_ENUM_SINGLE(WM8971_BASS, 7, 2, wm8971_bass), /* 0 */ - SOC_ENUM_SINGLE(WM8971_BASS, 6, 2, wm8971_bass_filter), - SOC_ENUM_SINGLE(WM8971_TREBLE, 6, 2, wm8971_treble), - SOC_ENUM_SINGLE(WM8971_ALC1, 7, 4, wm8971_alc_func), - SOC_ENUM_SINGLE(WM8971_NGATE, 1, 2, wm8971_ng_type), /* 4 */ - SOC_ENUM_SINGLE(WM8971_ADCDAC, 1, 4, wm8971_deemp), - SOC_ENUM_SINGLE(WM8971_ADCTL1, 4, 4, wm8971_mono_mux), - SOC_ENUM_SINGLE(WM8971_ADCTL1, 1, 2, wm8971_dac_phase), - SOC_ENUM_SINGLE(WM8971_LOUTM1, 0, 5, wm8971_lline_mux), /* 8 */ - SOC_ENUM_SINGLE(WM8971_ROUTM1, 0, 5, wm8971_rline_mux), - SOC_ENUM_SINGLE(WM8971_LADCIN, 6, 4, wm8971_lpga_sel), - SOC_ENUM_SINGLE(WM8971_RADCIN, 6, 4, wm8971_rpga_sel), - SOC_ENUM_SINGLE(WM8971_ADCDAC, 5, 4, wm8971_adcpol), /* 12 */ - SOC_ENUM_SINGLE(WM8971_ADCIN, 6, 4, wm8971_mono_mux), -}; +static const SOC_ENUM_SINGLE_DECL(bass_boost, WM8971_BASS, 7, wm8971_bass); +static const SOC_ENUM_SINGLE_DECL(bass_filter, WM8971_BASS, + 6, wm8971_bass_filter); +static const SOC_ENUM_SINGLE_DECL(treble_cutoff, WM8971_TREBLE, + 6, wm8971_treble); +static const SOC_ENUM_SINGLE_DECL(alc_capture_func, WM8971_ALC1, + 7, wm8971_alc_func); +static const SOC_ENUM_SINGLE_DECL(alc_capture_ngtype, WM8971_NGATE, + 1, wm8971_ng_type); +static const SOC_ENUM_SINGLE_DECL(dac_mono_mix, WM8971_ADCTL1, + 4, wm8971_mono_mux); +static const SOC_ENUM_SINGLE_DECL(dac_phase_inv, WM8971_ADCTL1, + 1, wm8971_dac_phase); +static const SOC_ENUM_SINGLE_DECL(left_line, WM8971_LOUTM1, + 0, wm8971_lline_mux); +static const SOC_ENUM_SINGLE_DECL(right_line, WM8971_ROUTM1, + 0, wm8971_rline_mux); +static const SOC_ENUM_SINGLE_DECL(left_pga, WM8971_LADCIN, 6, wm8971_lpga_sel); +static const SOC_ENUM_SINGLE_DECL(right_pga, WM8971_RADCIN, + 6, wm8971_rpga_sel); +static const SOC_ENUM_SINGLE_DECL(capture_polarity, WM8971_ADCDAC, + 5, wm8971_adcpol); +static const SOC_ENUM_SINGLE_DECL(monomux, WM8971_ADCIN, 6, wm8971_mono_mux); static const struct snd_kcontrol_new wm8971_snd_controls[] = { SOC_DOUBLE_R("Capture Volume", WM8971_LINVOL, WM8971_RINVOL, 0, 63, 0), @@ -226,12 +233,12 @@ static const struct snd_kcontrol_new wm8971_snd_controls[] = { SOC_DOUBLE_R("Speaker Playback Volume", WM8971_LOUT2V, WM8971_ROUT2V, 0, 127, 0), - SOC_ENUM("Bass Boost", wm8971_enum[0]), - SOC_ENUM("Bass Filter", wm8971_enum[1]), + SOC_ENUM("Bass Boost", bass_boost), + SOC_ENUM("Bass Filter", bass_filter), SOC_SINGLE("Bass Volume", WM8971_BASS, 0, 7, 1), SOC_SINGLE("Treble Volume", WM8971_TREBLE, 0, 7, 0), - SOC_ENUM("Treble Cut-off", wm8971_enum[2]), + SOC_ENUM("Treble Cut-off", treble_cutoff), SOC_SINGLE("Capture Filter Switch", WM8971_ADCDAC, 0, 1, 1), @@ -240,13 +247,13 @@ static const struct snd_kcontrol_new wm8971_snd_controls[] = { SOC_SINGLE("ALC Capture Target Volume", WM8971_ALC1, 0, 7, 0), SOC_SINGLE("ALC Capture Max Volume", WM8971_ALC1, 4, 7, 0), - SOC_ENUM("ALC Capture Function", wm8971_enum[3]), + SOC_ENUM("ALC Capture Function", alc_capture_func), SOC_SINGLE("ALC Capture ZC Switch", WM8971_ALC2, 7, 1, 0), SOC_SINGLE("ALC Capture Hold Time", WM8971_ALC2, 0, 15, 0), SOC_SINGLE("ALC Capture Decay Time", WM8971_ALC3, 4, 15, 0), SOC_SINGLE("ALC Capture Attack Time", WM8971_ALC3, 0, 15, 0), SOC_SINGLE("ALC Capture NG Threshold", WM8971_NGATE, 3, 31, 0), - SOC_ENUM("ALC Capture NG Type", wm8971_enum[4]), + SOC_ENUM("ALC Capture NG Type", alc_capture_ngtype), SOC_SINGLE("ALC Capture NG Switch", WM8971_NGATE, 0, 1, 0), SOC_SINGLE("Capture 6dB Attenuate", WM8971_ADCDAC, 8, 1, 0), @@ -254,8 +261,8 @@ static const struct snd_kcontrol_new wm8971_snd_controls[] = { SOC_SINGLE_BOOL_EXT("Playback De-emphasis Switch", 0, wm8971_get_deemph, wm8971_put_deemph), - SOC_ENUM("Playback Function", wm8971_enum[6]), - SOC_ENUM("Playback Phase", wm8971_enum[7]), + SOC_ENUM("Playback Function", dac_mono_mix), + SOC_ENUM("Playback Phase", dac_phase_inv), SOC_DOUBLE_R("Mic Boost", WM8971_LADCIN, WM8971_RADCIN, 4, 3, 0), }; @@ -290,23 +297,23 @@ SOC_DAPM_SINGLE("Right Bypass Switch", WM8971_MOUTM2, 7, 1, 0), /* Left Line Mux */ static const struct snd_kcontrol_new wm8971_left_line_controls = -SOC_DAPM_ENUM("Route", wm8971_enum[8]); +SOC_DAPM_ENUM("Route", left_line); /* Right Line Mux */ static const struct snd_kcontrol_new wm8971_right_line_controls = -SOC_DAPM_ENUM("Route", wm8971_enum[9]); +SOC_DAPM_ENUM("Route", right_line); /* Left PGA Mux */ static const struct snd_kcontrol_new wm8971_left_pga_controls = -SOC_DAPM_ENUM("Route", wm8971_enum[10]); +SOC_DAPM_ENUM("Route", left_pga); /* Right PGA Mux */ static const struct snd_kcontrol_new wm8971_right_pga_controls = -SOC_DAPM_ENUM("Route", wm8971_enum[11]); +SOC_DAPM_ENUM("Route", right_pga); /* Mono ADC Mux */ static const struct snd_kcontrol_new wm8971_monomux_controls = -SOC_DAPM_ENUM("Route", wm8971_enum[13]); +SOC_DAPM_ENUM("Route", monomux); static const struct snd_soc_dapm_widget wm8971_dapm_widgets[] = { SND_SOC_DAPM_MIXER("Left Mixer", SND_SOC_NOPM, 0, 0,