From patchwork Thu Mar 1 18:06:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 130362 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp3112932edc; Thu, 1 Mar 2018 10:07:45 -0800 (PST) X-Google-Smtp-Source: AG47ELvwA4ouANTsxdgywYjq6CnjhoEhkQWnWjWjXmFg/BPkl44797yU7ZC800XgBW3sgnLTgWr7 X-Received: by 10.28.128.79 with SMTP id b76mr2706056wmd.10.1519927665447; Thu, 01 Mar 2018 10:07:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519927665; cv=none; d=google.com; s=arc-20160816; b=ZBbo5Ty+NAT/lno/djXdCR0je87CBVMrgZK/F5M7aIB6xtaUr4q+Vy63uETF5MfKc1 wJ21TROQcyEpHP+chnO7b3KdvIXB7Kn1y7H+K9bbNPXrPtrkpTjdikkmT1EIZhp66gwM 55cp835vFs3W9B61DKnkoHvuf9SiCT4o3a3doEaGSsUO7Hx8sTDqz2Vyk0GMgEoONcdK 8SjL9Xgjwmdkj6opxLF+RDymiM/ZIKbb9AL9Mcyt9a0IwRkXqGAoJicQKcWeUcW6HlqF VietjKzmWLz0z/myFbUWuXzkl7gkanBXNIBk4GB30YiD9broVpulp2vD+pmcKG9wWa/K 2RGA== 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=MNws6anbzvIRkU76+njJXwmip3oQr5RmtZpSNRoU78s=; b=hOGk3ThWNb6Gipcadd0PfZWJoEwlROlL8v15iLUdFmlDwbhn204XKuKxM4o9iD0Uri 6nu9YqhET8vpfq2Ab6y3iOMoF6caqRLLHS8VIbLh7hWZOrrrGf11HyFN9FfeSWEuh8We OxPGyUc+FX/HTYdp1Icw6GLfVnptgo+y/uEY73J81uS09LIQWmTApXWI6OdLGz1BThdh GqJFtP5P78HK8Lm99a7P1OYQRpOjwcuWjW50M7aMl7zQT3/DQkgrbv5GHaW40HFtzqfM PgkK3GaYIMW3NA3cQTIRlfkuId8OIdOsWVjGzKC1he6LqlCR5PbXXoeDJ/nJa8enuG9u h4zg== 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=ZJz30wna; 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 a80si911717wma.221.2018.03.01.10.07.45; Thu, 01 Mar 2018 10:07:45 -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=ZJz30wna; 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 3E580267B48; Thu, 1 Mar 2018 19:07:06 +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 224C5267B36; Thu, 1 Mar 2018 19:07:03 +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 73D4C267B35 for ; Thu, 1 Mar 2018 19:07:01 +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=D5RUkXINAPZn2usjzTmIH94o0z7jal7g0s4v5vioTOU=; b=ZJz30wnaKYI6 XC5YBfFgvnJtifOFWb7Kns9Lx0gk1+SFUwdZPJszXtt63DMowLAcV4y0bh2lUKc0MAQWO52C1530J W68IfLlK0X6pGOeERVhgQBwwgSNr3zGmqY579SYy9qhhb8bNve4InRPrMRLFr1ttHH+PvE6wjpAwu AlEmE=; 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 1erSbP-0005WH-QM; Thu, 01 Mar 2018 18:06:47 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1erSbP-0005oz-Af; Thu, 01 Mar 2018 18:06:47 +0000 From: Mark Brown To: Hans de Goede In-Reply-To: <20180225104713.4745-6-hdegoede@redhat.com> Message-Id: Date: Thu, 01 Mar 2018 18:06:47 +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: rt5651: Add rt5651_apply_properties() helper function" 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: rt5651: Add rt5651_apply_properties() helper function 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 5f293d4354f8aae3c8617f83a3cbd30047676b4d Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 25 Feb 2018 11:46:46 +0100 Subject: [PATCH] ASoC: rt5651: Add rt5651_apply_properties() helper function Move the applying of the differential input and dmic properties to a new rt5651_apply_properties() helper function. This new function can be called by platform code which attaches properties after probe() has run to apply these new properties. Note this also moves the time when we apply these properties for DT platforms from i2c-probe to snd-component-probe time, this should not result in any functional difference. Signed-off-by: Hans de Goede Signed-off-by: Mark Brown --- sound/soc/codecs/rt5651.c | 22 ++++++++++++++-------- sound/soc/codecs/rt5651.h | 2 ++ 2 files changed, 16 insertions(+), 8 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/codecs/rt5651.c b/sound/soc/codecs/rt5651.c index 030889143249..4d93248b6401 100644 --- a/sound/soc/codecs/rt5651.c +++ b/sound/soc/codecs/rt5651.c @@ -1659,6 +1659,18 @@ static int rt5651_set_jack(struct snd_soc_component *component, return 0; } +void rt5651_apply_properties(struct snd_soc_component *component) +{ + if (device_property_read_bool(component->dev, "realtek,in2-differential")) + snd_soc_component_update_bits(component, RT5651_IN1_IN2, + RT5651_IN_DF2, RT5651_IN_DF2); + + if (device_property_read_bool(component->dev, "realtek,dmic-en")) + snd_soc_component_update_bits(component, RT5651_GPIO_CTRL1, + RT5651_GP2_PIN_MASK, RT5651_GP2_PIN_DMIC1_SCL); +} +EXPORT_SYMBOL_GPL(rt5651_apply_properties); + static int rt5651_probe(struct snd_soc_component *component) { struct rt5651_priv *rt5651 = snd_soc_component_get_drvdata(component); @@ -1677,6 +1689,8 @@ static int rt5651_probe(struct snd_soc_component *component) snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); + rt5651_apply_properties(component); + return 0; } @@ -1932,14 +1946,6 @@ static int rt5651_i2c_probe(struct i2c_client *i2c, if (ret != 0) dev_warn(&i2c->dev, "Failed to apply regmap patch: %d\n", ret); - if (device_property_read_bool(&i2c->dev, "realtek,in2-differential")) - regmap_update_bits(rt5651->regmap, RT5651_IN1_IN2, - RT5651_IN_DF2, RT5651_IN_DF2); - - if (device_property_read_bool(&i2c->dev, "realtek,dmic-en")) - regmap_update_bits(rt5651->regmap, RT5651_GPIO_CTRL1, - RT5651_GP2_PIN_MASK, RT5651_GP2_PIN_DMIC1_SCL); - rt5651->irq = i2c->irq; rt5651->hp_mute = 1; diff --git a/sound/soc/codecs/rt5651.h b/sound/soc/codecs/rt5651.h index f3158488fc89..7d9d5fa09d6f 100644 --- a/sound/soc/codecs/rt5651.h +++ b/sound/soc/codecs/rt5651.h @@ -2080,4 +2080,6 @@ struct rt5651_priv { bool hp_mute; }; +void rt5651_apply_properties(struct snd_soc_component *component); + #endif /* __RT5651_H__ */