From patchwork Wed Jun 27 11:30:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 140315 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp743030ljj; Wed, 27 Jun 2018 04:31:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfWbJ59XbvGSQ2lFLv/8iC6D2ItZf4c0vRXLDewX3E1AyuXTPh465ZWSn0QfXYFAha0+u2s X-Received: by 2002:a1c:42d7:: with SMTP id k84-v6mr4557622wmi.159.1530099072366; Wed, 27 Jun 2018 04:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530099072; cv=none; d=google.com; s=arc-20160816; b=b1QTbHmR9qFameLeZ0FTUzKYpzTOslDWkl1scOoY0wUVd+mKnNBKis0BruKZ2ZOupr QtaeY7ZklfOjwNcAsSlDVjaWzmMoWZmOR4fDIyZksEgRgWDWe2plv05+qNyBTTT0+fe1 jQoKBiFLdhOXoqblOgmSZJttEOTXtsDJsEf+rRkVN1lIIpNzbpIROe/IrsPO86xl6SxY nqEycz7qLHYa+ZUFpRv0YsT4aCaYetT/Mqytkl1N76c/toyq5J6zPkW3vIcerwbrbFnM D7IeG4kC9C/fd2SauEyUGX0KjA05xSqEad5BtWWrw6wgqAAAgRL8AK2j3rIyaLviaoyY tbWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=FBTHCFliwJnlYBKbonv/fSQOO5l1Vwb4ZStNA8Gl+H8=; b=P7Ha9c/2yR6ikAZV/1O//aEQZH2pxloreuy2X/YEU/KIE9V3NzsN0IcJ0LZ8xItWo+ ZcrNI4X5w7QpLS+7g2o7Qil+dKmuB3UOHVkr0kv3yXZzD3X1Sa0R1vhN1Wcg9dTQnwz9 VP1mhKvCQUD8uIQIHR/FaQWM2CSemdUuG5R7Vzd+gWV6GgEJlLF0wAPluU9PZDAEqlEH kajDP1ZN0YFtrB26MvOmA0/v5EyugLGcNNCbdQLEppYgnDG/A9x29AlCI8YEWl7SCWGT 5W/WKAz6teXkxEFZX1f+YvYHGiWq/ng2id+hD7TzSkjoAAG6muWK9r6e7ZvfwqBF0U7W aiNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="m6VdeD/t"; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id y204-v6si3729322wmb.5.2018.06.27.04.31.12; Wed, 27 Jun 2018 04:31:12 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="m6VdeD/t"; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3829B267988; Wed, 27 Jun 2018 13:31:11 +0200 (CEST) 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 34B30267995; Wed, 27 Jun 2018 13:31:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 8CC69267988 for ; Wed, 27 Jun 2018 13:31:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=0N4u2nrM8p7+hvK+tJNb7CLPKtLvfKhMZCNhHVy2yP0=; b=m6VdeD/trLUX +iq/QnjnsdYNZAAWNZhD2xzVOjA5myYq4szTg9ZXwoINm051T38i8Dx9bFXA0hHDIfbNMIc1VfSeI rP9+Qq6kITf2TVf4c0aBy+jdExUzLnTTQdsLEEzS4kjk5LlgJlA6oIfjiBJ/6uTxkicN2IQiR2SW1 rN8q0=; Received: from 188.29.164.103.threembb.co.uk ([188.29.164.103] helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fY8f8-0002w2-O2; Wed, 27 Jun 2018 11:31:03 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 320C7440070; Wed, 27 Jun 2018 12:30:49 +0100 (BST) From: Mark Brown To: Hans de Goede In-Reply-To: <20180624140634.16835-9-hdegoede@redhat.com> Message-Id: <20180627113049.320C7440070@finisterre.ee.mobilebroadband> Date: Wed, 27 Jun 2018 12:30:49 +0100 (BST) Cc: Oder Chiou , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Carlo Caione , Bard Liao Subject: [alsa-devel] Applied "ASoC: Intel: bytcr_rt5651: Add BYT_RT5651_HP_LR_SWAPPED quirk" to the asoc tree 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: Intel: bytcr_rt5651: Add BYT_RT5651_HP_LR_SWAPPED quirk has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 8f250e7009d71e6f3f3aeb95a540c36fc9c03398 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 24 Jun 2018 16:06:33 +0200 Subject: [PATCH] ASoC: Intel: bytcr_rt5651: Add BYT_RT5651_HP_LR_SWAPPED quirk One some models (Chuwi Vi8 Plus, Chuwi Hi8 Pro) the headphone output has left and right swapped. This can be fixed in with special mixer settings in the UCM profile, bit this requires these devices loading a different UCM profile. This commit adds a BYT_RT5651_HP_LR_SWAPPED quirk for this and postfixes the longname with "-hp-swapped" if set, so that a different UCM profile will be loaded. We can safely do this without causing regressions (UCM profile not found due to the longname change) as the UCM profiles are not in upstream alsa-lib yet. Signed-off-by: Hans de Goede Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- sound/soc/intel/boards/bytcr_rt5651.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) -- 2.17.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c index e778142b8a6e..ffd62eb5c266 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -73,6 +73,7 @@ enum { #define BYT_RT5651_SSP2_AIF2 BIT(19) /* default is using AIF1 */ #define BYT_RT5651_SSP0_AIF1 BIT(20) #define BYT_RT5651_SSP0_AIF2 BIT(21) +#define BYT_RT5651_HP_LR_SWAPPED BIT(22) #define BYT_RT5651_DEFAULT_QUIRKS (BYT_RT5651_MCLK_EN | \ BYT_RT5651_JD1_1 | \ @@ -359,6 +360,17 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = { .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | BYT_RT5651_IN1_IN2_MAP), }, + { + /* Chuwi Hi8 Pro (CWI513) */ + .callback = byt_rt5651_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hampoo"), + DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"), + }, + .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | + BYT_RT5651_IN1_MAP | + BYT_RT5651_HP_LR_SWAPPED), + }, { /* Chuwi Vi8 Plus (CWI519) */ .callback = byt_rt5651_quirk_cb, @@ -367,7 +379,8 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "D2D3_Vi8A1"), }, .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | - BYT_RT5651_IN1_MAP), + BYT_RT5651_IN1_MAP | + BYT_RT5651_HP_LR_SWAPPED), }, { /* VIOS LTH17 */ @@ -662,7 +675,7 @@ static struct snd_soc_card byt_rt5651_card = { static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN]; static char byt_rt5651_codec_aif_name[12]; /* = "rt5651-aif[1|2]" */ static char byt_rt5651_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ -static char byt_rt5651_long_name[40]; /* = "bytcr-rt5651-*-mic" */ +static char byt_rt5651_long_name[40]; /* = "bytcr-rt5651-*-mic[-swapped-hp]" */ static bool is_valleyview(void) { @@ -687,6 +700,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) struct byt_rt5651_private *priv; struct snd_soc_acpi_mach *mach; const char *i2c_name = NULL; + const char *hp_swapped; bool is_bytcr = false; int ret_val = 0; int dai_index = 0; @@ -829,9 +843,14 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) } } + if (byt_rt5651_quirk & BYT_RT5651_HP_LR_SWAPPED) + hp_swapped = "-hp-swapped"; + else + hp_swapped = ""; + snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name), - "bytcr-rt5651-%s-mic", - mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)]); + "bytcr-rt5651-%s-mic%s", + mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], hp_swapped); byt_rt5651_card.long_name = byt_rt5651_long_name; ret_val = devm_snd_soc_register_card(&pdev->dev, &byt_rt5651_card);