From patchwork Mon Nov 27 18:52:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 119773 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp2100634edl; Mon, 27 Nov 2017 10:54:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMbgxPH59n1jQuoeIQuihMwbcfYbLKE2pmbq5cbMep9oGqH3enKmalqA0tmrUwMl3gSBrOS2 X-Received: by 10.223.136.50 with SMTP id d47mr2811004wrd.76.1511808873958; Mon, 27 Nov 2017 10:54:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511808873; cv=none; d=google.com; s=arc-20160816; b=hgHu+K+aqvZfPIwAs78IMJhUj1PDLC/8QySJUycXgHIa4hEPDd694u6up0LwKZnmgb tw/ajWhNcyNTGRuRqa56bSPSc8E7SGERUu5StTN98WbXkWoyixg7zrtTr6x2i4Vu/co5 pJiwjSi3sVpRvr1ulCK9VO8OO6ejVO82VbuCZ5u6EDXFfEl/JiB/eZaBK45snrNHQo5B D15XLbRWSDI08ip/w5xbiLAXwKzYKy6X9sm3ABSYVZfN8iq4kKBmzAU5PUphCJq9Fjkx Y3usRhnBip2PdasdkPvGRNGkKrB44HB4e1F3Q0+oMtOgZdI0ymTUm3WjBlPYHynAiQml uCRA== 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=Umzc1nbAC0ex0x30QeKZF9rVfBAp3Zo2UKrcgwD8fUM=; b=D+kblbRkoirrrb8NekVNQCvBLuv7W4Nf8Qs8Bd/+04+ImT8T3YeACt97zqm7QY1FuY RnheXQxM9uO41MhrDP5nEXeVBd24JTJKMSBtM8Y3dKxM+H/MfegK2+OJ+bJWz7Q9M42v 8iLGi3xU5E4aGZMj2SSOESJhOFOzenb1xeh5yQRo62lMg7qg5iHAsKvoUymEQrXMBHst zQJcOlB1XVXIt3awPPJTEhE3SZoMM51oMRlxT9bl1b7cDoqQvhd/O19gMF3dOsX2Ds+4 qrpt7oYKZdoNQLzJbyrZ5OlTY2vwwmGQbUGd3Uhx7yKy2J2Ew04S07METGyO0267/Hr9 h8jg== 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=lQNDPlCY; 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 t84si11389091wmt.58.2017.11.27.10.54.33; Mon, 27 Nov 2017 10:54:33 -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=lQNDPlCY; 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 807F12675C4; Mon, 27 Nov 2017 19:52:36 +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 5E02A2675C3; Mon, 27 Nov 2017 19:52:35 +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 AB84B267588 for ; Mon, 27 Nov 2017 19:52:21 +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=mtd/tbcmOtnd989S65bL4ZoVne+BIW04a01f47bNdGU=; b=lQNDPlCYYkUS DFXfQKb343u/POOwKme4xrxJWckYu28sM5i5ATZJFdns7kmuc3E823071HR/suOPLYXDoYPXxEpFO rW74YMS0yhgbsBQzP7QpUHqgBGev0Fnmxkg6uXLZGZFnvB3jgUyhoiBqvMf2Cideiq+/W4dsEmJFI FwNR4=; 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 1eJOVu-000701-8M; Mon, 27 Nov 2017 18:52:18 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1eJOVt-0006v5-Rz; Mon, 27 Nov 2017 18:52:17 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87fuc7m11v.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 27 Nov 2017 18:52:17 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown , Lars-Peter Subject: [alsa-devel] Applied "ASoC: don't use codec hw_write on uda1380" 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 uda1380 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 eaa53216c5909ae1567d15888e55d9b1d7269ca7 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 9 Nov 2017 00:19:33 +0000 Subject: [PATCH] ASoC: don't use codec hw_write on uda1380 uda1380 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/uda1380.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 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/uda1380.c b/sound/soc/codecs/uda1380.c index 926c81ae8185..44448023edb0 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c @@ -37,7 +37,7 @@ struct uda1380_priv { struct snd_soc_codec *codec; unsigned int dac_clk; struct work_struct work; - void *control_data; + struct i2c_client *i2c; }; /* @@ -92,6 +92,7 @@ static inline void uda1380_write_reg_cache(struct snd_soc_codec *codec, static int uda1380_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int value) { + struct uda1380_priv *uda1380 = snd_soc_codec_get_drvdata(codec); u8 data[3]; /* data is @@ -111,10 +112,10 @@ static int uda1380_write(struct snd_soc_codec *codec, unsigned int reg, if (!snd_soc_codec_is_active(codec) && (reg >= UDA1380_MVOL)) return 0; pr_debug("uda1380: hw write %x val %x\n", reg, value); - if (codec->hw_write(codec->control_data, data, 3) == 3) { + if (i2c_master_send(uda1380->i2c, data, 3) == 3) { unsigned int val; - i2c_master_send(codec->control_data, data, 1); - i2c_master_recv(codec->control_data, data, 2); + i2c_master_send(uda1380->i2c, data, 1); + i2c_master_recv(uda1380->i2c, data, 2); val = (data[0]<<8) | data[1]; if (val != value) { pr_debug("uda1380: READ BACK VAL %x\n", @@ -130,6 +131,7 @@ static int uda1380_write(struct snd_soc_codec *codec, unsigned int reg, static void uda1380_sync_cache(struct snd_soc_codec *codec) { + struct uda1380_priv *uda1380 = snd_soc_codec_get_drvdata(codec); int reg; u8 data[3]; u16 *cache = codec->reg_cache; @@ -139,7 +141,7 @@ static void uda1380_sync_cache(struct snd_soc_codec *codec) data[0] = reg; data[1] = (cache[reg] & 0xff00) >> 8; data[2] = cache[reg] & 0x00ff; - if (codec->hw_write(codec->control_data, data, 3) != 3) + if (i2c_master_send(uda1380->i2c, data, 3) != 3) dev_err(codec->dev, "%s: write to reg 0x%x failed\n", __func__, reg); } @@ -148,6 +150,7 @@ static void uda1380_sync_cache(struct snd_soc_codec *codec) static int uda1380_reset(struct snd_soc_codec *codec) { struct uda1380_platform_data *pdata = codec->dev->platform_data; + struct uda1380_priv *uda1380 = snd_soc_codec_get_drvdata(codec); if (gpio_is_valid(pdata->gpio_reset)) { gpio_set_value(pdata->gpio_reset, 1); @@ -160,7 +163,7 @@ static int uda1380_reset(struct snd_soc_codec *codec) data[1] = 0; data[2] = 0; - if (codec->hw_write(codec->control_data, data, 3) != 3) { + if (i2c_master_send(uda1380->i2c, data, 3) != 3) { dev_err(codec->dev, "%s: failed\n", __func__); return -EIO; } @@ -695,9 +698,6 @@ static int uda1380_probe(struct snd_soc_codec *codec) uda1380->codec = codec; - codec->hw_write = (hw_write_t)i2c_master_send; - codec->control_data = uda1380->control_data; - if (!gpio_is_valid(pdata->gpio_power)) { ret = uda1380_reset(codec); if (ret) @@ -772,7 +772,7 @@ static int uda1380_i2c_probe(struct i2c_client *i2c, } i2c_set_clientdata(i2c, uda1380); - uda1380->control_data = i2c; + uda1380->i2c = i2c; ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_uda1380, uda1380_dai, ARRAY_SIZE(uda1380_dai));