Commit graph

1244 commits

Author SHA1 Message Date
Kuninori Morimoto
4acdf9aedd
ASoC: rsnd: setup BRGCKR/BRRA/BRRB on rsnd_adg_clk_control()
Current adg.c will configure BRGCKR/BRRA/BRRB to output clock
when it start sound. OTAH, rsnd_adg_clk_enable() will enables
clk_a/b/c when driver was probed.
But it is strange, these should be set in the same time.
This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h6oqzlei.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:53:29 +01:00
Kuninori Morimoto
ab0233747f
ASoC: rsnd: remove default division of clock out
Current adg has default division for BRRA/BRRB, but it was created at
very beginning of the driver implementation, and is now an unnecessary
settings.

Because it has this default division, unexpected clockout might
be selected. For example if it requests only 44.1kHz base clockout,
unrequested 48kHz base clockout also will be selected.

This patch remove default division of clock out

Reported-by: Vincenzo De Michele <vincenzo.michele@davinci.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87il96zlep.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:53:28 +01:00
Kuninori Morimoto
80d4984f38
ASoC: rsnd: tidyup brga/brgb default value
default value for brga/brgb should be 0xff instead of 0x2.
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87jztmzlew.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:53:27 +01:00
Kuninori Morimoto
d059cd40ae
ASoC: rsnd: setup clock-out only when all conditions are right
Current adg.c doesn't assume that requested clock out divide condition
doesn't match. In such case, it will indicate strange message, and will
register NULL clock, etc. It is just a DT setting miss, but is
confusable. This patch check all conditions for it.

Reported-by: Vincenzo De Michele <vincenzo.michele@davinci.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lee2zlf7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:53:26 +01:00
Kuninori Morimoto
bd4cee2fdf
ASoC: rsnd: enable clk_i approximate rate usage
Basically Renesas sound ADG is assuming that it has accurately
divisible input clock. But sometimes / some board might not have it.
The clk_i from CPG is used for such case. It can't calculate accurate
division, but can be used as approximate rate.
This patch enable clk_i for such case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Adnan Ali <adnan.ali@bp.renesas.com>
Tested-by: Vincenzo De Michele <vincenzo.michele@davinci.de>
Tested-by: Patrick Keil <patrick.keil@conti-engineering.com>
Link: https://lore.kernel.org/r/87msyizlfd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-23 13:53:25 +01:00
Kuninori Morimoto
4b0891a7b6
ASoC: rsnd: merge DAI call back functions into ops
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bkfhb0tg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:13 +01:00
Kuninori Morimoto
1a5ca2aad7
ASoC: rsnd: call of_node_put() when break
We need to call of_node_put() when break from
for_each_child_of_node(). This patch add missing
of_node_put().

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bkfh9g68.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-09 12:52:35 +01:00
Kuninori Morimoto
547b02f74e
ASoC: rsnd: enable multi Component support for Audio Graph Card/Card2
+-- Basic Board ---------+
	|+--------+      +------+|
	|| CPU ch0| <--> |CodecA||
	||     ch1| <-+  +------+|
	|+--------+   |          |
	+-------------|----------+
	+-- expansion board -----+
	|             |  +------+|
	|             +->|CodecB||
	|                +------+|
	+------------------------+

In above HW connection case, we intuitively think we want to handle these
as "2 Sound Cards".

	card0,0: CPU-ch0 - CodecA
	card1,0: CPU-ch1 - CodecB

But, we needed to handle it as "1 big Sound Card", because of
Component vs Card limitation.

	card0,0: CPU-ch0 - CodecA
	card0,1: CPU-ch1 - CodecB

This patch enables multi Component to handle multi Cards.
To support it, it needs

	- Fill dai_args for each DAI on snd_soc_dai_driver
	- Parse DT for each Component (Simple Card/Audio Graph Card)

Ex) Simple Card

	rcar_sound {
		...

		/* Component0 */
		rcar_sound,dai@0 {
			...
		};

		/* Component1 */
		rcar_sound,dai@1 {
			...
		};
	};

Ex) Audio Graph Card/Card2

	rcar_sound {
		/* Component0 */
		ports@0 {
			...
		};

		/* Component1 */
		ports@1 {
			...
		};
	};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tttub1m4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 12:44:49 +01:00
Kuninori Morimoto
6328489c13
ASoC: rsnd: cleanup rsnd_dai_of_node()
It calls rsnd_dai_of_node() to know it was called from Audio Graph
Card/Card2, or from Simple Audio Card. And after that, it gets
number of related DAIs.

