Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp60003pxh; Thu, 7 Apr 2022 13:58:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6xqFmmlvys2QHfl4nGYHxO5vm6+fhOeyekEWDOtBW9tjzLa9wG/yTgcAmigGvAENkWoKR X-Received: by 2002:a17:90b:2406:b0:1ca:ab60:60ae with SMTP id nr6-20020a17090b240600b001caab6060aemr18020924pjb.226.1649365118821; Thu, 07 Apr 2022 13:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649365118; cv=none; d=google.com; s=arc-20160816; b=ABedbw6sKCLIi3EKZssAADRIJMUncHbG5yeOR9G8y9JcwqWG1mQfLV62IiN3W6QzXh iqws6Oub3qXteoHD3ZZekGdI2BgaYp0QtD1QkzhU+FjYgx7MZmi+zMkx9peVP432negD FmT+J5sIyYpQ9YiuW3+fNwKVNRWcalJ6+9oXQrb8WP+CGDC0OXZ0p8iExG3pI6cjU+PS tu8mP3tppW/p+gupObQIMuhK0hTU/L0OTeRCwOYoK1d1PCpvAFtCIbkbsOM/v/2LzxG4 mlAy5TeojR+MN/IhHFYK2xsMqTRp9BmKnHmmIk6c4hQ/3VFbVbGOjXuOX0g3pafqPqIk RBng== 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=mO0Z9R21ETjM4vXys5A/pQRq4w/gq2ujBGIErpqYVxY=; b=tk8zxyPkzzC4Mb2/XTNRrlaX7GBb9nLXD634a/LAO8I8yeXT1CBhAEfK+Azl7OBYuy DMNGyUkP5goCzGXChAsB6okSBhtIIyAGViAi6xZuLUbQdsjjlSVnVfYDiUdx/xHEnbVl d+ywN4C948PWyB0r2ilEXq+Em0VNBtTXnhqc5TGjThiirtTTshjWIu1VadtKaHr5Z0l7 S4R1fsFqpHD/0wgOtaZ2BQofd+Awb3UzzkRvlZuLDWvjo3EYv9QjaVrHm74TJbX9iVW4 A4OTogtVsagy1hhkyTnMEA+ohtyws9icXx0EcrKEu3fk9LKFAJnKJ9rk1vH0zGbf4vCq drWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CY7Npgnd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j15-20020a056a00174f00b004fa3a8dffaesi19968063pfc.101.2022.04.07.13.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:58:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CY7Npgnd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4BB3F419DAF; Thu, 7 Apr 2022 13:01:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346976AbiDGSwI (ORCPT + 99 others); Thu, 7 Apr 2022 14:52:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233651AbiDGSwF (ORCPT ); Thu, 7 Apr 2022 14:52:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2934F1070AA for ; Thu, 7 Apr 2022 11:50:05 -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 ams.source.kernel.org (Postfix) with ESMTPS id C5E59B8260F for ; Thu, 7 Apr 2022 18:50:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84832C385A0; Thu, 7 Apr 2022 18:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649357402; bh=TAbTE0lF5EexKN7OT4x7M57eBGM9nfMRRu7XhDuXa7Y=; h=From:To:Cc:Subject:Date:From; b=CY7Npgnd7FKGA3gbSEsqEtlyjwFcX4266dB0hKhe/xIimNF74mFoc1p5+ioGavU+o vNaGZ0+J5rsL+UnPXnZ4CMQsTjXTh0KRemNqxmafuX+fwVBdTMYd3GPO797hau7Jlo ZpKxsGinzrqtF/r4e1scLFiBjlA3puYz6RPWVE6sP0Qd9GcCFxCRO7UtYX6H3Rr91O nkxRQ/IFvWTBFVyBUQ3i1885FEOvlkkbxi/adnepTeCIQXQp1LWAfbSBMqztipnY3W IBO97sIZ1PlYuyF3wqwALgN6cNUkH85cv03E+ZdBmmGWzK1PMMPWUCEoJgDDlPncBh zkHpwyIlxTAZQ== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1ncXCi-000Rug-4j; Thu, 07 Apr 2022 20:50:00 +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 v5 0/4] Make headphone work on Huawei Matebook D15 Date: Thu, 7 Apr 2022 20:49:55 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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. --- v5: - dropped an uneeded differential mux from the boards driver. 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 | 117 +++++++++++++++++++++------- 1 file changed, 89 insertions(+), 28 deletions(-) -- 2.35.1