diff options
Diffstat (limited to 'Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl')
-rw-r--r-- | Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl index ccd0a953953d..74d3a35b59bc 100644 --- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl | |||
@@ -1360,8 +1360,7 @@ | |||
1360 | <informalexample> | 1360 | <informalexample> |
1361 | <programlisting> | 1361 | <programlisting> |
1362 | <![CDATA[ | 1362 | <![CDATA[ |
1363 | static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id, | 1363 | static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id) |
1364 | struct pt_regs *regs) | ||
1365 | { | 1364 | { |
1366 | struct mychip *chip = dev_id; | 1365 | struct mychip *chip = dev_id; |
1367 | .... | 1366 | .... |
@@ -2127,7 +2126,7 @@ | |||
2127 | accessible via <constant>substream->runtime</constant>. | 2126 | accessible via <constant>substream->runtime</constant>. |
2128 | This runtime pointer holds the various information; it holds | 2127 | This runtime pointer holds the various information; it holds |
2129 | the copy of hw_params and sw_params configurations, the buffer | 2128 | the copy of hw_params and sw_params configurations, the buffer |
2130 | pointers, mmap records, spinlocks, etc. Almost everyhing you | 2129 | pointers, mmap records, spinlocks, etc. Almost everything you |
2131 | need for controlling the PCM can be found there. | 2130 | need for controlling the PCM can be found there. |
2132 | </para> | 2131 | </para> |
2133 | 2132 | ||
@@ -2340,7 +2339,7 @@ struct _snd_pcm_runtime { | |||
2340 | 2339 | ||
2341 | <para> | 2340 | <para> |
2342 | When the PCM substreams can be synchronized (typically, | 2341 | When the PCM substreams can be synchronized (typically, |
2343 | synchorinized start/stop of a playback and a capture streams), | 2342 | synchronized start/stop of a playback and a capture streams), |
2344 | you can give <constant>SNDRV_PCM_INFO_SYNC_START</constant>, | 2343 | you can give <constant>SNDRV_PCM_INFO_SYNC_START</constant>, |
2345 | too. In this case, you'll need to check the linked-list of | 2344 | too. In this case, you'll need to check the linked-list of |
2346 | PCM substreams in the trigger callback. This will be | 2345 | PCM substreams in the trigger callback. This will be |
@@ -3062,8 +3061,7 @@ struct _snd_pcm_runtime { | |||
3062 | <title>Interrupt Handler Case #1</title> | 3061 | <title>Interrupt Handler Case #1</title> |
3063 | <programlisting> | 3062 | <programlisting> |
3064 | <![CDATA[ | 3063 | <![CDATA[ |
3065 | static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id, | 3064 | static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id) |
3066 | struct pt_regs *regs) | ||
3067 | { | 3065 | { |
3068 | struct mychip *chip = dev_id; | 3066 | struct mychip *chip = dev_id; |
3069 | spin_lock(&chip->lock); | 3067 | spin_lock(&chip->lock); |
@@ -3106,8 +3104,7 @@ struct _snd_pcm_runtime { | |||
3106 | <title>Interrupt Handler Case #2</title> | 3104 | <title>Interrupt Handler Case #2</title> |
3107 | <programlisting> | 3105 | <programlisting> |
3108 | <![CDATA[ | 3106 | <![CDATA[ |
3109 | static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id, | 3107 | static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id) |
3110 | struct pt_regs *regs) | ||
3111 | { | 3108 | { |
3112 | struct mychip *chip = dev_id; | 3109 | struct mychip *chip = dev_id; |
3113 | spin_lock(&chip->lock); | 3110 | spin_lock(&chip->lock); |
@@ -3247,7 +3244,7 @@ struct _snd_pcm_runtime { | |||
3247 | You can even define your own constraint rules. | 3244 | You can even define your own constraint rules. |
3248 | For example, let's suppose my_chip can manage a substream of 1 channel | 3245 | For example, let's suppose my_chip can manage a substream of 1 channel |
3249 | if and only if the format is S16_LE, otherwise it supports any format | 3246 | if and only if the format is S16_LE, otherwise it supports any format |
3250 | specified in the <structname>snd_pcm_hardware</structname> stucture (or in any | 3247 | specified in the <structname>snd_pcm_hardware</structname> structure (or in any |
3251 | other constraint_list). You can build a rule like this: | 3248 | other constraint_list). You can build a rule like this: |
3252 | 3249 | ||
3253 | <example> | 3250 | <example> |
@@ -3691,16 +3688,6 @@ struct _snd_pcm_runtime { | |||
3691 | </para> | 3688 | </para> |
3692 | 3689 | ||
3693 | <para> | 3690 | <para> |
3694 | Here, the chip instance is retrieved via | ||
3695 | <function>snd_kcontrol_chip()</function> macro. This macro | ||
3696 | just accesses to kcontrol->private_data. The | ||
3697 | kcontrol->private_data field is | ||
3698 | given as the argument of <function>snd_ctl_new()</function> | ||
3699 | (see the later subsection | ||
3700 | <link linkend="control-interface-constructor"><citetitle>Constructor</citetitle></link>). | ||
3701 | </para> | ||
3702 | |||
3703 | <para> | ||
3704 | The <structfield>value</structfield> field is depending on | 3691 | The <structfield>value</structfield> field is depending on |
3705 | the type of control as well as on info callback. For example, | 3692 | the type of control as well as on info callback. For example, |
3706 | the sb driver uses this field to store the register offset, | 3693 | the sb driver uses this field to store the register offset, |
@@ -3780,7 +3767,7 @@ struct _snd_pcm_runtime { | |||
3780 | <para> | 3767 | <para> |
3781 | Like <structfield>get</structfield> callback, | 3768 | Like <structfield>get</structfield> callback, |
3782 | when the control has more than one elements, | 3769 | when the control has more than one elements, |
3783 | all elemehts must be evaluated in this callback, too. | 3770 | all elements must be evaluated in this callback, too. |
3784 | </para> | 3771 | </para> |
3785 | </section> | 3772 | </section> |
3786 | 3773 | ||
@@ -5541,12 +5528,12 @@ struct _snd_pcm_runtime { | |||
5541 | #ifdef CONFIG_PM | 5528 | #ifdef CONFIG_PM |
5542 | static int snd_my_suspend(struct pci_dev *pci, pm_message_t state) | 5529 | static int snd_my_suspend(struct pci_dev *pci, pm_message_t state) |
5543 | { | 5530 | { |
5544 | .... /* do things for suspsend */ | 5531 | .... /* do things for suspend */ |
5545 | return 0; | 5532 | return 0; |
5546 | } | 5533 | } |
5547 | static int snd_my_resume(struct pci_dev *pci) | 5534 | static int snd_my_resume(struct pci_dev *pci) |
5548 | { | 5535 | { |
5549 | .... /* do things for suspsend */ | 5536 | .... /* do things for suspend */ |
5550 | return 0; | 5537 | return 0; |
5551 | } | 5538 | } |
5552 | #endif | 5539 | #endif |
@@ -6111,7 +6098,7 @@ struct _snd_pcm_runtime { | |||
6111 | <!-- ****************************************************** --> | 6098 | <!-- ****************************************************** --> |
6112 | <!-- Acknowledgments --> | 6099 | <!-- Acknowledgments --> |
6113 | <!-- ****************************************************** --> | 6100 | <!-- ****************************************************** --> |
6114 | <chapter id="acknowledments"> | 6101 | <chapter id="acknowledgments"> |
6115 | <title>Acknowledgments</title> | 6102 | <title>Acknowledgments</title> |
6116 | <para> | 6103 | <para> |
6117 | I would like to thank Phil Kerr for his help for improvement and | 6104 | I would like to thank Phil Kerr for his help for improvement and |