From patchwork Tue Dec 4 08:00:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10711251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E15A11731 for ; Tue, 4 Dec 2018 08:00:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4C9B2A8CE for ; Tue, 4 Dec 2018 08:00:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C69792A915; Tue, 4 Dec 2018 08:00:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 113672A8CE for ; Tue, 4 Dec 2018 08:00:55 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id F32DE267B2F; Tue, 4 Dec 2018 09:00:53 +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 12D54267B31; Tue, 4 Dec 2018 09:00:52 +0100 (CET) Received: from JPN01-OS2-obe.outbound.protection.outlook.com (mail-eopbgr1410125.outbound.protection.outlook.com [40.107.141.125]) by alsa0.perex.cz (Postfix) with ESMTP id E63F626789B for ; Tue, 4 Dec 2018 09:00:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nh9iuQVwBRc43g1PtobxT6lvjSAu4myHDfbn6vJCLo0=; b=jI/uZyK7gkK+Y044iihhLW8yj1AliG7qae/ACFLuPBheF7JG2BQAfBSTc8GJKPJR5uv21fnD5L26V7neeZ3eDPnBWipU0WNN+hMtOmr4kAHJ7q0GN+uu/7uA445nuirzpzq/4lGDdA24Sl/su7/E746Ew6e7amPTift0sUoB/ws= Received: from TYAPR01MB3661.jpnprd01.prod.outlook.com (20.178.137.210) by TYAPR01MB3405.jpnprd01.prod.outlook.com (20.178.136.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Tue, 4 Dec 2018 08:00:47 +0000 Received: from TYAPR01MB3661.jpnprd01.prod.outlook.com ([fe80::70b6:5ef2:3f71:77c7]) by TYAPR01MB3661.jpnprd01.prod.outlook.com ([fe80::70b6:5ef2:3f71:77c7%4]) with mapi id 15.20.1382.020; Tue, 4 Dec 2018 08:00:47 +0000 From: Kuninori Morimoto To: Mark Brown Thread-Topic: [PATCH] ASoC: rsnd: fixup mod ID for CTU regmap read/write Thread-Index: AQHUi6d3IrhKDUN/NEu6OFi1kQ2HpA== Date: Tue, 4 Dec 2018 08:00:47 +0000 Message-ID: <87in093f2p.wl-kuninori.morimoto.gx@renesas.com> Accept-Language: ja-JP, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TY2PR02CA0041.apcprd02.prod.outlook.com (2603:1096:404:a6::29) To TYAPR01MB3661.jpnprd01.prod.outlook.com (2603:1096:404:c1::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [211.11.155.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TYAPR01MB3405; 20:Mn+TdC/8QjzKt4kLa5vYd2fghZAFNC3JkQYpm8p9fS+yLyEU7LIG7/d0+XUpFqovof6dgwPpHS7EnwSdThK3ctnucPQSewnRLDDz7a81Cvded+Ji7Fq7xFXEjsheBl698ZJunqdrsyDcs/cLXdpzZ/7uT5zRWaP/Uy/w2HLGBOM= x-ms-office365-filtering-correlation-id: 2cb38f95-459d-4be5-908d-08d659be9965 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:TYAPR01MB3405; x-ms-traffictypediagnostic: TYAPR01MB3405: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231455)(999002)(944501493)(52105112)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:TYAPR01MB3405; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB3405; x-forefront-prvs: 0876988AF0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(376002)(366004)(39860400002)(396003)(346002)(199004)(189003)(52116002)(3846002)(102836004)(6916009)(6116002)(2616005)(305945005)(7736002)(6486002)(486006)(71190400001)(71200400001)(186003)(6436002)(476003)(14454004)(66066001)(97736004)(86362001)(386003)(6506007)(36756003)(316002)(6512007)(53936002)(2906002)(68736007)(106356001)(478600001)(5660300001)(25786009)(26005)(99286004)(105586002)(4326008)(256004)(14444005)(8936002)(81166006)(81156014)(8676002); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB3405; H:TYAPR01MB3661.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: /SZaGrY243q5upLkNDQrcmAEZebM/qLWaaRrAunQNnQgCLNsHHPmpBaP0MLETelYQiz1XXdC52LFC6m6VsRXVlMEwlBe0564CwF6SWHeCHAhaoLuyn0VypOuQmIBgsqDzjLfRp9+CX7AN7AOMyGFe8bSM4XWXCDElt5qff4Whj0iLWYNBan635m3aAxqhyvjYxh0GNRLV2AeMhEian9ezYwb9j8uIkLryvzVDtA6xRrb2DNGd6jXEMFVJCRHS7lqwOM5xUauX1BAB+HA501nivKiROgPUw3VrUIIm/A+g3YeMVcufHvh3eSnlZWP8mn0s9R/wtaLCgyHIPZlILcS9F+npGhysr+apsoP0a5B+2o= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cb38f95-459d-4be5-908d-08d659be9965 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Dec 2018 08:00:47.4684 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB3405 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH] ASoC: rsnd: fixup mod ID for CTU regmap read/write 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto 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 --- 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;