Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1332036pxb; Wed, 6 Apr 2022 15:19:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySgrlDL62G7nrJKRFWXpL06jQTD+yGYWqRYnlqFZSV7O5d66QOqbuDWemOYcY8L/S9fBOH X-Received: by 2002:a17:907:2cc3:b0:6da:e6cb:2efa with SMTP id hg3-20020a1709072cc300b006dae6cb2efamr10377978ejc.169.1649283563813; Wed, 06 Apr 2022 15:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649283563; cv=none; d=google.com; s=arc-20160816; b=xvyZSia5QVXqFx8cnbKgteUI2QJWq3mh9/n4GYOME13teu8AAay2rWpu97SQlq3ERl sySLViCmIdLY5OfPJXTFSbuoT6MsOUKxnKm1aNixL8WPD4atv6775fRda4d6iefhjMsE 3yA70UOvWD618yXWhxeU8MlifRir9DBMptkObf0vP5rvmkoMStWIMCJ7oHXPaRpoRn1A Bsdc2f3/vMzJJg01PkaW00y00KRCpUWKQAF9NyFQh53sRUZpVJyvZCZ1qQCMk/0nDMjY lscRo8SF3/nLArcXGpvD177wsiHGqlQaDrfvaInsaA6sKwzsDjIq1a0kUVLoX5zSDYiB JiLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HBGFgd3xdRlkVPJUB6xRfBt5PTVo5BmqrgUyzekQ/UU=; b=PddQFG8NHxcUrqGgqmf9gT8GozI2TVJ+mz/znpqYqcYpgi0jzwGz1QE8rEVw0J0BF7 Pud7XGhfm8WmHp/sCSx0sueBtlRyqsgKYiah8yH2FfhAAWNCPhVRPWa93/WmDp/MdUNF UMnypcnwh3mBUgtJcy1Pr3Y08TQGQUFaDgd4TFHcvfr23lp0dIzOIr/IECZkHoX0+bdl J6LwEqgLfbjfZP4QLLXBRhJHkyyMZCtGY9owvmRU1qDtJlbnGqSdJdFeuCUJI/vHnnWV +ARqSCc2qgqwHVFXbqkwU+fDE3wP/dCc0ij2nE5An8Mu1pIv7Eat1/EVGmNvuxyC29R/ ciBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pn+coB4Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a509d46000000b0041939558a00si12108330edk.48.2022.04.06.15.18.56; Wed, 06 Apr 2022 15:19:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pn+coB4Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235177AbiDFVYm (ORCPT + 99 others); Wed, 6 Apr 2022 17:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235554AbiDFVXf (ORCPT ); Wed, 6 Apr 2022 17:23:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5F572E1942 for ; Wed, 6 Apr 2022 13:19:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D8EBB61607 for ; Wed, 6 Apr 2022 20:19:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C138C385AA; Wed, 6 Apr 2022 20:19:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649276363; bh=Lf/3oiDQxIjrJslaU4hDBu7sK/Kpd4Up096TW4VK1+8=; h=From:To:Cc:Subject:Date:From; b=pn+coB4YtR7Vx5Rgy46/4lZm6ZODHkcZrx1Y5uN2zIc5xyazhq2VDeix3XlEUu/h0 eP2tPVdRHpCEXIrkN0eICnBUml0ibYGSstHWZVJ5gAxLGCGxrCMRxoTo4j76i+hOja UuMwuC16hKemHL+1S5OfGm8gv2yW0GPTz8zFM/yaOJzpSsgtpBp+GOwdD9GAoEkzv3 ueSL40lr0cGiKUihXBB60HdrbanVqtpdcYNKYVPclW1CNaQHhXglJA9ReYn3NLbB3S s2gjy11N2wbmhbPoeGDnHhWpKJqq7HVbTHF51TYdhA/DDT1R9JdZxnn538RzJuu2TZ 4H4B5hFG4BRKA== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1ncC7c-00GGaG-Fy; Wed, 06 Apr 2022 22:19:20 +0200 From: Mauro Carvalho Chehab To: alsa-devel@alsa-project.org Cc: Mauro Carvalho Chehab , Pierre-Louis Bossart , Hans de Goede , =?UTF-8?q?P=C3=A9ter=20Ujfalusi?= , Bard Liao , Cezary Rojewski , Jaroslav Kysela , Jie Yang , Liam Girdwood , Mark Brown , Takashi Iwai , linux-kernel@vger.kernel.org Subject: [PATCH v4 0/4] Make headphone work on Huawei Matebook D15 Date: Wed, 6 Apr 2022 22:19:14 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Huawei Matebook D15 uses two different GPIOs are used to control the output: - gpio0 controls the speaker output; - gpio1 controls the headphone output. Changing both at the same time cause spurious events that are mis-interpreted as input events, causing troubles on apps. So, a delay is needed before turning on such gpios. Also, the headset microphone is connected to MIC1, instead of MIC2 port. With this patch, plugging a headphone causes a jack event to trigger the speaker supply, powering down the speaker and powering up the headphone output. Removing the headphone also triggers the power supply, powering up the speaker and powering down the headphone. The headset microphone also works. --- v4: - add support for headset microphone on MIC1 port. v3: - add a patch changing GPIO quirk speaker naming. Patch 2 got rebased on the top of it. Mauro Carvalho Chehab (3): ASoC: Intel: sof_es8336: support a separate gpio to control headphone ASoC: Intel: sof_es8336: add a quirk for headset at mic1 port ASoC: Intel: sof_es8336: Add a quirk for Huawei Matebook D15 Pierre-Louis Bossart (1): ASoC: Intel: sof_es8336: simplify speaker gpio naming sound/soc/intel/boards/sof_es8336.c | 122 +++++++++++++++++++++------- 1 file changed, 94 insertions(+), 28 deletions(-) -- 2.35.1