From patchwork Fri Jan 8 08:57:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zidan Wang X-Patchwork-Id: 7983431 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4D8A7BEEE5 for ; Fri, 8 Jan 2016 08:54:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77FD12014A for ; Fri, 8 Jan 2016 08:54:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E602C20108 for ; Fri, 8 Jan 2016 08:54:48 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A8C5D265A21; Fri, 8 Jan 2016 09:54:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 72FDC260421; Fri, 8 Jan 2016 09:54:39 +0100 (CET) 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 7B97626581A; Fri, 8 Jan 2016 09:54:38 +0100 (CET) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0126.outbound.protection.outlook.com [65.55.169.126]) by alsa0.perex.cz (Postfix) with ESMTP id E4CE326040E for ; Fri, 8 Jan 2016 09:54:30 +0100 (CET) Received: from BN3PR0301CA0069.namprd03.prod.outlook.com (10.160.152.165) by DM2PR0301MB1262.namprd03.prod.outlook.com (10.160.219.27) with Microsoft SMTP Server (TLS) id 15.1.361.13; Fri, 8 Jan 2016 08:54:24 +0000 Received: from BN1BFFO11FD051.protection.gbl (2a01:111:f400:7c10::1:104) by BN3PR0301CA0069.outlook.office365.com (2a01:111:e400:401e::37) with Microsoft SMTP Server (TLS) id 15.1.365.19 via Frontend Transport; Fri, 8 Jan 2016 08:54:24 +0000 Authentication-Results: spf=permerror (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; Received-SPF: PermError (protection.outlook.com: domain of freescale.com used an invalid SPF mechanism) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD051.mail.protection.outlook.com (10.58.145.6) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Fri, 8 Jan 2016 08:54:23 +0000 Received: from b50113.ap.freescale.net (b50113.ap.freescale.net [10.192.241.68]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u088sHIu025892; Fri, 8 Jan 2016 01:54:18 -0700 From: Zidan Wang To: Date: Fri, 8 Jan 2016 16:57:01 +0800 Message-ID: <3d52a0f560ed565ca81da1d041744e1814d7b561.1452243300.git.zidan.wang@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD051; 1:3TAn9fpx+o4tftOGjTKajcqzptxvfgeaA60x68V7ddh+4Pk9Bt28FCefyKZaTJ847X+cdbkFMyZmvbkx8QMYNtZcCy1VpUECtIk6Xpb8GCyfOHpGqJQvw6TBDWcSQt9JXkBuAjAS2MvKE+fvyh5I0R78Bpair/aCcFnHylNzpJg4BzhvIr6OAhqlLLqCE/+elNpUEvShS4iSxaqRhxmJgR597DCUPmWhirlFECK7NXvAMNlGIKIDFcqhjSQYK7WG+4ASWgTSOXETgz+nnLVrt5Wy4heQPDYmJ2YNd/YmGDEM8mehi4TwZnNuCVg0RrTuSrtnVDXLMG1/YPGT3MwxLEXvkHWFPCdsAJCUV7XUFcVHQ5APwmudInhPmHuhpLwqUKScf5uAi8ccJWT0F4Ty5X5ul4dBpX4bbkWdAGAwo/cKJRf6tJs48Oqn2M27+gz4RGi/itzmjw9h00aGy6kL1g== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(979002)(6009001)(2980300002)(448002)(3190300001)(189002)(199003)(5001960100002)(33646002)(48376002)(86362001)(118296001)(77096005)(50466002)(229853001)(36756003)(106466001)(2351001)(87936001)(85326001)(110136002)(189998001)(50226001)(4326007)(5003940100001)(81156007)(107886002)(1096002)(586003)(1220700001)(104016004)(47776003)(4001430100002)(2906002)(5008740100001)(92566002)(97736004)(50986999)(19580405001)(11100500001)(19580395003)(6806005)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB1262; H:tx30smr01.am.freescale.net; FPR:; SPF:PermError; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1262; 2:wYAhS8kx1M16eqCvTXa3ASn6rjW0flKQ0VCQHeCIWZHpmfKRozWceZkHX2A/g3llb3LWMiOo+ZvGstVLyd1SYImtd0tvJVhEYfjE7++0tNJmE1bhTLuhinepMWlZae3T/BVgVZC73URQmJtXx1vzEA==; 3:MjlKTWZcBoMxSMq/STZs5YPkZjEXWs+kWCOcKOCthgSeMFNJO6r3dnD5V7YA06qDcP/0fv9egN/qjZUhz/MBcQ78hzmC/kiFnia+B1z4NjLX8LXW19NV+7NtnHHs7CtBSLxITrkpQ4tj4rSTjdzAgXyumtmxkFM5BqSuKmNpieJr4TrGMBrMCQjiRlhUmQd+fuOH6aNVYhYTUeGvqAhEb+WqmXVZqQySInpzPwncf48=; 25:nV4apCfKfS7iMab4siIEViAu3uMJHyNHNlr1gGvaFZJH63pQwkAN10OIFJ+JsPnNW6ETUpSYlTgqYqGUwr9+X5GTzBMHoUYt1EOz5el0xOI5Dy9wILNN/5F1FpIFLsxjROOGNPESbQyRSgZqyv5ByXyztwM8mrzTmNFDxe0TF6AU3mG8kSR0sgn1xp4dnRXyE9DlEHDXu22T7vV7mArCqGtvSFKvcOVX+JxHsBRIHRl7JIs8e/Jm5mUOja/rRbCc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1262; X-MS-Office365-Filtering-Correlation-Id: 582133ec-483c-444b-9abd-08d318094ece X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1262; 20:NJBqL1tGpqz1TrBB70Nqiw82Q6InvyvU/pRGcm1EKeRu6XslUTGVRbXfQ64ouBJ4Am882EZfYf2yXzTs7jUuC5gR4NpyE4aK0MqpBSbzrX5PEwcJUTHm4Az1S9lc+HDrpj8UsN2WWYWWeIc06TDqu1gAC5xYIgmBfSO90Zpkvhd5crFjJuTl/mu7SzqsF+aRlQX5l+PkBYGfykisky7wvfGUi6N+mlIcpzcinq9HWkecaK4UWUb19w3VJeDMUNmouV125phjnABnR1M7reORSU03i3zq2QfzwMcZR/zdFXWU9FDkAgk2PvX2Y6DdsmJubz/3CmXzLST4t0LLpsT/QebPusS6wIkFPXeMUKmEdVvpp/5mWObT1Sez39/tg0j0U138aTMq+QDS8nAz9wAkdgrlqfVWLaH/Ed1xQwDPBI73eIgJ+cSMxFEAULTgjWsi; 4:GIQG/sSwvxce6TQc7cXwr0yiTr+jGEEpg3Mfka+uLLuCoH/v6n2y2+vs395pq7CY596XtyvP0dIofvc9i+MON5JoIBx3MN2nFQmJr8em4+3zm0i/4Vt7oy4ybeNBEcUaIUblMr5Vl9jLUrEyM6KrbkmObDscB6CTakFHdzmp7pEnLAybI7Clh+oikqiaOLHJnpm+hsRB6hhb/RIbsGfOeJNqov/NX7JEQdNFDxOh92nirMH6TKYT90nZz0GUAKnZZ0k9s8peeisIql/fz709Tl4K1j3OtTSARBCzrHbJ8rQ9G+6SP6GXnQXxFj9KA1yZGTqE8MB6jFr+0mSsPoaHiB79i/HOsTDqtBwh1z65wnQPluqhFir96OE4jvfJRJQjoplw0po1dCIKWhKIm4oTu/SpqJYiEWl2Epm0y0ViNImRzjDIBJiQlNnB/lvH29QISFe59hNVC6+2pQK+O1LIiA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(13015025)(13017025)(5005006)(3002001)(10201501046); SRVR:DM2PR0301MB1262; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB1262; X-Forefront-PRVS: 0815F8251E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB1262; 23:xChlqL/IqYPESMQLm95ljCfvIjPJsxfzfch0Uff?= =?us-ascii?Q?6fvAan2STWJrWxuN3qRrjHbk52659VWlkPT9kmGduXtmfiXQ8C6ACogLpaGz?= =?us-ascii?Q?1+DLi20JO8hd3zFFEq1SM0s/RxapdsYvKMUK0I/sBiTZUu6yDqR19mh8fdr5?= =?us-ascii?Q?bQRKnmnNpHAU5ZTv9VX2E3jj3OGdaXkzCznV4PH3BNWp7iyo8JOgwo/yzLBY?= =?us-ascii?Q?IcWty5h2gegW/MFdz+xREcRd7tjYkfd8N4RC8K069T7U9RIuAegbROU2fcHF?= =?us-ascii?Q?n7asqLMX9jZw6HB4Vfpseci0YhTiP0XWeiiyrqWPMwavkbo+OrxtOf2FhVTU?= =?us-ascii?Q?12siwuwKtf5Kwj0srPvQXmH/X3y6m5cuCJrw4dFja9uX5biPMlC1E8xeUIv5?= =?us-ascii?Q?UoYYRMvRiAFP5h2nFR8SCKBTzij1dr3KmYFK1tY+IY3rEO0yZBYK3lkqbMi2?= =?us-ascii?Q?tA9W/q7onsYcCTprUQ6WG1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 24:NTwwIcXLhFVtlymmqh9m9yR3lGHRSoWScPkd3Cxx3djN4IeGlviNIbZQA0oSrhBEqjUMM6EnLKyUc0e+xfmnQe4Ksi+QOi5F7Li2x/grpfA= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2016 08:54:23.6883 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB1262 Cc: alsa-devel@alsa-project.org, Zidan Wang , patches@opensource.wolfsonmicro.com, tiwai@suse.com, ckeepax@opensource.wolfsonmicro.com Subject: [alsa-devel] [PATCH] ASoC: wm8960: add DAC mono mix kcontrol 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 In normal operation, the left and right channel digital audio data is converted to analogue in two separate DACs. There is a mono-mix mode where the two audio channels are mixed together digitally and then converted to analogue using only one DAC, while the other DAC is switched off. The mono-mix signal can be selected to appear on both analogue output channels. The mono mix is automatically attenuated by 6dB to prevent clipping. Signed-off-by: Zidan Wang Acked-by: Charles Keepax --- sound/soc/codecs/wm8960.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 162def8..029031b 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -153,6 +153,7 @@ static const char *wm8960_adc_data_output_sel[] = { "Left Data = Right ADC; Right Data = Right ADC", "Left Data = Right ADC; Right Data = Left ADC", }; +static const char *wm8960_dmonomix[] = {"Stereo", "Mono"}; static const struct soc_enum wm8960_enum[] = { SOC_ENUM_SINGLE(WM8960_DACCTL1, 5, 4, wm8960_polarity), @@ -162,6 +163,7 @@ static const struct soc_enum wm8960_enum[] = { SOC_ENUM_SINGLE(WM8960_ALC1, 7, 4, wm8960_alcfunc), SOC_ENUM_SINGLE(WM8960_ALC3, 8, 2, wm8960_alcmode), SOC_ENUM_SINGLE(WM8960_ADDCTL1, 2, 4, wm8960_adc_data_output_sel), + SOC_ENUM_SINGLE(WM8960_ADDCTL1, 4, 2, wm8960_dmonomix), }; static const int deemph_settings[] = { 0, 32000, 44100, 48000 }; @@ -304,6 +306,7 @@ SOC_SINGLE_TLV("Right Output Mixer RINPUT3 Volume", WM8960_ROUTMIX, 4, 7, 1, bypass_tlv), SOC_ENUM("ADC Data Output Select", wm8960_enum[6]), +SOC_ENUM("DAC Mono Mix", wm8960_enum[7]), }; static const struct snd_kcontrol_new wm8960_lin_boost[] = {