rsnd.h (ea96380baa2794cb6e0d5bfbcca0c78b237a5f8a) rsnd.h (5ba17b42e1755c3c5cfe96370cfd47f34d01f62c)
1/*
2 * Renesas R-Car
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 219 unchanged lines hidden (view full) ---

228
229struct rsnd_dai_stream;
230struct rsnd_mod {
231 int id;
232 enum rsnd_mod_type type;
233 struct rsnd_mod_ops *ops;
234 struct rsnd_priv *priv;
235 struct clk *clk;
1/*
2 * Renesas R-Car
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 219 unchanged lines hidden (view full) ---

228
229struct rsnd_dai_stream;
230struct rsnd_mod {
231 int id;
232 enum rsnd_mod_type type;
233 struct rsnd_mod_ops *ops;
234 struct rsnd_priv *priv;
235 struct clk *clk;
236 u32 *(*get_status)(struct rsnd_dai_stream *io,
237 struct rsnd_mod *mod,
238 enum rsnd_mod_type type);
239 u32 status;
236};
237/*
238 * status
239 *
240 * 0xH0000CB0
241 *
242 * B 0: init 1: quit
243 * C 0: start 1: stop

--- 37 unchanged lines hidden (view full) ---

281#define rsnd_mod_to_priv(mod) ((mod)->priv)
282#define rsnd_mod_id(mod) ((mod) ? (mod)->id : -1)
283#define rsnd_mod_power_on(mod) clk_enable((mod)->clk)
284#define rsnd_mod_power_off(mod) clk_disable((mod)->clk)
285#define rsnd_mod_get(ip) (&(ip)->mod)
286
287int rsnd_mod_init(struct rsnd_priv *priv,
288 struct rsnd_mod *mod,
240};
241/*
242 * status
243 *
244 * 0xH0000CB0
245 *
246 * B 0: init 1: quit
247 * C 0: start 1: stop

--- 37 unchanged lines hidden (view full) ---

285#define rsnd_mod_to_priv(mod) ((mod)->priv)
286#define rsnd_mod_id(mod) ((mod) ? (mod)->id : -1)
287#define rsnd_mod_power_on(mod) clk_enable((mod)->clk)
288#define rsnd_mod_power_off(mod) clk_disable((mod)->clk)
289#define rsnd_mod_get(ip) (&(ip)->mod)
290
291int rsnd_mod_init(struct rsnd_priv *priv,
292 struct rsnd_mod *mod,
289 struct rsnd_mod_ops *ops,
290 struct clk *clk,
291 enum rsnd_mod_type type,
292 int id);
293 struct rsnd_mod_ops *ops,
294 struct clk *clk,
295 u32* (*get_status)(struct rsnd_dai_stream *io,
296 struct rsnd_mod *mod,
297 enum rsnd_mod_type type),
298 enum rsnd_mod_type type,
299 int id);
293void rsnd_mod_quit(struct rsnd_mod *mod);
294char *rsnd_mod_name(struct rsnd_mod *mod);
295struct dma_chan *rsnd_mod_dma_req(struct rsnd_dai_stream *io,
296 struct rsnd_mod *mod);
297void rsnd_mod_interrupt(struct rsnd_mod *mod,
298 void (*callback)(struct rsnd_mod *mod,
299 struct rsnd_dai_stream *io));
300void rsnd_mod_quit(struct rsnd_mod *mod);
301char *rsnd_mod_name(struct rsnd_mod *mod);
302struct dma_chan *rsnd_mod_dma_req(struct rsnd_dai_stream *io,
303 struct rsnd_mod *mod);
304void rsnd_mod_interrupt(struct rsnd_mod *mod,
305 void (*callback)(struct rsnd_mod *mod,
306 struct rsnd_dai_stream *io));
307u32 *rsnd_mod_get_status(struct rsnd_dai_stream *io,
308 struct rsnd_mod *mod,
309 enum rsnd_mod_type type);
310
300void rsnd_parse_connect_common(struct rsnd_dai *rdai,
301 struct rsnd_mod* (*mod_get)(struct rsnd_priv *priv, int id),
302 struct device_node *node,
303 struct device_node *playback,
304 struct device_node *capture);
305
306void rsnd_set_slot(struct rsnd_dai *rdai,
307 int slots, int slots_total);

--- 6 unchanged lines hidden (view full) ---

314 */
315#define RSND_DAI_NAME_SIZE 16
316struct rsnd_dai_stream {
317 char name[RSND_DAI_NAME_SIZE];
318 struct snd_pcm_substream *substream;
319 struct rsnd_mod *mod[RSND_MOD_MAX];
320 struct rsnd_dai_path_info *info; /* rcar_snd.h */
321 struct rsnd_dai *rdai;
311void rsnd_parse_connect_common(struct rsnd_dai *rdai,
312 struct rsnd_mod* (*mod_get)(struct rsnd_priv *priv, int id),
313 struct device_node *node,
314 struct device_node *playback,
315 struct device_node *capture);
316
317void rsnd_set_slot(struct rsnd_dai *rdai,
318 int slots, int slots_total);

--- 6 unchanged lines hidden (view full) ---

325 */
326#define RSND_DAI_NAME_SIZE 16
327struct rsnd_dai_stream {
328 char name[RSND_DAI_NAME_SIZE];
329 struct snd_pcm_substream *substream;
330 struct rsnd_mod *mod[RSND_MOD_MAX];
331 struct rsnd_dai_path_info *info; /* rcar_snd.h */
332 struct rsnd_dai *rdai;
322 u32 mod_status[RSND_MOD_MAX];
333 u32 parent_ssi_status;
323 int byte_pos;
324 int period_pos;
325 int byte_per_period;
326 int next_period_byte;
327};
328#define rsnd_io_to_mod(io, i) ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL)
329#define rsnd_io_to_mod_ssi(io) rsnd_io_to_mod((io), RSND_MOD_SSI)
330#define rsnd_io_to_mod_ssip(io) rsnd_io_to_mod((io), RSND_MOD_SSIP)

--- 314 unchanged lines hidden ---
334 int byte_pos;
335 int period_pos;
336 int byte_per_period;
337 int next_period_byte;
338};
339#define rsnd_io_to_mod(io, i) ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL)
340#define rsnd_io_to_mod_ssi(io) rsnd_io_to_mod((io), RSND_MOD_SSI)
341#define rsnd_io_to_mod_ssip(io) rsnd_io_to_mod((io), RSND_MOD_SSIP)

--- 314 unchanged lines hidden ---