From patchwork Mon Nov 5 11:57:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 150173 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2506242ljp; Mon, 5 Nov 2018 03:57:50 -0800 (PST) X-Google-Smtp-Source: AJdET5fV0Xw4NY88vk1SX4bj2ctuNs5paWv8GsNUaoIIuFhkz0pvo+je8uouOThxGApWfx6Thf5S X-Received: by 2002:adf:f082:: with SMTP id n2-v6mr14379170wro.88.1541419070790; Mon, 05 Nov 2018 03:57:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541419070; cv=none; d=google.com; s=arc-20160816; b=KtM9fLW1pptLhjLLlBDbAt4FEngp25bHrn5zG0zM6XlDzJ6cQPfx7XX7O+D/NE0jGq aswgdhJR1tqCTeJYKZ3ZYakivhJzAQG13Ts67tyxOtOhmh9j7ef6Cm9Pa9CP7EOj/D8U IQ7GZ16bhuPQUNQb2HF9HV0tso5i1F9FeYfw3bNtk7NAkn4m7Yw9OzhXD5rCGUJ5ONsc z4YeDDhVVGf8WW1j9Hgv9Lhp2NaT3fBsTrPl7x0wNdQ0A0BLo8tbaNXpRP1czSQwboja h9STOT/lu8Ox99gKsy3C7QW4+n6WJZ89ssd40wFMnBrsvF7vpFEzsOFCBGPxeBmpbd6d JRgw== 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; bh=RsWaJUdX13+yjk9phvJ6G+7ZpznkLMWzbIxHcQT5M6o=; b=xsdHp8EpYqW2nC9JXrJmOghksHXarAjO0oNdOONG/twIbBbCAY7QvLEYAAisUo+ojf PBS82rubuT4ZTe7GROdEfYovfer/ZQE7/II9uzcEKartfCA1Z3OfRxYPDIzXFN00sPZT fJvtoitMI/fMeyV5v8OHw5+yDW4nvmgcNh2uMYAuLuf2tTkaqgkC2zacI/r+m1dH1z3n UaAdreHchSyIU7DLZglclwiEs3yD3uSQoYbwZ5MjhrNzgqTARAGuoWgbQ3VDW04OWg4H suagprwjLCN6F7ZEFyxv9GD6w9jEBowZpPay2GJWxjtBUmrGxmqSSgrz2hkbfOaI3jM5 2OrA== 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="XkYg/XPC"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id m6-v6si21451806wrw.260.2018.11.05.03.57.50; Mon, 05 Nov 2018 03:57: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="XkYg/XPC"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 69A0A2679E0; Mon, 5 Nov 2018 12:57:49 +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 04D6D2679F7; Mon, 5 Nov 2018 12:57:42 +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,RCVD_IN_DNSWL_NONE 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 050B02678DD for ; Mon, 5 Nov 2018 12:57:40 +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=slUbSV61LeOiWJRDI3aQVQ+dAOrRt+vim+dgO5MyTq0=; b=XkYg/XPC3XvE 73w4lJhU9PjwDeDCeZQ0gGZlg+Kq7KwzyTCR4xNN9Qa47tzjLzPVfhTHG5xnLUydVGjN5kW6oZ5JN mWdInHGciXgvJ4QpFsWVEu2dNrj4EXgo+AloOi1Gtm0daJVSLChX8GIBi53EI7IlZkBB1YlvPDF5E HYO+k=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gJdVk-0008Hl-Jh; Mon, 05 Nov 2018 11:57:40 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 4F18B1124D98; Mon, 5 Nov 2018 11:57:40 +0000 (GMT) From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87d0rrsx37.wl-kuninori.morimoto.gx@renesas.com> Message-Id: <20181105115740.4F18B1124D98@debutante.sirena.org.uk> Date: Mon, 5 Nov 2018 11:57:40 +0000 (GMT) Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: rsnd: add .get_id/.get_id_sub" 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: rsnd: add .get_id/.get_id_sub 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 c16015f36cc128244c910152663de45c3b99f551 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 30 Oct 2018 07:47:18 +0000 Subject: [PATCH] ASoC: rsnd: add .get_id/.get_id_sub ID for CTU and SSIU are confusable. 1 CTU has 4 sub nodes. This means, CTU0 has CTU01 - CTU03, CTU1 has CTU10 - CTU13. SSIU is more confusable. Gen2 SSIU has BUSIF0-3, Gen3 SSIU has BUSIF0-7, but not for all SSIU. In rsnd driver, each mod drivers are assuming rsnd_mod_id() returns main device ID (In CTU case CTU0-1, SSIU case SSIU0-9), not serial number. This patch adds new .id/.id_sub to handling more detail ID. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/core.c | 21 +++++++++++++++++++++ sound/soc/sh/rcar/ctu.c | 20 ++++++++++++++++++++ sound/soc/sh/rcar/rsnd.h | 6 +++++- 3 files changed, 46 insertions(+), 1 deletion(-) -- 2.19.0.rc2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 5373eba5d572..82d2234840c5 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -144,6 +144,27 @@ u32 *rsnd_mod_get_status(struct rsnd_mod *mod, return &mod->status; } +int rsnd_mod_id_raw(struct rsnd_mod *mod) +{ + return mod->id; +} + +int rsnd_mod_id(struct rsnd_mod *mod) +{ + if ((mod)->ops->id) + return (mod)->ops->id(mod); + + return rsnd_mod_id_raw(mod); +} + +int rsnd_mod_id_sub(struct rsnd_mod *mod) +{ + if ((mod)->ops->id_sub) + return (mod)->ops->id_sub(mod); + + return 0; +} + int rsnd_mod_init(struct rsnd_priv *priv, struct rsnd_mod *mod, struct rsnd_mod_ops *ops, diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c index 28058474075b..6a948b1fd9ab 100644 --- a/sound/soc/sh/rcar/ctu.c +++ b/sound/soc/sh/rcar/ctu.c @@ -334,6 +334,24 @@ static int rsnd_ctu_pcm_new(struct rsnd_mod *mod, return ret; } +static int rsnd_ctu_id(struct rsnd_mod *mod) +{ + /* + * ctu00: -> 0, ctu01: -> 0, ctu02: -> 0, ctu03: -> 0 + * ctu10: -> 1, ctu11: -> 1, ctu12: -> 1, ctu13: -> 1 + */ + return mod->id / 4; +} + +static int rsnd_ctu_id_sub(struct rsnd_mod *mod) +{ + /* + * ctu00: -> 0, ctu01: -> 1, ctu02: -> 2, ctu03: -> 3 + * ctu10: -> 0, ctu11: -> 1, ctu12: -> 2, ctu13: -> 3 + */ + return mod->id % 4; +} + static struct rsnd_mod_ops rsnd_ctu_ops = { .name = CTU_NAME, .probe = rsnd_ctu_probe_, @@ -342,6 +360,8 @@ static struct rsnd_mod_ops rsnd_ctu_ops = { .hw_params = rsnd_ctu_hw_params, .pcm_new = rsnd_ctu_pcm_new, .get_status = rsnd_mod_get_status, + .id = rsnd_ctu_id, + .id_sub = rsnd_ctu_id_sub, }; struct rsnd_mod *rsnd_ctu_mod_get(struct rsnd_priv *priv, int id) diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index d25fb5c14c2d..fdf007aeac27 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -304,6 +304,8 @@ struct rsnd_mod_ops { u32 *(*get_status)(struct rsnd_mod *mod, struct rsnd_dai_stream *io, enum rsnd_mod_type type); + int (*id)(struct rsnd_mod *mod); + int (*id_sub)(struct rsnd_mod *mod); }; struct rsnd_dai_stream; @@ -376,7 +378,6 @@ struct rsnd_mod { #define rsnd_mod_to_priv(mod) ((mod)->priv) #define rsnd_mod_name(mod) ((mod)->ops->name) -#define rsnd_mod_id(mod) ((mod)->id) #define rsnd_mod_power_on(mod) clk_enable((mod)->clk) #define rsnd_mod_power_off(mod) clk_disable((mod)->clk) #define rsnd_mod_get(ip) (&(ip)->mod) @@ -396,6 +397,9 @@ void rsnd_mod_interrupt(struct rsnd_mod *mod, u32 *rsnd_mod_get_status(struct rsnd_mod *mod, struct rsnd_dai_stream *io, enum rsnd_mod_type type); +int rsnd_mod_id(struct rsnd_mod *mod); +int rsnd_mod_id_raw(struct rsnd_mod *mod); +int rsnd_mod_id_sub(struct rsnd_mod *mod); struct rsnd_mod *rsnd_mod_next(int *iterator, struct rsnd_dai_stream *io, enum rsnd_mod_type *array,