Received: by 10.213.65.68 with SMTP id h4csp2113870imn; Sun, 8 Apr 2018 20:03:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/xQC2/WTJc6Qwbq4WPO4IazXCSCJg1xIYqxZ2kRLienPfU3JfH7u+Rj6dHXp4DpIpcFvLN X-Received: by 10.98.205.69 with SMTP id o66mr27937503pfg.34.1523243037869; Sun, 08 Apr 2018 20:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243037; cv=none; d=google.com; s=arc-20160816; b=yNgrt6yUuNL+5L257kLwzK4zdcmBRf6WosExOFweKx4i5rbAUZLDRF2D4PlGozzy5y 066RiMTISgQ5+QnqcHI9MsCLqVrAblV5k4unXgCAOBmpIPG+g4UQ4f8UG1SVs79bbLgo 0qiu+naT50U0zz5F9pu4UtAJQhzKv8wFT0VOHVhZAtDVeZnh+kQfpptzjN/jfJpwfggm dIb1R3hcnOPW9WJP3mEzAaHP2xMSGjrmjbrLxbIYsEvogvvslkOAH62aAf5y/jR0Nk9S S0R0kiV8FAyh09ko6+tJHZPFntv8T5O9jsKfQ6zQIJugXGiR2ODhyR/k9nTuHxTlgQ95 5tRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=hIuzdwoX623vBV2hcw2yQwELBT9grYXWIKjk2orQQlM=; b=OnYpg+Oim31E0KoEKWz272aZVg/aSoWIC3FncXfcfbma+HHIgVRiYgYFYnJgEmLbII PKpgQD80aNMHzqAKtuvksl3M2PwNKK8mtQ1qs8F4mK4oPl+13j0U/vUjWvtavZ0SXRv2 lm2t9VeV3kOKLimpwT979r2EqYk1W32lXr5ln77LZntFXlRZ2vlFHS7VgnPOHXcIM0fY mbYEPsHPc1YtrPF1Dv6v4BWMb8tpqSxtsKnv7j9TSwj3E3aOMUzqwxI+jRWmVE/kGKcn DercezT6yfDxo/sl+ZCDroBZeNlUkQi3vP1Ml6uw+W29mXF4i2xLawKwctVL3AxaDrB0 k8gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ZRWD33Wj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x25si10339961pgc.234.2018.04.08.20.03.20; Sun, 08 Apr 2018 20:03:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ZRWD33Wj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756101AbeDIAaf (ORCPT + 99 others); Sun, 8 Apr 2018 20:30:35 -0400 Received: from mail-dm3nam03on0104.outbound.protection.outlook.com ([104.47.41.104]:17478 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756080AbeDIAa2 (ORCPT ); Sun, 8 Apr 2018 20:30:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=hIuzdwoX623vBV2hcw2yQwELBT9grYXWIKjk2orQQlM=; b=ZRWD33WjFy46MCD7outPVHLCViYH77YzbIaAZju6V22sbd4/T1lIhEBMBxXWrcExtUVUITGjySYVk/eoJQoQb5XOOyhEH7ziysLtb3DUz9hpVdu8yA5WtZGXChVSx7jA/Tmc867aTU86bz4R6OwE8p3NkGdKDkV1ZfDu/p3/tDw= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0807.namprd21.prod.outlook.com (10.167.110.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.3; Mon, 9 Apr 2018 00:30:23 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:30:23 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: John Hsu , John Hsu , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 134/293] ASoC: nau8825: fix jack type detection issue after resume Thread-Topic: [PATCH AUTOSEL for 4.9 134/293] ASoC: nau8825: fix jack type detection issue after resume Thread-Index: AQHTz5kkWQ3I7JwLFkyqfkLhZpSplA== Date: Mon, 9 Apr 2018 00:24:37 +0000 Message-ID: <20180409002239.163177-134-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0807;7:Z2IzJa2L1JGgvkkqqBYmYb7gGtnaSsH76GlR3WyEqbevC7a+iZ9ZG0/cercMkCUej/A1ywSAw/EgQ8szPnDcsHCo1uXz/foucSPSFwh3h2S7ZvynyjTJKtXGmhUC+0ApmccwVgBR4Sx9BxoybcYyMtN6pL54C/4B9mlr/CH9N72mUOF07dD0qf3ZH3Ru2SGW5Gv0sm5/ip/DxnjziYBkMjT6vMsyYGqVsKRR9yUR3Phe9yN3mWWKPvkDZzuUapKN;20:iq4GOFTUpnOlfLpcYUxhz2uNMuyQ6Nshdd5KkQqVD3kBwcJhXPAmQkD2V4jcwI2GHPE70wfSLIsWJ4OvfDI4rvr/p+Khwc+zYrY66Fr/DpVfv+nmQLMvYUgoXu81FL7fCFMX+wyqiEvHZqIrLZEO89B0JqLyZlF8/6Ex/7xh5v0= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 76c6050f-ff8f-47bd-aa85-08d59db11521 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0807; x-ms-traffictypediagnostic: DM5PR2101MB0807: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231221)(944501327)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0807;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0807; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(39860400002)(396003)(366004)(376002)(346002)(199004)(189003)(14454004)(4326008)(54906003)(25786009)(53936002)(2900100001)(1076002)(3280700002)(6486002)(186003)(2616005)(68736007)(110136005)(11346002)(10090500001)(6116002)(107886003)(3846002)(36756003)(8676002)(72206003)(22452003)(66066001)(26005)(39060400002)(6512007)(478600001)(3660700001)(81156014)(86362001)(81166006)(86612001)(7736002)(305945005)(8936002)(10290500003)(6436002)(105586002)(6666003)(316002)(59450400001)(76176011)(5660300001)(476003)(106356001)(2906002)(6506007)(446003)(2501003)(99286004)(5250100002)(486006)(102836004)(97736004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0807;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: gmRL3ST5/4tUKBvmN5g/1MAErftqSqGYd5QHzjAVQgiwBSPgxlKgRWOw++Zan5MgE0zPSNL7wBxKh2qcLz1W8lmtb4IiqV8/l9sPiKisKclaOL40LGVVZLCUVyCRrauDW+fAXfbYvA6Phtq6TndOpmO8hTCRFZQ+4Kb5VJguNkcN06PFdVWRAoVYgrIjsZZdjabE/Jn+i0WDZeqx0Ts+N+DXk/JkvbZlQdkG7DON2f9GhVfbiwXriA0czBMge1AUOgTtqS8SVb3k2RQAAPxhfm0WzAyIhnFmoyzDleu478dQc7gRvBSFUvEYN5cTXrO9QuLcJor2BlBKvtEqkNpIGLQNGiNtnQFy38Vvm8jt5zJVUC55TZ1haYGGsTzrFmBwyrnnD6pNwtRZusfM4bvrdmVDDIjcaC/QDeBTELAQWw4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76c6050f-ff8f-47bd-aa85-08d59db11521 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:24:37.4250 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0807 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Hsu [ Upstream commit 8fe19795da1b9dea2353f016622842a2f163039e ] Fix the issue that mic type detection error after resume. The microphone type detection procedure will recognize testing signal on JKSLV pin, but before the procedure, JKSLV already had supply voltage, that results in the failure. Therefore, the patch turns off the power and reset the jack type configuration before suspend. Then redo the jack detection procedure after resume. The patch help to fix the issue as follows: Google issue 37973093: CTIA/OMTP jack type detection failure after resume Reported Issue Chrome OS Version : ChromeOS R59-9460.13.0 Type of hardware : DVT sample What steps will reproduce the problem? (1 Play a music (2 Insert a headphones (3 Close laptop lid 3 sec then open it What is the expected output? The music is normal in the headphones. What do you see instead? Singer voice in the music is not clear. How frequently does this problem reproduce? Always What is the impact to the user, and is there a workaround? If so, what is it? Re-insert the headset or close the laptop lid and then open it again can be repaired. Signed-off-by: John Hsu Signed-off-by: John Hsu Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/nau8825.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c index a4871c4adcb0..1285923650fc 100644 --- a/sound/soc/codecs/nau8825.c +++ b/sound/soc/codecs/nau8825.c @@ -1523,7 +1523,6 @@ static int nau8825_jack_insert(struct nau8825 *nau882= 5) snd_soc_dapm_sync(dapm); break; case 2: - case 3: dev_dbg(nau8825->dev, "CTIA (micgnd2) mic connected\n"); type =3D SND_JACK_HEADSET; =20 @@ -1543,6 +1542,11 @@ static int nau8825_jack_insert(struct nau8825 *nau88= 25) snd_soc_dapm_force_enable_pin(dapm, "SAR"); snd_soc_dapm_sync(dapm); break; + case 3: + /* detect error case */ + dev_err(nau8825->dev, "detection error; disable mic function\n"); + type =3D SND_JACK_HEADPHONE; + break; } =20 /* Leaving HPOL/R grounded after jack insert by default. They will be @@ -2203,6 +2207,13 @@ static int nau8825_set_bias_level(struct snd_soc_cod= ec *codec, break; =20 case SND_SOC_BIAS_OFF: + /* Reset the configuration of jack type for detection */ + /* Detach 2kOhm Resistors from MICBIAS to MICGND1/2 */ + regmap_update_bits(nau8825->regmap, NAU8825_REG_MIC_BIAS, + NAU8825_MICBIAS_JKSLV | NAU8825_MICBIAS_JKR2, 0); + /* ground HPL/HPR, MICGRND1/2 */ + regmap_update_bits(nau8825->regmap, + NAU8825_REG_HSD_CTRL, 0xf, 0xf); /* Cancel and reset cross talk detection funciton */ nau8825_xtalk_cancel(nau8825); /* Turn off all interruptions before system shutdown. Keep the @@ -2226,6 +2237,10 @@ static int __maybe_unused nau8825_suspend(struct snd= _soc_codec *codec) =20 disable_irq(nau8825->irq); snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); + /* Power down codec power; don't suppoet button wakeup */ + snd_soc_dapm_disable_pin(nau8825->dapm, "SAR"); + snd_soc_dapm_disable_pin(nau8825->dapm, "MICBIAS"); + snd_soc_dapm_sync(nau8825->dapm); regcache_cache_only(nau8825->regmap, true); regcache_mark_dirty(nau8825->regmap); =20 --=20 2.15.1