To be more simple code, this patch merges these.
This is prepare for multi Component support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v8eab1md.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 12:44:48 +01:00
Kuninori Morimoto
8897a1475f
ASoC: rsnd: use DAI driver ID instead of DAI ID
Current rsnd is using DAI ID to get own priv data without setting
driver->id. It was no problem for Single Component, but will be problem
in case of Multi Component, because it is not a DAI serial number.

	struct snd_soc_dai *snd_soc_register_dai(...)
	{
		...
		if (dai_drv->id)
			dai->id = dai_drv->id;
		else
			dai->id = component->num_dai;
		...
	}

This patch sets driver->id, and get serial number.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wmyqb1mm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 12:44:47 +01:00
Juerg Haefliger
82a28d5aa5
ASoC: siu: Add MODULE_FIRMWARE macro
The module loads firmware so add a MODULE_FIRMWARE macro to provide that
information via modinfo.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Link: https://lore.kernel.org/r/20230613095454.38696-1-juerg.haefliger@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-13 12:15:12 +01:00
Uwe Kleine-König
4136b45d25
ASoC: sh: siu_dai: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-135-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20 13:09:01 +00:00
Uwe Kleine-König
b89438c71d
ASoC: sh: rz-ssi: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-134-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20 13:09:00 +00:00
Uwe Kleine-König
5310f0a331
ASoC: sh: rcar: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-133-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20 13:08:59 +00:00
Uwe Kleine-König
9baee32e88
ASoC: sh: hac: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-132-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20 13:08:58 +00:00
Uwe Kleine-König
08719f469b
ASoC: sh: fsi: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-131-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20 13:08:57 +00:00
Rob Herring
2d2998b843
ASoC: Use of_property_read_bool() for boolean properties
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230310144733.1546413-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-11 12:18:55 +00:00
Rob Herring
1e108e60a4
ASoC: Use of_property_present() for testing DT property presence
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties. As
part of this, convert of_get_property/of_find_property calls to the
recently added of_property_present() helper when we just want to test
for presence of a property and nothing more.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230310144732.1546328-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-11 12:18:54 +00:00
Lad Prabhakar
38c042b59a
ASoC: sh: rz-ssi: Update interrupt handling for half duplex channels
For half duplex channels we dont have separate interrupts for Tx and Rx
instead we have single interrupt Rt (where the signal for Rx and Tx is
muxed). To handle such a case install a handler in case we have a dma_rt
interrupt specified in the DT for the PIO mode.

Note, for backward compatibility we check if the Rx and Tx interrupts
are present first instead of checking Rt interrupt.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230217185225.43310-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-05 23:36:48 +00:00
Geert Uytterhoeven
4932b1fa61
ASoC: rsnd: adg: Fix BRG typos
"BRG" stands for "Baud Rate Generator", but is frequently misspelled as
"RBG".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/ac6365c17861d71fbc89d823089db4aafdb763ed.1676470202.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-16 13:11:35 +00:00
Kuninori Morimoto
1ad059a157
ASoC: rsnd: core.c: indicate warning if strange TDM width was set
Current rsnd silently uses default TDM width if it was strange
settings. It is difficult to notice about it.
This patch indicates warning for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lel6ksqn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-10 15:08:12 +00:00
Kuninori Morimoto
c2bc65274a
ASoC: rsnd: add R-Car Gen4 Sound support
This patch is tested on V4H White Hawk + ARD-AUDIO-DA7212

Signed-off-by: Linh Phung <linh.phung.jy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7qe5ej5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:57 +00:00
Kuninori Morimoto
beab0aad72
ASoC: rsnd: dma.c: tidyup rsnd_dma_probe()
This patch tidyups rsnd_dma_probe(), but there is no effect.

This is prepare for Gen4 support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r0va5elq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:54 +00:00
Kuninori Morimoto
c20bc7c9ce
ASoC: rsnd: tidyup rsnd_dma_addr()
This patch tidyups rsnd_dma_addr(), but there is no effect.

This is prepare for Gen4 support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sffq5elx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:53 +00:00
Kuninori Morimoto
662721ece4
ASoC: rsnd: use array for 44.1kHz/48kHz rate handling
ADG need to know output rate of 44.1kHz/48kHz.
It is using single variable for each, but this patch changes
it to array. Nothing is changed by this patch.

This is prepare for R-Car Gen4 support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tu065em3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:52 +00:00
Kuninori Morimoto
efaab61588
ASoC: rsnd: use clkin/out_size
Current adg.c is assuming number of clkin/clkout are fixed, but it is
not correct on Gen4. This patch uses clkin/out_size to handling it.

