From patchwork Thu Oct 17 07:05:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 11194965 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F14C315AB for ; Thu, 17 Oct 2019 07:09:36 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9F4720640 for ; Thu, 17 Oct 2019 07:09:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9F4720640 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bp.renesas.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=cip-dev-bounces@lists.cip-project.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CA45B10A0; Thu, 17 Oct 2019 07:07:23 +0000 (UTC) X-Original-To: cip-dev@lists.cip-project.org Delivered-To: cip-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 3E6C91087 for ; Thu, 17 Oct 2019 07:07:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 99053608 for ; Thu, 17 Oct 2019 07:07:20 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.67,306,1566831600"; d="scan'208";a="29316716" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 17 Oct 2019 16:07:19 +0900 Received: from be1yocto.ree.adwin.renesas.com (unknown [172.29.43.62]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 056F140A4D75; Thu, 17 Oct 2019 16:07:17 +0900 (JST) From: Biju Das To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek Date: Thu, 17 Oct 2019 08:05:09 +0100 Message-Id: <1571295929-47286-38-git-send-email-biju.das@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1571295929-47286-1-git-send-email-biju.das@bp.renesas.com> References: <1571295929-47286-1-git-send-email-biju.das@bp.renesas.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Biju Das Subject: [cip-dev] [PATCH 4.19.y-cip 37/57] ASoC: rsnd: fixup mod ID for CTU regmap read/write X-BeenThere: cip-dev@lists.cip-project.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cip-dev-bounces@lists.cip-project.org Errors-To: cip-dev-bounces@lists.cip-project.org From: Kuninori Morimoto commit 665c1ade11e8aee0db691c7a928de1586b712344 upstream. commit c16015f36cc12824 ("ASoC: rsnd: add .get_id/.get_id_sub") add new .get_id/.get_id_sub to indicate module ID/subID. It is used for SSIU and CTU. In SSIU case, subID indicates BUSIF, but register settings is based on SSIU ID. OTOH, in CTU case, subID indicates CTU channel, and register settings is based on it. This means regmap read/write function needs to care it. This patch fixup this issue. It can't play MIXed sound without this patch. Fixes: c16015f36cc12824 ("ASoC: rsnd: add .get_id/.get_id_sub") Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown Signed-off-by: Biju Das --- sound/soc/sh/rcar/ctu.c | 1 + sound/soc/sh/rcar/gen.c | 14 +++++++++++--- sound/soc/sh/rcar/rsnd.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c index 4dda7d9..ff41a5e 100644 --- a/sound/soc/sh/rcar/ctu.c +++ b/sound/soc/sh/rcar/ctu.c @@ -317,6 +317,7 @@ static struct rsnd_mod_ops rsnd_ctu_ops = { .get_status = rsnd_mod_get_status, .id = rsnd_ctu_id, .id_sub = rsnd_ctu_id_sub, + .id_cmd = rsnd_mod_id_raw, }; struct rsnd_mod *rsnd_ctu_mod_get(struct rsnd_priv *priv, int id) diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index ca63940..3283d67 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c @@ -71,6 +71,14 @@ static int rsnd_is_accessible_reg(struct rsnd_priv *priv, return 1; } +static int rsnd_mod_id_cmd(struct rsnd_mod *mod) +{ + if (mod->ops->id_cmd) + return mod->ops->id_cmd(mod); + + return rsnd_mod_id(mod); +} + u32 rsnd_read(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg) { @@ -81,7 +89,7 @@ u32 rsnd_read(struct rsnd_priv *priv, if (!rsnd_is_accessible_reg(priv, gen, reg)) return 0; - regmap_fields_read(gen->regs[reg], rsnd_mod_id(mod), &val); + regmap_fields_read(gen->regs[reg], rsnd_mod_id_cmd(mod), &val); dev_dbg(dev, "r %s - %-18s (%4d) : %08x\n", rsnd_mod_name(mod), @@ -100,7 +108,7 @@ void rsnd_write(struct rsnd_priv *priv, if (!rsnd_is_accessible_reg(priv, gen, reg)) return; - regmap_fields_force_write(gen->regs[reg], rsnd_mod_id(mod), data); + regmap_fields_force_write(gen->regs[reg], rsnd_mod_id_cmd(mod), data); dev_dbg(dev, "w %s - %-18s (%4d) : %08x\n", rsnd_mod_name(mod), @@ -117,7 +125,7 @@ void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, return; regmap_fields_force_update_bits(gen->regs[reg], - rsnd_mod_id(mod), mask, data); + rsnd_mod_id_cmd(mod), mask, data); dev_dbg(dev, "b %s - %-18s (%4d) : %08x/%08x\n", rsnd_mod_name(mod), diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 3c57129..94d51fe 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -306,6 +306,7 @@ struct rsnd_mod_ops { enum rsnd_mod_type type); int (*id)(struct rsnd_mod *mod); int (*id_sub)(struct rsnd_mod *mod); + int (*id_cmd)(struct rsnd_mod *mod); }; struct rsnd_dai_stream;