From patchwork Tue Jul 10 18:16:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 141644 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4203016ljj; Tue, 10 Jul 2018 11:17:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcKW0gWhCQ0oth1BeUluxgH3+kk+ZtfBm18YHohh9LuevZgVuKe64eli/ih47MBGHzAhRRE X-Received: by 2002:a1c:ca0f:: with SMTP id a15-v6mr15023062wmg.102.1531246660604; Tue, 10 Jul 2018 11:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531246660; cv=none; d=google.com; s=arc-20160816; b=Mg9Ld/YeWVFeH+6SodDeb/jhJZtYJahaHV94fmUTn+OBrcYdXN6amjv6pArMmuByZv WAWTDqQdKCpUVeoMQr3JemaaQnK1bxDFTnBj9WwfX9THPvZLU0Od0qtes0jxk0VihTXc +M+6MAVh6YI7GBiCIFQxKOiym5Fjxe704pm46UK8wDqBy1w0Htt9m72EZTMmoA/5LVaM vmyWIzEG9Ob1JNTU55BUgL+XA8brWDgpPm6cbroVSYoq4YUuJAySP3NLhltOWdLR6bFJ CsmlaiUPZNp/Jr8SbJ1x6tw7JMcc3sMGUdqq8GS+0JFqTOezRo/cFtb0eRjhoXTWnd+6 ioZg== 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=aChGwptkotwAoEX2jL3cM0rZBtY9ORAvs31w77bLbgQ=; b=WeH9iDhGonlRsbRg3q6wIEpeCu6BpK4ItCJJvC+i3kuANHiwzNDJWgBBgqyzWNsnqy 4YO3ig+SGh5dDdJDqVHFzWSgo1m4IkWdPGajImVSe6yiKlSaEfXeO2oXxMnB8ZxukVoF QF/SBRndsYhTS7C85nuw94sgk944lEE78/mRTMhu/3PQ5n3iyBeUTgtTg9/rZ74L7jZB WA8/fwPPhlMI1Qx3ZV1yhHfW3KAdHge82X5jBpiyMOZ8CHkPJnEVkPHd9yGNBvCrp0xu QO6vkfIA+o30WyVMVvbaDfmbsvMKHr0blONW88VhVmlScEXcM8q1incUD8qPa6QROlEt Tg/Q== 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=S1rd0AsU; 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 t66-v6si79069wmf.31.2018.07.10.11.17.40; Tue, 10 Jul 2018 11:17:40 -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=S1rd0AsU; 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 30D6526774B; Tue, 10 Jul 2018 20:17:00 +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 0E338267727; Tue, 10 Jul 2018 20:16:50 +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=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, 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 755C1267713 for ; Tue, 10 Jul 2018 20:16:48 +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=F+R065yxt55oB/bklaf6H1oWgwMiE3G9NpkdJcpMDW8=; b=S1rd0AsU5/lY RfgaC00xg/uSWrYIUmNe+JFl6vz1K/Vn1naC9IJg0Fx7fJKhIRXt3uNBHeK24HZmOAKo+shFadVsU y1998sYJEOLX+h9oYqd8cDwZBMJ8BldWuSZETXva7o/+bvPINChgxIKIKLJ2lMd69c74Bc3vNp27c JA3pM=; 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 1fcxBr-00029h-LE; Tue, 10 Jul 2018 18:16:43 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fcxBr-0001lY-6U; Tue, 10 Jul 2018 19:16:43 +0100 From: Mark Brown To: Hans de Goede In-Reply-To: <20180701183631.5532-2-hdegoede@redhat.com> Message-Id: Date: Tue, 10 Jul 2018 19:16:43 +0100 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: Move getting of codec_dev into probe()" 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: Move getting of codec_dev into probe() 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 2c375204bfad2f481feb006a82cdb67cc570b670 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 1 Jul 2018 20:36:30 +0200 Subject: [PATCH] ASoC: Intel: bytcr_rt5651: Move getting of codec_dev into probe() Move the getting of the codec_dev, to add device-props to it, out of byt_rt5651_add_codec_device_props() and into its caller, snd_byt_rt5651_mc_probe(). This is a preparation patch for adding support for an external amplifier enable GPIO, which requires further accesses to the codec_dev. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- sound/soc/intel/boards/bytcr_rt5651.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) -- 2.18.0.rc2 _______________________________________________ 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 80f47a45cb10..d920725ce603 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -403,15 +403,10 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = { * Note this MUST be called before snd_soc_register_card(), so that the props * are in place before the codec component driver's probe function parses them. */ -static int byt_rt5651_add_codec_device_props(const char *i2c_dev_name) +static int byt_rt5651_add_codec_device_props(struct device *i2c_dev) { struct property_entry props[MAX_NO_PROPS] = {}; - struct device *i2c_dev; - int ret, cnt = 0; - - i2c_dev = bus_find_device_by_name(&i2c_bus_type, NULL, i2c_dev_name); - if (!i2c_dev) - return -EPROBE_DEFER; + int cnt = 0; props[cnt++] = PROPERTY_ENTRY_U32("realtek,jack-detect-source", BYT_RT5651_JDSRC(byt_rt5651_quirk)); @@ -425,10 +420,7 @@ static int byt_rt5651_add_codec_device_props(const char *i2c_dev_name) if (byt_rt5651_quirk & BYT_RT5651_DMIC_EN) props[cnt++] = PROPERTY_ENTRY_BOOL("realtek,dmic-en"); - ret = device_add_properties(i2c_dev, props); - put_device(i2c_dev); - - return ret; + return device_add_properties(i2c_dev, props); } static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime) @@ -696,6 +688,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) const char * const mic_name[] = { "dmic", "in1", "in12" }; struct byt_rt5651_private *priv; struct snd_soc_acpi_mach *mach; + struct device *codec_dev; const char *i2c_name = NULL; const char *hp_swapped; bool is_bytcr = false; @@ -731,6 +724,11 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) "%s%s", "i2c-", i2c_name); byt_rt5651_dais[dai_index].codec_name = byt_rt5651_codec_name; + codec_dev = bus_find_device_by_name(&i2c_bus_type, NULL, + byt_rt5651_codec_name); + if (!codec_dev) + return -EPROBE_DEFER; + /* * swap SSP0 if bytcr is detected * (will be overridden if DMI quirk is detected) @@ -794,7 +792,8 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) dmi_check_system(byt_rt5651_quirk_table); /* Must be called before register_card, also see declaration comment. */ - ret_val = byt_rt5651_add_codec_device_props(byt_rt5651_codec_name); + ret_val = byt_rt5651_add_codec_device_props(codec_dev); + put_device(codec_dev); if (ret_val) return ret_val;