From patchwork Mon Nov 27 18:52:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 119771 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp2099901edl; Mon, 27 Nov 2017 10:53:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMZu3XZo80ODP29PU2wFYGB10IO5A/U7RhGW/6jMbY357QQ3uTINieXg/ynXKGWiTtlq6C4J X-Received: by 10.28.87.207 with SMTP id l198mr18040910wmb.45.1511808830653; Mon, 27 Nov 2017 10:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511808830; cv=none; d=google.com; s=arc-20160816; b=CgVt+OmQ/5S/MJsb+rVWSNbpI0d3RR0VqpFXf9Yhb58QGCcXA70ukggQSVv42WJR/u hwOKL9dUgj/Ffz4agYfYw9peDz2gM7Aup1YKHb9zl1cpTkYd+2Ob4eBi5HO586Wk1oW+ ZHwIxsSmwwQ4uaAzrlJmN3UjizGCNz7dDmLGkbfjxI6wzOAf3hSghbSs75yrL3gkSqnA C6WyPcLUkplsQUd/A61yGf0bPD/YzebjULDy9t1o/yJ5Je5NOTXTbh60E76o/4ZA+tB3 meTJwFDOFe7inyc7nLLaiYD+zefijC2VU/3g2FISkdjRwtavh7SxQ9CfMeje5rF4AnAh J/DQ== 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=DE4VFEulWQ+Xi1QyFULU4CmU6Ah0BUhK9YTMlfYBs+U=; b=WEx/L1YBAvxONxPzetdz2mC8ehFnFosg2PaDZ+UuYAkHuGvXxJPwsWy4MwzGw6d8Yl cdX8ijo1IOTd6SSoHv+srG0IiwPXFQcEVV3K0KvVsxaep6QfLAKG/ebisQ9t0w9iyIs3 qbLO9obyl6hdqW0qZMyUmnVhEU17EtiKAFN25OR/cwP+DsnENGkCRjChxo1fasqQFpv7 5TxuwL01MtPymL+gUo10nODMkopGfaiSPnWfwbE/m6Qu4escyesBGhZq9dO9w8yWJkCF b6saO5cPfKtpYIHYHxphDTCiOkL5wQFUVL8xvSLtyoKdEcCocQF51fsoDXkNblqHaJJi oNPg== 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=O/u50DIg; 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 q34si21965193wrb.208.2017.11.27.10.53.50; Mon, 27 Nov 2017 10:53:50 -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=O/u50DIg; 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 B59B02675A7; Mon, 27 Nov 2017 19:52:27 +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 DF55226759E; Mon, 27 Nov 2017 19:52:23 +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.0 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 87FBE26758B for ; Mon, 27 Nov 2017 19:52:12 +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=z38n9O5KCCHL3kMsjQcjSzZFpGa5cunLK6CT2ONjF3o=; b=O/u50DIgfMlR mIgX/E1Z3VV2WoAJdSE9nvxi3ME/I4RLrcwFzbrNaRIOZLyPuHiC2qt2MkX1yYR2MNRgRh5IUuUnO dxVdoZm6bHHhjVkzWcdBL/UiJ6tC7WBGKNleGyYXvOKPaW5kO0HmbPRmqylZOKh9jnA1QF1Ot1h/X KGSqA=; 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 1eJOVl-0006zh-6L; Mon, 27 Nov 2017 18:52:09 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1eJOVk-0006sc-P3; Mon, 27 Nov 2017 18:52:08 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87bmmvm108.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 27 Nov 2017 18:52:08 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown , Lars-Peter Subject: [alsa-devel] Applied "ASoC: don't use codec hw_write on twl6040" 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: don't use codec hw_write on twl6040 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 3bd333677d6091d989068b0f7ff7aba975e62dc5 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 9 Nov 2017 01:04:37 +0000 Subject: [PATCH] ASoC: don't use codec hw_write on twl6040 twl6040 driver is using codec hw_write/control_data, but it is redundant code. This patch cleanup these Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/codecs/twl6040.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.15.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 1773ff84ee3b..a8e6941a1868 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -106,10 +106,12 @@ static const struct snd_pcm_hw_constraint_list sysclk_constraints[] = { { .count = ARRAY_SIZE(hp_rates), .list = hp_rates, }, }; +#define to_twl6040(codec) dev_get_drvdata((codec)->dev->parent) + static unsigned int twl6040_read(struct snd_soc_codec *codec, unsigned int reg) { struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); - struct twl6040 *twl6040 = codec->control_data; + struct twl6040 *twl6040 = to_twl6040(codec); u8 value; if (reg >= TWL6040_CACHEREGNUM) @@ -171,7 +173,7 @@ static inline void twl6040_update_dl12_cache(struct snd_soc_codec *codec, static int twl6040_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int value) { - struct twl6040 *twl6040 = codec->control_data; + struct twl6040 *twl6040 = to_twl6040(codec); if (reg >= TWL6040_CACHEREGNUM) return -EIO; @@ -572,7 +574,7 @@ EXPORT_SYMBOL_GPL(twl6040_get_trim_value); int twl6040_get_hs_step_size(struct snd_soc_codec *codec) { - struct twl6040 *twl6040 = codec->control_data; + struct twl6040 *twl6040 = to_twl6040(codec); if (twl6040_get_revid(twl6040) < TWL6040_REV_ES1_3) /* For ES under ES_1.3 HS step is 2 mV */ @@ -830,7 +832,7 @@ static const struct snd_soc_dapm_route intercon[] = { static int twl6040_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { - struct twl6040 *twl6040 = codec->control_data; + struct twl6040 *twl6040 = to_twl6040(codec); struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); int ret = 0; @@ -922,7 +924,7 @@ static int twl6040_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_codec *codec = dai->codec; - struct twl6040 *twl6040 = codec->control_data; + struct twl6040 *twl6040 = to_twl6040(codec); struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); int ret; @@ -964,7 +966,7 @@ static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai, static void twl6040_mute_path(struct snd_soc_codec *codec, enum twl6040_dai_id id, int mute) { - struct twl6040 *twl6040 = codec->control_data; + struct twl6040 *twl6040 = to_twl6040(codec); struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); int hslctl, hsrctl, earctl; int hflctl, hfrctl; @@ -1108,7 +1110,6 @@ static struct snd_soc_dai_driver twl6040_dai[] = { static int twl6040_probe(struct snd_soc_codec *codec) { struct twl6040_data *priv; - struct twl6040 *twl6040 = dev_get_drvdata(codec->dev->parent); struct platform_device *pdev = to_platform_device(codec->dev); int ret = 0; @@ -1119,7 +1120,6 @@ static int twl6040_probe(struct snd_soc_codec *codec) snd_soc_codec_set_drvdata(codec, priv); priv->codec = codec; - codec->control_data = twl6040; priv->plug_irq = platform_get_irq(pdev, 0); if (priv->plug_irq < 0) {