From patchwork Mon Nov 27 18:51:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 119769 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp2099119edl; Mon, 27 Nov 2017 10:53:05 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ9/BNAaoWGYydRLrAigzX0IXcwYqpLo/83V+ivxFz0ipySgm/OzVbs82bELEHzZStg2afP X-Received: by 10.223.179.215 with SMTP id x23mr10045494wrd.198.1511808785609; Mon, 27 Nov 2017 10:53:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511808785; cv=none; d=google.com; s=arc-20160816; b=Oci8KXK6csklujzZaKOL0hzGhhSAAAQ3OzxmWzP0DYxatOr6rPABIEmlMav4IN4XZj y9lrdtxstm1QiLm1YiC99eH32KM7QYVvhswltvkhzrFTwLTaAAQmKWcO40XeEah1i4LM IjJNoi0kFUxlhmnn5HXsOwpCZc9pRmBAlkey0EIeiNdyLYObHNU+/hVq/c+N8diiuzLE oxr77QLgHG6GIhQGmhOzf8J5R4vnN+z0a8UYROkJpTkdjKEbtqOJt9jn6rWMPo1cqzb9 cTpIqieQaPjjMwXC4joM3JAxuFcVjWYuvEIx6Mfz3k3/hQQ7DguBdZo+vpv3QunSuQQW kSbA== 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=MVmi9sJViyF5FE1DTWRN1mCZ1sB5qhk3L7/Dti2qd3c=; b=ktIGeckIXh/n34Gve+57DXQ5SeTG59+FG+HQl3encJgDDauEVV5Y1F++VtuuQGhj8Z 3Vvp4r8wGXkyIY6BmgZTqpxKMgIs72Yb6pfWleAbzg9giUuZCigDidR9DubAtcWj9Ajt z1OCs7ioqkxBU0PQ84wyTqVVUFXgTqF3q1HSknsC+qy/lEkVKoBifdH+Cd1T0mEfdEwl Bd0m8vkFwAaKrFJN4oJm25Brot32NTAG7EPkznH3veafXqP3zEYe4JtxDzr/p/6TAkVp KjoaU5mhlLirTu8gOxEKYAjOZMdXrgwzeyvUXh81Juon8gyJiZcEGGr3RYBA9/+6Guxz XWkQ== 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=p3wgeyb3; 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 m70si4886920wma.241.2017.11.27.10.53.05; Mon, 27 Nov 2017 10:53:05 -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=p3wgeyb3; 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 DDC99267574; Mon, 27 Nov 2017 19:52:09 +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 D4E20267558; Mon, 27 Nov 2017 19:52:05 +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 2499C267567 for ; Mon, 27 Nov 2017 19:52:02 +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=RoXVIrzURG61+vzbnXyrnOUeXDIUdApVUeEKoo+cf7c=; b=p3wgeyb3BbFP NgdbqoWWoAUlYw9PA8Y8pMNEdVhkfIqLvTplpiyJiiegoZw403fy6EsP3veG7WCHhP6/QpMVh4lDi zEaMd7xuU6f6MR/tl+LKc3OmEOk+1eF25NGWO9gw1SPP+LBHIVtK2gn9Jb/30xBLomyfHM+vc8Qbu sYZQc=; 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 1eJOVb-0006zM-Pj; Mon, 27 Nov 2017 18:51:59 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1eJOVb-0006pa-Cj; Mon, 27 Nov 2017 18:51:59 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <874lsnm02f.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 27 Nov 2017 18:51:59 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown , Lars-Peter Subject: [alsa-devel] Applied "ASoC: use internal reg_cache 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: use internal reg_cache 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 c001bf633a910cfc8a5b84b80634db4636bf1724 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 14 Nov 2017 01:04:08 +0000 Subject: [PATCH] ASoC: use internal reg_cache on uda1380 Codec reg_cache is legacy feature and very few driver only are using it. But, ALSA SoC framework needs to support it. Codec will be merged into Component in the future, so, let's remove legacy and unused feature from framework. This patch implements ALSA SoC reg_cache feature into driver, and don't use ALSA SoC framework's feature. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/codecs/uda1380.c | 24 ++++++++++++++---------- 1 file changed, 14 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 44448023edb0..46a495b4da8d 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c @@ -38,6 +38,7 @@ struct uda1380_priv { unsigned int dac_clk; struct work_struct work; struct i2c_client *i2c; + u16 *reg_cache; }; /* @@ -63,7 +64,9 @@ static unsigned long uda1380_cache_dirty; static inline unsigned int uda1380_read_reg_cache(struct snd_soc_codec *codec, unsigned int reg) { - u16 *cache = codec->reg_cache; + struct uda1380_priv *uda1380 = snd_soc_codec_get_drvdata(codec); + u16 *cache = uda1380->reg_cache; + if (reg == UDA1380_RESET) return 0; if (reg >= UDA1380_CACHEREGNUM) @@ -77,7 +80,8 @@ static inline unsigned int uda1380_read_reg_cache(struct snd_soc_codec *codec, static inline void uda1380_write_reg_cache(struct snd_soc_codec *codec, u16 reg, unsigned int value) { - u16 *cache = codec->reg_cache; + struct uda1380_priv *uda1380 = snd_soc_codec_get_drvdata(codec); + u16 *cache = uda1380->reg_cache; if (reg >= UDA1380_CACHEREGNUM) return; @@ -134,7 +138,7 @@ 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; + u16 *cache = uda1380->reg_cache; /* Sync reg_cache with the hardware */ for (reg = 0; reg < UDA1380_MVOL; reg++) { @@ -722,16 +726,9 @@ static int uda1380_probe(struct snd_soc_codec *codec) static const struct snd_soc_codec_driver soc_codec_dev_uda1380 = { .probe = uda1380_probe, - .read = uda1380_read_reg_cache, - .write = uda1380_write, .set_bias_level = uda1380_set_bias_level, .suspend_bias_off = true, - .reg_cache_size = ARRAY_SIZE(uda1380_reg), - .reg_word_size = sizeof(u16), - .reg_cache_default = uda1380_reg, - .reg_cache_step = 1, - .component_driver = { .controls = uda1380_snd_controls, .num_controls = ARRAY_SIZE(uda1380_snd_controls), @@ -771,6 +768,13 @@ static int uda1380_i2c_probe(struct i2c_client *i2c, return ret; } + uda1380->reg_cache = devm_kmemdup(&i2c->dev, + uda1380_reg, + ARRAY_SIZE(uda1380_reg) * sizeof(u16), + GFP_KERNEL); + if (!uda1380->reg_cache) + return -ENOMEM; + i2c_set_clientdata(i2c, uda1380); uda1380->i2c = i2c;