From patchwork Wed Mar 7 14:22:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 130912 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp5242122lja; Wed, 7 Mar 2018 06:22:55 -0800 (PST) X-Google-Smtp-Source: AG47ELtzFAWePLMY3oBQhI5t1RPpPVrUcTXcLBCqmzSer17mRNDKNsysBr1gmOE7hmSU5WJHO74u X-Received: by 10.223.160.234 with SMTP id n39mr20054522wrn.25.1520432575044; Wed, 07 Mar 2018 06:22:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520432575; cv=none; d=google.com; s=arc-20160816; b=DTMLDJHFHmDB64/heLJ/1pY6tllZHaN6XuaBxHngWHkyc+9Gi4hG9+xyR8cEAc1MYK GbjWQC9+EFewgyK0Cah9ym6pYlwSJdQKYmiNXkV106W1WQ0zhTJQnTEwLULk5jZ27Fgc 1lsZ15wRoBNm8lF8TyzOwJm0hFcbCjI0c5Z78DfJlwLcNpOWdqwJ42uEIvI0NlWpKTv9 TMqNmd9syHwe4wc+i8EZjPZp9iEIa5Q61DHTyhKtN8q8Aaywf5JwaJWPhzJG3OdTnl5Z INV8b0M6eyn8UfDk6a+PaPZQdiRSeuXN/8RusE5KJa9SCgCLwuOZ8xT4Mng70IUzgRX1 hssg== 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=Utp0d8Ag0rfHeD5Qf/YHzMzWyfNZxWF/dLEAj0cZlgo=; b=Heue9rlZZ3xu5cNgPQayNI5/zOfKfdZQI16hHEsuDHIuI1luWRK59jiNCnibWZTGAv xXAdApFnqstr66BCPIPGkY+4p31yMeG5mvLkIrqWlhImuP0DzsU1cODoM31ca8lHOI9k QnYyse1kRJFk3LuKsXYb1hG6tSsHTXO99Sj2hR9rzpq1qUraOv0NUoYFaNYOMThmogMi WsnVsGGWJgRyFC7X1enPkJwSPObqc9shzjlMYsEE+M24LTGOXCQytzye9lHEPEAPg/4h +5uqoJEVO4gr7iNkKak9wQfIcALh3QAOBx0/7MGDvqm72dL4yLTbjr1EFE2I/RRGJWFA DjlQ== 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=pCmqXEt8; 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 Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id c184si7814518wmh.28.2018.03.07.06.22.54; Wed, 07 Mar 2018 06:22:55 -0800 (PST) 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=pCmqXEt8; 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 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 17E3F267444; Wed, 7 Mar 2018 15:22:39 +0100 (CET) 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 22BF726744A; Wed, 7 Mar 2018 15:22:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD 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 10D12267439 for ; Wed, 7 Mar 2018 15:22:32 +0100 (CET) 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=tgqJ2bO6Mc8yHVllr+1bzjRIdYvxNNsfX+zGB8kJjcw=; b=pCmqXEt8KDqS KD6OWXM4nmd6xjpW3EJ00ovG7FnVOegp4XVMwNLr5SMiH9fEjC1+yU7ALq3L08j7jI9RhVbUNuc2t yR5jLPWDY8m0+7puNj2BmINoFHSjtJY9f5v/RkfOS9Y364E49cYzfLAwP0LH7pqRm9yOTu/hPLUMg vRigw=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1etZxb-0000E1-AU; Wed, 07 Mar 2018 14:22:27 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1etZxa-0002oI-Ru; Wed, 07 Mar 2018 14:22:26 +0000 From: Mark Brown To: Hans de Goede In-Reply-To: <20180304143610.21125-15-hdegoede@redhat.com> Message-Id: Date: Wed, 07 Mar 2018 14:22:26 +0000 Cc: Oder Chiou , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Takashi Iwai , Mark Brown , Carlo Caione , Bard Liao Subject: [alsa-devel] Applied "ASoC: Intel: bytcr_rt5651: Add quirk micbias OVCD configuration" 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 quirk micbias OVCD configuration 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 8ffaa6a136e6f30e053e78fb9742c7748bef8576 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 4 Mar 2018 15:36:02 +0100 Subject: [PATCH] ASoC: Intel: bytcr_rt5651: Add quirk micbias OVCD configuration Add support for setting the micbias OVCD limits device-properties through quirks. And set the limits for this to 2000uA with a scale-factor of 0.75 for the KIANO SlimNote 14.2 device, which is the only device on which jack-detection is currently enabled. Tested-by: Carlo Caione Signed-off-by: Hans de Goede Signed-off-by: Mark Brown --- sound/soc/intel/boards/bytcr_rt5651.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) -- 2.16.2 _______________________________________________ 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 56f1f076d92c..91b5841af622 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -51,14 +51,29 @@ enum { BYT_RT5651_JD2 = (RT5651_JD2 << 4), }; +enum { + BYT_RT5651_OVCD_TH_600UA = (6 << 8), + BYT_RT5651_OVCD_TH_1500UA = (15 << 8), + BYT_RT5651_OVCD_TH_2000UA = (20 << 8), +}; + +enum { + BYT_RT5651_OVCD_SF_0P5 = (RT5651_OVCD_SF_0P5 << 13), + BYT_RT5651_OVCD_SF_0P75 = (RT5651_OVCD_SF_0P75 << 13), + BYT_RT5651_OVCD_SF_1P0 = (RT5651_OVCD_SF_1P0 << 13), + BYT_RT5651_OVCD_SF_1P5 = (RT5651_OVCD_SF_1P5 << 13), +}; + #define BYT_RT5651_MAP(quirk) ((quirk) & GENMASK(3, 0)) #define BYT_RT5651_JDSRC(quirk) (((quirk) & GENMASK(7, 4)) >> 4) +#define BYT_RT5651_OVCD_TH(quirk) (((quirk) & GENMASK(12, 8)) >> 8) +#define BYT_RT5651_OVCD_SF(quirk) (((quirk) & GENMASK(14, 13)) >> 13) #define BYT_RT5651_DMIC_EN BIT(16) #define BYT_RT5651_MCLK_EN BIT(17) #define BYT_RT5651_MCLK_25MHZ BIT(18) -/* jack-detect-source + dmic-en + terminating empty entry */ -#define MAX_NO_PROPS 3 +/* jack-detect-source + dmic-en + ovcd-th + -sf + terminating empty entry */ +#define MAX_NO_PROPS 5 struct byt_rt5651_private { struct clk *mclk; @@ -78,9 +93,14 @@ static void log_quirks(struct device *dev) dev_info(dev, "quirk IN2_MAP enabled"); if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN3_MAP) dev_info(dev, "quirk IN3_MAP enabled"); - if (BYT_RT5651_JDSRC(byt_rt5651_quirk)) + if (BYT_RT5651_JDSRC(byt_rt5651_quirk)) { dev_info(dev, "quirk realtek,jack-detect-source %ld\n", BYT_RT5651_JDSRC(byt_rt5651_quirk)); + dev_info(dev, "quirk realtek,over-current-threshold-microamp %ld\n", + BYT_RT5651_OVCD_TH(byt_rt5651_quirk) * 100); + dev_info(dev, "quirk realtek,over-current-scale-factor %ld\n", + BYT_RT5651_OVCD_SF(byt_rt5651_quirk)); + } if (byt_rt5651_quirk & BYT_RT5651_DMIC_EN) dev_info(dev, "quirk DMIC enabled"); if (byt_rt5651_quirk & BYT_RT5651_MCLK_EN) @@ -304,6 +324,8 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = { }, .driver_data = (void *)(BYT_RT5651_MCLK_EN | BYT_RT5651_JD1_1 | + BYT_RT5651_OVCD_TH_2000UA | + BYT_RT5651_OVCD_SF_0P75 | BYT_RT5651_IN1_IN2_MAP), }, {} @@ -326,6 +348,12 @@ static int byt_rt5651_add_codec_device_props(const char *i2c_dev_name) props[cnt++] = PROPERTY_ENTRY_U32("realtek,jack-detect-source", BYT_RT5651_JDSRC(byt_rt5651_quirk)); + props[cnt++] = PROPERTY_ENTRY_U32("realtek,over-current-threshold-microamp", + BYT_RT5651_OVCD_TH(byt_rt5651_quirk) * 100); + + props[cnt++] = PROPERTY_ENTRY_U32("realtek,over-current-scale-factor", + BYT_RT5651_OVCD_SF(byt_rt5651_quirk)); + if (byt_rt5651_quirk & BYT_RT5651_DMIC_EN) props[cnt++] = PROPERTY_ENTRY_BOOL("realtek,dmic-en");