From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A038BC433E0 for ; Mon, 11 Jan 2021 21:26:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5280722CBE for ; Mon, 11 Jan 2021 21:26:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730150AbhAKV01 (ORCPT ); Mon, 11 Jan 2021 16:26:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38194 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbhAKV00 (ORCPT ); Mon, 11 Jan 2021 16:26:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610400299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5TWvqrIVm+eS1cOB00SDFYgHatsARh3E9H2TndpfG6E=; b=euiG9JXd6lGt5XWbVo0ep18lqFyv8oVJZVUnStptmo72njN0Kt6bKibu0X0bNge0B6B5So maOfbKYlRGoDXzUgGYv3CrX89pYNmyoFSBjGI4oCdNKu8G2FfY47Dm3TZN9TYK/F7+kodl H96WeT/6qooc03uavN3wQ3Fft9B+6cI= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-hZWTfXl7OdeSfTevb_IVGg-1; Mon, 11 Jan 2021 16:24:57 -0500 X-MC-Unique: hZWTfXl7OdeSfTevb_IVGg-1 Received: by mail-ej1-f71.google.com with SMTP id n17so129596eja.23 for ; Mon, 11 Jan 2021 13:24:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5TWvqrIVm+eS1cOB00SDFYgHatsARh3E9H2TndpfG6E=; b=EkRd2NzOGTxr+Xl1+TR+gWTfKoGhSQKgfOE1qip609ohpOxnLP/xC/COUWElvBkktk C4x3JoJDJxy8CJS4yeV7nvth5dJt0g4UCWbHXcYQ3A/DdjSgPkcDDCW2WP0Lr+AVvoX/ eC5mCB5gmTkbpysH8kVWQ+w4idHke3OdGs4N/lfeoHADAY7uSPyf872BokMQpn5k2HlG 7s2AV1gfRhNV+Q3F6/V6sKvVRg68J2g2dufaGH1xqhzj3NLXkf7FnLFumiJxcaxWVDcZ jt4SjU9XlmshOv7xEr3BYKLURidSF1iiCJI8mR37dHbGo+9VNdSix2zxu5QuSCaZp/UC IpwA== X-Gm-Message-State: AOAM533ahxlEZXT5FDdGKuxyVMA7vkQA4dyc6kQhOQGtE+pC8/3UKhjp iVZeAuQV92k9rdFbwyK9IYqDg1jJ2W92QU/4yjEQ/6H7vQEw1yAFPV2LScTeL+3H5hVcebmOmnM SqU8H1EucJms8hlm6Y2MIIMeO X-Received: by 2002:a17:906:8151:: with SMTP id z17mr978465ejw.48.1610400296191; Mon, 11 Jan 2021 13:24:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxXhXldBoE2+pr7QCaS5A+yMjdW8BmlmZyOL9jrU41uAREPuAsgEFGMQIXw8nX9gHpG66zKg== X-Received: by 2002:a17:906:8151:: with SMTP id z17mr978453ejw.48.1610400296046; Mon, 11 Jan 2021 13:24:56 -0800 (PST) Received: from x1.localdomain (2001-1c00-0c1e-bf00-37a3-353b-be90-1238.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:37a3:353b:be90:1238]) by smtp.gmail.com with ESMTPSA id rs27sm349583ejb.21.2021.01.11.13.24.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Jan 2021 13:24:55 -0800 (PST) Subject: Re: [PATCH] ASoC: Intel: bytcr_rt5640: Add quirks for DeeQ X5-Z8300 To: Pierre-Louis Bossart , Chris Chiu , cezary.rojewski@intel.com, yang.jie@linux.intel.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux@endlessos.org, Mark Brown , Takashi Iwai References: <20201216041601.5993-1-chiu@endlessos.org> <8d4f7c48-cb3e-a868-3d48-fe63a3113ea1@linux.intel.com> From: Hans de Goede Message-ID: <835f8b2e-5e9a-b8db-d126-d0cd5f0ec075@redhat.com> Date: Mon, 11 Jan 2021 22:24:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <8d4f7c48-cb3e-a868-3d48-fe63a3113ea1@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 1/11/21 6:05 PM, Pierre-Louis Bossart wrote: > > > On 12/15/20 10:16 PM, Chris Chiu wrote: >> DeeQ X5-Z8300 is a laptop empowered by Intel Atom Cherry Trail. Add >> quirks to select the correct input map, jack-detect options to enable >> jack sensing and internal/headset microphones. >> >> Signed-off-by: Chris Chiu > > You probably need to re-send and CC: maintainers (Mark Brown, Takashi Iwai) and Hans de Goede who's been supporting all those quirks. > > I don't think the changes below are fully correct, most quirks start with        > .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | > > which e.g. enables the MCLK and overcurrent handling. > > I wonder if what you need is > > .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | BYT_RT5651_IN1_IN2_MAP) Ack, BYT_RT5651_DEFAULT_QUIRKS is: #define BYT_RT5651_DEFAULT_QUIRKS (BYT_RT5651_MCLK_EN | \ BYT_RT5651_JD1_1 | \ BYT_RT5651_OVCD_TH_2000UA | \ BYT_RT5651_OVCD_SF_0P75) So compared to the quirk from the original patch that will add: BYT_RT5651_MCLK_EN BYT_RT5651_OVCD_TH_2000UA BYT_RT5651_OVCD_SF_0P75 Since you have working jack-detect you will definitely want the latter 2 which will make headset vs headphones detection work and will add button-press detection for headsets. BYT_RT5651_MCLK_EN is also a quirk which you almost always want, the sole exception is boards where the mclk is not connected which are very rare. Boards where the mclk is not connected are easy to spot, since they will not work at all when setting BYT_RT5651_MCLK_EN, so if things work with BYT_RT5651_DEFAULT_QUIRKS then setting BYT_RT5651_MCLK_EN is the right thing to do. Tl;DR: use (BYT_RT5651_DEFAULT_QUIRKS | BYT_RT5651_IN1_IN2_MAP) as Pierre-Louis suggests. Regards, Hans > >> --- >>   sound/soc/intel/boards/bytcr_rt5651.c | 8 ++++++++ >>   1 file changed, 8 insertions(+) >> >> diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c >> index 688b5e0a49e3..9df09e26b05a 100644 >> --- a/sound/soc/intel/boards/bytcr_rt5651.c >> +++ b/sound/soc/intel/boards/bytcr_rt5651.c >> @@ -507,6 +507,14 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = { >>                       BYT_RT5651_SSP0_AIF1 | >>                       BYT_RT5651_MONO_SPEAKER), >>       }, >> +    { >> +        .callback = byt_rt5651_quirk_cb, >> +        .matches = { >> +            DMI_MATCH(DMI_SYS_VENDOR, "DeeQ"), >> +            DMI_MATCH(DMI_PRODUCT_NAME, "X5-Z8300"), >> +        }, >> +        .driver_data = (void *)(BYT_RT5651_IN1_IN2_MAP | BYT_RT5651_JD1_1), >> +    }, >>       {} >>   }; >>   > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4F14C433E0 for ; Mon, 11 Jan 2021 21:26:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 19C4D22CB2 for ; Mon, 11 Jan 2021 21:26:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19C4D22CB2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9B48A1749; Mon, 11 Jan 2021 22:25:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9B48A1749 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1610400365; bh=pJjKYZtiPlODEbYxxbKwFMOMyHssIK7t8LlECH8Q2ig=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TmMCon4DC1Eq59u1x6LacerPIbqWO4X9U19HWItHO2ms3NurE+/qM1z1HFAjCjeL4 B64bHlARWPdqgX3YS8qRbm5GNMiYTx8GT2BhsWVuoZ+k+1PL+DhJhV8Ry9QlDAYRzl al6rttBWcq0eTfYcvERJqgnIGiV9IeAM4N06cilc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B15C6F800BE; Mon, 11 Jan 2021 22:25:14 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 80ED0F8016D; Mon, 11 Jan 2021 22:25:12 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A9C6AF800BE for ; Mon, 11 Jan 2021 22:25:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A9C6AF800BE Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ABDGd1ry" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610400300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5TWvqrIVm+eS1cOB00SDFYgHatsARh3E9H2TndpfG6E=; b=ABDGd1ryrKsS6u3E95eJ70b5HliMs4b2OZnbaqMEjY4zX6+gbpvvCoJm8/3WPqlVk54Aem xOYcvzxacW/cc0DpPl97UsOcxkWmTHUz+sBx0nPpv5RkNEOfYUk78ZC+IjSKTN+kiz9NSb leUwbbWTeX9jBawaByz96ERuoS+W7FY= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-45-YRGYXeJbOYm-YhgnXT544A-1; Mon, 11 Jan 2021 16:24:58 -0500 X-MC-Unique: YRGYXeJbOYm-YhgnXT544A-1 Received: by mail-ej1-f70.google.com with SMTP id p1so143932ejo.4 for ; Mon, 11 Jan 2021 13:24:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5TWvqrIVm+eS1cOB00SDFYgHatsARh3E9H2TndpfG6E=; b=kbhIqrhqoAXFprhZZYE2dnEpyg1qV2CmDll8H+TdM0MgIPBDIVWDuOYl0+qTS/ncUh jqzRa4yBZtS9oz0+/f9rjVWD4PDaDembjbh09vo94Bbf50vT4rBmX8Lfne0ILtDRKgR5 fZ3SAcxuTyPZ4UoFHkCfShYyB8khcitWcERJLuitwJ5nDD7Bn6Vzx0THrpgY0FKWNvSC bxbR1FhoYJNoj2Sdi2sonMfv2ZRwfDn9Gdzfug504tNTew/WXqL1DdaLR3gLFqv0+A3J 9RZzIq/50Sh3juckuMDCYn6DYBi0HoCVHzt+C6t0yJ3LazEsbkvTseRRdtdaVwForV72 DQ8A== X-Gm-Message-State: AOAM531tnkWzXxF2XLR4y0oC44obpLGlfX4efTN01KG7YkTsP24TIU9W IijFQ9xzxD5iytYy5PhSanwafFG4uKeJgJi3p2ofjQ0k7gLvaCELsqus854g1iJvTwsCv8Kz6S8 0GGE/fZyCu4UhcaJ/jLJ0EoM= X-Received: by 2002:a17:906:8151:: with SMTP id z17mr978464ejw.48.1610400296191; Mon, 11 Jan 2021 13:24:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxXhXldBoE2+pr7QCaS5A+yMjdW8BmlmZyOL9jrU41uAREPuAsgEFGMQIXw8nX9gHpG66zKg== X-Received: by 2002:a17:906:8151:: with SMTP id z17mr978453ejw.48.1610400296046; Mon, 11 Jan 2021 13:24:56 -0800 (PST) Received: from x1.localdomain (2001-1c00-0c1e-bf00-37a3-353b-be90-1238.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:37a3:353b:be90:1238]) by smtp.gmail.com with ESMTPSA id rs27sm349583ejb.21.2021.01.11.13.24.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Jan 2021 13:24:55 -0800 (PST) Subject: Re: [PATCH] ASoC: Intel: bytcr_rt5640: Add quirks for DeeQ X5-Z8300 To: Pierre-Louis Bossart , Chris Chiu , cezary.rojewski@intel.com, yang.jie@linux.intel.com References: <20201216041601.5993-1-chiu@endlessos.org> <8d4f7c48-cb3e-a868-3d48-fe63a3113ea1@linux.intel.com> From: Hans de Goede Message-ID: <835f8b2e-5e9a-b8db-d126-d0cd5f0ec075@redhat.com> Date: Mon, 11 Jan 2021 22:24:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <8d4f7c48-cb3e-a868-3d48-fe63a3113ea1@linux.intel.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Cc: Takashi Iwai , alsa-devel@alsa-project.org, Mark Brown , linux-kernel@vger.kernel.org, linux@endlessos.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Hi, On 1/11/21 6:05 PM, Pierre-Louis Bossart wrote: > > > On 12/15/20 10:16 PM, Chris Chiu wrote: >> DeeQ X5-Z8300 is a laptop empowered by Intel Atom Cherry Trail. Add >> quirks to select the correct input map, jack-detect options to enable >> jack sensing and internal/headset microphones. >> >> Signed-off-by: Chris Chiu > > You probably need to re-send and CC: maintainers (Mark Brown, Takashi Iwai) and Hans de Goede who's been supporting all those quirks. > > I don't think the changes below are fully correct, most quirks start with        > .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | > > which e.g. enables the MCLK and overcurrent handling. > > I wonder if what you need is > > .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | BYT_RT5651_IN1_IN2_MAP) Ack, BYT_RT5651_DEFAULT_QUIRKS is: #define BYT_RT5651_DEFAULT_QUIRKS (BYT_RT5651_MCLK_EN | \ BYT_RT5651_JD1_1 | \ BYT_RT5651_OVCD_TH_2000UA | \ BYT_RT5651_OVCD_SF_0P75) So compared to the quirk from the original patch that will add: BYT_RT5651_MCLK_EN BYT_RT5651_OVCD_TH_2000UA BYT_RT5651_OVCD_SF_0P75 Since you have working jack-detect you will definitely want the latter 2 which will make headset vs headphones detection work and will add button-press detection for headsets. BYT_RT5651_MCLK_EN is also a quirk which you almost always want, the sole exception is boards where the mclk is not connected which are very rare. Boards where the mclk is not connected are easy to spot, since they will not work at all when setting BYT_RT5651_MCLK_EN, so if things work with BYT_RT5651_DEFAULT_QUIRKS then setting BYT_RT5651_MCLK_EN is the right thing to do. Tl;DR: use (BYT_RT5651_DEFAULT_QUIRKS | BYT_RT5651_IN1_IN2_MAP) as Pierre-Louis suggests. Regards, Hans > >> --- >>   sound/soc/intel/boards/bytcr_rt5651.c | 8 ++++++++ >>   1 file changed, 8 insertions(+) >> >> diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c >> index 688b5e0a49e3..9df09e26b05a 100644 >> --- a/sound/soc/intel/boards/bytcr_rt5651.c >> +++ b/sound/soc/intel/boards/bytcr_rt5651.c >> @@ -507,6 +507,14 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = { >>                       BYT_RT5651_SSP0_AIF1 | >>                       BYT_RT5651_MONO_SPEAKER), >>       }, >> +    { >> +        .callback = byt_rt5651_quirk_cb, >> +        .matches = { >> +            DMI_MATCH(DMI_SYS_VENDOR, "DeeQ"), >> +            DMI_MATCH(DMI_PRODUCT_NAME, "X5-Z8300"), >> +        }, >> +        .driver_data = (void *)(BYT_RT5651_IN1_IN2_MAP | BYT_RT5651_JD1_1), >> +    }, >>       {} >>   }; >>   >