struct rsnd_dai_stream *io,
u32 timsel)
{
- int is_play = rsnd_dai_is_play(rdai, io);
+ int is_play = rsnd_io_is_play(io);
int id = rsnd_mod_id(mod);
int shift = (id % 2) ? 16 : 0;
u32 mask, ws;
return rsnd_rdai_get(priv, dai->id);
}
-int rsnd_dai_is_play(struct rsnd_dai *rdai, struct rsnd_dai_stream *io)
-{
- return &rdai->playback == io;
-}
-
/*
* rsnd_soc_dai functions
*/
{
struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod);
+ int is_play = rsnd_io_is_play(io);
int ret;
/* Volume */
ret = rsnd_kctrl_new_m(mod, rdai, rtd,
- rsnd_dai_is_play(rdai, io) ?
+ is_play ?
"DVC Out Playback Volume" : "DVC In Capture Volume",
rsnd_dvc_volume_update,
&dvc->volume, 0x00800000 - 1);
/* Mute */
ret = rsnd_kctrl_new_m(mod, rdai, rtd,
- rsnd_dai_is_play(rdai, io) ?
+ is_play ?
"DVC Out Mute Switch" : "DVC In Mute Switch",
rsnd_dvc_volume_update,
&dvc->mute, 1);
/* Ramp */
ret = rsnd_kctrl_new_s(mod, rdai, rtd,
- rsnd_dai_is_play(rdai, io) ?
+ is_play ?
"DVC Out Ramp Switch" : "DVC In Ramp Switch",
rsnd_dvc_volume_update,
&dvc->ren, 1);
return ret;
ret = rsnd_kctrl_new_e(mod, rdai, rtd,
- rsnd_dai_is_play(rdai, io) ?
+ is_play ?
"DVC Out Ramp Up Rate" : "DVC In Ramp Up Rate",
&dvc->rup,
rsnd_dvc_volume_update,
return ret;
ret = rsnd_kctrl_new_e(mod, rdai, rtd,
- rsnd_dai_is_play(rdai, io) ?
+ is_play ?
"DVC Out Ramp Down Rate" : "DVC In Ramp Down Rate",
&dvc->rdown,
rsnd_dvc_volume_update,
#define rsnd_io_to_mod_src(io) ((io)->mod[RSND_MOD_SRC])
#define rsnd_io_to_mod_dvc(io) ((io)->mod[RSND_MOD_DVC])
#define rsnd_io_to_rdai(io) ((io)->rdai)
+#define rsnd_io_is_play(io) (&rsnd_io_to_rdai(io)->playback == io)
#define rsnd_io_to_runtime(io) ((io)->substream ? \
(io)->substream->runtime : NULL)
+
struct rsnd_dai {
char name[RSND_DAI_NAME_SIZE];
struct rsnd_dai_stream playback;
struct rsnd_dai *rsnd_rdai_get(struct rsnd_priv *priv, int id);
-int rsnd_dai_is_play(struct rsnd_dai *rdai, struct rsnd_dai_stream *io);
-
void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int cnt);
int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional);
/*
* SRC_ROUTE_SELECT
*/
- val = rsnd_dai_is_play(rdai, io) ? 0x1 : 0x2;
+ val = rsnd_io_is_play(io) ? 0x1 : 0x2;
val = val << routes[id].shift;
mask = routes[id].mask << routes[id].shift;
cr |= SDTA;
if (rdai->sys_delay)
cr |= DEL;
- if (rsnd_dai_is_play(rdai, io))
+ if (rsnd_io_is_play(io))
cr |= TRMD;
/*
* directly as 32bit data
* see rsnd_ssi_init()
*/
- if (rsnd_dai_is_play(rdai, io))
+ if (rsnd_io_is_play(io))
rsnd_mod_write(mod, SSITDR, *buf);
else
*buf = rsnd_mod_read(mod, SSIRDR);