From patchwork Wed Mar 7 14:14:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 130903 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp5233782lja; Wed, 7 Mar 2018 06:15:17 -0800 (PST) X-Google-Smtp-Source: AG47ELsSZjn6tioly0s4ScY88aBBc3UvoAy4hYH6IDL48GWxOeD3/c9eJ1w5AAUGXb14OaB7jzcP X-Received: by 10.28.211.132 with SMTP id k126mr13500593wmg.142.1520432117906; Wed, 07 Mar 2018 06:15:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520432117; cv=none; d=google.com; s=arc-20160816; b=VWHsiFMOskBuRjEZo3/B3THRKKcmjFNgfV+HKxToGO2G4odKAeFC+MXQ+2nMd+IMu8 00OnN8OVQbTCds5NrdWS8i1Hvx80nwm0KoemQGTMfDQigV+sbKOgtADbxlcyCZGq8oYe Tef69rJ7KosxeHCtY1tRPs52SLcnuhZ9v/UMdKABP8eUPQfqcBMFqNS9e8D4PxXGll8o KzTP9GqbXdflTObPec+5zF3WTnoHLloKVja6GM3ui/YXOoZOCJ6sn2F/uxq8TFUmX50Z 5tGB7hDDWleyyd81kkT2Kc0252zO1DWQGlEEDnRYqdTofTbO2OBDXp1x001eOqwqkr67 ZuCQ== 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=oW9q/fYk6xnnsCvKKi1YQKtZ1yaiFelLDyblrzBmnXY=; b=klztF7wApLr+WRchLdxztMvx1h7mhzHpSB9uE0Ar8mPTx+ih8gYDbomSIB1+Q+BGdJ Yjli3fs7bjEctFLuj2rLkX9ETmb9ftsIcJ4OALZYzZkEtPzYpEbV4E7MiYT8zteSaXSG aYjO9jhnZVjgIkFgYZUk78Tg0s6o81b3QJDEUXfLqBQMkfifhna1XfFdsAI8TLTSTZJY +RC9l5CbbBWJxlc/1uTuHpAcib7pXA2OddL7b38vI+CQxI2oPlo04lQbKnS3mujv3Tqj 8VwkUabzXMnOOp67fiTs0IkJvVFj7j1QX80jsLoI0lgTrZbRAqhxX1BGMll1/fGhtD3q IsMw== 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=meh3kDdU; 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 s12si12899245wrg.395.2018.03.07.06.15.17; Wed, 07 Mar 2018 06:15:17 -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=meh3kDdU; 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 E33952673F4; Wed, 7 Mar 2018 15:15:04 +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 35829267429; Wed, 7 Mar 2018 15:15: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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, PRX_BODY_76, 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 49E41267339 for ; Wed, 7 Mar 2018 15:15: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=95ACQA1MO+58P9kw88gebvdpdiAyoonyjeCsAPdLhPk=; b=meh3kDdUiPIZ 84kznLBPKEpdJbzTqL6kNJwTvDkyOvY+t3CBkd5C8MOdRkKsi0BfqTT25Apu+vtIh+KV4I27OmfSP cJ0N0G9yuC6kSy8vU6zofRDDqVNTCXd2hMI5jTGvGNXDl2CnpQnO37lt+6qEBQzxhwsNrD5tdOtff rppPE=; 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 1etZqK-0000Bf-K3; Wed, 07 Mar 2018 14:14:56 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1etZqK-0001Vs-5X; Wed, 07 Mar 2018 14:14:56 +0000 From: Mark Brown To: Hans de Goede In-Reply-To: <20180304143610.21125-2-hdegoede@redhat.com> Message-Id: Date: Wed, 07 Mar 2018 14:14:56 +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: Make rt5651_apply_properties() private" 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: Make rt5651_apply_properties() private 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 1cf5b50426136fe54380a7dd1ca7eb49973cae5a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 4 Mar 2018 15:35:49 +0100 Subject: [PATCH] ASoC: rt5651: Make rt5651_apply_properties() private The idea behind exporting rt5651_apply_properties(), was for it to be used on platforms where the platform code may need to add device-properties, rather then relying only on properties set by the firmware. The platform code could then call rt5651_apply_properties() after adding properties to make sure that the codec driver was aware of the new properties. But this is not necessary, as long as we do all property parsing from the codec component-driver's probe function (or later) then the machine driver can attach properties before calling snd_soc_register_card and calling rt5651_apply_properties() for ordering reasons is not necessary. This commit makes rt5651_apply_properties() private and adds 2 comments documenting that all property parsing must be done from the codec component-driver's probe function. Signed-off-by: Hans de Goede Signed-off-by: Mark Brown --- sound/soc/codecs/rt5651.c | 14 ++++++++++++-- sound/soc/codecs/rt5651.h | 2 -- 2 files changed, 12 insertions(+), 4 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 55bcc74e344f..767a05e009df 100644 --- a/sound/soc/codecs/rt5651.c +++ b/sound/soc/codecs/rt5651.c @@ -1666,7 +1666,14 @@ static int rt5651_set_jack(struct snd_soc_component *component, return 0; } -void rt5651_apply_properties(struct snd_soc_component *component) +/* + * Note on some platforms the platform code may need to add device-properties, + * rather then relying only on properties set by the firmware. Therefor the + * property parsing MUST be done from the component driver's probe function, + * rather then from the i2c driver's probe function, so that the platform-code + * can attach extra properties before calling snd_soc_register_card(). + */ +static 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, @@ -1676,7 +1683,6 @@ void rt5651_apply_properties(struct snd_soc_component *component) 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) { @@ -1893,6 +1899,10 @@ static void rt5651_jack_detect_work(struct work_struct *work) snd_soc_jack_report(rt5651->hp_jack, report, SND_JACK_HEADSET); } +/* + * Note this function MUST not look at device-properties, see the comment + * above rt5651_apply_properties(). + */ static int rt5651_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { diff --git a/sound/soc/codecs/rt5651.h b/sound/soc/codecs/rt5651.h index 7d9d5fa09d6f..f3158488fc89 100644 --- a/sound/soc/codecs/rt5651.h +++ b/sound/soc/codecs/rt5651.h @@ -2080,6 +2080,4 @@ struct rt5651_priv { bool hp_mute; }; -void rt5651_apply_properties(struct snd_soc_component *component); - #endif /* __RT5651_H__ */