This is prepare for R-Car Gen4 support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v8km5em7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:51 +00:00
Kuninori Morimoto
da2f9e8594
ASoC: rsnd: moves clkout_name to top of the file
This patch moves clkout_name to top of the file to handling both
clkin/clkout in the same place.

This is prepare for R-Car Gen4 support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wn525emc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:51 +00:00
Kuninori Morimoto
4bbff16d26
ASoC: rsnd: rename clk to clkin
Current adg.c is usig "clk" as clock IN, but is using "clkout" for
clock OUT. This patch arranges "clk" to "clkin".

This is prepare for R-Car Gen4 support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y1pi5emh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:50 +00:00
Kuninori Morimoto
184d82e142
ASoC: rsnd: remove unnecessary ADG flags
The flag LRCLK_ASYNC / AUDIO_OUT_48 had been added to handling
special case of Salvator-X board, but it is not used on upstream.
It makes code complex today, let's remove these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zg9y5emm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:49 +00:00
Kuninori Morimoto
3e262e9592
ASoC: rsnd: use same debug message format on clkout
This patch follows clkin debug message style on clkout.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871qna6t77.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:48 +00:00
Kuninori Morimoto
6d612f67a8
ASoC: rsnd: indicate warning once if it can't handle requested rule
Some SoC can't handle all requested hw rule. In such case, it will indicate
like below, but it is unclear why it didn't work to user.
This patch indicates warning in such case once, because player will try to
similar rule many times.

	# aplay sound.wav
	Playing WAVE 'sound.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
	aplay: aplay.c: 1359: set_params: Assertion `err >= 0' failed.
	Aborted by signal Aborted...

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87357q6t7b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:47 +00:00
Kuninori Morimoto
c12dc0f665
ASoC: rsnd: indicate necessary error when clock start failed
rsnd_ssi_master_clk_start() indicates error message if it couldn't
handle requested clock/rate, but it is not caring all cases.
This patch cares it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874js66t7g.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:46 +00:00
Kuninori Morimoto
e5a3c491e1
ASoC: rsnd: Remove unnecessary rsnd_dbg_dai_call()
commit b43b8ae87c ("ASoC: rsnd: protect mod->status") removed
RSND_DEBUG_NO_DAI_CALL and rsnd_dbg_dai_call(), but these are still
exist on rsnd.h. This patch removes it.

Fixes: b43b8ae87c ("ASoC: rsnd: protect mod->status")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875ycm6t7l.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:45 +00:00
Kuninori Morimoto
49123b51cd
ASoC: rsnd: fixup #endif position
commit 1f9c82b5ab ("ASoC: rsnd: add debugfs support") added
CONFIG_DEBUG_FS related definitions on rsnd.h, but it should be
added inside of RSND_H. This patch fixup it.

Fixes: 1f9c82b5ab ("ASoC: rsnd: add debugfs support")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877cx26t7r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:44 +00:00
Kuninori Morimoto
68a410aff9
ASoC: rsnd: check whether playback/capture property exists
Current rsnd sets "channels_min" which is used from
snd_soc_dai_stream_valid() without checking DT playback/capture property.
Thus, "aplay -l" or "arecord -l" will indicate un-exising device.
This patch checks DT proerty and do nothing playback/capture settings if
not exist.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878rhi6t7x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-01 11:43:43 +00:00
Kuninori Morimoto
7aa6d95d7f
ASoC: rsnd: adg: use __clk_get_name() instead of local clk_name[]
Current rsnd_adg_clk_dbg_info() is using locak clk_name[] to ndicating
clk name, but we don't want to use local clk_name[] everywhere when we
support R-Car Gen4 sound to handling non compatible clk naming.

This patch uses __clk_get_name() instead of local clk_name[] for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v8mz8wcs.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-28 13:04:33 +00:00
Jean Delvare
d695d089e3
ASoC: rsnd: Drop obsolete dependency on COMPILE_TEST
Since commit 0166dc11be ("of: make CONFIG_OF user selectable"), it
is possible to test-build any driver which depends on OF on any
architecture by explicitly selecting OF. Therefore depending on
COMPILE_TEST as an alternative is no longer needed.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Link: https://lore.kernel.org/r/20221127193441.0b54484d@endymion.delvare
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-28 13:04:23 +00:00
Kuninori Morimoto
25106550f1
ASoC: soc-dpcm.h: remove snd_soc_dpcm::hw_param
Current soc-pcm.c is coping fe hw_param to dpcm->hw_param (A),
fixup it (B), and copy it to be (C).

	int dpcm_be_dai_hw_params(...)
	{
		...
		for_each_dpcm_be(fe, stream, dpcm) {
			...
			/* copy params for each dpcm */
(A)			memcpy(&dpcm->hw_params, &fe->dpcm[stream].hw_params, ...) ;

			/* perform any hw_params fixups */
(B)			ret = snd_soc_link_be_hw_params_fixup(be, &dpcm->hw_params);
			...

			/* copy the fixed-up hw params for BE dai */
(C)			memcpy(&be->dpcm[stream].hw_params, &dpcm->hw_params, ...);
			...
		}
		...
	}

But here, (1) it is coping hw_params without caring stream (Playback/Capture),
(2) we can get same value from be. We don't need to have dpcm->hw_params.
This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/87v8ogsl6h.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-10-19 13:05:34 +01:00
Shang XiaoJing
4aa2b05a24
ASoC: rsnd: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it, which intents and makes it
more clear what is going on for the casual reviewer.

The Coccinelle references Commit e4d8aef214 ("ALSA: usb: Use
DIV_ROUND_UP() instead of open-coding it").

Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Link: https://lore.kernel.org/r/20220927140948.17696-4-shangxiaojing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-10-17 12:48:22 +01:00
Takashi Iwai
86a4d29e75 ASoC: Updates for v6.1
This has been a very quiet release for the core but quite a busy one for
 drivers with a big crop of new drivers and lots of feature additions and
 fixes to existing ones:
 
  - A new string helper parse_int_array_user().
  - Improvements to the SOF IPC4 code, especially around trace.
  - Support for AMD Rembrant DSPs, AMD Pink Sardine ACP 6.2, Apple Silcon
    systems, Everest ES8326, Intel Sky Lake and Kaby Lake, MediaTek
    MT8186 support, NXP i.MX8ULP DSPs, Qualcomm SC8280XP, SM8250 and SM8450
    and Texas Instruments SRC4392
 
 There is a conflict with the conversion of I2C remove functions to void
 in the cs42l42 driver which is fairly straightforward to resolve but
 should be highlighted to Linus.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmM6tu0ACgkQJNaLcl1U
 h9BHFQf9Ew/yLSHRdeJwNUEb4VjnRtXz+DLQbGeZBNnk/7Yt/STd0EaudUl0OuiJ
 +Ok4bLN6/47bwp5OB0kRGdTVycUq+rR2niJu4dgcY0MkfJi7Pyumibp/biips5rw
 +Qzj8oOUPu1970zmOktuy84ZY9Ikl02UEQYyUFVL1AJM3aUzfa/gQ24UCEyA2WxD
 ai7TcnUf2+zkMzqvfwFeW3avLSh+9ZLRgHHB52VNQXLHO5+YDvmMmyKZydon67n1
 +3QZOS57rQRXUgBOraq+AojTXs9gTFXmF8ujD1eA2qL33vqeZaf7upx76a3U/Rm+
 9m+6JucR1qrJyErag2nX90HQOvUcxA==
 =kv8c
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v6.1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v6.1

This has been a very quiet release for the core but quite a busy one for
drivers with a big crop of new drivers and lots of feature additions and
fixes to existing ones:

 - A new string helper parse_int_array_user().
 - Improvements to the SOF IPC4 code, especially around trace.
 - Support for AMD Rembrant DSPs, AMD Pink Sardine ACP 6.2, Apple Silcon
   systems, Everest ES8326, Intel Sky Lake and Kaby Lake, MediaTek
   MT8186 support, NXP i.MX8ULP DSPs, Qualcomm SC8280XP, SM8250 and SM8450
   and Texas Instruments SRC4392

There is a conflict with the conversion of I2C remove functions to void
in the cs42l42 driver which is fairly straightforward to resolve but
should be highlighted to Linus.
2022-10-03 16:30:42 +02:00
Takashi Iwai
a267fdd0a6 ASoC: sh: Replace runtime->status->state reference to runtime->state
The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220926135558.26580-11-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2022-09-27 08:49:25 +02:00
Jiasheng Jiang
376be51caf
ASoC: rsnd: Add check for rsnd_mod_power_on
As rsnd_mod_power_on() can return negative numbers,
it should be better to check the return value and
deal with the exception.

Fixes: e7d850dd10 ("ASoC: rsnd: use mod base common method on SSI-parent")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20220902013030.3691266-1-jiasheng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-09-02 13:27:16 +01:00
Takashi Iwai
25a3b95957 ASoC: Fixes for v6.0
A relatively large batch of fixes that came in since my pull request,
 none of them too major and mostly device specific apart from a series of
 security/robustness improvements from Takashi.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmL7feEACgkQJNaLcl1U
 h9Bxygf/cZrD1ke0CQSEp89KK5N36hidFgRcwkW/aMEFV2rCWlj4fufX5YRX8f0D
 WPRwojsiE7QRrKrwR8a1mewj4x5KqwzkeM6OVCpNJsut+MYsHmGpM/tsAqX8rFwi
 PMH3oN/9cDIqKjjxE7ZQ3AOfaVDZNV4+kVHYhhMGgZ2zpdPSSaLiIeoAkk5UQHcC
 K4FD21gp4tsE6mxZKu98N1aKM0v52/TYvrmMMG0oUSr8zdsGFUBkJ9UcicHRYD/v
 WgwW5lIW6h5nhdAk9yoFpv11M3rSaL16PFvbNQYMo9AACrMq9gbytZ0ej2FmEkqR
 K6qYEetQWXR6XW68YN8tytgJB8m5wQ==
 =ErLu
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v6.0-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.0

A relatively large batch of fixes that came in since my pull request,
none of them too major and mostly device specific apart from a series of
security/robustness improvements from Takashi.
2022-08-16 15:07:55 +02:00
Mark Brown
4d39265b93
Merge remote-tracking branch 'asoc/for-5.20' into asoc-6.0 2022-08-15 00:33:32 +01:00
Biju Das
c75ed9f54c
ASoC: sh: rz-ssi: Improve error handling in rz_ssi_probe() error path
We usually do cleanup in reverse order of init. Currently in case of
error rz_ssi_release_dma_channels() done in the reverse order. This
patch improves error handling in rz_ssi_probe() error path.

While at it, use "goto cleanup" style to reduce code duplication.

Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20220728092612.38858-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-05 12:57:26 +01:00
Takashi Iwai
9769e44d41 Merge branch 'for-next' into for-linus 2022-08-01 08:11:19 +02:00
Wang Jiada
11e9318ff7
ASoC: rsnd: ssiu: add missing .quit callback for gen2
commit 83b220cf8e ("ASoC: rsnd: implement BUSIF related
code in ssiu.c") moved BUSIF related code in ssiu.c
which added .quit callback in ssiu.c to disable error irq
when ssiu quits.

But .quit callback was added only for gen1 and is missing
for gen2, this causes error irq is left enabled after ssiu
quits on gen2.

This commit adds missing .quit callback for gen2

Signed-off-by: Wang Jiada <jiada_wang@mentor.com>
Cc: Dean Jenkins <Dean_Jenkins@mentor.com>
Cc: Eugeniu Rosca <erosca@de.adit-jv.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20220718110404.1529085-1-jiwang_wang@mentor.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-19 14:54:21 +01:00
Kuninori Morimoto
ef30911d3c
ASoC: rsnd: care default case on rsnd_ssiu_busif_err_irq_ctrl()
Before, ssiu.c didn't care SSI5-8, thus,
commit b1384d4c95 ("ASoC: rsnd: care default case on
rsnd_ssiu_busif_err_status_clear()") cares it for status clear.

But we should care it for error irq handling, too.
This patch cares it.

Reported-by: Nguyen Bao Nguyen <nguyen.nguyen.yj@renesas.com>
Reported-by: Nishiyama Kunihiko <kunihiko.nishiyama.dn@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871quocio1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-14 13:26:38 +01:00
Uwe Kleine-König
e57297fc09
ASoC: rsnd: Emit useful error messages in .remove()
If more than one call of rsnd_dai_call(remove, ...) fails the platform
remove callback returns all values orred together which then makes the
driver core emit a generic error message which is little helpful.

Instead emit details of which call failed exactly and return 0. Note
returning 0 instead of an error code doesn't make a difference in the
driver core apart from the error message.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220705063613.93770-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-06 15:20:22 +01:00
Charles Keepax
f712ff57a2
ASoC: sh: Migrate to new style legacy DAI naming flag
Change the legacy DAI naming flag from opting in to the new scheme
(non_legacy_dai_naming), to opting out of it (legacy_dai_naming).
These drivers appear to be on the CPU side of the DAI link and
currently uses the legacy naming, so add the new flag.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623125250.2355471-11-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-27 13:16:22 +01:00