aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 09:12:54 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:20:14 -0500
commit446ab5f5039df4209a2e28752bd48c99007d3d82 (patch)
treed40253e01ba04cfdf03ba2aaf5f81e91d40be369 /Documentation
parenta0d6f880faad2ceba3af3b8c34ddefd15119ced1 (diff)
[ALSA] Remove xxx_t typedefs: Documentation
Modules: Documentation Remove xxx_t typedefs from documentation. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl419
-rw-r--r--Documentation/sound/alsa/hda_codec.txt14
2 files changed, 214 insertions, 219 deletions
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index 260334c98d95..f2e59fe802bd 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -403,9 +403,8 @@
403 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 403 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
404 404
405 /* definition of the chip-specific record */ 405 /* definition of the chip-specific record */
406 typedef struct snd_mychip mychip_t; 406 struct mychip {
407 struct snd_mychip { 407 struct snd_card *card;
408 snd_card_t *card;
409 // rest of implementation will be in the section 408 // rest of implementation will be in the section
410 // "PCI Resource Managements" 409 // "PCI Resource Managements"
411 }; 410 };
@@ -413,7 +412,7 @@
413 /* chip-specific destructor 412 /* chip-specific destructor
414 * (see "PCI Resource Managements") 413 * (see "PCI Resource Managements")
415 */ 414 */
416 static int snd_mychip_free(mychip_t *chip) 415 static int snd_mychip_free(struct mychip *chip)
417 { 416 {
418 .... // will be implemented later... 417 .... // will be implemented later...
419 } 418 }
@@ -421,22 +420,21 @@
421 /* component-destructor 420 /* component-destructor
422 * (see "Management of Cards and Components") 421 * (see "Management of Cards and Components")
423 */ 422 */
424 static int snd_mychip_dev_free(snd_device_t *device) 423 static int snd_mychip_dev_free(struct snd_device *device)
425 { 424 {
426 mychip_t *chip = device->device_data; 425 return snd_mychip_free(device->device_data);
427 return snd_mychip_free(chip);
428 } 426 }
429 427
430 /* chip-specific constructor 428 /* chip-specific constructor
431 * (see "Management of Cards and Components") 429 * (see "Management of Cards and Components")
432 */ 430 */
433 static int __devinit snd_mychip_create(snd_card_t *card, 431 static int __devinit snd_mychip_create(struct snd_card *card,
434 struct pci_dev *pci, 432 struct pci_dev *pci,
435 mychip_t **rchip) 433 struct mychip **rchip)
436 { 434 {
437 mychip_t *chip; 435 struct mychip *chip;
438 int err; 436 int err;
439 static snd_device_ops_t ops = { 437 static struct snd_device_ops ops = {
440 .dev_free = snd_mychip_dev_free, 438 .dev_free = snd_mychip_dev_free,
441 }; 439 };
442 440
@@ -474,8 +472,8 @@
474 const struct pci_device_id *pci_id) 472 const struct pci_device_id *pci_id)
475 { 473 {
476 static int dev; 474 static int dev;
477 snd_card_t *card; 475 struct snd_card *card;
478 mychip_t *chip; 476 struct mychip *chip;
479 int err; 477 int err;
480 478
481 /* (1) */ 479 /* (1) */
@@ -582,7 +580,7 @@
582 <informalexample> 580 <informalexample>
583 <programlisting> 581 <programlisting>
584<![CDATA[ 582<![CDATA[
585 snd_card_t *card; 583 struct snd_card *card;
586 .... 584 ....
587 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); 585 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
588]]> 586]]>
@@ -605,7 +603,7 @@
605 <informalexample> 603 <informalexample>
606 <programlisting> 604 <programlisting>
607<![CDATA[ 605<![CDATA[
608 mychip_t *chip; 606 struct mychip *chip;
609 .... 607 ....
610 if ((err = snd_mychip_create(card, pci, &chip)) < 0) { 608 if ((err = snd_mychip_create(card, pci, &chip)) < 0) {
611 snd_card_free(card); 609 snd_card_free(card);
@@ -806,7 +804,7 @@
806 <informalexample> 804 <informalexample>
807 <programlisting> 805 <programlisting>
808<![CDATA[ 806<![CDATA[
809 snd_card_t *card; 807 struct snd_card *card;
810 card = snd_card_new(index, id, module, extra_size); 808 card = snd_card_new(index, id, module, extra_size);
811]]> 809]]>
812 </programlisting> 810 </programlisting>
@@ -830,7 +828,7 @@
830 <para> 828 <para>
831 After the card is created, you can attach the components 829 After the card is created, you can attach the components
832 (devices) to the card instance. On ALSA driver, a component is 830 (devices) to the card instance. On ALSA driver, a component is
833 represented as a <type>snd_device_t</type> object. 831 represented as a struct <structname>snd_device</structname> object.
834 A component can be a PCM instance, a control interface, a raw 832 A component can be a PCM instance, a control interface, a raw
835 MIDI interface, etc. Each of such instances has one component 833 MIDI interface, etc. Each of such instances has one component
836 entry. 834 entry.
@@ -891,14 +889,11 @@
891 The chip-specific information, e.g. the i/o port address, its 889 The chip-specific information, e.g. the i/o port address, its
892 resource pointer, or the irq number, is stored in the 890 resource pointer, or the irq number, is stored in the
893 chip-specific record. 891 chip-specific record.
894 Usually, the chip-specific record is typedef'ed as
895 <type>xxx_t</type> like the following:
896 892
897 <informalexample> 893 <informalexample>
898 <programlisting> 894 <programlisting>
899<![CDATA[ 895<![CDATA[
900 typedef struct snd_mychip mychip_t; 896 struct mychip {
901 struct snd_mychip {
902 .... 897 ....
903 }; 898 };
904]]> 899]]>
@@ -918,12 +913,12 @@
918 <informalexample> 913 <informalexample>
919 <programlisting> 914 <programlisting>
920<![CDATA[ 915<![CDATA[
921 card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(mychip_t)); 916 card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct mychip));
922]]> 917]]>
923 </programlisting> 918 </programlisting>
924 </informalexample> 919 </informalexample>
925 920
926 whether <type>mychip_t</type> is the type of the chip record. 921 whether struct <structname>mychip</structname> is the type of the chip record.
927 </para> 922 </para>
928 923
929 <para> 924 <para>
@@ -932,7 +927,7 @@
932 <informalexample> 927 <informalexample>
933 <programlisting> 928 <programlisting>
934<![CDATA[ 929<![CDATA[
935 mychip_t *chip = (mychip_t *)card->private_data; 930 struct mychip *chip = (struct mychip *)card->private_data;
936]]> 931]]>
937 </programlisting> 932 </programlisting>
938 </informalexample> 933 </informalexample>
@@ -954,8 +949,8 @@
954 <informalexample> 949 <informalexample>
955 <programlisting> 950 <programlisting>
956<![CDATA[ 951<![CDATA[
957 snd_card_t *card; 952 struct snd_card *card;
958 mychip_t *chip; 953 struct mychip *chip;
959 card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL); 954 card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL);
960 ..... 955 .....
961 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 956 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
@@ -971,8 +966,8 @@
971 <informalexample> 966 <informalexample>
972 <programlisting> 967 <programlisting>
973<![CDATA[ 968<![CDATA[
974 struct snd_mychip { 969 struct mychip {
975 snd_card_t *card; 970 struct snd_card *card;
976 .... 971 ....
977 }; 972 };
978]]> 973]]>
@@ -1000,7 +995,7 @@
1000 <informalexample> 995 <informalexample>
1001 <programlisting> 996 <programlisting>
1002<![CDATA[ 997<![CDATA[
1003 static snd_device_ops_t ops = { 998 static struct snd_device_ops ops = {
1004 .dev_free = snd_mychip_dev_free, 999 .dev_free = snd_mychip_dev_free,
1005 }; 1000 };
1006 .... 1001 ....
@@ -1018,10 +1013,9 @@
1018 <informalexample> 1013 <informalexample>
1019 <programlisting> 1014 <programlisting>
1020<![CDATA[ 1015<![CDATA[
1021 static int snd_mychip_dev_free(snd_device_t *device) 1016 static int snd_mychip_dev_free(struct snd_device *device)
1022 { 1017 {
1023 mychip_t *chip = device->device_data; 1018 return snd_mychip_free(device->device_data);
1024 return snd_mychip_free(chip);
1025 } 1019 }
1026]]> 1020]]>
1027 </programlisting> 1021 </programlisting>
@@ -1087,15 +1081,15 @@
1087 <title>PCI Resource Managements Example</title> 1081 <title>PCI Resource Managements Example</title>
1088 <programlisting> 1082 <programlisting>
1089<![CDATA[ 1083<![CDATA[
1090 struct snd_mychip { 1084 struct mychip {
1091 snd_card_t *card; 1085 struct snd_card *card;
1092 struct pci_dev *pci; 1086 struct pci_dev *pci;
1093 1087
1094 unsigned long port; 1088 unsigned long port;
1095 int irq; 1089 int irq;
1096 }; 1090 };
1097 1091
1098 static int snd_mychip_free(mychip_t *chip) 1092 static int snd_mychip_free(struct mychip *chip)
1099 { 1093 {
1100 /* disable hardware here if any */ 1094 /* disable hardware here if any */
1101 .... // (not implemented in this document) 1095 .... // (not implemented in this document)
@@ -1113,13 +1107,13 @@
1113 } 1107 }
1114 1108
1115 /* chip-specific constructor */ 1109 /* chip-specific constructor */
1116 static int __devinit snd_mychip_create(snd_card_t *card, 1110 static int __devinit snd_mychip_create(struct snd_card *card,
1117 struct pci_dev *pci, 1111 struct pci_dev *pci,
1118 mychip_t **rchip) 1112 struct mychip **rchip)
1119 { 1113 {
1120 mychip_t *chip; 1114 struct mychip *chip;
1121 int err; 1115 int err;
1122 static snd_device_ops_t ops = { 1116 static struct snd_device_ops ops = {
1123 .dev_free = snd_mychip_dev_free, 1117 .dev_free = snd_mychip_dev_free,
1124 }; 1118 };
1125 1119
@@ -1155,8 +1149,7 @@
1155 } 1149 }
1156 chip->port = pci_resource_start(pci, 0); 1150 chip->port = pci_resource_start(pci, 0);
1157 if (request_irq(pci->irq, snd_mychip_interrupt, 1151 if (request_irq(pci->irq, snd_mychip_interrupt,
1158 SA_INTERRUPT|SA_SHIRQ, "My Chip", 1152 SA_INTERRUPT|SA_SHIRQ, "My Chip", chip)) {
1159 (void *)chip)) {
1160 printk(KERN_ERR "cannot grab irq %d\n", pci->irq); 1153 printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
1161 snd_mychip_free(chip); 1154 snd_mychip_free(chip);
1162 return -EBUSY; 1155 return -EBUSY;
@@ -1268,14 +1261,14 @@
1268 1261
1269 <para> 1262 <para>
1270 Now assume that this PCI device has an I/O port with 8 bytes 1263 Now assume that this PCI device has an I/O port with 8 bytes
1271 and an interrupt. Then <type>mychip_t</type> will have the 1264 and an interrupt. Then struct <structname>mychip</structname> will have the
1272 following fields: 1265 following fields:
1273 1266
1274 <informalexample> 1267 <informalexample>
1275 <programlisting> 1268 <programlisting>
1276<![CDATA[ 1269<![CDATA[
1277 struct snd_mychip { 1270 struct mychip {
1278 snd_card_t *card; 1271 struct snd_card *card;
1279 1272
1280 unsigned long port; 1273 unsigned long port;
1281 int irq; 1274 int irq;
@@ -1330,8 +1323,7 @@
1330 <programlisting> 1323 <programlisting>
1331<![CDATA[ 1324<![CDATA[
1332 if (request_irq(pci->irq, snd_mychip_interrupt, 1325 if (request_irq(pci->irq, snd_mychip_interrupt,
1333 SA_INTERRUPT|SA_SHIRQ, "My Chip", 1326 SA_INTERRUPT|SA_SHIRQ, "My Chip", chip)) {
1334 (void *)chip)) {
1335 printk(KERN_ERR "cannot grab irq %d\n", pci->irq); 1327 printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
1336 snd_mychip_free(chip); 1328 snd_mychip_free(chip);
1337 return -EBUSY; 1329 return -EBUSY;
@@ -1372,7 +1364,7 @@
1372 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id, 1364 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id,
1373 struct pt_regs *regs) 1365 struct pt_regs *regs)
1374 { 1366 {
1375 mychip_t *chip = dev_id; 1367 struct mychip *chip = dev_id;
1376 .... 1368 ....
1377 return IRQ_HANDLED; 1369 return IRQ_HANDLED;
1378 } 1370 }
@@ -1487,7 +1479,7 @@
1487 <informalexample> 1479 <informalexample>
1488 <programlisting> 1480 <programlisting>
1489<![CDATA[ 1481<![CDATA[
1490 struct snd_mychip { 1482 struct mychip {
1491 .... 1483 ....
1492 unsigned long iobase_phys; 1484 unsigned long iobase_phys;
1493 void __iomem *iobase_virt; 1485 void __iomem *iobase_virt;
@@ -1517,7 +1509,7 @@
1517 <informalexample> 1509 <informalexample>
1518 <programlisting> 1510 <programlisting>
1519<![CDATA[ 1511<![CDATA[
1520 static int snd_mychip_free(mychip_t *chip) 1512 static int snd_mychip_free(struct mychip *chip)
1521 { 1513 {
1522 .... 1514 ....
1523 if (chip->iobase_virt) 1515 if (chip->iobase_virt)
@@ -1537,7 +1529,7 @@
1537 <title>Registration of Device Struct</title> 1529 <title>Registration of Device Struct</title>
1538 <para> 1530 <para>
1539 At some point, typically after calling <function>snd_device_new()</function>, 1531 At some point, typically after calling <function>snd_device_new()</function>,
1540 you need to register the <structname>struct device</structname> of the chip 1532 you need to register the struct <structname>device</structname> of the chip
1541 you're handling for udev and co. ALSA provides a macro for compatibility with 1533 you're handling for udev and co. ALSA provides a macro for compatibility with
1542 older kernels. Simply call like the following: 1534 older kernels. Simply call like the following:
1543 <informalexample> 1535 <informalexample>
@@ -1739,7 +1731,7 @@
1739 .... 1731 ....
1740 1732
1741 /* hardware definition */ 1733 /* hardware definition */
1742 static snd_pcm_hardware_t snd_mychip_playback_hw = { 1734 static struct snd_pcm_hardware snd_mychip_playback_hw = {
1743 .info = (SNDRV_PCM_INFO_MMAP | 1735 .info = (SNDRV_PCM_INFO_MMAP |
1744 SNDRV_PCM_INFO_INTERLEAVED | 1736 SNDRV_PCM_INFO_INTERLEAVED |
1745 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1737 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1758,7 +1750,7 @@
1758 }; 1750 };
1759 1751
1760 /* hardware definition */ 1752 /* hardware definition */
1761 static snd_pcm_hardware_t snd_mychip_capture_hw = { 1753 static struct snd_pcm_hardware snd_mychip_capture_hw = {
1762 .info = (SNDRV_PCM_INFO_MMAP | 1754 .info = (SNDRV_PCM_INFO_MMAP |
1763 SNDRV_PCM_INFO_INTERLEAVED | 1755 SNDRV_PCM_INFO_INTERLEAVED |
1764 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1756 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1777,10 +1769,10 @@
1777 }; 1769 };
1778 1770
1779 /* open callback */ 1771 /* open callback */
1780 static int snd_mychip_playback_open(snd_pcm_substream_t *substream) 1772 static int snd_mychip_playback_open(struct snd_pcm_substream *substream)
1781 { 1773 {
1782 mychip_t *chip = snd_pcm_substream_chip(substream); 1774 struct mychip *chip = snd_pcm_substream_chip(substream);
1783 snd_pcm_runtime_t *runtime = substream->runtime; 1775 struct snd_pcm_runtime *runtime = substream->runtime;
1784 1776
1785 runtime->hw = snd_mychip_playback_hw; 1777 runtime->hw = snd_mychip_playback_hw;
1786 // more hardware-initialization will be done here 1778 // more hardware-initialization will be done here
@@ -1788,19 +1780,19 @@
1788 } 1780 }
1789 1781
1790 /* close callback */ 1782 /* close callback */
1791 static int snd_mychip_playback_close(snd_pcm_substream_t *substream) 1783 static int snd_mychip_playback_close(struct snd_pcm_substream *substream)
1792 { 1784 {
1793 mychip_t *chip = snd_pcm_substream_chip(substream); 1785 struct mychip *chip = snd_pcm_substream_chip(substream);
1794 // the hardware-specific codes will be here 1786 // the hardware-specific codes will be here
1795 return 0; 1787 return 0;
1796 1788
1797 } 1789 }
1798 1790
1799 /* open callback */ 1791 /* open callback */
1800 static int snd_mychip_capture_open(snd_pcm_substream_t *substream) 1792 static int snd_mychip_capture_open(struct snd_pcm_substream *substream)
1801 { 1793 {
1802 mychip_t *chip = snd_pcm_substream_chip(substream); 1794 struct mychip *chip = snd_pcm_substream_chip(substream);
1803 snd_pcm_runtime_t *runtime = substream->runtime; 1795 struct snd_pcm_runtime *runtime = substream->runtime;
1804 1796
1805 runtime->hw = snd_mychip_capture_hw; 1797 runtime->hw = snd_mychip_capture_hw;
1806 // more hardware-initialization will be done here 1798 // more hardware-initialization will be done here
@@ -1808,33 +1800,33 @@
1808 } 1800 }
1809 1801
1810 /* close callback */ 1802 /* close callback */
1811 static int snd_mychip_capture_close(snd_pcm_substream_t *substream) 1803 static int snd_mychip_capture_close(struct snd_pcm_substream *substream)
1812 { 1804 {
1813 mychip_t *chip = snd_pcm_substream_chip(substream); 1805 struct mychip *chip = snd_pcm_substream_chip(substream);
1814 // the hardware-specific codes will be here 1806 // the hardware-specific codes will be here
1815 return 0; 1807 return 0;
1816 1808
1817 } 1809 }
1818 1810
1819 /* hw_params callback */ 1811 /* hw_params callback */
1820 static int snd_mychip_pcm_hw_params(snd_pcm_substream_t *substream, 1812 static int snd_mychip_pcm_hw_params(struct snd_pcm_substream *substream,
1821 snd_pcm_hw_params_t * hw_params) 1813 struct snd_pcm_hw_params *hw_params)
1822 { 1814 {
1823 return snd_pcm_lib_malloc_pages(substream, 1815 return snd_pcm_lib_malloc_pages(substream,
1824 params_buffer_bytes(hw_params)); 1816 params_buffer_bytes(hw_params));
1825 } 1817 }
1826 1818
1827 /* hw_free callback */ 1819 /* hw_free callback */
1828 static int snd_mychip_pcm_hw_free(snd_pcm_substream_t *substream) 1820 static int snd_mychip_pcm_hw_free(struct snd_pcm_substream *substream)
1829 { 1821 {
1830 return snd_pcm_lib_free_pages(substream); 1822 return snd_pcm_lib_free_pages(substream);
1831 } 1823 }
1832 1824
1833 /* prepare callback */ 1825 /* prepare callback */
1834 static int snd_mychip_pcm_prepare(snd_pcm_substream_t *substream) 1826 static int snd_mychip_pcm_prepare(struct snd_pcm_substream *substream)
1835 { 1827 {
1836 mychip_t *chip = snd_pcm_substream_chip(substream); 1828 struct mychip *chip = snd_pcm_substream_chip(substream);
1837 snd_pcm_runtime_t *runtime = substream->runtime; 1829 struct snd_pcm_runtime *runtime = substream->runtime;
1838 1830
1839 /* set up the hardware with the current configuration 1831 /* set up the hardware with the current configuration
1840 * for example... 1832 * for example...
@@ -1849,7 +1841,7 @@
1849 } 1841 }
1850 1842
1851 /* trigger callback */ 1843 /* trigger callback */
1852 static int snd_mychip_pcm_trigger(snd_pcm_substream_t *substream, 1844 static int snd_mychip_pcm_trigger(struct snd_pcm_substream *substream,
1853 int cmd) 1845 int cmd)
1854 { 1846 {
1855 switch (cmd) { 1847 switch (cmd) {
@@ -1866,9 +1858,9 @@
1866 1858
1867 /* pointer callback */ 1859 /* pointer callback */
1868 static snd_pcm_uframes_t 1860 static snd_pcm_uframes_t
1869 snd_mychip_pcm_pointer(snd_pcm_substream_t *substream) 1861 snd_mychip_pcm_pointer(struct snd_pcm_substream *substream)
1870 { 1862 {
1871 mychip_t *chip = snd_pcm_substream_chip(substream); 1863 struct mychip *chip = snd_pcm_substream_chip(substream);
1872 unsigned int current_ptr; 1864 unsigned int current_ptr;
1873 1865
1874 /* get the current hardware pointer */ 1866 /* get the current hardware pointer */
@@ -1877,7 +1869,7 @@
1877 } 1869 }
1878 1870
1879 /* operators */ 1871 /* operators */
1880 static snd_pcm_ops_t snd_mychip_playback_ops = { 1872 static struct snd_pcm_ops snd_mychip_playback_ops = {
1881 .open = snd_mychip_playback_open, 1873 .open = snd_mychip_playback_open,
1882 .close = snd_mychip_playback_close, 1874 .close = snd_mychip_playback_close,
1883 .ioctl = snd_pcm_lib_ioctl, 1875 .ioctl = snd_pcm_lib_ioctl,
@@ -1889,7 +1881,7 @@
1889 }; 1881 };
1890 1882
1891 /* operators */ 1883 /* operators */
1892 static snd_pcm_ops_t snd_mychip_capture_ops = { 1884 static struct snd_pcm_ops snd_mychip_capture_ops = {
1893 .open = snd_mychip_capture_open, 1885 .open = snd_mychip_capture_open,
1894 .close = snd_mychip_capture_close, 1886 .close = snd_mychip_capture_close,
1895 .ioctl = snd_pcm_lib_ioctl, 1887 .ioctl = snd_pcm_lib_ioctl,
@@ -1905,9 +1897,9 @@
1905 */ 1897 */
1906 1898
1907 /* create a pcm device */ 1899 /* create a pcm device */
1908 static int __devinit snd_mychip_new_pcm(mychip_t *chip) 1900 static int __devinit snd_mychip_new_pcm(struct mychip *chip)
1909 { 1901 {
1910 snd_pcm_t *pcm; 1902 struct snd_pcm *pcm;
1911 int err; 1903 int err;
1912 1904
1913 if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1, 1905 if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1,
@@ -1944,9 +1936,9 @@
1944 <informalexample> 1936 <informalexample>
1945 <programlisting> 1937 <programlisting>
1946<![CDATA[ 1938<![CDATA[
1947 static int __devinit snd_mychip_new_pcm(mychip_t *chip) 1939 static int __devinit snd_mychip_new_pcm(struct mychip *chip)
1948 { 1940 {
1949 snd_pcm_t *pcm; 1941 struct snd_pcm *pcm;
1950 int err; 1942 int err;
1951 1943
1952 if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1, 1944 if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1,
@@ -1989,13 +1981,13 @@
1989 specify more numbers, but they must be handled properly in 1981 specify more numbers, but they must be handled properly in
1990 open/close, etc. callbacks. When you need to know which 1982 open/close, etc. callbacks. When you need to know which
1991 substream you are referring to, then it can be obtained from 1983 substream you are referring to, then it can be obtained from
1992 <type>snd_pcm_substream_t</type> data passed to each callback 1984 struct <structname>snd_pcm_substream</structname> data passed to each callback
1993 as follows: 1985 as follows:
1994 1986
1995 <informalexample> 1987 <informalexample>
1996 <programlisting> 1988 <programlisting>
1997<![CDATA[ 1989<![CDATA[
1998 snd_pcm_substream_t *substream; 1990 struct snd_pcm_substream *substream;
1999 int index = substream->number; 1991 int index = substream->number;
2000]]> 1992]]>
2001 </programlisting> 1993 </programlisting>
@@ -2024,7 +2016,7 @@
2024 <informalexample> 2016 <informalexample>
2025 <programlisting> 2017 <programlisting>
2026<![CDATA[ 2018<![CDATA[
2027 static snd_pcm_ops_t snd_mychip_playback_ops = { 2019 static struct snd_pcm_ops snd_mychip_playback_ops = {
2028 .open = snd_mychip_pcm_open, 2020 .open = snd_mychip_pcm_open,
2029 .close = snd_mychip_pcm_close, 2021 .close = snd_mychip_pcm_close,
2030 .ioctl = snd_pcm_lib_ioctl, 2022 .ioctl = snd_pcm_lib_ioctl,
@@ -2102,18 +2094,18 @@
2102 <title>PCM Instance with a Destructor</title> 2094 <title>PCM Instance with a Destructor</title>
2103 <programlisting> 2095 <programlisting>
2104<![CDATA[ 2096<![CDATA[
2105 static void mychip_pcm_free(snd_pcm_t *pcm) 2097 static void mychip_pcm_free(struct snd_pcm *pcm)
2106 { 2098 {
2107 mychip_t *chip = snd_pcm_chip(pcm); 2099 struct mychip *chip = snd_pcm_chip(pcm);
2108 /* free your own data */ 2100 /* free your own data */
2109 kfree(chip->my_private_pcm_data); 2101 kfree(chip->my_private_pcm_data);
2110 // do what you like else 2102 // do what you like else
2111 .... 2103 ....
2112 } 2104 }
2113 2105
2114 static int __devinit snd_mychip_new_pcm(mychip_t *chip) 2106 static int __devinit snd_mychip_new_pcm(struct mychip *chip)
2115 { 2107 {
2116 snd_pcm_t *pcm; 2108 struct snd_pcm *pcm;
2117 .... 2109 ....
2118 /* allocate your own data */ 2110 /* allocate your own data */
2119 chip->my_private_pcm_data = kmalloc(...); 2111 chip->my_private_pcm_data = kmalloc(...);
@@ -2149,7 +2141,7 @@
2149<![CDATA[ 2141<![CDATA[
2150struct _snd_pcm_runtime { 2142struct _snd_pcm_runtime {
2151 /* -- Status -- */ 2143 /* -- Status -- */
2152 snd_pcm_substream_t *trigger_master; 2144 struct snd_pcm_substream *trigger_master;
2153 snd_timestamp_t trigger_tstamp; /* trigger timestamp */ 2145 snd_timestamp_t trigger_tstamp; /* trigger timestamp */
2154 int overrange; 2146 int overrange;
2155 snd_pcm_uframes_t avail_max; 2147 snd_pcm_uframes_t avail_max;
@@ -2192,8 +2184,8 @@ struct _snd_pcm_runtime {
2192 snd_pcm_sync_id_t sync; /* hardware synchronization ID */ 2184 snd_pcm_sync_id_t sync; /* hardware synchronization ID */
2193 2185
2194 /* -- mmap -- */ 2186 /* -- mmap -- */
2195 volatile snd_pcm_mmap_status_t *status; 2187 volatile struct snd_pcm_mmap_status *status;
2196 volatile snd_pcm_mmap_control_t *control; 2188 volatile struct snd_pcm_mmap_control *control;
2197 atomic_t mmap_count; 2189 atomic_t mmap_count;
2198 2190
2199 /* -- locking / scheduling -- */ 2191 /* -- locking / scheduling -- */
@@ -2204,15 +2196,15 @@ struct _snd_pcm_runtime {
2204 2196
2205 /* -- private section -- */ 2197 /* -- private section -- */
2206 void *private_data; 2198 void *private_data;
2207 void (*private_free)(snd_pcm_runtime_t *runtime); 2199 void (*private_free)(struct snd_pcm_runtime *runtime);
2208 2200
2209 /* -- hardware description -- */ 2201 /* -- hardware description -- */
2210 snd_pcm_hardware_t hw; 2202 struct snd_pcm_hardware hw;
2211 snd_pcm_hw_constraints_t hw_constraints; 2203 struct snd_pcm_hw_constraints hw_constraints;
2212 2204
2213 /* -- interrupt callbacks -- */ 2205 /* -- interrupt callbacks -- */
2214 void (*transfer_ack_begin)(snd_pcm_substream_t *substream); 2206 void (*transfer_ack_begin)(struct snd_pcm_substream *substream);
2215 void (*transfer_ack_end)(snd_pcm_substream_t *substream); 2207 void (*transfer_ack_end)(struct snd_pcm_substream *substream);
2216 2208
2217 /* -- timer -- */ 2209 /* -- timer -- */
2218 unsigned int timer_resolution; /* timer resolution */ 2210 unsigned int timer_resolution; /* timer resolution */
@@ -2226,7 +2218,7 @@ struct _snd_pcm_runtime {
2226 2218
2227#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 2219#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
2228 /* -- OSS things -- */ 2220 /* -- OSS things -- */
2229 snd_pcm_oss_runtime_t oss; 2221 struct snd_pcm_oss_runtime oss;
2230#endif 2222#endif
2231}; 2223};
2232]]> 2224]]>
@@ -2252,7 +2244,7 @@ struct _snd_pcm_runtime {
2252 <section id="pcm-interface-runtime-hw"> 2244 <section id="pcm-interface-runtime-hw">
2253 <title>Hardware Description</title> 2245 <title>Hardware Description</title>
2254 <para> 2246 <para>
2255 The hardware descriptor (<type>snd_pcm_hardware_t</type>) 2247 The hardware descriptor (struct <structname>snd_pcm_hardware</structname>)
2256 contains the definitions of the fundamental hardware 2248 contains the definitions of the fundamental hardware
2257 configuration. Above all, you'll need to define this in 2249 configuration. Above all, you'll need to define this in
2258 <link linkend="pcm-interface-operators-open-callback"><citetitle> 2250 <link linkend="pcm-interface-operators-open-callback"><citetitle>
@@ -2267,7 +2259,7 @@ struct _snd_pcm_runtime {
2267 <informalexample> 2259 <informalexample>
2268 <programlisting> 2260 <programlisting>
2269<![CDATA[ 2261<![CDATA[
2270 snd_pcm_runtime_t *runtime = substream->runtime; 2262 struct snd_pcm_runtime *runtime = substream->runtime;
2271 ... 2263 ...
2272 runtime->hw = snd_mychip_playback_hw; /* common definition */ 2264 runtime->hw = snd_mychip_playback_hw; /* common definition */
2273 if (chip->model == VERY_OLD_ONE) 2265 if (chip->model == VERY_OLD_ONE)
@@ -2282,7 +2274,7 @@ struct _snd_pcm_runtime {
2282 <informalexample> 2274 <informalexample>
2283 <programlisting> 2275 <programlisting>
2284<![CDATA[ 2276<![CDATA[
2285 static snd_pcm_hardware_t snd_mychip_playback_hw = { 2277 static struct snd_pcm_hardware snd_mychip_playback_hw = {
2286 .info = (SNDRV_PCM_INFO_MMAP | 2278 .info = (SNDRV_PCM_INFO_MMAP |
2287 SNDRV_PCM_INFO_INTERLEAVED | 2279 SNDRV_PCM_INFO_INTERLEAVED |
2288 SNDRV_PCM_INFO_BLOCK_TRANSFER | 2280 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -2512,7 +2504,7 @@ struct _snd_pcm_runtime {
2512 <title>Running Status</title> 2504 <title>Running Status</title>
2513 <para> 2505 <para>
2514 The running status can be referred via <constant>runtime-&gt;status</constant>. 2506 The running status can be referred via <constant>runtime-&gt;status</constant>.
2515 This is the pointer to <type>snd_pcm_mmap_status_t</type> 2507 This is the pointer to struct <structname>snd_pcm_mmap_status</structname>
2516 record. For example, you can get the current DMA hardware 2508 record. For example, you can get the current DMA hardware
2517 pointer via <constant>runtime-&gt;status-&gt;hw_ptr</constant>. 2509 pointer via <constant>runtime-&gt;status-&gt;hw_ptr</constant>.
2518 </para> 2510 </para>
@@ -2520,7 +2512,7 @@ struct _snd_pcm_runtime {
2520 <para> 2512 <para>
2521 The DMA application pointer can be referred via 2513 The DMA application pointer can be referred via
2522 <constant>runtime-&gt;control</constant>, which points 2514 <constant>runtime-&gt;control</constant>, which points
2523 <type>snd_pcm_mmap_control_t</type> record. 2515 struct <structname>snd_pcm_mmap_control</structname> record.
2524 However, accessing directly to this value is not recommended. 2516 However, accessing directly to this value is not recommended.
2525 </para> 2517 </para>
2526 </section> 2518 </section>
@@ -2542,9 +2534,9 @@ struct _snd_pcm_runtime {
2542 <informalexample> 2534 <informalexample>
2543 <programlisting> 2535 <programlisting>
2544<![CDATA[ 2536<![CDATA[
2545 static int snd_xxx_open(snd_pcm_substream_t *substream) 2537 static int snd_xxx_open(struct snd_pcm_substream *substream)
2546 { 2538 {
2547 my_pcm_data_t *data; 2539 struct my_pcm_data *data;
2548 .... 2540 ....
2549 data = kmalloc(sizeof(*data), GFP_KERNEL); 2541 data = kmalloc(sizeof(*data), GFP_KERNEL);
2550 substream->runtime->private_data = data; 2542 substream->runtime->private_data = data;
@@ -2586,7 +2578,7 @@ struct _snd_pcm_runtime {
2586 2578
2587 <para> 2579 <para>
2588 The callback function takes at least the argument with 2580 The callback function takes at least the argument with
2589 <type>snd_pcm_substream_t</type> pointer. For retrieving the 2581 <structname>snd_pcm_substream</structname> pointer. For retrieving the
2590 chip record from the given substream instance, you can use the 2582 chip record from the given substream instance, you can use the
2591 following macro. 2583 following macro.
2592 2584
@@ -2594,7 +2586,7 @@ struct _snd_pcm_runtime {
2594 <programlisting> 2586 <programlisting>
2595<![CDATA[ 2587<![CDATA[
2596 int xxx() { 2588 int xxx() {
2597 mychip_t *chip = snd_pcm_substream_chip(substream); 2589 struct mychip *chip = snd_pcm_substream_chip(substream);
2598 .... 2590 ....
2599 } 2591 }
2600]]> 2592]]>
@@ -2616,7 +2608,7 @@ struct _snd_pcm_runtime {
2616 <informalexample> 2608 <informalexample>
2617 <programlisting> 2609 <programlisting>
2618<![CDATA[ 2610<![CDATA[
2619 static int snd_xxx_open(snd_pcm_substream_t *substream); 2611 static int snd_xxx_open(struct snd_pcm_substream *substream);
2620]]> 2612]]>
2621 </programlisting> 2613 </programlisting>
2622 </informalexample> 2614 </informalexample>
@@ -2631,10 +2623,10 @@ struct _snd_pcm_runtime {
2631 <informalexample> 2623 <informalexample>
2632 <programlisting> 2624 <programlisting>
2633<![CDATA[ 2625<![CDATA[
2634 static int snd_xxx_open(snd_pcm_substream_t *substream) 2626 static int snd_xxx_open(struct snd_pcm_substream *substream)
2635 { 2627 {
2636 mychip_t *chip = snd_pcm_substream_chip(substream); 2628 struct mychip *chip = snd_pcm_substream_chip(substream);
2637 snd_pcm_runtime_t *runtime = substream->runtime; 2629 struct snd_pcm_runtime *runtime = substream->runtime;
2638 2630
2639 runtime->hw = snd_mychip_playback_hw; 2631 runtime->hw = snd_mychip_playback_hw;
2640 return 0; 2632 return 0;
@@ -2667,7 +2659,7 @@ struct _snd_pcm_runtime {
2667 <informalexample> 2659 <informalexample>
2668 <programlisting> 2660 <programlisting>
2669<![CDATA[ 2661<![CDATA[
2670 static int snd_xxx_close(snd_pcm_substream_t *substream); 2662 static int snd_xxx_close(struct snd_pcm_substream *substream);
2671]]> 2663]]>
2672 </programlisting> 2664 </programlisting>
2673 </informalexample> 2665 </informalexample>
@@ -2682,7 +2674,7 @@ struct _snd_pcm_runtime {
2682 <informalexample> 2674 <informalexample>
2683 <programlisting> 2675 <programlisting>
2684<![CDATA[ 2676<![CDATA[
2685 static int snd_xxx_close(snd_pcm_substream_t *substream) 2677 static int snd_xxx_close(struct snd_pcm_substream *substream)
2686 { 2678 {
2687 .... 2679 ....
2688 kfree(substream->runtime->private_data); 2680 kfree(substream->runtime->private_data);
@@ -2709,8 +2701,8 @@ struct _snd_pcm_runtime {
2709 <informalexample> 2701 <informalexample>
2710 <programlisting> 2702 <programlisting>
2711<![CDATA[ 2703<![CDATA[
2712 static int snd_xxx_hw_params(snd_pcm_substream_t * substream, 2704 static int snd_xxx_hw_params(struct snd_pcm_substream *substream,
2713 snd_pcm_hw_params_t * hw_params); 2705 struct snd_pcm_hw_params *hw_params);
2714]]> 2706]]>
2715 </programlisting> 2707 </programlisting>
2716 </informalexample> 2708 </informalexample>
@@ -2785,7 +2777,7 @@ struct _snd_pcm_runtime {
2785 <informalexample> 2777 <informalexample>
2786 <programlisting> 2778 <programlisting>
2787<![CDATA[ 2779<![CDATA[
2788 static int snd_xxx_hw_free(snd_pcm_substream_t * substream); 2780 static int snd_xxx_hw_free(struct snd_pcm_substream *substream);
2789]]> 2781]]>
2790 </programlisting> 2782 </programlisting>
2791 </informalexample> 2783 </informalexample>
@@ -2820,7 +2812,7 @@ struct _snd_pcm_runtime {
2820 <informalexample> 2812 <informalexample>
2821 <programlisting> 2813 <programlisting>
2822<![CDATA[ 2814<![CDATA[
2823 static int snd_xxx_prepare(snd_pcm_substream_t * substream); 2815 static int snd_xxx_prepare(struct snd_pcm_substream *substream);
2824]]> 2816]]>
2825 </programlisting> 2817 </programlisting>
2826 </informalexample> 2818 </informalexample>
@@ -2869,7 +2861,7 @@ struct _snd_pcm_runtime {
2869 <informalexample> 2861 <informalexample>
2870 <programlisting> 2862 <programlisting>
2871<![CDATA[ 2863<![CDATA[
2872 static int snd_xxx_trigger(snd_pcm_substream_t * substream, int cmd); 2864 static int snd_xxx_trigger(struct snd_pcm_substream *substream, int cmd);
2873]]> 2865]]>
2874 </programlisting> 2866 </programlisting>
2875 </informalexample> 2867 </informalexample>
@@ -2939,7 +2931,7 @@ struct _snd_pcm_runtime {
2939 <informalexample> 2931 <informalexample>
2940 <programlisting> 2932 <programlisting>
2941<![CDATA[ 2933<![CDATA[
2942 static snd_pcm_uframes_t snd_xxx_pointer(snd_pcm_substream_t * substream) 2934 static snd_pcm_uframes_t snd_xxx_pointer(struct snd_pcm_substream *substream)
2943]]> 2935]]>
2944 </programlisting> 2936 </programlisting>
2945 </informalexample> 2937 </informalexample>
@@ -3067,7 +3059,7 @@ struct _snd_pcm_runtime {
3067 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id, 3059 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id,
3068 struct pt_regs *regs) 3060 struct pt_regs *regs)
3069 { 3061 {
3070 mychip_t *chip = dev_id; 3062 struct mychip *chip = dev_id;
3071 spin_lock(&chip->lock); 3063 spin_lock(&chip->lock);
3072 .... 3064 ....
3073 if (pcm_irq_invoked(chip)) { 3065 if (pcm_irq_invoked(chip)) {
@@ -3111,7 +3103,7 @@ struct _snd_pcm_runtime {
3111 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id, 3103 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id,
3112 struct pt_regs *regs) 3104 struct pt_regs *regs)
3113 { 3105 {
3114 mychip_t *chip = dev_id; 3106 struct mychip *chip = dev_id;
3115 spin_lock(&chip->lock); 3107 spin_lock(&chip->lock);
3116 .... 3108 ....
3117 if (pcm_irq_invoked(chip)) { 3109 if (pcm_irq_invoked(chip)) {
@@ -3221,13 +3213,13 @@ struct _snd_pcm_runtime {
3221<![CDATA[ 3213<![CDATA[
3222 static unsigned int rates[] = 3214 static unsigned int rates[] =
3223 {4000, 10000, 22050, 44100}; 3215 {4000, 10000, 22050, 44100};
3224 static snd_pcm_hw_constraint_list_t constraints_rates = { 3216 static struct snd_pcm_hw_constraint_list constraints_rates = {
3225 .count = ARRAY_SIZE(rates), 3217 .count = ARRAY_SIZE(rates),
3226 .list = rates, 3218 .list = rates,
3227 .mask = 0, 3219 .mask = 0,
3228 }; 3220 };
3229 3221
3230 static int snd_mychip_pcm_open(snd_pcm_substream_t *substream) 3222 static int snd_mychip_pcm_open(struct snd_pcm_substream *substream)
3231 { 3223 {
3232 int err; 3224 int err;
3233 .... 3225 ....
@@ -3249,19 +3241,20 @@ struct _snd_pcm_runtime {
3249 You can even define your own constraint rules. 3241 You can even define your own constraint rules.
3250 For example, let's suppose my_chip can manage a substream of 1 channel 3242 For example, let's suppose my_chip can manage a substream of 1 channel
3251 if and only if the format is S16_LE, otherwise it supports any format 3243 if and only if the format is S16_LE, otherwise it supports any format
3252 specified in the <type>snd_pcm_hardware_t</type> stucture (or in any 3244 specified in the <structname>snd_pcm_hardware</structname> stucture (or in any
3253 other constraint_list). You can build a rule like this: 3245 other constraint_list). You can build a rule like this:
3254 3246
3255 <example> 3247 <example>
3256 <title>Example of Hardware Constraints for Channels</title> 3248 <title>Example of Hardware Constraints for Channels</title>
3257 <programlisting> 3249 <programlisting>
3258<![CDATA[ 3250<![CDATA[
3259 static int hw_rule_format_by_channels(snd_pcm_hw_params_t *params, 3251 static int hw_rule_format_by_channels(struct snd_pcm_hw_params *params,
3260 snd_pcm_hw_rule_t *rule) 3252 struct snd_pcm_hw_rule *rule)
3261 { 3253 {
3262 snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); 3254 struct snd_interval *c = hw_param_interval(params,
3263 snd_mask_t *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); 3255 SNDRV_PCM_HW_PARAM_CHANNELS);
3264 snd_mask_t fmt; 3256 struct snd_mask *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
3257 struct snd_mask fmt;
3265 3258
3266 snd_mask_any(&fmt); /* Init the struct */ 3259 snd_mask_any(&fmt); /* Init the struct */
3267 if (c->min < 2) { 3260 if (c->min < 2) {
@@ -3298,12 +3291,13 @@ struct _snd_pcm_runtime {
3298 <title>Example of Hardware Constraints for Channels</title> 3291 <title>Example of Hardware Constraints for Channels</title>
3299 <programlisting> 3292 <programlisting>
3300<![CDATA[ 3293<![CDATA[
3301 static int hw_rule_channels_by_format(snd_pcm_hw_params_t *params, 3294 static int hw_rule_channels_by_format(struct snd_pcm_hw_params *params,
3302 snd_pcm_hw_rule_t *rule) 3295 struct snd_pcm_hw_rule *rule)
3303 { 3296 {
3304 snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); 3297 struct snd_interval *c = hw_param_interval(params,
3305 snd_mask_t *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); 3298 SNDRV_PCM_HW_PARAM_CHANNELS);
3306 snd_interval_t ch; 3299 struct snd_mask *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
3300 struct snd_interval ch;
3307 3301
3308 snd_interval_any(&ch); 3302 snd_interval_any(&ch);
3309 if (f->bits[0] == SNDRV_PCM_FMTBIT_S16_LE) { 3303 if (f->bits[0] == SNDRV_PCM_FMTBIT_S16_LE) {
@@ -3376,13 +3370,13 @@ struct _snd_pcm_runtime {
3376 callbacks: <structfield>info</structfield>, 3370 callbacks: <structfield>info</structfield>,
3377 <structfield>get</structfield> and 3371 <structfield>get</structfield> and
3378 <structfield>put</structfield>. Then, define a 3372 <structfield>put</structfield>. Then, define a
3379 <type>snd_kcontrol_new_t</type> record, such as: 3373 struct <structname>snd_kcontrol_new</structname> record, such as:
3380 3374
3381 <example> 3375 <example>
3382 <title>Definition of a Control</title> 3376 <title>Definition of a Control</title>
3383 <programlisting> 3377 <programlisting>
3384<![CDATA[ 3378<![CDATA[
3385 static snd_kcontrol_new_t my_control __devinitdata = { 3379 static struct snd_kcontrol_new my_control __devinitdata = {
3386 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3380 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3387 .name = "PCM Playback Switch", 3381 .name = "PCM Playback Switch",
3388 .index = 0, 3382 .index = 0,
@@ -3599,7 +3593,7 @@ struct _snd_pcm_runtime {
3599 <para> 3593 <para>
3600 The <structfield>info</structfield> callback is used to get 3594 The <structfield>info</structfield> callback is used to get
3601 the detailed information of this control. This must store the 3595 the detailed information of this control. This must store the
3602 values of the given <type>snd_ctl_elem_info_t</type> 3596 values of the given struct <structname>snd_ctl_elem_info</structname>
3603 object. For example, for a boolean control with a single 3597 object. For example, for a boolean control with a single
3604 element will be: 3598 element will be:
3605 3599
@@ -3607,8 +3601,8 @@ struct _snd_pcm_runtime {
3607 <title>Example of info callback</title> 3601 <title>Example of info callback</title>
3608 <programlisting> 3602 <programlisting>
3609<![CDATA[ 3603<![CDATA[
3610 static int snd_myctl_info(snd_kcontrol_t *kcontrol, 3604 static int snd_myctl_info(struct snd_kcontrol *kcontrol,
3611 snd_ctl_elem_info_t *uinfo) 3605 struct snd_ctl_elem_info *uinfo)
3612 { 3606 {
3613 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 3607 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
3614 uinfo->count = 1; 3608 uinfo->count = 1;
@@ -3642,8 +3636,8 @@ struct _snd_pcm_runtime {
3642 <informalexample> 3636 <informalexample>
3643 <programlisting> 3637 <programlisting>
3644<![CDATA[ 3638<![CDATA[
3645 static int snd_myctl_info(snd_kcontrol_t *kcontrol, 3639 static int snd_myctl_info(struct snd_kcontrol *kcontrol,
3646 snd_ctl_elem_info_t *uinfo) 3640 struct snd_ctl_elem_info *uinfo)
3647 { 3641 {
3648 static char *texts[4] = { 3642 static char *texts[4] = {
3649 "First", "Second", "Third", "Fourth" 3643 "First", "Second", "Third", "Fourth"
@@ -3678,10 +3672,10 @@ struct _snd_pcm_runtime {
3678 <title>Example of get callback</title> 3672 <title>Example of get callback</title>
3679 <programlisting> 3673 <programlisting>
3680<![CDATA[ 3674<![CDATA[
3681 static int snd_myctl_get(snd_kcontrol_t *kcontrol, 3675 static int snd_myctl_get(struct snd_kcontrol *kcontrol,
3682 snd_ctl_elem_value_t *ucontrol) 3676 struct snd_ctl_elem_value *ucontrol)
3683 { 3677 {
3684 mychip_t *chip = snd_kcontrol_chip(kcontrol); 3678 struct mychip *chip = snd_kcontrol_chip(kcontrol);
3685 ucontrol->value.integer.value[0] = get_some_value(chip); 3679 ucontrol->value.integer.value[0] = get_some_value(chip);
3686 return 0; 3680 return 0;
3687 } 3681 }
@@ -3717,8 +3711,8 @@ struct _snd_pcm_runtime {
3717 <informalexample> 3711 <informalexample>
3718 <programlisting> 3712 <programlisting>
3719<![CDATA[ 3713<![CDATA[
3720 static int snd_sbmixer_get_single(snd_kcontrol_t *kcontrol, 3714 static int snd_sbmixer_get_single(struct snd_kcontrol *kcontrol,
3721 snd_ctl_elem_value_t *ucontrol) 3715 struct snd_ctl_elem_value *ucontrol)
3722 { 3716 {
3723 int reg = kcontrol->private_value & 0xff; 3717 int reg = kcontrol->private_value & 0xff;
3724 int shift = (kcontrol->private_value >> 16) & 0xff; 3718 int shift = (kcontrol->private_value >> 16) & 0xff;
@@ -3754,10 +3748,10 @@ struct _snd_pcm_runtime {
3754 <title>Example of put callback</title> 3748 <title>Example of put callback</title>
3755 <programlisting> 3749 <programlisting>
3756<![CDATA[ 3750<![CDATA[
3757 static int snd_myctl_put(snd_kcontrol_t *kcontrol, 3751 static int snd_myctl_put(struct snd_kcontrol *kcontrol,
3758 snd_ctl_elem_value_t *ucontrol) 3752 struct snd_ctl_elem_value *ucontrol)
3759 { 3753 {
3760 mychip_t *chip = snd_kcontrol_chip(kcontrol); 3754 struct mychip *chip = snd_kcontrol_chip(kcontrol);
3761 int changed = 0; 3755 int changed = 0;
3762 if (chip->current_value != 3756 if (chip->current_value !=
3763 ucontrol->value.integer.value[0]) { 3757 ucontrol->value.integer.value[0]) {
@@ -3814,7 +3808,7 @@ struct _snd_pcm_runtime {
3814 </informalexample> 3808 </informalexample>
3815 3809
3816 where <parameter>my_control</parameter> is the 3810 where <parameter>my_control</parameter> is the
3817 <type>snd_kcontrol_new_t</type> object defined above, and chip 3811 struct <structname>snd_kcontrol_new</structname> object defined above, and chip
3818 is the object pointer to be passed to 3812 is the object pointer to be passed to
3819 kcontrol-&gt;private_data 3813 kcontrol-&gt;private_data
3820 which can be referred in callbacks. 3814 which can be referred in callbacks.
@@ -3822,7 +3816,7 @@ struct _snd_pcm_runtime {
3822 3816
3823 <para> 3817 <para>
3824 <function>snd_ctl_new1()</function> allocates a new 3818 <function>snd_ctl_new1()</function> allocates a new
3825 <type>snd_kcontrol_t</type> instance (that's why the definition 3819 <structname>snd_kcontrol</structname> instance (that's why the definition
3826 of <parameter>my_control</parameter> can be with 3820 of <parameter>my_control</parameter> can be with
3827 <parameter>__devinitdata</parameter> 3821 <parameter>__devinitdata</parameter>
3828 prefix), and <function>snd_ctl_add</function> assigns the given 3822 prefix), and <function>snd_ctl_add</function> assigns the given
@@ -3849,7 +3843,7 @@ struct _snd_pcm_runtime {
3849 control id pointer for the notification. The event-mask 3843 control id pointer for the notification. The event-mask
3850 specifies the types of notification, for example, in the above 3844 specifies the types of notification, for example, in the above
3851 example, the change of control values is notified. 3845 example, the change of control values is notified.
3852 The id pointer is the pointer of <type>snd_ctl_elem_id_t</type> 3846 The id pointer is the pointer of struct <structname>snd_ctl_elem_id</structname>
3853 to be notified. 3847 to be notified.
3854 You can find some examples in <filename>es1938.c</filename> or 3848 You can find some examples in <filename>es1938.c</filename> or
3855 <filename>es1968.c</filename> for hardware volume interrupts. 3849 <filename>es1968.c</filename> for hardware volume interrupts.
@@ -3882,35 +3876,35 @@ struct _snd_pcm_runtime {
3882 <title>Example of AC97 Interface</title> 3876 <title>Example of AC97 Interface</title>
3883 <programlisting> 3877 <programlisting>
3884<![CDATA[ 3878<![CDATA[
3885 struct snd_mychip { 3879 struct mychip {
3886 .... 3880 ....
3887 ac97_t *ac97; 3881 struct snd_ac97 *ac97;
3888 .... 3882 ....
3889 }; 3883 };
3890 3884
3891 static unsigned short snd_mychip_ac97_read(ac97_t *ac97, 3885 static unsigned short snd_mychip_ac97_read(struct snd_ac97 *ac97,
3892 unsigned short reg) 3886 unsigned short reg)
3893 { 3887 {
3894 mychip_t *chip = ac97->private_data; 3888 struct mychip *chip = ac97->private_data;
3895 .... 3889 ....
3896 // read a register value here from the codec 3890 // read a register value here from the codec
3897 return the_register_value; 3891 return the_register_value;
3898 } 3892 }
3899 3893
3900 static void snd_mychip_ac97_write(ac97_t *ac97, 3894 static void snd_mychip_ac97_write(struct snd_ac97 *ac97,
3901 unsigned short reg, unsigned short val) 3895 unsigned short reg, unsigned short val)
3902 { 3896 {
3903 mychip_t *chip = ac97->private_data; 3897 struct mychip *chip = ac97->private_data;
3904 .... 3898 ....
3905 // write the given register value to the codec 3899 // write the given register value to the codec
3906 } 3900 }
3907 3901
3908 static int snd_mychip_ac97(mychip_t *chip) 3902 static int snd_mychip_ac97(struct mychip *chip)
3909 { 3903 {
3910 ac97_bus_t *bus; 3904 struct snd_ac97_bus *bus;
3911 ac97_template_t ac97; 3905 struct snd_ac97_template ac97;
3912 int err; 3906 int err;
3913 static ac97_bus_ops_t ops = { 3907 static struct snd_ac97_bus_ops ops = {
3914 .write = snd_mychip_ac97_write, 3908 .write = snd_mychip_ac97_write,
3915 .read = snd_mychip_ac97_read, 3909 .read = snd_mychip_ac97_read,
3916 }; 3910 };
@@ -3937,8 +3931,8 @@ struct _snd_pcm_runtime {
3937 <informalexample> 3931 <informalexample>
3938 <programlisting> 3932 <programlisting>
3939<![CDATA[ 3933<![CDATA[
3940 ac97_bus_t *bus; 3934 struct snd_ac97_bus *bus;
3941 static ac97_bus_ops_t ops = { 3935 static struct snd_ac97_bus_ops ops = {
3942 .write = snd_mychip_ac97_write, 3936 .write = snd_mychip_ac97_write,
3943 .read = snd_mychip_ac97_read, 3937 .read = snd_mychip_ac97_read,
3944 }; 3938 };
@@ -3952,13 +3946,14 @@ struct _snd_pcm_runtime {
3952 </para> 3946 </para>
3953 3947
3954 <para> 3948 <para>
3955 And then call <function>snd_ac97_mixer()</function> with an <type>ac97_template_t</type> 3949 And then call <function>snd_ac97_mixer()</function> with an
3950 struct <structname>snd_ac97_template</structname>
3956 record together with the bus pointer created above. 3951 record together with the bus pointer created above.
3957 3952
3958 <informalexample> 3953 <informalexample>
3959 <programlisting> 3954 <programlisting>
3960<![CDATA[ 3955<![CDATA[
3961 ac97_template_t ac97; 3956 struct snd_ac97_template ac97;
3962 int err; 3957 int err;
3963 3958
3964 memset(&ac97, 0, sizeof(ac97)); 3959 memset(&ac97, 0, sizeof(ac97));
@@ -3995,10 +3990,10 @@ struct _snd_pcm_runtime {
3995 <informalexample> 3990 <informalexample>
3996 <programlisting> 3991 <programlisting>
3997<![CDATA[ 3992<![CDATA[
3998 static unsigned short snd_mychip_ac97_read(ac97_t *ac97, 3993 static unsigned short snd_mychip_ac97_read(struct snd_ac97 *ac97,
3999 unsigned short reg) 3994 unsigned short reg)
4000 { 3995 {
4001 mychip_t *chip = ac97->private_data; 3996 struct mychip *chip = ac97->private_data;
4002 .... 3997 ....
4003 return the_register_value; 3998 return the_register_value;
4004 } 3999 }
@@ -4016,7 +4011,7 @@ struct _snd_pcm_runtime {
4016 <informalexample> 4011 <informalexample>
4017 <programlisting> 4012 <programlisting>
4018<![CDATA[ 4013<![CDATA[
4019 static void snd_mychip_ac97_write(ac97_t *ac97, 4014 static void snd_mychip_ac97_write(struct snd_ac97 *ac97,
4020 unsigned short reg, unsigned short val) 4015 unsigned short reg, unsigned short val)
4021]]> 4016]]>
4022 </programlisting> 4017 </programlisting>
@@ -4163,7 +4158,7 @@ struct _snd_pcm_runtime {
4163 <title>Multiple Codecs</title> 4158 <title>Multiple Codecs</title>
4164 <para> 4159 <para>
4165 When there are several codecs on the same card, you need to 4160 When there are several codecs on the same card, you need to
4166 call <function>snd_ac97_new()</function> multiple times with 4161 call <function>snd_ac97_mixer()</function> multiple times with
4167 ac97.num=1 or greater. The <structfield>num</structfield> field 4162 ac97.num=1 or greater. The <structfield>num</structfield> field
4168 specifies the codec 4163 specifies the codec
4169 number. 4164 number.
@@ -4212,7 +4207,7 @@ struct _snd_pcm_runtime {
4212 <informalexample> 4207 <informalexample>
4213 <programlisting> 4208 <programlisting>
4214<![CDATA[ 4209<![CDATA[
4215 snd_rawmidi_t *rmidi; 4210 struct snd_rawmidi *rmidi;
4216 snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, port, integrated, 4211 snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, port, integrated,
4217 irq, irq_flags, &rmidi); 4212 irq, irq_flags, &rmidi);
4218]]> 4213]]>
@@ -4253,17 +4248,17 @@ struct _snd_pcm_runtime {
4253 Usually, the port address corresponds to the command port and 4248 Usually, the port address corresponds to the command port and
4254 port + 1 corresponds to the data port. If not, you may change 4249 port + 1 corresponds to the data port. If not, you may change
4255 the <structfield>cport</structfield> field of 4250 the <structfield>cport</structfield> field of
4256 <type>mpu401_t</type> manually 4251 struct <structname>snd_mpu401</structname> manually
4257 afterward. However, <type>mpu401_t</type> pointer is not 4252 afterward. However, <structname>snd_mpu401</structname> pointer is not
4258 returned explicitly by 4253 returned explicitly by
4259 <function>snd_mpu401_uart_new()</function>. You need to cast 4254 <function>snd_mpu401_uart_new()</function>. You need to cast
4260 rmidi-&gt;private_data to 4255 rmidi-&gt;private_data to
4261 <type>mpu401_t</type> explicitly, 4256 <structname>snd_mpu401</structname> explicitly,
4262 4257
4263 <informalexample> 4258 <informalexample>
4264 <programlisting> 4259 <programlisting>
4265<![CDATA[ 4260<![CDATA[
4266 mpu401_t *mpu; 4261 struct snd_mpu401 *mpu;
4267 mpu = rmidi->private_data; 4262 mpu = rmidi->private_data;
4268]]> 4263]]>
4269 </programlisting> 4264 </programlisting>
@@ -4359,7 +4354,7 @@ struct _snd_pcm_runtime {
4359 <informalexample> 4354 <informalexample>
4360 <programlisting> 4355 <programlisting>
4361<![CDATA[ 4356<![CDATA[
4362 snd_rawmidi_t *rmidi; 4357 struct snd_rawmidi *rmidi;
4363 err = snd_rawmidi_new(chip->card, "MyMIDI", 0, outs, ins, &rmidi); 4358 err = snd_rawmidi_new(chip->card, "MyMIDI", 0, outs, ins, &rmidi);
4364 if (err < 0) 4359 if (err < 0)
4365 return err; 4360 return err;
@@ -4419,7 +4414,7 @@ struct _snd_pcm_runtime {
4419 <informalexample> 4414 <informalexample>
4420 <programlisting> 4415 <programlisting>
4421<![CDATA[ 4416<![CDATA[
4422 static snd_rawmidi_ops_t snd_mymidi_output_ops = { 4417 static struct snd_rawmidi_ops snd_mymidi_output_ops = {
4423 .open = snd_mymidi_output_open, 4418 .open = snd_mymidi_output_open,
4424 .close = snd_mymidi_output_close, 4419 .close = snd_mymidi_output_close,
4425 .trigger = snd_mymidi_output_trigger, 4420 .trigger = snd_mymidi_output_trigger,
@@ -4439,9 +4434,9 @@ struct _snd_pcm_runtime {
4439 <programlisting> 4434 <programlisting>
4440<![CDATA[ 4435<![CDATA[
4441 struct list_head *list; 4436 struct list_head *list;
4442 snd_rawmidi_substream_t *substream; 4437 struct snd_rawmidi_substream *substream;
4443 list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) { 4438 list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) {
4444 substream = list_entry(list, snd_rawmidi_substream_t, list); 4439 substream = list_entry(list, struct snd_rawmidi_substream, list);
4445 sprintf(substream->name, "My MIDI Port %d", substream->number + 1); 4440 sprintf(substream->name, "My MIDI Port %d", substream->number + 1);
4446 } 4441 }
4447 /* same for SNDRV_RAWMIDI_STREAM_INPUT */ 4442 /* same for SNDRV_RAWMIDI_STREAM_INPUT */
@@ -4463,12 +4458,12 @@ struct _snd_pcm_runtime {
4463 4458
4464 <para> 4459 <para>
4465 If there is more than one port, your callbacks can determine the 4460 If there is more than one port, your callbacks can determine the
4466 port index from the snd_rawmidi_substream_t data passed to each 4461 port index from the struct snd_rawmidi_substream data passed to each
4467 callback: 4462 callback:
4468 <informalexample> 4463 <informalexample>
4469 <programlisting> 4464 <programlisting>
4470<![CDATA[ 4465<![CDATA[
4471 snd_rawmidi_substream_t *substream; 4466 struct snd_rawmidi_substream *substream;
4472 int index = substream->number; 4467 int index = substream->number;
4473]]> 4468]]>
4474 </programlisting> 4469 </programlisting>
@@ -4481,7 +4476,7 @@ struct _snd_pcm_runtime {
4481 <informalexample> 4476 <informalexample>
4482 <programlisting> 4477 <programlisting>
4483<![CDATA[ 4478<![CDATA[
4484 static int snd_xxx_open(snd_rawmidi_substream_t *substream); 4479 static int snd_xxx_open(struct snd_rawmidi_substream *substream);
4485]]> 4480]]>
4486 </programlisting> 4481 </programlisting>
4487 </informalexample> 4482 </informalexample>
@@ -4499,7 +4494,7 @@ struct _snd_pcm_runtime {
4499 <informalexample> 4494 <informalexample>
4500 <programlisting> 4495 <programlisting>
4501<![CDATA[ 4496<![CDATA[
4502 static int snd_xxx_close(snd_rawmidi_substream_t *substream); 4497 static int snd_xxx_close(struct snd_rawmidi_substream *substream);
4503]]> 4498]]>
4504 </programlisting> 4499 </programlisting>
4505 </informalexample> 4500 </informalexample>
@@ -4522,7 +4517,7 @@ struct _snd_pcm_runtime {
4522 <informalexample> 4517 <informalexample>
4523 <programlisting> 4518 <programlisting>
4524<![CDATA[ 4519<![CDATA[
4525 static void snd_xxx_output_trigger(snd_rawmidi_substream_t *substream, int up); 4520 static void snd_xxx_output_trigger(struct snd_rawmidi_substream *substream, int up);
4526]]> 4521]]>
4527 </programlisting> 4522 </programlisting>
4528 </informalexample> 4523 </informalexample>
@@ -4547,7 +4542,7 @@ struct _snd_pcm_runtime {
4547<![CDATA[ 4542<![CDATA[
4548 unsigned char data; 4543 unsigned char data;
4549 while (snd_rawmidi_transmit_peek(substream, &data, 1) == 1) { 4544 while (snd_rawmidi_transmit_peek(substream, &data, 1) == 1) {
4550 if (mychip_try_to_transmit(data)) 4545 if (snd_mychip_try_to_transmit(data))
4551 snd_rawmidi_transmit_ack(substream, 1); 4546 snd_rawmidi_transmit_ack(substream, 1);
4552 else 4547 else
4553 break; /* hardware FIFO full */ 4548 break; /* hardware FIFO full */
@@ -4564,11 +4559,11 @@ struct _snd_pcm_runtime {
4564 <informalexample> 4559 <informalexample>
4565 <programlisting> 4560 <programlisting>
4566<![CDATA[ 4561<![CDATA[
4567 while (mychip_transmit_possible()) { 4562 while (snd_mychip_transmit_possible()) {
4568 unsigned char data; 4563 unsigned char data;
4569 if (snd_rawmidi_transmit(substream, &data, 1) != 1) 4564 if (snd_rawmidi_transmit(substream, &data, 1) != 1)
4570 break; /* no more data */ 4565 break; /* no more data */
4571 mychip_transmit(data); 4566 snd_mychip_transmit(data);
4572 } 4567 }
4573]]> 4568]]>
4574 </programlisting> 4569 </programlisting>
@@ -4603,7 +4598,7 @@ struct _snd_pcm_runtime {
4603 <informalexample> 4598 <informalexample>
4604 <programlisting> 4599 <programlisting>
4605<![CDATA[ 4600<![CDATA[
4606 static void snd_xxx_input_trigger(snd_rawmidi_substream_t *substream, int up); 4601 static void snd_xxx_input_trigger(struct snd_rawmidi_substream *substream, int up);
4607]]> 4602]]>
4608 </programlisting> 4603 </programlisting>
4609 </informalexample> 4604 </informalexample>
@@ -4647,7 +4642,7 @@ struct _snd_pcm_runtime {
4647 <informalexample> 4642 <informalexample>
4648 <programlisting> 4643 <programlisting>
4649<![CDATA[ 4644<![CDATA[
4650 static void snd_xxx_drain(snd_rawmidi_substream_t *substream); 4645 static void snd_xxx_drain(struct snd_rawmidi_substream *substream);
4651]]> 4646]]>
4652 </programlisting> 4647 </programlisting>
4653 </informalexample> 4648 </informalexample>
@@ -4661,7 +4656,7 @@ struct _snd_pcm_runtime {
4661 4656
4662 <para> 4657 <para>
4663 This callback is optional. If you do not set 4658 This callback is optional. If you do not set
4664 <structfield>drain</structfield> in the snd_rawmidi_ops_t 4659 <structfield>drain</structfield> in the struct snd_rawmidi_ops
4665 structure, ALSA will simply wait for 50&nbsp;milliseconds 4660 structure, ALSA will simply wait for 50&nbsp;milliseconds
4666 instead. 4661 instead.
4667 </para> 4662 </para>
@@ -4703,7 +4698,7 @@ struct _snd_pcm_runtime {
4703 <informalexample> 4698 <informalexample>
4704 <programlisting> 4699 <programlisting>
4705<![CDATA[ 4700<![CDATA[
4706 opl3_t *opl3; 4701 struct snd_opl3 *opl3;
4707 snd_opl3_create(card, lport, rport, OPL3_HW_OPL3_XXX, 4702 snd_opl3_create(card, lport, rport, OPL3_HW_OPL3_XXX,
4708 integrated, &opl3); 4703 integrated, &opl3);
4709]]> 4704]]>
@@ -4736,7 +4731,7 @@ struct _snd_pcm_runtime {
4736 <informalexample> 4731 <informalexample>
4737 <programlisting> 4732 <programlisting>
4738<![CDATA[ 4733<![CDATA[
4739 opl3_t *opl3; 4734 struct snd_opl3 *opl3;
4740 snd_opl3_new(card, OPL3_HW_OPL3_XXX, &opl3); 4735 snd_opl3_new(card, OPL3_HW_OPL3_XXX, &opl3);
4741]]> 4736]]>
4742 </programlisting> 4737 </programlisting>
@@ -4767,7 +4762,7 @@ struct _snd_pcm_runtime {
4767 <informalexample> 4762 <informalexample>
4768 <programlisting> 4763 <programlisting>
4769<![CDATA[ 4764<![CDATA[
4770 snd_hwdep_t *opl3hwdep; 4765 struct snd_hwdep *opl3hwdep;
4771 snd_opl3_hwdep_new(opl3, 0, 1, &opl3hwdep); 4766 snd_opl3_hwdep_new(opl3, 0, 1, &opl3hwdep);
4772]]> 4767]]>
4773 </programlisting> 4768 </programlisting>
@@ -4804,7 +4799,7 @@ struct _snd_pcm_runtime {
4804 <informalexample> 4799 <informalexample>
4805 <programlisting> 4800 <programlisting>
4806<![CDATA[ 4801<![CDATA[
4807 snd_hwdep_t *hw; 4802 struct snd_hwdep *hw;
4808 snd_hwdep_new(card, "My HWDEP", 0, &hw); 4803 snd_hwdep_new(card, "My HWDEP", 0, &hw);
4809]]> 4804]]>
4810 </programlisting> 4805 </programlisting>
@@ -4823,7 +4818,7 @@ struct _snd_pcm_runtime {
4823 <informalexample> 4818 <informalexample>
4824 <programlisting> 4819 <programlisting>
4825<![CDATA[ 4820<![CDATA[
4826 mydata_t *p = kmalloc(sizeof(*p), GFP_KERNEL); 4821 struct mydata *p = kmalloc(sizeof(*p), GFP_KERNEL);
4827 hw->private_data = p; 4822 hw->private_data = p;
4828 hw->private_free = mydata_free; 4823 hw->private_free = mydata_free;
4829]]> 4824]]>
@@ -4835,9 +4830,9 @@ struct _snd_pcm_runtime {
4835 <informalexample> 4830 <informalexample>
4836 <programlisting> 4831 <programlisting>
4837<![CDATA[ 4832<![CDATA[
4838 static void mydata_free(snd_hwdep_t *hw) 4833 static void mydata_free(struct snd_hwdep *hw)
4839 { 4834 {
4840 mydata_t *p = hw->private_data; 4835 struct mydata *p = hw->private_data;
4841 kfree(p); 4836 kfree(p);
4842 } 4837 }
4843]]> 4838]]>
@@ -5061,9 +5056,9 @@ struct _snd_pcm_runtime {
5061 <informalexample> 5056 <informalexample>
5062 <programlisting> 5057 <programlisting>
5063<![CDATA[ 5058<![CDATA[
5064 static int playback_copy(snd_pcm_substream_t *substream, int channel, 5059 static int playback_copy(struct snd_pcm_substream *substream, int channel,
5065 snd_pcm_uframes_t pos, void *src, snd_pcm_uframes_t count); 5060 snd_pcm_uframes_t pos, void *src, snd_pcm_uframes_t count);
5066 static int capture_copy(snd_pcm_substream_t *substream, int channel, 5061 static int capture_copy(struct snd_pcm_substream *substream, int channel,
5067 snd_pcm_uframes_t pos, void *dst, snd_pcm_uframes_t count); 5062 snd_pcm_uframes_t pos, void *dst, snd_pcm_uframes_t count);
5068]]> 5063]]>
5069 </programlisting> 5064 </programlisting>
@@ -5144,7 +5139,7 @@ struct _snd_pcm_runtime {
5144 <informalexample> 5139 <informalexample>
5145 <programlisting> 5140 <programlisting>
5146<![CDATA[ 5141<![CDATA[
5147 static int silence(snd_pcm_substream_t *substream, int channel, 5142 static int silence(struct snd_pcm_substream *substream, int channel,
5148 snd_pcm_uframes_t pos, snd_pcm_uframes_t count); 5143 snd_pcm_uframes_t pos, snd_pcm_uframes_t count);
5149]]> 5144]]>
5150 </programlisting> 5145 </programlisting>
@@ -5211,7 +5206,7 @@ struct _snd_pcm_runtime {
5211 <informalexample> 5206 <informalexample>
5212 <programlisting> 5207 <programlisting>
5213<![CDATA[ 5208<![CDATA[
5214 snd_pcm_sgbuf_t *sgbuf = (snd_pcm_sgbuf_t*)substream->dma_private; 5209 struct snd_sg_buf *sgbuf = (struct snd_sg_buf_t*)substream->dma_private;
5215]]> 5210]]>
5216 </programlisting> 5211 </programlisting>
5217 </informalexample> 5212 </informalexample>
@@ -5266,7 +5261,7 @@ struct _snd_pcm_runtime {
5266 #include <linux/vmalloc.h> 5261 #include <linux/vmalloc.h>
5267 5262
5268 /* get the physical page pointer on the given offset */ 5263 /* get the physical page pointer on the given offset */
5269 static struct page *mychip_page(snd_pcm_substream_t *substream, 5264 static struct page *mychip_page(struct snd_pcm_substream *substream,
5270 unsigned long offset) 5265 unsigned long offset)
5271 { 5266 {
5272 void *pageptr = substream->runtime->dma_area + offset; 5267 void *pageptr = substream->runtime->dma_area + offset;
@@ -5301,7 +5296,7 @@ struct _snd_pcm_runtime {
5301 <informalexample> 5296 <informalexample>
5302 <programlisting> 5297 <programlisting>
5303<![CDATA[ 5298<![CDATA[
5304 snd_info_entry_t *entry; 5299 struct snd_info_entry *entry;
5305 int err = snd_card_proc_new(card, "my-file", &entry); 5300 int err = snd_card_proc_new(card, "my-file", &entry);
5306]]> 5301]]>
5307 </programlisting> 5302 </programlisting>
@@ -5345,8 +5340,8 @@ struct _snd_pcm_runtime {
5345 <informalexample> 5340 <informalexample>
5346 <programlisting> 5341 <programlisting>
5347<![CDATA[ 5342<![CDATA[
5348 static void my_proc_read(snd_info_entry_t *entry, 5343 static void my_proc_read(struct snd_info_entry *entry,
5349 snd_info_buffer_t *buffer); 5344 struct snd_info_buffer *buffer);
5350]]> 5345]]>
5351 </programlisting> 5346 </programlisting>
5352 </informalexample> 5347 </informalexample>
@@ -5361,10 +5356,10 @@ struct _snd_pcm_runtime {
5361 <informalexample> 5356 <informalexample>
5362 <programlisting> 5357 <programlisting>
5363<![CDATA[ 5358<![CDATA[
5364 static void my_proc_read(snd_info_entry_t *entry, 5359 static void my_proc_read(struct snd_info_entry *entry,
5365 snd_info_buffer_t *buffer) 5360 struct snd_info_buffer *buffer)
5366 { 5361 {
5367 chip_t *chip = entry->private_data; 5362 struct my_chip *chip = entry->private_data;
5368 5363
5369 snd_iprintf(buffer, "This is my chip!\n"); 5364 snd_iprintf(buffer, "This is my chip!\n");
5370 snd_iprintf(buffer, "Port = %ld\n", chip->port); 5365 snd_iprintf(buffer, "Port = %ld\n", chip->port);
@@ -5453,7 +5448,7 @@ struct _snd_pcm_runtime {
5453 <informalexample> 5448 <informalexample>
5454 <programlisting> 5449 <programlisting>
5455<![CDATA[ 5450<![CDATA[
5456 static long my_file_io_read(snd_info_entry_t *entry, 5451 static long my_file_io_read(struct snd_info_entry *entry,
5457 void *file_private_data, 5452 void *file_private_data,
5458 struct file *file, 5453 struct file *file,
5459 char *buf, 5454 char *buf,
@@ -5496,12 +5491,12 @@ struct _snd_pcm_runtime {
5496 <programlisting> 5491 <programlisting>
5497<![CDATA[ 5492<![CDATA[
5498 #ifdef CONFIG_PM 5493 #ifdef CONFIG_PM
5499 static int snd_my_suspend(snd_card_t *card, pm_message_t state) 5494 static int snd_my_suspend(struct snd_card *card, pm_message_t state)
5500 { 5495 {
5501 .... // do things for suspsend 5496 .... // do things for suspsend
5502 return 0; 5497 return 0;
5503 } 5498 }
5504 static int snd_my_resume(snd_card_t *card) 5499 static int snd_my_resume(struct snd_card *card)
5505 { 5500 {
5506 .... // do things for suspsend 5501 .... // do things for suspsend
5507 return 0; 5502 return 0;
@@ -5530,10 +5525,10 @@ struct _snd_pcm_runtime {
5530 <informalexample> 5525 <informalexample>
5531 <programlisting> 5526 <programlisting>
5532<![CDATA[ 5527<![CDATA[
5533 static int mychip_suspend(snd_card_t *card, pm_message_t state) 5528 static int mychip_suspend(struct snd_card *card, pm_message_t state)
5534 { 5529 {
5535 /* (1) */ 5530 /* (1) */
5536 mychip_t *chip = card->pm_private_data; 5531 struct mychip *chip = card->pm_private_data;
5537 /* (2) */ 5532 /* (2) */
5538 snd_pcm_suspend_all(chip->pcm); 5533 snd_pcm_suspend_all(chip->pcm);
5539 /* (3) */ 5534 /* (3) */
@@ -5570,10 +5565,10 @@ struct _snd_pcm_runtime {
5570 <informalexample> 5565 <informalexample>
5571 <programlisting> 5566 <programlisting>
5572<![CDATA[ 5567<![CDATA[
5573 static void mychip_resume(mychip_t *chip) 5568 static void mychip_resume(struct mychip *chip)
5574 { 5569 {
5575 /* (1) */ 5570 /* (1) */
5576 mychip_t *chip = card->pm_private_data; 5571 struct mychip *chip = card->pm_private_data;
5577 /* (2) */ 5572 /* (2) */
5578 pci_enable_device(chip->pci); 5573 pci_enable_device(chip->pci);
5579 /* (3) */ 5574 /* (3) */
@@ -5602,8 +5597,8 @@ struct _snd_pcm_runtime {
5602 const struct pci_device_id *pci_id) 5597 const struct pci_device_id *pci_id)
5603 { 5598 {
5604 .... 5599 ....
5605 snd_card_t *card; 5600 struct snd_card *card;
5606 mychip_t *chip; 5601 struct mychip *chip;
5607 .... 5602 ....
5608 snd_card_set_pm_callback(card, snd_my_suspend, snd_my_resume, chip); 5603 snd_card_set_pm_callback(card, snd_my_suspend, snd_my_resume, chip);
5609 .... 5604 ....
diff --git a/Documentation/sound/alsa/hda_codec.txt b/Documentation/sound/alsa/hda_codec.txt
index e9d07b8f1acb..0be57ed81302 100644
--- a/Documentation/sound/alsa/hda_codec.txt
+++ b/Documentation/sound/alsa/hda_codec.txt
@@ -63,7 +63,7 @@ The bus instance is created via snd_hda_bus_new(). You need to pass
63the card instance, the template, and the pointer to store the 63the card instance, the template, and the pointer to store the
64resultant bus instance. 64resultant bus instance.
65 65
66int snd_hda_bus_new(snd_card_t *card, const struct hda_bus_template *temp, 66int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp,
67 struct hda_bus **busp); 67 struct hda_bus **busp);
68 68
69It returns zero if successful. A negative return value means any 69It returns zero if successful. A negative return value means any
@@ -166,14 +166,14 @@ The ops field contains the following callback functions:
166 166
167struct hda_pcm_ops { 167struct hda_pcm_ops {
168 int (*open)(struct hda_pcm_stream *info, struct hda_codec *codec, 168 int (*open)(struct hda_pcm_stream *info, struct hda_codec *codec,
169 snd_pcm_substream_t *substream); 169 struct snd_pcm_substream *substream);
170 int (*close)(struct hda_pcm_stream *info, struct hda_codec *codec, 170 int (*close)(struct hda_pcm_stream *info, struct hda_codec *codec,
171 snd_pcm_substream_t *substream); 171 struct snd_pcm_substream *substream);
172 int (*prepare)(struct hda_pcm_stream *info, struct hda_codec *codec, 172 int (*prepare)(struct hda_pcm_stream *info, struct hda_codec *codec,
173 unsigned int stream_tag, unsigned int format, 173 unsigned int stream_tag, unsigned int format,
174 snd_pcm_substream_t *substream); 174 struct snd_pcm_substream *substream);
175 int (*cleanup)(struct hda_pcm_stream *info, struct hda_codec *codec, 175 int (*cleanup)(struct hda_pcm_stream *info, struct hda_codec *codec,
176 snd_pcm_substream_t *substream); 176 struct snd_pcm_substream *substream);
177}; 177};
178 178
179All are non-NULL, so you can call them safely without NULL check. 179All are non-NULL, so you can call them safely without NULL check.
@@ -284,7 +284,7 @@ parameter, and PCI subsystem IDs. If the matching entry is found, it
284returns the config field value. 284returns the config field value.
285 285
286snd_hda_add_new_ctls() can be used to create and add control entries. 286snd_hda_add_new_ctls() can be used to create and add control entries.
287Pass the zero-terminated array of snd_kcontrol_new_t. The same array 287Pass the zero-terminated array of struct snd_kcontrol_new. The same array
288can be passed to snd_hda_resume_ctls() for resume. 288can be passed to snd_hda_resume_ctls() for resume.
289Note that this will call control->put callback of these entries. So, 289Note that this will call control->put callback of these entries. So,
290put callback should check codec->in_resume and force to restore the 290put callback should check codec->in_resume and force to restore the
@@ -292,7 +292,7 @@ given value if it's non-zero even if the value is identical with the
292cached value. 292cached value.
293 293
294Macros HDA_CODEC_VOLUME(), HDA_CODEC_MUTE() and their variables can be 294Macros HDA_CODEC_VOLUME(), HDA_CODEC_MUTE() and their variables can be
295used for the entry of snd_kcontrol_new_t. 295used for the entry of struct snd_kcontrol_new.
296 296
297The input MUX helper callbacks for such a control are provided, too: 297The input MUX helper callbacks for such a control are provided, too:
298snd_hda_input_mux_info() and snd_hda_input_mux_put(). See 298snd_hda_input_mux_info() and snd_hda_input_mux_put(). See