[alsa-devel] [ASoC] Missing shutdown() vectors in ASoC

Nobin Mathew nobin.mathew at gmail.com
Tue Jun 12 14:14:36 CEST 2007


Liam

I am trying to implement shutdown in ASoC

/* dapm stream operations */
#define SND_SOC_DAPM_STREAM_NOP			0x0
#define SND_SOC_DAPM_STREAM_START		0x1
#define SND_SOC_DAPM_STREAM_STOP		0x2
#define SND_SOC_DAPM_STREAM_SUSPEND		0x4
#define SND_SOC_DAPM_STREAM_RESUME		0x8
#define SND_SOC_DAPM_STREAM_PAUSE_PUSH	0x10
#define SND_SOC_DAPM_STREAM_PAUSE_RELEASE	0x20


Is there any need to add stream operation called
SND_SOC_DAPM_STREAM_SHUTDOWN even though this has no effect no the
system behaviour.

Instead we can use SND_SOC_DAPM_STREAM_SUSPEND.
Is this OK.

is there any better way to implement suspend?, i think suspend will be
a copy of remove() function.



On 6/12/07, Nobin Mathew <nobin.mathew at gmail.com> wrote:
> Liam,
>
> Shutdown() vectors is missing in ASoC, we need this to ensure proper
> shutdown of the system.
>
> * codec device */
> struct snd_soc_codec_device {
>         int (*probe)(struct platform_device *pdev);
>         int (*remove)(struct platform_device *pdev);
>         int (*suspend)(struct platform_device *pdev, pm_message_t state);
>         int (*resume)(struct platform_device *pdev);
> };
>
> /* SoC CPU DAI */
> struct snd_soc_cpu_dai {
>
>         /* DAI description */
>         char *name;
>         unsigned int id;
>         unsigned char type;
>
>         /* DAI callbacks */
>         int (*probe)(struct platform_device *pdev);
>         void (*remove)(struct platform_device *pdev);
>         int (*suspend)(struct platform_device *pdev,
>                 struct snd_soc_cpu_dai *cpu_dai);
>         int (*resume)(struct platform_device *pdev,
>                 struct snd_soc_cpu_dai *cpu_dai);
>         unsigned int (*config_sysclk)(struct snd_soc_cpu_dai *cpu_dai,
>                 struct snd_soc_clock_info *info, unsigned int clk);
>
>         /* DAI capabilities */
>         struct snd_soc_pcm_stream capture;
>         struct snd_soc_pcm_stream playback;
>         struct snd_soc_dai_cap caps;
>
>
> /* SoC platform interface */
> struct snd_soc_platform {
>         char *name;
>
>         int (*probe)(struct platform_device *pdev);
>         int (*remove)(struct platform_device *pdev);
>         int (*suspend)(struct platform_device *pdev,
>                 struct snd_soc_cpu_dai *cpu_dai);
>         int (*resume)(struct platform_device *pdev,
>                 struct snd_soc_cpu_dai *cpu_dai);
>
>         /* pcm creation and destruction */
>
>
>
> /* SoC machine */
> struct snd_soc_machine {
>         char *name;
>
>         int (*probe)(struct platform_device *pdev);
>         int (*remove)(struct platform_device *pdev);
>
>         /* the pre and post PM functions are used to do any PM work before and
>          * after the codec and DAI's do any PM work. */
>         int (*suspend_pre)(struct platform_device *pdev, pm_message_t state);
>         int (*suspend_post)(struct platform_device *pdev, pm_message_t state);
>         int (*resume_pre)(struct platform_device *pdev);
>         int (*resume_post)(struct platform_device *pdev);
>
>
>
> Nobin Mathew
>


More information about the Alsa-devel mailing list