1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> 4 5<!-- ****************************************************** --> 6<!-- Header --> 7<!-- ****************************************************** --> 8<book id="ALSA-Driver-API"> 9 <bookinfo> 10 <title>The ALSA Driver API</title> 11 12 <legalnotice> 13 <para> 14 This document is free; you can redistribute it and/or modify it 15 under the terms of the GNU General Public License as published by 16 the Free Software Foundation; either version 2 of the License, or 17 (at your option) any later version. 18 </para> 19 20 <para> 21 This document is distributed in the hope that it will be useful, 22 but <emphasis>WITHOUT ANY WARRANTY</emphasis>; without even the 23 implied warranty of <emphasis>MERCHANTABILITY or FITNESS FOR A 24 PARTICULAR PURPOSE</emphasis>. See the GNU General Public License 25 for more details. 26 </para> 27 28 <para> 29 You should have received a copy of the GNU General Public 30 License along with this program; if not, write to the Free 31 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 32 MA 02111-1307 USA 33 </para> 34 </legalnotice> 35 36 </bookinfo> 37 38<toc></toc> 39 40 <chapter><title>Management of Cards and Devices</title> 41 <sect1><title>Card Management</title> 42<!-- sound/core/init.c --> 43<refentry id="API-snd-device-initialize"> 44<refentryinfo> 45 <title>LINUX</title> 46 <productname>Kernel Hackers Manual</productname> 47 <date>July 2017</date> 48</refentryinfo> 49<refmeta> 50 <refentrytitle><phrase>snd_device_initialize</phrase></refentrytitle> 51 <manvolnum>9</manvolnum> 52 <refmiscinfo class="version">4.1.27</refmiscinfo> 53</refmeta> 54<refnamediv> 55 <refname>snd_device_initialize</refname> 56 <refpurpose> 57 Initialize struct device for sound devices 58 </refpurpose> 59</refnamediv> 60<refsynopsisdiv> 61 <title>Synopsis</title> 62 <funcsynopsis><funcprototype> 63 <funcdef>void <function>snd_device_initialize </function></funcdef> 64 <paramdef>struct device * <parameter>dev</parameter></paramdef> 65 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 66 </funcprototype></funcsynopsis> 67</refsynopsisdiv> 68<refsect1> 69 <title>Arguments</title> 70 <variablelist> 71 <varlistentry> 72 <term><parameter>dev</parameter></term> 73 <listitem> 74 <para> 75 device to initialize 76 </para> 77 </listitem> 78 </varlistentry> 79 <varlistentry> 80 <term><parameter>card</parameter></term> 81 <listitem> 82 <para> 83 card to assign, optional 84 </para> 85 </listitem> 86 </varlistentry> 87 </variablelist> 88</refsect1> 89</refentry> 90 91<refentry id="API-snd-card-new"> 92<refentryinfo> 93 <title>LINUX</title> 94 <productname>Kernel Hackers Manual</productname> 95 <date>July 2017</date> 96</refentryinfo> 97<refmeta> 98 <refentrytitle><phrase>snd_card_new</phrase></refentrytitle> 99 <manvolnum>9</manvolnum> 100 <refmiscinfo class="version">4.1.27</refmiscinfo> 101</refmeta> 102<refnamediv> 103 <refname>snd_card_new</refname> 104 <refpurpose> 105 create and initialize a soundcard structure 106 </refpurpose> 107</refnamediv> 108<refsynopsisdiv> 109 <title>Synopsis</title> 110 <funcsynopsis><funcprototype> 111 <funcdef>int <function>snd_card_new </function></funcdef> 112 <paramdef>struct device * <parameter>parent</parameter></paramdef> 113 <paramdef>int <parameter>idx</parameter></paramdef> 114 <paramdef>const char * <parameter>xid</parameter></paramdef> 115 <paramdef>struct module * <parameter>module</parameter></paramdef> 116 <paramdef>int <parameter>extra_size</parameter></paramdef> 117 <paramdef>struct snd_card ** <parameter>card_ret</parameter></paramdef> 118 </funcprototype></funcsynopsis> 119</refsynopsisdiv> 120<refsect1> 121 <title>Arguments</title> 122 <variablelist> 123 <varlistentry> 124 <term><parameter>parent</parameter></term> 125 <listitem> 126 <para> 127 the parent device object 128 </para> 129 </listitem> 130 </varlistentry> 131 <varlistentry> 132 <term><parameter>idx</parameter></term> 133 <listitem> 134 <para> 135 card index (address) [0 ... (SNDRV_CARDS-1)] 136 </para> 137 </listitem> 138 </varlistentry> 139 <varlistentry> 140 <term><parameter>xid</parameter></term> 141 <listitem> 142 <para> 143 card identification (ASCII string) 144 </para> 145 </listitem> 146 </varlistentry> 147 <varlistentry> 148 <term><parameter>module</parameter></term> 149 <listitem> 150 <para> 151 top level module for locking 152 </para> 153 </listitem> 154 </varlistentry> 155 <varlistentry> 156 <term><parameter>extra_size</parameter></term> 157 <listitem> 158 <para> 159 allocate this extra size after the main soundcard structure 160 </para> 161 </listitem> 162 </varlistentry> 163 <varlistentry> 164 <term><parameter>card_ret</parameter></term> 165 <listitem> 166 <para> 167 the pointer to store the created card instance 168 </para> 169 </listitem> 170 </varlistentry> 171 </variablelist> 172</refsect1> 173<refsect1> 174<title>Description</title> 175<para> 176 Creates and initializes a soundcard structure. 177 </para><para> 178 179 The function allocates snd_card instance via kzalloc with the given 180 space for the driver to use freely. The allocated struct is stored 181 in the given card_ret pointer. 182</para> 183</refsect1> 184<refsect1> 185<title>Return</title> 186<para> 187 Zero if successful or a negative error code. 188</para> 189</refsect1> 190</refentry> 191 192<refentry id="API-snd-card-disconnect"> 193<refentryinfo> 194 <title>LINUX</title> 195 <productname>Kernel Hackers Manual</productname> 196 <date>July 2017</date> 197</refentryinfo> 198<refmeta> 199 <refentrytitle><phrase>snd_card_disconnect</phrase></refentrytitle> 200 <manvolnum>9</manvolnum> 201 <refmiscinfo class="version">4.1.27</refmiscinfo> 202</refmeta> 203<refnamediv> 204 <refname>snd_card_disconnect</refname> 205 <refpurpose> 206 disconnect all APIs from the file-operations (user space) 207 </refpurpose> 208</refnamediv> 209<refsynopsisdiv> 210 <title>Synopsis</title> 211 <funcsynopsis><funcprototype> 212 <funcdef>int <function>snd_card_disconnect </function></funcdef> 213 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 214 </funcprototype></funcsynopsis> 215</refsynopsisdiv> 216<refsect1> 217 <title>Arguments</title> 218 <variablelist> 219 <varlistentry> 220 <term><parameter>card</parameter></term> 221 <listitem> 222 <para> 223 soundcard structure 224 </para> 225 </listitem> 226 </varlistentry> 227 </variablelist> 228</refsect1> 229<refsect1> 230<title>Description</title> 231<para> 232 Disconnects all APIs from the file-operations (user space). 233</para> 234</refsect1> 235<refsect1> 236<title>Return</title> 237<para> 238 Zero, otherwise a negative error code. 239</para> 240</refsect1> 241<refsect1> 242<title>Note</title> 243<para> 244 The current implementation replaces all active file->f_op with special 245 dummy file operations (they do nothing except release). 246</para> 247</refsect1> 248</refentry> 249 250<refentry id="API-snd-card-free-when-closed"> 251<refentryinfo> 252 <title>LINUX</title> 253 <productname>Kernel Hackers Manual</productname> 254 <date>July 2017</date> 255</refentryinfo> 256<refmeta> 257 <refentrytitle><phrase>snd_card_free_when_closed</phrase></refentrytitle> 258 <manvolnum>9</manvolnum> 259 <refmiscinfo class="version">4.1.27</refmiscinfo> 260</refmeta> 261<refnamediv> 262 <refname>snd_card_free_when_closed</refname> 263 <refpurpose> 264 Disconnect the card, free it later eventually 265 </refpurpose> 266</refnamediv> 267<refsynopsisdiv> 268 <title>Synopsis</title> 269 <funcsynopsis><funcprototype> 270 <funcdef>int <function>snd_card_free_when_closed </function></funcdef> 271 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 272 </funcprototype></funcsynopsis> 273</refsynopsisdiv> 274<refsect1> 275 <title>Arguments</title> 276 <variablelist> 277 <varlistentry> 278 <term><parameter>card</parameter></term> 279 <listitem> 280 <para> 281 soundcard structure 282 </para> 283 </listitem> 284 </varlistentry> 285 </variablelist> 286</refsect1> 287<refsect1> 288<title>Description</title> 289<para> 290 Unlike <function>snd_card_free</function>, this function doesn't try to release the card 291 resource immediately, but tries to disconnect at first. When the card 292 is still in use, the function returns before freeing the resources. 293 The card resources will be freed when the refcount gets to zero. 294</para> 295</refsect1> 296</refentry> 297 298<refentry id="API-snd-card-free"> 299<refentryinfo> 300 <title>LINUX</title> 301 <productname>Kernel Hackers Manual</productname> 302 <date>July 2017</date> 303</refentryinfo> 304<refmeta> 305 <refentrytitle><phrase>snd_card_free</phrase></refentrytitle> 306 <manvolnum>9</manvolnum> 307 <refmiscinfo class="version">4.1.27</refmiscinfo> 308</refmeta> 309<refnamediv> 310 <refname>snd_card_free</refname> 311 <refpurpose> 312 frees given soundcard structure 313 </refpurpose> 314</refnamediv> 315<refsynopsisdiv> 316 <title>Synopsis</title> 317 <funcsynopsis><funcprototype> 318 <funcdef>int <function>snd_card_free </function></funcdef> 319 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 320 </funcprototype></funcsynopsis> 321</refsynopsisdiv> 322<refsect1> 323 <title>Arguments</title> 324 <variablelist> 325 <varlistentry> 326 <term><parameter>card</parameter></term> 327 <listitem> 328 <para> 329 soundcard structure 330 </para> 331 </listitem> 332 </varlistentry> 333 </variablelist> 334</refsect1> 335<refsect1> 336<title>Description</title> 337<para> 338 This function releases the soundcard structure and the all assigned 339 devices automatically. That is, you don't have to release the devices 340 by yourself. 341 </para><para> 342 343 This function waits until the all resources are properly released. 344</para> 345</refsect1> 346<refsect1> 347<title>Return</title> 348<para> 349 Zero. Frees all associated devices and frees the control 350 interface associated to given soundcard. 351</para> 352</refsect1> 353</refentry> 354 355<refentry id="API-snd-card-set-id"> 356<refentryinfo> 357 <title>LINUX</title> 358 <productname>Kernel Hackers Manual</productname> 359 <date>July 2017</date> 360</refentryinfo> 361<refmeta> 362 <refentrytitle><phrase>snd_card_set_id</phrase></refentrytitle> 363 <manvolnum>9</manvolnum> 364 <refmiscinfo class="version">4.1.27</refmiscinfo> 365</refmeta> 366<refnamediv> 367 <refname>snd_card_set_id</refname> 368 <refpurpose> 369 set card identification name 370 </refpurpose> 371</refnamediv> 372<refsynopsisdiv> 373 <title>Synopsis</title> 374 <funcsynopsis><funcprototype> 375 <funcdef>void <function>snd_card_set_id </function></funcdef> 376 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 377 <paramdef>const char * <parameter>nid</parameter></paramdef> 378 </funcprototype></funcsynopsis> 379</refsynopsisdiv> 380<refsect1> 381 <title>Arguments</title> 382 <variablelist> 383 <varlistentry> 384 <term><parameter>card</parameter></term> 385 <listitem> 386 <para> 387 soundcard structure 388 </para> 389 </listitem> 390 </varlistentry> 391 <varlistentry> 392 <term><parameter>nid</parameter></term> 393 <listitem> 394 <para> 395 new identification string 396 </para> 397 </listitem> 398 </varlistentry> 399 </variablelist> 400</refsect1> 401<refsect1> 402<title>Description</title> 403<para> 404 This function sets the card identification and checks for name 405 collisions. 406</para> 407</refsect1> 408</refentry> 409 410<refentry id="API-snd-card-add-dev-attr"> 411<refentryinfo> 412 <title>LINUX</title> 413 <productname>Kernel Hackers Manual</productname> 414 <date>July 2017</date> 415</refentryinfo> 416<refmeta> 417 <refentrytitle><phrase>snd_card_add_dev_attr</phrase></refentrytitle> 418 <manvolnum>9</manvolnum> 419 <refmiscinfo class="version">4.1.27</refmiscinfo> 420</refmeta> 421<refnamediv> 422 <refname>snd_card_add_dev_attr</refname> 423 <refpurpose> 424 Append a new sysfs attribute group to card 425 </refpurpose> 426</refnamediv> 427<refsynopsisdiv> 428 <title>Synopsis</title> 429 <funcsynopsis><funcprototype> 430 <funcdef>int <function>snd_card_add_dev_attr </function></funcdef> 431 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 432 <paramdef>const struct attribute_group * <parameter>group</parameter></paramdef> 433 </funcprototype></funcsynopsis> 434</refsynopsisdiv> 435<refsect1> 436 <title>Arguments</title> 437 <variablelist> 438 <varlistentry> 439 <term><parameter>card</parameter></term> 440 <listitem> 441 <para> 442 card instance 443 </para> 444 </listitem> 445 </varlistentry> 446 <varlistentry> 447 <term><parameter>group</parameter></term> 448 <listitem> 449 <para> 450 attribute group to append 451 </para> 452 </listitem> 453 </varlistentry> 454 </variablelist> 455</refsect1> 456</refentry> 457 458<refentry id="API-snd-card-register"> 459<refentryinfo> 460 <title>LINUX</title> 461 <productname>Kernel Hackers Manual</productname> 462 <date>July 2017</date> 463</refentryinfo> 464<refmeta> 465 <refentrytitle><phrase>snd_card_register</phrase></refentrytitle> 466 <manvolnum>9</manvolnum> 467 <refmiscinfo class="version">4.1.27</refmiscinfo> 468</refmeta> 469<refnamediv> 470 <refname>snd_card_register</refname> 471 <refpurpose> 472 register the soundcard 473 </refpurpose> 474</refnamediv> 475<refsynopsisdiv> 476 <title>Synopsis</title> 477 <funcsynopsis><funcprototype> 478 <funcdef>int <function>snd_card_register </function></funcdef> 479 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 480 </funcprototype></funcsynopsis> 481</refsynopsisdiv> 482<refsect1> 483 <title>Arguments</title> 484 <variablelist> 485 <varlistentry> 486 <term><parameter>card</parameter></term> 487 <listitem> 488 <para> 489 soundcard structure 490 </para> 491 </listitem> 492 </varlistentry> 493 </variablelist> 494</refsect1> 495<refsect1> 496<title>Description</title> 497<para> 498 This function registers all the devices assigned to the soundcard. 499 Until calling this, the ALSA control interface is blocked from the 500 external accesses. Thus, you should call this function at the end 501 of the initialization of the card. 502</para> 503</refsect1> 504<refsect1> 505<title>Return</title> 506<para> 507 Zero otherwise a negative error code if the registration failed. 508</para> 509</refsect1> 510</refentry> 511 512<refentry id="API-snd-component-add"> 513<refentryinfo> 514 <title>LINUX</title> 515 <productname>Kernel Hackers Manual</productname> 516 <date>July 2017</date> 517</refentryinfo> 518<refmeta> 519 <refentrytitle><phrase>snd_component_add</phrase></refentrytitle> 520 <manvolnum>9</manvolnum> 521 <refmiscinfo class="version">4.1.27</refmiscinfo> 522</refmeta> 523<refnamediv> 524 <refname>snd_component_add</refname> 525 <refpurpose> 526 add a component string 527 </refpurpose> 528</refnamediv> 529<refsynopsisdiv> 530 <title>Synopsis</title> 531 <funcsynopsis><funcprototype> 532 <funcdef>int <function>snd_component_add </function></funcdef> 533 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 534 <paramdef>const char * <parameter>component</parameter></paramdef> 535 </funcprototype></funcsynopsis> 536</refsynopsisdiv> 537<refsect1> 538 <title>Arguments</title> 539 <variablelist> 540 <varlistentry> 541 <term><parameter>card</parameter></term> 542 <listitem> 543 <para> 544 soundcard structure 545 </para> 546 </listitem> 547 </varlistentry> 548 <varlistentry> 549 <term><parameter>component</parameter></term> 550 <listitem> 551 <para> 552 the component id string 553 </para> 554 </listitem> 555 </varlistentry> 556 </variablelist> 557</refsect1> 558<refsect1> 559<title>Description</title> 560<para> 561 This function adds the component id string to the supported list. 562 The component can be referred from the alsa-lib. 563</para> 564</refsect1> 565<refsect1> 566<title>Return</title> 567<para> 568 Zero otherwise a negative error code. 569</para> 570</refsect1> 571</refentry> 572 573<refentry id="API-snd-card-file-add"> 574<refentryinfo> 575 <title>LINUX</title> 576 <productname>Kernel Hackers Manual</productname> 577 <date>July 2017</date> 578</refentryinfo> 579<refmeta> 580 <refentrytitle><phrase>snd_card_file_add</phrase></refentrytitle> 581 <manvolnum>9</manvolnum> 582 <refmiscinfo class="version">4.1.27</refmiscinfo> 583</refmeta> 584<refnamediv> 585 <refname>snd_card_file_add</refname> 586 <refpurpose> 587 add the file to the file list of the card 588 </refpurpose> 589</refnamediv> 590<refsynopsisdiv> 591 <title>Synopsis</title> 592 <funcsynopsis><funcprototype> 593 <funcdef>int <function>snd_card_file_add </function></funcdef> 594 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 595 <paramdef>struct file * <parameter>file</parameter></paramdef> 596 </funcprototype></funcsynopsis> 597</refsynopsisdiv> 598<refsect1> 599 <title>Arguments</title> 600 <variablelist> 601 <varlistentry> 602 <term><parameter>card</parameter></term> 603 <listitem> 604 <para> 605 soundcard structure 606 </para> 607 </listitem> 608 </varlistentry> 609 <varlistentry> 610 <term><parameter>file</parameter></term> 611 <listitem> 612 <para> 613 file pointer 614 </para> 615 </listitem> 616 </varlistentry> 617 </variablelist> 618</refsect1> 619<refsect1> 620<title>Description</title> 621<para> 622 This function adds the file to the file linked-list of the card. 623 This linked-list is used to keep tracking the connection state, 624 and to avoid the release of busy resources by hotplug. 625</para> 626</refsect1> 627<refsect1> 628<title>Return</title> 629<para> 630 zero or a negative error code. 631</para> 632</refsect1> 633</refentry> 634 635<refentry id="API-snd-card-file-remove"> 636<refentryinfo> 637 <title>LINUX</title> 638 <productname>Kernel Hackers Manual</productname> 639 <date>July 2017</date> 640</refentryinfo> 641<refmeta> 642 <refentrytitle><phrase>snd_card_file_remove</phrase></refentrytitle> 643 <manvolnum>9</manvolnum> 644 <refmiscinfo class="version">4.1.27</refmiscinfo> 645</refmeta> 646<refnamediv> 647 <refname>snd_card_file_remove</refname> 648 <refpurpose> 649 remove the file from the file list 650 </refpurpose> 651</refnamediv> 652<refsynopsisdiv> 653 <title>Synopsis</title> 654 <funcsynopsis><funcprototype> 655 <funcdef>int <function>snd_card_file_remove </function></funcdef> 656 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 657 <paramdef>struct file * <parameter>file</parameter></paramdef> 658 </funcprototype></funcsynopsis> 659</refsynopsisdiv> 660<refsect1> 661 <title>Arguments</title> 662 <variablelist> 663 <varlistentry> 664 <term><parameter>card</parameter></term> 665 <listitem> 666 <para> 667 soundcard structure 668 </para> 669 </listitem> 670 </varlistentry> 671 <varlistentry> 672 <term><parameter>file</parameter></term> 673 <listitem> 674 <para> 675 file pointer 676 </para> 677 </listitem> 678 </varlistentry> 679 </variablelist> 680</refsect1> 681<refsect1> 682<title>Description</title> 683<para> 684 This function removes the file formerly added to the card via 685 <function>snd_card_file_add</function> function. 686 If all files are removed and <function>snd_card_free_when_closed</function> was 687 called beforehand, it processes the pending release of 688 resources. 689</para> 690</refsect1> 691<refsect1> 692<title>Return</title> 693<para> 694 Zero or a negative error code. 695</para> 696</refsect1> 697</refentry> 698 699<refentry id="API-snd-power-wait"> 700<refentryinfo> 701 <title>LINUX</title> 702 <productname>Kernel Hackers Manual</productname> 703 <date>July 2017</date> 704</refentryinfo> 705<refmeta> 706 <refentrytitle><phrase>snd_power_wait</phrase></refentrytitle> 707 <manvolnum>9</manvolnum> 708 <refmiscinfo class="version">4.1.27</refmiscinfo> 709</refmeta> 710<refnamediv> 711 <refname>snd_power_wait</refname> 712 <refpurpose> 713 wait until the power-state is changed. 714 </refpurpose> 715</refnamediv> 716<refsynopsisdiv> 717 <title>Synopsis</title> 718 <funcsynopsis><funcprototype> 719 <funcdef>int <function>snd_power_wait </function></funcdef> 720 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 721 <paramdef>unsigned int <parameter>power_state</parameter></paramdef> 722 </funcprototype></funcsynopsis> 723</refsynopsisdiv> 724<refsect1> 725 <title>Arguments</title> 726 <variablelist> 727 <varlistentry> 728 <term><parameter>card</parameter></term> 729 <listitem> 730 <para> 731 soundcard structure 732 </para> 733 </listitem> 734 </varlistentry> 735 <varlistentry> 736 <term><parameter>power_state</parameter></term> 737 <listitem> 738 <para> 739 expected power state 740 </para> 741 </listitem> 742 </varlistentry> 743 </variablelist> 744</refsect1> 745<refsect1> 746<title>Description</title> 747<para> 748 Waits until the power-state is changed. 749</para> 750</refsect1> 751<refsect1> 752<title>Return</title> 753<para> 754 Zero if successful, or a negative error code. 755</para> 756</refsect1> 757<refsect1> 758<title>Note</title> 759<para> 760 the power lock must be active before call. 761</para> 762</refsect1> 763</refentry> 764 765 </sect1> 766 <sect1><title>Device Components</title> 767<!-- sound/core/device.c --> 768<refentry id="API-snd-device-new"> 769<refentryinfo> 770 <title>LINUX</title> 771 <productname>Kernel Hackers Manual</productname> 772 <date>July 2017</date> 773</refentryinfo> 774<refmeta> 775 <refentrytitle><phrase>snd_device_new</phrase></refentrytitle> 776 <manvolnum>9</manvolnum> 777 <refmiscinfo class="version">4.1.27</refmiscinfo> 778</refmeta> 779<refnamediv> 780 <refname>snd_device_new</refname> 781 <refpurpose> 782 create an ALSA device component 783 </refpurpose> 784</refnamediv> 785<refsynopsisdiv> 786 <title>Synopsis</title> 787 <funcsynopsis><funcprototype> 788 <funcdef>int <function>snd_device_new </function></funcdef> 789 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 790 <paramdef>enum snd_device_type <parameter>type</parameter></paramdef> 791 <paramdef>void * <parameter>device_data</parameter></paramdef> 792 <paramdef>struct snd_device_ops * <parameter>ops</parameter></paramdef> 793 </funcprototype></funcsynopsis> 794</refsynopsisdiv> 795<refsect1> 796 <title>Arguments</title> 797 <variablelist> 798 <varlistentry> 799 <term><parameter>card</parameter></term> 800 <listitem> 801 <para> 802 the card instance 803 </para> 804 </listitem> 805 </varlistentry> 806 <varlistentry> 807 <term><parameter>type</parameter></term> 808 <listitem> 809 <para> 810 the device type, SNDRV_DEV_XXX 811 </para> 812 </listitem> 813 </varlistentry> 814 <varlistentry> 815 <term><parameter>device_data</parameter></term> 816 <listitem> 817 <para> 818 the data pointer of this device 819 </para> 820 </listitem> 821 </varlistentry> 822 <varlistentry> 823 <term><parameter>ops</parameter></term> 824 <listitem> 825 <para> 826 the operator table 827 </para> 828 </listitem> 829 </varlistentry> 830 </variablelist> 831</refsect1> 832<refsect1> 833<title>Description</title> 834<para> 835 Creates a new device component for the given data pointer. 836 The device will be assigned to the card and managed together 837 by the card. 838 </para><para> 839 840 The data pointer plays a role as the identifier, too, so the 841 pointer address must be unique and unchanged. 842</para> 843</refsect1> 844<refsect1> 845<title>Return</title> 846<para> 847 Zero if successful, or a negative error code on failure. 848</para> 849</refsect1> 850</refentry> 851 852<refentry id="API-snd-device-disconnect"> 853<refentryinfo> 854 <title>LINUX</title> 855 <productname>Kernel Hackers Manual</productname> 856 <date>July 2017</date> 857</refentryinfo> 858<refmeta> 859 <refentrytitle><phrase>snd_device_disconnect</phrase></refentrytitle> 860 <manvolnum>9</manvolnum> 861 <refmiscinfo class="version">4.1.27</refmiscinfo> 862</refmeta> 863<refnamediv> 864 <refname>snd_device_disconnect</refname> 865 <refpurpose> 866 disconnect the device 867 </refpurpose> 868</refnamediv> 869<refsynopsisdiv> 870 <title>Synopsis</title> 871 <funcsynopsis><funcprototype> 872 <funcdef>void <function>snd_device_disconnect </function></funcdef> 873 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 874 <paramdef>void * <parameter>device_data</parameter></paramdef> 875 </funcprototype></funcsynopsis> 876</refsynopsisdiv> 877<refsect1> 878 <title>Arguments</title> 879 <variablelist> 880 <varlistentry> 881 <term><parameter>card</parameter></term> 882 <listitem> 883 <para> 884 the card instance 885 </para> 886 </listitem> 887 </varlistentry> 888 <varlistentry> 889 <term><parameter>device_data</parameter></term> 890 <listitem> 891 <para> 892 the data pointer to disconnect 893 </para> 894 </listitem> 895 </varlistentry> 896 </variablelist> 897</refsect1> 898<refsect1> 899<title>Description</title> 900<para> 901 Turns the device into the disconnection state, invoking 902 dev_disconnect callback, if the device was already registered. 903 </para><para> 904 905 Usually called from <function>snd_card_disconnect</function>. 906</para> 907</refsect1> 908<refsect1> 909<title>Return</title> 910<para> 911 Zero if successful, or a negative error code on failure or if the 912 device not found. 913</para> 914</refsect1> 915</refentry> 916 917<refentry id="API-snd-device-free"> 918<refentryinfo> 919 <title>LINUX</title> 920 <productname>Kernel Hackers Manual</productname> 921 <date>July 2017</date> 922</refentryinfo> 923<refmeta> 924 <refentrytitle><phrase>snd_device_free</phrase></refentrytitle> 925 <manvolnum>9</manvolnum> 926 <refmiscinfo class="version">4.1.27</refmiscinfo> 927</refmeta> 928<refnamediv> 929 <refname>snd_device_free</refname> 930 <refpurpose> 931 release the device from the card 932 </refpurpose> 933</refnamediv> 934<refsynopsisdiv> 935 <title>Synopsis</title> 936 <funcsynopsis><funcprototype> 937 <funcdef>void <function>snd_device_free </function></funcdef> 938 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 939 <paramdef>void * <parameter>device_data</parameter></paramdef> 940 </funcprototype></funcsynopsis> 941</refsynopsisdiv> 942<refsect1> 943 <title>Arguments</title> 944 <variablelist> 945 <varlistentry> 946 <term><parameter>card</parameter></term> 947 <listitem> 948 <para> 949 the card instance 950 </para> 951 </listitem> 952 </varlistentry> 953 <varlistentry> 954 <term><parameter>device_data</parameter></term> 955 <listitem> 956 <para> 957 the data pointer to release 958 </para> 959 </listitem> 960 </varlistentry> 961 </variablelist> 962</refsect1> 963<refsect1> 964<title>Description</title> 965<para> 966 Removes the device from the list on the card and invokes the 967 callbacks, dev_disconnect and dev_free, corresponding to the state. 968 Then release the device. 969</para> 970</refsect1> 971</refentry> 972 973<refentry id="API-snd-device-register"> 974<refentryinfo> 975 <title>LINUX</title> 976 <productname>Kernel Hackers Manual</productname> 977 <date>July 2017</date> 978</refentryinfo> 979<refmeta> 980 <refentrytitle><phrase>snd_device_register</phrase></refentrytitle> 981 <manvolnum>9</manvolnum> 982 <refmiscinfo class="version">4.1.27</refmiscinfo> 983</refmeta> 984<refnamediv> 985 <refname>snd_device_register</refname> 986 <refpurpose> 987 register the device 988 </refpurpose> 989</refnamediv> 990<refsynopsisdiv> 991 <title>Synopsis</title> 992 <funcsynopsis><funcprototype> 993 <funcdef>int <function>snd_device_register </function></funcdef> 994 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 995 <paramdef>void * <parameter>device_data</parameter></paramdef> 996 </funcprototype></funcsynopsis> 997</refsynopsisdiv> 998<refsect1> 999 <title>Arguments</title> 1000 <variablelist> 1001 <varlistentry> 1002 <term><parameter>card</parameter></term> 1003 <listitem> 1004 <para> 1005 the card instance 1006 </para> 1007 </listitem> 1008 </varlistentry> 1009 <varlistentry> 1010 <term><parameter>device_data</parameter></term> 1011 <listitem> 1012 <para> 1013 the data pointer to register 1014 </para> 1015 </listitem> 1016 </varlistentry> 1017 </variablelist> 1018</refsect1> 1019<refsect1> 1020<title>Description</title> 1021<para> 1022 Registers the device which was already created via 1023 <function>snd_device_new</function>. Usually this is called from <function>snd_card_register</function>, 1024 but it can be called later if any new devices are created after 1025 invocation of <function>snd_card_register</function>. 1026</para> 1027</refsect1> 1028<refsect1> 1029<title>Return</title> 1030<para> 1031 Zero if successful, or a negative error code on failure or if the 1032 device not found. 1033</para> 1034</refsect1> 1035</refentry> 1036 1037 </sect1> 1038 <sect1><title>Module requests and Device File Entries</title> 1039<!-- sound/core/sound.c --> 1040<refentry id="API-snd-request-card"> 1041<refentryinfo> 1042 <title>LINUX</title> 1043 <productname>Kernel Hackers Manual</productname> 1044 <date>July 2017</date> 1045</refentryinfo> 1046<refmeta> 1047 <refentrytitle><phrase>snd_request_card</phrase></refentrytitle> 1048 <manvolnum>9</manvolnum> 1049 <refmiscinfo class="version">4.1.27</refmiscinfo> 1050</refmeta> 1051<refnamediv> 1052 <refname>snd_request_card</refname> 1053 <refpurpose> 1054 try to load the card module 1055 </refpurpose> 1056</refnamediv> 1057<refsynopsisdiv> 1058 <title>Synopsis</title> 1059 <funcsynopsis><funcprototype> 1060 <funcdef>void <function>snd_request_card </function></funcdef> 1061 <paramdef>int <parameter>card</parameter></paramdef> 1062 </funcprototype></funcsynopsis> 1063</refsynopsisdiv> 1064<refsect1> 1065 <title>Arguments</title> 1066 <variablelist> 1067 <varlistentry> 1068 <term><parameter>card</parameter></term> 1069 <listitem> 1070 <para> 1071 the card number 1072 </para> 1073 </listitem> 1074 </varlistentry> 1075 </variablelist> 1076</refsect1> 1077<refsect1> 1078<title>Description</title> 1079<para> 1080 Tries to load the module <quote>snd-card-X</quote> for the given card number 1081 via request_module. Returns immediately if already loaded. 1082</para> 1083</refsect1> 1084</refentry> 1085 1086<refentry id="API-snd-lookup-minor-data"> 1087<refentryinfo> 1088 <title>LINUX</title> 1089 <productname>Kernel Hackers Manual</productname> 1090 <date>July 2017</date> 1091</refentryinfo> 1092<refmeta> 1093 <refentrytitle><phrase>snd_lookup_minor_data</phrase></refentrytitle> 1094 <manvolnum>9</manvolnum> 1095 <refmiscinfo class="version">4.1.27</refmiscinfo> 1096</refmeta> 1097<refnamediv> 1098 <refname>snd_lookup_minor_data</refname> 1099 <refpurpose> 1100 get user data of a registered device 1101 </refpurpose> 1102</refnamediv> 1103<refsynopsisdiv> 1104 <title>Synopsis</title> 1105 <funcsynopsis><funcprototype> 1106 <funcdef>void * <function>snd_lookup_minor_data </function></funcdef> 1107 <paramdef>unsigned int <parameter>minor</parameter></paramdef> 1108 <paramdef>int <parameter>type</parameter></paramdef> 1109 </funcprototype></funcsynopsis> 1110</refsynopsisdiv> 1111<refsect1> 1112 <title>Arguments</title> 1113 <variablelist> 1114 <varlistentry> 1115 <term><parameter>minor</parameter></term> 1116 <listitem> 1117 <para> 1118 the minor number 1119 </para> 1120 </listitem> 1121 </varlistentry> 1122 <varlistentry> 1123 <term><parameter>type</parameter></term> 1124 <listitem> 1125 <para> 1126 device type (SNDRV_DEVICE_TYPE_XXX) 1127 </para> 1128 </listitem> 1129 </varlistentry> 1130 </variablelist> 1131</refsect1> 1132<refsect1> 1133<title>Description</title> 1134<para> 1135 Checks that a minor device with the specified type is registered, and returns 1136 its user data pointer. 1137 </para><para> 1138 1139 This function increments the reference counter of the card instance 1140 if an associated instance with the given minor number and type is found. 1141 The caller must call <function>snd_card_unref</function> appropriately later. 1142</para> 1143</refsect1> 1144<refsect1> 1145<title>Return</title> 1146<para> 1147 The user data pointer if the specified device is found. <constant>NULL</constant> 1148 otherwise. 1149</para> 1150</refsect1> 1151</refentry> 1152 1153<refentry id="API-snd-register-device"> 1154<refentryinfo> 1155 <title>LINUX</title> 1156 <productname>Kernel Hackers Manual</productname> 1157 <date>July 2017</date> 1158</refentryinfo> 1159<refmeta> 1160 <refentrytitle><phrase>snd_register_device</phrase></refentrytitle> 1161 <manvolnum>9</manvolnum> 1162 <refmiscinfo class="version">4.1.27</refmiscinfo> 1163</refmeta> 1164<refnamediv> 1165 <refname>snd_register_device</refname> 1166 <refpurpose> 1167 Register the ALSA device file for the card 1168 </refpurpose> 1169</refnamediv> 1170<refsynopsisdiv> 1171 <title>Synopsis</title> 1172 <funcsynopsis><funcprototype> 1173 <funcdef>int <function>snd_register_device </function></funcdef> 1174 <paramdef>int <parameter>type</parameter></paramdef> 1175 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 1176 <paramdef>int <parameter>dev</parameter></paramdef> 1177 <paramdef>const struct file_operations * <parameter>f_ops</parameter></paramdef> 1178 <paramdef>void * <parameter>private_data</parameter></paramdef> 1179 <paramdef>struct device * <parameter>device</parameter></paramdef> 1180 </funcprototype></funcsynopsis> 1181</refsynopsisdiv> 1182<refsect1> 1183 <title>Arguments</title> 1184 <variablelist> 1185 <varlistentry> 1186 <term><parameter>type</parameter></term> 1187 <listitem> 1188 <para> 1189 the device type, SNDRV_DEVICE_TYPE_XXX 1190 </para> 1191 </listitem> 1192 </varlistentry> 1193 <varlistentry> 1194 <term><parameter>card</parameter></term> 1195 <listitem> 1196 <para> 1197 the card instance 1198 </para> 1199 </listitem> 1200 </varlistentry> 1201 <varlistentry> 1202 <term><parameter>dev</parameter></term> 1203 <listitem> 1204 <para> 1205 the device index 1206 </para> 1207 </listitem> 1208 </varlistentry> 1209 <varlistentry> 1210 <term><parameter>f_ops</parameter></term> 1211 <listitem> 1212 <para> 1213 the file operations 1214 </para> 1215 </listitem> 1216 </varlistentry> 1217 <varlistentry> 1218 <term><parameter>private_data</parameter></term> 1219 <listitem> 1220 <para> 1221 user pointer for f_ops-><function>open</function> 1222 </para> 1223 </listitem> 1224 </varlistentry> 1225 <varlistentry> 1226 <term><parameter>device</parameter></term> 1227 <listitem> 1228 <para> 1229 the device to register 1230 </para> 1231 </listitem> 1232 </varlistentry> 1233 </variablelist> 1234</refsect1> 1235<refsect1> 1236<title>Description</title> 1237<para> 1238 Registers an ALSA device file for the given card. 1239 The operators have to be set in reg parameter. 1240</para> 1241</refsect1> 1242<refsect1> 1243<title>Return</title> 1244<para> 1245 Zero if successful, or a negative error code on failure. 1246</para> 1247</refsect1> 1248</refentry> 1249 1250<refentry id="API-snd-unregister-device"> 1251<refentryinfo> 1252 <title>LINUX</title> 1253 <productname>Kernel Hackers Manual</productname> 1254 <date>July 2017</date> 1255</refentryinfo> 1256<refmeta> 1257 <refentrytitle><phrase>snd_unregister_device</phrase></refentrytitle> 1258 <manvolnum>9</manvolnum> 1259 <refmiscinfo class="version">4.1.27</refmiscinfo> 1260</refmeta> 1261<refnamediv> 1262 <refname>snd_unregister_device</refname> 1263 <refpurpose> 1264 unregister the device on the given card 1265 </refpurpose> 1266</refnamediv> 1267<refsynopsisdiv> 1268 <title>Synopsis</title> 1269 <funcsynopsis><funcprototype> 1270 <funcdef>int <function>snd_unregister_device </function></funcdef> 1271 <paramdef>struct device * <parameter>dev</parameter></paramdef> 1272 </funcprototype></funcsynopsis> 1273</refsynopsisdiv> 1274<refsect1> 1275 <title>Arguments</title> 1276 <variablelist> 1277 <varlistentry> 1278 <term><parameter>dev</parameter></term> 1279 <listitem> 1280 <para> 1281 the device instance 1282 </para> 1283 </listitem> 1284 </varlistentry> 1285 </variablelist> 1286</refsect1> 1287<refsect1> 1288<title>Description</title> 1289<para> 1290 Unregisters the device file already registered via 1291 <function>snd_register_device</function>. 1292</para> 1293</refsect1> 1294<refsect1> 1295<title>Return</title> 1296<para> 1297 Zero if successful, or a negative error code on failure. 1298</para> 1299</refsect1> 1300</refentry> 1301 1302 </sect1> 1303 <sect1><title>Memory Management Helpers</title> 1304<!-- sound/core/memory.c --> 1305<refentry id="API-copy-to-user-fromio"> 1306<refentryinfo> 1307 <title>LINUX</title> 1308 <productname>Kernel Hackers Manual</productname> 1309 <date>July 2017</date> 1310</refentryinfo> 1311<refmeta> 1312 <refentrytitle><phrase>copy_to_user_fromio</phrase></refentrytitle> 1313 <manvolnum>9</manvolnum> 1314 <refmiscinfo class="version">4.1.27</refmiscinfo> 1315</refmeta> 1316<refnamediv> 1317 <refname>copy_to_user_fromio</refname> 1318 <refpurpose> 1319 copy data from mmio-space to user-space 1320 </refpurpose> 1321</refnamediv> 1322<refsynopsisdiv> 1323 <title>Synopsis</title> 1324 <funcsynopsis><funcprototype> 1325 <funcdef>int <function>copy_to_user_fromio </function></funcdef> 1326 <paramdef>void __user * <parameter>dst</parameter></paramdef> 1327 <paramdef>const volatile void __iomem * <parameter>src</parameter></paramdef> 1328 <paramdef>size_t <parameter>count</parameter></paramdef> 1329 </funcprototype></funcsynopsis> 1330</refsynopsisdiv> 1331<refsect1> 1332 <title>Arguments</title> 1333 <variablelist> 1334 <varlistentry> 1335 <term><parameter>dst</parameter></term> 1336 <listitem> 1337 <para> 1338 the destination pointer on user-space 1339 </para> 1340 </listitem> 1341 </varlistentry> 1342 <varlistentry> 1343 <term><parameter>src</parameter></term> 1344 <listitem> 1345 <para> 1346 the source pointer on mmio 1347 </para> 1348 </listitem> 1349 </varlistentry> 1350 <varlistentry> 1351 <term><parameter>count</parameter></term> 1352 <listitem> 1353 <para> 1354 the data size to copy in bytes 1355 </para> 1356 </listitem> 1357 </varlistentry> 1358 </variablelist> 1359</refsect1> 1360<refsect1> 1361<title>Description</title> 1362<para> 1363 Copies the data from mmio-space to user-space. 1364</para> 1365</refsect1> 1366<refsect1> 1367<title>Return</title> 1368<para> 1369 Zero if successful, or non-zero on failure. 1370</para> 1371</refsect1> 1372</refentry> 1373 1374<refentry id="API-copy-from-user-toio"> 1375<refentryinfo> 1376 <title>LINUX</title> 1377 <productname>Kernel Hackers Manual</productname> 1378 <date>July 2017</date> 1379</refentryinfo> 1380<refmeta> 1381 <refentrytitle><phrase>copy_from_user_toio</phrase></refentrytitle> 1382 <manvolnum>9</manvolnum> 1383 <refmiscinfo class="version">4.1.27</refmiscinfo> 1384</refmeta> 1385<refnamediv> 1386 <refname>copy_from_user_toio</refname> 1387 <refpurpose> 1388 copy data from user-space to mmio-space 1389 </refpurpose> 1390</refnamediv> 1391<refsynopsisdiv> 1392 <title>Synopsis</title> 1393 <funcsynopsis><funcprototype> 1394 <funcdef>int <function>copy_from_user_toio </function></funcdef> 1395 <paramdef>volatile void __iomem * <parameter>dst</parameter></paramdef> 1396 <paramdef>const void __user * <parameter>src</parameter></paramdef> 1397 <paramdef>size_t <parameter>count</parameter></paramdef> 1398 </funcprototype></funcsynopsis> 1399</refsynopsisdiv> 1400<refsect1> 1401 <title>Arguments</title> 1402 <variablelist> 1403 <varlistentry> 1404 <term><parameter>dst</parameter></term> 1405 <listitem> 1406 <para> 1407 the destination pointer on mmio-space 1408 </para> 1409 </listitem> 1410 </varlistentry> 1411 <varlistentry> 1412 <term><parameter>src</parameter></term> 1413 <listitem> 1414 <para> 1415 the source pointer on user-space 1416 </para> 1417 </listitem> 1418 </varlistentry> 1419 <varlistentry> 1420 <term><parameter>count</parameter></term> 1421 <listitem> 1422 <para> 1423 the data size to copy in bytes 1424 </para> 1425 </listitem> 1426 </varlistentry> 1427 </variablelist> 1428</refsect1> 1429<refsect1> 1430<title>Description</title> 1431<para> 1432 Copies the data from user-space to mmio-space. 1433</para> 1434</refsect1> 1435<refsect1> 1436<title>Return</title> 1437<para> 1438 Zero if successful, or non-zero on failure. 1439</para> 1440</refsect1> 1441</refentry> 1442 1443<!-- sound/core/memalloc.c --> 1444<refentry id="API-snd-malloc-pages"> 1445<refentryinfo> 1446 <title>LINUX</title> 1447 <productname>Kernel Hackers Manual</productname> 1448 <date>July 2017</date> 1449</refentryinfo> 1450<refmeta> 1451 <refentrytitle><phrase>snd_malloc_pages</phrase></refentrytitle> 1452 <manvolnum>9</manvolnum> 1453 <refmiscinfo class="version">4.1.27</refmiscinfo> 1454</refmeta> 1455<refnamediv> 1456 <refname>snd_malloc_pages</refname> 1457 <refpurpose> 1458 allocate pages with the given size 1459 </refpurpose> 1460</refnamediv> 1461<refsynopsisdiv> 1462 <title>Synopsis</title> 1463 <funcsynopsis><funcprototype> 1464 <funcdef>void * <function>snd_malloc_pages </function></funcdef> 1465 <paramdef>size_t <parameter>size</parameter></paramdef> 1466 <paramdef>gfp_t <parameter>gfp_flags</parameter></paramdef> 1467 </funcprototype></funcsynopsis> 1468</refsynopsisdiv> 1469<refsect1> 1470 <title>Arguments</title> 1471 <variablelist> 1472 <varlistentry> 1473 <term><parameter>size</parameter></term> 1474 <listitem> 1475 <para> 1476 the size to allocate in bytes 1477 </para> 1478 </listitem> 1479 </varlistentry> 1480 <varlistentry> 1481 <term><parameter>gfp_flags</parameter></term> 1482 <listitem> 1483 <para> 1484 the allocation conditions, GFP_XXX 1485 </para> 1486 </listitem> 1487 </varlistentry> 1488 </variablelist> 1489</refsect1> 1490<refsect1> 1491<title>Description</title> 1492<para> 1493 Allocates the physically contiguous pages with the given size. 1494</para> 1495</refsect1> 1496<refsect1> 1497<title>Return</title> 1498<para> 1499 The pointer of the buffer, or <constant>NULL</constant> if no enough memory. 1500</para> 1501</refsect1> 1502</refentry> 1503 1504<refentry id="API-snd-free-pages"> 1505<refentryinfo> 1506 <title>LINUX</title> 1507 <productname>Kernel Hackers Manual</productname> 1508 <date>July 2017</date> 1509</refentryinfo> 1510<refmeta> 1511 <refentrytitle><phrase>snd_free_pages</phrase></refentrytitle> 1512 <manvolnum>9</manvolnum> 1513 <refmiscinfo class="version">4.1.27</refmiscinfo> 1514</refmeta> 1515<refnamediv> 1516 <refname>snd_free_pages</refname> 1517 <refpurpose> 1518 release the pages 1519 </refpurpose> 1520</refnamediv> 1521<refsynopsisdiv> 1522 <title>Synopsis</title> 1523 <funcsynopsis><funcprototype> 1524 <funcdef>void <function>snd_free_pages </function></funcdef> 1525 <paramdef>void * <parameter>ptr</parameter></paramdef> 1526 <paramdef>size_t <parameter>size</parameter></paramdef> 1527 </funcprototype></funcsynopsis> 1528</refsynopsisdiv> 1529<refsect1> 1530 <title>Arguments</title> 1531 <variablelist> 1532 <varlistentry> 1533 <term><parameter>ptr</parameter></term> 1534 <listitem> 1535 <para> 1536 the buffer pointer to release 1537 </para> 1538 </listitem> 1539 </varlistentry> 1540 <varlistentry> 1541 <term><parameter>size</parameter></term> 1542 <listitem> 1543 <para> 1544 the allocated buffer size 1545 </para> 1546 </listitem> 1547 </varlistentry> 1548 </variablelist> 1549</refsect1> 1550<refsect1> 1551<title>Description</title> 1552<para> 1553 Releases the buffer allocated via <function>snd_malloc_pages</function>. 1554</para> 1555</refsect1> 1556</refentry> 1557 1558<refentry id="API-snd-dma-alloc-pages"> 1559<refentryinfo> 1560 <title>LINUX</title> 1561 <productname>Kernel Hackers Manual</productname> 1562 <date>July 2017</date> 1563</refentryinfo> 1564<refmeta> 1565 <refentrytitle><phrase>snd_dma_alloc_pages</phrase></refentrytitle> 1566 <manvolnum>9</manvolnum> 1567 <refmiscinfo class="version">4.1.27</refmiscinfo> 1568</refmeta> 1569<refnamediv> 1570 <refname>snd_dma_alloc_pages</refname> 1571 <refpurpose> 1572 allocate the buffer area according to the given type 1573 </refpurpose> 1574</refnamediv> 1575<refsynopsisdiv> 1576 <title>Synopsis</title> 1577 <funcsynopsis><funcprototype> 1578 <funcdef>int <function>snd_dma_alloc_pages </function></funcdef> 1579 <paramdef>int <parameter>type</parameter></paramdef> 1580 <paramdef>struct device * <parameter>device</parameter></paramdef> 1581 <paramdef>size_t <parameter>size</parameter></paramdef> 1582 <paramdef>struct snd_dma_buffer * <parameter>dmab</parameter></paramdef> 1583 </funcprototype></funcsynopsis> 1584</refsynopsisdiv> 1585<refsect1> 1586 <title>Arguments</title> 1587 <variablelist> 1588 <varlistentry> 1589 <term><parameter>type</parameter></term> 1590 <listitem> 1591 <para> 1592 the DMA buffer type 1593 </para> 1594 </listitem> 1595 </varlistentry> 1596 <varlistentry> 1597 <term><parameter>device</parameter></term> 1598 <listitem> 1599 <para> 1600 the device pointer 1601 </para> 1602 </listitem> 1603 </varlistentry> 1604 <varlistentry> 1605 <term><parameter>size</parameter></term> 1606 <listitem> 1607 <para> 1608 the buffer size to allocate 1609 </para> 1610 </listitem> 1611 </varlistentry> 1612 <varlistentry> 1613 <term><parameter>dmab</parameter></term> 1614 <listitem> 1615 <para> 1616 buffer allocation record to store the allocated data 1617 </para> 1618 </listitem> 1619 </varlistentry> 1620 </variablelist> 1621</refsect1> 1622<refsect1> 1623<title>Description</title> 1624<para> 1625 Calls the memory-allocator function for the corresponding 1626 buffer type. 1627</para> 1628</refsect1> 1629<refsect1> 1630<title>Return</title> 1631<para> 1632 Zero if the buffer with the given size is allocated successfully, 1633 otherwise a negative value on error. 1634</para> 1635</refsect1> 1636</refentry> 1637 1638<refentry id="API-snd-dma-alloc-pages-fallback"> 1639<refentryinfo> 1640 <title>LINUX</title> 1641 <productname>Kernel Hackers Manual</productname> 1642 <date>July 2017</date> 1643</refentryinfo> 1644<refmeta> 1645 <refentrytitle><phrase>snd_dma_alloc_pages_fallback</phrase></refentrytitle> 1646 <manvolnum>9</manvolnum> 1647 <refmiscinfo class="version">4.1.27</refmiscinfo> 1648</refmeta> 1649<refnamediv> 1650 <refname>snd_dma_alloc_pages_fallback</refname> 1651 <refpurpose> 1652 allocate the buffer area according to the given type with fallback 1653 </refpurpose> 1654</refnamediv> 1655<refsynopsisdiv> 1656 <title>Synopsis</title> 1657 <funcsynopsis><funcprototype> 1658 <funcdef>int <function>snd_dma_alloc_pages_fallback </function></funcdef> 1659 <paramdef>int <parameter>type</parameter></paramdef> 1660 <paramdef>struct device * <parameter>device</parameter></paramdef> 1661 <paramdef>size_t <parameter>size</parameter></paramdef> 1662 <paramdef>struct snd_dma_buffer * <parameter>dmab</parameter></paramdef> 1663 </funcprototype></funcsynopsis> 1664</refsynopsisdiv> 1665<refsect1> 1666 <title>Arguments</title> 1667 <variablelist> 1668 <varlistentry> 1669 <term><parameter>type</parameter></term> 1670 <listitem> 1671 <para> 1672 the DMA buffer type 1673 </para> 1674 </listitem> 1675 </varlistentry> 1676 <varlistentry> 1677 <term><parameter>device</parameter></term> 1678 <listitem> 1679 <para> 1680 the device pointer 1681 </para> 1682 </listitem> 1683 </varlistentry> 1684 <varlistentry> 1685 <term><parameter>size</parameter></term> 1686 <listitem> 1687 <para> 1688 the buffer size to allocate 1689 </para> 1690 </listitem> 1691 </varlistentry> 1692 <varlistentry> 1693 <term><parameter>dmab</parameter></term> 1694 <listitem> 1695 <para> 1696 buffer allocation record to store the allocated data 1697 </para> 1698 </listitem> 1699 </varlistentry> 1700 </variablelist> 1701</refsect1> 1702<refsect1> 1703<title>Description</title> 1704<para> 1705 Calls the memory-allocator function for the corresponding 1706 buffer type. When no space is left, this function reduces the size and 1707 tries to allocate again. The size actually allocated is stored in 1708 res_size argument. 1709</para> 1710</refsect1> 1711<refsect1> 1712<title>Return</title> 1713<para> 1714 Zero if the buffer with the given size is allocated successfully, 1715 otherwise a negative value on error. 1716</para> 1717</refsect1> 1718</refentry> 1719 1720<refentry id="API-snd-dma-free-pages"> 1721<refentryinfo> 1722 <title>LINUX</title> 1723 <productname>Kernel Hackers Manual</productname> 1724 <date>July 2017</date> 1725</refentryinfo> 1726<refmeta> 1727 <refentrytitle><phrase>snd_dma_free_pages</phrase></refentrytitle> 1728 <manvolnum>9</manvolnum> 1729 <refmiscinfo class="version">4.1.27</refmiscinfo> 1730</refmeta> 1731<refnamediv> 1732 <refname>snd_dma_free_pages</refname> 1733 <refpurpose> 1734 release the allocated buffer 1735 </refpurpose> 1736</refnamediv> 1737<refsynopsisdiv> 1738 <title>Synopsis</title> 1739 <funcsynopsis><funcprototype> 1740 <funcdef>void <function>snd_dma_free_pages </function></funcdef> 1741 <paramdef>struct snd_dma_buffer * <parameter>dmab</parameter></paramdef> 1742 </funcprototype></funcsynopsis> 1743</refsynopsisdiv> 1744<refsect1> 1745 <title>Arguments</title> 1746 <variablelist> 1747 <varlistentry> 1748 <term><parameter>dmab</parameter></term> 1749 <listitem> 1750 <para> 1751 the buffer allocation record to release 1752 </para> 1753 </listitem> 1754 </varlistentry> 1755 </variablelist> 1756</refsect1> 1757<refsect1> 1758<title>Description</title> 1759<para> 1760 Releases the allocated buffer via <function>snd_dma_alloc_pages</function>. 1761</para> 1762</refsect1> 1763</refentry> 1764 1765 </sect1> 1766 </chapter> 1767 <chapter><title>PCM API</title> 1768 <sect1><title>PCM Core</title> 1769<!-- sound/core/pcm.c --> 1770<refentry id="API-snd-pcm-format-name"> 1771<refentryinfo> 1772 <title>LINUX</title> 1773 <productname>Kernel Hackers Manual</productname> 1774 <date>July 2017</date> 1775</refentryinfo> 1776<refmeta> 1777 <refentrytitle><phrase>snd_pcm_format_name</phrase></refentrytitle> 1778 <manvolnum>9</manvolnum> 1779 <refmiscinfo class="version">4.1.27</refmiscinfo> 1780</refmeta> 1781<refnamediv> 1782 <refname>snd_pcm_format_name</refname> 1783 <refpurpose> 1784 Return a name string for the given PCM format 1785 </refpurpose> 1786</refnamediv> 1787<refsynopsisdiv> 1788 <title>Synopsis</title> 1789 <funcsynopsis><funcprototype> 1790 <funcdef>const char * <function>snd_pcm_format_name </function></funcdef> 1791 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 1792 </funcprototype></funcsynopsis> 1793</refsynopsisdiv> 1794<refsect1> 1795 <title>Arguments</title> 1796 <variablelist> 1797 <varlistentry> 1798 <term><parameter>format</parameter></term> 1799 <listitem> 1800 <para> 1801 PCM format 1802 </para> 1803 </listitem> 1804 </varlistentry> 1805 </variablelist> 1806</refsect1> 1807</refentry> 1808 1809<refentry id="API-snd-pcm-new-stream"> 1810<refentryinfo> 1811 <title>LINUX</title> 1812 <productname>Kernel Hackers Manual</productname> 1813 <date>July 2017</date> 1814</refentryinfo> 1815<refmeta> 1816 <refentrytitle><phrase>snd_pcm_new_stream</phrase></refentrytitle> 1817 <manvolnum>9</manvolnum> 1818 <refmiscinfo class="version">4.1.27</refmiscinfo> 1819</refmeta> 1820<refnamediv> 1821 <refname>snd_pcm_new_stream</refname> 1822 <refpurpose> 1823 create a new PCM stream 1824 </refpurpose> 1825</refnamediv> 1826<refsynopsisdiv> 1827 <title>Synopsis</title> 1828 <funcsynopsis><funcprototype> 1829 <funcdef>int <function>snd_pcm_new_stream </function></funcdef> 1830 <paramdef>struct snd_pcm * <parameter>pcm</parameter></paramdef> 1831 <paramdef>int <parameter>stream</parameter></paramdef> 1832 <paramdef>int <parameter>substream_count</parameter></paramdef> 1833 </funcprototype></funcsynopsis> 1834</refsynopsisdiv> 1835<refsect1> 1836 <title>Arguments</title> 1837 <variablelist> 1838 <varlistentry> 1839 <term><parameter>pcm</parameter></term> 1840 <listitem> 1841 <para> 1842 the pcm instance 1843 </para> 1844 </listitem> 1845 </varlistentry> 1846 <varlistentry> 1847 <term><parameter>stream</parameter></term> 1848 <listitem> 1849 <para> 1850 the stream direction, SNDRV_PCM_STREAM_XXX 1851 </para> 1852 </listitem> 1853 </varlistentry> 1854 <varlistentry> 1855 <term><parameter>substream_count</parameter></term> 1856 <listitem> 1857 <para> 1858 the number of substreams 1859 </para> 1860 </listitem> 1861 </varlistentry> 1862 </variablelist> 1863</refsect1> 1864<refsect1> 1865<title>Description</title> 1866<para> 1867 Creates a new stream for the pcm. 1868 The corresponding stream on the pcm must have been empty before 1869 calling this, i.e. zero must be given to the argument of 1870 <function>snd_pcm_new</function>. 1871</para> 1872</refsect1> 1873<refsect1> 1874<title>Return</title> 1875<para> 1876 Zero if successful, or a negative error code on failure. 1877</para> 1878</refsect1> 1879</refentry> 1880 1881<refentry id="API-snd-pcm-new"> 1882<refentryinfo> 1883 <title>LINUX</title> 1884 <productname>Kernel Hackers Manual</productname> 1885 <date>July 2017</date> 1886</refentryinfo> 1887<refmeta> 1888 <refentrytitle><phrase>snd_pcm_new</phrase></refentrytitle> 1889 <manvolnum>9</manvolnum> 1890 <refmiscinfo class="version">4.1.27</refmiscinfo> 1891</refmeta> 1892<refnamediv> 1893 <refname>snd_pcm_new</refname> 1894 <refpurpose> 1895 create a new PCM instance 1896 </refpurpose> 1897</refnamediv> 1898<refsynopsisdiv> 1899 <title>Synopsis</title> 1900 <funcsynopsis><funcprototype> 1901 <funcdef>int <function>snd_pcm_new </function></funcdef> 1902 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 1903 <paramdef>const char * <parameter>id</parameter></paramdef> 1904 <paramdef>int <parameter>device</parameter></paramdef> 1905 <paramdef>int <parameter>playback_count</parameter></paramdef> 1906 <paramdef>int <parameter>capture_count</parameter></paramdef> 1907 <paramdef>struct snd_pcm ** <parameter>rpcm</parameter></paramdef> 1908 </funcprototype></funcsynopsis> 1909</refsynopsisdiv> 1910<refsect1> 1911 <title>Arguments</title> 1912 <variablelist> 1913 <varlistentry> 1914 <term><parameter>card</parameter></term> 1915 <listitem> 1916 <para> 1917 the card instance 1918 </para> 1919 </listitem> 1920 </varlistentry> 1921 <varlistentry> 1922 <term><parameter>id</parameter></term> 1923 <listitem> 1924 <para> 1925 the id string 1926 </para> 1927 </listitem> 1928 </varlistentry> 1929 <varlistentry> 1930 <term><parameter>device</parameter></term> 1931 <listitem> 1932 <para> 1933 the device index (zero based) 1934 </para> 1935 </listitem> 1936 </varlistentry> 1937 <varlistentry> 1938 <term><parameter>playback_count</parameter></term> 1939 <listitem> 1940 <para> 1941 the number of substreams for playback 1942 </para> 1943 </listitem> 1944 </varlistentry> 1945 <varlistentry> 1946 <term><parameter>capture_count</parameter></term> 1947 <listitem> 1948 <para> 1949 the number of substreams for capture 1950 </para> 1951 </listitem> 1952 </varlistentry> 1953 <varlistentry> 1954 <term><parameter>rpcm</parameter></term> 1955 <listitem> 1956 <para> 1957 the pointer to store the new pcm instance 1958 </para> 1959 </listitem> 1960 </varlistentry> 1961 </variablelist> 1962</refsect1> 1963<refsect1> 1964<title>Description</title> 1965<para> 1966 Creates a new PCM instance. 1967 </para><para> 1968 1969 The pcm operators have to be set afterwards to the new instance 1970 via <function>snd_pcm_set_ops</function>. 1971</para> 1972</refsect1> 1973<refsect1> 1974<title>Return</title> 1975<para> 1976 Zero if successful, or a negative error code on failure. 1977</para> 1978</refsect1> 1979</refentry> 1980 1981<refentry id="API-snd-pcm-new-internal"> 1982<refentryinfo> 1983 <title>LINUX</title> 1984 <productname>Kernel Hackers Manual</productname> 1985 <date>July 2017</date> 1986</refentryinfo> 1987<refmeta> 1988 <refentrytitle><phrase>snd_pcm_new_internal</phrase></refentrytitle> 1989 <manvolnum>9</manvolnum> 1990 <refmiscinfo class="version">4.1.27</refmiscinfo> 1991</refmeta> 1992<refnamediv> 1993 <refname>snd_pcm_new_internal</refname> 1994 <refpurpose> 1995 create a new internal PCM instance 1996 </refpurpose> 1997</refnamediv> 1998<refsynopsisdiv> 1999 <title>Synopsis</title> 2000 <funcsynopsis><funcprototype> 2001 <funcdef>int <function>snd_pcm_new_internal </function></funcdef> 2002 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 2003 <paramdef>const char * <parameter>id</parameter></paramdef> 2004 <paramdef>int <parameter>device</parameter></paramdef> 2005 <paramdef>int <parameter>playback_count</parameter></paramdef> 2006 <paramdef>int <parameter>capture_count</parameter></paramdef> 2007 <paramdef>struct snd_pcm ** <parameter>rpcm</parameter></paramdef> 2008 </funcprototype></funcsynopsis> 2009</refsynopsisdiv> 2010<refsect1> 2011 <title>Arguments</title> 2012 <variablelist> 2013 <varlistentry> 2014 <term><parameter>card</parameter></term> 2015 <listitem> 2016 <para> 2017 the card instance 2018 </para> 2019 </listitem> 2020 </varlistentry> 2021 <varlistentry> 2022 <term><parameter>id</parameter></term> 2023 <listitem> 2024 <para> 2025 the id string 2026 </para> 2027 </listitem> 2028 </varlistentry> 2029 <varlistentry> 2030 <term><parameter>device</parameter></term> 2031 <listitem> 2032 <para> 2033 the device index (zero based - shared with normal PCMs) 2034 </para> 2035 </listitem> 2036 </varlistentry> 2037 <varlistentry> 2038 <term><parameter>playback_count</parameter></term> 2039 <listitem> 2040 <para> 2041 the number of substreams for playback 2042 </para> 2043 </listitem> 2044 </varlistentry> 2045 <varlistentry> 2046 <term><parameter>capture_count</parameter></term> 2047 <listitem> 2048 <para> 2049 the number of substreams for capture 2050 </para> 2051 </listitem> 2052 </varlistentry> 2053 <varlistentry> 2054 <term><parameter>rpcm</parameter></term> 2055 <listitem> 2056 <para> 2057 the pointer to store the new pcm instance 2058 </para> 2059 </listitem> 2060 </varlistentry> 2061 </variablelist> 2062</refsect1> 2063<refsect1> 2064<title>Description</title> 2065<para> 2066 Creates a new internal PCM instance with no userspace device or procfs 2067 entries. This is used by ASoC Back End PCMs in order to create a PCM that 2068 will only be used internally by kernel drivers. i.e. it cannot be opened 2069 by userspace. It provides existing ASoC components drivers with a substream 2070 and access to any private data. 2071 </para><para> 2072 2073 The pcm operators have to be set afterwards to the new instance 2074 via <function>snd_pcm_set_ops</function>. 2075</para> 2076</refsect1> 2077<refsect1> 2078<title>Return</title> 2079<para> 2080 Zero if successful, or a negative error code on failure. 2081</para> 2082</refsect1> 2083</refentry> 2084 2085<refentry id="API-snd-pcm-notify"> 2086<refentryinfo> 2087 <title>LINUX</title> 2088 <productname>Kernel Hackers Manual</productname> 2089 <date>July 2017</date> 2090</refentryinfo> 2091<refmeta> 2092 <refentrytitle><phrase>snd_pcm_notify</phrase></refentrytitle> 2093 <manvolnum>9</manvolnum> 2094 <refmiscinfo class="version">4.1.27</refmiscinfo> 2095</refmeta> 2096<refnamediv> 2097 <refname>snd_pcm_notify</refname> 2098 <refpurpose> 2099 Add/remove the notify list 2100 </refpurpose> 2101</refnamediv> 2102<refsynopsisdiv> 2103 <title>Synopsis</title> 2104 <funcsynopsis><funcprototype> 2105 <funcdef>int <function>snd_pcm_notify </function></funcdef> 2106 <paramdef>struct snd_pcm_notify * <parameter>notify</parameter></paramdef> 2107 <paramdef>int <parameter>nfree</parameter></paramdef> 2108 </funcprototype></funcsynopsis> 2109</refsynopsisdiv> 2110<refsect1> 2111 <title>Arguments</title> 2112 <variablelist> 2113 <varlistentry> 2114 <term><parameter>notify</parameter></term> 2115 <listitem> 2116 <para> 2117 PCM notify list 2118 </para> 2119 </listitem> 2120 </varlistentry> 2121 <varlistentry> 2122 <term><parameter>nfree</parameter></term> 2123 <listitem> 2124 <para> 2125 0 = register, 1 = unregister 2126 </para> 2127 </listitem> 2128 </varlistentry> 2129 </variablelist> 2130</refsect1> 2131<refsect1> 2132<title>Description</title> 2133<para> 2134 This adds the given notifier to the global list so that the callback is 2135 called for each registered PCM devices. This exists only for PCM OSS 2136 emulation, so far. 2137</para> 2138</refsect1> 2139</refentry> 2140 2141<!-- sound/core/pcm_lib.c --> 2142<refentry id="API-snd-pcm-set-ops"> 2143<refentryinfo> 2144 <title>LINUX</title> 2145 <productname>Kernel Hackers Manual</productname> 2146 <date>July 2017</date> 2147</refentryinfo> 2148<refmeta> 2149 <refentrytitle><phrase>snd_pcm_set_ops</phrase></refentrytitle> 2150 <manvolnum>9</manvolnum> 2151 <refmiscinfo class="version">4.1.27</refmiscinfo> 2152</refmeta> 2153<refnamediv> 2154 <refname>snd_pcm_set_ops</refname> 2155 <refpurpose> 2156 set the PCM operators 2157 </refpurpose> 2158</refnamediv> 2159<refsynopsisdiv> 2160 <title>Synopsis</title> 2161 <funcsynopsis><funcprototype> 2162 <funcdef>void <function>snd_pcm_set_ops </function></funcdef> 2163 <paramdef>struct snd_pcm * <parameter>pcm</parameter></paramdef> 2164 <paramdef>int <parameter>direction</parameter></paramdef> 2165 <paramdef>const struct snd_pcm_ops * <parameter>ops</parameter></paramdef> 2166 </funcprototype></funcsynopsis> 2167</refsynopsisdiv> 2168<refsect1> 2169 <title>Arguments</title> 2170 <variablelist> 2171 <varlistentry> 2172 <term><parameter>pcm</parameter></term> 2173 <listitem> 2174 <para> 2175 the pcm instance 2176 </para> 2177 </listitem> 2178 </varlistentry> 2179 <varlistentry> 2180 <term><parameter>direction</parameter></term> 2181 <listitem> 2182 <para> 2183 stream direction, SNDRV_PCM_STREAM_XXX 2184 </para> 2185 </listitem> 2186 </varlistentry> 2187 <varlistentry> 2188 <term><parameter>ops</parameter></term> 2189 <listitem> 2190 <para> 2191 the operator table 2192 </para> 2193 </listitem> 2194 </varlistentry> 2195 </variablelist> 2196</refsect1> 2197<refsect1> 2198<title>Description</title> 2199<para> 2200 Sets the given PCM operators to the pcm instance. 2201</para> 2202</refsect1> 2203</refentry> 2204 2205<refentry id="API-snd-pcm-set-sync"> 2206<refentryinfo> 2207 <title>LINUX</title> 2208 <productname>Kernel Hackers Manual</productname> 2209 <date>July 2017</date> 2210</refentryinfo> 2211<refmeta> 2212 <refentrytitle><phrase>snd_pcm_set_sync</phrase></refentrytitle> 2213 <manvolnum>9</manvolnum> 2214 <refmiscinfo class="version">4.1.27</refmiscinfo> 2215</refmeta> 2216<refnamediv> 2217 <refname>snd_pcm_set_sync</refname> 2218 <refpurpose> 2219 set the PCM sync id 2220 </refpurpose> 2221</refnamediv> 2222<refsynopsisdiv> 2223 <title>Synopsis</title> 2224 <funcsynopsis><funcprototype> 2225 <funcdef>void <function>snd_pcm_set_sync </function></funcdef> 2226 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 2227 </funcprototype></funcsynopsis> 2228</refsynopsisdiv> 2229<refsect1> 2230 <title>Arguments</title> 2231 <variablelist> 2232 <varlistentry> 2233 <term><parameter>substream</parameter></term> 2234 <listitem> 2235 <para> 2236 the pcm substream 2237 </para> 2238 </listitem> 2239 </varlistentry> 2240 </variablelist> 2241</refsect1> 2242<refsect1> 2243<title>Description</title> 2244<para> 2245 Sets the PCM sync identifier for the card. 2246</para> 2247</refsect1> 2248</refentry> 2249 2250<refentry id="API-snd-interval-refine"> 2251<refentryinfo> 2252 <title>LINUX</title> 2253 <productname>Kernel Hackers Manual</productname> 2254 <date>July 2017</date> 2255</refentryinfo> 2256<refmeta> 2257 <refentrytitle><phrase>snd_interval_refine</phrase></refentrytitle> 2258 <manvolnum>9</manvolnum> 2259 <refmiscinfo class="version">4.1.27</refmiscinfo> 2260</refmeta> 2261<refnamediv> 2262 <refname>snd_interval_refine</refname> 2263 <refpurpose> 2264 refine the interval value of configurator 2265 </refpurpose> 2266</refnamediv> 2267<refsynopsisdiv> 2268 <title>Synopsis</title> 2269 <funcsynopsis><funcprototype> 2270 <funcdef>int <function>snd_interval_refine </function></funcdef> 2271 <paramdef>struct snd_interval * <parameter>i</parameter></paramdef> 2272 <paramdef>const struct snd_interval * <parameter>v</parameter></paramdef> 2273 </funcprototype></funcsynopsis> 2274</refsynopsisdiv> 2275<refsect1> 2276 <title>Arguments</title> 2277 <variablelist> 2278 <varlistentry> 2279 <term><parameter>i</parameter></term> 2280 <listitem> 2281 <para> 2282 the interval value to refine 2283 </para> 2284 </listitem> 2285 </varlistentry> 2286 <varlistentry> 2287 <term><parameter>v</parameter></term> 2288 <listitem> 2289 <para> 2290 the interval value to refer to 2291 </para> 2292 </listitem> 2293 </varlistentry> 2294 </variablelist> 2295</refsect1> 2296<refsect1> 2297<title>Description</title> 2298<para> 2299 Refines the interval value with the reference value. 2300 The interval is changed to the range satisfying both intervals. 2301 The interval status (min, max, integer, etc.) are evaluated. 2302</para> 2303</refsect1> 2304<refsect1> 2305<title>Return</title> 2306<para> 2307 Positive if the value is changed, zero if it's not changed, or a 2308 negative error code. 2309</para> 2310</refsect1> 2311</refentry> 2312 2313<refentry id="API-snd-interval-ratnum"> 2314<refentryinfo> 2315 <title>LINUX</title> 2316 <productname>Kernel Hackers Manual</productname> 2317 <date>July 2017</date> 2318</refentryinfo> 2319<refmeta> 2320 <refentrytitle><phrase>snd_interval_ratnum</phrase></refentrytitle> 2321 <manvolnum>9</manvolnum> 2322 <refmiscinfo class="version">4.1.27</refmiscinfo> 2323</refmeta> 2324<refnamediv> 2325 <refname>snd_interval_ratnum</refname> 2326 <refpurpose> 2327 refine the interval value 2328 </refpurpose> 2329</refnamediv> 2330<refsynopsisdiv> 2331 <title>Synopsis</title> 2332 <funcsynopsis><funcprototype> 2333 <funcdef>int <function>snd_interval_ratnum </function></funcdef> 2334 <paramdef>struct snd_interval * <parameter>i</parameter></paramdef> 2335 <paramdef>unsigned int <parameter>rats_count</parameter></paramdef> 2336 <paramdef>struct snd_ratnum * <parameter>rats</parameter></paramdef> 2337 <paramdef>unsigned int * <parameter>nump</parameter></paramdef> 2338 <paramdef>unsigned int * <parameter>denp</parameter></paramdef> 2339 </funcprototype></funcsynopsis> 2340</refsynopsisdiv> 2341<refsect1> 2342 <title>Arguments</title> 2343 <variablelist> 2344 <varlistentry> 2345 <term><parameter>i</parameter></term> 2346 <listitem> 2347 <para> 2348 interval to refine 2349 </para> 2350 </listitem> 2351 </varlistentry> 2352 <varlistentry> 2353 <term><parameter>rats_count</parameter></term> 2354 <listitem> 2355 <para> 2356 number of ratnum_t 2357 </para> 2358 </listitem> 2359 </varlistentry> 2360 <varlistentry> 2361 <term><parameter>rats</parameter></term> 2362 <listitem> 2363 <para> 2364 ratnum_t array 2365 </para> 2366 </listitem> 2367 </varlistentry> 2368 <varlistentry> 2369 <term><parameter>nump</parameter></term> 2370 <listitem> 2371 <para> 2372 pointer to store the resultant numerator 2373 </para> 2374 </listitem> 2375 </varlistentry> 2376 <varlistentry> 2377 <term><parameter>denp</parameter></term> 2378 <listitem> 2379 <para> 2380 pointer to store the resultant denominator 2381 </para> 2382 </listitem> 2383 </varlistentry> 2384 </variablelist> 2385</refsect1> 2386<refsect1> 2387<title>Return</title> 2388<para> 2389 Positive if the value is changed, zero if it's not changed, or a 2390 negative error code. 2391</para> 2392</refsect1> 2393</refentry> 2394 2395<refentry id="API-snd-interval-list"> 2396<refentryinfo> 2397 <title>LINUX</title> 2398 <productname>Kernel Hackers Manual</productname> 2399 <date>July 2017</date> 2400</refentryinfo> 2401<refmeta> 2402 <refentrytitle><phrase>snd_interval_list</phrase></refentrytitle> 2403 <manvolnum>9</manvolnum> 2404 <refmiscinfo class="version">4.1.27</refmiscinfo> 2405</refmeta> 2406<refnamediv> 2407 <refname>snd_interval_list</refname> 2408 <refpurpose> 2409 refine the interval value from the list 2410 </refpurpose> 2411</refnamediv> 2412<refsynopsisdiv> 2413 <title>Synopsis</title> 2414 <funcsynopsis><funcprototype> 2415 <funcdef>int <function>snd_interval_list </function></funcdef> 2416 <paramdef>struct snd_interval * <parameter>i</parameter></paramdef> 2417 <paramdef>unsigned int <parameter>count</parameter></paramdef> 2418 <paramdef>const unsigned int * <parameter>list</parameter></paramdef> 2419 <paramdef>unsigned int <parameter>mask</parameter></paramdef> 2420 </funcprototype></funcsynopsis> 2421</refsynopsisdiv> 2422<refsect1> 2423 <title>Arguments</title> 2424 <variablelist> 2425 <varlistentry> 2426 <term><parameter>i</parameter></term> 2427 <listitem> 2428 <para> 2429 the interval value to refine 2430 </para> 2431 </listitem> 2432 </varlistentry> 2433 <varlistentry> 2434 <term><parameter>count</parameter></term> 2435 <listitem> 2436 <para> 2437 the number of elements in the list 2438 </para> 2439 </listitem> 2440 </varlistentry> 2441 <varlistentry> 2442 <term><parameter>list</parameter></term> 2443 <listitem> 2444 <para> 2445 the value list 2446 </para> 2447 </listitem> 2448 </varlistentry> 2449 <varlistentry> 2450 <term><parameter>mask</parameter></term> 2451 <listitem> 2452 <para> 2453 the bit-mask to evaluate 2454 </para> 2455 </listitem> 2456 </varlistentry> 2457 </variablelist> 2458</refsect1> 2459<refsect1> 2460<title>Description</title> 2461<para> 2462 Refines the interval value from the list. 2463 When mask is non-zero, only the elements corresponding to bit 1 are 2464 evaluated. 2465</para> 2466</refsect1> 2467<refsect1> 2468<title>Return</title> 2469<para> 2470 Positive if the value is changed, zero if it's not changed, or a 2471 negative error code. 2472</para> 2473</refsect1> 2474</refentry> 2475 2476<refentry id="API-snd-interval-ranges"> 2477<refentryinfo> 2478 <title>LINUX</title> 2479 <productname>Kernel Hackers Manual</productname> 2480 <date>July 2017</date> 2481</refentryinfo> 2482<refmeta> 2483 <refentrytitle><phrase>snd_interval_ranges</phrase></refentrytitle> 2484 <manvolnum>9</manvolnum> 2485 <refmiscinfo class="version">4.1.27</refmiscinfo> 2486</refmeta> 2487<refnamediv> 2488 <refname>snd_interval_ranges</refname> 2489 <refpurpose> 2490 refine the interval value from the list of ranges 2491 </refpurpose> 2492</refnamediv> 2493<refsynopsisdiv> 2494 <title>Synopsis</title> 2495 <funcsynopsis><funcprototype> 2496 <funcdef>int <function>snd_interval_ranges </function></funcdef> 2497 <paramdef>struct snd_interval * <parameter>i</parameter></paramdef> 2498 <paramdef>unsigned int <parameter>count</parameter></paramdef> 2499 <paramdef>const struct snd_interval * <parameter>ranges</parameter></paramdef> 2500 <paramdef>unsigned int <parameter>mask</parameter></paramdef> 2501 </funcprototype></funcsynopsis> 2502</refsynopsisdiv> 2503<refsect1> 2504 <title>Arguments</title> 2505 <variablelist> 2506 <varlistentry> 2507 <term><parameter>i</parameter></term> 2508 <listitem> 2509 <para> 2510 the interval value to refine 2511 </para> 2512 </listitem> 2513 </varlistentry> 2514 <varlistentry> 2515 <term><parameter>count</parameter></term> 2516 <listitem> 2517 <para> 2518 the number of elements in the list of ranges 2519 </para> 2520 </listitem> 2521 </varlistentry> 2522 <varlistentry> 2523 <term><parameter>ranges</parameter></term> 2524 <listitem> 2525 <para> 2526 the ranges list 2527 </para> 2528 </listitem> 2529 </varlistentry> 2530 <varlistentry> 2531 <term><parameter>mask</parameter></term> 2532 <listitem> 2533 <para> 2534 the bit-mask to evaluate 2535 </para> 2536 </listitem> 2537 </varlistentry> 2538 </variablelist> 2539</refsect1> 2540<refsect1> 2541<title>Description</title> 2542<para> 2543 Refines the interval value from the list of ranges. 2544 When mask is non-zero, only the elements corresponding to bit 1 are 2545 evaluated. 2546</para> 2547</refsect1> 2548<refsect1> 2549<title>Return</title> 2550<para> 2551 Positive if the value is changed, zero if it's not changed, or a 2552 negative error code. 2553</para> 2554</refsect1> 2555</refentry> 2556 2557<refentry id="API-snd-pcm-hw-rule-add"> 2558<refentryinfo> 2559 <title>LINUX</title> 2560 <productname>Kernel Hackers Manual</productname> 2561 <date>July 2017</date> 2562</refentryinfo> 2563<refmeta> 2564 <refentrytitle><phrase>snd_pcm_hw_rule_add</phrase></refentrytitle> 2565 <manvolnum>9</manvolnum> 2566 <refmiscinfo class="version">4.1.27</refmiscinfo> 2567</refmeta> 2568<refnamediv> 2569 <refname>snd_pcm_hw_rule_add</refname> 2570 <refpurpose> 2571 add the hw-constraint rule 2572 </refpurpose> 2573</refnamediv> 2574<refsynopsisdiv> 2575 <title>Synopsis</title> 2576 <funcsynopsis><funcprototype> 2577 <funcdef>int <function>snd_pcm_hw_rule_add </function></funcdef> 2578 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 2579 <paramdef>unsigned int <parameter>cond</parameter></paramdef> 2580 <paramdef>int <parameter>var</parameter></paramdef> 2581 <paramdef>snd_pcm_hw_rule_func_t <parameter>func</parameter></paramdef> 2582 <paramdef>void * <parameter>private</parameter></paramdef> 2583 <paramdef>int <parameter>dep</parameter></paramdef> 2584 <paramdef> <parameter>...</parameter></paramdef> 2585 </funcprototype></funcsynopsis> 2586</refsynopsisdiv> 2587<refsect1> 2588 <title>Arguments</title> 2589 <variablelist> 2590 <varlistentry> 2591 <term><parameter>runtime</parameter></term> 2592 <listitem> 2593 <para> 2594 the pcm runtime instance 2595 </para> 2596 </listitem> 2597 </varlistentry> 2598 <varlistentry> 2599 <term><parameter>cond</parameter></term> 2600 <listitem> 2601 <para> 2602 condition bits 2603 </para> 2604 </listitem> 2605 </varlistentry> 2606 <varlistentry> 2607 <term><parameter>var</parameter></term> 2608 <listitem> 2609 <para> 2610 the variable to evaluate 2611 </para> 2612 </listitem> 2613 </varlistentry> 2614 <varlistentry> 2615 <term><parameter>func</parameter></term> 2616 <listitem> 2617 <para> 2618 the evaluation function 2619 </para> 2620 </listitem> 2621 </varlistentry> 2622 <varlistentry> 2623 <term><parameter>private</parameter></term> 2624 <listitem> 2625 <para> 2626 the private data pointer passed to function 2627 </para> 2628 </listitem> 2629 </varlistentry> 2630 <varlistentry> 2631 <term><parameter>dep</parameter></term> 2632 <listitem> 2633 <para> 2634 the dependent variables 2635 </para> 2636 </listitem> 2637 </varlistentry> 2638 <varlistentry> 2639 <term><parameter>...</parameter></term> 2640 <listitem> 2641 <para> 2642 variable arguments 2643 </para> 2644 </listitem> 2645 </varlistentry> 2646 </variablelist> 2647</refsect1> 2648<refsect1> 2649<title>Return</title> 2650<para> 2651 Zero if successful, or a negative error code on failure. 2652</para> 2653</refsect1> 2654</refentry> 2655 2656<refentry id="API-snd-pcm-hw-constraint-mask64"> 2657<refentryinfo> 2658 <title>LINUX</title> 2659 <productname>Kernel Hackers Manual</productname> 2660 <date>July 2017</date> 2661</refentryinfo> 2662<refmeta> 2663 <refentrytitle><phrase>snd_pcm_hw_constraint_mask64</phrase></refentrytitle> 2664 <manvolnum>9</manvolnum> 2665 <refmiscinfo class="version">4.1.27</refmiscinfo> 2666</refmeta> 2667<refnamediv> 2668 <refname>snd_pcm_hw_constraint_mask64</refname> 2669 <refpurpose> 2670 apply the given bitmap mask constraint 2671 </refpurpose> 2672</refnamediv> 2673<refsynopsisdiv> 2674 <title>Synopsis</title> 2675 <funcsynopsis><funcprototype> 2676 <funcdef>int <function>snd_pcm_hw_constraint_mask64 </function></funcdef> 2677 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 2678 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 2679 <paramdef>u_int64_t <parameter>mask</parameter></paramdef> 2680 </funcprototype></funcsynopsis> 2681</refsynopsisdiv> 2682<refsect1> 2683 <title>Arguments</title> 2684 <variablelist> 2685 <varlistentry> 2686 <term><parameter>runtime</parameter></term> 2687 <listitem> 2688 <para> 2689 PCM runtime instance 2690 </para> 2691 </listitem> 2692 </varlistentry> 2693 <varlistentry> 2694 <term><parameter>var</parameter></term> 2695 <listitem> 2696 <para> 2697 hw_params variable to apply the mask 2698 </para> 2699 </listitem> 2700 </varlistentry> 2701 <varlistentry> 2702 <term><parameter>mask</parameter></term> 2703 <listitem> 2704 <para> 2705 the 64bit bitmap mask 2706 </para> 2707 </listitem> 2708 </varlistentry> 2709 </variablelist> 2710</refsect1> 2711<refsect1> 2712<title>Description</title> 2713<para> 2714 Apply the constraint of the given bitmap mask to a 64-bit mask parameter. 2715</para> 2716</refsect1> 2717<refsect1> 2718<title>Return</title> 2719<para> 2720 Zero if successful, or a negative error code on failure. 2721</para> 2722</refsect1> 2723</refentry> 2724 2725<refentry id="API-snd-pcm-hw-constraint-integer"> 2726<refentryinfo> 2727 <title>LINUX</title> 2728 <productname>Kernel Hackers Manual</productname> 2729 <date>July 2017</date> 2730</refentryinfo> 2731<refmeta> 2732 <refentrytitle><phrase>snd_pcm_hw_constraint_integer</phrase></refentrytitle> 2733 <manvolnum>9</manvolnum> 2734 <refmiscinfo class="version">4.1.27</refmiscinfo> 2735</refmeta> 2736<refnamediv> 2737 <refname>snd_pcm_hw_constraint_integer</refname> 2738 <refpurpose> 2739 apply an integer constraint to an interval 2740 </refpurpose> 2741</refnamediv> 2742<refsynopsisdiv> 2743 <title>Synopsis</title> 2744 <funcsynopsis><funcprototype> 2745 <funcdef>int <function>snd_pcm_hw_constraint_integer </function></funcdef> 2746 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 2747 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 2748 </funcprototype></funcsynopsis> 2749</refsynopsisdiv> 2750<refsect1> 2751 <title>Arguments</title> 2752 <variablelist> 2753 <varlistentry> 2754 <term><parameter>runtime</parameter></term> 2755 <listitem> 2756 <para> 2757 PCM runtime instance 2758 </para> 2759 </listitem> 2760 </varlistentry> 2761 <varlistentry> 2762 <term><parameter>var</parameter></term> 2763 <listitem> 2764 <para> 2765 hw_params variable to apply the integer constraint 2766 </para> 2767 </listitem> 2768 </varlistentry> 2769 </variablelist> 2770</refsect1> 2771<refsect1> 2772<title>Description</title> 2773<para> 2774 Apply the constraint of integer to an interval parameter. 2775</para> 2776</refsect1> 2777<refsect1> 2778<title>Return</title> 2779<para> 2780 Positive if the value is changed, zero if it's not changed, or a 2781 negative error code. 2782</para> 2783</refsect1> 2784</refentry> 2785 2786<refentry id="API-snd-pcm-hw-constraint-minmax"> 2787<refentryinfo> 2788 <title>LINUX</title> 2789 <productname>Kernel Hackers Manual</productname> 2790 <date>July 2017</date> 2791</refentryinfo> 2792<refmeta> 2793 <refentrytitle><phrase>snd_pcm_hw_constraint_minmax</phrase></refentrytitle> 2794 <manvolnum>9</manvolnum> 2795 <refmiscinfo class="version">4.1.27</refmiscinfo> 2796</refmeta> 2797<refnamediv> 2798 <refname>snd_pcm_hw_constraint_minmax</refname> 2799 <refpurpose> 2800 apply a min/max range constraint to an interval 2801 </refpurpose> 2802</refnamediv> 2803<refsynopsisdiv> 2804 <title>Synopsis</title> 2805 <funcsynopsis><funcprototype> 2806 <funcdef>int <function>snd_pcm_hw_constraint_minmax </function></funcdef> 2807 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 2808 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 2809 <paramdef>unsigned int <parameter>min</parameter></paramdef> 2810 <paramdef>unsigned int <parameter>max</parameter></paramdef> 2811 </funcprototype></funcsynopsis> 2812</refsynopsisdiv> 2813<refsect1> 2814 <title>Arguments</title> 2815 <variablelist> 2816 <varlistentry> 2817 <term><parameter>runtime</parameter></term> 2818 <listitem> 2819 <para> 2820 PCM runtime instance 2821 </para> 2822 </listitem> 2823 </varlistentry> 2824 <varlistentry> 2825 <term><parameter>var</parameter></term> 2826 <listitem> 2827 <para> 2828 hw_params variable to apply the range 2829 </para> 2830 </listitem> 2831 </varlistentry> 2832 <varlistentry> 2833 <term><parameter>min</parameter></term> 2834 <listitem> 2835 <para> 2836 the minimal value 2837 </para> 2838 </listitem> 2839 </varlistentry> 2840 <varlistentry> 2841 <term><parameter>max</parameter></term> 2842 <listitem> 2843 <para> 2844 the maximal value 2845 </para> 2846 </listitem> 2847 </varlistentry> 2848 </variablelist> 2849</refsect1> 2850<refsect1> 2851<title>Description</title> 2852<para> 2853 Apply the min/max range constraint to an interval parameter. 2854</para> 2855</refsect1> 2856<refsect1> 2857<title>Return</title> 2858<para> 2859 Positive if the value is changed, zero if it's not changed, or a 2860 negative error code. 2861</para> 2862</refsect1> 2863</refentry> 2864 2865<refentry id="API-snd-pcm-hw-constraint-list"> 2866<refentryinfo> 2867 <title>LINUX</title> 2868 <productname>Kernel Hackers Manual</productname> 2869 <date>July 2017</date> 2870</refentryinfo> 2871<refmeta> 2872 <refentrytitle><phrase>snd_pcm_hw_constraint_list</phrase></refentrytitle> 2873 <manvolnum>9</manvolnum> 2874 <refmiscinfo class="version">4.1.27</refmiscinfo> 2875</refmeta> 2876<refnamediv> 2877 <refname>snd_pcm_hw_constraint_list</refname> 2878 <refpurpose> 2879 apply a list of constraints to a parameter 2880 </refpurpose> 2881</refnamediv> 2882<refsynopsisdiv> 2883 <title>Synopsis</title> 2884 <funcsynopsis><funcprototype> 2885 <funcdef>int <function>snd_pcm_hw_constraint_list </function></funcdef> 2886 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 2887 <paramdef>unsigned int <parameter>cond</parameter></paramdef> 2888 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 2889 <paramdef>const struct snd_pcm_hw_constraint_list * <parameter>l</parameter></paramdef> 2890 </funcprototype></funcsynopsis> 2891</refsynopsisdiv> 2892<refsect1> 2893 <title>Arguments</title> 2894 <variablelist> 2895 <varlistentry> 2896 <term><parameter>runtime</parameter></term> 2897 <listitem> 2898 <para> 2899 PCM runtime instance 2900 </para> 2901 </listitem> 2902 </varlistentry> 2903 <varlistentry> 2904 <term><parameter>cond</parameter></term> 2905 <listitem> 2906 <para> 2907 condition bits 2908 </para> 2909 </listitem> 2910 </varlistentry> 2911 <varlistentry> 2912 <term><parameter>var</parameter></term> 2913 <listitem> 2914 <para> 2915 hw_params variable to apply the list constraint 2916 </para> 2917 </listitem> 2918 </varlistentry> 2919 <varlistentry> 2920 <term><parameter>l</parameter></term> 2921 <listitem> 2922 <para> 2923 list 2924 </para> 2925 </listitem> 2926 </varlistentry> 2927 </variablelist> 2928</refsect1> 2929<refsect1> 2930<title>Description</title> 2931<para> 2932 Apply the list of constraints to an interval parameter. 2933</para> 2934</refsect1> 2935<refsect1> 2936<title>Return</title> 2937<para> 2938 Zero if successful, or a negative error code on failure. 2939</para> 2940</refsect1> 2941</refentry> 2942 2943<refentry id="API-snd-pcm-hw-constraint-ranges"> 2944<refentryinfo> 2945 <title>LINUX</title> 2946 <productname>Kernel Hackers Manual</productname> 2947 <date>July 2017</date> 2948</refentryinfo> 2949<refmeta> 2950 <refentrytitle><phrase>snd_pcm_hw_constraint_ranges</phrase></refentrytitle> 2951 <manvolnum>9</manvolnum> 2952 <refmiscinfo class="version">4.1.27</refmiscinfo> 2953</refmeta> 2954<refnamediv> 2955 <refname>snd_pcm_hw_constraint_ranges</refname> 2956 <refpurpose> 2957 apply list of range constraints to a parameter 2958 </refpurpose> 2959</refnamediv> 2960<refsynopsisdiv> 2961 <title>Synopsis</title> 2962 <funcsynopsis><funcprototype> 2963 <funcdef>int <function>snd_pcm_hw_constraint_ranges </function></funcdef> 2964 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 2965 <paramdef>unsigned int <parameter>cond</parameter></paramdef> 2966 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 2967 <paramdef>const struct snd_pcm_hw_constraint_ranges * <parameter>r</parameter></paramdef> 2968 </funcprototype></funcsynopsis> 2969</refsynopsisdiv> 2970<refsect1> 2971 <title>Arguments</title> 2972 <variablelist> 2973 <varlistentry> 2974 <term><parameter>runtime</parameter></term> 2975 <listitem> 2976 <para> 2977 PCM runtime instance 2978 </para> 2979 </listitem> 2980 </varlistentry> 2981 <varlistentry> 2982 <term><parameter>cond</parameter></term> 2983 <listitem> 2984 <para> 2985 condition bits 2986 </para> 2987 </listitem> 2988 </varlistentry> 2989 <varlistentry> 2990 <term><parameter>var</parameter></term> 2991 <listitem> 2992 <para> 2993 hw_params variable to apply the list of range constraints 2994 </para> 2995 </listitem> 2996 </varlistentry> 2997 <varlistentry> 2998 <term><parameter>r</parameter></term> 2999 <listitem> 3000 <para> 3001 ranges 3002 </para> 3003 </listitem> 3004 </varlistentry> 3005 </variablelist> 3006</refsect1> 3007<refsect1> 3008<title>Description</title> 3009<para> 3010 Apply the list of range constraints to an interval parameter. 3011</para> 3012</refsect1> 3013<refsect1> 3014<title>Return</title> 3015<para> 3016 Zero if successful, or a negative error code on failure. 3017</para> 3018</refsect1> 3019</refentry> 3020 3021<refentry id="API-snd-pcm-hw-constraint-ratnums"> 3022<refentryinfo> 3023 <title>LINUX</title> 3024 <productname>Kernel Hackers Manual</productname> 3025 <date>July 2017</date> 3026</refentryinfo> 3027<refmeta> 3028 <refentrytitle><phrase>snd_pcm_hw_constraint_ratnums</phrase></refentrytitle> 3029 <manvolnum>9</manvolnum> 3030 <refmiscinfo class="version">4.1.27</refmiscinfo> 3031</refmeta> 3032<refnamediv> 3033 <refname>snd_pcm_hw_constraint_ratnums</refname> 3034 <refpurpose> 3035 apply ratnums constraint to a parameter 3036 </refpurpose> 3037</refnamediv> 3038<refsynopsisdiv> 3039 <title>Synopsis</title> 3040 <funcsynopsis><funcprototype> 3041 <funcdef>int <function>snd_pcm_hw_constraint_ratnums </function></funcdef> 3042 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 3043 <paramdef>unsigned int <parameter>cond</parameter></paramdef> 3044 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 3045 <paramdef>struct snd_pcm_hw_constraint_ratnums * <parameter>r</parameter></paramdef> 3046 </funcprototype></funcsynopsis> 3047</refsynopsisdiv> 3048<refsect1> 3049 <title>Arguments</title> 3050 <variablelist> 3051 <varlistentry> 3052 <term><parameter>runtime</parameter></term> 3053 <listitem> 3054 <para> 3055 PCM runtime instance 3056 </para> 3057 </listitem> 3058 </varlistentry> 3059 <varlistentry> 3060 <term><parameter>cond</parameter></term> 3061 <listitem> 3062 <para> 3063 condition bits 3064 </para> 3065 </listitem> 3066 </varlistentry> 3067 <varlistentry> 3068 <term><parameter>var</parameter></term> 3069 <listitem> 3070 <para> 3071 hw_params variable to apply the ratnums constraint 3072 </para> 3073 </listitem> 3074 </varlistentry> 3075 <varlistentry> 3076 <term><parameter>r</parameter></term> 3077 <listitem> 3078 <para> 3079 struct snd_ratnums constriants 3080 </para> 3081 </listitem> 3082 </varlistentry> 3083 </variablelist> 3084</refsect1> 3085<refsect1> 3086<title>Return</title> 3087<para> 3088 Zero if successful, or a negative error code on failure. 3089</para> 3090</refsect1> 3091</refentry> 3092 3093<refentry id="API-snd-pcm-hw-constraint-ratdens"> 3094<refentryinfo> 3095 <title>LINUX</title> 3096 <productname>Kernel Hackers Manual</productname> 3097 <date>July 2017</date> 3098</refentryinfo> 3099<refmeta> 3100 <refentrytitle><phrase>snd_pcm_hw_constraint_ratdens</phrase></refentrytitle> 3101 <manvolnum>9</manvolnum> 3102 <refmiscinfo class="version">4.1.27</refmiscinfo> 3103</refmeta> 3104<refnamediv> 3105 <refname>snd_pcm_hw_constraint_ratdens</refname> 3106 <refpurpose> 3107 apply ratdens constraint to a parameter 3108 </refpurpose> 3109</refnamediv> 3110<refsynopsisdiv> 3111 <title>Synopsis</title> 3112 <funcsynopsis><funcprototype> 3113 <funcdef>int <function>snd_pcm_hw_constraint_ratdens </function></funcdef> 3114 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 3115 <paramdef>unsigned int <parameter>cond</parameter></paramdef> 3116 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 3117 <paramdef>struct snd_pcm_hw_constraint_ratdens * <parameter>r</parameter></paramdef> 3118 </funcprototype></funcsynopsis> 3119</refsynopsisdiv> 3120<refsect1> 3121 <title>Arguments</title> 3122 <variablelist> 3123 <varlistentry> 3124 <term><parameter>runtime</parameter></term> 3125 <listitem> 3126 <para> 3127 PCM runtime instance 3128 </para> 3129 </listitem> 3130 </varlistentry> 3131 <varlistentry> 3132 <term><parameter>cond</parameter></term> 3133 <listitem> 3134 <para> 3135 condition bits 3136 </para> 3137 </listitem> 3138 </varlistentry> 3139 <varlistentry> 3140 <term><parameter>var</parameter></term> 3141 <listitem> 3142 <para> 3143 hw_params variable to apply the ratdens constraint 3144 </para> 3145 </listitem> 3146 </varlistentry> 3147 <varlistentry> 3148 <term><parameter>r</parameter></term> 3149 <listitem> 3150 <para> 3151 struct snd_ratdens constriants 3152 </para> 3153 </listitem> 3154 </varlistentry> 3155 </variablelist> 3156</refsect1> 3157<refsect1> 3158<title>Return</title> 3159<para> 3160 Zero if successful, or a negative error code on failure. 3161</para> 3162</refsect1> 3163</refentry> 3164 3165<refentry id="API-snd-pcm-hw-constraint-msbits"> 3166<refentryinfo> 3167 <title>LINUX</title> 3168 <productname>Kernel Hackers Manual</productname> 3169 <date>July 2017</date> 3170</refentryinfo> 3171<refmeta> 3172 <refentrytitle><phrase>snd_pcm_hw_constraint_msbits</phrase></refentrytitle> 3173 <manvolnum>9</manvolnum> 3174 <refmiscinfo class="version">4.1.27</refmiscinfo> 3175</refmeta> 3176<refnamediv> 3177 <refname>snd_pcm_hw_constraint_msbits</refname> 3178 <refpurpose> 3179 add a hw constraint msbits rule 3180 </refpurpose> 3181</refnamediv> 3182<refsynopsisdiv> 3183 <title>Synopsis</title> 3184 <funcsynopsis><funcprototype> 3185 <funcdef>int <function>snd_pcm_hw_constraint_msbits </function></funcdef> 3186 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 3187 <paramdef>unsigned int <parameter>cond</parameter></paramdef> 3188 <paramdef>unsigned int <parameter>width</parameter></paramdef> 3189 <paramdef>unsigned int <parameter>msbits</parameter></paramdef> 3190 </funcprototype></funcsynopsis> 3191</refsynopsisdiv> 3192<refsect1> 3193 <title>Arguments</title> 3194 <variablelist> 3195 <varlistentry> 3196 <term><parameter>runtime</parameter></term> 3197 <listitem> 3198 <para> 3199 PCM runtime instance 3200 </para> 3201 </listitem> 3202 </varlistentry> 3203 <varlistentry> 3204 <term><parameter>cond</parameter></term> 3205 <listitem> 3206 <para> 3207 condition bits 3208 </para> 3209 </listitem> 3210 </varlistentry> 3211 <varlistentry> 3212 <term><parameter>width</parameter></term> 3213 <listitem> 3214 <para> 3215 sample bits width 3216 </para> 3217 </listitem> 3218 </varlistentry> 3219 <varlistentry> 3220 <term><parameter>msbits</parameter></term> 3221 <listitem> 3222 <para> 3223 msbits width 3224 </para> 3225 </listitem> 3226 </varlistentry> 3227 </variablelist> 3228</refsect1> 3229<refsect1> 3230<title>Description</title> 3231<para> 3232 This constraint will set the number of most significant bits (msbits) if a 3233 sample format with the specified width has been select. If width is set to 0 3234 the msbits will be set for any sample format with a width larger than the 3235 specified msbits. 3236</para> 3237</refsect1> 3238<refsect1> 3239<title>Return</title> 3240<para> 3241 Zero if successful, or a negative error code on failure. 3242</para> 3243</refsect1> 3244</refentry> 3245 3246<refentry id="API-snd-pcm-hw-constraint-step"> 3247<refentryinfo> 3248 <title>LINUX</title> 3249 <productname>Kernel Hackers Manual</productname> 3250 <date>July 2017</date> 3251</refentryinfo> 3252<refmeta> 3253 <refentrytitle><phrase>snd_pcm_hw_constraint_step</phrase></refentrytitle> 3254 <manvolnum>9</manvolnum> 3255 <refmiscinfo class="version">4.1.27</refmiscinfo> 3256</refmeta> 3257<refnamediv> 3258 <refname>snd_pcm_hw_constraint_step</refname> 3259 <refpurpose> 3260 add a hw constraint step rule 3261 </refpurpose> 3262</refnamediv> 3263<refsynopsisdiv> 3264 <title>Synopsis</title> 3265 <funcsynopsis><funcprototype> 3266 <funcdef>int <function>snd_pcm_hw_constraint_step </function></funcdef> 3267 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 3268 <paramdef>unsigned int <parameter>cond</parameter></paramdef> 3269 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 3270 <paramdef>unsigned long <parameter>step</parameter></paramdef> 3271 </funcprototype></funcsynopsis> 3272</refsynopsisdiv> 3273<refsect1> 3274 <title>Arguments</title> 3275 <variablelist> 3276 <varlistentry> 3277 <term><parameter>runtime</parameter></term> 3278 <listitem> 3279 <para> 3280 PCM runtime instance 3281 </para> 3282 </listitem> 3283 </varlistentry> 3284 <varlistentry> 3285 <term><parameter>cond</parameter></term> 3286 <listitem> 3287 <para> 3288 condition bits 3289 </para> 3290 </listitem> 3291 </varlistentry> 3292 <varlistentry> 3293 <term><parameter>var</parameter></term> 3294 <listitem> 3295 <para> 3296 hw_params variable to apply the step constraint 3297 </para> 3298 </listitem> 3299 </varlistentry> 3300 <varlistentry> 3301 <term><parameter>step</parameter></term> 3302 <listitem> 3303 <para> 3304 step size 3305 </para> 3306 </listitem> 3307 </varlistentry> 3308 </variablelist> 3309</refsect1> 3310<refsect1> 3311<title>Return</title> 3312<para> 3313 Zero if successful, or a negative error code on failure. 3314</para> 3315</refsect1> 3316</refentry> 3317 3318<refentry id="API-snd-pcm-hw-constraint-pow2"> 3319<refentryinfo> 3320 <title>LINUX</title> 3321 <productname>Kernel Hackers Manual</productname> 3322 <date>July 2017</date> 3323</refentryinfo> 3324<refmeta> 3325 <refentrytitle><phrase>snd_pcm_hw_constraint_pow2</phrase></refentrytitle> 3326 <manvolnum>9</manvolnum> 3327 <refmiscinfo class="version">4.1.27</refmiscinfo> 3328</refmeta> 3329<refnamediv> 3330 <refname>snd_pcm_hw_constraint_pow2</refname> 3331 <refpurpose> 3332 add a hw constraint power-of-2 rule 3333 </refpurpose> 3334</refnamediv> 3335<refsynopsisdiv> 3336 <title>Synopsis</title> 3337 <funcsynopsis><funcprototype> 3338 <funcdef>int <function>snd_pcm_hw_constraint_pow2 </function></funcdef> 3339 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 3340 <paramdef>unsigned int <parameter>cond</parameter></paramdef> 3341 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 3342 </funcprototype></funcsynopsis> 3343</refsynopsisdiv> 3344<refsect1> 3345 <title>Arguments</title> 3346 <variablelist> 3347 <varlistentry> 3348 <term><parameter>runtime</parameter></term> 3349 <listitem> 3350 <para> 3351 PCM runtime instance 3352 </para> 3353 </listitem> 3354 </varlistentry> 3355 <varlistentry> 3356 <term><parameter>cond</parameter></term> 3357 <listitem> 3358 <para> 3359 condition bits 3360 </para> 3361 </listitem> 3362 </varlistentry> 3363 <varlistentry> 3364 <term><parameter>var</parameter></term> 3365 <listitem> 3366 <para> 3367 hw_params variable to apply the power-of-2 constraint 3368 </para> 3369 </listitem> 3370 </varlistentry> 3371 </variablelist> 3372</refsect1> 3373<refsect1> 3374<title>Return</title> 3375<para> 3376 Zero if successful, or a negative error code on failure. 3377</para> 3378</refsect1> 3379</refentry> 3380 3381<refentry id="API-snd-pcm-hw-rule-noresample"> 3382<refentryinfo> 3383 <title>LINUX</title> 3384 <productname>Kernel Hackers Manual</productname> 3385 <date>July 2017</date> 3386</refentryinfo> 3387<refmeta> 3388 <refentrytitle><phrase>snd_pcm_hw_rule_noresample</phrase></refentrytitle> 3389 <manvolnum>9</manvolnum> 3390 <refmiscinfo class="version">4.1.27</refmiscinfo> 3391</refmeta> 3392<refnamediv> 3393 <refname>snd_pcm_hw_rule_noresample</refname> 3394 <refpurpose> 3395 add a rule to allow disabling hw resampling 3396 </refpurpose> 3397</refnamediv> 3398<refsynopsisdiv> 3399 <title>Synopsis</title> 3400 <funcsynopsis><funcprototype> 3401 <funcdef>int <function>snd_pcm_hw_rule_noresample </function></funcdef> 3402 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 3403 <paramdef>unsigned int <parameter>base_rate</parameter></paramdef> 3404 </funcprototype></funcsynopsis> 3405</refsynopsisdiv> 3406<refsect1> 3407 <title>Arguments</title> 3408 <variablelist> 3409 <varlistentry> 3410 <term><parameter>runtime</parameter></term> 3411 <listitem> 3412 <para> 3413 PCM runtime instance 3414 </para> 3415 </listitem> 3416 </varlistentry> 3417 <varlistentry> 3418 <term><parameter>base_rate</parameter></term> 3419 <listitem> 3420 <para> 3421 the rate at which the hardware does not resample 3422 </para> 3423 </listitem> 3424 </varlistentry> 3425 </variablelist> 3426</refsect1> 3427<refsect1> 3428<title>Return</title> 3429<para> 3430 Zero if successful, or a negative error code on failure. 3431</para> 3432</refsect1> 3433</refentry> 3434 3435<refentry id="API-snd-pcm-hw-param-value"> 3436<refentryinfo> 3437 <title>LINUX</title> 3438 <productname>Kernel Hackers Manual</productname> 3439 <date>July 2017</date> 3440</refentryinfo> 3441<refmeta> 3442 <refentrytitle><phrase>snd_pcm_hw_param_value</phrase></refentrytitle> 3443 <manvolnum>9</manvolnum> 3444 <refmiscinfo class="version">4.1.27</refmiscinfo> 3445</refmeta> 3446<refnamediv> 3447 <refname>snd_pcm_hw_param_value</refname> 3448 <refpurpose> 3449 return <parameter>params</parameter> field <parameter>var</parameter> value 3450 </refpurpose> 3451</refnamediv> 3452<refsynopsisdiv> 3453 <title>Synopsis</title> 3454 <funcsynopsis><funcprototype> 3455 <funcdef>int <function>snd_pcm_hw_param_value </function></funcdef> 3456 <paramdef>const struct snd_pcm_hw_params * <parameter>params</parameter></paramdef> 3457 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 3458 <paramdef>int * <parameter>dir</parameter></paramdef> 3459 </funcprototype></funcsynopsis> 3460</refsynopsisdiv> 3461<refsect1> 3462 <title>Arguments</title> 3463 <variablelist> 3464 <varlistentry> 3465 <term><parameter>params</parameter></term> 3466 <listitem> 3467 <para> 3468 the hw_params instance 3469 </para> 3470 </listitem> 3471 </varlistentry> 3472 <varlistentry> 3473 <term><parameter>var</parameter></term> 3474 <listitem> 3475 <para> 3476 parameter to retrieve 3477 </para> 3478 </listitem> 3479 </varlistentry> 3480 <varlistentry> 3481 <term><parameter>dir</parameter></term> 3482 <listitem> 3483 <para> 3484 pointer to the direction (-1,0,1) or <constant>NULL</constant> 3485 </para> 3486 </listitem> 3487 </varlistentry> 3488 </variablelist> 3489</refsect1> 3490<refsect1> 3491<title>Return</title> 3492<para> 3493 The value for field <parameter>var</parameter> if it's fixed in configuration space 3494 defined by <parameter>params</parameter>. -<constant>EINVAL</constant> otherwise. 3495</para> 3496</refsect1> 3497</refentry> 3498 3499<refentry id="API-snd-pcm-hw-param-first"> 3500<refentryinfo> 3501 <title>LINUX</title> 3502 <productname>Kernel Hackers Manual</productname> 3503 <date>July 2017</date> 3504</refentryinfo> 3505<refmeta> 3506 <refentrytitle><phrase>snd_pcm_hw_param_first</phrase></refentrytitle> 3507 <manvolnum>9</manvolnum> 3508 <refmiscinfo class="version">4.1.27</refmiscinfo> 3509</refmeta> 3510<refnamediv> 3511 <refname>snd_pcm_hw_param_first</refname> 3512 <refpurpose> 3513 refine config space and return minimum value 3514 </refpurpose> 3515</refnamediv> 3516<refsynopsisdiv> 3517 <title>Synopsis</title> 3518 <funcsynopsis><funcprototype> 3519 <funcdef>int <function>snd_pcm_hw_param_first </function></funcdef> 3520 <paramdef>struct snd_pcm_substream * <parameter>pcm</parameter></paramdef> 3521 <paramdef>struct snd_pcm_hw_params * <parameter>params</parameter></paramdef> 3522 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 3523 <paramdef>int * <parameter>dir</parameter></paramdef> 3524 </funcprototype></funcsynopsis> 3525</refsynopsisdiv> 3526<refsect1> 3527 <title>Arguments</title> 3528 <variablelist> 3529 <varlistentry> 3530 <term><parameter>pcm</parameter></term> 3531 <listitem> 3532 <para> 3533 PCM instance 3534 </para> 3535 </listitem> 3536 </varlistentry> 3537 <varlistentry> 3538 <term><parameter>params</parameter></term> 3539 <listitem> 3540 <para> 3541 the hw_params instance 3542 </para> 3543 </listitem> 3544 </varlistentry> 3545 <varlistentry> 3546 <term><parameter>var</parameter></term> 3547 <listitem> 3548 <para> 3549 parameter to retrieve 3550 </para> 3551 </listitem> 3552 </varlistentry> 3553 <varlistentry> 3554 <term><parameter>dir</parameter></term> 3555 <listitem> 3556 <para> 3557 pointer to the direction (-1,0,1) or <constant>NULL</constant> 3558 </para> 3559 </listitem> 3560 </varlistentry> 3561 </variablelist> 3562</refsect1> 3563<refsect1> 3564<title>Description</title> 3565<para> 3566 Inside configuration space defined by <parameter>params</parameter> remove from <parameter>var</parameter> all 3567 values > minimum. Reduce configuration space accordingly. 3568</para> 3569</refsect1> 3570<refsect1> 3571<title>Return</title> 3572<para> 3573 The minimum, or a negative error code on failure. 3574</para> 3575</refsect1> 3576</refentry> 3577 3578<refentry id="API-snd-pcm-hw-param-last"> 3579<refentryinfo> 3580 <title>LINUX</title> 3581 <productname>Kernel Hackers Manual</productname> 3582 <date>July 2017</date> 3583</refentryinfo> 3584<refmeta> 3585 <refentrytitle><phrase>snd_pcm_hw_param_last</phrase></refentrytitle> 3586 <manvolnum>9</manvolnum> 3587 <refmiscinfo class="version">4.1.27</refmiscinfo> 3588</refmeta> 3589<refnamediv> 3590 <refname>snd_pcm_hw_param_last</refname> 3591 <refpurpose> 3592 refine config space and return maximum value 3593 </refpurpose> 3594</refnamediv> 3595<refsynopsisdiv> 3596 <title>Synopsis</title> 3597 <funcsynopsis><funcprototype> 3598 <funcdef>int <function>snd_pcm_hw_param_last </function></funcdef> 3599 <paramdef>struct snd_pcm_substream * <parameter>pcm</parameter></paramdef> 3600 <paramdef>struct snd_pcm_hw_params * <parameter>params</parameter></paramdef> 3601 <paramdef>snd_pcm_hw_param_t <parameter>var</parameter></paramdef> 3602 <paramdef>int * <parameter>dir</parameter></paramdef> 3603 </funcprototype></funcsynopsis> 3604</refsynopsisdiv> 3605<refsect1> 3606 <title>Arguments</title> 3607 <variablelist> 3608 <varlistentry> 3609 <term><parameter>pcm</parameter></term> 3610 <listitem> 3611 <para> 3612 PCM instance 3613 </para> 3614 </listitem> 3615 </varlistentry> 3616 <varlistentry> 3617 <term><parameter>params</parameter></term> 3618 <listitem> 3619 <para> 3620 the hw_params instance 3621 </para> 3622 </listitem> 3623 </varlistentry> 3624 <varlistentry> 3625 <term><parameter>var</parameter></term> 3626 <listitem> 3627 <para> 3628 parameter to retrieve 3629 </para> 3630 </listitem> 3631 </varlistentry> 3632 <varlistentry> 3633 <term><parameter>dir</parameter></term> 3634 <listitem> 3635 <para> 3636 pointer to the direction (-1,0,1) or <constant>NULL</constant> 3637 </para> 3638 </listitem> 3639 </varlistentry> 3640 </variablelist> 3641</refsect1> 3642<refsect1> 3643<title>Description</title> 3644<para> 3645 Inside configuration space defined by <parameter>params</parameter> remove from <parameter>var</parameter> all 3646 values < maximum. Reduce configuration space accordingly. 3647</para> 3648</refsect1> 3649<refsect1> 3650<title>Return</title> 3651<para> 3652 The maximum, or a negative error code on failure. 3653</para> 3654</refsect1> 3655</refentry> 3656 3657<refentry id="API-snd-pcm-lib-ioctl"> 3658<refentryinfo> 3659 <title>LINUX</title> 3660 <productname>Kernel Hackers Manual</productname> 3661 <date>July 2017</date> 3662</refentryinfo> 3663<refmeta> 3664 <refentrytitle><phrase>snd_pcm_lib_ioctl</phrase></refentrytitle> 3665 <manvolnum>9</manvolnum> 3666 <refmiscinfo class="version">4.1.27</refmiscinfo> 3667</refmeta> 3668<refnamediv> 3669 <refname>snd_pcm_lib_ioctl</refname> 3670 <refpurpose> 3671 a generic PCM ioctl callback 3672 </refpurpose> 3673</refnamediv> 3674<refsynopsisdiv> 3675 <title>Synopsis</title> 3676 <funcsynopsis><funcprototype> 3677 <funcdef>int <function>snd_pcm_lib_ioctl </function></funcdef> 3678 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 3679 <paramdef>unsigned int <parameter>cmd</parameter></paramdef> 3680 <paramdef>void * <parameter>arg</parameter></paramdef> 3681 </funcprototype></funcsynopsis> 3682</refsynopsisdiv> 3683<refsect1> 3684 <title>Arguments</title> 3685 <variablelist> 3686 <varlistentry> 3687 <term><parameter>substream</parameter></term> 3688 <listitem> 3689 <para> 3690 the pcm substream instance 3691 </para> 3692 </listitem> 3693 </varlistentry> 3694 <varlistentry> 3695 <term><parameter>cmd</parameter></term> 3696 <listitem> 3697 <para> 3698 ioctl command 3699 </para> 3700 </listitem> 3701 </varlistentry> 3702 <varlistentry> 3703 <term><parameter>arg</parameter></term> 3704 <listitem> 3705 <para> 3706 ioctl argument 3707 </para> 3708 </listitem> 3709 </varlistentry> 3710 </variablelist> 3711</refsect1> 3712<refsect1> 3713<title>Description</title> 3714<para> 3715 Processes the generic ioctl commands for PCM. 3716 Can be passed as the ioctl callback for PCM ops. 3717</para> 3718</refsect1> 3719<refsect1> 3720<title>Return</title> 3721<para> 3722 Zero if successful, or a negative error code on failure. 3723</para> 3724</refsect1> 3725</refentry> 3726 3727<refentry id="API-snd-pcm-period-elapsed"> 3728<refentryinfo> 3729 <title>LINUX</title> 3730 <productname>Kernel Hackers Manual</productname> 3731 <date>July 2017</date> 3732</refentryinfo> 3733<refmeta> 3734 <refentrytitle><phrase>snd_pcm_period_elapsed</phrase></refentrytitle> 3735 <manvolnum>9</manvolnum> 3736 <refmiscinfo class="version">4.1.27</refmiscinfo> 3737</refmeta> 3738<refnamediv> 3739 <refname>snd_pcm_period_elapsed</refname> 3740 <refpurpose> 3741 update the pcm status for the next period 3742 </refpurpose> 3743</refnamediv> 3744<refsynopsisdiv> 3745 <title>Synopsis</title> 3746 <funcsynopsis><funcprototype> 3747 <funcdef>void <function>snd_pcm_period_elapsed </function></funcdef> 3748 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 3749 </funcprototype></funcsynopsis> 3750</refsynopsisdiv> 3751<refsect1> 3752 <title>Arguments</title> 3753 <variablelist> 3754 <varlistentry> 3755 <term><parameter>substream</parameter></term> 3756 <listitem> 3757 <para> 3758 the pcm substream instance 3759 </para> 3760 </listitem> 3761 </varlistentry> 3762 </variablelist> 3763</refsect1> 3764<refsect1> 3765<title>Description</title> 3766<para> 3767 This function is called from the interrupt handler when the 3768 PCM has processed the period size. It will update the current 3769 pointer, wake up sleepers, etc. 3770 </para><para> 3771 3772 Even if more than one periods have elapsed since the last call, you 3773 have to call this only once. 3774</para> 3775</refsect1> 3776</refentry> 3777 3778<refentry id="API-snd-pcm-add-chmap-ctls"> 3779<refentryinfo> 3780 <title>LINUX</title> 3781 <productname>Kernel Hackers Manual</productname> 3782 <date>July 2017</date> 3783</refentryinfo> 3784<refmeta> 3785 <refentrytitle><phrase>snd_pcm_add_chmap_ctls</phrase></refentrytitle> 3786 <manvolnum>9</manvolnum> 3787 <refmiscinfo class="version">4.1.27</refmiscinfo> 3788</refmeta> 3789<refnamediv> 3790 <refname>snd_pcm_add_chmap_ctls</refname> 3791 <refpurpose> 3792 create channel-mapping control elements 3793 </refpurpose> 3794</refnamediv> 3795<refsynopsisdiv> 3796 <title>Synopsis</title> 3797 <funcsynopsis><funcprototype> 3798 <funcdef>int <function>snd_pcm_add_chmap_ctls </function></funcdef> 3799 <paramdef>struct snd_pcm * <parameter>pcm</parameter></paramdef> 3800 <paramdef>int <parameter>stream</parameter></paramdef> 3801 <paramdef>const struct snd_pcm_chmap_elem * <parameter>chmap</parameter></paramdef> 3802 <paramdef>int <parameter>max_channels</parameter></paramdef> 3803 <paramdef>unsigned long <parameter>private_value</parameter></paramdef> 3804 <paramdef>struct snd_pcm_chmap ** <parameter>info_ret</parameter></paramdef> 3805 </funcprototype></funcsynopsis> 3806</refsynopsisdiv> 3807<refsect1> 3808 <title>Arguments</title> 3809 <variablelist> 3810 <varlistentry> 3811 <term><parameter>pcm</parameter></term> 3812 <listitem> 3813 <para> 3814 the assigned PCM instance 3815 </para> 3816 </listitem> 3817 </varlistentry> 3818 <varlistentry> 3819 <term><parameter>stream</parameter></term> 3820 <listitem> 3821 <para> 3822 stream direction 3823 </para> 3824 </listitem> 3825 </varlistentry> 3826 <varlistentry> 3827 <term><parameter>chmap</parameter></term> 3828 <listitem> 3829 <para> 3830 channel map elements (for query) 3831 </para> 3832 </listitem> 3833 </varlistentry> 3834 <varlistentry> 3835 <term><parameter>max_channels</parameter></term> 3836 <listitem> 3837 <para> 3838 the max number of channels for the stream 3839 </para> 3840 </listitem> 3841 </varlistentry> 3842 <varlistentry> 3843 <term><parameter>private_value</parameter></term> 3844 <listitem> 3845 <para> 3846 the value passed to each kcontrol's private_value field 3847 </para> 3848 </listitem> 3849 </varlistentry> 3850 <varlistentry> 3851 <term><parameter>info_ret</parameter></term> 3852 <listitem> 3853 <para> 3854 store struct snd_pcm_chmap instance if non-NULL 3855 </para> 3856 </listitem> 3857 </varlistentry> 3858 </variablelist> 3859</refsect1> 3860<refsect1> 3861<title>Description</title> 3862<para> 3863 Create channel-mapping control elements assigned to the given PCM stream(s). 3864</para> 3865</refsect1> 3866<refsect1> 3867<title>Return</title> 3868<para> 3869 Zero if successful, or a negative error value. 3870</para> 3871</refsect1> 3872</refentry> 3873 3874<!-- sound/core/pcm_native.c --> 3875<refentry id="API-snd-pcm-stream-lock"> 3876<refentryinfo> 3877 <title>LINUX</title> 3878 <productname>Kernel Hackers Manual</productname> 3879 <date>July 2017</date> 3880</refentryinfo> 3881<refmeta> 3882 <refentrytitle><phrase>snd_pcm_stream_lock</phrase></refentrytitle> 3883 <manvolnum>9</manvolnum> 3884 <refmiscinfo class="version">4.1.27</refmiscinfo> 3885</refmeta> 3886<refnamediv> 3887 <refname>snd_pcm_stream_lock</refname> 3888 <refpurpose> 3889 Lock the PCM stream 3890 </refpurpose> 3891</refnamediv> 3892<refsynopsisdiv> 3893 <title>Synopsis</title> 3894 <funcsynopsis><funcprototype> 3895 <funcdef>void <function>snd_pcm_stream_lock </function></funcdef> 3896 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 3897 </funcprototype></funcsynopsis> 3898</refsynopsisdiv> 3899<refsect1> 3900 <title>Arguments</title> 3901 <variablelist> 3902 <varlistentry> 3903 <term><parameter>substream</parameter></term> 3904 <listitem> 3905 <para> 3906 PCM substream 3907 </para> 3908 </listitem> 3909 </varlistentry> 3910 </variablelist> 3911</refsect1> 3912<refsect1> 3913<title>Description</title> 3914<para> 3915 This locks the PCM stream's spinlock or mutex depending on the nonatomic 3916 flag of the given substream. This also takes the global link rw lock 3917 (or rw sem), too, for avoiding the race with linked streams. 3918</para> 3919</refsect1> 3920</refentry> 3921 3922<refentry id="API-snd-pcm-stream-unlock"> 3923<refentryinfo> 3924 <title>LINUX</title> 3925 <productname>Kernel Hackers Manual</productname> 3926 <date>July 2017</date> 3927</refentryinfo> 3928<refmeta> 3929 <refentrytitle><phrase>snd_pcm_stream_unlock</phrase></refentrytitle> 3930 <manvolnum>9</manvolnum> 3931 <refmiscinfo class="version">4.1.27</refmiscinfo> 3932</refmeta> 3933<refnamediv> 3934 <refname>snd_pcm_stream_unlock</refname> 3935 <refpurpose> 3936 Unlock the PCM stream 3937 </refpurpose> 3938</refnamediv> 3939<refsynopsisdiv> 3940 <title>Synopsis</title> 3941 <funcsynopsis><funcprototype> 3942 <funcdef>void <function>snd_pcm_stream_unlock </function></funcdef> 3943 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 3944 </funcprototype></funcsynopsis> 3945</refsynopsisdiv> 3946<refsect1> 3947 <title>Arguments</title> 3948 <variablelist> 3949 <varlistentry> 3950 <term><parameter>substream</parameter></term> 3951 <listitem> 3952 <para> 3953 PCM substream 3954 </para> 3955 </listitem> 3956 </varlistentry> 3957 </variablelist> 3958</refsect1> 3959<refsect1> 3960<title>Description</title> 3961<para> 3962 This unlocks the PCM stream that has been locked via <function>snd_pcm_stream_lock</function>. 3963</para> 3964</refsect1> 3965</refentry> 3966 3967<refentry id="API-snd-pcm-stream-lock-irq"> 3968<refentryinfo> 3969 <title>LINUX</title> 3970 <productname>Kernel Hackers Manual</productname> 3971 <date>July 2017</date> 3972</refentryinfo> 3973<refmeta> 3974 <refentrytitle><phrase>snd_pcm_stream_lock_irq</phrase></refentrytitle> 3975 <manvolnum>9</manvolnum> 3976 <refmiscinfo class="version">4.1.27</refmiscinfo> 3977</refmeta> 3978<refnamediv> 3979 <refname>snd_pcm_stream_lock_irq</refname> 3980 <refpurpose> 3981 Lock the PCM stream 3982 </refpurpose> 3983</refnamediv> 3984<refsynopsisdiv> 3985 <title>Synopsis</title> 3986 <funcsynopsis><funcprototype> 3987 <funcdef>void <function>snd_pcm_stream_lock_irq </function></funcdef> 3988 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 3989 </funcprototype></funcsynopsis> 3990</refsynopsisdiv> 3991<refsect1> 3992 <title>Arguments</title> 3993 <variablelist> 3994 <varlistentry> 3995 <term><parameter>substream</parameter></term> 3996 <listitem> 3997 <para> 3998 PCM substream 3999 </para> 4000 </listitem> 4001 </varlistentry> 4002 </variablelist> 4003</refsect1> 4004<refsect1> 4005<title>Description</title> 4006<para> 4007 This locks the PCM stream like <function>snd_pcm_stream_lock</function> and disables the local 4008 IRQ (only when nonatomic is false). In nonatomic case, this is identical 4009 as <function>snd_pcm_stream_lock</function>. 4010</para> 4011</refsect1> 4012</refentry> 4013 4014<refentry id="API-snd-pcm-stream-unlock-irq"> 4015<refentryinfo> 4016 <title>LINUX</title> 4017 <productname>Kernel Hackers Manual</productname> 4018 <date>July 2017</date> 4019</refentryinfo> 4020<refmeta> 4021 <refentrytitle><phrase>snd_pcm_stream_unlock_irq</phrase></refentrytitle> 4022 <manvolnum>9</manvolnum> 4023 <refmiscinfo class="version">4.1.27</refmiscinfo> 4024</refmeta> 4025<refnamediv> 4026 <refname>snd_pcm_stream_unlock_irq</refname> 4027 <refpurpose> 4028 Unlock the PCM stream 4029 </refpurpose> 4030</refnamediv> 4031<refsynopsisdiv> 4032 <title>Synopsis</title> 4033 <funcsynopsis><funcprototype> 4034 <funcdef>void <function>snd_pcm_stream_unlock_irq </function></funcdef> 4035 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4036 </funcprototype></funcsynopsis> 4037</refsynopsisdiv> 4038<refsect1> 4039 <title>Arguments</title> 4040 <variablelist> 4041 <varlistentry> 4042 <term><parameter>substream</parameter></term> 4043 <listitem> 4044 <para> 4045 PCM substream 4046 </para> 4047 </listitem> 4048 </varlistentry> 4049 </variablelist> 4050</refsect1> 4051<refsect1> 4052<title>Description</title> 4053<para> 4054 This is a counter-part of <function>snd_pcm_stream_lock_irq</function>. 4055</para> 4056</refsect1> 4057</refentry> 4058 4059<refentry id="API-snd-pcm-stream-unlock-irqrestore"> 4060<refentryinfo> 4061 <title>LINUX</title> 4062 <productname>Kernel Hackers Manual</productname> 4063 <date>July 2017</date> 4064</refentryinfo> 4065<refmeta> 4066 <refentrytitle><phrase>snd_pcm_stream_unlock_irqrestore</phrase></refentrytitle> 4067 <manvolnum>9</manvolnum> 4068 <refmiscinfo class="version">4.1.27</refmiscinfo> 4069</refmeta> 4070<refnamediv> 4071 <refname>snd_pcm_stream_unlock_irqrestore</refname> 4072 <refpurpose> 4073 Unlock the PCM stream 4074 </refpurpose> 4075</refnamediv> 4076<refsynopsisdiv> 4077 <title>Synopsis</title> 4078 <funcsynopsis><funcprototype> 4079 <funcdef>void <function>snd_pcm_stream_unlock_irqrestore </function></funcdef> 4080 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4081 <paramdef>unsigned long <parameter>flags</parameter></paramdef> 4082 </funcprototype></funcsynopsis> 4083</refsynopsisdiv> 4084<refsect1> 4085 <title>Arguments</title> 4086 <variablelist> 4087 <varlistentry> 4088 <term><parameter>substream</parameter></term> 4089 <listitem> 4090 <para> 4091 PCM substream 4092 </para> 4093 </listitem> 4094 </varlistentry> 4095 <varlistentry> 4096 <term><parameter>flags</parameter></term> 4097 <listitem> 4098 <para> 4099 irq flags 4100 </para> 4101 </listitem> 4102 </varlistentry> 4103 </variablelist> 4104</refsect1> 4105<refsect1> 4106<title>Description</title> 4107<para> 4108 This is a counter-part of <function>snd_pcm_stream_lock_irqsave</function>. 4109</para> 4110</refsect1> 4111</refentry> 4112 4113<refentry id="API-snd-pcm-stop"> 4114<refentryinfo> 4115 <title>LINUX</title> 4116 <productname>Kernel Hackers Manual</productname> 4117 <date>July 2017</date> 4118</refentryinfo> 4119<refmeta> 4120 <refentrytitle><phrase>snd_pcm_stop</phrase></refentrytitle> 4121 <manvolnum>9</manvolnum> 4122 <refmiscinfo class="version">4.1.27</refmiscinfo> 4123</refmeta> 4124<refnamediv> 4125 <refname>snd_pcm_stop</refname> 4126 <refpurpose> 4127 try to stop all running streams in the substream group 4128 </refpurpose> 4129</refnamediv> 4130<refsynopsisdiv> 4131 <title>Synopsis</title> 4132 <funcsynopsis><funcprototype> 4133 <funcdef>int <function>snd_pcm_stop </function></funcdef> 4134 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4135 <paramdef>snd_pcm_state_t <parameter>state</parameter></paramdef> 4136 </funcprototype></funcsynopsis> 4137</refsynopsisdiv> 4138<refsect1> 4139 <title>Arguments</title> 4140 <variablelist> 4141 <varlistentry> 4142 <term><parameter>substream</parameter></term> 4143 <listitem> 4144 <para> 4145 the PCM substream instance 4146 </para> 4147 </listitem> 4148 </varlistentry> 4149 <varlistentry> 4150 <term><parameter>state</parameter></term> 4151 <listitem> 4152 <para> 4153 PCM state after stopping the stream 4154 </para> 4155 </listitem> 4156 </varlistentry> 4157 </variablelist> 4158</refsect1> 4159<refsect1> 4160<title>Description</title> 4161<para> 4162 The state of each stream is then changed to the given state unconditionally. 4163</para> 4164</refsect1> 4165<refsect1> 4166<title>Return</title> 4167<para> 4168 Zero if successful, or a negative error code. 4169</para> 4170</refsect1> 4171</refentry> 4172 4173<refentry id="API-snd-pcm-stop-xrun"> 4174<refentryinfo> 4175 <title>LINUX</title> 4176 <productname>Kernel Hackers Manual</productname> 4177 <date>July 2017</date> 4178</refentryinfo> 4179<refmeta> 4180 <refentrytitle><phrase>snd_pcm_stop_xrun</phrase></refentrytitle> 4181 <manvolnum>9</manvolnum> 4182 <refmiscinfo class="version">4.1.27</refmiscinfo> 4183</refmeta> 4184<refnamediv> 4185 <refname>snd_pcm_stop_xrun</refname> 4186 <refpurpose> 4187 stop the running streams as XRUN 4188 </refpurpose> 4189</refnamediv> 4190<refsynopsisdiv> 4191 <title>Synopsis</title> 4192 <funcsynopsis><funcprototype> 4193 <funcdef>int <function>snd_pcm_stop_xrun </function></funcdef> 4194 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4195 </funcprototype></funcsynopsis> 4196</refsynopsisdiv> 4197<refsect1> 4198 <title>Arguments</title> 4199 <variablelist> 4200 <varlistentry> 4201 <term><parameter>substream</parameter></term> 4202 <listitem> 4203 <para> 4204 the PCM substream instance 4205 </para> 4206 </listitem> 4207 </varlistentry> 4208 </variablelist> 4209</refsect1> 4210<refsect1> 4211<title>Description</title> 4212<para> 4213 This stops the given running substream (and all linked substreams) as XRUN. 4214 Unlike <function>snd_pcm_stop</function>, this function takes the substream lock by itself. 4215</para> 4216</refsect1> 4217<refsect1> 4218<title>Return</title> 4219<para> 4220 Zero if successful, or a negative error code. 4221</para> 4222</refsect1> 4223</refentry> 4224 4225<refentry id="API-snd-pcm-suspend"> 4226<refentryinfo> 4227 <title>LINUX</title> 4228 <productname>Kernel Hackers Manual</productname> 4229 <date>July 2017</date> 4230</refentryinfo> 4231<refmeta> 4232 <refentrytitle><phrase>snd_pcm_suspend</phrase></refentrytitle> 4233 <manvolnum>9</manvolnum> 4234 <refmiscinfo class="version">4.1.27</refmiscinfo> 4235</refmeta> 4236<refnamediv> 4237 <refname>snd_pcm_suspend</refname> 4238 <refpurpose> 4239 trigger SUSPEND to all linked streams 4240 </refpurpose> 4241</refnamediv> 4242<refsynopsisdiv> 4243 <title>Synopsis</title> 4244 <funcsynopsis><funcprototype> 4245 <funcdef>int <function>snd_pcm_suspend </function></funcdef> 4246 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4247 </funcprototype></funcsynopsis> 4248</refsynopsisdiv> 4249<refsect1> 4250 <title>Arguments</title> 4251 <variablelist> 4252 <varlistentry> 4253 <term><parameter>substream</parameter></term> 4254 <listitem> 4255 <para> 4256 the PCM substream 4257 </para> 4258 </listitem> 4259 </varlistentry> 4260 </variablelist> 4261</refsect1> 4262<refsect1> 4263<title>Description</title> 4264<para> 4265 After this call, all streams are changed to SUSPENDED state. 4266</para> 4267</refsect1> 4268<refsect1> 4269<title>Return</title> 4270<para> 4271 Zero if successful (or <parameter>substream</parameter> is <constant>NULL</constant>), or a negative error 4272 code. 4273</para> 4274</refsect1> 4275</refentry> 4276 4277<refentry id="API-snd-pcm-suspend-all"> 4278<refentryinfo> 4279 <title>LINUX</title> 4280 <productname>Kernel Hackers Manual</productname> 4281 <date>July 2017</date> 4282</refentryinfo> 4283<refmeta> 4284 <refentrytitle><phrase>snd_pcm_suspend_all</phrase></refentrytitle> 4285 <manvolnum>9</manvolnum> 4286 <refmiscinfo class="version">4.1.27</refmiscinfo> 4287</refmeta> 4288<refnamediv> 4289 <refname>snd_pcm_suspend_all</refname> 4290 <refpurpose> 4291 trigger SUSPEND to all substreams in the given pcm 4292 </refpurpose> 4293</refnamediv> 4294<refsynopsisdiv> 4295 <title>Synopsis</title> 4296 <funcsynopsis><funcprototype> 4297 <funcdef>int <function>snd_pcm_suspend_all </function></funcdef> 4298 <paramdef>struct snd_pcm * <parameter>pcm</parameter></paramdef> 4299 </funcprototype></funcsynopsis> 4300</refsynopsisdiv> 4301<refsect1> 4302 <title>Arguments</title> 4303 <variablelist> 4304 <varlistentry> 4305 <term><parameter>pcm</parameter></term> 4306 <listitem> 4307 <para> 4308 the PCM instance 4309 </para> 4310 </listitem> 4311 </varlistentry> 4312 </variablelist> 4313</refsect1> 4314<refsect1> 4315<title>Description</title> 4316<para> 4317 After this call, all streams are changed to SUSPENDED state. 4318</para> 4319</refsect1> 4320<refsect1> 4321<title>Return</title> 4322<para> 4323 Zero if successful (or <parameter>pcm</parameter> is <constant>NULL</constant>), or a negative error code. 4324</para> 4325</refsect1> 4326</refentry> 4327 4328<refentry id="API-snd-pcm-lib-default-mmap"> 4329<refentryinfo> 4330 <title>LINUX</title> 4331 <productname>Kernel Hackers Manual</productname> 4332 <date>July 2017</date> 4333</refentryinfo> 4334<refmeta> 4335 <refentrytitle><phrase>snd_pcm_lib_default_mmap</phrase></refentrytitle> 4336 <manvolnum>9</manvolnum> 4337 <refmiscinfo class="version">4.1.27</refmiscinfo> 4338</refmeta> 4339<refnamediv> 4340 <refname>snd_pcm_lib_default_mmap</refname> 4341 <refpurpose> 4342 Default PCM data mmap function 4343 </refpurpose> 4344</refnamediv> 4345<refsynopsisdiv> 4346 <title>Synopsis</title> 4347 <funcsynopsis><funcprototype> 4348 <funcdef>int <function>snd_pcm_lib_default_mmap </function></funcdef> 4349 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4350 <paramdef>struct vm_area_struct * <parameter>area</parameter></paramdef> 4351 </funcprototype></funcsynopsis> 4352</refsynopsisdiv> 4353<refsect1> 4354 <title>Arguments</title> 4355 <variablelist> 4356 <varlistentry> 4357 <term><parameter>substream</parameter></term> 4358 <listitem> 4359 <para> 4360 PCM substream 4361 </para> 4362 </listitem> 4363 </varlistentry> 4364 <varlistentry> 4365 <term><parameter>area</parameter></term> 4366 <listitem> 4367 <para> 4368 VMA 4369 </para> 4370 </listitem> 4371 </varlistentry> 4372 </variablelist> 4373</refsect1> 4374<refsect1> 4375<title>Description</title> 4376<para> 4377 This is the default mmap handler for PCM data. When mmap pcm_ops is NULL, 4378 this function is invoked implicitly. 4379</para> 4380</refsect1> 4381</refentry> 4382 4383<refentry id="API-snd-pcm-lib-mmap-iomem"> 4384<refentryinfo> 4385 <title>LINUX</title> 4386 <productname>Kernel Hackers Manual</productname> 4387 <date>July 2017</date> 4388</refentryinfo> 4389<refmeta> 4390 <refentrytitle><phrase>snd_pcm_lib_mmap_iomem</phrase></refentrytitle> 4391 <manvolnum>9</manvolnum> 4392 <refmiscinfo class="version">4.1.27</refmiscinfo> 4393</refmeta> 4394<refnamediv> 4395 <refname>snd_pcm_lib_mmap_iomem</refname> 4396 <refpurpose> 4397 Default PCM data mmap function for I/O mem 4398 </refpurpose> 4399</refnamediv> 4400<refsynopsisdiv> 4401 <title>Synopsis</title> 4402 <funcsynopsis><funcprototype> 4403 <funcdef>int <function>snd_pcm_lib_mmap_iomem </function></funcdef> 4404 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4405 <paramdef>struct vm_area_struct * <parameter>area</parameter></paramdef> 4406 </funcprototype></funcsynopsis> 4407</refsynopsisdiv> 4408<refsect1> 4409 <title>Arguments</title> 4410 <variablelist> 4411 <varlistentry> 4412 <term><parameter>substream</parameter></term> 4413 <listitem> 4414 <para> 4415 PCM substream 4416 </para> 4417 </listitem> 4418 </varlistentry> 4419 <varlistentry> 4420 <term><parameter>area</parameter></term> 4421 <listitem> 4422 <para> 4423 VMA 4424 </para> 4425 </listitem> 4426 </varlistentry> 4427 </variablelist> 4428</refsect1> 4429<refsect1> 4430<title>Description</title> 4431<para> 4432 When your hardware uses the iomapped pages as the hardware buffer and 4433 wants to mmap it, pass this function as mmap pcm_ops. Note that this 4434 is supposed to work only on limited architectures. 4435</para> 4436</refsect1> 4437</refentry> 4438 4439<!-- include/sound/pcm.h --> 4440<refentry id="API-snd-pcm-stream-linked"> 4441<refentryinfo> 4442 <title>LINUX</title> 4443 <productname>Kernel Hackers Manual</productname> 4444 <date>July 2017</date> 4445</refentryinfo> 4446<refmeta> 4447 <refentrytitle><phrase>snd_pcm_stream_linked</phrase></refentrytitle> 4448 <manvolnum>9</manvolnum> 4449 <refmiscinfo class="version">4.1.27</refmiscinfo> 4450</refmeta> 4451<refnamediv> 4452 <refname>snd_pcm_stream_linked</refname> 4453 <refpurpose> 4454 Check whether the substream is linked with others 4455 </refpurpose> 4456</refnamediv> 4457<refsynopsisdiv> 4458 <title>Synopsis</title> 4459 <funcsynopsis><funcprototype> 4460 <funcdef>int <function>snd_pcm_stream_linked </function></funcdef> 4461 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4462 </funcprototype></funcsynopsis> 4463</refsynopsisdiv> 4464<refsect1> 4465 <title>Arguments</title> 4466 <variablelist> 4467 <varlistentry> 4468 <term><parameter>substream</parameter></term> 4469 <listitem> 4470 <para> 4471 substream to check 4472 </para> 4473 </listitem> 4474 </varlistentry> 4475 </variablelist> 4476</refsect1> 4477<refsect1> 4478<title>Description</title> 4479<para> 4480 Returns true if the given substream is being linked with others. 4481</para> 4482</refsect1> 4483</refentry> 4484 4485<refentry id="API-snd-pcm-stream-lock-irqsave"> 4486<refentryinfo> 4487 <title>LINUX</title> 4488 <productname>Kernel Hackers Manual</productname> 4489 <date>July 2017</date> 4490</refentryinfo> 4491<refmeta> 4492 <refentrytitle><phrase>snd_pcm_stream_lock_irqsave</phrase></refentrytitle> 4493 <manvolnum>9</manvolnum> 4494 <refmiscinfo class="version">4.1.27</refmiscinfo> 4495</refmeta> 4496<refnamediv> 4497 <refname>snd_pcm_stream_lock_irqsave</refname> 4498 <refpurpose> 4499 Lock the PCM stream 4500 </refpurpose> 4501</refnamediv> 4502<refsynopsisdiv> 4503 <title>Synopsis</title> 4504 <funcsynopsis><funcprototype> 4505 <funcdef> <function>snd_pcm_stream_lock_irqsave </function></funcdef> 4506 <paramdef> <parameter>substream</parameter></paramdef> 4507 <paramdef> <parameter>flags</parameter></paramdef> 4508 </funcprototype></funcsynopsis> 4509</refsynopsisdiv> 4510<refsect1> 4511 <title>Arguments</title> 4512 <variablelist> 4513 <varlistentry> 4514 <term><parameter>substream</parameter></term> 4515 <listitem> 4516 <para> 4517 PCM substream 4518 </para> 4519 </listitem> 4520 </varlistentry> 4521 <varlistentry> 4522 <term><parameter>flags</parameter></term> 4523 <listitem> 4524 <para> 4525 irq flags 4526 </para> 4527 </listitem> 4528 </varlistentry> 4529 </variablelist> 4530</refsect1> 4531<refsect1> 4532<title>Description</title> 4533<para> 4534 This locks the PCM stream like <function>snd_pcm_stream_lock</function> but with the local 4535 IRQ (only when nonatomic is false). In nonatomic case, this is identical 4536 as <function>snd_pcm_stream_lock</function>. 4537</para> 4538</refsect1> 4539</refentry> 4540 4541<refentry id="API-snd-pcm-group-for-each-entry"> 4542<refentryinfo> 4543 <title>LINUX</title> 4544 <productname>Kernel Hackers Manual</productname> 4545 <date>July 2017</date> 4546</refentryinfo> 4547<refmeta> 4548 <refentrytitle><phrase>snd_pcm_group_for_each_entry</phrase></refentrytitle> 4549 <manvolnum>9</manvolnum> 4550 <refmiscinfo class="version">4.1.27</refmiscinfo> 4551</refmeta> 4552<refnamediv> 4553 <refname>snd_pcm_group_for_each_entry</refname> 4554 <refpurpose> 4555 iterate over the linked substreams 4556 </refpurpose> 4557</refnamediv> 4558<refsynopsisdiv> 4559 <title>Synopsis</title> 4560 <funcsynopsis><funcprototype> 4561 <funcdef> <function>snd_pcm_group_for_each_entry </function></funcdef> 4562 <paramdef> <parameter>s</parameter></paramdef> 4563 <paramdef> <parameter>substream</parameter></paramdef> 4564 </funcprototype></funcsynopsis> 4565</refsynopsisdiv> 4566<refsect1> 4567 <title>Arguments</title> 4568 <variablelist> 4569 <varlistentry> 4570 <term><parameter>s</parameter></term> 4571 <listitem> 4572 <para> 4573 the iterator 4574 </para> 4575 </listitem> 4576 </varlistentry> 4577 <varlistentry> 4578 <term><parameter>substream</parameter></term> 4579 <listitem> 4580 <para> 4581 the substream 4582 </para> 4583 </listitem> 4584 </varlistentry> 4585 </variablelist> 4586</refsect1> 4587<refsect1> 4588<title>Description</title> 4589<para> 4590 Iterate over the all linked substreams to the given <parameter>substream</parameter>. 4591 When <parameter>substream</parameter> isn't linked with any others, this gives returns <parameter>substream</parameter> 4592 itself once. 4593</para> 4594</refsect1> 4595</refentry> 4596 4597<refentry id="API-snd-pcm-running"> 4598<refentryinfo> 4599 <title>LINUX</title> 4600 <productname>Kernel Hackers Manual</productname> 4601 <date>July 2017</date> 4602</refentryinfo> 4603<refmeta> 4604 <refentrytitle><phrase>snd_pcm_running</phrase></refentrytitle> 4605 <manvolnum>9</manvolnum> 4606 <refmiscinfo class="version">4.1.27</refmiscinfo> 4607</refmeta> 4608<refnamediv> 4609 <refname>snd_pcm_running</refname> 4610 <refpurpose> 4611 Check whether the substream is in a running state 4612 </refpurpose> 4613</refnamediv> 4614<refsynopsisdiv> 4615 <title>Synopsis</title> 4616 <funcsynopsis><funcprototype> 4617 <funcdef>int <function>snd_pcm_running </function></funcdef> 4618 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4619 </funcprototype></funcsynopsis> 4620</refsynopsisdiv> 4621<refsect1> 4622 <title>Arguments</title> 4623 <variablelist> 4624 <varlistentry> 4625 <term><parameter>substream</parameter></term> 4626 <listitem> 4627 <para> 4628 substream to check 4629 </para> 4630 </listitem> 4631 </varlistentry> 4632 </variablelist> 4633</refsect1> 4634<refsect1> 4635<title>Description</title> 4636<para> 4637 Returns true if the given substream is in the state RUNNING, or in the 4638 state DRAINING for playback. 4639</para> 4640</refsect1> 4641</refentry> 4642 4643<refentry id="API-bytes-to-samples"> 4644<refentryinfo> 4645 <title>LINUX</title> 4646 <productname>Kernel Hackers Manual</productname> 4647 <date>July 2017</date> 4648</refentryinfo> 4649<refmeta> 4650 <refentrytitle><phrase>bytes_to_samples</phrase></refentrytitle> 4651 <manvolnum>9</manvolnum> 4652 <refmiscinfo class="version">4.1.27</refmiscinfo> 4653</refmeta> 4654<refnamediv> 4655 <refname>bytes_to_samples</refname> 4656 <refpurpose> 4657 Unit conversion of the size from bytes to samples 4658 </refpurpose> 4659</refnamediv> 4660<refsynopsisdiv> 4661 <title>Synopsis</title> 4662 <funcsynopsis><funcprototype> 4663 <funcdef>ssize_t <function>bytes_to_samples </function></funcdef> 4664 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 4665 <paramdef>ssize_t <parameter>size</parameter></paramdef> 4666 </funcprototype></funcsynopsis> 4667</refsynopsisdiv> 4668<refsect1> 4669 <title>Arguments</title> 4670 <variablelist> 4671 <varlistentry> 4672 <term><parameter>runtime</parameter></term> 4673 <listitem> 4674 <para> 4675 PCM runtime instance 4676 </para> 4677 </listitem> 4678 </varlistentry> 4679 <varlistentry> 4680 <term><parameter>size</parameter></term> 4681 <listitem> 4682 <para> 4683 size in bytes 4684 </para> 4685 </listitem> 4686 </varlistentry> 4687 </variablelist> 4688</refsect1> 4689</refentry> 4690 4691<refentry id="API-bytes-to-frames"> 4692<refentryinfo> 4693 <title>LINUX</title> 4694 <productname>Kernel Hackers Manual</productname> 4695 <date>July 2017</date> 4696</refentryinfo> 4697<refmeta> 4698 <refentrytitle><phrase>bytes_to_frames</phrase></refentrytitle> 4699 <manvolnum>9</manvolnum> 4700 <refmiscinfo class="version">4.1.27</refmiscinfo> 4701</refmeta> 4702<refnamediv> 4703 <refname>bytes_to_frames</refname> 4704 <refpurpose> 4705 Unit conversion of the size from bytes to frames 4706 </refpurpose> 4707</refnamediv> 4708<refsynopsisdiv> 4709 <title>Synopsis</title> 4710 <funcsynopsis><funcprototype> 4711 <funcdef>snd_pcm_sframes_t <function>bytes_to_frames </function></funcdef> 4712 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 4713 <paramdef>ssize_t <parameter>size</parameter></paramdef> 4714 </funcprototype></funcsynopsis> 4715</refsynopsisdiv> 4716<refsect1> 4717 <title>Arguments</title> 4718 <variablelist> 4719 <varlistentry> 4720 <term><parameter>runtime</parameter></term> 4721 <listitem> 4722 <para> 4723 PCM runtime instance 4724 </para> 4725 </listitem> 4726 </varlistentry> 4727 <varlistentry> 4728 <term><parameter>size</parameter></term> 4729 <listitem> 4730 <para> 4731 size in bytes 4732 </para> 4733 </listitem> 4734 </varlistentry> 4735 </variablelist> 4736</refsect1> 4737</refentry> 4738 4739<refentry id="API-samples-to-bytes"> 4740<refentryinfo> 4741 <title>LINUX</title> 4742 <productname>Kernel Hackers Manual</productname> 4743 <date>July 2017</date> 4744</refentryinfo> 4745<refmeta> 4746 <refentrytitle><phrase>samples_to_bytes</phrase></refentrytitle> 4747 <manvolnum>9</manvolnum> 4748 <refmiscinfo class="version">4.1.27</refmiscinfo> 4749</refmeta> 4750<refnamediv> 4751 <refname>samples_to_bytes</refname> 4752 <refpurpose> 4753 Unit conversion of the size from samples to bytes 4754 </refpurpose> 4755</refnamediv> 4756<refsynopsisdiv> 4757 <title>Synopsis</title> 4758 <funcsynopsis><funcprototype> 4759 <funcdef>ssize_t <function>samples_to_bytes </function></funcdef> 4760 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 4761 <paramdef>ssize_t <parameter>size</parameter></paramdef> 4762 </funcprototype></funcsynopsis> 4763</refsynopsisdiv> 4764<refsect1> 4765 <title>Arguments</title> 4766 <variablelist> 4767 <varlistentry> 4768 <term><parameter>runtime</parameter></term> 4769 <listitem> 4770 <para> 4771 PCM runtime instance 4772 </para> 4773 </listitem> 4774 </varlistentry> 4775 <varlistentry> 4776 <term><parameter>size</parameter></term> 4777 <listitem> 4778 <para> 4779 size in samples 4780 </para> 4781 </listitem> 4782 </varlistentry> 4783 </variablelist> 4784</refsect1> 4785</refentry> 4786 4787<refentry id="API-frames-to-bytes"> 4788<refentryinfo> 4789 <title>LINUX</title> 4790 <productname>Kernel Hackers Manual</productname> 4791 <date>July 2017</date> 4792</refentryinfo> 4793<refmeta> 4794 <refentrytitle><phrase>frames_to_bytes</phrase></refentrytitle> 4795 <manvolnum>9</manvolnum> 4796 <refmiscinfo class="version">4.1.27</refmiscinfo> 4797</refmeta> 4798<refnamediv> 4799 <refname>frames_to_bytes</refname> 4800 <refpurpose> 4801 Unit conversion of the size from frames to bytes 4802 </refpurpose> 4803</refnamediv> 4804<refsynopsisdiv> 4805 <title>Synopsis</title> 4806 <funcsynopsis><funcprototype> 4807 <funcdef>ssize_t <function>frames_to_bytes </function></funcdef> 4808 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 4809 <paramdef>snd_pcm_sframes_t <parameter>size</parameter></paramdef> 4810 </funcprototype></funcsynopsis> 4811</refsynopsisdiv> 4812<refsect1> 4813 <title>Arguments</title> 4814 <variablelist> 4815 <varlistentry> 4816 <term><parameter>runtime</parameter></term> 4817 <listitem> 4818 <para> 4819 PCM runtime instance 4820 </para> 4821 </listitem> 4822 </varlistentry> 4823 <varlistentry> 4824 <term><parameter>size</parameter></term> 4825 <listitem> 4826 <para> 4827 size in frames 4828 </para> 4829 </listitem> 4830 </varlistentry> 4831 </variablelist> 4832</refsect1> 4833</refentry> 4834 4835<refentry id="API-frame-aligned"> 4836<refentryinfo> 4837 <title>LINUX</title> 4838 <productname>Kernel Hackers Manual</productname> 4839 <date>July 2017</date> 4840</refentryinfo> 4841<refmeta> 4842 <refentrytitle><phrase>frame_aligned</phrase></refentrytitle> 4843 <manvolnum>9</manvolnum> 4844 <refmiscinfo class="version">4.1.27</refmiscinfo> 4845</refmeta> 4846<refnamediv> 4847 <refname>frame_aligned</refname> 4848 <refpurpose> 4849 Check whether the byte size is aligned to frames 4850 </refpurpose> 4851</refnamediv> 4852<refsynopsisdiv> 4853 <title>Synopsis</title> 4854 <funcsynopsis><funcprototype> 4855 <funcdef>int <function>frame_aligned </function></funcdef> 4856 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 4857 <paramdef>ssize_t <parameter>bytes</parameter></paramdef> 4858 </funcprototype></funcsynopsis> 4859</refsynopsisdiv> 4860<refsect1> 4861 <title>Arguments</title> 4862 <variablelist> 4863 <varlistentry> 4864 <term><parameter>runtime</parameter></term> 4865 <listitem> 4866 <para> 4867 PCM runtime instance 4868 </para> 4869 </listitem> 4870 </varlistentry> 4871 <varlistentry> 4872 <term><parameter>bytes</parameter></term> 4873 <listitem> 4874 <para> 4875 size in bytes 4876 </para> 4877 </listitem> 4878 </varlistentry> 4879 </variablelist> 4880</refsect1> 4881</refentry> 4882 4883<refentry id="API-snd-pcm-lib-buffer-bytes"> 4884<refentryinfo> 4885 <title>LINUX</title> 4886 <productname>Kernel Hackers Manual</productname> 4887 <date>July 2017</date> 4888</refentryinfo> 4889<refmeta> 4890 <refentrytitle><phrase>snd_pcm_lib_buffer_bytes</phrase></refentrytitle> 4891 <manvolnum>9</manvolnum> 4892 <refmiscinfo class="version">4.1.27</refmiscinfo> 4893</refmeta> 4894<refnamediv> 4895 <refname>snd_pcm_lib_buffer_bytes</refname> 4896 <refpurpose> 4897 Get the buffer size of the current PCM in bytes 4898 </refpurpose> 4899</refnamediv> 4900<refsynopsisdiv> 4901 <title>Synopsis</title> 4902 <funcsynopsis><funcprototype> 4903 <funcdef>size_t <function>snd_pcm_lib_buffer_bytes </function></funcdef> 4904 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4905 </funcprototype></funcsynopsis> 4906</refsynopsisdiv> 4907<refsect1> 4908 <title>Arguments</title> 4909 <variablelist> 4910 <varlistentry> 4911 <term><parameter>substream</parameter></term> 4912 <listitem> 4913 <para> 4914 PCM substream 4915 </para> 4916 </listitem> 4917 </varlistentry> 4918 </variablelist> 4919</refsect1> 4920</refentry> 4921 4922<refentry id="API-snd-pcm-lib-period-bytes"> 4923<refentryinfo> 4924 <title>LINUX</title> 4925 <productname>Kernel Hackers Manual</productname> 4926 <date>July 2017</date> 4927</refentryinfo> 4928<refmeta> 4929 <refentrytitle><phrase>snd_pcm_lib_period_bytes</phrase></refentrytitle> 4930 <manvolnum>9</manvolnum> 4931 <refmiscinfo class="version">4.1.27</refmiscinfo> 4932</refmeta> 4933<refnamediv> 4934 <refname>snd_pcm_lib_period_bytes</refname> 4935 <refpurpose> 4936 Get the period size of the current PCM in bytes 4937 </refpurpose> 4938</refnamediv> 4939<refsynopsisdiv> 4940 <title>Synopsis</title> 4941 <funcsynopsis><funcprototype> 4942 <funcdef>size_t <function>snd_pcm_lib_period_bytes </function></funcdef> 4943 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 4944 </funcprototype></funcsynopsis> 4945</refsynopsisdiv> 4946<refsect1> 4947 <title>Arguments</title> 4948 <variablelist> 4949 <varlistentry> 4950 <term><parameter>substream</parameter></term> 4951 <listitem> 4952 <para> 4953 PCM substream 4954 </para> 4955 </listitem> 4956 </varlistentry> 4957 </variablelist> 4958</refsect1> 4959</refentry> 4960 4961<refentry id="API-snd-pcm-playback-avail"> 4962<refentryinfo> 4963 <title>LINUX</title> 4964 <productname>Kernel Hackers Manual</productname> 4965 <date>July 2017</date> 4966</refentryinfo> 4967<refmeta> 4968 <refentrytitle><phrase>snd_pcm_playback_avail</phrase></refentrytitle> 4969 <manvolnum>9</manvolnum> 4970 <refmiscinfo class="version">4.1.27</refmiscinfo> 4971</refmeta> 4972<refnamediv> 4973 <refname>snd_pcm_playback_avail</refname> 4974 <refpurpose> 4975 Get the available (writable) space for playback 4976 </refpurpose> 4977</refnamediv> 4978<refsynopsisdiv> 4979 <title>Synopsis</title> 4980 <funcsynopsis><funcprototype> 4981 <funcdef>snd_pcm_uframes_t <function>snd_pcm_playback_avail </function></funcdef> 4982 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 4983 </funcprototype></funcsynopsis> 4984</refsynopsisdiv> 4985<refsect1> 4986 <title>Arguments</title> 4987 <variablelist> 4988 <varlistentry> 4989 <term><parameter>runtime</parameter></term> 4990 <listitem> 4991 <para> 4992 PCM runtime instance 4993 </para> 4994 </listitem> 4995 </varlistentry> 4996 </variablelist> 4997</refsect1> 4998<refsect1> 4999<title>Description</title> 5000<para> 5001 Result is between 0 ... (boundary - 1) 5002</para> 5003</refsect1> 5004</refentry> 5005 5006<refentry id="API-snd-pcm-capture-avail"> 5007<refentryinfo> 5008 <title>LINUX</title> 5009 <productname>Kernel Hackers Manual</productname> 5010 <date>July 2017</date> 5011</refentryinfo> 5012<refmeta> 5013 <refentrytitle><phrase>snd_pcm_capture_avail</phrase></refentrytitle> 5014 <manvolnum>9</manvolnum> 5015 <refmiscinfo class="version">4.1.27</refmiscinfo> 5016</refmeta> 5017<refnamediv> 5018 <refname>snd_pcm_capture_avail</refname> 5019 <refpurpose> 5020 Get the available (readable) space for capture 5021 </refpurpose> 5022</refnamediv> 5023<refsynopsisdiv> 5024 <title>Synopsis</title> 5025 <funcsynopsis><funcprototype> 5026 <funcdef>snd_pcm_uframes_t <function>snd_pcm_capture_avail </function></funcdef> 5027 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 5028 </funcprototype></funcsynopsis> 5029</refsynopsisdiv> 5030<refsect1> 5031 <title>Arguments</title> 5032 <variablelist> 5033 <varlistentry> 5034 <term><parameter>runtime</parameter></term> 5035 <listitem> 5036 <para> 5037 PCM runtime instance 5038 </para> 5039 </listitem> 5040 </varlistentry> 5041 </variablelist> 5042</refsect1> 5043<refsect1> 5044<title>Description</title> 5045<para> 5046 Result is between 0 ... (boundary - 1) 5047</para> 5048</refsect1> 5049</refentry> 5050 5051<refentry id="API-snd-pcm-playback-hw-avail"> 5052<refentryinfo> 5053 <title>LINUX</title> 5054 <productname>Kernel Hackers Manual</productname> 5055 <date>July 2017</date> 5056</refentryinfo> 5057<refmeta> 5058 <refentrytitle><phrase>snd_pcm_playback_hw_avail</phrase></refentrytitle> 5059 <manvolnum>9</manvolnum> 5060 <refmiscinfo class="version">4.1.27</refmiscinfo> 5061</refmeta> 5062<refnamediv> 5063 <refname>snd_pcm_playback_hw_avail</refname> 5064 <refpurpose> 5065 Get the queued space for playback 5066 </refpurpose> 5067</refnamediv> 5068<refsynopsisdiv> 5069 <title>Synopsis</title> 5070 <funcsynopsis><funcprototype> 5071 <funcdef>snd_pcm_sframes_t <function>snd_pcm_playback_hw_avail </function></funcdef> 5072 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 5073 </funcprototype></funcsynopsis> 5074</refsynopsisdiv> 5075<refsect1> 5076 <title>Arguments</title> 5077 <variablelist> 5078 <varlistentry> 5079 <term><parameter>runtime</parameter></term> 5080 <listitem> 5081 <para> 5082 PCM runtime instance 5083 </para> 5084 </listitem> 5085 </varlistentry> 5086 </variablelist> 5087</refsect1> 5088</refentry> 5089 5090<refentry id="API-snd-pcm-capture-hw-avail"> 5091<refentryinfo> 5092 <title>LINUX</title> 5093 <productname>Kernel Hackers Manual</productname> 5094 <date>July 2017</date> 5095</refentryinfo> 5096<refmeta> 5097 <refentrytitle><phrase>snd_pcm_capture_hw_avail</phrase></refentrytitle> 5098 <manvolnum>9</manvolnum> 5099 <refmiscinfo class="version">4.1.27</refmiscinfo> 5100</refmeta> 5101<refnamediv> 5102 <refname>snd_pcm_capture_hw_avail</refname> 5103 <refpurpose> 5104 Get the free space for capture 5105 </refpurpose> 5106</refnamediv> 5107<refsynopsisdiv> 5108 <title>Synopsis</title> 5109 <funcsynopsis><funcprototype> 5110 <funcdef>snd_pcm_sframes_t <function>snd_pcm_capture_hw_avail </function></funcdef> 5111 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 5112 </funcprototype></funcsynopsis> 5113</refsynopsisdiv> 5114<refsect1> 5115 <title>Arguments</title> 5116 <variablelist> 5117 <varlistentry> 5118 <term><parameter>runtime</parameter></term> 5119 <listitem> 5120 <para> 5121 PCM runtime instance 5122 </para> 5123 </listitem> 5124 </varlistentry> 5125 </variablelist> 5126</refsect1> 5127</refentry> 5128 5129<refentry id="API-snd-pcm-playback-ready"> 5130<refentryinfo> 5131 <title>LINUX</title> 5132 <productname>Kernel Hackers Manual</productname> 5133 <date>July 2017</date> 5134</refentryinfo> 5135<refmeta> 5136 <refentrytitle><phrase>snd_pcm_playback_ready</phrase></refentrytitle> 5137 <manvolnum>9</manvolnum> 5138 <refmiscinfo class="version">4.1.27</refmiscinfo> 5139</refmeta> 5140<refnamediv> 5141 <refname>snd_pcm_playback_ready</refname> 5142 <refpurpose> 5143 check whether the playback buffer is available 5144 </refpurpose> 5145</refnamediv> 5146<refsynopsisdiv> 5147 <title>Synopsis</title> 5148 <funcsynopsis><funcprototype> 5149 <funcdef>int <function>snd_pcm_playback_ready </function></funcdef> 5150 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 5151 </funcprototype></funcsynopsis> 5152</refsynopsisdiv> 5153<refsect1> 5154 <title>Arguments</title> 5155 <variablelist> 5156 <varlistentry> 5157 <term><parameter>substream</parameter></term> 5158 <listitem> 5159 <para> 5160 the pcm substream instance 5161 </para> 5162 </listitem> 5163 </varlistentry> 5164 </variablelist> 5165</refsect1> 5166<refsect1> 5167<title>Description</title> 5168<para> 5169 Checks whether enough free space is available on the playback buffer. 5170</para> 5171</refsect1> 5172<refsect1> 5173<title>Return</title> 5174<para> 5175 Non-zero if available, or zero if not. 5176</para> 5177</refsect1> 5178</refentry> 5179 5180<refentry id="API-snd-pcm-capture-ready"> 5181<refentryinfo> 5182 <title>LINUX</title> 5183 <productname>Kernel Hackers Manual</productname> 5184 <date>July 2017</date> 5185</refentryinfo> 5186<refmeta> 5187 <refentrytitle><phrase>snd_pcm_capture_ready</phrase></refentrytitle> 5188 <manvolnum>9</manvolnum> 5189 <refmiscinfo class="version">4.1.27</refmiscinfo> 5190</refmeta> 5191<refnamediv> 5192 <refname>snd_pcm_capture_ready</refname> 5193 <refpurpose> 5194 check whether the capture buffer is available 5195 </refpurpose> 5196</refnamediv> 5197<refsynopsisdiv> 5198 <title>Synopsis</title> 5199 <funcsynopsis><funcprototype> 5200 <funcdef>int <function>snd_pcm_capture_ready </function></funcdef> 5201 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 5202 </funcprototype></funcsynopsis> 5203</refsynopsisdiv> 5204<refsect1> 5205 <title>Arguments</title> 5206 <variablelist> 5207 <varlistentry> 5208 <term><parameter>substream</parameter></term> 5209 <listitem> 5210 <para> 5211 the pcm substream instance 5212 </para> 5213 </listitem> 5214 </varlistentry> 5215 </variablelist> 5216</refsect1> 5217<refsect1> 5218<title>Description</title> 5219<para> 5220 Checks whether enough capture data is available on the capture buffer. 5221</para> 5222</refsect1> 5223<refsect1> 5224<title>Return</title> 5225<para> 5226 Non-zero if available, or zero if not. 5227</para> 5228</refsect1> 5229</refentry> 5230 5231<refentry id="API-snd-pcm-playback-data"> 5232<refentryinfo> 5233 <title>LINUX</title> 5234 <productname>Kernel Hackers Manual</productname> 5235 <date>July 2017</date> 5236</refentryinfo> 5237<refmeta> 5238 <refentrytitle><phrase>snd_pcm_playback_data</phrase></refentrytitle> 5239 <manvolnum>9</manvolnum> 5240 <refmiscinfo class="version">4.1.27</refmiscinfo> 5241</refmeta> 5242<refnamediv> 5243 <refname>snd_pcm_playback_data</refname> 5244 <refpurpose> 5245 check whether any data exists on the playback buffer 5246 </refpurpose> 5247</refnamediv> 5248<refsynopsisdiv> 5249 <title>Synopsis</title> 5250 <funcsynopsis><funcprototype> 5251 <funcdef>int <function>snd_pcm_playback_data </function></funcdef> 5252 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 5253 </funcprototype></funcsynopsis> 5254</refsynopsisdiv> 5255<refsect1> 5256 <title>Arguments</title> 5257 <variablelist> 5258 <varlistentry> 5259 <term><parameter>substream</parameter></term> 5260 <listitem> 5261 <para> 5262 the pcm substream instance 5263 </para> 5264 </listitem> 5265 </varlistentry> 5266 </variablelist> 5267</refsect1> 5268<refsect1> 5269<title>Description</title> 5270<para> 5271 Checks whether any data exists on the playback buffer. 5272</para> 5273</refsect1> 5274<refsect1> 5275<title>Return</title> 5276<para> 5277 Non-zero if any data exists, or zero if not. If stop_threshold 5278 is bigger or equal to boundary, then this function returns always non-zero. 5279</para> 5280</refsect1> 5281</refentry> 5282 5283<refentry id="API-snd-pcm-playback-empty"> 5284<refentryinfo> 5285 <title>LINUX</title> 5286 <productname>Kernel Hackers Manual</productname> 5287 <date>July 2017</date> 5288</refentryinfo> 5289<refmeta> 5290 <refentrytitle><phrase>snd_pcm_playback_empty</phrase></refentrytitle> 5291 <manvolnum>9</manvolnum> 5292 <refmiscinfo class="version">4.1.27</refmiscinfo> 5293</refmeta> 5294<refnamediv> 5295 <refname>snd_pcm_playback_empty</refname> 5296 <refpurpose> 5297 check whether the playback buffer is empty 5298 </refpurpose> 5299</refnamediv> 5300<refsynopsisdiv> 5301 <title>Synopsis</title> 5302 <funcsynopsis><funcprototype> 5303 <funcdef>int <function>snd_pcm_playback_empty </function></funcdef> 5304 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 5305 </funcprototype></funcsynopsis> 5306</refsynopsisdiv> 5307<refsect1> 5308 <title>Arguments</title> 5309 <variablelist> 5310 <varlistentry> 5311 <term><parameter>substream</parameter></term> 5312 <listitem> 5313 <para> 5314 the pcm substream instance 5315 </para> 5316 </listitem> 5317 </varlistentry> 5318 </variablelist> 5319</refsect1> 5320<refsect1> 5321<title>Description</title> 5322<para> 5323 Checks whether the playback buffer is empty. 5324</para> 5325</refsect1> 5326<refsect1> 5327<title>Return</title> 5328<para> 5329 Non-zero if empty, or zero if not. 5330</para> 5331</refsect1> 5332</refentry> 5333 5334<refentry id="API-snd-pcm-capture-empty"> 5335<refentryinfo> 5336 <title>LINUX</title> 5337 <productname>Kernel Hackers Manual</productname> 5338 <date>July 2017</date> 5339</refentryinfo> 5340<refmeta> 5341 <refentrytitle><phrase>snd_pcm_capture_empty</phrase></refentrytitle> 5342 <manvolnum>9</manvolnum> 5343 <refmiscinfo class="version">4.1.27</refmiscinfo> 5344</refmeta> 5345<refnamediv> 5346 <refname>snd_pcm_capture_empty</refname> 5347 <refpurpose> 5348 check whether the capture buffer is empty 5349 </refpurpose> 5350</refnamediv> 5351<refsynopsisdiv> 5352 <title>Synopsis</title> 5353 <funcsynopsis><funcprototype> 5354 <funcdef>int <function>snd_pcm_capture_empty </function></funcdef> 5355 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 5356 </funcprototype></funcsynopsis> 5357</refsynopsisdiv> 5358<refsect1> 5359 <title>Arguments</title> 5360 <variablelist> 5361 <varlistentry> 5362 <term><parameter>substream</parameter></term> 5363 <listitem> 5364 <para> 5365 the pcm substream instance 5366 </para> 5367 </listitem> 5368 </varlistentry> 5369 </variablelist> 5370</refsect1> 5371<refsect1> 5372<title>Description</title> 5373<para> 5374 Checks whether the capture buffer is empty. 5375</para> 5376</refsect1> 5377<refsect1> 5378<title>Return</title> 5379<para> 5380 Non-zero if empty, or zero if not. 5381</para> 5382</refsect1> 5383</refentry> 5384 5385<refentry id="API-snd-pcm-trigger-done"> 5386<refentryinfo> 5387 <title>LINUX</title> 5388 <productname>Kernel Hackers Manual</productname> 5389 <date>July 2017</date> 5390</refentryinfo> 5391<refmeta> 5392 <refentrytitle><phrase>snd_pcm_trigger_done</phrase></refentrytitle> 5393 <manvolnum>9</manvolnum> 5394 <refmiscinfo class="version">4.1.27</refmiscinfo> 5395</refmeta> 5396<refnamediv> 5397 <refname>snd_pcm_trigger_done</refname> 5398 <refpurpose> 5399 Mark the master substream 5400 </refpurpose> 5401</refnamediv> 5402<refsynopsisdiv> 5403 <title>Synopsis</title> 5404 <funcsynopsis><funcprototype> 5405 <funcdef>void <function>snd_pcm_trigger_done </function></funcdef> 5406 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 5407 <paramdef>struct snd_pcm_substream * <parameter>master</parameter></paramdef> 5408 </funcprototype></funcsynopsis> 5409</refsynopsisdiv> 5410<refsect1> 5411 <title>Arguments</title> 5412 <variablelist> 5413 <varlistentry> 5414 <term><parameter>substream</parameter></term> 5415 <listitem> 5416 <para> 5417 the pcm substream instance 5418 </para> 5419 </listitem> 5420 </varlistentry> 5421 <varlistentry> 5422 <term><parameter>master</parameter></term> 5423 <listitem> 5424 <para> 5425 the linked master substream 5426 </para> 5427 </listitem> 5428 </varlistentry> 5429 </variablelist> 5430</refsect1> 5431<refsect1> 5432<title>Description</title> 5433<para> 5434 When multiple substreams of the same card are linked and the hardware 5435 supports the single-shot operation, the driver calls this in the loop 5436 in <function>snd_pcm_group_for_each_entry</function> for marking the substream as <quote>done</quote>. 5437 Then most of trigger operations are performed only to the given master 5438 substream. 5439 </para><para> 5440 5441 The trigger_master mark is cleared at timestamp updates at the end 5442 of trigger operations. 5443</para> 5444</refsect1> 5445</refentry> 5446 5447<refentry id="API-params-channels"> 5448<refentryinfo> 5449 <title>LINUX</title> 5450 <productname>Kernel Hackers Manual</productname> 5451 <date>July 2017</date> 5452</refentryinfo> 5453<refmeta> 5454 <refentrytitle><phrase>params_channels</phrase></refentrytitle> 5455 <manvolnum>9</manvolnum> 5456 <refmiscinfo class="version">4.1.27</refmiscinfo> 5457</refmeta> 5458<refnamediv> 5459 <refname>params_channels</refname> 5460 <refpurpose> 5461 Get the number of channels from the hw params 5462 </refpurpose> 5463</refnamediv> 5464<refsynopsisdiv> 5465 <title>Synopsis</title> 5466 <funcsynopsis><funcprototype> 5467 <funcdef>unsigned int <function>params_channels </function></funcdef> 5468 <paramdef>const struct snd_pcm_hw_params * <parameter>p</parameter></paramdef> 5469 </funcprototype></funcsynopsis> 5470</refsynopsisdiv> 5471<refsect1> 5472 <title>Arguments</title> 5473 <variablelist> 5474 <varlistentry> 5475 <term><parameter>p</parameter></term> 5476 <listitem> 5477 <para> 5478 hw params 5479 </para> 5480 </listitem> 5481 </varlistentry> 5482 </variablelist> 5483</refsect1> 5484</refentry> 5485 5486<refentry id="API-params-rate"> 5487<refentryinfo> 5488 <title>LINUX</title> 5489 <productname>Kernel Hackers Manual</productname> 5490 <date>July 2017</date> 5491</refentryinfo> 5492<refmeta> 5493 <refentrytitle><phrase>params_rate</phrase></refentrytitle> 5494 <manvolnum>9</manvolnum> 5495 <refmiscinfo class="version">4.1.27</refmiscinfo> 5496</refmeta> 5497<refnamediv> 5498 <refname>params_rate</refname> 5499 <refpurpose> 5500 Get the sample rate from the hw params 5501 </refpurpose> 5502</refnamediv> 5503<refsynopsisdiv> 5504 <title>Synopsis</title> 5505 <funcsynopsis><funcprototype> 5506 <funcdef>unsigned int <function>params_rate </function></funcdef> 5507 <paramdef>const struct snd_pcm_hw_params * <parameter>p</parameter></paramdef> 5508 </funcprototype></funcsynopsis> 5509</refsynopsisdiv> 5510<refsect1> 5511 <title>Arguments</title> 5512 <variablelist> 5513 <varlistentry> 5514 <term><parameter>p</parameter></term> 5515 <listitem> 5516 <para> 5517 hw params 5518 </para> 5519 </listitem> 5520 </varlistentry> 5521 </variablelist> 5522</refsect1> 5523</refentry> 5524 5525<refentry id="API-params-period-size"> 5526<refentryinfo> 5527 <title>LINUX</title> 5528 <productname>Kernel Hackers Manual</productname> 5529 <date>July 2017</date> 5530</refentryinfo> 5531<refmeta> 5532 <refentrytitle><phrase>params_period_size</phrase></refentrytitle> 5533 <manvolnum>9</manvolnum> 5534 <refmiscinfo class="version">4.1.27</refmiscinfo> 5535</refmeta> 5536<refnamediv> 5537 <refname>params_period_size</refname> 5538 <refpurpose> 5539 Get the period size (in frames) from the hw params 5540 </refpurpose> 5541</refnamediv> 5542<refsynopsisdiv> 5543 <title>Synopsis</title> 5544 <funcsynopsis><funcprototype> 5545 <funcdef>unsigned int <function>params_period_size </function></funcdef> 5546 <paramdef>const struct snd_pcm_hw_params * <parameter>p</parameter></paramdef> 5547 </funcprototype></funcsynopsis> 5548</refsynopsisdiv> 5549<refsect1> 5550 <title>Arguments</title> 5551 <variablelist> 5552 <varlistentry> 5553 <term><parameter>p</parameter></term> 5554 <listitem> 5555 <para> 5556 hw params 5557 </para> 5558 </listitem> 5559 </varlistentry> 5560 </variablelist> 5561</refsect1> 5562</refentry> 5563 5564<refentry id="API-params-periods"> 5565<refentryinfo> 5566 <title>LINUX</title> 5567 <productname>Kernel Hackers Manual</productname> 5568 <date>July 2017</date> 5569</refentryinfo> 5570<refmeta> 5571 <refentrytitle><phrase>params_periods</phrase></refentrytitle> 5572 <manvolnum>9</manvolnum> 5573 <refmiscinfo class="version">4.1.27</refmiscinfo> 5574</refmeta> 5575<refnamediv> 5576 <refname>params_periods</refname> 5577 <refpurpose> 5578 Get the number of periods from the hw params 5579 </refpurpose> 5580</refnamediv> 5581<refsynopsisdiv> 5582 <title>Synopsis</title> 5583 <funcsynopsis><funcprototype> 5584 <funcdef>unsigned int <function>params_periods </function></funcdef> 5585 <paramdef>const struct snd_pcm_hw_params * <parameter>p</parameter></paramdef> 5586 </funcprototype></funcsynopsis> 5587</refsynopsisdiv> 5588<refsect1> 5589 <title>Arguments</title> 5590 <variablelist> 5591 <varlistentry> 5592 <term><parameter>p</parameter></term> 5593 <listitem> 5594 <para> 5595 hw params 5596 </para> 5597 </listitem> 5598 </varlistentry> 5599 </variablelist> 5600</refsect1> 5601</refentry> 5602 5603<refentry id="API-params-buffer-size"> 5604<refentryinfo> 5605 <title>LINUX</title> 5606 <productname>Kernel Hackers Manual</productname> 5607 <date>July 2017</date> 5608</refentryinfo> 5609<refmeta> 5610 <refentrytitle><phrase>params_buffer_size</phrase></refentrytitle> 5611 <manvolnum>9</manvolnum> 5612 <refmiscinfo class="version">4.1.27</refmiscinfo> 5613</refmeta> 5614<refnamediv> 5615 <refname>params_buffer_size</refname> 5616 <refpurpose> 5617 Get the buffer size (in frames) from the hw params 5618 </refpurpose> 5619</refnamediv> 5620<refsynopsisdiv> 5621 <title>Synopsis</title> 5622 <funcsynopsis><funcprototype> 5623 <funcdef>unsigned int <function>params_buffer_size </function></funcdef> 5624 <paramdef>const struct snd_pcm_hw_params * <parameter>p</parameter></paramdef> 5625 </funcprototype></funcsynopsis> 5626</refsynopsisdiv> 5627<refsect1> 5628 <title>Arguments</title> 5629 <variablelist> 5630 <varlistentry> 5631 <term><parameter>p</parameter></term> 5632 <listitem> 5633 <para> 5634 hw params 5635 </para> 5636 </listitem> 5637 </varlistentry> 5638 </variablelist> 5639</refsect1> 5640</refentry> 5641 5642<refentry id="API-params-buffer-bytes"> 5643<refentryinfo> 5644 <title>LINUX</title> 5645 <productname>Kernel Hackers Manual</productname> 5646 <date>July 2017</date> 5647</refentryinfo> 5648<refmeta> 5649 <refentrytitle><phrase>params_buffer_bytes</phrase></refentrytitle> 5650 <manvolnum>9</manvolnum> 5651 <refmiscinfo class="version">4.1.27</refmiscinfo> 5652</refmeta> 5653<refnamediv> 5654 <refname>params_buffer_bytes</refname> 5655 <refpurpose> 5656 Get the buffer size (in bytes) from the hw params 5657 </refpurpose> 5658</refnamediv> 5659<refsynopsisdiv> 5660 <title>Synopsis</title> 5661 <funcsynopsis><funcprototype> 5662 <funcdef>unsigned int <function>params_buffer_bytes </function></funcdef> 5663 <paramdef>const struct snd_pcm_hw_params * <parameter>p</parameter></paramdef> 5664 </funcprototype></funcsynopsis> 5665</refsynopsisdiv> 5666<refsect1> 5667 <title>Arguments</title> 5668 <variablelist> 5669 <varlistentry> 5670 <term><parameter>p</parameter></term> 5671 <listitem> 5672 <para> 5673 hw params 5674 </para> 5675 </listitem> 5676 </varlistentry> 5677 </variablelist> 5678</refsect1> 5679</refentry> 5680 5681<refentry id="API-snd-pcm-format-cpu-endian"> 5682<refentryinfo> 5683 <title>LINUX</title> 5684 <productname>Kernel Hackers Manual</productname> 5685 <date>July 2017</date> 5686</refentryinfo> 5687<refmeta> 5688 <refentrytitle><phrase>snd_pcm_format_cpu_endian</phrase></refentrytitle> 5689 <manvolnum>9</manvolnum> 5690 <refmiscinfo class="version">4.1.27</refmiscinfo> 5691</refmeta> 5692<refnamediv> 5693 <refname>snd_pcm_format_cpu_endian</refname> 5694 <refpurpose> 5695 Check the PCM format is CPU-endian 5696 </refpurpose> 5697</refnamediv> 5698<refsynopsisdiv> 5699 <title>Synopsis</title> 5700 <funcsynopsis><funcprototype> 5701 <funcdef>int <function>snd_pcm_format_cpu_endian </function></funcdef> 5702 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 5703 </funcprototype></funcsynopsis> 5704</refsynopsisdiv> 5705<refsect1> 5706 <title>Arguments</title> 5707 <variablelist> 5708 <varlistentry> 5709 <term><parameter>format</parameter></term> 5710 <listitem> 5711 <para> 5712 the format to check 5713 </para> 5714 </listitem> 5715 </varlistentry> 5716 </variablelist> 5717</refsect1> 5718<refsect1> 5719<title>Return</title> 5720<para> 5721 1 if the given PCM format is CPU-endian, 0 if 5722 opposite, or a negative error code if endian not specified. 5723</para> 5724</refsect1> 5725</refentry> 5726 5727<refentry id="API-snd-pcm-set-runtime-buffer"> 5728<refentryinfo> 5729 <title>LINUX</title> 5730 <productname>Kernel Hackers Manual</productname> 5731 <date>July 2017</date> 5732</refentryinfo> 5733<refmeta> 5734 <refentrytitle><phrase>snd_pcm_set_runtime_buffer</phrase></refentrytitle> 5735 <manvolnum>9</manvolnum> 5736 <refmiscinfo class="version">4.1.27</refmiscinfo> 5737</refmeta> 5738<refnamediv> 5739 <refname>snd_pcm_set_runtime_buffer</refname> 5740 <refpurpose> 5741 Set the PCM runtime buffer 5742 </refpurpose> 5743</refnamediv> 5744<refsynopsisdiv> 5745 <title>Synopsis</title> 5746 <funcsynopsis><funcprototype> 5747 <funcdef>void <function>snd_pcm_set_runtime_buffer </function></funcdef> 5748 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 5749 <paramdef>struct snd_dma_buffer * <parameter>bufp</parameter></paramdef> 5750 </funcprototype></funcsynopsis> 5751</refsynopsisdiv> 5752<refsect1> 5753 <title>Arguments</title> 5754 <variablelist> 5755 <varlistentry> 5756 <term><parameter>substream</parameter></term> 5757 <listitem> 5758 <para> 5759 PCM substream to set 5760 </para> 5761 </listitem> 5762 </varlistentry> 5763 <varlistentry> 5764 <term><parameter>bufp</parameter></term> 5765 <listitem> 5766 <para> 5767 the buffer information, NULL to clear 5768 </para> 5769 </listitem> 5770 </varlistentry> 5771 </variablelist> 5772</refsect1> 5773<refsect1> 5774<title>Description</title> 5775<para> 5776 Copy the buffer information to runtime->dma_buffer when <parameter>bufp</parameter> is non-NULL. 5777 Otherwise it clears the current buffer information. 5778</para> 5779</refsect1> 5780</refentry> 5781 5782<refentry id="API-snd-pcm-gettime"> 5783<refentryinfo> 5784 <title>LINUX</title> 5785 <productname>Kernel Hackers Manual</productname> 5786 <date>July 2017</date> 5787</refentryinfo> 5788<refmeta> 5789 <refentrytitle><phrase>snd_pcm_gettime</phrase></refentrytitle> 5790 <manvolnum>9</manvolnum> 5791 <refmiscinfo class="version">4.1.27</refmiscinfo> 5792</refmeta> 5793<refnamediv> 5794 <refname>snd_pcm_gettime</refname> 5795 <refpurpose> 5796 Fill the timespec depending on the timestamp mode 5797 </refpurpose> 5798</refnamediv> 5799<refsynopsisdiv> 5800 <title>Synopsis</title> 5801 <funcsynopsis><funcprototype> 5802 <funcdef>void <function>snd_pcm_gettime </function></funcdef> 5803 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 5804 <paramdef>struct timespec * <parameter>tv</parameter></paramdef> 5805 </funcprototype></funcsynopsis> 5806</refsynopsisdiv> 5807<refsect1> 5808 <title>Arguments</title> 5809 <variablelist> 5810 <varlistentry> 5811 <term><parameter>runtime</parameter></term> 5812 <listitem> 5813 <para> 5814 PCM runtime instance 5815 </para> 5816 </listitem> 5817 </varlistentry> 5818 <varlistentry> 5819 <term><parameter>tv</parameter></term> 5820 <listitem> 5821 <para> 5822 timespec to fill 5823 </para> 5824 </listitem> 5825 </varlistentry> 5826 </variablelist> 5827</refsect1> 5828</refentry> 5829 5830<refentry id="API-snd-pcm-lib-alloc-vmalloc-buffer"> 5831<refentryinfo> 5832 <title>LINUX</title> 5833 <productname>Kernel Hackers Manual</productname> 5834 <date>July 2017</date> 5835</refentryinfo> 5836<refmeta> 5837 <refentrytitle><phrase>snd_pcm_lib_alloc_vmalloc_buffer</phrase></refentrytitle> 5838 <manvolnum>9</manvolnum> 5839 <refmiscinfo class="version">4.1.27</refmiscinfo> 5840</refmeta> 5841<refnamediv> 5842 <refname>snd_pcm_lib_alloc_vmalloc_buffer</refname> 5843 <refpurpose> 5844 allocate virtual DMA buffer 5845 </refpurpose> 5846</refnamediv> 5847<refsynopsisdiv> 5848 <title>Synopsis</title> 5849 <funcsynopsis><funcprototype> 5850 <funcdef>int <function>snd_pcm_lib_alloc_vmalloc_buffer </function></funcdef> 5851 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 5852 <paramdef>size_t <parameter>size</parameter></paramdef> 5853 </funcprototype></funcsynopsis> 5854</refsynopsisdiv> 5855<refsect1> 5856 <title>Arguments</title> 5857 <variablelist> 5858 <varlistentry> 5859 <term><parameter>substream</parameter></term> 5860 <listitem> 5861 <para> 5862 the substream to allocate the buffer to 5863 </para> 5864 </listitem> 5865 </varlistentry> 5866 <varlistentry> 5867 <term><parameter>size</parameter></term> 5868 <listitem> 5869 <para> 5870 the requested buffer size, in bytes 5871 </para> 5872 </listitem> 5873 </varlistentry> 5874 </variablelist> 5875</refsect1> 5876<refsect1> 5877<title>Description</title> 5878<para> 5879 Allocates the PCM substream buffer using <function>vmalloc</function>, i.e., the memory is 5880 contiguous in kernel virtual space, but not in physical memory. Use this 5881 if the buffer is accessed by kernel code but not by device DMA. 5882</para> 5883</refsect1> 5884<refsect1> 5885<title>Return</title> 5886<para> 5887 1 if the buffer was changed, 0 if not changed, or a negative error 5888 code. 5889</para> 5890</refsect1> 5891</refentry> 5892 5893<refentry id="API-snd-pcm-lib-alloc-vmalloc-32-buffer"> 5894<refentryinfo> 5895 <title>LINUX</title> 5896 <productname>Kernel Hackers Manual</productname> 5897 <date>July 2017</date> 5898</refentryinfo> 5899<refmeta> 5900 <refentrytitle><phrase>snd_pcm_lib_alloc_vmalloc_32_buffer</phrase></refentrytitle> 5901 <manvolnum>9</manvolnum> 5902 <refmiscinfo class="version">4.1.27</refmiscinfo> 5903</refmeta> 5904<refnamediv> 5905 <refname>snd_pcm_lib_alloc_vmalloc_32_buffer</refname> 5906 <refpurpose> 5907 allocate 32-bit-addressable buffer 5908 </refpurpose> 5909</refnamediv> 5910<refsynopsisdiv> 5911 <title>Synopsis</title> 5912 <funcsynopsis><funcprototype> 5913 <funcdef>int <function>snd_pcm_lib_alloc_vmalloc_32_buffer </function></funcdef> 5914 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 5915 <paramdef>size_t <parameter>size</parameter></paramdef> 5916 </funcprototype></funcsynopsis> 5917</refsynopsisdiv> 5918<refsect1> 5919 <title>Arguments</title> 5920 <variablelist> 5921 <varlistentry> 5922 <term><parameter>substream</parameter></term> 5923 <listitem> 5924 <para> 5925 the substream to allocate the buffer to 5926 </para> 5927 </listitem> 5928 </varlistentry> 5929 <varlistentry> 5930 <term><parameter>size</parameter></term> 5931 <listitem> 5932 <para> 5933 the requested buffer size, in bytes 5934 </para> 5935 </listitem> 5936 </varlistentry> 5937 </variablelist> 5938</refsect1> 5939<refsect1> 5940<title>Description</title> 5941<para> 5942 This function works like <function>snd_pcm_lib_alloc_vmalloc_buffer</function>, but uses 5943 <function>vmalloc_32</function>, i.e., the pages are allocated from 32-bit-addressable memory. 5944</para> 5945</refsect1> 5946<refsect1> 5947<title>Return</title> 5948<para> 5949 1 if the buffer was changed, 0 if not changed, or a negative error 5950 code. 5951</para> 5952</refsect1> 5953</refentry> 5954 5955<refentry id="API-snd-pcm-sgbuf-get-addr"> 5956<refentryinfo> 5957 <title>LINUX</title> 5958 <productname>Kernel Hackers Manual</productname> 5959 <date>July 2017</date> 5960</refentryinfo> 5961<refmeta> 5962 <refentrytitle><phrase>snd_pcm_sgbuf_get_addr</phrase></refentrytitle> 5963 <manvolnum>9</manvolnum> 5964 <refmiscinfo class="version">4.1.27</refmiscinfo> 5965</refmeta> 5966<refnamediv> 5967 <refname>snd_pcm_sgbuf_get_addr</refname> 5968 <refpurpose> 5969 Get the DMA address at the corresponding offset 5970 </refpurpose> 5971</refnamediv> 5972<refsynopsisdiv> 5973 <title>Synopsis</title> 5974 <funcsynopsis><funcprototype> 5975 <funcdef>dma_addr_t <function>snd_pcm_sgbuf_get_addr </function></funcdef> 5976 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 5977 <paramdef>unsigned int <parameter>ofs</parameter></paramdef> 5978 </funcprototype></funcsynopsis> 5979</refsynopsisdiv> 5980<refsect1> 5981 <title>Arguments</title> 5982 <variablelist> 5983 <varlistentry> 5984 <term><parameter>substream</parameter></term> 5985 <listitem> 5986 <para> 5987 PCM substream 5988 </para> 5989 </listitem> 5990 </varlistentry> 5991 <varlistentry> 5992 <term><parameter>ofs</parameter></term> 5993 <listitem> 5994 <para> 5995 byte offset 5996 </para> 5997 </listitem> 5998 </varlistentry> 5999 </variablelist> 6000</refsect1> 6001</refentry> 6002 6003<refentry id="API-snd-pcm-sgbuf-get-ptr"> 6004<refentryinfo> 6005 <title>LINUX</title> 6006 <productname>Kernel Hackers Manual</productname> 6007 <date>July 2017</date> 6008</refentryinfo> 6009<refmeta> 6010 <refentrytitle><phrase>snd_pcm_sgbuf_get_ptr</phrase></refentrytitle> 6011 <manvolnum>9</manvolnum> 6012 <refmiscinfo class="version">4.1.27</refmiscinfo> 6013</refmeta> 6014<refnamediv> 6015 <refname>snd_pcm_sgbuf_get_ptr</refname> 6016 <refpurpose> 6017 Get the virtual address at the corresponding offset 6018 </refpurpose> 6019</refnamediv> 6020<refsynopsisdiv> 6021 <title>Synopsis</title> 6022 <funcsynopsis><funcprototype> 6023 <funcdef>void * <function>snd_pcm_sgbuf_get_ptr </function></funcdef> 6024 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 6025 <paramdef>unsigned int <parameter>ofs</parameter></paramdef> 6026 </funcprototype></funcsynopsis> 6027</refsynopsisdiv> 6028<refsect1> 6029 <title>Arguments</title> 6030 <variablelist> 6031 <varlistentry> 6032 <term><parameter>substream</parameter></term> 6033 <listitem> 6034 <para> 6035 PCM substream 6036 </para> 6037 </listitem> 6038 </varlistentry> 6039 <varlistentry> 6040 <term><parameter>ofs</parameter></term> 6041 <listitem> 6042 <para> 6043 byte offset 6044 </para> 6045 </listitem> 6046 </varlistentry> 6047 </variablelist> 6048</refsect1> 6049</refentry> 6050 6051<refentry id="API-snd-pcm-sgbuf-get-chunk-size"> 6052<refentryinfo> 6053 <title>LINUX</title> 6054 <productname>Kernel Hackers Manual</productname> 6055 <date>July 2017</date> 6056</refentryinfo> 6057<refmeta> 6058 <refentrytitle><phrase>snd_pcm_sgbuf_get_chunk_size</phrase></refentrytitle> 6059 <manvolnum>9</manvolnum> 6060 <refmiscinfo class="version">4.1.27</refmiscinfo> 6061</refmeta> 6062<refnamediv> 6063 <refname>snd_pcm_sgbuf_get_chunk_size</refname> 6064 <refpurpose> 6065 Compute the max size that fits within the contig. page from the given size 6066 </refpurpose> 6067</refnamediv> 6068<refsynopsisdiv> 6069 <title>Synopsis</title> 6070 <funcsynopsis><funcprototype> 6071 <funcdef>unsigned int <function>snd_pcm_sgbuf_get_chunk_size </function></funcdef> 6072 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 6073 <paramdef>unsigned int <parameter>ofs</parameter></paramdef> 6074 <paramdef>unsigned int <parameter>size</parameter></paramdef> 6075 </funcprototype></funcsynopsis> 6076</refsynopsisdiv> 6077<refsect1> 6078 <title>Arguments</title> 6079 <variablelist> 6080 <varlistentry> 6081 <term><parameter>substream</parameter></term> 6082 <listitem> 6083 <para> 6084 PCM substream 6085 </para> 6086 </listitem> 6087 </varlistentry> 6088 <varlistentry> 6089 <term><parameter>ofs</parameter></term> 6090 <listitem> 6091 <para> 6092 byte offset 6093 </para> 6094 </listitem> 6095 </varlistentry> 6096 <varlistentry> 6097 <term><parameter>size</parameter></term> 6098 <listitem> 6099 <para> 6100 byte size to examine 6101 </para> 6102 </listitem> 6103 </varlistentry> 6104 </variablelist> 6105</refsect1> 6106</refentry> 6107 6108<refentry id="API-snd-pcm-mmap-data-open"> 6109<refentryinfo> 6110 <title>LINUX</title> 6111 <productname>Kernel Hackers Manual</productname> 6112 <date>July 2017</date> 6113</refentryinfo> 6114<refmeta> 6115 <refentrytitle><phrase>snd_pcm_mmap_data_open</phrase></refentrytitle> 6116 <manvolnum>9</manvolnum> 6117 <refmiscinfo class="version">4.1.27</refmiscinfo> 6118</refmeta> 6119<refnamediv> 6120 <refname>snd_pcm_mmap_data_open</refname> 6121 <refpurpose> 6122 increase the mmap counter 6123 </refpurpose> 6124</refnamediv> 6125<refsynopsisdiv> 6126 <title>Synopsis</title> 6127 <funcsynopsis><funcprototype> 6128 <funcdef>void <function>snd_pcm_mmap_data_open </function></funcdef> 6129 <paramdef>struct vm_area_struct * <parameter>area</parameter></paramdef> 6130 </funcprototype></funcsynopsis> 6131</refsynopsisdiv> 6132<refsect1> 6133 <title>Arguments</title> 6134 <variablelist> 6135 <varlistentry> 6136 <term><parameter>area</parameter></term> 6137 <listitem> 6138 <para> 6139 VMA 6140 </para> 6141 </listitem> 6142 </varlistentry> 6143 </variablelist> 6144</refsect1> 6145<refsect1> 6146<title>Description</title> 6147<para> 6148 PCM mmap callback should handle this counter properly 6149</para> 6150</refsect1> 6151</refentry> 6152 6153<refentry id="API-snd-pcm-mmap-data-close"> 6154<refentryinfo> 6155 <title>LINUX</title> 6156 <productname>Kernel Hackers Manual</productname> 6157 <date>July 2017</date> 6158</refentryinfo> 6159<refmeta> 6160 <refentrytitle><phrase>snd_pcm_mmap_data_close</phrase></refentrytitle> 6161 <manvolnum>9</manvolnum> 6162 <refmiscinfo class="version">4.1.27</refmiscinfo> 6163</refmeta> 6164<refnamediv> 6165 <refname>snd_pcm_mmap_data_close</refname> 6166 <refpurpose> 6167 decrease the mmap counter 6168 </refpurpose> 6169</refnamediv> 6170<refsynopsisdiv> 6171 <title>Synopsis</title> 6172 <funcsynopsis><funcprototype> 6173 <funcdef>void <function>snd_pcm_mmap_data_close </function></funcdef> 6174 <paramdef>struct vm_area_struct * <parameter>area</parameter></paramdef> 6175 </funcprototype></funcsynopsis> 6176</refsynopsisdiv> 6177<refsect1> 6178 <title>Arguments</title> 6179 <variablelist> 6180 <varlistentry> 6181 <term><parameter>area</parameter></term> 6182 <listitem> 6183 <para> 6184 VMA 6185 </para> 6186 </listitem> 6187 </varlistentry> 6188 </variablelist> 6189</refsect1> 6190<refsect1> 6191<title>Description</title> 6192<para> 6193 PCM mmap callback should handle this counter properly 6194</para> 6195</refsect1> 6196</refentry> 6197 6198<refentry id="API-snd-pcm-limit-isa-dma-size"> 6199<refentryinfo> 6200 <title>LINUX</title> 6201 <productname>Kernel Hackers Manual</productname> 6202 <date>July 2017</date> 6203</refentryinfo> 6204<refmeta> 6205 <refentrytitle><phrase>snd_pcm_limit_isa_dma_size</phrase></refentrytitle> 6206 <manvolnum>9</manvolnum> 6207 <refmiscinfo class="version">4.1.27</refmiscinfo> 6208</refmeta> 6209<refnamediv> 6210 <refname>snd_pcm_limit_isa_dma_size</refname> 6211 <refpurpose> 6212 Get the max size fitting with ISA DMA transfer 6213 </refpurpose> 6214</refnamediv> 6215<refsynopsisdiv> 6216 <title>Synopsis</title> 6217 <funcsynopsis><funcprototype> 6218 <funcdef>void <function>snd_pcm_limit_isa_dma_size </function></funcdef> 6219 <paramdef>int <parameter>dma</parameter></paramdef> 6220 <paramdef>size_t * <parameter>max</parameter></paramdef> 6221 </funcprototype></funcsynopsis> 6222</refsynopsisdiv> 6223<refsect1> 6224 <title>Arguments</title> 6225 <variablelist> 6226 <varlistentry> 6227 <term><parameter>dma</parameter></term> 6228 <listitem> 6229 <para> 6230 DMA number 6231 </para> 6232 </listitem> 6233 </varlistentry> 6234 <varlistentry> 6235 <term><parameter>max</parameter></term> 6236 <listitem> 6237 <para> 6238 pointer to store the max size 6239 </para> 6240 </listitem> 6241 </varlistentry> 6242 </variablelist> 6243</refsect1> 6244</refentry> 6245 6246<refentry id="API-snd-pcm-stream-str"> 6247<refentryinfo> 6248 <title>LINUX</title> 6249 <productname>Kernel Hackers Manual</productname> 6250 <date>July 2017</date> 6251</refentryinfo> 6252<refmeta> 6253 <refentrytitle><phrase>snd_pcm_stream_str</phrase></refentrytitle> 6254 <manvolnum>9</manvolnum> 6255 <refmiscinfo class="version">4.1.27</refmiscinfo> 6256</refmeta> 6257<refnamediv> 6258 <refname>snd_pcm_stream_str</refname> 6259 <refpurpose> 6260 Get a string naming the direction of a stream 6261 </refpurpose> 6262</refnamediv> 6263<refsynopsisdiv> 6264 <title>Synopsis</title> 6265 <funcsynopsis><funcprototype> 6266 <funcdef>const char * <function>snd_pcm_stream_str </function></funcdef> 6267 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 6268 </funcprototype></funcsynopsis> 6269</refsynopsisdiv> 6270<refsect1> 6271 <title>Arguments</title> 6272 <variablelist> 6273 <varlistentry> 6274 <term><parameter>substream</parameter></term> 6275 <listitem> 6276 <para> 6277 the pcm substream instance 6278 </para> 6279 </listitem> 6280 </varlistentry> 6281 </variablelist> 6282</refsect1> 6283<refsect1> 6284<title>Return</title> 6285<para> 6286 A string naming the direction of the stream. 6287</para> 6288</refsect1> 6289</refentry> 6290 6291<refentry id="API-snd-pcm-chmap-substream"> 6292<refentryinfo> 6293 <title>LINUX</title> 6294 <productname>Kernel Hackers Manual</productname> 6295 <date>July 2017</date> 6296</refentryinfo> 6297<refmeta> 6298 <refentrytitle><phrase>snd_pcm_chmap_substream</phrase></refentrytitle> 6299 <manvolnum>9</manvolnum> 6300 <refmiscinfo class="version">4.1.27</refmiscinfo> 6301</refmeta> 6302<refnamediv> 6303 <refname>snd_pcm_chmap_substream</refname> 6304 <refpurpose> 6305 get the PCM substream assigned to the given chmap info 6306 </refpurpose> 6307</refnamediv> 6308<refsynopsisdiv> 6309 <title>Synopsis</title> 6310 <funcsynopsis><funcprototype> 6311 <funcdef>struct snd_pcm_substream * <function>snd_pcm_chmap_substream </function></funcdef> 6312 <paramdef>struct snd_pcm_chmap * <parameter>info</parameter></paramdef> 6313 <paramdef>unsigned int <parameter>idx</parameter></paramdef> 6314 </funcprototype></funcsynopsis> 6315</refsynopsisdiv> 6316<refsect1> 6317 <title>Arguments</title> 6318 <variablelist> 6319 <varlistentry> 6320 <term><parameter>info</parameter></term> 6321 <listitem> 6322 <para> 6323 chmap information 6324 </para> 6325 </listitem> 6326 </varlistentry> 6327 <varlistentry> 6328 <term><parameter>idx</parameter></term> 6329 <listitem> 6330 <para> 6331 the substream number index 6332 </para> 6333 </listitem> 6334 </varlistentry> 6335 </variablelist> 6336</refsect1> 6337</refentry> 6338 6339<refentry id="API-pcm-format-to-bits"> 6340<refentryinfo> 6341 <title>LINUX</title> 6342 <productname>Kernel Hackers Manual</productname> 6343 <date>July 2017</date> 6344</refentryinfo> 6345<refmeta> 6346 <refentrytitle><phrase>pcm_format_to_bits</phrase></refentrytitle> 6347 <manvolnum>9</manvolnum> 6348 <refmiscinfo class="version">4.1.27</refmiscinfo> 6349</refmeta> 6350<refnamediv> 6351 <refname>pcm_format_to_bits</refname> 6352 <refpurpose> 6353 Strong-typed conversion of pcm_format to bitwise 6354 </refpurpose> 6355</refnamediv> 6356<refsynopsisdiv> 6357 <title>Synopsis</title> 6358 <funcsynopsis><funcprototype> 6359 <funcdef>u64 <function>pcm_format_to_bits </function></funcdef> 6360 <paramdef>snd_pcm_format_t <parameter>pcm_format</parameter></paramdef> 6361 </funcprototype></funcsynopsis> 6362</refsynopsisdiv> 6363<refsect1> 6364 <title>Arguments</title> 6365 <variablelist> 6366 <varlistentry> 6367 <term><parameter>pcm_format</parameter></term> 6368 <listitem> 6369 <para> 6370 PCM format 6371 </para> 6372 </listitem> 6373 </varlistentry> 6374 </variablelist> 6375</refsect1> 6376</refentry> 6377 6378 </sect1> 6379 <sect1><title>PCM Format Helpers</title> 6380<!-- sound/core/pcm_misc.c --> 6381<refentry id="API-snd-pcm-format-signed"> 6382<refentryinfo> 6383 <title>LINUX</title> 6384 <productname>Kernel Hackers Manual</productname> 6385 <date>July 2017</date> 6386</refentryinfo> 6387<refmeta> 6388 <refentrytitle><phrase>snd_pcm_format_signed</phrase></refentrytitle> 6389 <manvolnum>9</manvolnum> 6390 <refmiscinfo class="version">4.1.27</refmiscinfo> 6391</refmeta> 6392<refnamediv> 6393 <refname>snd_pcm_format_signed</refname> 6394 <refpurpose> 6395 Check the PCM format is signed linear 6396 </refpurpose> 6397</refnamediv> 6398<refsynopsisdiv> 6399 <title>Synopsis</title> 6400 <funcsynopsis><funcprototype> 6401 <funcdef>int <function>snd_pcm_format_signed </function></funcdef> 6402 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 6403 </funcprototype></funcsynopsis> 6404</refsynopsisdiv> 6405<refsect1> 6406 <title>Arguments</title> 6407 <variablelist> 6408 <varlistentry> 6409 <term><parameter>format</parameter></term> 6410 <listitem> 6411 <para> 6412 the format to check 6413 </para> 6414 </listitem> 6415 </varlistentry> 6416 </variablelist> 6417</refsect1> 6418<refsect1> 6419<title>Return</title> 6420<para> 6421 1 if the given PCM format is signed linear, 0 if unsigned 6422 linear, and a negative error code for non-linear formats. 6423</para> 6424</refsect1> 6425</refentry> 6426 6427<refentry id="API-snd-pcm-format-unsigned"> 6428<refentryinfo> 6429 <title>LINUX</title> 6430 <productname>Kernel Hackers Manual</productname> 6431 <date>July 2017</date> 6432</refentryinfo> 6433<refmeta> 6434 <refentrytitle><phrase>snd_pcm_format_unsigned</phrase></refentrytitle> 6435 <manvolnum>9</manvolnum> 6436 <refmiscinfo class="version">4.1.27</refmiscinfo> 6437</refmeta> 6438<refnamediv> 6439 <refname>snd_pcm_format_unsigned</refname> 6440 <refpurpose> 6441 Check the PCM format is unsigned linear 6442 </refpurpose> 6443</refnamediv> 6444<refsynopsisdiv> 6445 <title>Synopsis</title> 6446 <funcsynopsis><funcprototype> 6447 <funcdef>int <function>snd_pcm_format_unsigned </function></funcdef> 6448 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 6449 </funcprototype></funcsynopsis> 6450</refsynopsisdiv> 6451<refsect1> 6452 <title>Arguments</title> 6453 <variablelist> 6454 <varlistentry> 6455 <term><parameter>format</parameter></term> 6456 <listitem> 6457 <para> 6458 the format to check 6459 </para> 6460 </listitem> 6461 </varlistentry> 6462 </variablelist> 6463</refsect1> 6464<refsect1> 6465<title>Return</title> 6466<para> 6467 1 if the given PCM format is unsigned linear, 0 if signed 6468 linear, and a negative error code for non-linear formats. 6469</para> 6470</refsect1> 6471</refentry> 6472 6473<refentry id="API-snd-pcm-format-linear"> 6474<refentryinfo> 6475 <title>LINUX</title> 6476 <productname>Kernel Hackers Manual</productname> 6477 <date>July 2017</date> 6478</refentryinfo> 6479<refmeta> 6480 <refentrytitle><phrase>snd_pcm_format_linear</phrase></refentrytitle> 6481 <manvolnum>9</manvolnum> 6482 <refmiscinfo class="version">4.1.27</refmiscinfo> 6483</refmeta> 6484<refnamediv> 6485 <refname>snd_pcm_format_linear</refname> 6486 <refpurpose> 6487 Check the PCM format is linear 6488 </refpurpose> 6489</refnamediv> 6490<refsynopsisdiv> 6491 <title>Synopsis</title> 6492 <funcsynopsis><funcprototype> 6493 <funcdef>int <function>snd_pcm_format_linear </function></funcdef> 6494 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 6495 </funcprototype></funcsynopsis> 6496</refsynopsisdiv> 6497<refsect1> 6498 <title>Arguments</title> 6499 <variablelist> 6500 <varlistentry> 6501 <term><parameter>format</parameter></term> 6502 <listitem> 6503 <para> 6504 the format to check 6505 </para> 6506 </listitem> 6507 </varlistentry> 6508 </variablelist> 6509</refsect1> 6510<refsect1> 6511<title>Return</title> 6512<para> 6513 1 if the given PCM format is linear, 0 if not. 6514</para> 6515</refsect1> 6516</refentry> 6517 6518<refentry id="API-snd-pcm-format-little-endian"> 6519<refentryinfo> 6520 <title>LINUX</title> 6521 <productname>Kernel Hackers Manual</productname> 6522 <date>July 2017</date> 6523</refentryinfo> 6524<refmeta> 6525 <refentrytitle><phrase>snd_pcm_format_little_endian</phrase></refentrytitle> 6526 <manvolnum>9</manvolnum> 6527 <refmiscinfo class="version">4.1.27</refmiscinfo> 6528</refmeta> 6529<refnamediv> 6530 <refname>snd_pcm_format_little_endian</refname> 6531 <refpurpose> 6532 Check the PCM format is little-endian 6533 </refpurpose> 6534</refnamediv> 6535<refsynopsisdiv> 6536 <title>Synopsis</title> 6537 <funcsynopsis><funcprototype> 6538 <funcdef>int <function>snd_pcm_format_little_endian </function></funcdef> 6539 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 6540 </funcprototype></funcsynopsis> 6541</refsynopsisdiv> 6542<refsect1> 6543 <title>Arguments</title> 6544 <variablelist> 6545 <varlistentry> 6546 <term><parameter>format</parameter></term> 6547 <listitem> 6548 <para> 6549 the format to check 6550 </para> 6551 </listitem> 6552 </varlistentry> 6553 </variablelist> 6554</refsect1> 6555<refsect1> 6556<title>Return</title> 6557<para> 6558 1 if the given PCM format is little-endian, 0 if 6559 big-endian, or a negative error code if endian not specified. 6560</para> 6561</refsect1> 6562</refentry> 6563 6564<refentry id="API-snd-pcm-format-big-endian"> 6565<refentryinfo> 6566 <title>LINUX</title> 6567 <productname>Kernel Hackers Manual</productname> 6568 <date>July 2017</date> 6569</refentryinfo> 6570<refmeta> 6571 <refentrytitle><phrase>snd_pcm_format_big_endian</phrase></refentrytitle> 6572 <manvolnum>9</manvolnum> 6573 <refmiscinfo class="version">4.1.27</refmiscinfo> 6574</refmeta> 6575<refnamediv> 6576 <refname>snd_pcm_format_big_endian</refname> 6577 <refpurpose> 6578 Check the PCM format is big-endian 6579 </refpurpose> 6580</refnamediv> 6581<refsynopsisdiv> 6582 <title>Synopsis</title> 6583 <funcsynopsis><funcprototype> 6584 <funcdef>int <function>snd_pcm_format_big_endian </function></funcdef> 6585 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 6586 </funcprototype></funcsynopsis> 6587</refsynopsisdiv> 6588<refsect1> 6589 <title>Arguments</title> 6590 <variablelist> 6591 <varlistentry> 6592 <term><parameter>format</parameter></term> 6593 <listitem> 6594 <para> 6595 the format to check 6596 </para> 6597 </listitem> 6598 </varlistentry> 6599 </variablelist> 6600</refsect1> 6601<refsect1> 6602<title>Return</title> 6603<para> 6604 1 if the given PCM format is big-endian, 0 if 6605 little-endian, or a negative error code if endian not specified. 6606</para> 6607</refsect1> 6608</refentry> 6609 6610<refentry id="API-snd-pcm-format-width"> 6611<refentryinfo> 6612 <title>LINUX</title> 6613 <productname>Kernel Hackers Manual</productname> 6614 <date>July 2017</date> 6615</refentryinfo> 6616<refmeta> 6617 <refentrytitle><phrase>snd_pcm_format_width</phrase></refentrytitle> 6618 <manvolnum>9</manvolnum> 6619 <refmiscinfo class="version">4.1.27</refmiscinfo> 6620</refmeta> 6621<refnamediv> 6622 <refname>snd_pcm_format_width</refname> 6623 <refpurpose> 6624 return the bit-width of the format 6625 </refpurpose> 6626</refnamediv> 6627<refsynopsisdiv> 6628 <title>Synopsis</title> 6629 <funcsynopsis><funcprototype> 6630 <funcdef>int <function>snd_pcm_format_width </function></funcdef> 6631 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 6632 </funcprototype></funcsynopsis> 6633</refsynopsisdiv> 6634<refsect1> 6635 <title>Arguments</title> 6636 <variablelist> 6637 <varlistentry> 6638 <term><parameter>format</parameter></term> 6639 <listitem> 6640 <para> 6641 the format to check 6642 </para> 6643 </listitem> 6644 </varlistentry> 6645 </variablelist> 6646</refsect1> 6647<refsect1> 6648<title>Return</title> 6649<para> 6650 The bit-width of the format, or a negative error code 6651 if unknown format. 6652</para> 6653</refsect1> 6654</refentry> 6655 6656<refentry id="API-snd-pcm-format-physical-width"> 6657<refentryinfo> 6658 <title>LINUX</title> 6659 <productname>Kernel Hackers Manual</productname> 6660 <date>July 2017</date> 6661</refentryinfo> 6662<refmeta> 6663 <refentrytitle><phrase>snd_pcm_format_physical_width</phrase></refentrytitle> 6664 <manvolnum>9</manvolnum> 6665 <refmiscinfo class="version">4.1.27</refmiscinfo> 6666</refmeta> 6667<refnamediv> 6668 <refname>snd_pcm_format_physical_width</refname> 6669 <refpurpose> 6670 return the physical bit-width of the format 6671 </refpurpose> 6672</refnamediv> 6673<refsynopsisdiv> 6674 <title>Synopsis</title> 6675 <funcsynopsis><funcprototype> 6676 <funcdef>int <function>snd_pcm_format_physical_width </function></funcdef> 6677 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 6678 </funcprototype></funcsynopsis> 6679</refsynopsisdiv> 6680<refsect1> 6681 <title>Arguments</title> 6682 <variablelist> 6683 <varlistentry> 6684 <term><parameter>format</parameter></term> 6685 <listitem> 6686 <para> 6687 the format to check 6688 </para> 6689 </listitem> 6690 </varlistentry> 6691 </variablelist> 6692</refsect1> 6693<refsect1> 6694<title>Return</title> 6695<para> 6696 The physical bit-width of the format, or a negative error code 6697 if unknown format. 6698</para> 6699</refsect1> 6700</refentry> 6701 6702<refentry id="API-snd-pcm-format-size"> 6703<refentryinfo> 6704 <title>LINUX</title> 6705 <productname>Kernel Hackers Manual</productname> 6706 <date>July 2017</date> 6707</refentryinfo> 6708<refmeta> 6709 <refentrytitle><phrase>snd_pcm_format_size</phrase></refentrytitle> 6710 <manvolnum>9</manvolnum> 6711 <refmiscinfo class="version">4.1.27</refmiscinfo> 6712</refmeta> 6713<refnamediv> 6714 <refname>snd_pcm_format_size</refname> 6715 <refpurpose> 6716 return the byte size of samples on the given format 6717 </refpurpose> 6718</refnamediv> 6719<refsynopsisdiv> 6720 <title>Synopsis</title> 6721 <funcsynopsis><funcprototype> 6722 <funcdef>ssize_t <function>snd_pcm_format_size </function></funcdef> 6723 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 6724 <paramdef>size_t <parameter>samples</parameter></paramdef> 6725 </funcprototype></funcsynopsis> 6726</refsynopsisdiv> 6727<refsect1> 6728 <title>Arguments</title> 6729 <variablelist> 6730 <varlistentry> 6731 <term><parameter>format</parameter></term> 6732 <listitem> 6733 <para> 6734 the format to check 6735 </para> 6736 </listitem> 6737 </varlistentry> 6738 <varlistentry> 6739 <term><parameter>samples</parameter></term> 6740 <listitem> 6741 <para> 6742 sampling rate 6743 </para> 6744 </listitem> 6745 </varlistentry> 6746 </variablelist> 6747</refsect1> 6748<refsect1> 6749<title>Return</title> 6750<para> 6751 The byte size of the given samples for the format, or a 6752 negative error code if unknown format. 6753</para> 6754</refsect1> 6755</refentry> 6756 6757<refentry id="API-snd-pcm-format-silence-64"> 6758<refentryinfo> 6759 <title>LINUX</title> 6760 <productname>Kernel Hackers Manual</productname> 6761 <date>July 2017</date> 6762</refentryinfo> 6763<refmeta> 6764 <refentrytitle><phrase>snd_pcm_format_silence_64</phrase></refentrytitle> 6765 <manvolnum>9</manvolnum> 6766 <refmiscinfo class="version">4.1.27</refmiscinfo> 6767</refmeta> 6768<refnamediv> 6769 <refname>snd_pcm_format_silence_64</refname> 6770 <refpurpose> 6771 return the silent data in 8 bytes array 6772 </refpurpose> 6773</refnamediv> 6774<refsynopsisdiv> 6775 <title>Synopsis</title> 6776 <funcsynopsis><funcprototype> 6777 <funcdef>const unsigned char * <function>snd_pcm_format_silence_64 </function></funcdef> 6778 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 6779 </funcprototype></funcsynopsis> 6780</refsynopsisdiv> 6781<refsect1> 6782 <title>Arguments</title> 6783 <variablelist> 6784 <varlistentry> 6785 <term><parameter>format</parameter></term> 6786 <listitem> 6787 <para> 6788 the format to check 6789 </para> 6790 </listitem> 6791 </varlistentry> 6792 </variablelist> 6793</refsect1> 6794<refsect1> 6795<title>Return</title> 6796<para> 6797 The format pattern to fill or <constant>NULL</constant> if error. 6798</para> 6799</refsect1> 6800</refentry> 6801 6802<refentry id="API-snd-pcm-format-set-silence"> 6803<refentryinfo> 6804 <title>LINUX</title> 6805 <productname>Kernel Hackers Manual</productname> 6806 <date>July 2017</date> 6807</refentryinfo> 6808<refmeta> 6809 <refentrytitle><phrase>snd_pcm_format_set_silence</phrase></refentrytitle> 6810 <manvolnum>9</manvolnum> 6811 <refmiscinfo class="version">4.1.27</refmiscinfo> 6812</refmeta> 6813<refnamediv> 6814 <refname>snd_pcm_format_set_silence</refname> 6815 <refpurpose> 6816 set the silence data on the buffer 6817 </refpurpose> 6818</refnamediv> 6819<refsynopsisdiv> 6820 <title>Synopsis</title> 6821 <funcsynopsis><funcprototype> 6822 <funcdef>int <function>snd_pcm_format_set_silence </function></funcdef> 6823 <paramdef>snd_pcm_format_t <parameter>format</parameter></paramdef> 6824 <paramdef>void * <parameter>data</parameter></paramdef> 6825 <paramdef>unsigned int <parameter>samples</parameter></paramdef> 6826 </funcprototype></funcsynopsis> 6827</refsynopsisdiv> 6828<refsect1> 6829 <title>Arguments</title> 6830 <variablelist> 6831 <varlistentry> 6832 <term><parameter>format</parameter></term> 6833 <listitem> 6834 <para> 6835 the PCM format 6836 </para> 6837 </listitem> 6838 </varlistentry> 6839 <varlistentry> 6840 <term><parameter>data</parameter></term> 6841 <listitem> 6842 <para> 6843 the buffer pointer 6844 </para> 6845 </listitem> 6846 </varlistentry> 6847 <varlistentry> 6848 <term><parameter>samples</parameter></term> 6849 <listitem> 6850 <para> 6851 the number of samples to set silence 6852 </para> 6853 </listitem> 6854 </varlistentry> 6855 </variablelist> 6856</refsect1> 6857<refsect1> 6858<title>Description</title> 6859<para> 6860 Sets the silence data on the buffer for the given samples. 6861</para> 6862</refsect1> 6863<refsect1> 6864<title>Return</title> 6865<para> 6866 Zero if successful, or a negative error code on failure. 6867</para> 6868</refsect1> 6869</refentry> 6870 6871<refentry id="API-snd-pcm-limit-hw-rates"> 6872<refentryinfo> 6873 <title>LINUX</title> 6874 <productname>Kernel Hackers Manual</productname> 6875 <date>July 2017</date> 6876</refentryinfo> 6877<refmeta> 6878 <refentrytitle><phrase>snd_pcm_limit_hw_rates</phrase></refentrytitle> 6879 <manvolnum>9</manvolnum> 6880 <refmiscinfo class="version">4.1.27</refmiscinfo> 6881</refmeta> 6882<refnamediv> 6883 <refname>snd_pcm_limit_hw_rates</refname> 6884 <refpurpose> 6885 determine rate_min/rate_max fields 6886 </refpurpose> 6887</refnamediv> 6888<refsynopsisdiv> 6889 <title>Synopsis</title> 6890 <funcsynopsis><funcprototype> 6891 <funcdef>int <function>snd_pcm_limit_hw_rates </function></funcdef> 6892 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 6893 </funcprototype></funcsynopsis> 6894</refsynopsisdiv> 6895<refsect1> 6896 <title>Arguments</title> 6897 <variablelist> 6898 <varlistentry> 6899 <term><parameter>runtime</parameter></term> 6900 <listitem> 6901 <para> 6902 the runtime instance 6903 </para> 6904 </listitem> 6905 </varlistentry> 6906 </variablelist> 6907</refsect1> 6908<refsect1> 6909<title>Description</title> 6910<para> 6911 Determines the rate_min and rate_max fields from the rates bits of 6912 the given runtime->hw. 6913</para> 6914</refsect1> 6915<refsect1> 6916<title>Return</title> 6917<para> 6918 Zero if successful. 6919</para> 6920</refsect1> 6921</refentry> 6922 6923<refentry id="API-snd-pcm-rate-to-rate-bit"> 6924<refentryinfo> 6925 <title>LINUX</title> 6926 <productname>Kernel Hackers Manual</productname> 6927 <date>July 2017</date> 6928</refentryinfo> 6929<refmeta> 6930 <refentrytitle><phrase>snd_pcm_rate_to_rate_bit</phrase></refentrytitle> 6931 <manvolnum>9</manvolnum> 6932 <refmiscinfo class="version">4.1.27</refmiscinfo> 6933</refmeta> 6934<refnamediv> 6935 <refname>snd_pcm_rate_to_rate_bit</refname> 6936 <refpurpose> 6937 converts sample rate to SNDRV_PCM_RATE_xxx bit 6938 </refpurpose> 6939</refnamediv> 6940<refsynopsisdiv> 6941 <title>Synopsis</title> 6942 <funcsynopsis><funcprototype> 6943 <funcdef>unsigned int <function>snd_pcm_rate_to_rate_bit </function></funcdef> 6944 <paramdef>unsigned int <parameter>rate</parameter></paramdef> 6945 </funcprototype></funcsynopsis> 6946</refsynopsisdiv> 6947<refsect1> 6948 <title>Arguments</title> 6949 <variablelist> 6950 <varlistentry> 6951 <term><parameter>rate</parameter></term> 6952 <listitem> 6953 <para> 6954 the sample rate to convert 6955 </para> 6956 </listitem> 6957 </varlistentry> 6958 </variablelist> 6959</refsect1> 6960<refsect1> 6961<title>Return</title> 6962<para> 6963 The SNDRV_PCM_RATE_xxx flag that corresponds to the given rate, or 6964 SNDRV_PCM_RATE_KNOT for an unknown rate. 6965</para> 6966</refsect1> 6967</refentry> 6968 6969<refentry id="API-snd-pcm-rate-bit-to-rate"> 6970<refentryinfo> 6971 <title>LINUX</title> 6972 <productname>Kernel Hackers Manual</productname> 6973 <date>July 2017</date> 6974</refentryinfo> 6975<refmeta> 6976 <refentrytitle><phrase>snd_pcm_rate_bit_to_rate</phrase></refentrytitle> 6977 <manvolnum>9</manvolnum> 6978 <refmiscinfo class="version">4.1.27</refmiscinfo> 6979</refmeta> 6980<refnamediv> 6981 <refname>snd_pcm_rate_bit_to_rate</refname> 6982 <refpurpose> 6983 converts SNDRV_PCM_RATE_xxx bit to sample rate 6984 </refpurpose> 6985</refnamediv> 6986<refsynopsisdiv> 6987 <title>Synopsis</title> 6988 <funcsynopsis><funcprototype> 6989 <funcdef>unsigned int <function>snd_pcm_rate_bit_to_rate </function></funcdef> 6990 <paramdef>unsigned int <parameter>rate_bit</parameter></paramdef> 6991 </funcprototype></funcsynopsis> 6992</refsynopsisdiv> 6993<refsect1> 6994 <title>Arguments</title> 6995 <variablelist> 6996 <varlistentry> 6997 <term><parameter>rate_bit</parameter></term> 6998 <listitem> 6999 <para> 7000 the rate bit to convert 7001 </para> 7002 </listitem> 7003 </varlistentry> 7004 </variablelist> 7005</refsect1> 7006<refsect1> 7007<title>Return</title> 7008<para> 7009 The sample rate that corresponds to the given SNDRV_PCM_RATE_xxx flag 7010 or 0 for an unknown rate bit. 7011</para> 7012</refsect1> 7013</refentry> 7014 7015<refentry id="API-snd-pcm-rate-mask-intersect"> 7016<refentryinfo> 7017 <title>LINUX</title> 7018 <productname>Kernel Hackers Manual</productname> 7019 <date>July 2017</date> 7020</refentryinfo> 7021<refmeta> 7022 <refentrytitle><phrase>snd_pcm_rate_mask_intersect</phrase></refentrytitle> 7023 <manvolnum>9</manvolnum> 7024 <refmiscinfo class="version">4.1.27</refmiscinfo> 7025</refmeta> 7026<refnamediv> 7027 <refname>snd_pcm_rate_mask_intersect</refname> 7028 <refpurpose> 7029 computes the intersection between two rate masks 7030 </refpurpose> 7031</refnamediv> 7032<refsynopsisdiv> 7033 <title>Synopsis</title> 7034 <funcsynopsis><funcprototype> 7035 <funcdef>unsigned int <function>snd_pcm_rate_mask_intersect </function></funcdef> 7036 <paramdef>unsigned int <parameter>rates_a</parameter></paramdef> 7037 <paramdef>unsigned int <parameter>rates_b</parameter></paramdef> 7038 </funcprototype></funcsynopsis> 7039</refsynopsisdiv> 7040<refsect1> 7041 <title>Arguments</title> 7042 <variablelist> 7043 <varlistentry> 7044 <term><parameter>rates_a</parameter></term> 7045 <listitem> 7046 <para> 7047 The first rate mask 7048 </para> 7049 </listitem> 7050 </varlistentry> 7051 <varlistentry> 7052 <term><parameter>rates_b</parameter></term> 7053 <listitem> 7054 <para> 7055 The second rate mask 7056 </para> 7057 </listitem> 7058 </varlistentry> 7059 </variablelist> 7060</refsect1> 7061<refsect1> 7062<title>Description</title> 7063<para> 7064 This function computes the rates that are supported by both rate masks passed 7065 to the function. It will take care of the special handling of 7066 SNDRV_PCM_RATE_CONTINUOUS and SNDRV_PCM_RATE_KNOT. 7067</para> 7068</refsect1> 7069<refsect1> 7070<title>Return</title> 7071<para> 7072 A rate mask containing the rates that are supported by both rates_a 7073 and rates_b. 7074</para> 7075</refsect1> 7076</refentry> 7077 7078 </sect1> 7079 <sect1><title>PCM Memory Management</title> 7080<!-- sound/core/pcm_memory.c --> 7081<refentry id="API-snd-pcm-lib-preallocate-free-for-all"> 7082<refentryinfo> 7083 <title>LINUX</title> 7084 <productname>Kernel Hackers Manual</productname> 7085 <date>July 2017</date> 7086</refentryinfo> 7087<refmeta> 7088 <refentrytitle><phrase>snd_pcm_lib_preallocate_free_for_all</phrase></refentrytitle> 7089 <manvolnum>9</manvolnum> 7090 <refmiscinfo class="version">4.1.27</refmiscinfo> 7091</refmeta> 7092<refnamediv> 7093 <refname>snd_pcm_lib_preallocate_free_for_all</refname> 7094 <refpurpose> 7095 release all pre-allocated buffers on the pcm 7096 </refpurpose> 7097</refnamediv> 7098<refsynopsisdiv> 7099 <title>Synopsis</title> 7100 <funcsynopsis><funcprototype> 7101 <funcdef>int <function>snd_pcm_lib_preallocate_free_for_all </function></funcdef> 7102 <paramdef>struct snd_pcm * <parameter>pcm</parameter></paramdef> 7103 </funcprototype></funcsynopsis> 7104</refsynopsisdiv> 7105<refsect1> 7106 <title>Arguments</title> 7107 <variablelist> 7108 <varlistentry> 7109 <term><parameter>pcm</parameter></term> 7110 <listitem> 7111 <para> 7112 the pcm instance 7113 </para> 7114 </listitem> 7115 </varlistentry> 7116 </variablelist> 7117</refsect1> 7118<refsect1> 7119<title>Description</title> 7120<para> 7121 Releases all the pre-allocated buffers on the given pcm. 7122</para> 7123</refsect1> 7124<refsect1> 7125<title>Return</title> 7126<para> 7127 Zero if successful, or a negative error code on failure. 7128</para> 7129</refsect1> 7130</refentry> 7131 7132<refentry id="API-snd-pcm-lib-preallocate-pages"> 7133<refentryinfo> 7134 <title>LINUX</title> 7135 <productname>Kernel Hackers Manual</productname> 7136 <date>July 2017</date> 7137</refentryinfo> 7138<refmeta> 7139 <refentrytitle><phrase>snd_pcm_lib_preallocate_pages</phrase></refentrytitle> 7140 <manvolnum>9</manvolnum> 7141 <refmiscinfo class="version">4.1.27</refmiscinfo> 7142</refmeta> 7143<refnamediv> 7144 <refname>snd_pcm_lib_preallocate_pages</refname> 7145 <refpurpose> 7146 pre-allocation for the given DMA type 7147 </refpurpose> 7148</refnamediv> 7149<refsynopsisdiv> 7150 <title>Synopsis</title> 7151 <funcsynopsis><funcprototype> 7152 <funcdef>int <function>snd_pcm_lib_preallocate_pages </function></funcdef> 7153 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7154 <paramdef>int <parameter>type</parameter></paramdef> 7155 <paramdef>struct device * <parameter>data</parameter></paramdef> 7156 <paramdef>size_t <parameter>size</parameter></paramdef> 7157 <paramdef>size_t <parameter>max</parameter></paramdef> 7158 </funcprototype></funcsynopsis> 7159</refsynopsisdiv> 7160<refsect1> 7161 <title>Arguments</title> 7162 <variablelist> 7163 <varlistentry> 7164 <term><parameter>substream</parameter></term> 7165 <listitem> 7166 <para> 7167 the pcm substream instance 7168 </para> 7169 </listitem> 7170 </varlistentry> 7171 <varlistentry> 7172 <term><parameter>type</parameter></term> 7173 <listitem> 7174 <para> 7175 DMA type (SNDRV_DMA_TYPE_*) 7176 </para> 7177 </listitem> 7178 </varlistentry> 7179 <varlistentry> 7180 <term><parameter>data</parameter></term> 7181 <listitem> 7182 <para> 7183 DMA type dependent data 7184 </para> 7185 </listitem> 7186 </varlistentry> 7187 <varlistentry> 7188 <term><parameter>size</parameter></term> 7189 <listitem> 7190 <para> 7191 the requested pre-allocation size in bytes 7192 </para> 7193 </listitem> 7194 </varlistentry> 7195 <varlistentry> 7196 <term><parameter>max</parameter></term> 7197 <listitem> 7198 <para> 7199 the max. allowed pre-allocation size 7200 </para> 7201 </listitem> 7202 </varlistentry> 7203 </variablelist> 7204</refsect1> 7205<refsect1> 7206<title>Description</title> 7207<para> 7208 Do pre-allocation for the given DMA buffer type. 7209</para> 7210</refsect1> 7211<refsect1> 7212<title>Return</title> 7213<para> 7214 Zero if successful, or a negative error code on failure. 7215</para> 7216</refsect1> 7217</refentry> 7218 7219<refentry id="API-snd-pcm-lib-preallocate-pages-for-all"> 7220<refentryinfo> 7221 <title>LINUX</title> 7222 <productname>Kernel Hackers Manual</productname> 7223 <date>July 2017</date> 7224</refentryinfo> 7225<refmeta> 7226 <refentrytitle><phrase>snd_pcm_lib_preallocate_pages_for_all</phrase></refentrytitle> 7227 <manvolnum>9</manvolnum> 7228 <refmiscinfo class="version">4.1.27</refmiscinfo> 7229</refmeta> 7230<refnamediv> 7231 <refname>snd_pcm_lib_preallocate_pages_for_all</refname> 7232 <refpurpose> 7233 pre-allocation for continuous memory type (all substreams) 7234 </refpurpose> 7235</refnamediv> 7236<refsynopsisdiv> 7237 <title>Synopsis</title> 7238 <funcsynopsis><funcprototype> 7239 <funcdef>int <function>snd_pcm_lib_preallocate_pages_for_all </function></funcdef> 7240 <paramdef>struct snd_pcm * <parameter>pcm</parameter></paramdef> 7241 <paramdef>int <parameter>type</parameter></paramdef> 7242 <paramdef>void * <parameter>data</parameter></paramdef> 7243 <paramdef>size_t <parameter>size</parameter></paramdef> 7244 <paramdef>size_t <parameter>max</parameter></paramdef> 7245 </funcprototype></funcsynopsis> 7246</refsynopsisdiv> 7247<refsect1> 7248 <title>Arguments</title> 7249 <variablelist> 7250 <varlistentry> 7251 <term><parameter>pcm</parameter></term> 7252 <listitem> 7253 <para> 7254 the pcm instance 7255 </para> 7256 </listitem> 7257 </varlistentry> 7258 <varlistentry> 7259 <term><parameter>type</parameter></term> 7260 <listitem> 7261 <para> 7262 DMA type (SNDRV_DMA_TYPE_*) 7263 </para> 7264 </listitem> 7265 </varlistentry> 7266 <varlistentry> 7267 <term><parameter>data</parameter></term> 7268 <listitem> 7269 <para> 7270 DMA type dependent data 7271 </para> 7272 </listitem> 7273 </varlistentry> 7274 <varlistentry> 7275 <term><parameter>size</parameter></term> 7276 <listitem> 7277 <para> 7278 the requested pre-allocation size in bytes 7279 </para> 7280 </listitem> 7281 </varlistentry> 7282 <varlistentry> 7283 <term><parameter>max</parameter></term> 7284 <listitem> 7285 <para> 7286 the max. allowed pre-allocation size 7287 </para> 7288 </listitem> 7289 </varlistentry> 7290 </variablelist> 7291</refsect1> 7292<refsect1> 7293<title>Description</title> 7294<para> 7295 Do pre-allocation to all substreams of the given pcm for the 7296 specified DMA type. 7297</para> 7298</refsect1> 7299<refsect1> 7300<title>Return</title> 7301<para> 7302 Zero if successful, or a negative error code on failure. 7303</para> 7304</refsect1> 7305</refentry> 7306 7307<refentry id="API-snd-pcm-sgbuf-ops-page"> 7308<refentryinfo> 7309 <title>LINUX</title> 7310 <productname>Kernel Hackers Manual</productname> 7311 <date>July 2017</date> 7312</refentryinfo> 7313<refmeta> 7314 <refentrytitle><phrase>snd_pcm_sgbuf_ops_page</phrase></refentrytitle> 7315 <manvolnum>9</manvolnum> 7316 <refmiscinfo class="version">4.1.27</refmiscinfo> 7317</refmeta> 7318<refnamediv> 7319 <refname>snd_pcm_sgbuf_ops_page</refname> 7320 <refpurpose> 7321 get the page struct at the given offset 7322 </refpurpose> 7323</refnamediv> 7324<refsynopsisdiv> 7325 <title>Synopsis</title> 7326 <funcsynopsis><funcprototype> 7327 <funcdef>struct page * <function>snd_pcm_sgbuf_ops_page </function></funcdef> 7328 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7329 <paramdef>unsigned long <parameter>offset</parameter></paramdef> 7330 </funcprototype></funcsynopsis> 7331</refsynopsisdiv> 7332<refsect1> 7333 <title>Arguments</title> 7334 <variablelist> 7335 <varlistentry> 7336 <term><parameter>substream</parameter></term> 7337 <listitem> 7338 <para> 7339 the pcm substream instance 7340 </para> 7341 </listitem> 7342 </varlistentry> 7343 <varlistentry> 7344 <term><parameter>offset</parameter></term> 7345 <listitem> 7346 <para> 7347 the buffer offset 7348 </para> 7349 </listitem> 7350 </varlistentry> 7351 </variablelist> 7352</refsect1> 7353<refsect1> 7354<title>Description</title> 7355<para> 7356 Used as the page callback of PCM ops. 7357</para> 7358</refsect1> 7359<refsect1> 7360<title>Return</title> 7361<para> 7362 The page struct at the given buffer offset. <constant>NULL</constant> on failure. 7363</para> 7364</refsect1> 7365</refentry> 7366 7367<refentry id="API-snd-pcm-lib-malloc-pages"> 7368<refentryinfo> 7369 <title>LINUX</title> 7370 <productname>Kernel Hackers Manual</productname> 7371 <date>July 2017</date> 7372</refentryinfo> 7373<refmeta> 7374 <refentrytitle><phrase>snd_pcm_lib_malloc_pages</phrase></refentrytitle> 7375 <manvolnum>9</manvolnum> 7376 <refmiscinfo class="version">4.1.27</refmiscinfo> 7377</refmeta> 7378<refnamediv> 7379 <refname>snd_pcm_lib_malloc_pages</refname> 7380 <refpurpose> 7381 allocate the DMA buffer 7382 </refpurpose> 7383</refnamediv> 7384<refsynopsisdiv> 7385 <title>Synopsis</title> 7386 <funcsynopsis><funcprototype> 7387 <funcdef>int <function>snd_pcm_lib_malloc_pages </function></funcdef> 7388 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7389 <paramdef>size_t <parameter>size</parameter></paramdef> 7390 </funcprototype></funcsynopsis> 7391</refsynopsisdiv> 7392<refsect1> 7393 <title>Arguments</title> 7394 <variablelist> 7395 <varlistentry> 7396 <term><parameter>substream</parameter></term> 7397 <listitem> 7398 <para> 7399 the substream to allocate the DMA buffer to 7400 </para> 7401 </listitem> 7402 </varlistentry> 7403 <varlistentry> 7404 <term><parameter>size</parameter></term> 7405 <listitem> 7406 <para> 7407 the requested buffer size in bytes 7408 </para> 7409 </listitem> 7410 </varlistentry> 7411 </variablelist> 7412</refsect1> 7413<refsect1> 7414<title>Description</title> 7415<para> 7416 Allocates the DMA buffer on the BUS type given earlier to 7417 <function>snd_pcm_lib_preallocate_xxx_pages</function>. 7418</para> 7419</refsect1> 7420<refsect1> 7421<title>Return</title> 7422<para> 7423 1 if the buffer is changed, 0 if not changed, or a negative 7424 code on failure. 7425</para> 7426</refsect1> 7427</refentry> 7428 7429<refentry id="API-snd-pcm-lib-free-pages"> 7430<refentryinfo> 7431 <title>LINUX</title> 7432 <productname>Kernel Hackers Manual</productname> 7433 <date>July 2017</date> 7434</refentryinfo> 7435<refmeta> 7436 <refentrytitle><phrase>snd_pcm_lib_free_pages</phrase></refentrytitle> 7437 <manvolnum>9</manvolnum> 7438 <refmiscinfo class="version">4.1.27</refmiscinfo> 7439</refmeta> 7440<refnamediv> 7441 <refname>snd_pcm_lib_free_pages</refname> 7442 <refpurpose> 7443 release the allocated DMA buffer. 7444 </refpurpose> 7445</refnamediv> 7446<refsynopsisdiv> 7447 <title>Synopsis</title> 7448 <funcsynopsis><funcprototype> 7449 <funcdef>int <function>snd_pcm_lib_free_pages </function></funcdef> 7450 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7451 </funcprototype></funcsynopsis> 7452</refsynopsisdiv> 7453<refsect1> 7454 <title>Arguments</title> 7455 <variablelist> 7456 <varlistentry> 7457 <term><parameter>substream</parameter></term> 7458 <listitem> 7459 <para> 7460 the substream to release the DMA buffer 7461 </para> 7462 </listitem> 7463 </varlistentry> 7464 </variablelist> 7465</refsect1> 7466<refsect1> 7467<title>Description</title> 7468<para> 7469 Releases the DMA buffer allocated via <function>snd_pcm_lib_malloc_pages</function>. 7470</para> 7471</refsect1> 7472<refsect1> 7473<title>Return</title> 7474<para> 7475 Zero if successful, or a negative error code on failure. 7476</para> 7477</refsect1> 7478</refentry> 7479 7480<refentry id="API-snd-pcm-lib-free-vmalloc-buffer"> 7481<refentryinfo> 7482 <title>LINUX</title> 7483 <productname>Kernel Hackers Manual</productname> 7484 <date>July 2017</date> 7485</refentryinfo> 7486<refmeta> 7487 <refentrytitle><phrase>snd_pcm_lib_free_vmalloc_buffer</phrase></refentrytitle> 7488 <manvolnum>9</manvolnum> 7489 <refmiscinfo class="version">4.1.27</refmiscinfo> 7490</refmeta> 7491<refnamediv> 7492 <refname>snd_pcm_lib_free_vmalloc_buffer</refname> 7493 <refpurpose> 7494 free vmalloc buffer 7495 </refpurpose> 7496</refnamediv> 7497<refsynopsisdiv> 7498 <title>Synopsis</title> 7499 <funcsynopsis><funcprototype> 7500 <funcdef>int <function>snd_pcm_lib_free_vmalloc_buffer </function></funcdef> 7501 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7502 </funcprototype></funcsynopsis> 7503</refsynopsisdiv> 7504<refsect1> 7505 <title>Arguments</title> 7506 <variablelist> 7507 <varlistentry> 7508 <term><parameter>substream</parameter></term> 7509 <listitem> 7510 <para> 7511 the substream with a buffer allocated by 7512 <function>snd_pcm_lib_alloc_vmalloc_buffer</function> 7513 </para> 7514 </listitem> 7515 </varlistentry> 7516 </variablelist> 7517</refsect1> 7518<refsect1> 7519<title>Return</title> 7520<para> 7521 Zero if successful, or a negative error code on failure. 7522</para> 7523</refsect1> 7524</refentry> 7525 7526<refentry id="API-snd-pcm-lib-get-vmalloc-page"> 7527<refentryinfo> 7528 <title>LINUX</title> 7529 <productname>Kernel Hackers Manual</productname> 7530 <date>July 2017</date> 7531</refentryinfo> 7532<refmeta> 7533 <refentrytitle><phrase>snd_pcm_lib_get_vmalloc_page</phrase></refentrytitle> 7534 <manvolnum>9</manvolnum> 7535 <refmiscinfo class="version">4.1.27</refmiscinfo> 7536</refmeta> 7537<refnamediv> 7538 <refname>snd_pcm_lib_get_vmalloc_page</refname> 7539 <refpurpose> 7540 map vmalloc buffer offset to page struct 7541 </refpurpose> 7542</refnamediv> 7543<refsynopsisdiv> 7544 <title>Synopsis</title> 7545 <funcsynopsis><funcprototype> 7546 <funcdef>struct page * <function>snd_pcm_lib_get_vmalloc_page </function></funcdef> 7547 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7548 <paramdef>unsigned long <parameter>offset</parameter></paramdef> 7549 </funcprototype></funcsynopsis> 7550</refsynopsisdiv> 7551<refsect1> 7552 <title>Arguments</title> 7553 <variablelist> 7554 <varlistentry> 7555 <term><parameter>substream</parameter></term> 7556 <listitem> 7557 <para> 7558 the substream with a buffer allocated by 7559 <function>snd_pcm_lib_alloc_vmalloc_buffer</function> 7560 </para> 7561 </listitem> 7562 </varlistentry> 7563 <varlistentry> 7564 <term><parameter>offset</parameter></term> 7565 <listitem> 7566 <para> 7567 offset in the buffer 7568 </para> 7569 </listitem> 7570 </varlistentry> 7571 </variablelist> 7572</refsect1> 7573<refsect1> 7574<title>Description</title> 7575<para> 7576 This function is to be used as the page callback in the PCM ops. 7577</para> 7578</refsect1> 7579<refsect1> 7580<title>Return</title> 7581<para> 7582 The page struct, or <constant>NULL</constant> on failure. 7583</para> 7584</refsect1> 7585</refentry> 7586 7587 </sect1> 7588 <sect1><title>PCM DMA Engine API</title> 7589<!-- sound/core/pcm_dmaengine.c --> 7590<refentry id="API-snd-hwparams-to-dma-slave-config"> 7591<refentryinfo> 7592 <title>LINUX</title> 7593 <productname>Kernel Hackers Manual</productname> 7594 <date>July 2017</date> 7595</refentryinfo> 7596<refmeta> 7597 <refentrytitle><phrase>snd_hwparams_to_dma_slave_config</phrase></refentrytitle> 7598 <manvolnum>9</manvolnum> 7599 <refmiscinfo class="version">4.1.27</refmiscinfo> 7600</refmeta> 7601<refnamediv> 7602 <refname>snd_hwparams_to_dma_slave_config</refname> 7603 <refpurpose> 7604 Convert hw_params to dma_slave_config 7605 </refpurpose> 7606</refnamediv> 7607<refsynopsisdiv> 7608 <title>Synopsis</title> 7609 <funcsynopsis><funcprototype> 7610 <funcdef>int <function>snd_hwparams_to_dma_slave_config </function></funcdef> 7611 <paramdef>const struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7612 <paramdef>const struct snd_pcm_hw_params * <parameter>params</parameter></paramdef> 7613 <paramdef>struct dma_slave_config * <parameter>slave_config</parameter></paramdef> 7614 </funcprototype></funcsynopsis> 7615</refsynopsisdiv> 7616<refsect1> 7617 <title>Arguments</title> 7618 <variablelist> 7619 <varlistentry> 7620 <term><parameter>substream</parameter></term> 7621 <listitem> 7622 <para> 7623 PCM substream 7624 </para> 7625 </listitem> 7626 </varlistentry> 7627 <varlistentry> 7628 <term><parameter>params</parameter></term> 7629 <listitem> 7630 <para> 7631 hw_params 7632 </para> 7633 </listitem> 7634 </varlistentry> 7635 <varlistentry> 7636 <term><parameter>slave_config</parameter></term> 7637 <listitem> 7638 <para> 7639 DMA slave config 7640 </para> 7641 </listitem> 7642 </varlistentry> 7643 </variablelist> 7644</refsect1> 7645<refsect1> 7646<title>Description</title> 7647<para> 7648 This function can be used to initialize a dma_slave_config from a substream 7649 and hw_params in a dmaengine based PCM driver implementation. 7650</para> 7651</refsect1> 7652</refentry> 7653 7654<refentry id="API-snd-dmaengine-pcm-set-config-from-dai-data"> 7655<refentryinfo> 7656 <title>LINUX</title> 7657 <productname>Kernel Hackers Manual</productname> 7658 <date>July 2017</date> 7659</refentryinfo> 7660<refmeta> 7661 <refentrytitle><phrase>snd_dmaengine_pcm_set_config_from_dai_data</phrase></refentrytitle> 7662 <manvolnum>9</manvolnum> 7663 <refmiscinfo class="version">4.1.27</refmiscinfo> 7664</refmeta> 7665<refnamediv> 7666 <refname>snd_dmaengine_pcm_set_config_from_dai_data</refname> 7667 <refpurpose> 7668 Initializes a dma slave config using DAI DMA data. 7669 </refpurpose> 7670</refnamediv> 7671<refsynopsisdiv> 7672 <title>Synopsis</title> 7673 <funcsynopsis><funcprototype> 7674 <funcdef>void <function>snd_dmaengine_pcm_set_config_from_dai_data </function></funcdef> 7675 <paramdef>const struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7676 <paramdef>const struct snd_dmaengine_dai_dma_data * <parameter>dma_data</parameter></paramdef> 7677 <paramdef>struct dma_slave_config * <parameter>slave_config</parameter></paramdef> 7678 </funcprototype></funcsynopsis> 7679</refsynopsisdiv> 7680<refsect1> 7681 <title>Arguments</title> 7682 <variablelist> 7683 <varlistentry> 7684 <term><parameter>substream</parameter></term> 7685 <listitem> 7686 <para> 7687 PCM substream 7688 </para> 7689 </listitem> 7690 </varlistentry> 7691 <varlistentry> 7692 <term><parameter>dma_data</parameter></term> 7693 <listitem> 7694 <para> 7695 DAI DMA data 7696 </para> 7697 </listitem> 7698 </varlistentry> 7699 <varlistentry> 7700 <term><parameter>slave_config</parameter></term> 7701 <listitem> 7702 <para> 7703 DMA slave configuration 7704 </para> 7705 </listitem> 7706 </varlistentry> 7707 </variablelist> 7708</refsect1> 7709<refsect1> 7710<title>Description</title> 7711<para> 7712 Initializes the {dst,src}_addr, {dst,src}_maxburst, {dst,src}_addr_width and 7713 slave_id fields of the DMA slave config from the same fields of the DAI DMA 7714 data struct. The src and dst fields will be initialized depending on the 7715 direction of the substream. If the substream is a playback stream the dst 7716 fields will be initialized, if it is a capture stream the src fields will be 7717 initialized. The {dst,src}_addr_width field will only be initialized if the 7718 addr_width field of the DAI DMA data struct is not equal to 7719 DMA_SLAVE_BUSWIDTH_UNDEFINED. 7720</para> 7721</refsect1> 7722</refentry> 7723 7724<refentry id="API-snd-dmaengine-pcm-trigger"> 7725<refentryinfo> 7726 <title>LINUX</title> 7727 <productname>Kernel Hackers Manual</productname> 7728 <date>July 2017</date> 7729</refentryinfo> 7730<refmeta> 7731 <refentrytitle><phrase>snd_dmaengine_pcm_trigger</phrase></refentrytitle> 7732 <manvolnum>9</manvolnum> 7733 <refmiscinfo class="version">4.1.27</refmiscinfo> 7734</refmeta> 7735<refnamediv> 7736 <refname>snd_dmaengine_pcm_trigger</refname> 7737 <refpurpose> 7738 dmaengine based PCM trigger implementation 7739 </refpurpose> 7740</refnamediv> 7741<refsynopsisdiv> 7742 <title>Synopsis</title> 7743 <funcsynopsis><funcprototype> 7744 <funcdef>int <function>snd_dmaengine_pcm_trigger </function></funcdef> 7745 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7746 <paramdef>int <parameter>cmd</parameter></paramdef> 7747 </funcprototype></funcsynopsis> 7748</refsynopsisdiv> 7749<refsect1> 7750 <title>Arguments</title> 7751 <variablelist> 7752 <varlistentry> 7753 <term><parameter>substream</parameter></term> 7754 <listitem> 7755 <para> 7756 PCM substream 7757 </para> 7758 </listitem> 7759 </varlistentry> 7760 <varlistentry> 7761 <term><parameter>cmd</parameter></term> 7762 <listitem> 7763 <para> 7764 Trigger command 7765 </para> 7766 </listitem> 7767 </varlistentry> 7768 </variablelist> 7769</refsect1> 7770<refsect1> 7771<title>Description</title> 7772<para> 7773 Returns 0 on success, a negative error code otherwise. 7774 </para><para> 7775 7776 This function can be used as the PCM trigger callback for dmaengine based PCM 7777 driver implementations. 7778</para> 7779</refsect1> 7780</refentry> 7781 7782<refentry id="API-snd-dmaengine-pcm-pointer-no-residue"> 7783<refentryinfo> 7784 <title>LINUX</title> 7785 <productname>Kernel Hackers Manual</productname> 7786 <date>July 2017</date> 7787</refentryinfo> 7788<refmeta> 7789 <refentrytitle><phrase>snd_dmaengine_pcm_pointer_no_residue</phrase></refentrytitle> 7790 <manvolnum>9</manvolnum> 7791 <refmiscinfo class="version">4.1.27</refmiscinfo> 7792</refmeta> 7793<refnamediv> 7794 <refname>snd_dmaengine_pcm_pointer_no_residue</refname> 7795 <refpurpose> 7796 dmaengine based PCM pointer implementation 7797 </refpurpose> 7798</refnamediv> 7799<refsynopsisdiv> 7800 <title>Synopsis</title> 7801 <funcsynopsis><funcprototype> 7802 <funcdef>snd_pcm_uframes_t <function>snd_dmaengine_pcm_pointer_no_residue </function></funcdef> 7803 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7804 </funcprototype></funcsynopsis> 7805</refsynopsisdiv> 7806<refsect1> 7807 <title>Arguments</title> 7808 <variablelist> 7809 <varlistentry> 7810 <term><parameter>substream</parameter></term> 7811 <listitem> 7812 <para> 7813 PCM substream 7814 </para> 7815 </listitem> 7816 </varlistentry> 7817 </variablelist> 7818</refsect1> 7819<refsect1> 7820<title>Description</title> 7821<para> 7822 This function is deprecated and should not be used by new drivers, as its 7823 results may be unreliable. 7824</para> 7825</refsect1> 7826</refentry> 7827 7828<refentry id="API-snd-dmaengine-pcm-pointer"> 7829<refentryinfo> 7830 <title>LINUX</title> 7831 <productname>Kernel Hackers Manual</productname> 7832 <date>July 2017</date> 7833</refentryinfo> 7834<refmeta> 7835 <refentrytitle><phrase>snd_dmaengine_pcm_pointer</phrase></refentrytitle> 7836 <manvolnum>9</manvolnum> 7837 <refmiscinfo class="version">4.1.27</refmiscinfo> 7838</refmeta> 7839<refnamediv> 7840 <refname>snd_dmaengine_pcm_pointer</refname> 7841 <refpurpose> 7842 dmaengine based PCM pointer implementation 7843 </refpurpose> 7844</refnamediv> 7845<refsynopsisdiv> 7846 <title>Synopsis</title> 7847 <funcsynopsis><funcprototype> 7848 <funcdef>snd_pcm_uframes_t <function>snd_dmaengine_pcm_pointer </function></funcdef> 7849 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7850 </funcprototype></funcsynopsis> 7851</refsynopsisdiv> 7852<refsect1> 7853 <title>Arguments</title> 7854 <variablelist> 7855 <varlistentry> 7856 <term><parameter>substream</parameter></term> 7857 <listitem> 7858 <para> 7859 PCM substream 7860 </para> 7861 </listitem> 7862 </varlistentry> 7863 </variablelist> 7864</refsect1> 7865<refsect1> 7866<title>Description</title> 7867<para> 7868 This function can be used as the PCM pointer callback for dmaengine based PCM 7869 driver implementations. 7870</para> 7871</refsect1> 7872</refentry> 7873 7874<refentry id="API-snd-dmaengine-pcm-request-channel"> 7875<refentryinfo> 7876 <title>LINUX</title> 7877 <productname>Kernel Hackers Manual</productname> 7878 <date>July 2017</date> 7879</refentryinfo> 7880<refmeta> 7881 <refentrytitle><phrase>snd_dmaengine_pcm_request_channel</phrase></refentrytitle> 7882 <manvolnum>9</manvolnum> 7883 <refmiscinfo class="version">4.1.27</refmiscinfo> 7884</refmeta> 7885<refnamediv> 7886 <refname>snd_dmaengine_pcm_request_channel</refname> 7887 <refpurpose> 7888 Request channel for the dmaengine PCM 7889 </refpurpose> 7890</refnamediv> 7891<refsynopsisdiv> 7892 <title>Synopsis</title> 7893 <funcsynopsis><funcprototype> 7894 <funcdef>struct dma_chan * <function>snd_dmaengine_pcm_request_channel </function></funcdef> 7895 <paramdef>dma_filter_fn <parameter>filter_fn</parameter></paramdef> 7896 <paramdef>void * <parameter>filter_data</parameter></paramdef> 7897 </funcprototype></funcsynopsis> 7898</refsynopsisdiv> 7899<refsect1> 7900 <title>Arguments</title> 7901 <variablelist> 7902 <varlistentry> 7903 <term><parameter>filter_fn</parameter></term> 7904 <listitem> 7905 <para> 7906 Filter function used to request the DMA channel 7907 </para> 7908 </listitem> 7909 </varlistentry> 7910 <varlistentry> 7911 <term><parameter>filter_data</parameter></term> 7912 <listitem> 7913 <para> 7914 Data passed to the DMA filter function 7915 </para> 7916 </listitem> 7917 </varlistentry> 7918 </variablelist> 7919</refsect1> 7920<refsect1> 7921<title>Description</title> 7922<para> 7923 Returns NULL or the requested DMA channel. 7924 </para><para> 7925 7926 This function request a DMA channel for usage with dmaengine PCM. 7927</para> 7928</refsect1> 7929</refentry> 7930 7931<refentry id="API-snd-dmaengine-pcm-open"> 7932<refentryinfo> 7933 <title>LINUX</title> 7934 <productname>Kernel Hackers Manual</productname> 7935 <date>July 2017</date> 7936</refentryinfo> 7937<refmeta> 7938 <refentrytitle><phrase>snd_dmaengine_pcm_open</phrase></refentrytitle> 7939 <manvolnum>9</manvolnum> 7940 <refmiscinfo class="version">4.1.27</refmiscinfo> 7941</refmeta> 7942<refnamediv> 7943 <refname>snd_dmaengine_pcm_open</refname> 7944 <refpurpose> 7945 Open a dmaengine based PCM substream 7946 </refpurpose> 7947</refnamediv> 7948<refsynopsisdiv> 7949 <title>Synopsis</title> 7950 <funcsynopsis><funcprototype> 7951 <funcdef>int <function>snd_dmaengine_pcm_open </function></funcdef> 7952 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 7953 <paramdef>struct dma_chan * <parameter>chan</parameter></paramdef> 7954 </funcprototype></funcsynopsis> 7955</refsynopsisdiv> 7956<refsect1> 7957 <title>Arguments</title> 7958 <variablelist> 7959 <varlistentry> 7960 <term><parameter>substream</parameter></term> 7961 <listitem> 7962 <para> 7963 PCM substream 7964 </para> 7965 </listitem> 7966 </varlistentry> 7967 <varlistentry> 7968 <term><parameter>chan</parameter></term> 7969 <listitem> 7970 <para> 7971 DMA channel to use for data transfers 7972 </para> 7973 </listitem> 7974 </varlistentry> 7975 </variablelist> 7976</refsect1> 7977<refsect1> 7978<title>Description</title> 7979<para> 7980 Returns 0 on success, a negative error code otherwise. 7981 </para><para> 7982 7983 The function should usually be called from the pcm open callback. Note that 7984 this function will use private_data field of the substream's runtime. So it 7985 is not available to your pcm driver implementation. 7986</para> 7987</refsect1> 7988</refentry> 7989 7990<refentry id="API-snd-dmaengine-pcm-open-request-chan"> 7991<refentryinfo> 7992 <title>LINUX</title> 7993 <productname>Kernel Hackers Manual</productname> 7994 <date>July 2017</date> 7995</refentryinfo> 7996<refmeta> 7997 <refentrytitle><phrase>snd_dmaengine_pcm_open_request_chan</phrase></refentrytitle> 7998 <manvolnum>9</manvolnum> 7999 <refmiscinfo class="version">4.1.27</refmiscinfo> 8000</refmeta> 8001<refnamediv> 8002 <refname>snd_dmaengine_pcm_open_request_chan</refname> 8003 <refpurpose> 8004 Open a dmaengine based PCM substream and request channel 8005 </refpurpose> 8006</refnamediv> 8007<refsynopsisdiv> 8008 <title>Synopsis</title> 8009 <funcsynopsis><funcprototype> 8010 <funcdef>int <function>snd_dmaengine_pcm_open_request_chan </function></funcdef> 8011 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 8012 <paramdef>dma_filter_fn <parameter>filter_fn</parameter></paramdef> 8013 <paramdef>void * <parameter>filter_data</parameter></paramdef> 8014 </funcprototype></funcsynopsis> 8015</refsynopsisdiv> 8016<refsect1> 8017 <title>Arguments</title> 8018 <variablelist> 8019 <varlistentry> 8020 <term><parameter>substream</parameter></term> 8021 <listitem> 8022 <para> 8023 PCM substream 8024 </para> 8025 </listitem> 8026 </varlistentry> 8027 <varlistentry> 8028 <term><parameter>filter_fn</parameter></term> 8029 <listitem> 8030 <para> 8031 Filter function used to request the DMA channel 8032 </para> 8033 </listitem> 8034 </varlistentry> 8035 <varlistentry> 8036 <term><parameter>filter_data</parameter></term> 8037 <listitem> 8038 <para> 8039 Data passed to the DMA filter function 8040 </para> 8041 </listitem> 8042 </varlistentry> 8043 </variablelist> 8044</refsect1> 8045<refsect1> 8046<title>Description</title> 8047<para> 8048 Returns 0 on success, a negative error code otherwise. 8049 </para><para> 8050 8051 This function will request a DMA channel using the passed filter function and 8052 data. The function should usually be called from the pcm open callback. Note 8053 that this function will use private_data field of the substream's runtime. So 8054 it is not available to your pcm driver implementation. 8055</para> 8056</refsect1> 8057</refentry> 8058 8059<refentry id="API-snd-dmaengine-pcm-close"> 8060<refentryinfo> 8061 <title>LINUX</title> 8062 <productname>Kernel Hackers Manual</productname> 8063 <date>July 2017</date> 8064</refentryinfo> 8065<refmeta> 8066 <refentrytitle><phrase>snd_dmaengine_pcm_close</phrase></refentrytitle> 8067 <manvolnum>9</manvolnum> 8068 <refmiscinfo class="version">4.1.27</refmiscinfo> 8069</refmeta> 8070<refnamediv> 8071 <refname>snd_dmaengine_pcm_close</refname> 8072 <refpurpose> 8073 Close a dmaengine based PCM substream 8074 </refpurpose> 8075</refnamediv> 8076<refsynopsisdiv> 8077 <title>Synopsis</title> 8078 <funcsynopsis><funcprototype> 8079 <funcdef>int <function>snd_dmaengine_pcm_close </function></funcdef> 8080 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 8081 </funcprototype></funcsynopsis> 8082</refsynopsisdiv> 8083<refsect1> 8084 <title>Arguments</title> 8085 <variablelist> 8086 <varlistentry> 8087 <term><parameter>substream</parameter></term> 8088 <listitem> 8089 <para> 8090 PCM substream 8091 </para> 8092 </listitem> 8093 </varlistentry> 8094 </variablelist> 8095</refsect1> 8096</refentry> 8097 8098<refentry id="API-snd-dmaengine-pcm-close-release-chan"> 8099<refentryinfo> 8100 <title>LINUX</title> 8101 <productname>Kernel Hackers Manual</productname> 8102 <date>July 2017</date> 8103</refentryinfo> 8104<refmeta> 8105 <refentrytitle><phrase>snd_dmaengine_pcm_close_release_chan</phrase></refentrytitle> 8106 <manvolnum>9</manvolnum> 8107 <refmiscinfo class="version">4.1.27</refmiscinfo> 8108</refmeta> 8109<refnamediv> 8110 <refname>snd_dmaengine_pcm_close_release_chan</refname> 8111 <refpurpose> 8112 Close a dmaengine based PCM substream and release channel 8113 </refpurpose> 8114</refnamediv> 8115<refsynopsisdiv> 8116 <title>Synopsis</title> 8117 <funcsynopsis><funcprototype> 8118 <funcdef>int <function>snd_dmaengine_pcm_close_release_chan </function></funcdef> 8119 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 8120 </funcprototype></funcsynopsis> 8121</refsynopsisdiv> 8122<refsect1> 8123 <title>Arguments</title> 8124 <variablelist> 8125 <varlistentry> 8126 <term><parameter>substream</parameter></term> 8127 <listitem> 8128 <para> 8129 PCM substream 8130 </para> 8131 </listitem> 8132 </varlistentry> 8133 </variablelist> 8134</refsect1> 8135<refsect1> 8136<title>Description</title> 8137<para> 8138 Releases the DMA channel associated with the PCM substream. 8139</para> 8140</refsect1> 8141</refentry> 8142 8143<!-- include/sound/dmaengine_pcm.h --> 8144<refentry id="API-snd-pcm-substream-to-dma-direction"> 8145<refentryinfo> 8146 <title>LINUX</title> 8147 <productname>Kernel Hackers Manual</productname> 8148 <date>July 2017</date> 8149</refentryinfo> 8150<refmeta> 8151 <refentrytitle><phrase>snd_pcm_substream_to_dma_direction</phrase></refentrytitle> 8152 <manvolnum>9</manvolnum> 8153 <refmiscinfo class="version">4.1.27</refmiscinfo> 8154</refmeta> 8155<refnamediv> 8156 <refname>snd_pcm_substream_to_dma_direction</refname> 8157 <refpurpose> 8158 Get dma_transfer_direction for a PCM substream 8159 </refpurpose> 8160</refnamediv> 8161<refsynopsisdiv> 8162 <title>Synopsis</title> 8163 <funcsynopsis><funcprototype> 8164 <funcdef>enum dma_transfer_direction <function>snd_pcm_substream_to_dma_direction </function></funcdef> 8165 <paramdef>const struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 8166 </funcprototype></funcsynopsis> 8167</refsynopsisdiv> 8168<refsect1> 8169 <title>Arguments</title> 8170 <variablelist> 8171 <varlistentry> 8172 <term><parameter>substream</parameter></term> 8173 <listitem> 8174 <para> 8175 PCM substream 8176 </para> 8177 </listitem> 8178 </varlistentry> 8179 </variablelist> 8180</refsect1> 8181</refentry> 8182 8183<refentry id="API-struct-snd-dmaengine-dai-dma-data"> 8184<refentryinfo> 8185 <title>LINUX</title> 8186 <productname>Kernel Hackers Manual</productname> 8187 <date>July 2017</date> 8188</refentryinfo> 8189<refmeta> 8190 <refentrytitle><phrase>struct snd_dmaengine_dai_dma_data</phrase></refentrytitle> 8191 <manvolnum>9</manvolnum> 8192 <refmiscinfo class="version">4.1.27</refmiscinfo> 8193</refmeta> 8194<refnamediv> 8195 <refname>struct snd_dmaengine_dai_dma_data</refname> 8196 <refpurpose> 8197 DAI DMA configuration data 8198 </refpurpose> 8199</refnamediv> 8200<refsynopsisdiv> 8201 <title>Synopsis</title> 8202 <programlisting> 8203struct snd_dmaengine_dai_dma_data { 8204 dma_addr_t addr; 8205 enum dma_slave_buswidth addr_width; 8206 u32 maxburst; 8207 unsigned int slave_id; 8208 void * filter_data; 8209 const char * chan_name; 8210 unsigned int fifo_size; 8211}; </programlisting> 8212</refsynopsisdiv> 8213 <refsect1> 8214 <title>Members</title> 8215 <variablelist> 8216 <varlistentry> <term>addr</term> 8217 <listitem><para> 8218 Address of the DAI data source or destination register. 8219 </para></listitem> 8220 </varlistentry> 8221 <varlistentry> <term>addr_width</term> 8222 <listitem><para> 8223 Width of the DAI data source or destination register. 8224 </para></listitem> 8225 </varlistentry> 8226 <varlistentry> <term>maxburst</term> 8227 <listitem><para> 8228 Maximum number of words(note: words, as in units of the 8229 src_addr_width member, not bytes) that can be send to or received from the 8230 DAI in one burst. 8231 </para></listitem> 8232 </varlistentry> 8233 <varlistentry> <term>slave_id</term> 8234 <listitem><para> 8235 Slave requester id for the DMA channel. 8236 </para></listitem> 8237 </varlistentry> 8238 <varlistentry> <term>filter_data</term> 8239 <listitem><para> 8240 Custom DMA channel filter data, this will usually be used when 8241 requesting the DMA channel. 8242 </para></listitem> 8243 </varlistentry> 8244 <varlistentry> <term>chan_name</term> 8245 <listitem><para> 8246 Custom channel name to use when requesting DMA channel. 8247 </para></listitem> 8248 </varlistentry> 8249 <varlistentry> <term>fifo_size</term> 8250 <listitem><para> 8251 FIFO size of the DAI controller in bytes 8252 </para></listitem> 8253 </varlistentry> 8254 </variablelist> 8255 </refsect1> 8256</refentry> 8257 8258<refentry id="API-struct-snd-dmaengine-pcm-config"> 8259<refentryinfo> 8260 <title>LINUX</title> 8261 <productname>Kernel Hackers Manual</productname> 8262 <date>July 2017</date> 8263</refentryinfo> 8264<refmeta> 8265 <refentrytitle><phrase>struct snd_dmaengine_pcm_config</phrase></refentrytitle> 8266 <manvolnum>9</manvolnum> 8267 <refmiscinfo class="version">4.1.27</refmiscinfo> 8268</refmeta> 8269<refnamediv> 8270 <refname>struct snd_dmaengine_pcm_config</refname> 8271 <refpurpose> 8272 Configuration data for dmaengine based PCM 8273 </refpurpose> 8274</refnamediv> 8275<refsynopsisdiv> 8276 <title>Synopsis</title> 8277 <programlisting> 8278struct snd_dmaengine_pcm_config { 8279 int (* prepare_slave_config) (struct snd_pcm_substream *substream,struct snd_pcm_hw_params *params,struct dma_slave_config *slave_config); 8280 struct dma_chan *(* compat_request_channel) (struct snd_soc_pcm_runtime *rtd,struct snd_pcm_substream *substream); 8281 dma_filter_fn compat_filter_fn; 8282 struct device * dma_dev; 8283 const char * chan_names[SNDRV_PCM_STREAM_LAST + 1]; 8284 const struct snd_pcm_hardware * pcm_hardware; 8285 unsigned int prealloc_buffer_size; 8286}; </programlisting> 8287</refsynopsisdiv> 8288 <refsect1> 8289 <title>Members</title> 8290 <variablelist> 8291 <varlistentry> <term>prepare_slave_config</term> 8292 <listitem><para> 8293 Callback used to fill in the DMA slave_config for a 8294 PCM substream. Will be called from the PCM drivers hwparams callback. 8295 </para></listitem> 8296 </varlistentry> 8297 <varlistentry> <term>compat_request_channel</term> 8298 <listitem><para> 8299 Callback to request a DMA channel for platforms 8300 which do not use devicetree. 8301 </para></listitem> 8302 </varlistentry> 8303 <varlistentry> <term>compat_filter_fn</term> 8304 <listitem><para> 8305 Will be used as the filter function when requesting a 8306 channel for platforms which do not use devicetree. The filter parameter 8307 will be the DAI's DMA data. 8308 </para></listitem> 8309 </varlistentry> 8310 <varlistentry> <term>dma_dev</term> 8311 <listitem><para> 8312 If set, request DMA channel on this device rather than the DAI 8313 device. 8314 </para></listitem> 8315 </varlistentry> 8316 <varlistentry> <term>chan_names[SNDRV_PCM_STREAM_LAST + 1]</term> 8317 <listitem><para> 8318 If set, these custom DMA channel names will be requested at 8319 registration time. 8320 </para></listitem> 8321 </varlistentry> 8322 <varlistentry> <term>pcm_hardware</term> 8323 <listitem><para> 8324 snd_pcm_hardware struct to be used for the PCM. 8325 </para></listitem> 8326 </varlistentry> 8327 <varlistentry> <term>prealloc_buffer_size</term> 8328 <listitem><para> 8329 Size of the preallocated audio buffer. 8330 </para></listitem> 8331 </varlistentry> 8332 </variablelist> 8333 </refsect1> 8334<refsect1> 8335<title>Note</title> 8336<para> 8337 If both compat_request_channel and compat_filter_fn are set 8338 compat_request_channel will be used to request the channel and 8339 compat_filter_fn will be ignored. Otherwise the channel will be requested 8340 using dma_request_channel with compat_filter_fn as the filter function. 8341</para> 8342</refsect1> 8343</refentry> 8344 8345 </sect1> 8346 </chapter> 8347 <chapter><title>Control/Mixer API</title> 8348 <sect1><title>General Control Interface</title> 8349<!-- sound/core/control.c --> 8350<refentry id="API-snd-ctl-notify"> 8351<refentryinfo> 8352 <title>LINUX</title> 8353 <productname>Kernel Hackers Manual</productname> 8354 <date>July 2017</date> 8355</refentryinfo> 8356<refmeta> 8357 <refentrytitle><phrase>snd_ctl_notify</phrase></refentrytitle> 8358 <manvolnum>9</manvolnum> 8359 <refmiscinfo class="version">4.1.27</refmiscinfo> 8360</refmeta> 8361<refnamediv> 8362 <refname>snd_ctl_notify</refname> 8363 <refpurpose> 8364 Send notification to user-space for a control change 8365 </refpurpose> 8366</refnamediv> 8367<refsynopsisdiv> 8368 <title>Synopsis</title> 8369 <funcsynopsis><funcprototype> 8370 <funcdef>void <function>snd_ctl_notify </function></funcdef> 8371 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 8372 <paramdef>unsigned int <parameter>mask</parameter></paramdef> 8373 <paramdef>struct snd_ctl_elem_id * <parameter>id</parameter></paramdef> 8374 </funcprototype></funcsynopsis> 8375</refsynopsisdiv> 8376<refsect1> 8377 <title>Arguments</title> 8378 <variablelist> 8379 <varlistentry> 8380 <term><parameter>card</parameter></term> 8381 <listitem> 8382 <para> 8383 the card to send notification 8384 </para> 8385 </listitem> 8386 </varlistentry> 8387 <varlistentry> 8388 <term><parameter>mask</parameter></term> 8389 <listitem> 8390 <para> 8391 the event mask, SNDRV_CTL_EVENT_* 8392 </para> 8393 </listitem> 8394 </varlistentry> 8395 <varlistentry> 8396 <term><parameter>id</parameter></term> 8397 <listitem> 8398 <para> 8399 the ctl element id to send notification 8400 </para> 8401 </listitem> 8402 </varlistentry> 8403 </variablelist> 8404</refsect1> 8405<refsect1> 8406<title>Description</title> 8407<para> 8408 This function adds an event record with the given id and mask, appends 8409 to the list and wakes up the user-space for notification. This can be 8410 called in the atomic context. 8411</para> 8412</refsect1> 8413</refentry> 8414 8415<refentry id="API-snd-ctl-new1"> 8416<refentryinfo> 8417 <title>LINUX</title> 8418 <productname>Kernel Hackers Manual</productname> 8419 <date>July 2017</date> 8420</refentryinfo> 8421<refmeta> 8422 <refentrytitle><phrase>snd_ctl_new1</phrase></refentrytitle> 8423 <manvolnum>9</manvolnum> 8424 <refmiscinfo class="version">4.1.27</refmiscinfo> 8425</refmeta> 8426<refnamediv> 8427 <refname>snd_ctl_new1</refname> 8428 <refpurpose> 8429 create a control instance from the template 8430 </refpurpose> 8431</refnamediv> 8432<refsynopsisdiv> 8433 <title>Synopsis</title> 8434 <funcsynopsis><funcprototype> 8435 <funcdef>struct snd_kcontrol * <function>snd_ctl_new1 </function></funcdef> 8436 <paramdef>const struct snd_kcontrol_new * <parameter>ncontrol</parameter></paramdef> 8437 <paramdef>void * <parameter>private_data</parameter></paramdef> 8438 </funcprototype></funcsynopsis> 8439</refsynopsisdiv> 8440<refsect1> 8441 <title>Arguments</title> 8442 <variablelist> 8443 <varlistentry> 8444 <term><parameter>ncontrol</parameter></term> 8445 <listitem> 8446 <para> 8447 the initialization record 8448 </para> 8449 </listitem> 8450 </varlistentry> 8451 <varlistentry> 8452 <term><parameter>private_data</parameter></term> 8453 <listitem> 8454 <para> 8455 the private data to set 8456 </para> 8457 </listitem> 8458 </varlistentry> 8459 </variablelist> 8460</refsect1> 8461<refsect1> 8462<title>Description</title> 8463<para> 8464 Allocates a new struct snd_kcontrol instance and initialize from the given 8465 template. When the access field of ncontrol is 0, it's assumed as 8466 READWRITE access. When the count field is 0, it's assumes as one. 8467</para> 8468</refsect1> 8469<refsect1> 8470<title>Return</title> 8471<para> 8472 The pointer of the newly generated instance, or <constant>NULL</constant> on failure. 8473</para> 8474</refsect1> 8475</refentry> 8476 8477<refentry id="API-snd-ctl-free-one"> 8478<refentryinfo> 8479 <title>LINUX</title> 8480 <productname>Kernel Hackers Manual</productname> 8481 <date>July 2017</date> 8482</refentryinfo> 8483<refmeta> 8484 <refentrytitle><phrase>snd_ctl_free_one</phrase></refentrytitle> 8485 <manvolnum>9</manvolnum> 8486 <refmiscinfo class="version">4.1.27</refmiscinfo> 8487</refmeta> 8488<refnamediv> 8489 <refname>snd_ctl_free_one</refname> 8490 <refpurpose> 8491 release the control instance 8492 </refpurpose> 8493</refnamediv> 8494<refsynopsisdiv> 8495 <title>Synopsis</title> 8496 <funcsynopsis><funcprototype> 8497 <funcdef>void <function>snd_ctl_free_one </function></funcdef> 8498 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 8499 </funcprototype></funcsynopsis> 8500</refsynopsisdiv> 8501<refsect1> 8502 <title>Arguments</title> 8503 <variablelist> 8504 <varlistentry> 8505 <term><parameter>kcontrol</parameter></term> 8506 <listitem> 8507 <para> 8508 the control instance 8509 </para> 8510 </listitem> 8511 </varlistentry> 8512 </variablelist> 8513</refsect1> 8514<refsect1> 8515<title>Description</title> 8516<para> 8517 Releases the control instance created via <function>snd_ctl_new</function> 8518 or <function>snd_ctl_new1</function>. 8519 Don't call this after the control was added to the card. 8520</para> 8521</refsect1> 8522</refentry> 8523 8524<refentry id="API-snd-ctl-add"> 8525<refentryinfo> 8526 <title>LINUX</title> 8527 <productname>Kernel Hackers Manual</productname> 8528 <date>July 2017</date> 8529</refentryinfo> 8530<refmeta> 8531 <refentrytitle><phrase>snd_ctl_add</phrase></refentrytitle> 8532 <manvolnum>9</manvolnum> 8533 <refmiscinfo class="version">4.1.27</refmiscinfo> 8534</refmeta> 8535<refnamediv> 8536 <refname>snd_ctl_add</refname> 8537 <refpurpose> 8538 add the control instance to the card 8539 </refpurpose> 8540</refnamediv> 8541<refsynopsisdiv> 8542 <title>Synopsis</title> 8543 <funcsynopsis><funcprototype> 8544 <funcdef>int <function>snd_ctl_add </function></funcdef> 8545 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 8546 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 8547 </funcprototype></funcsynopsis> 8548</refsynopsisdiv> 8549<refsect1> 8550 <title>Arguments</title> 8551 <variablelist> 8552 <varlistentry> 8553 <term><parameter>card</parameter></term> 8554 <listitem> 8555 <para> 8556 the card instance 8557 </para> 8558 </listitem> 8559 </varlistentry> 8560 <varlistentry> 8561 <term><parameter>kcontrol</parameter></term> 8562 <listitem> 8563 <para> 8564 the control instance to add 8565 </para> 8566 </listitem> 8567 </varlistentry> 8568 </variablelist> 8569</refsect1> 8570<refsect1> 8571<title>Description</title> 8572<para> 8573 Adds the control instance created via <function>snd_ctl_new</function> or 8574 <function>snd_ctl_new1</function> to the given card. Assigns also an unique 8575 numid used for fast search. 8576 </para><para> 8577 8578 It frees automatically the control which cannot be added. 8579</para> 8580</refsect1> 8581<refsect1> 8582<title>Return</title> 8583<para> 8584 Zero if successful, or a negative error code on failure. 8585</para> 8586</refsect1> 8587</refentry> 8588 8589<refentry id="API-snd-ctl-replace"> 8590<refentryinfo> 8591 <title>LINUX</title> 8592 <productname>Kernel Hackers Manual</productname> 8593 <date>July 2017</date> 8594</refentryinfo> 8595<refmeta> 8596 <refentrytitle><phrase>snd_ctl_replace</phrase></refentrytitle> 8597 <manvolnum>9</manvolnum> 8598 <refmiscinfo class="version">4.1.27</refmiscinfo> 8599</refmeta> 8600<refnamediv> 8601 <refname>snd_ctl_replace</refname> 8602 <refpurpose> 8603 replace the control instance of the card 8604 </refpurpose> 8605</refnamediv> 8606<refsynopsisdiv> 8607 <title>Synopsis</title> 8608 <funcsynopsis><funcprototype> 8609 <funcdef>int <function>snd_ctl_replace </function></funcdef> 8610 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 8611 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 8612 <paramdef>bool <parameter>add_on_replace</parameter></paramdef> 8613 </funcprototype></funcsynopsis> 8614</refsynopsisdiv> 8615<refsect1> 8616 <title>Arguments</title> 8617 <variablelist> 8618 <varlistentry> 8619 <term><parameter>card</parameter></term> 8620 <listitem> 8621 <para> 8622 the card instance 8623 </para> 8624 </listitem> 8625 </varlistentry> 8626 <varlistentry> 8627 <term><parameter>kcontrol</parameter></term> 8628 <listitem> 8629 <para> 8630 the control instance to replace 8631 </para> 8632 </listitem> 8633 </varlistentry> 8634 <varlistentry> 8635 <term><parameter>add_on_replace</parameter></term> 8636 <listitem> 8637 <para> 8638 add the control if not already added 8639 </para> 8640 </listitem> 8641 </varlistentry> 8642 </variablelist> 8643</refsect1> 8644<refsect1> 8645<title>Description</title> 8646<para> 8647 Replaces the given control. If the given control does not exist 8648 and the add_on_replace flag is set, the control is added. If the 8649 control exists, it is destroyed first. 8650 </para><para> 8651 8652 It frees automatically the control which cannot be added or replaced. 8653</para> 8654</refsect1> 8655<refsect1> 8656<title>Return</title> 8657<para> 8658 Zero if successful, or a negative error code on failure. 8659</para> 8660</refsect1> 8661</refentry> 8662 8663<refentry id="API-snd-ctl-remove"> 8664<refentryinfo> 8665 <title>LINUX</title> 8666 <productname>Kernel Hackers Manual</productname> 8667 <date>July 2017</date> 8668</refentryinfo> 8669<refmeta> 8670 <refentrytitle><phrase>snd_ctl_remove</phrase></refentrytitle> 8671 <manvolnum>9</manvolnum> 8672 <refmiscinfo class="version">4.1.27</refmiscinfo> 8673</refmeta> 8674<refnamediv> 8675 <refname>snd_ctl_remove</refname> 8676 <refpurpose> 8677 remove the control from the card and release it 8678 </refpurpose> 8679</refnamediv> 8680<refsynopsisdiv> 8681 <title>Synopsis</title> 8682 <funcsynopsis><funcprototype> 8683 <funcdef>int <function>snd_ctl_remove </function></funcdef> 8684 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 8685 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 8686 </funcprototype></funcsynopsis> 8687</refsynopsisdiv> 8688<refsect1> 8689 <title>Arguments</title> 8690 <variablelist> 8691 <varlistentry> 8692 <term><parameter>card</parameter></term> 8693 <listitem> 8694 <para> 8695 the card instance 8696 </para> 8697 </listitem> 8698 </varlistentry> 8699 <varlistentry> 8700 <term><parameter>kcontrol</parameter></term> 8701 <listitem> 8702 <para> 8703 the control instance to remove 8704 </para> 8705 </listitem> 8706 </varlistentry> 8707 </variablelist> 8708</refsect1> 8709<refsect1> 8710<title>Description</title> 8711<para> 8712 Removes the control from the card and then releases the instance. 8713 You don't need to call <function>snd_ctl_free_one</function>. You must be in 8714 the write lock - down_write(<structname>card</structname>->controls_rwsem). 8715</para> 8716</refsect1> 8717<refsect1> 8718<title>Return</title> 8719<para> 8720 0 if successful, or a negative error code on failure. 8721</para> 8722</refsect1> 8723</refentry> 8724 8725<refentry id="API-snd-ctl-remove-id"> 8726<refentryinfo> 8727 <title>LINUX</title> 8728 <productname>Kernel Hackers Manual</productname> 8729 <date>July 2017</date> 8730</refentryinfo> 8731<refmeta> 8732 <refentrytitle><phrase>snd_ctl_remove_id</phrase></refentrytitle> 8733 <manvolnum>9</manvolnum> 8734 <refmiscinfo class="version">4.1.27</refmiscinfo> 8735</refmeta> 8736<refnamediv> 8737 <refname>snd_ctl_remove_id</refname> 8738 <refpurpose> 8739 remove the control of the given id and release it 8740 </refpurpose> 8741</refnamediv> 8742<refsynopsisdiv> 8743 <title>Synopsis</title> 8744 <funcsynopsis><funcprototype> 8745 <funcdef>int <function>snd_ctl_remove_id </function></funcdef> 8746 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 8747 <paramdef>struct snd_ctl_elem_id * <parameter>id</parameter></paramdef> 8748 </funcprototype></funcsynopsis> 8749</refsynopsisdiv> 8750<refsect1> 8751 <title>Arguments</title> 8752 <variablelist> 8753 <varlistentry> 8754 <term><parameter>card</parameter></term> 8755 <listitem> 8756 <para> 8757 the card instance 8758 </para> 8759 </listitem> 8760 </varlistentry> 8761 <varlistentry> 8762 <term><parameter>id</parameter></term> 8763 <listitem> 8764 <para> 8765 the control id to remove 8766 </para> 8767 </listitem> 8768 </varlistentry> 8769 </variablelist> 8770</refsect1> 8771<refsect1> 8772<title>Description</title> 8773<para> 8774 Finds the control instance with the given id, removes it from the 8775 card list and releases it. 8776</para> 8777</refsect1> 8778<refsect1> 8779<title>Return</title> 8780<para> 8781 0 if successful, or a negative error code on failure. 8782</para> 8783</refsect1> 8784</refentry> 8785 8786<refentry id="API-snd-ctl-activate-id"> 8787<refentryinfo> 8788 <title>LINUX</title> 8789 <productname>Kernel Hackers Manual</productname> 8790 <date>July 2017</date> 8791</refentryinfo> 8792<refmeta> 8793 <refentrytitle><phrase>snd_ctl_activate_id</phrase></refentrytitle> 8794 <manvolnum>9</manvolnum> 8795 <refmiscinfo class="version">4.1.27</refmiscinfo> 8796</refmeta> 8797<refnamediv> 8798 <refname>snd_ctl_activate_id</refname> 8799 <refpurpose> 8800 activate/inactivate the control of the given id 8801 </refpurpose> 8802</refnamediv> 8803<refsynopsisdiv> 8804 <title>Synopsis</title> 8805 <funcsynopsis><funcprototype> 8806 <funcdef>int <function>snd_ctl_activate_id </function></funcdef> 8807 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 8808 <paramdef>struct snd_ctl_elem_id * <parameter>id</parameter></paramdef> 8809 <paramdef>int <parameter>active</parameter></paramdef> 8810 </funcprototype></funcsynopsis> 8811</refsynopsisdiv> 8812<refsect1> 8813 <title>Arguments</title> 8814 <variablelist> 8815 <varlistentry> 8816 <term><parameter>card</parameter></term> 8817 <listitem> 8818 <para> 8819 the card instance 8820 </para> 8821 </listitem> 8822 </varlistentry> 8823 <varlistentry> 8824 <term><parameter>id</parameter></term> 8825 <listitem> 8826 <para> 8827 the control id to activate/inactivate 8828 </para> 8829 </listitem> 8830 </varlistentry> 8831 <varlistentry> 8832 <term><parameter>active</parameter></term> 8833 <listitem> 8834 <para> 8835 non-zero to activate 8836 </para> 8837 </listitem> 8838 </varlistentry> 8839 </variablelist> 8840</refsect1> 8841<refsect1> 8842<title>Description</title> 8843<para> 8844 Finds the control instance with the given id, and activate or 8845 inactivate the control together with notification, if changed. 8846 The given ID data is filled with full information. 8847</para> 8848</refsect1> 8849<refsect1> 8850<title>Return</title> 8851<para> 8852 0 if unchanged, 1 if changed, or a negative error code on failure. 8853</para> 8854</refsect1> 8855</refentry> 8856 8857<refentry id="API-snd-ctl-rename-id"> 8858<refentryinfo> 8859 <title>LINUX</title> 8860 <productname>Kernel Hackers Manual</productname> 8861 <date>July 2017</date> 8862</refentryinfo> 8863<refmeta> 8864 <refentrytitle><phrase>snd_ctl_rename_id</phrase></refentrytitle> 8865 <manvolnum>9</manvolnum> 8866 <refmiscinfo class="version">4.1.27</refmiscinfo> 8867</refmeta> 8868<refnamediv> 8869 <refname>snd_ctl_rename_id</refname> 8870 <refpurpose> 8871 replace the id of a control on the card 8872 </refpurpose> 8873</refnamediv> 8874<refsynopsisdiv> 8875 <title>Synopsis</title> 8876 <funcsynopsis><funcprototype> 8877 <funcdef>int <function>snd_ctl_rename_id </function></funcdef> 8878 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 8879 <paramdef>struct snd_ctl_elem_id * <parameter>src_id</parameter></paramdef> 8880 <paramdef>struct snd_ctl_elem_id * <parameter>dst_id</parameter></paramdef> 8881 </funcprototype></funcsynopsis> 8882</refsynopsisdiv> 8883<refsect1> 8884 <title>Arguments</title> 8885 <variablelist> 8886 <varlistentry> 8887 <term><parameter>card</parameter></term> 8888 <listitem> 8889 <para> 8890 the card instance 8891 </para> 8892 </listitem> 8893 </varlistentry> 8894 <varlistentry> 8895 <term><parameter>src_id</parameter></term> 8896 <listitem> 8897 <para> 8898 the old id 8899 </para> 8900 </listitem> 8901 </varlistentry> 8902 <varlistentry> 8903 <term><parameter>dst_id</parameter></term> 8904 <listitem> 8905 <para> 8906 the new id 8907 </para> 8908 </listitem> 8909 </varlistentry> 8910 </variablelist> 8911</refsect1> 8912<refsect1> 8913<title>Description</title> 8914<para> 8915 Finds the control with the old id from the card, and replaces the 8916 id with the new one. 8917</para> 8918</refsect1> 8919<refsect1> 8920<title>Return</title> 8921<para> 8922 Zero if successful, or a negative error code on failure. 8923</para> 8924</refsect1> 8925</refentry> 8926 8927<refentry id="API-snd-ctl-find-numid"> 8928<refentryinfo> 8929 <title>LINUX</title> 8930 <productname>Kernel Hackers Manual</productname> 8931 <date>July 2017</date> 8932</refentryinfo> 8933<refmeta> 8934 <refentrytitle><phrase>snd_ctl_find_numid</phrase></refentrytitle> 8935 <manvolnum>9</manvolnum> 8936 <refmiscinfo class="version">4.1.27</refmiscinfo> 8937</refmeta> 8938<refnamediv> 8939 <refname>snd_ctl_find_numid</refname> 8940 <refpurpose> 8941 find the control instance with the given number-id 8942 </refpurpose> 8943</refnamediv> 8944<refsynopsisdiv> 8945 <title>Synopsis</title> 8946 <funcsynopsis><funcprototype> 8947 <funcdef>struct snd_kcontrol * <function>snd_ctl_find_numid </function></funcdef> 8948 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 8949 <paramdef>unsigned int <parameter>numid</parameter></paramdef> 8950 </funcprototype></funcsynopsis> 8951</refsynopsisdiv> 8952<refsect1> 8953 <title>Arguments</title> 8954 <variablelist> 8955 <varlistentry> 8956 <term><parameter>card</parameter></term> 8957 <listitem> 8958 <para> 8959 the card instance 8960 </para> 8961 </listitem> 8962 </varlistentry> 8963 <varlistentry> 8964 <term><parameter>numid</parameter></term> 8965 <listitem> 8966 <para> 8967 the number-id to search 8968 </para> 8969 </listitem> 8970 </varlistentry> 8971 </variablelist> 8972</refsect1> 8973<refsect1> 8974<title>Description</title> 8975<para> 8976 Finds the control instance with the given number-id from the card. 8977 </para><para> 8978 8979 The caller must down card->controls_rwsem before calling this function 8980 (if the race condition can happen). 8981</para> 8982</refsect1> 8983<refsect1> 8984<title>Return</title> 8985<para> 8986 The pointer of the instance if found, or <constant>NULL</constant> if not. 8987</para> 8988</refsect1> 8989</refentry> 8990 8991<refentry id="API-snd-ctl-find-id"> 8992<refentryinfo> 8993 <title>LINUX</title> 8994 <productname>Kernel Hackers Manual</productname> 8995 <date>July 2017</date> 8996</refentryinfo> 8997<refmeta> 8998 <refentrytitle><phrase>snd_ctl_find_id</phrase></refentrytitle> 8999 <manvolnum>9</manvolnum> 9000 <refmiscinfo class="version">4.1.27</refmiscinfo> 9001</refmeta> 9002<refnamediv> 9003 <refname>snd_ctl_find_id</refname> 9004 <refpurpose> 9005 find the control instance with the given id 9006 </refpurpose> 9007</refnamediv> 9008<refsynopsisdiv> 9009 <title>Synopsis</title> 9010 <funcsynopsis><funcprototype> 9011 <funcdef>struct snd_kcontrol * <function>snd_ctl_find_id </function></funcdef> 9012 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 9013 <paramdef>struct snd_ctl_elem_id * <parameter>id</parameter></paramdef> 9014 </funcprototype></funcsynopsis> 9015</refsynopsisdiv> 9016<refsect1> 9017 <title>Arguments</title> 9018 <variablelist> 9019 <varlistentry> 9020 <term><parameter>card</parameter></term> 9021 <listitem> 9022 <para> 9023 the card instance 9024 </para> 9025 </listitem> 9026 </varlistentry> 9027 <varlistentry> 9028 <term><parameter>id</parameter></term> 9029 <listitem> 9030 <para> 9031 the id to search 9032 </para> 9033 </listitem> 9034 </varlistentry> 9035 </variablelist> 9036</refsect1> 9037<refsect1> 9038<title>Description</title> 9039<para> 9040 Finds the control instance with the given id from the card. 9041 </para><para> 9042 9043 The caller must down card->controls_rwsem before calling this function 9044 (if the race condition can happen). 9045</para> 9046</refsect1> 9047<refsect1> 9048<title>Return</title> 9049<para> 9050 The pointer of the instance if found, or <constant>NULL</constant> if not. 9051</para> 9052</refsect1> 9053</refentry> 9054 9055<refentry id="API-snd-ctl-register-ioctl"> 9056<refentryinfo> 9057 <title>LINUX</title> 9058 <productname>Kernel Hackers Manual</productname> 9059 <date>July 2017</date> 9060</refentryinfo> 9061<refmeta> 9062 <refentrytitle><phrase>snd_ctl_register_ioctl</phrase></refentrytitle> 9063 <manvolnum>9</manvolnum> 9064 <refmiscinfo class="version">4.1.27</refmiscinfo> 9065</refmeta> 9066<refnamediv> 9067 <refname>snd_ctl_register_ioctl</refname> 9068 <refpurpose> 9069 register the device-specific control-ioctls 9070 </refpurpose> 9071</refnamediv> 9072<refsynopsisdiv> 9073 <title>Synopsis</title> 9074 <funcsynopsis><funcprototype> 9075 <funcdef>int <function>snd_ctl_register_ioctl </function></funcdef> 9076 <paramdef>snd_kctl_ioctl_func_t <parameter>fcn</parameter></paramdef> 9077 </funcprototype></funcsynopsis> 9078</refsynopsisdiv> 9079<refsect1> 9080 <title>Arguments</title> 9081 <variablelist> 9082 <varlistentry> 9083 <term><parameter>fcn</parameter></term> 9084 <listitem> 9085 <para> 9086 ioctl callback function 9087 </para> 9088 </listitem> 9089 </varlistentry> 9090 </variablelist> 9091</refsect1> 9092<refsect1> 9093<title>Description</title> 9094<para> 9095 called from each device manager like pcm.c, hwdep.c, etc. 9096</para> 9097</refsect1> 9098</refentry> 9099 9100<refentry id="API-snd-ctl-register-ioctl-compat"> 9101<refentryinfo> 9102 <title>LINUX</title> 9103 <productname>Kernel Hackers Manual</productname> 9104 <date>July 2017</date> 9105</refentryinfo> 9106<refmeta> 9107 <refentrytitle><phrase>snd_ctl_register_ioctl_compat</phrase></refentrytitle> 9108 <manvolnum>9</manvolnum> 9109 <refmiscinfo class="version">4.1.27</refmiscinfo> 9110</refmeta> 9111<refnamediv> 9112 <refname>snd_ctl_register_ioctl_compat</refname> 9113 <refpurpose> 9114 register the device-specific 32bit compat control-ioctls 9115 </refpurpose> 9116</refnamediv> 9117<refsynopsisdiv> 9118 <title>Synopsis</title> 9119 <funcsynopsis><funcprototype> 9120 <funcdef>int <function>snd_ctl_register_ioctl_compat </function></funcdef> 9121 <paramdef>snd_kctl_ioctl_func_t <parameter>fcn</parameter></paramdef> 9122 </funcprototype></funcsynopsis> 9123</refsynopsisdiv> 9124<refsect1> 9125 <title>Arguments</title> 9126 <variablelist> 9127 <varlistentry> 9128 <term><parameter>fcn</parameter></term> 9129 <listitem> 9130 <para> 9131 ioctl callback function 9132 </para> 9133 </listitem> 9134 </varlistentry> 9135 </variablelist> 9136</refsect1> 9137</refentry> 9138 9139<refentry id="API-snd-ctl-unregister-ioctl"> 9140<refentryinfo> 9141 <title>LINUX</title> 9142 <productname>Kernel Hackers Manual</productname> 9143 <date>July 2017</date> 9144</refentryinfo> 9145<refmeta> 9146 <refentrytitle><phrase>snd_ctl_unregister_ioctl</phrase></refentrytitle> 9147 <manvolnum>9</manvolnum> 9148 <refmiscinfo class="version">4.1.27</refmiscinfo> 9149</refmeta> 9150<refnamediv> 9151 <refname>snd_ctl_unregister_ioctl</refname> 9152 <refpurpose> 9153 de-register the device-specific control-ioctls 9154 </refpurpose> 9155</refnamediv> 9156<refsynopsisdiv> 9157 <title>Synopsis</title> 9158 <funcsynopsis><funcprototype> 9159 <funcdef>int <function>snd_ctl_unregister_ioctl </function></funcdef> 9160 <paramdef>snd_kctl_ioctl_func_t <parameter>fcn</parameter></paramdef> 9161 </funcprototype></funcsynopsis> 9162</refsynopsisdiv> 9163<refsect1> 9164 <title>Arguments</title> 9165 <variablelist> 9166 <varlistentry> 9167 <term><parameter>fcn</parameter></term> 9168 <listitem> 9169 <para> 9170 ioctl callback function to unregister 9171 </para> 9172 </listitem> 9173 </varlistentry> 9174 </variablelist> 9175</refsect1> 9176</refentry> 9177 9178<refentry id="API-snd-ctl-unregister-ioctl-compat"> 9179<refentryinfo> 9180 <title>LINUX</title> 9181 <productname>Kernel Hackers Manual</productname> 9182 <date>July 2017</date> 9183</refentryinfo> 9184<refmeta> 9185 <refentrytitle><phrase>snd_ctl_unregister_ioctl_compat</phrase></refentrytitle> 9186 <manvolnum>9</manvolnum> 9187 <refmiscinfo class="version">4.1.27</refmiscinfo> 9188</refmeta> 9189<refnamediv> 9190 <refname>snd_ctl_unregister_ioctl_compat</refname> 9191 <refpurpose> 9192 de-register the device-specific compat 32bit control-ioctls 9193 </refpurpose> 9194</refnamediv> 9195<refsynopsisdiv> 9196 <title>Synopsis</title> 9197 <funcsynopsis><funcprototype> 9198 <funcdef>int <function>snd_ctl_unregister_ioctl_compat </function></funcdef> 9199 <paramdef>snd_kctl_ioctl_func_t <parameter>fcn</parameter></paramdef> 9200 </funcprototype></funcsynopsis> 9201</refsynopsisdiv> 9202<refsect1> 9203 <title>Arguments</title> 9204 <variablelist> 9205 <varlistentry> 9206 <term><parameter>fcn</parameter></term> 9207 <listitem> 9208 <para> 9209 ioctl callback function to unregister 9210 </para> 9211 </listitem> 9212 </varlistentry> 9213 </variablelist> 9214</refsect1> 9215</refentry> 9216 9217<refentry id="API-snd-ctl-boolean-mono-info"> 9218<refentryinfo> 9219 <title>LINUX</title> 9220 <productname>Kernel Hackers Manual</productname> 9221 <date>July 2017</date> 9222</refentryinfo> 9223<refmeta> 9224 <refentrytitle><phrase>snd_ctl_boolean_mono_info</phrase></refentrytitle> 9225 <manvolnum>9</manvolnum> 9226 <refmiscinfo class="version">4.1.27</refmiscinfo> 9227</refmeta> 9228<refnamediv> 9229 <refname>snd_ctl_boolean_mono_info</refname> 9230 <refpurpose> 9231 Helper function for a standard boolean info callback with a mono channel 9232 </refpurpose> 9233</refnamediv> 9234<refsynopsisdiv> 9235 <title>Synopsis</title> 9236 <funcsynopsis><funcprototype> 9237 <funcdef>int <function>snd_ctl_boolean_mono_info </function></funcdef> 9238 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 9239 <paramdef>struct snd_ctl_elem_info * <parameter>uinfo</parameter></paramdef> 9240 </funcprototype></funcsynopsis> 9241</refsynopsisdiv> 9242<refsect1> 9243 <title>Arguments</title> 9244 <variablelist> 9245 <varlistentry> 9246 <term><parameter>kcontrol</parameter></term> 9247 <listitem> 9248 <para> 9249 the kcontrol instance 9250 </para> 9251 </listitem> 9252 </varlistentry> 9253 <varlistentry> 9254 <term><parameter>uinfo</parameter></term> 9255 <listitem> 9256 <para> 9257 info to store 9258 </para> 9259 </listitem> 9260 </varlistentry> 9261 </variablelist> 9262</refsect1> 9263<refsect1> 9264<title>Description</title> 9265<para> 9266 This is a function that can be used as info callback for a standard 9267 boolean control with a single mono channel. 9268</para> 9269</refsect1> 9270</refentry> 9271 9272<refentry id="API-snd-ctl-boolean-stereo-info"> 9273<refentryinfo> 9274 <title>LINUX</title> 9275 <productname>Kernel Hackers Manual</productname> 9276 <date>July 2017</date> 9277</refentryinfo> 9278<refmeta> 9279 <refentrytitle><phrase>snd_ctl_boolean_stereo_info</phrase></refentrytitle> 9280 <manvolnum>9</manvolnum> 9281 <refmiscinfo class="version">4.1.27</refmiscinfo> 9282</refmeta> 9283<refnamediv> 9284 <refname>snd_ctl_boolean_stereo_info</refname> 9285 <refpurpose> 9286 Helper function for a standard boolean info callback with stereo two channels 9287 </refpurpose> 9288</refnamediv> 9289<refsynopsisdiv> 9290 <title>Synopsis</title> 9291 <funcsynopsis><funcprototype> 9292 <funcdef>int <function>snd_ctl_boolean_stereo_info </function></funcdef> 9293 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 9294 <paramdef>struct snd_ctl_elem_info * <parameter>uinfo</parameter></paramdef> 9295 </funcprototype></funcsynopsis> 9296</refsynopsisdiv> 9297<refsect1> 9298 <title>Arguments</title> 9299 <variablelist> 9300 <varlistentry> 9301 <term><parameter>kcontrol</parameter></term> 9302 <listitem> 9303 <para> 9304 the kcontrol instance 9305 </para> 9306 </listitem> 9307 </varlistentry> 9308 <varlistentry> 9309 <term><parameter>uinfo</parameter></term> 9310 <listitem> 9311 <para> 9312 info to store 9313 </para> 9314 </listitem> 9315 </varlistentry> 9316 </variablelist> 9317</refsect1> 9318<refsect1> 9319<title>Description</title> 9320<para> 9321 This is a function that can be used as info callback for a standard 9322 boolean control with stereo two channels. 9323</para> 9324</refsect1> 9325</refentry> 9326 9327<refentry id="API-snd-ctl-enum-info"> 9328<refentryinfo> 9329 <title>LINUX</title> 9330 <productname>Kernel Hackers Manual</productname> 9331 <date>July 2017</date> 9332</refentryinfo> 9333<refmeta> 9334 <refentrytitle><phrase>snd_ctl_enum_info</phrase></refentrytitle> 9335 <manvolnum>9</manvolnum> 9336 <refmiscinfo class="version">4.1.27</refmiscinfo> 9337</refmeta> 9338<refnamediv> 9339 <refname>snd_ctl_enum_info</refname> 9340 <refpurpose> 9341 fills the info structure for an enumerated control 9342 </refpurpose> 9343</refnamediv> 9344<refsynopsisdiv> 9345 <title>Synopsis</title> 9346 <funcsynopsis><funcprototype> 9347 <funcdef>int <function>snd_ctl_enum_info </function></funcdef> 9348 <paramdef>struct snd_ctl_elem_info * <parameter>info</parameter></paramdef> 9349 <paramdef>unsigned int <parameter>channels</parameter></paramdef> 9350 <paramdef>unsigned int <parameter>items</parameter></paramdef> 9351 <paramdef>const char *const <parameter>names[]</parameter></paramdef> 9352 </funcprototype></funcsynopsis> 9353</refsynopsisdiv> 9354<refsect1> 9355 <title>Arguments</title> 9356 <variablelist> 9357 <varlistentry> 9358 <term><parameter>info</parameter></term> 9359 <listitem> 9360 <para> 9361 the structure to be filled 9362 </para> 9363 </listitem> 9364 </varlistentry> 9365 <varlistentry> 9366 <term><parameter>channels</parameter></term> 9367 <listitem> 9368 <para> 9369 the number of the control's channels; often one 9370 </para> 9371 </listitem> 9372 </varlistentry> 9373 <varlistentry> 9374 <term><parameter>items</parameter></term> 9375 <listitem> 9376 <para> 9377 the number of control values; also the size of <parameter>names</parameter> 9378 </para> 9379 </listitem> 9380 </varlistentry> 9381 <varlistentry> 9382 <term><parameter>names[]</parameter></term> 9383 <listitem> 9384 <para> 9385 an array containing the names of all control values 9386 </para> 9387 </listitem> 9388 </varlistentry> 9389 </variablelist> 9390</refsect1> 9391<refsect1> 9392<title>Description</title> 9393<para> 9394 Sets all required fields in <parameter>info</parameter> to their appropriate values. 9395 If the control's accessibility is not the default (readable and writable), 9396 the caller has to fill <parameter>info</parameter>->access. 9397</para> 9398</refsect1> 9399<refsect1> 9400<title>Return</title> 9401<para> 9402 Zero. 9403</para> 9404</refsect1> 9405</refentry> 9406 9407 </sect1> 9408 <sect1><title>AC97 Codec API</title> 9409<!-- sound/pci/ac97/ac97_codec.c --> 9410<refentry id="API-snd-ac97-write"> 9411<refentryinfo> 9412 <title>LINUX</title> 9413 <productname>Kernel Hackers Manual</productname> 9414 <date>July 2017</date> 9415</refentryinfo> 9416<refmeta> 9417 <refentrytitle><phrase>snd_ac97_write</phrase></refentrytitle> 9418 <manvolnum>9</manvolnum> 9419 <refmiscinfo class="version">4.1.27</refmiscinfo> 9420</refmeta> 9421<refnamediv> 9422 <refname>snd_ac97_write</refname> 9423 <refpurpose> 9424 write a value on the given register 9425 </refpurpose> 9426</refnamediv> 9427<refsynopsisdiv> 9428 <title>Synopsis</title> 9429 <funcsynopsis><funcprototype> 9430 <funcdef>void <function>snd_ac97_write </function></funcdef> 9431 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 9432 <paramdef>unsigned short <parameter>reg</parameter></paramdef> 9433 <paramdef>unsigned short <parameter>value</parameter></paramdef> 9434 </funcprototype></funcsynopsis> 9435</refsynopsisdiv> 9436<refsect1> 9437 <title>Arguments</title> 9438 <variablelist> 9439 <varlistentry> 9440 <term><parameter>ac97</parameter></term> 9441 <listitem> 9442 <para> 9443 the ac97 instance 9444 </para> 9445 </listitem> 9446 </varlistentry> 9447 <varlistentry> 9448 <term><parameter>reg</parameter></term> 9449 <listitem> 9450 <para> 9451 the register to change 9452 </para> 9453 </listitem> 9454 </varlistentry> 9455 <varlistentry> 9456 <term><parameter>value</parameter></term> 9457 <listitem> 9458 <para> 9459 the value to set 9460 </para> 9461 </listitem> 9462 </varlistentry> 9463 </variablelist> 9464</refsect1> 9465<refsect1> 9466<title>Description</title> 9467<para> 9468 Writes a value on the given register. This will invoke the write 9469 callback directly after the register check. 9470 This function doesn't change the register cache unlike 9471 #<function>snd_ca97_write_cache</function>, so use this only when you don't want to 9472 reflect the change to the suspend/resume state. 9473</para> 9474</refsect1> 9475</refentry> 9476 9477<refentry id="API-snd-ac97-read"> 9478<refentryinfo> 9479 <title>LINUX</title> 9480 <productname>Kernel Hackers Manual</productname> 9481 <date>July 2017</date> 9482</refentryinfo> 9483<refmeta> 9484 <refentrytitle><phrase>snd_ac97_read</phrase></refentrytitle> 9485 <manvolnum>9</manvolnum> 9486 <refmiscinfo class="version">4.1.27</refmiscinfo> 9487</refmeta> 9488<refnamediv> 9489 <refname>snd_ac97_read</refname> 9490 <refpurpose> 9491 read a value from the given register 9492 </refpurpose> 9493</refnamediv> 9494<refsynopsisdiv> 9495 <title>Synopsis</title> 9496 <funcsynopsis><funcprototype> 9497 <funcdef>unsigned short <function>snd_ac97_read </function></funcdef> 9498 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 9499 <paramdef>unsigned short <parameter>reg</parameter></paramdef> 9500 </funcprototype></funcsynopsis> 9501</refsynopsisdiv> 9502<refsect1> 9503 <title>Arguments</title> 9504 <variablelist> 9505 <varlistentry> 9506 <term><parameter>ac97</parameter></term> 9507 <listitem> 9508 <para> 9509 the ac97 instance 9510 </para> 9511 </listitem> 9512 </varlistentry> 9513 <varlistentry> 9514 <term><parameter>reg</parameter></term> 9515 <listitem> 9516 <para> 9517 the register to read 9518 </para> 9519 </listitem> 9520 </varlistentry> 9521 </variablelist> 9522</refsect1> 9523<refsect1> 9524<title>Description</title> 9525<para> 9526 Reads a value from the given register. This will invoke the read 9527 callback directly after the register check. 9528</para> 9529</refsect1> 9530<refsect1> 9531<title>Return</title> 9532<para> 9533 The read value. 9534</para> 9535</refsect1> 9536</refentry> 9537 9538<refentry id="API-snd-ac97-write-cache"> 9539<refentryinfo> 9540 <title>LINUX</title> 9541 <productname>Kernel Hackers Manual</productname> 9542 <date>July 2017</date> 9543</refentryinfo> 9544<refmeta> 9545 <refentrytitle><phrase>snd_ac97_write_cache</phrase></refentrytitle> 9546 <manvolnum>9</manvolnum> 9547 <refmiscinfo class="version">4.1.27</refmiscinfo> 9548</refmeta> 9549<refnamediv> 9550 <refname>snd_ac97_write_cache</refname> 9551 <refpurpose> 9552 write a value on the given register and update the cache 9553 </refpurpose> 9554</refnamediv> 9555<refsynopsisdiv> 9556 <title>Synopsis</title> 9557 <funcsynopsis><funcprototype> 9558 <funcdef>void <function>snd_ac97_write_cache </function></funcdef> 9559 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 9560 <paramdef>unsigned short <parameter>reg</parameter></paramdef> 9561 <paramdef>unsigned short <parameter>value</parameter></paramdef> 9562 </funcprototype></funcsynopsis> 9563</refsynopsisdiv> 9564<refsect1> 9565 <title>Arguments</title> 9566 <variablelist> 9567 <varlistentry> 9568 <term><parameter>ac97</parameter></term> 9569 <listitem> 9570 <para> 9571 the ac97 instance 9572 </para> 9573 </listitem> 9574 </varlistentry> 9575 <varlistentry> 9576 <term><parameter>reg</parameter></term> 9577 <listitem> 9578 <para> 9579 the register to change 9580 </para> 9581 </listitem> 9582 </varlistentry> 9583 <varlistentry> 9584 <term><parameter>value</parameter></term> 9585 <listitem> 9586 <para> 9587 the value to set 9588 </para> 9589 </listitem> 9590 </varlistentry> 9591 </variablelist> 9592</refsect1> 9593<refsect1> 9594<title>Description</title> 9595<para> 9596 Writes a value on the given register and updates the register 9597 cache. The cached values are used for the cached-read and the 9598 suspend/resume. 9599</para> 9600</refsect1> 9601</refentry> 9602 9603<refentry id="API-snd-ac97-update"> 9604<refentryinfo> 9605 <title>LINUX</title> 9606 <productname>Kernel Hackers Manual</productname> 9607 <date>July 2017</date> 9608</refentryinfo> 9609<refmeta> 9610 <refentrytitle><phrase>snd_ac97_update</phrase></refentrytitle> 9611 <manvolnum>9</manvolnum> 9612 <refmiscinfo class="version">4.1.27</refmiscinfo> 9613</refmeta> 9614<refnamediv> 9615 <refname>snd_ac97_update</refname> 9616 <refpurpose> 9617 update the value on the given register 9618 </refpurpose> 9619</refnamediv> 9620<refsynopsisdiv> 9621 <title>Synopsis</title> 9622 <funcsynopsis><funcprototype> 9623 <funcdef>int <function>snd_ac97_update </function></funcdef> 9624 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 9625 <paramdef>unsigned short <parameter>reg</parameter></paramdef> 9626 <paramdef>unsigned short <parameter>value</parameter></paramdef> 9627 </funcprototype></funcsynopsis> 9628</refsynopsisdiv> 9629<refsect1> 9630 <title>Arguments</title> 9631 <variablelist> 9632 <varlistentry> 9633 <term><parameter>ac97</parameter></term> 9634 <listitem> 9635 <para> 9636 the ac97 instance 9637 </para> 9638 </listitem> 9639 </varlistentry> 9640 <varlistentry> 9641 <term><parameter>reg</parameter></term> 9642 <listitem> 9643 <para> 9644 the register to change 9645 </para> 9646 </listitem> 9647 </varlistentry> 9648 <varlistentry> 9649 <term><parameter>value</parameter></term> 9650 <listitem> 9651 <para> 9652 the value to set 9653 </para> 9654 </listitem> 9655 </varlistentry> 9656 </variablelist> 9657</refsect1> 9658<refsect1> 9659<title>Description</title> 9660<para> 9661 Compares the value with the register cache and updates the value 9662 only when the value is changed. 9663</para> 9664</refsect1> 9665<refsect1> 9666<title>Return</title> 9667<para> 9668 1 if the value is changed, 0 if no change, or a negative 9669 code on failure. 9670</para> 9671</refsect1> 9672</refentry> 9673 9674<refentry id="API-snd-ac97-update-bits"> 9675<refentryinfo> 9676 <title>LINUX</title> 9677 <productname>Kernel Hackers Manual</productname> 9678 <date>July 2017</date> 9679</refentryinfo> 9680<refmeta> 9681 <refentrytitle><phrase>snd_ac97_update_bits</phrase></refentrytitle> 9682 <manvolnum>9</manvolnum> 9683 <refmiscinfo class="version">4.1.27</refmiscinfo> 9684</refmeta> 9685<refnamediv> 9686 <refname>snd_ac97_update_bits</refname> 9687 <refpurpose> 9688 update the bits on the given register 9689 </refpurpose> 9690</refnamediv> 9691<refsynopsisdiv> 9692 <title>Synopsis</title> 9693 <funcsynopsis><funcprototype> 9694 <funcdef>int <function>snd_ac97_update_bits </function></funcdef> 9695 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 9696 <paramdef>unsigned short <parameter>reg</parameter></paramdef> 9697 <paramdef>unsigned short <parameter>mask</parameter></paramdef> 9698 <paramdef>unsigned short <parameter>value</parameter></paramdef> 9699 </funcprototype></funcsynopsis> 9700</refsynopsisdiv> 9701<refsect1> 9702 <title>Arguments</title> 9703 <variablelist> 9704 <varlistentry> 9705 <term><parameter>ac97</parameter></term> 9706 <listitem> 9707 <para> 9708 the ac97 instance 9709 </para> 9710 </listitem> 9711 </varlistentry> 9712 <varlistentry> 9713 <term><parameter>reg</parameter></term> 9714 <listitem> 9715 <para> 9716 the register to change 9717 </para> 9718 </listitem> 9719 </varlistentry> 9720 <varlistentry> 9721 <term><parameter>mask</parameter></term> 9722 <listitem> 9723 <para> 9724 the bit-mask to change 9725 </para> 9726 </listitem> 9727 </varlistentry> 9728 <varlistentry> 9729 <term><parameter>value</parameter></term> 9730 <listitem> 9731 <para> 9732 the value to set 9733 </para> 9734 </listitem> 9735 </varlistentry> 9736 </variablelist> 9737</refsect1> 9738<refsect1> 9739<title>Description</title> 9740<para> 9741 Updates the masked-bits on the given register only when the value 9742 is changed. 9743</para> 9744</refsect1> 9745<refsect1> 9746<title>Return</title> 9747<para> 9748 1 if the bits are changed, 0 if no change, or a negative 9749 code on failure. 9750</para> 9751</refsect1> 9752</refentry> 9753 9754<refentry id="API-snd-ac97-get-short-name"> 9755<refentryinfo> 9756 <title>LINUX</title> 9757 <productname>Kernel Hackers Manual</productname> 9758 <date>July 2017</date> 9759</refentryinfo> 9760<refmeta> 9761 <refentrytitle><phrase>snd_ac97_get_short_name</phrase></refentrytitle> 9762 <manvolnum>9</manvolnum> 9763 <refmiscinfo class="version">4.1.27</refmiscinfo> 9764</refmeta> 9765<refnamediv> 9766 <refname>snd_ac97_get_short_name</refname> 9767 <refpurpose> 9768 retrieve codec name 9769 </refpurpose> 9770</refnamediv> 9771<refsynopsisdiv> 9772 <title>Synopsis</title> 9773 <funcsynopsis><funcprototype> 9774 <funcdef>const char * <function>snd_ac97_get_short_name </function></funcdef> 9775 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 9776 </funcprototype></funcsynopsis> 9777</refsynopsisdiv> 9778<refsect1> 9779 <title>Arguments</title> 9780 <variablelist> 9781 <varlistentry> 9782 <term><parameter>ac97</parameter></term> 9783 <listitem> 9784 <para> 9785 the codec instance 9786 </para> 9787 </listitem> 9788 </varlistentry> 9789 </variablelist> 9790</refsect1> 9791<refsect1> 9792<title>Return</title> 9793<para> 9794 The short identifying name of the codec. 9795</para> 9796</refsect1> 9797</refentry> 9798 9799<refentry id="API-snd-ac97-bus"> 9800<refentryinfo> 9801 <title>LINUX</title> 9802 <productname>Kernel Hackers Manual</productname> 9803 <date>July 2017</date> 9804</refentryinfo> 9805<refmeta> 9806 <refentrytitle><phrase>snd_ac97_bus</phrase></refentrytitle> 9807 <manvolnum>9</manvolnum> 9808 <refmiscinfo class="version">4.1.27</refmiscinfo> 9809</refmeta> 9810<refnamediv> 9811 <refname>snd_ac97_bus</refname> 9812 <refpurpose> 9813 create an AC97 bus component 9814 </refpurpose> 9815</refnamediv> 9816<refsynopsisdiv> 9817 <title>Synopsis</title> 9818 <funcsynopsis><funcprototype> 9819 <funcdef>int <function>snd_ac97_bus </function></funcdef> 9820 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 9821 <paramdef>int <parameter>num</parameter></paramdef> 9822 <paramdef>struct snd_ac97_bus_ops * <parameter>ops</parameter></paramdef> 9823 <paramdef>void * <parameter>private_data</parameter></paramdef> 9824 <paramdef>struct snd_ac97_bus ** <parameter>rbus</parameter></paramdef> 9825 </funcprototype></funcsynopsis> 9826</refsynopsisdiv> 9827<refsect1> 9828 <title>Arguments</title> 9829 <variablelist> 9830 <varlistentry> 9831 <term><parameter>card</parameter></term> 9832 <listitem> 9833 <para> 9834 the card instance 9835 </para> 9836 </listitem> 9837 </varlistentry> 9838 <varlistentry> 9839 <term><parameter>num</parameter></term> 9840 <listitem> 9841 <para> 9842 the bus number 9843 </para> 9844 </listitem> 9845 </varlistentry> 9846 <varlistentry> 9847 <term><parameter>ops</parameter></term> 9848 <listitem> 9849 <para> 9850 the bus callbacks table 9851 </para> 9852 </listitem> 9853 </varlistentry> 9854 <varlistentry> 9855 <term><parameter>private_data</parameter></term> 9856 <listitem> 9857 <para> 9858 private data pointer for the new instance 9859 </para> 9860 </listitem> 9861 </varlistentry> 9862 <varlistentry> 9863 <term><parameter>rbus</parameter></term> 9864 <listitem> 9865 <para> 9866 the pointer to store the new AC97 bus instance. 9867 </para> 9868 </listitem> 9869 </varlistentry> 9870 </variablelist> 9871</refsect1> 9872<refsect1> 9873<title>Description</title> 9874<para> 9875 Creates an AC97 bus component. An struct snd_ac97_bus instance is newly 9876 allocated and initialized. 9877 </para><para> 9878 9879 The ops table must include valid callbacks (at least read and 9880 write). The other callbacks, wait and reset, are not mandatory. 9881 </para><para> 9882 9883 The clock is set to 48000. If another clock is needed, set 9884 (*rbus)->clock manually. 9885 </para><para> 9886 9887 The AC97 bus instance is registered as a low-level device, so you don't 9888 have to release it manually. 9889</para> 9890</refsect1> 9891<refsect1> 9892<title>Return</title> 9893<para> 9894 Zero if successful, or a negative error code on failure. 9895</para> 9896</refsect1> 9897</refentry> 9898 9899<refentry id="API-snd-ac97-mixer"> 9900<refentryinfo> 9901 <title>LINUX</title> 9902 <productname>Kernel Hackers Manual</productname> 9903 <date>July 2017</date> 9904</refentryinfo> 9905<refmeta> 9906 <refentrytitle><phrase>snd_ac97_mixer</phrase></refentrytitle> 9907 <manvolnum>9</manvolnum> 9908 <refmiscinfo class="version">4.1.27</refmiscinfo> 9909</refmeta> 9910<refnamediv> 9911 <refname>snd_ac97_mixer</refname> 9912 <refpurpose> 9913 create an Codec97 component 9914 </refpurpose> 9915</refnamediv> 9916<refsynopsisdiv> 9917 <title>Synopsis</title> 9918 <funcsynopsis><funcprototype> 9919 <funcdef>int <function>snd_ac97_mixer </function></funcdef> 9920 <paramdef>struct snd_ac97_bus * <parameter>bus</parameter></paramdef> 9921 <paramdef>struct snd_ac97_template * <parameter>template</parameter></paramdef> 9922 <paramdef>struct snd_ac97 ** <parameter>rac97</parameter></paramdef> 9923 </funcprototype></funcsynopsis> 9924</refsynopsisdiv> 9925<refsect1> 9926 <title>Arguments</title> 9927 <variablelist> 9928 <varlistentry> 9929 <term><parameter>bus</parameter></term> 9930 <listitem> 9931 <para> 9932 the AC97 bus which codec is attached to 9933 </para> 9934 </listitem> 9935 </varlistentry> 9936 <varlistentry> 9937 <term><parameter>template</parameter></term> 9938 <listitem> 9939 <para> 9940 the template of ac97, including index, callbacks and 9941 the private data. 9942 </para> 9943 </listitem> 9944 </varlistentry> 9945 <varlistentry> 9946 <term><parameter>rac97</parameter></term> 9947 <listitem> 9948 <para> 9949 the pointer to store the new ac97 instance. 9950 </para> 9951 </listitem> 9952 </varlistentry> 9953 </variablelist> 9954</refsect1> 9955<refsect1> 9956<title>Description</title> 9957<para> 9958 Creates an Codec97 component. An struct snd_ac97 instance is newly 9959 allocated and initialized from the template. The codec 9960 is then initialized by the standard procedure. 9961 </para><para> 9962 9963 The template must include the codec number (num) and address (addr), 9964 and the private data (private_data). 9965 </para><para> 9966 9967 The ac97 instance is registered as a low-level device, so you don't 9968 have to release it manually. 9969</para> 9970</refsect1> 9971<refsect1> 9972<title>Return</title> 9973<para> 9974 Zero if successful, or a negative error code on failure. 9975</para> 9976</refsect1> 9977</refentry> 9978 9979<refentry id="API-snd-ac97-update-power"> 9980<refentryinfo> 9981 <title>LINUX</title> 9982 <productname>Kernel Hackers Manual</productname> 9983 <date>July 2017</date> 9984</refentryinfo> 9985<refmeta> 9986 <refentrytitle><phrase>snd_ac97_update_power</phrase></refentrytitle> 9987 <manvolnum>9</manvolnum> 9988 <refmiscinfo class="version">4.1.27</refmiscinfo> 9989</refmeta> 9990<refnamediv> 9991 <refname>snd_ac97_update_power</refname> 9992 <refpurpose> 9993 update the powerdown register 9994 </refpurpose> 9995</refnamediv> 9996<refsynopsisdiv> 9997 <title>Synopsis</title> 9998 <funcsynopsis><funcprototype> 9999 <funcdef>int <function>snd_ac97_update_power </function></funcdef> 10000 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 10001 <paramdef>int <parameter>reg</parameter></paramdef> 10002 <paramdef>int <parameter>powerup</parameter></paramdef> 10003 </funcprototype></funcsynopsis> 10004</refsynopsisdiv> 10005<refsect1> 10006 <title>Arguments</title> 10007 <variablelist> 10008 <varlistentry> 10009 <term><parameter>ac97</parameter></term> 10010 <listitem> 10011 <para> 10012 the codec instance 10013 </para> 10014 </listitem> 10015 </varlistentry> 10016 <varlistentry> 10017 <term><parameter>reg</parameter></term> 10018 <listitem> 10019 <para> 10020 the rate register, e.g. AC97_PCM_FRONT_DAC_RATE 10021 </para> 10022 </listitem> 10023 </varlistentry> 10024 <varlistentry> 10025 <term><parameter>powerup</parameter></term> 10026 <listitem> 10027 <para> 10028 non-zero when power up the part 10029 </para> 10030 </listitem> 10031 </varlistentry> 10032 </variablelist> 10033</refsect1> 10034<refsect1> 10035<title>Description</title> 10036<para> 10037 Update the AC97 powerdown register bits of the given part. 10038</para> 10039</refsect1> 10040<refsect1> 10041<title>Return</title> 10042<para> 10043 Zero. 10044</para> 10045</refsect1> 10046</refentry> 10047 10048<refentry id="API-snd-ac97-suspend"> 10049<refentryinfo> 10050 <title>LINUX</title> 10051 <productname>Kernel Hackers Manual</productname> 10052 <date>July 2017</date> 10053</refentryinfo> 10054<refmeta> 10055 <refentrytitle><phrase>snd_ac97_suspend</phrase></refentrytitle> 10056 <manvolnum>9</manvolnum> 10057 <refmiscinfo class="version">4.1.27</refmiscinfo> 10058</refmeta> 10059<refnamediv> 10060 <refname>snd_ac97_suspend</refname> 10061 <refpurpose> 10062 General suspend function for AC97 codec 10063 </refpurpose> 10064</refnamediv> 10065<refsynopsisdiv> 10066 <title>Synopsis</title> 10067 <funcsynopsis><funcprototype> 10068 <funcdef>void <function>snd_ac97_suspend </function></funcdef> 10069 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 10070 </funcprototype></funcsynopsis> 10071</refsynopsisdiv> 10072<refsect1> 10073 <title>Arguments</title> 10074 <variablelist> 10075 <varlistentry> 10076 <term><parameter>ac97</parameter></term> 10077 <listitem> 10078 <para> 10079 the ac97 instance 10080 </para> 10081 </listitem> 10082 </varlistentry> 10083 </variablelist> 10084</refsect1> 10085<refsect1> 10086<title>Description</title> 10087<para> 10088 Suspends the codec, power down the chip. 10089</para> 10090</refsect1> 10091</refentry> 10092 10093<refentry id="API-snd-ac97-resume"> 10094<refentryinfo> 10095 <title>LINUX</title> 10096 <productname>Kernel Hackers Manual</productname> 10097 <date>July 2017</date> 10098</refentryinfo> 10099<refmeta> 10100 <refentrytitle><phrase>snd_ac97_resume</phrase></refentrytitle> 10101 <manvolnum>9</manvolnum> 10102 <refmiscinfo class="version">4.1.27</refmiscinfo> 10103</refmeta> 10104<refnamediv> 10105 <refname>snd_ac97_resume</refname> 10106 <refpurpose> 10107 General resume function for AC97 codec 10108 </refpurpose> 10109</refnamediv> 10110<refsynopsisdiv> 10111 <title>Synopsis</title> 10112 <funcsynopsis><funcprototype> 10113 <funcdef>void <function>snd_ac97_resume </function></funcdef> 10114 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 10115 </funcprototype></funcsynopsis> 10116</refsynopsisdiv> 10117<refsect1> 10118 <title>Arguments</title> 10119 <variablelist> 10120 <varlistentry> 10121 <term><parameter>ac97</parameter></term> 10122 <listitem> 10123 <para> 10124 the ac97 instance 10125 </para> 10126 </listitem> 10127 </varlistentry> 10128 </variablelist> 10129</refsect1> 10130<refsect1> 10131<title>Description</title> 10132<para> 10133 Do the standard resume procedure, power up and restoring the 10134 old register values. 10135</para> 10136</refsect1> 10137</refentry> 10138 10139<refentry id="API-snd-ac97-tune-hardware"> 10140<refentryinfo> 10141 <title>LINUX</title> 10142 <productname>Kernel Hackers Manual</productname> 10143 <date>July 2017</date> 10144</refentryinfo> 10145<refmeta> 10146 <refentrytitle><phrase>snd_ac97_tune_hardware</phrase></refentrytitle> 10147 <manvolnum>9</manvolnum> 10148 <refmiscinfo class="version">4.1.27</refmiscinfo> 10149</refmeta> 10150<refnamediv> 10151 <refname>snd_ac97_tune_hardware</refname> 10152 <refpurpose> 10153 tune up the hardware 10154 </refpurpose> 10155</refnamediv> 10156<refsynopsisdiv> 10157 <title>Synopsis</title> 10158 <funcsynopsis><funcprototype> 10159 <funcdef>int <function>snd_ac97_tune_hardware </function></funcdef> 10160 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 10161 <paramdef>const struct ac97_quirk * <parameter>quirk</parameter></paramdef> 10162 <paramdef>const char * <parameter>override</parameter></paramdef> 10163 </funcprototype></funcsynopsis> 10164</refsynopsisdiv> 10165<refsect1> 10166 <title>Arguments</title> 10167 <variablelist> 10168 <varlistentry> 10169 <term><parameter>ac97</parameter></term> 10170 <listitem> 10171 <para> 10172 the ac97 instance 10173 </para> 10174 </listitem> 10175 </varlistentry> 10176 <varlistentry> 10177 <term><parameter>quirk</parameter></term> 10178 <listitem> 10179 <para> 10180 quirk list 10181 </para> 10182 </listitem> 10183 </varlistentry> 10184 <varlistentry> 10185 <term><parameter>override</parameter></term> 10186 <listitem> 10187 <para> 10188 explicit quirk value (overrides the list if non-NULL) 10189 </para> 10190 </listitem> 10191 </varlistentry> 10192 </variablelist> 10193</refsect1> 10194<refsect1> 10195<title>Description</title> 10196<para> 10197 Do some workaround for each pci device, such as renaming of the 10198 headphone (true line-out) control as <quote>Master</quote>. 10199 The quirk-list must be terminated with a zero-filled entry. 10200</para> 10201</refsect1> 10202<refsect1> 10203<title>Return</title> 10204<para> 10205 Zero if successful, or a negative error code on failure. 10206</para> 10207</refsect1> 10208</refentry> 10209 10210<!-- sound/pci/ac97/ac97_pcm.c --> 10211<refentry id="API-snd-ac97-set-rate"> 10212<refentryinfo> 10213 <title>LINUX</title> 10214 <productname>Kernel Hackers Manual</productname> 10215 <date>July 2017</date> 10216</refentryinfo> 10217<refmeta> 10218 <refentrytitle><phrase>snd_ac97_set_rate</phrase></refentrytitle> 10219 <manvolnum>9</manvolnum> 10220 <refmiscinfo class="version">4.1.27</refmiscinfo> 10221</refmeta> 10222<refnamediv> 10223 <refname>snd_ac97_set_rate</refname> 10224 <refpurpose> 10225 change the rate of the given input/output. 10226 </refpurpose> 10227</refnamediv> 10228<refsynopsisdiv> 10229 <title>Synopsis</title> 10230 <funcsynopsis><funcprototype> 10231 <funcdef>int <function>snd_ac97_set_rate </function></funcdef> 10232 <paramdef>struct snd_ac97 * <parameter>ac97</parameter></paramdef> 10233 <paramdef>int <parameter>reg</parameter></paramdef> 10234 <paramdef>unsigned int <parameter>rate</parameter></paramdef> 10235 </funcprototype></funcsynopsis> 10236</refsynopsisdiv> 10237<refsect1> 10238 <title>Arguments</title> 10239 <variablelist> 10240 <varlistentry> 10241 <term><parameter>ac97</parameter></term> 10242 <listitem> 10243 <para> 10244 the ac97 instance 10245 </para> 10246 </listitem> 10247 </varlistentry> 10248 <varlistentry> 10249 <term><parameter>reg</parameter></term> 10250 <listitem> 10251 <para> 10252 the register to change 10253 </para> 10254 </listitem> 10255 </varlistentry> 10256 <varlistentry> 10257 <term><parameter>rate</parameter></term> 10258 <listitem> 10259 <para> 10260 the sample rate to set 10261 </para> 10262 </listitem> 10263 </varlistentry> 10264 </variablelist> 10265</refsect1> 10266<refsect1> 10267<title>Description</title> 10268<para> 10269 Changes the rate of the given input/output on the codec. 10270 If the codec doesn't support VAR, the rate must be 48000 (except 10271 for SPDIF). 10272 </para><para> 10273 10274 The valid registers are AC97_PMC_MIC_ADC_RATE, 10275 AC97_PCM_FRONT_DAC_RATE, AC97_PCM_LR_ADC_RATE. 10276 AC97_PCM_SURR_DAC_RATE and AC97_PCM_LFE_DAC_RATE are accepted 10277 if the codec supports them. 10278 AC97_SPDIF is accepted as a pseudo register to modify the SPDIF 10279 status bits. 10280</para> 10281</refsect1> 10282<refsect1> 10283<title>Return</title> 10284<para> 10285 Zero if successful, or a negative error code on failure. 10286</para> 10287</refsect1> 10288</refentry> 10289 10290<refentry id="API-snd-ac97-pcm-assign"> 10291<refentryinfo> 10292 <title>LINUX</title> 10293 <productname>Kernel Hackers Manual</productname> 10294 <date>July 2017</date> 10295</refentryinfo> 10296<refmeta> 10297 <refentrytitle><phrase>snd_ac97_pcm_assign</phrase></refentrytitle> 10298 <manvolnum>9</manvolnum> 10299 <refmiscinfo class="version">4.1.27</refmiscinfo> 10300</refmeta> 10301<refnamediv> 10302 <refname>snd_ac97_pcm_assign</refname> 10303 <refpurpose> 10304 assign AC97 slots to given PCM streams 10305 </refpurpose> 10306</refnamediv> 10307<refsynopsisdiv> 10308 <title>Synopsis</title> 10309 <funcsynopsis><funcprototype> 10310 <funcdef>int <function>snd_ac97_pcm_assign </function></funcdef> 10311 <paramdef>struct snd_ac97_bus * <parameter>bus</parameter></paramdef> 10312 <paramdef>unsigned short <parameter>pcms_count</parameter></paramdef> 10313 <paramdef>const struct ac97_pcm * <parameter>pcms</parameter></paramdef> 10314 </funcprototype></funcsynopsis> 10315</refsynopsisdiv> 10316<refsect1> 10317 <title>Arguments</title> 10318 <variablelist> 10319 <varlistentry> 10320 <term><parameter>bus</parameter></term> 10321 <listitem> 10322 <para> 10323 the ac97 bus instance 10324 </para> 10325 </listitem> 10326 </varlistentry> 10327 <varlistentry> 10328 <term><parameter>pcms_count</parameter></term> 10329 <listitem> 10330 <para> 10331 count of PCMs to be assigned 10332 </para> 10333 </listitem> 10334 </varlistentry> 10335 <varlistentry> 10336 <term><parameter>pcms</parameter></term> 10337 <listitem> 10338 <para> 10339 PCMs to be assigned 10340 </para> 10341 </listitem> 10342 </varlistentry> 10343 </variablelist> 10344</refsect1> 10345<refsect1> 10346<title>Description</title> 10347<para> 10348 It assigns available AC97 slots for given PCMs. If none or only 10349 some slots are available, pcm->xxx.slots and pcm->xxx.rslots[] members 10350 are reduced and might be zero. 10351</para> 10352</refsect1> 10353<refsect1> 10354<title>Return</title> 10355<para> 10356 Zero if successful, or a negative error code on failure. 10357</para> 10358</refsect1> 10359</refentry> 10360 10361<refentry id="API-snd-ac97-pcm-open"> 10362<refentryinfo> 10363 <title>LINUX</title> 10364 <productname>Kernel Hackers Manual</productname> 10365 <date>July 2017</date> 10366</refentryinfo> 10367<refmeta> 10368 <refentrytitle><phrase>snd_ac97_pcm_open</phrase></refentrytitle> 10369 <manvolnum>9</manvolnum> 10370 <refmiscinfo class="version">4.1.27</refmiscinfo> 10371</refmeta> 10372<refnamediv> 10373 <refname>snd_ac97_pcm_open</refname> 10374 <refpurpose> 10375 opens the given AC97 pcm 10376 </refpurpose> 10377</refnamediv> 10378<refsynopsisdiv> 10379 <title>Synopsis</title> 10380 <funcsynopsis><funcprototype> 10381 <funcdef>int <function>snd_ac97_pcm_open </function></funcdef> 10382 <paramdef>struct ac97_pcm * <parameter>pcm</parameter></paramdef> 10383 <paramdef>unsigned int <parameter>rate</parameter></paramdef> 10384 <paramdef>enum ac97_pcm_cfg <parameter>cfg</parameter></paramdef> 10385 <paramdef>unsigned short <parameter>slots</parameter></paramdef> 10386 </funcprototype></funcsynopsis> 10387</refsynopsisdiv> 10388<refsect1> 10389 <title>Arguments</title> 10390 <variablelist> 10391 <varlistentry> 10392 <term><parameter>pcm</parameter></term> 10393 <listitem> 10394 <para> 10395 the ac97 pcm instance 10396 </para> 10397 </listitem> 10398 </varlistentry> 10399 <varlistentry> 10400 <term><parameter>rate</parameter></term> 10401 <listitem> 10402 <para> 10403 rate in Hz, if codec does not support VRA, this value must be 48000Hz 10404 </para> 10405 </listitem> 10406 </varlistentry> 10407 <varlistentry> 10408 <term><parameter>cfg</parameter></term> 10409 <listitem> 10410 <para> 10411 output stream characteristics 10412 </para> 10413 </listitem> 10414 </varlistentry> 10415 <varlistentry> 10416 <term><parameter>slots</parameter></term> 10417 <listitem> 10418 <para> 10419 a subset of allocated slots (snd_ac97_pcm_assign) for this pcm 10420 </para> 10421 </listitem> 10422 </varlistentry> 10423 </variablelist> 10424</refsect1> 10425<refsect1> 10426<title>Description</title> 10427<para> 10428 It locks the specified slots and sets the given rate to AC97 registers. 10429</para> 10430</refsect1> 10431<refsect1> 10432<title>Return</title> 10433<para> 10434 Zero if successful, or a negative error code on failure. 10435</para> 10436</refsect1> 10437</refentry> 10438 10439<refentry id="API-snd-ac97-pcm-close"> 10440<refentryinfo> 10441 <title>LINUX</title> 10442 <productname>Kernel Hackers Manual</productname> 10443 <date>July 2017</date> 10444</refentryinfo> 10445<refmeta> 10446 <refentrytitle><phrase>snd_ac97_pcm_close</phrase></refentrytitle> 10447 <manvolnum>9</manvolnum> 10448 <refmiscinfo class="version">4.1.27</refmiscinfo> 10449</refmeta> 10450<refnamediv> 10451 <refname>snd_ac97_pcm_close</refname> 10452 <refpurpose> 10453 closes the given AC97 pcm 10454 </refpurpose> 10455</refnamediv> 10456<refsynopsisdiv> 10457 <title>Synopsis</title> 10458 <funcsynopsis><funcprototype> 10459 <funcdef>int <function>snd_ac97_pcm_close </function></funcdef> 10460 <paramdef>struct ac97_pcm * <parameter>pcm</parameter></paramdef> 10461 </funcprototype></funcsynopsis> 10462</refsynopsisdiv> 10463<refsect1> 10464 <title>Arguments</title> 10465 <variablelist> 10466 <varlistentry> 10467 <term><parameter>pcm</parameter></term> 10468 <listitem> 10469 <para> 10470 the ac97 pcm instance 10471 </para> 10472 </listitem> 10473 </varlistentry> 10474 </variablelist> 10475</refsect1> 10476<refsect1> 10477<title>Description</title> 10478<para> 10479 It frees the locked AC97 slots. 10480</para> 10481</refsect1> 10482<refsect1> 10483<title>Return</title> 10484<para> 10485 Zero. 10486</para> 10487</refsect1> 10488</refentry> 10489 10490<refentry id="API-snd-ac97-pcm-double-rate-rules"> 10491<refentryinfo> 10492 <title>LINUX</title> 10493 <productname>Kernel Hackers Manual</productname> 10494 <date>July 2017</date> 10495</refentryinfo> 10496<refmeta> 10497 <refentrytitle><phrase>snd_ac97_pcm_double_rate_rules</phrase></refentrytitle> 10498 <manvolnum>9</manvolnum> 10499 <refmiscinfo class="version">4.1.27</refmiscinfo> 10500</refmeta> 10501<refnamediv> 10502 <refname>snd_ac97_pcm_double_rate_rules</refname> 10503 <refpurpose> 10504 set double rate constraints 10505 </refpurpose> 10506</refnamediv> 10507<refsynopsisdiv> 10508 <title>Synopsis</title> 10509 <funcsynopsis><funcprototype> 10510 <funcdef>int <function>snd_ac97_pcm_double_rate_rules </function></funcdef> 10511 <paramdef>struct snd_pcm_runtime * <parameter>runtime</parameter></paramdef> 10512 </funcprototype></funcsynopsis> 10513</refsynopsisdiv> 10514<refsect1> 10515 <title>Arguments</title> 10516 <variablelist> 10517 <varlistentry> 10518 <term><parameter>runtime</parameter></term> 10519 <listitem> 10520 <para> 10521 the runtime of the ac97 front playback pcm 10522 </para> 10523 </listitem> 10524 </varlistentry> 10525 </variablelist> 10526</refsect1> 10527<refsect1> 10528<title>Description</title> 10529<para> 10530 Installs the hardware constraint rules to prevent using double rates and 10531 more than two channels at the same time. 10532</para> 10533</refsect1> 10534<refsect1> 10535<title>Return</title> 10536<para> 10537 Zero if successful, or a negative error code on failure. 10538</para> 10539</refsect1> 10540</refentry> 10541 10542 </sect1> 10543 <sect1><title>Virtual Master Control API</title> 10544<!-- sound/core/vmaster.c --> 10545<refentry id="API-snd-ctl-make-virtual-master"> 10546<refentryinfo> 10547 <title>LINUX</title> 10548 <productname>Kernel Hackers Manual</productname> 10549 <date>July 2017</date> 10550</refentryinfo> 10551<refmeta> 10552 <refentrytitle><phrase>snd_ctl_make_virtual_master</phrase></refentrytitle> 10553 <manvolnum>9</manvolnum> 10554 <refmiscinfo class="version">4.1.27</refmiscinfo> 10555</refmeta> 10556<refnamediv> 10557 <refname>snd_ctl_make_virtual_master</refname> 10558 <refpurpose> 10559 Create a virtual master control 10560 </refpurpose> 10561</refnamediv> 10562<refsynopsisdiv> 10563 <title>Synopsis</title> 10564 <funcsynopsis><funcprototype> 10565 <funcdef>struct snd_kcontrol * <function>snd_ctl_make_virtual_master </function></funcdef> 10566 <paramdef>char * <parameter>name</parameter></paramdef> 10567 <paramdef>const unsigned int * <parameter>tlv</parameter></paramdef> 10568 </funcprototype></funcsynopsis> 10569</refsynopsisdiv> 10570<refsect1> 10571 <title>Arguments</title> 10572 <variablelist> 10573 <varlistentry> 10574 <term><parameter>name</parameter></term> 10575 <listitem> 10576 <para> 10577 name string of the control element to create 10578 </para> 10579 </listitem> 10580 </varlistentry> 10581 <varlistentry> 10582 <term><parameter>tlv</parameter></term> 10583 <listitem> 10584 <para> 10585 optional TLV int array for dB information 10586 </para> 10587 </listitem> 10588 </varlistentry> 10589 </variablelist> 10590</refsect1> 10591<refsect1> 10592<title>Description</title> 10593<para> 10594 Creates a virtual master control with the given name string. 10595 </para><para> 10596 10597 After creating a vmaster element, you can add the slave controls 10598 via <function>snd_ctl_add_slave</function> or <function>snd_ctl_add_slave_uncached</function>. 10599 </para><para> 10600 10601 The optional argument <parameter>tlv</parameter> can be used to specify the TLV information 10602 for dB scale of the master control. It should be a single element 10603 with #SNDRV_CTL_TLVT_DB_SCALE, #SNDRV_CTL_TLV_DB_MINMAX or 10604 #SNDRV_CTL_TLVT_DB_MINMAX_MUTE type, and should be the max 0dB. 10605</para> 10606</refsect1> 10607<refsect1> 10608<title>Return</title> 10609<para> 10610 The created control element, or <constant>NULL</constant> for errors (ENOMEM). 10611</para> 10612</refsect1> 10613</refentry> 10614 10615<refentry id="API-snd-ctl-add-vmaster-hook"> 10616<refentryinfo> 10617 <title>LINUX</title> 10618 <productname>Kernel Hackers Manual</productname> 10619 <date>July 2017</date> 10620</refentryinfo> 10621<refmeta> 10622 <refentrytitle><phrase>snd_ctl_add_vmaster_hook</phrase></refentrytitle> 10623 <manvolnum>9</manvolnum> 10624 <refmiscinfo class="version">4.1.27</refmiscinfo> 10625</refmeta> 10626<refnamediv> 10627 <refname>snd_ctl_add_vmaster_hook</refname> 10628 <refpurpose> 10629 Add a hook to a vmaster control 10630 </refpurpose> 10631</refnamediv> 10632<refsynopsisdiv> 10633 <title>Synopsis</title> 10634 <funcsynopsis><funcprototype> 10635 <funcdef>int <function>snd_ctl_add_vmaster_hook </function></funcdef> 10636 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 10637 <paramdef>void (*<parameter>hook</parameter>) 10638 <funcparams>void *private_data, int</funcparams></paramdef> 10639 <paramdef>void * <parameter>private_data</parameter></paramdef> 10640 </funcprototype></funcsynopsis> 10641</refsynopsisdiv> 10642<refsect1> 10643 <title>Arguments</title> 10644 <variablelist> 10645 <varlistentry> 10646 <term><parameter>kcontrol</parameter></term> 10647 <listitem> 10648 <para> 10649 vmaster kctl element 10650 </para> 10651 </listitem> 10652 </varlistentry> 10653 <varlistentry> 10654 <term><parameter>hook</parameter></term> 10655 <listitem> 10656 <para> 10657 the hook function 10658 </para> 10659 </listitem> 10660 </varlistentry> 10661 <varlistentry> 10662 <term><parameter>private_data</parameter></term> 10663 <listitem> 10664 <para> 10665 the private_data pointer to be saved 10666 </para> 10667 </listitem> 10668 </varlistentry> 10669 </variablelist> 10670</refsect1> 10671<refsect1> 10672<title>Description</title> 10673<para> 10674 Adds the given hook to the vmaster control element so that it's called 10675 at each time when the value is changed. 10676</para> 10677</refsect1> 10678<refsect1> 10679<title>Return</title> 10680<para> 10681 Zero. 10682</para> 10683</refsect1> 10684</refentry> 10685 10686<refentry id="API-snd-ctl-sync-vmaster"> 10687<refentryinfo> 10688 <title>LINUX</title> 10689 <productname>Kernel Hackers Manual</productname> 10690 <date>July 2017</date> 10691</refentryinfo> 10692<refmeta> 10693 <refentrytitle><phrase>snd_ctl_sync_vmaster</phrase></refentrytitle> 10694 <manvolnum>9</manvolnum> 10695 <refmiscinfo class="version">4.1.27</refmiscinfo> 10696</refmeta> 10697<refnamediv> 10698 <refname>snd_ctl_sync_vmaster</refname> 10699 <refpurpose> 10700 Sync the vmaster slaves and hook 10701 </refpurpose> 10702</refnamediv> 10703<refsynopsisdiv> 10704 <title>Synopsis</title> 10705 <funcsynopsis><funcprototype> 10706 <funcdef>void <function>snd_ctl_sync_vmaster </function></funcdef> 10707 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 10708 <paramdef>bool <parameter>hook_only</parameter></paramdef> 10709 </funcprototype></funcsynopsis> 10710</refsynopsisdiv> 10711<refsect1> 10712 <title>Arguments</title> 10713 <variablelist> 10714 <varlistentry> 10715 <term><parameter>kcontrol</parameter></term> 10716 <listitem> 10717 <para> 10718 vmaster kctl element 10719 </para> 10720 </listitem> 10721 </varlistentry> 10722 <varlistentry> 10723 <term><parameter>hook_only</parameter></term> 10724 <listitem> 10725 <para> 10726 sync only the hook 10727 </para> 10728 </listitem> 10729 </varlistentry> 10730 </variablelist> 10731</refsect1> 10732<refsect1> 10733<title>Description</title> 10734<para> 10735 Forcibly call the put callback of each slave and call the hook function 10736 to synchronize with the current value of the given vmaster element. 10737 NOP when NULL is passed to <parameter>kcontrol</parameter>. 10738</para> 10739</refsect1> 10740</refentry> 10741 10742<!-- include/sound/control.h --> 10743<refentry id="API-snd-ctl-add-slave"> 10744<refentryinfo> 10745 <title>LINUX</title> 10746 <productname>Kernel Hackers Manual</productname> 10747 <date>July 2017</date> 10748</refentryinfo> 10749<refmeta> 10750 <refentrytitle><phrase>snd_ctl_add_slave</phrase></refentrytitle> 10751 <manvolnum>9</manvolnum> 10752 <refmiscinfo class="version">4.1.27</refmiscinfo> 10753</refmeta> 10754<refnamediv> 10755 <refname>snd_ctl_add_slave</refname> 10756 <refpurpose> 10757 Add a virtual slave control 10758 </refpurpose> 10759</refnamediv> 10760<refsynopsisdiv> 10761 <title>Synopsis</title> 10762 <funcsynopsis><funcprototype> 10763 <funcdef>int <function>snd_ctl_add_slave </function></funcdef> 10764 <paramdef>struct snd_kcontrol * <parameter>master</parameter></paramdef> 10765 <paramdef>struct snd_kcontrol * <parameter>slave</parameter></paramdef> 10766 </funcprototype></funcsynopsis> 10767</refsynopsisdiv> 10768<refsect1> 10769 <title>Arguments</title> 10770 <variablelist> 10771 <varlistentry> 10772 <term><parameter>master</parameter></term> 10773 <listitem> 10774 <para> 10775 vmaster element 10776 </para> 10777 </listitem> 10778 </varlistentry> 10779 <varlistentry> 10780 <term><parameter>slave</parameter></term> 10781 <listitem> 10782 <para> 10783 slave element to add 10784 </para> 10785 </listitem> 10786 </varlistentry> 10787 </variablelist> 10788</refsect1> 10789<refsect1> 10790<title>Description</title> 10791<para> 10792 Add a virtual slave control to the given master element created via 10793 <function>snd_ctl_create_virtual_master</function> beforehand. 10794 </para><para> 10795 10796 All slaves must be the same type (returning the same information 10797 via info callback). The function doesn't check it, so it's your 10798 responsibility. 10799 </para><para> 10800 10801 Also, some additional limitations: 10802 at most two channels, 10803 logarithmic volume control (dB level) thus no linear volume, 10804 master can only attenuate the volume without gain 10805</para> 10806</refsect1> 10807<refsect1> 10808<title>Return</title> 10809<para> 10810 Zero if successful or a negative error code. 10811</para> 10812</refsect1> 10813</refentry> 10814 10815<refentry id="API-snd-ctl-add-slave-uncached"> 10816<refentryinfo> 10817 <title>LINUX</title> 10818 <productname>Kernel Hackers Manual</productname> 10819 <date>July 2017</date> 10820</refentryinfo> 10821<refmeta> 10822 <refentrytitle><phrase>snd_ctl_add_slave_uncached</phrase></refentrytitle> 10823 <manvolnum>9</manvolnum> 10824 <refmiscinfo class="version">4.1.27</refmiscinfo> 10825</refmeta> 10826<refnamediv> 10827 <refname>snd_ctl_add_slave_uncached</refname> 10828 <refpurpose> 10829 Add a virtual slave control 10830 </refpurpose> 10831</refnamediv> 10832<refsynopsisdiv> 10833 <title>Synopsis</title> 10834 <funcsynopsis><funcprototype> 10835 <funcdef>int <function>snd_ctl_add_slave_uncached </function></funcdef> 10836 <paramdef>struct snd_kcontrol * <parameter>master</parameter></paramdef> 10837 <paramdef>struct snd_kcontrol * <parameter>slave</parameter></paramdef> 10838 </funcprototype></funcsynopsis> 10839</refsynopsisdiv> 10840<refsect1> 10841 <title>Arguments</title> 10842 <variablelist> 10843 <varlistentry> 10844 <term><parameter>master</parameter></term> 10845 <listitem> 10846 <para> 10847 vmaster element 10848 </para> 10849 </listitem> 10850 </varlistentry> 10851 <varlistentry> 10852 <term><parameter>slave</parameter></term> 10853 <listitem> 10854 <para> 10855 slave element to add 10856 </para> 10857 </listitem> 10858 </varlistentry> 10859 </variablelist> 10860</refsect1> 10861<refsect1> 10862<title>Description</title> 10863<para> 10864 Add a virtual slave control to the given master. 10865 Unlike <function>snd_ctl_add_slave</function>, the element added via this function 10866 is supposed to have volatile values, and get callback is called 10867 at each time queried from the master. 10868 </para><para> 10869 10870 When the control peeks the hardware values directly and the value 10871 can be changed by other means than the put callback of the element, 10872 this function should be used to keep the value always up-to-date. 10873</para> 10874</refsect1> 10875<refsect1> 10876<title>Return</title> 10877<para> 10878 Zero if successful or a negative error code. 10879</para> 10880</refsect1> 10881</refentry> 10882 10883 </sect1> 10884 </chapter> 10885 <chapter><title>MIDI API</title> 10886 <sect1><title>Raw MIDI API</title> 10887<!-- sound/core/rawmidi.c --> 10888<refentry id="API-snd-rawmidi-receive"> 10889<refentryinfo> 10890 <title>LINUX</title> 10891 <productname>Kernel Hackers Manual</productname> 10892 <date>July 2017</date> 10893</refentryinfo> 10894<refmeta> 10895 <refentrytitle><phrase>snd_rawmidi_receive</phrase></refentrytitle> 10896 <manvolnum>9</manvolnum> 10897 <refmiscinfo class="version">4.1.27</refmiscinfo> 10898</refmeta> 10899<refnamediv> 10900 <refname>snd_rawmidi_receive</refname> 10901 <refpurpose> 10902 receive the input data from the device 10903 </refpurpose> 10904</refnamediv> 10905<refsynopsisdiv> 10906 <title>Synopsis</title> 10907 <funcsynopsis><funcprototype> 10908 <funcdef>int <function>snd_rawmidi_receive </function></funcdef> 10909 <paramdef>struct snd_rawmidi_substream * <parameter>substream</parameter></paramdef> 10910 <paramdef>const unsigned char * <parameter>buffer</parameter></paramdef> 10911 <paramdef>int <parameter>count</parameter></paramdef> 10912 </funcprototype></funcsynopsis> 10913</refsynopsisdiv> 10914<refsect1> 10915 <title>Arguments</title> 10916 <variablelist> 10917 <varlistentry> 10918 <term><parameter>substream</parameter></term> 10919 <listitem> 10920 <para> 10921 the rawmidi substream 10922 </para> 10923 </listitem> 10924 </varlistentry> 10925 <varlistentry> 10926 <term><parameter>buffer</parameter></term> 10927 <listitem> 10928 <para> 10929 the buffer pointer 10930 </para> 10931 </listitem> 10932 </varlistentry> 10933 <varlistentry> 10934 <term><parameter>count</parameter></term> 10935 <listitem> 10936 <para> 10937 the data size to read 10938 </para> 10939 </listitem> 10940 </varlistentry> 10941 </variablelist> 10942</refsect1> 10943<refsect1> 10944<title>Description</title> 10945<para> 10946 Reads the data from the internal buffer. 10947</para> 10948</refsect1> 10949<refsect1> 10950<title>Return</title> 10951<para> 10952 The size of read data, or a negative error code on failure. 10953</para> 10954</refsect1> 10955</refentry> 10956 10957<refentry id="API-snd-rawmidi-transmit-empty"> 10958<refentryinfo> 10959 <title>LINUX</title> 10960 <productname>Kernel Hackers Manual</productname> 10961 <date>July 2017</date> 10962</refentryinfo> 10963<refmeta> 10964 <refentrytitle><phrase>snd_rawmidi_transmit_empty</phrase></refentrytitle> 10965 <manvolnum>9</manvolnum> 10966 <refmiscinfo class="version">4.1.27</refmiscinfo> 10967</refmeta> 10968<refnamediv> 10969 <refname>snd_rawmidi_transmit_empty</refname> 10970 <refpurpose> 10971 check whether the output buffer is empty 10972 </refpurpose> 10973</refnamediv> 10974<refsynopsisdiv> 10975 <title>Synopsis</title> 10976 <funcsynopsis><funcprototype> 10977 <funcdef>int <function>snd_rawmidi_transmit_empty </function></funcdef> 10978 <paramdef>struct snd_rawmidi_substream * <parameter>substream</parameter></paramdef> 10979 </funcprototype></funcsynopsis> 10980</refsynopsisdiv> 10981<refsect1> 10982 <title>Arguments</title> 10983 <variablelist> 10984 <varlistentry> 10985 <term><parameter>substream</parameter></term> 10986 <listitem> 10987 <para> 10988 the rawmidi substream 10989 </para> 10990 </listitem> 10991 </varlistentry> 10992 </variablelist> 10993</refsect1> 10994<refsect1> 10995<title>Return</title> 10996<para> 10997 1 if the internal output buffer is empty, 0 if not. 10998</para> 10999</refsect1> 11000</refentry> 11001 11002<refentry id="API---snd-rawmidi-transmit-peek"> 11003<refentryinfo> 11004 <title>LINUX</title> 11005 <productname>Kernel Hackers Manual</productname> 11006 <date>July 2017</date> 11007</refentryinfo> 11008<refmeta> 11009 <refentrytitle><phrase>__snd_rawmidi_transmit_peek</phrase></refentrytitle> 11010 <manvolnum>9</manvolnum> 11011 <refmiscinfo class="version">4.1.27</refmiscinfo> 11012</refmeta> 11013<refnamediv> 11014 <refname>__snd_rawmidi_transmit_peek</refname> 11015 <refpurpose> 11016 copy data from the internal buffer 11017 </refpurpose> 11018</refnamediv> 11019<refsynopsisdiv> 11020 <title>Synopsis</title> 11021 <funcsynopsis><funcprototype> 11022 <funcdef>int <function>__snd_rawmidi_transmit_peek </function></funcdef> 11023 <paramdef>struct snd_rawmidi_substream * <parameter>substream</parameter></paramdef> 11024 <paramdef>unsigned char * <parameter>buffer</parameter></paramdef> 11025 <paramdef>int <parameter>count</parameter></paramdef> 11026 </funcprototype></funcsynopsis> 11027</refsynopsisdiv> 11028<refsect1> 11029 <title>Arguments</title> 11030 <variablelist> 11031 <varlistentry> 11032 <term><parameter>substream</parameter></term> 11033 <listitem> 11034 <para> 11035 the rawmidi substream 11036 </para> 11037 </listitem> 11038 </varlistentry> 11039 <varlistentry> 11040 <term><parameter>buffer</parameter></term> 11041 <listitem> 11042 <para> 11043 the buffer pointer 11044 </para> 11045 </listitem> 11046 </varlistentry> 11047 <varlistentry> 11048 <term><parameter>count</parameter></term> 11049 <listitem> 11050 <para> 11051 data size to transfer 11052 </para> 11053 </listitem> 11054 </varlistentry> 11055 </variablelist> 11056</refsect1> 11057<refsect1> 11058<title>Description</title> 11059<para> 11060 This is a variant of <function>snd_rawmidi_transmit_peek</function> without spinlock. 11061</para> 11062</refsect1> 11063</refentry> 11064 11065<refentry id="API-snd-rawmidi-transmit-peek"> 11066<refentryinfo> 11067 <title>LINUX</title> 11068 <productname>Kernel Hackers Manual</productname> 11069 <date>July 2017</date> 11070</refentryinfo> 11071<refmeta> 11072 <refentrytitle><phrase>snd_rawmidi_transmit_peek</phrase></refentrytitle> 11073 <manvolnum>9</manvolnum> 11074 <refmiscinfo class="version">4.1.27</refmiscinfo> 11075</refmeta> 11076<refnamediv> 11077 <refname>snd_rawmidi_transmit_peek</refname> 11078 <refpurpose> 11079 copy data from the internal buffer 11080 </refpurpose> 11081</refnamediv> 11082<refsynopsisdiv> 11083 <title>Synopsis</title> 11084 <funcsynopsis><funcprototype> 11085 <funcdef>int <function>snd_rawmidi_transmit_peek </function></funcdef> 11086 <paramdef>struct snd_rawmidi_substream * <parameter>substream</parameter></paramdef> 11087 <paramdef>unsigned char * <parameter>buffer</parameter></paramdef> 11088 <paramdef>int <parameter>count</parameter></paramdef> 11089 </funcprototype></funcsynopsis> 11090</refsynopsisdiv> 11091<refsect1> 11092 <title>Arguments</title> 11093 <variablelist> 11094 <varlistentry> 11095 <term><parameter>substream</parameter></term> 11096 <listitem> 11097 <para> 11098 the rawmidi substream 11099 </para> 11100 </listitem> 11101 </varlistentry> 11102 <varlistentry> 11103 <term><parameter>buffer</parameter></term> 11104 <listitem> 11105 <para> 11106 the buffer pointer 11107 </para> 11108 </listitem> 11109 </varlistentry> 11110 <varlistentry> 11111 <term><parameter>count</parameter></term> 11112 <listitem> 11113 <para> 11114 data size to transfer 11115 </para> 11116 </listitem> 11117 </varlistentry> 11118 </variablelist> 11119</refsect1> 11120<refsect1> 11121<title>Description</title> 11122<para> 11123 Copies data from the internal output buffer to the given buffer. 11124 </para><para> 11125 11126 Call this in the interrupt handler when the midi output is ready, 11127 and call <function>snd_rawmidi_transmit_ack</function> after the transmission is 11128 finished. 11129</para> 11130</refsect1> 11131<refsect1> 11132<title>Return</title> 11133<para> 11134 The size of copied data, or a negative error code on failure. 11135</para> 11136</refsect1> 11137</refentry> 11138 11139<refentry id="API---snd-rawmidi-transmit-ack"> 11140<refentryinfo> 11141 <title>LINUX</title> 11142 <productname>Kernel Hackers Manual</productname> 11143 <date>July 2017</date> 11144</refentryinfo> 11145<refmeta> 11146 <refentrytitle><phrase>__snd_rawmidi_transmit_ack</phrase></refentrytitle> 11147 <manvolnum>9</manvolnum> 11148 <refmiscinfo class="version">4.1.27</refmiscinfo> 11149</refmeta> 11150<refnamediv> 11151 <refname>__snd_rawmidi_transmit_ack</refname> 11152 <refpurpose> 11153 acknowledge the transmission 11154 </refpurpose> 11155</refnamediv> 11156<refsynopsisdiv> 11157 <title>Synopsis</title> 11158 <funcsynopsis><funcprototype> 11159 <funcdef>int <function>__snd_rawmidi_transmit_ack </function></funcdef> 11160 <paramdef>struct snd_rawmidi_substream * <parameter>substream</parameter></paramdef> 11161 <paramdef>int <parameter>count</parameter></paramdef> 11162 </funcprototype></funcsynopsis> 11163</refsynopsisdiv> 11164<refsect1> 11165 <title>Arguments</title> 11166 <variablelist> 11167 <varlistentry> 11168 <term><parameter>substream</parameter></term> 11169 <listitem> 11170 <para> 11171 the rawmidi substream 11172 </para> 11173 </listitem> 11174 </varlistentry> 11175 <varlistentry> 11176 <term><parameter>count</parameter></term> 11177 <listitem> 11178 <para> 11179 the transferred count 11180 </para> 11181 </listitem> 11182 </varlistentry> 11183 </variablelist> 11184</refsect1> 11185<refsect1> 11186<title>Description</title> 11187<para> 11188 This is a variant of <function>__snd_rawmidi_transmit_ack</function> without spinlock. 11189</para> 11190</refsect1> 11191</refentry> 11192 11193<refentry id="API-snd-rawmidi-transmit-ack"> 11194<refentryinfo> 11195 <title>LINUX</title> 11196 <productname>Kernel Hackers Manual</productname> 11197 <date>July 2017</date> 11198</refentryinfo> 11199<refmeta> 11200 <refentrytitle><phrase>snd_rawmidi_transmit_ack</phrase></refentrytitle> 11201 <manvolnum>9</manvolnum> 11202 <refmiscinfo class="version">4.1.27</refmiscinfo> 11203</refmeta> 11204<refnamediv> 11205 <refname>snd_rawmidi_transmit_ack</refname> 11206 <refpurpose> 11207 acknowledge the transmission 11208 </refpurpose> 11209</refnamediv> 11210<refsynopsisdiv> 11211 <title>Synopsis</title> 11212 <funcsynopsis><funcprototype> 11213 <funcdef>int <function>snd_rawmidi_transmit_ack </function></funcdef> 11214 <paramdef>struct snd_rawmidi_substream * <parameter>substream</parameter></paramdef> 11215 <paramdef>int <parameter>count</parameter></paramdef> 11216 </funcprototype></funcsynopsis> 11217</refsynopsisdiv> 11218<refsect1> 11219 <title>Arguments</title> 11220 <variablelist> 11221 <varlistentry> 11222 <term><parameter>substream</parameter></term> 11223 <listitem> 11224 <para> 11225 the rawmidi substream 11226 </para> 11227 </listitem> 11228 </varlistentry> 11229 <varlistentry> 11230 <term><parameter>count</parameter></term> 11231 <listitem> 11232 <para> 11233 the transferred count 11234 </para> 11235 </listitem> 11236 </varlistentry> 11237 </variablelist> 11238</refsect1> 11239<refsect1> 11240<title>Description</title> 11241<para> 11242 Advances the hardware pointer for the internal output buffer with 11243 the given size and updates the condition. 11244 Call after the transmission is finished. 11245</para> 11246</refsect1> 11247<refsect1> 11248<title>Return</title> 11249<para> 11250 The advanced size if successful, or a negative error code on failure. 11251</para> 11252</refsect1> 11253</refentry> 11254 11255<refentry id="API-snd-rawmidi-transmit"> 11256<refentryinfo> 11257 <title>LINUX</title> 11258 <productname>Kernel Hackers Manual</productname> 11259 <date>July 2017</date> 11260</refentryinfo> 11261<refmeta> 11262 <refentrytitle><phrase>snd_rawmidi_transmit</phrase></refentrytitle> 11263 <manvolnum>9</manvolnum> 11264 <refmiscinfo class="version">4.1.27</refmiscinfo> 11265</refmeta> 11266<refnamediv> 11267 <refname>snd_rawmidi_transmit</refname> 11268 <refpurpose> 11269 copy from the buffer to the device 11270 </refpurpose> 11271</refnamediv> 11272<refsynopsisdiv> 11273 <title>Synopsis</title> 11274 <funcsynopsis><funcprototype> 11275 <funcdef>int <function>snd_rawmidi_transmit </function></funcdef> 11276 <paramdef>struct snd_rawmidi_substream * <parameter>substream</parameter></paramdef> 11277 <paramdef>unsigned char * <parameter>buffer</parameter></paramdef> 11278 <paramdef>int <parameter>count</parameter></paramdef> 11279 </funcprototype></funcsynopsis> 11280</refsynopsisdiv> 11281<refsect1> 11282 <title>Arguments</title> 11283 <variablelist> 11284 <varlistentry> 11285 <term><parameter>substream</parameter></term> 11286 <listitem> 11287 <para> 11288 the rawmidi substream 11289 </para> 11290 </listitem> 11291 </varlistentry> 11292 <varlistentry> 11293 <term><parameter>buffer</parameter></term> 11294 <listitem> 11295 <para> 11296 the buffer pointer 11297 </para> 11298 </listitem> 11299 </varlistentry> 11300 <varlistentry> 11301 <term><parameter>count</parameter></term> 11302 <listitem> 11303 <para> 11304 the data size to transfer 11305 </para> 11306 </listitem> 11307 </varlistentry> 11308 </variablelist> 11309</refsect1> 11310<refsect1> 11311<title>Description</title> 11312<para> 11313 Copies data from the buffer to the device and advances the pointer. 11314</para> 11315</refsect1> 11316<refsect1> 11317<title>Return</title> 11318<para> 11319 The copied size if successful, or a negative error code on failure. 11320</para> 11321</refsect1> 11322</refentry> 11323 11324<refentry id="API-snd-rawmidi-new"> 11325<refentryinfo> 11326 <title>LINUX</title> 11327 <productname>Kernel Hackers Manual</productname> 11328 <date>July 2017</date> 11329</refentryinfo> 11330<refmeta> 11331 <refentrytitle><phrase>snd_rawmidi_new</phrase></refentrytitle> 11332 <manvolnum>9</manvolnum> 11333 <refmiscinfo class="version">4.1.27</refmiscinfo> 11334</refmeta> 11335<refnamediv> 11336 <refname>snd_rawmidi_new</refname> 11337 <refpurpose> 11338 create a rawmidi instance 11339 </refpurpose> 11340</refnamediv> 11341<refsynopsisdiv> 11342 <title>Synopsis</title> 11343 <funcsynopsis><funcprototype> 11344 <funcdef>int <function>snd_rawmidi_new </function></funcdef> 11345 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 11346 <paramdef>char * <parameter>id</parameter></paramdef> 11347 <paramdef>int <parameter>device</parameter></paramdef> 11348 <paramdef>int <parameter>output_count</parameter></paramdef> 11349 <paramdef>int <parameter>input_count</parameter></paramdef> 11350 <paramdef>struct snd_rawmidi ** <parameter>rrawmidi</parameter></paramdef> 11351 </funcprototype></funcsynopsis> 11352</refsynopsisdiv> 11353<refsect1> 11354 <title>Arguments</title> 11355 <variablelist> 11356 <varlistentry> 11357 <term><parameter>card</parameter></term> 11358 <listitem> 11359 <para> 11360 the card instance 11361 </para> 11362 </listitem> 11363 </varlistentry> 11364 <varlistentry> 11365 <term><parameter>id</parameter></term> 11366 <listitem> 11367 <para> 11368 the id string 11369 </para> 11370 </listitem> 11371 </varlistentry> 11372 <varlistentry> 11373 <term><parameter>device</parameter></term> 11374 <listitem> 11375 <para> 11376 the device index 11377 </para> 11378 </listitem> 11379 </varlistentry> 11380 <varlistentry> 11381 <term><parameter>output_count</parameter></term> 11382 <listitem> 11383 <para> 11384 the number of output streams 11385 </para> 11386 </listitem> 11387 </varlistentry> 11388 <varlistentry> 11389 <term><parameter>input_count</parameter></term> 11390 <listitem> 11391 <para> 11392 the number of input streams 11393 </para> 11394 </listitem> 11395 </varlistentry> 11396 <varlistentry> 11397 <term><parameter>rrawmidi</parameter></term> 11398 <listitem> 11399 <para> 11400 the pointer to store the new rawmidi instance 11401 </para> 11402 </listitem> 11403 </varlistentry> 11404 </variablelist> 11405</refsect1> 11406<refsect1> 11407<title>Description</title> 11408<para> 11409 Creates a new rawmidi instance. 11410 Use <function>snd_rawmidi_set_ops</function> to set the operators to the new instance. 11411</para> 11412</refsect1> 11413<refsect1> 11414<title>Return</title> 11415<para> 11416 Zero if successful, or a negative error code on failure. 11417</para> 11418</refsect1> 11419</refentry> 11420 11421<refentry id="API-snd-rawmidi-set-ops"> 11422<refentryinfo> 11423 <title>LINUX</title> 11424 <productname>Kernel Hackers Manual</productname> 11425 <date>July 2017</date> 11426</refentryinfo> 11427<refmeta> 11428 <refentrytitle><phrase>snd_rawmidi_set_ops</phrase></refentrytitle> 11429 <manvolnum>9</manvolnum> 11430 <refmiscinfo class="version">4.1.27</refmiscinfo> 11431</refmeta> 11432<refnamediv> 11433 <refname>snd_rawmidi_set_ops</refname> 11434 <refpurpose> 11435 set the rawmidi operators 11436 </refpurpose> 11437</refnamediv> 11438<refsynopsisdiv> 11439 <title>Synopsis</title> 11440 <funcsynopsis><funcprototype> 11441 <funcdef>void <function>snd_rawmidi_set_ops </function></funcdef> 11442 <paramdef>struct snd_rawmidi * <parameter>rmidi</parameter></paramdef> 11443 <paramdef>int <parameter>stream</parameter></paramdef> 11444 <paramdef>struct snd_rawmidi_ops * <parameter>ops</parameter></paramdef> 11445 </funcprototype></funcsynopsis> 11446</refsynopsisdiv> 11447<refsect1> 11448 <title>Arguments</title> 11449 <variablelist> 11450 <varlistentry> 11451 <term><parameter>rmidi</parameter></term> 11452 <listitem> 11453 <para> 11454 the rawmidi instance 11455 </para> 11456 </listitem> 11457 </varlistentry> 11458 <varlistentry> 11459 <term><parameter>stream</parameter></term> 11460 <listitem> 11461 <para> 11462 the stream direction, SNDRV_RAWMIDI_STREAM_XXX 11463 </para> 11464 </listitem> 11465 </varlistentry> 11466 <varlistentry> 11467 <term><parameter>ops</parameter></term> 11468 <listitem> 11469 <para> 11470 the operator table 11471 </para> 11472 </listitem> 11473 </varlistentry> 11474 </variablelist> 11475</refsect1> 11476<refsect1> 11477<title>Description</title> 11478<para> 11479 Sets the rawmidi operators for the given stream direction. 11480</para> 11481</refsect1> 11482</refentry> 11483 11484 </sect1> 11485 <sect1><title>MPU401-UART API</title> 11486<!-- sound/drivers/mpu401/mpu401_uart.c --> 11487<refentry id="API-snd-mpu401-uart-interrupt"> 11488<refentryinfo> 11489 <title>LINUX</title> 11490 <productname>Kernel Hackers Manual</productname> 11491 <date>July 2017</date> 11492</refentryinfo> 11493<refmeta> 11494 <refentrytitle><phrase>snd_mpu401_uart_interrupt</phrase></refentrytitle> 11495 <manvolnum>9</manvolnum> 11496 <refmiscinfo class="version">4.1.27</refmiscinfo> 11497</refmeta> 11498<refnamediv> 11499 <refname>snd_mpu401_uart_interrupt</refname> 11500 <refpurpose> 11501 generic MPU401-UART interrupt handler 11502 </refpurpose> 11503</refnamediv> 11504<refsynopsisdiv> 11505 <title>Synopsis</title> 11506 <funcsynopsis><funcprototype> 11507 <funcdef>irqreturn_t <function>snd_mpu401_uart_interrupt </function></funcdef> 11508 <paramdef>int <parameter>irq</parameter></paramdef> 11509 <paramdef>void * <parameter>dev_id</parameter></paramdef> 11510 </funcprototype></funcsynopsis> 11511</refsynopsisdiv> 11512<refsect1> 11513 <title>Arguments</title> 11514 <variablelist> 11515 <varlistentry> 11516 <term><parameter>irq</parameter></term> 11517 <listitem> 11518 <para> 11519 the irq number 11520 </para> 11521 </listitem> 11522 </varlistentry> 11523 <varlistentry> 11524 <term><parameter>dev_id</parameter></term> 11525 <listitem> 11526 <para> 11527 mpu401 instance 11528 </para> 11529 </listitem> 11530 </varlistentry> 11531 </variablelist> 11532</refsect1> 11533<refsect1> 11534<title>Description</title> 11535<para> 11536 Processes the interrupt for MPU401-UART i/o. 11537</para> 11538</refsect1> 11539<refsect1> 11540<title>Return</title> 11541<para> 11542 <constant>IRQ_HANDLED</constant> if the interrupt was handled. <constant>IRQ_NONE</constant> otherwise. 11543</para> 11544</refsect1> 11545</refentry> 11546 11547<refentry id="API-snd-mpu401-uart-interrupt-tx"> 11548<refentryinfo> 11549 <title>LINUX</title> 11550 <productname>Kernel Hackers Manual</productname> 11551 <date>July 2017</date> 11552</refentryinfo> 11553<refmeta> 11554 <refentrytitle><phrase>snd_mpu401_uart_interrupt_tx</phrase></refentrytitle> 11555 <manvolnum>9</manvolnum> 11556 <refmiscinfo class="version">4.1.27</refmiscinfo> 11557</refmeta> 11558<refnamediv> 11559 <refname>snd_mpu401_uart_interrupt_tx</refname> 11560 <refpurpose> 11561 generic MPU401-UART transmit irq handler 11562 </refpurpose> 11563</refnamediv> 11564<refsynopsisdiv> 11565 <title>Synopsis</title> 11566 <funcsynopsis><funcprototype> 11567 <funcdef>irqreturn_t <function>snd_mpu401_uart_interrupt_tx </function></funcdef> 11568 <paramdef>int <parameter>irq</parameter></paramdef> 11569 <paramdef>void * <parameter>dev_id</parameter></paramdef> 11570 </funcprototype></funcsynopsis> 11571</refsynopsisdiv> 11572<refsect1> 11573 <title>Arguments</title> 11574 <variablelist> 11575 <varlistentry> 11576 <term><parameter>irq</parameter></term> 11577 <listitem> 11578 <para> 11579 the irq number 11580 </para> 11581 </listitem> 11582 </varlistentry> 11583 <varlistentry> 11584 <term><parameter>dev_id</parameter></term> 11585 <listitem> 11586 <para> 11587 mpu401 instance 11588 </para> 11589 </listitem> 11590 </varlistentry> 11591 </variablelist> 11592</refsect1> 11593<refsect1> 11594<title>Description</title> 11595<para> 11596 Processes the interrupt for MPU401-UART output. 11597</para> 11598</refsect1> 11599<refsect1> 11600<title>Return</title> 11601<para> 11602 <constant>IRQ_HANDLED</constant> if the interrupt was handled. <constant>IRQ_NONE</constant> otherwise. 11603</para> 11604</refsect1> 11605</refentry> 11606 11607<refentry id="API-snd-mpu401-uart-new"> 11608<refentryinfo> 11609 <title>LINUX</title> 11610 <productname>Kernel Hackers Manual</productname> 11611 <date>July 2017</date> 11612</refentryinfo> 11613<refmeta> 11614 <refentrytitle><phrase>snd_mpu401_uart_new</phrase></refentrytitle> 11615 <manvolnum>9</manvolnum> 11616 <refmiscinfo class="version">4.1.27</refmiscinfo> 11617</refmeta> 11618<refnamediv> 11619 <refname>snd_mpu401_uart_new</refname> 11620 <refpurpose> 11621 create an MPU401-UART instance 11622 </refpurpose> 11623</refnamediv> 11624<refsynopsisdiv> 11625 <title>Synopsis</title> 11626 <funcsynopsis><funcprototype> 11627 <funcdef>int <function>snd_mpu401_uart_new </function></funcdef> 11628 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 11629 <paramdef>int <parameter>device</parameter></paramdef> 11630 <paramdef>unsigned short <parameter>hardware</parameter></paramdef> 11631 <paramdef>unsigned long <parameter>port</parameter></paramdef> 11632 <paramdef>unsigned int <parameter>info_flags</parameter></paramdef> 11633 <paramdef>int <parameter>irq</parameter></paramdef> 11634 <paramdef>struct snd_rawmidi ** <parameter>rrawmidi</parameter></paramdef> 11635 </funcprototype></funcsynopsis> 11636</refsynopsisdiv> 11637<refsect1> 11638 <title>Arguments</title> 11639 <variablelist> 11640 <varlistentry> 11641 <term><parameter>card</parameter></term> 11642 <listitem> 11643 <para> 11644 the card instance 11645 </para> 11646 </listitem> 11647 </varlistentry> 11648 <varlistentry> 11649 <term><parameter>device</parameter></term> 11650 <listitem> 11651 <para> 11652 the device index, zero-based 11653 </para> 11654 </listitem> 11655 </varlistentry> 11656 <varlistentry> 11657 <term><parameter>hardware</parameter></term> 11658 <listitem> 11659 <para> 11660 the hardware type, MPU401_HW_XXXX 11661 </para> 11662 </listitem> 11663 </varlistentry> 11664 <varlistentry> 11665 <term><parameter>port</parameter></term> 11666 <listitem> 11667 <para> 11668 the base address of MPU401 port 11669 </para> 11670 </listitem> 11671 </varlistentry> 11672 <varlistentry> 11673 <term><parameter>info_flags</parameter></term> 11674 <listitem> 11675 <para> 11676 bitflags MPU401_INFO_XXX 11677 </para> 11678 </listitem> 11679 </varlistentry> 11680 <varlistentry> 11681 <term><parameter>irq</parameter></term> 11682 <listitem> 11683 <para> 11684 the ISA irq number, -1 if not to be allocated 11685 </para> 11686 </listitem> 11687 </varlistentry> 11688 <varlistentry> 11689 <term><parameter>rrawmidi</parameter></term> 11690 <listitem> 11691 <para> 11692 the pointer to store the new rawmidi instance 11693 </para> 11694 </listitem> 11695 </varlistentry> 11696 </variablelist> 11697</refsect1> 11698<refsect1> 11699<title>Description</title> 11700<para> 11701 Creates a new MPU-401 instance. 11702 </para><para> 11703 11704 Note that the rawmidi instance is returned on the rrawmidi argument, 11705 not the mpu401 instance itself. To access to the mpu401 instance, 11706 cast from rawmidi->private_data (with struct snd_mpu401 magic-cast). 11707</para> 11708</refsect1> 11709<refsect1> 11710<title>Return</title> 11711<para> 11712 Zero if successful, or a negative error code. 11713</para> 11714</refsect1> 11715</refentry> 11716 11717 </sect1> 11718 </chapter> 11719 <chapter><title>Proc Info API</title> 11720 <sect1><title>Proc Info Interface</title> 11721<!-- sound/core/info.c --> 11722<refentry id="API-snd-iprintf"> 11723<refentryinfo> 11724 <title>LINUX</title> 11725 <productname>Kernel Hackers Manual</productname> 11726 <date>July 2017</date> 11727</refentryinfo> 11728<refmeta> 11729 <refentrytitle><phrase>snd_iprintf</phrase></refentrytitle> 11730 <manvolnum>9</manvolnum> 11731 <refmiscinfo class="version">4.1.27</refmiscinfo> 11732</refmeta> 11733<refnamediv> 11734 <refname>snd_iprintf</refname> 11735 <refpurpose> 11736 printf on the procfs buffer 11737 </refpurpose> 11738</refnamediv> 11739<refsynopsisdiv> 11740 <title>Synopsis</title> 11741 <funcsynopsis><funcprototype> 11742 <funcdef>int <function>snd_iprintf </function></funcdef> 11743 <paramdef>struct snd_info_buffer * <parameter>buffer</parameter></paramdef> 11744 <paramdef>const char * <parameter>fmt</parameter></paramdef> 11745 <paramdef> <parameter>...</parameter></paramdef> 11746 </funcprototype></funcsynopsis> 11747</refsynopsisdiv> 11748<refsect1> 11749 <title>Arguments</title> 11750 <variablelist> 11751 <varlistentry> 11752 <term><parameter>buffer</parameter></term> 11753 <listitem> 11754 <para> 11755 the procfs buffer 11756 </para> 11757 </listitem> 11758 </varlistentry> 11759 <varlistentry> 11760 <term><parameter>fmt</parameter></term> 11761 <listitem> 11762 <para> 11763 the printf format 11764 </para> 11765 </listitem> 11766 </varlistentry> 11767 <varlistentry> 11768 <term><parameter>...</parameter></term> 11769 <listitem> 11770 <para> 11771 variable arguments 11772 </para> 11773 </listitem> 11774 </varlistentry> 11775 </variablelist> 11776</refsect1> 11777<refsect1> 11778<title>Description</title> 11779<para> 11780 Outputs the string on the procfs buffer just like <function>printf</function>. 11781</para> 11782</refsect1> 11783<refsect1> 11784<title>Return</title> 11785<para> 11786 The size of output string, or a negative error code. 11787</para> 11788</refsect1> 11789</refentry> 11790 11791<refentry id="API-snd-info-get-line"> 11792<refentryinfo> 11793 <title>LINUX</title> 11794 <productname>Kernel Hackers Manual</productname> 11795 <date>July 2017</date> 11796</refentryinfo> 11797<refmeta> 11798 <refentrytitle><phrase>snd_info_get_line</phrase></refentrytitle> 11799 <manvolnum>9</manvolnum> 11800 <refmiscinfo class="version">4.1.27</refmiscinfo> 11801</refmeta> 11802<refnamediv> 11803 <refname>snd_info_get_line</refname> 11804 <refpurpose> 11805 read one line from the procfs buffer 11806 </refpurpose> 11807</refnamediv> 11808<refsynopsisdiv> 11809 <title>Synopsis</title> 11810 <funcsynopsis><funcprototype> 11811 <funcdef>int <function>snd_info_get_line </function></funcdef> 11812 <paramdef>struct snd_info_buffer * <parameter>buffer</parameter></paramdef> 11813 <paramdef>char * <parameter>line</parameter></paramdef> 11814 <paramdef>int <parameter>len</parameter></paramdef> 11815 </funcprototype></funcsynopsis> 11816</refsynopsisdiv> 11817<refsect1> 11818 <title>Arguments</title> 11819 <variablelist> 11820 <varlistentry> 11821 <term><parameter>buffer</parameter></term> 11822 <listitem> 11823 <para> 11824 the procfs buffer 11825 </para> 11826 </listitem> 11827 </varlistentry> 11828 <varlistentry> 11829 <term><parameter>line</parameter></term> 11830 <listitem> 11831 <para> 11832 the buffer to store 11833 </para> 11834 </listitem> 11835 </varlistentry> 11836 <varlistentry> 11837 <term><parameter>len</parameter></term> 11838 <listitem> 11839 <para> 11840 the max. buffer size 11841 </para> 11842 </listitem> 11843 </varlistentry> 11844 </variablelist> 11845</refsect1> 11846<refsect1> 11847<title>Description</title> 11848<para> 11849 Reads one line from the buffer and stores the string. 11850</para> 11851</refsect1> 11852<refsect1> 11853<title>Return</title> 11854<para> 11855 Zero if successful, or 1 if error or EOF. 11856</para> 11857</refsect1> 11858</refentry> 11859 11860<refentry id="API-snd-info-get-str"> 11861<refentryinfo> 11862 <title>LINUX</title> 11863 <productname>Kernel Hackers Manual</productname> 11864 <date>July 2017</date> 11865</refentryinfo> 11866<refmeta> 11867 <refentrytitle><phrase>snd_info_get_str</phrase></refentrytitle> 11868 <manvolnum>9</manvolnum> 11869 <refmiscinfo class="version">4.1.27</refmiscinfo> 11870</refmeta> 11871<refnamediv> 11872 <refname>snd_info_get_str</refname> 11873 <refpurpose> 11874 parse a string token 11875 </refpurpose> 11876</refnamediv> 11877<refsynopsisdiv> 11878 <title>Synopsis</title> 11879 <funcsynopsis><funcprototype> 11880 <funcdef>const char * <function>snd_info_get_str </function></funcdef> 11881 <paramdef>char * <parameter>dest</parameter></paramdef> 11882 <paramdef>const char * <parameter>src</parameter></paramdef> 11883 <paramdef>int <parameter>len</parameter></paramdef> 11884 </funcprototype></funcsynopsis> 11885</refsynopsisdiv> 11886<refsect1> 11887 <title>Arguments</title> 11888 <variablelist> 11889 <varlistentry> 11890 <term><parameter>dest</parameter></term> 11891 <listitem> 11892 <para> 11893 the buffer to store the string token 11894 </para> 11895 </listitem> 11896 </varlistentry> 11897 <varlistentry> 11898 <term><parameter>src</parameter></term> 11899 <listitem> 11900 <para> 11901 the original string 11902 </para> 11903 </listitem> 11904 </varlistentry> 11905 <varlistentry> 11906 <term><parameter>len</parameter></term> 11907 <listitem> 11908 <para> 11909 the max. length of token - 1 11910 </para> 11911 </listitem> 11912 </varlistentry> 11913 </variablelist> 11914</refsect1> 11915<refsect1> 11916<title>Description</title> 11917<para> 11918 Parses the original string and copy a token to the given 11919 string buffer. 11920</para> 11921</refsect1> 11922<refsect1> 11923<title>Return</title> 11924<para> 11925 The updated pointer of the original string so that 11926 it can be used for the next call. 11927</para> 11928</refsect1> 11929</refentry> 11930 11931<refentry id="API-snd-info-create-module-entry"> 11932<refentryinfo> 11933 <title>LINUX</title> 11934 <productname>Kernel Hackers Manual</productname> 11935 <date>July 2017</date> 11936</refentryinfo> 11937<refmeta> 11938 <refentrytitle><phrase>snd_info_create_module_entry</phrase></refentrytitle> 11939 <manvolnum>9</manvolnum> 11940 <refmiscinfo class="version">4.1.27</refmiscinfo> 11941</refmeta> 11942<refnamediv> 11943 <refname>snd_info_create_module_entry</refname> 11944 <refpurpose> 11945 create an info entry for the given module 11946 </refpurpose> 11947</refnamediv> 11948<refsynopsisdiv> 11949 <title>Synopsis</title> 11950 <funcsynopsis><funcprototype> 11951 <funcdef>struct snd_info_entry * <function>snd_info_create_module_entry </function></funcdef> 11952 <paramdef>struct module * <parameter>module</parameter></paramdef> 11953 <paramdef>const char * <parameter>name</parameter></paramdef> 11954 <paramdef>struct snd_info_entry * <parameter>parent</parameter></paramdef> 11955 </funcprototype></funcsynopsis> 11956</refsynopsisdiv> 11957<refsect1> 11958 <title>Arguments</title> 11959 <variablelist> 11960 <varlistentry> 11961 <term><parameter>module</parameter></term> 11962 <listitem> 11963 <para> 11964 the module pointer 11965 </para> 11966 </listitem> 11967 </varlistentry> 11968 <varlistentry> 11969 <term><parameter>name</parameter></term> 11970 <listitem> 11971 <para> 11972 the file name 11973 </para> 11974 </listitem> 11975 </varlistentry> 11976 <varlistentry> 11977 <term><parameter>parent</parameter></term> 11978 <listitem> 11979 <para> 11980 the parent directory 11981 </para> 11982 </listitem> 11983 </varlistentry> 11984 </variablelist> 11985</refsect1> 11986<refsect1> 11987<title>Description</title> 11988<para> 11989 Creates a new info entry and assigns it to the given module. 11990</para> 11991</refsect1> 11992<refsect1> 11993<title>Return</title> 11994<para> 11995 The pointer of the new instance, or <constant>NULL</constant> on failure. 11996</para> 11997</refsect1> 11998</refentry> 11999 12000<refentry id="API-snd-info-create-card-entry"> 12001<refentryinfo> 12002 <title>LINUX</title> 12003 <productname>Kernel Hackers Manual</productname> 12004 <date>July 2017</date> 12005</refentryinfo> 12006<refmeta> 12007 <refentrytitle><phrase>snd_info_create_card_entry</phrase></refentrytitle> 12008 <manvolnum>9</manvolnum> 12009 <refmiscinfo class="version">4.1.27</refmiscinfo> 12010</refmeta> 12011<refnamediv> 12012 <refname>snd_info_create_card_entry</refname> 12013 <refpurpose> 12014 create an info entry for the given card 12015 </refpurpose> 12016</refnamediv> 12017<refsynopsisdiv> 12018 <title>Synopsis</title> 12019 <funcsynopsis><funcprototype> 12020 <funcdef>struct snd_info_entry * <function>snd_info_create_card_entry </function></funcdef> 12021 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 12022 <paramdef>const char * <parameter>name</parameter></paramdef> 12023 <paramdef>struct snd_info_entry * <parameter>parent</parameter></paramdef> 12024 </funcprototype></funcsynopsis> 12025</refsynopsisdiv> 12026<refsect1> 12027 <title>Arguments</title> 12028 <variablelist> 12029 <varlistentry> 12030 <term><parameter>card</parameter></term> 12031 <listitem> 12032 <para> 12033 the card instance 12034 </para> 12035 </listitem> 12036 </varlistentry> 12037 <varlistentry> 12038 <term><parameter>name</parameter></term> 12039 <listitem> 12040 <para> 12041 the file name 12042 </para> 12043 </listitem> 12044 </varlistentry> 12045 <varlistentry> 12046 <term><parameter>parent</parameter></term> 12047 <listitem> 12048 <para> 12049 the parent directory 12050 </para> 12051 </listitem> 12052 </varlistentry> 12053 </variablelist> 12054</refsect1> 12055<refsect1> 12056<title>Description</title> 12057<para> 12058 Creates a new info entry and assigns it to the given card. 12059</para> 12060</refsect1> 12061<refsect1> 12062<title>Return</title> 12063<para> 12064 The pointer of the new instance, or <constant>NULL</constant> on failure. 12065</para> 12066</refsect1> 12067</refentry> 12068 12069<refentry id="API-snd-card-proc-new"> 12070<refentryinfo> 12071 <title>LINUX</title> 12072 <productname>Kernel Hackers Manual</productname> 12073 <date>July 2017</date> 12074</refentryinfo> 12075<refmeta> 12076 <refentrytitle><phrase>snd_card_proc_new</phrase></refentrytitle> 12077 <manvolnum>9</manvolnum> 12078 <refmiscinfo class="version">4.1.27</refmiscinfo> 12079</refmeta> 12080<refnamediv> 12081 <refname>snd_card_proc_new</refname> 12082 <refpurpose> 12083 create an info entry for the given card 12084 </refpurpose> 12085</refnamediv> 12086<refsynopsisdiv> 12087 <title>Synopsis</title> 12088 <funcsynopsis><funcprototype> 12089 <funcdef>int <function>snd_card_proc_new </function></funcdef> 12090 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 12091 <paramdef>const char * <parameter>name</parameter></paramdef> 12092 <paramdef>struct snd_info_entry ** <parameter>entryp</parameter></paramdef> 12093 </funcprototype></funcsynopsis> 12094</refsynopsisdiv> 12095<refsect1> 12096 <title>Arguments</title> 12097 <variablelist> 12098 <varlistentry> 12099 <term><parameter>card</parameter></term> 12100 <listitem> 12101 <para> 12102 the card instance 12103 </para> 12104 </listitem> 12105 </varlistentry> 12106 <varlistentry> 12107 <term><parameter>name</parameter></term> 12108 <listitem> 12109 <para> 12110 the file name 12111 </para> 12112 </listitem> 12113 </varlistentry> 12114 <varlistentry> 12115 <term><parameter>entryp</parameter></term> 12116 <listitem> 12117 <para> 12118 the pointer to store the new info entry 12119 </para> 12120 </listitem> 12121 </varlistentry> 12122 </variablelist> 12123</refsect1> 12124<refsect1> 12125<title>Description</title> 12126<para> 12127 Creates a new info entry and assigns it to the given card. 12128 Unlike <function>snd_info_create_card_entry</function>, this function registers the 12129 info entry as an ALSA device component, so that it can be 12130 unregistered/released without explicit call. 12131 Also, you don't have to register this entry via <function>snd_info_register</function>, 12132 since this will be registered by <function>snd_card_register</function> automatically. 12133 </para><para> 12134 12135 The parent is assumed as card->proc_root. 12136 </para><para> 12137 12138 For releasing this entry, use <function>snd_device_free</function> instead of 12139 <function>snd_info_free_entry</function>. 12140</para> 12141</refsect1> 12142<refsect1> 12143<title>Return</title> 12144<para> 12145 Zero if successful, or a negative error code on failure. 12146</para> 12147</refsect1> 12148</refentry> 12149 12150<refentry id="API-snd-info-free-entry"> 12151<refentryinfo> 12152 <title>LINUX</title> 12153 <productname>Kernel Hackers Manual</productname> 12154 <date>July 2017</date> 12155</refentryinfo> 12156<refmeta> 12157 <refentrytitle><phrase>snd_info_free_entry</phrase></refentrytitle> 12158 <manvolnum>9</manvolnum> 12159 <refmiscinfo class="version">4.1.27</refmiscinfo> 12160</refmeta> 12161<refnamediv> 12162 <refname>snd_info_free_entry</refname> 12163 <refpurpose> 12164 release the info entry 12165 </refpurpose> 12166</refnamediv> 12167<refsynopsisdiv> 12168 <title>Synopsis</title> 12169 <funcsynopsis><funcprototype> 12170 <funcdef>void <function>snd_info_free_entry </function></funcdef> 12171 <paramdef>struct snd_info_entry * <parameter>entry</parameter></paramdef> 12172 </funcprototype></funcsynopsis> 12173</refsynopsisdiv> 12174<refsect1> 12175 <title>Arguments</title> 12176 <variablelist> 12177 <varlistentry> 12178 <term><parameter>entry</parameter></term> 12179 <listitem> 12180 <para> 12181 the info entry 12182 </para> 12183 </listitem> 12184 </varlistentry> 12185 </variablelist> 12186</refsect1> 12187<refsect1> 12188<title>Description</title> 12189<para> 12190 Releases the info entry. Don't call this after registered. 12191</para> 12192</refsect1> 12193</refentry> 12194 12195<refentry id="API-snd-info-register"> 12196<refentryinfo> 12197 <title>LINUX</title> 12198 <productname>Kernel Hackers Manual</productname> 12199 <date>July 2017</date> 12200</refentryinfo> 12201<refmeta> 12202 <refentrytitle><phrase>snd_info_register</phrase></refentrytitle> 12203 <manvolnum>9</manvolnum> 12204 <refmiscinfo class="version">4.1.27</refmiscinfo> 12205</refmeta> 12206<refnamediv> 12207 <refname>snd_info_register</refname> 12208 <refpurpose> 12209 register the info entry 12210 </refpurpose> 12211</refnamediv> 12212<refsynopsisdiv> 12213 <title>Synopsis</title> 12214 <funcsynopsis><funcprototype> 12215 <funcdef>int <function>snd_info_register </function></funcdef> 12216 <paramdef>struct snd_info_entry * <parameter>entry</parameter></paramdef> 12217 </funcprototype></funcsynopsis> 12218</refsynopsisdiv> 12219<refsect1> 12220 <title>Arguments</title> 12221 <variablelist> 12222 <varlistentry> 12223 <term><parameter>entry</parameter></term> 12224 <listitem> 12225 <para> 12226 the info entry 12227 </para> 12228 </listitem> 12229 </varlistentry> 12230 </variablelist> 12231</refsect1> 12232<refsect1> 12233<title>Description</title> 12234<para> 12235 Registers the proc info entry. 12236</para> 12237</refsect1> 12238<refsect1> 12239<title>Return</title> 12240<para> 12241 Zero if successful, or a negative error code on failure. 12242</para> 12243</refsect1> 12244</refentry> 12245 12246 </sect1> 12247 </chapter> 12248 <chapter><title>Compress Offload</title> 12249 <sect1><title>Compress Offload API</title> 12250<!-- sound/core/compress_offload.c --> 12251<refentry id="API-snd-compress-register"> 12252<refentryinfo> 12253 <title>LINUX</title> 12254 <productname>Kernel Hackers Manual</productname> 12255 <date>July 2017</date> 12256</refentryinfo> 12257<refmeta> 12258 <refentrytitle><phrase>snd_compress_register</phrase></refentrytitle> 12259 <manvolnum>9</manvolnum> 12260 <refmiscinfo class="version">4.1.27</refmiscinfo> 12261</refmeta> 12262<refnamediv> 12263 <refname>snd_compress_register</refname> 12264 <refpurpose> 12265 register compressed device 12266 </refpurpose> 12267</refnamediv> 12268<refsynopsisdiv> 12269 <title>Synopsis</title> 12270 <funcsynopsis><funcprototype> 12271 <funcdef>int <function>snd_compress_register </function></funcdef> 12272 <paramdef>struct snd_compr * <parameter>device</parameter></paramdef> 12273 </funcprototype></funcsynopsis> 12274</refsynopsisdiv> 12275<refsect1> 12276 <title>Arguments</title> 12277 <variablelist> 12278 <varlistentry> 12279 <term><parameter>device</parameter></term> 12280 <listitem> 12281 <para> 12282 compressed device to register 12283 </para> 12284 </listitem> 12285 </varlistentry> 12286 </variablelist> 12287</refsect1> 12288</refentry> 12289 12290<!-- include/uapi/sound/compress_offload.h --> 12291<refentry id="API-struct-snd-compressed-buffer"> 12292<refentryinfo> 12293 <title>LINUX</title> 12294 <productname>Kernel Hackers Manual</productname> 12295 <date>July 2017</date> 12296</refentryinfo> 12297<refmeta> 12298 <refentrytitle><phrase>struct snd_compressed_buffer</phrase></refentrytitle> 12299 <manvolnum>9</manvolnum> 12300 <refmiscinfo class="version">4.1.27</refmiscinfo> 12301</refmeta> 12302<refnamediv> 12303 <refname>struct snd_compressed_buffer</refname> 12304 <refpurpose> 12305 compressed buffer 12306 </refpurpose> 12307</refnamediv> 12308<refsynopsisdiv> 12309 <title>Synopsis</title> 12310 <programlisting> 12311struct snd_compressed_buffer { 12312 __u32 fragment_size; 12313 __u32 fragments; 12314}; </programlisting> 12315</refsynopsisdiv> 12316 <refsect1> 12317 <title>Members</title> 12318 <variablelist> 12319 <varlistentry> <term>fragment_size</term> 12320 <listitem><para> 12321size of buffer fragment in bytes 12322 </para></listitem> 12323 </varlistentry> 12324 <varlistentry> <term>fragments</term> 12325 <listitem><para> 12326number of such fragments 12327 </para></listitem> 12328 </varlistentry> 12329 </variablelist> 12330 </refsect1> 12331</refentry> 12332 12333<refentry id="API-struct-snd-compr-params"> 12334<refentryinfo> 12335 <title>LINUX</title> 12336 <productname>Kernel Hackers Manual</productname> 12337 <date>July 2017</date> 12338</refentryinfo> 12339<refmeta> 12340 <refentrytitle><phrase>struct snd_compr_params</phrase></refentrytitle> 12341 <manvolnum>9</manvolnum> 12342 <refmiscinfo class="version">4.1.27</refmiscinfo> 12343</refmeta> 12344<refnamediv> 12345 <refname>struct snd_compr_params</refname> 12346 <refpurpose> 12347 compressed stream params 12348 </refpurpose> 12349</refnamediv> 12350<refsynopsisdiv> 12351 <title>Synopsis</title> 12352 <programlisting> 12353struct snd_compr_params { 12354 struct snd_compressed_buffer buffer; 12355 struct snd_codec codec; 12356 __u8 no_wake_mode; 12357}; </programlisting> 12358</refsynopsisdiv> 12359 <refsect1> 12360 <title>Members</title> 12361 <variablelist> 12362 <varlistentry> <term>buffer</term> 12363 <listitem><para> 12364 buffer description 12365 </para></listitem> 12366 </varlistentry> 12367 <varlistentry> <term>codec</term> 12368 <listitem><para> 12369 codec parameters 12370 </para></listitem> 12371 </varlistentry> 12372 <varlistentry> <term>no_wake_mode</term> 12373 <listitem><para> 12374 dont wake on fragment elapsed 12375 </para></listitem> 12376 </varlistentry> 12377 </variablelist> 12378 </refsect1> 12379</refentry> 12380 12381<refentry id="API-struct-snd-compr-tstamp"> 12382<refentryinfo> 12383 <title>LINUX</title> 12384 <productname>Kernel Hackers Manual</productname> 12385 <date>July 2017</date> 12386</refentryinfo> 12387<refmeta> 12388 <refentrytitle><phrase>struct snd_compr_tstamp</phrase></refentrytitle> 12389 <manvolnum>9</manvolnum> 12390 <refmiscinfo class="version">4.1.27</refmiscinfo> 12391</refmeta> 12392<refnamediv> 12393 <refname>struct snd_compr_tstamp</refname> 12394 <refpurpose> 12395 timestamp descriptor 12396 </refpurpose> 12397</refnamediv> 12398<refsynopsisdiv> 12399 <title>Synopsis</title> 12400 <programlisting> 12401struct snd_compr_tstamp { 12402 __u32 byte_offset; 12403 __u32 copied_total; 12404 __u32 pcm_frames; 12405 __u32 pcm_io_frames; 12406 __u32 sampling_rate; 12407}; </programlisting> 12408</refsynopsisdiv> 12409 <refsect1> 12410 <title>Members</title> 12411 <variablelist> 12412 <varlistentry> <term>byte_offset</term> 12413 <listitem><para> 12414 Byte offset in ring buffer to DSP 12415 </para></listitem> 12416 </varlistentry> 12417 <varlistentry> <term>copied_total</term> 12418 <listitem><para> 12419 Total number of bytes copied from/to ring buffer to/by DSP 12420 </para></listitem> 12421 </varlistentry> 12422 <varlistentry> <term>pcm_frames</term> 12423 <listitem><para> 12424 Frames decoded or encoded by DSP. This field will evolve by 12425 large steps and should only be used to monitor encoding/decoding 12426 progress. It shall not be used for timing estimates. 12427 </para></listitem> 12428 </varlistentry> 12429 <varlistentry> <term>pcm_io_frames</term> 12430 <listitem><para> 12431 Frames rendered or received by DSP into a mixer or an audio 12432 output/input. This field should be used for A/V sync or time estimates. 12433 </para></listitem> 12434 </varlistentry> 12435 <varlistentry> <term>sampling_rate</term> 12436 <listitem><para> 12437 sampling rate of audio 12438 </para></listitem> 12439 </varlistentry> 12440 </variablelist> 12441 </refsect1> 12442</refentry> 12443 12444<refentry id="API-struct-snd-compr-avail"> 12445<refentryinfo> 12446 <title>LINUX</title> 12447 <productname>Kernel Hackers Manual</productname> 12448 <date>July 2017</date> 12449</refentryinfo> 12450<refmeta> 12451 <refentrytitle><phrase>struct snd_compr_avail</phrase></refentrytitle> 12452 <manvolnum>9</manvolnum> 12453 <refmiscinfo class="version">4.1.27</refmiscinfo> 12454</refmeta> 12455<refnamediv> 12456 <refname>struct snd_compr_avail</refname> 12457 <refpurpose> 12458 avail descriptor 12459 </refpurpose> 12460</refnamediv> 12461<refsynopsisdiv> 12462 <title>Synopsis</title> 12463 <programlisting> 12464struct snd_compr_avail { 12465 __u64 avail; 12466 struct snd_compr_tstamp tstamp; 12467}; </programlisting> 12468</refsynopsisdiv> 12469 <refsect1> 12470 <title>Members</title> 12471 <variablelist> 12472 <varlistentry> <term>avail</term> 12473 <listitem><para> 12474 Number of bytes available in ring buffer for writing/reading 12475 </para></listitem> 12476 </varlistentry> 12477 <varlistentry> <term>tstamp</term> 12478 <listitem><para> 12479 timestamp information 12480 </para></listitem> 12481 </varlistentry> 12482 </variablelist> 12483 </refsect1> 12484</refentry> 12485 12486<refentry id="API-struct-snd-compr-caps"> 12487<refentryinfo> 12488 <title>LINUX</title> 12489 <productname>Kernel Hackers Manual</productname> 12490 <date>July 2017</date> 12491</refentryinfo> 12492<refmeta> 12493 <refentrytitle><phrase>struct snd_compr_caps</phrase></refentrytitle> 12494 <manvolnum>9</manvolnum> 12495 <refmiscinfo class="version">4.1.27</refmiscinfo> 12496</refmeta> 12497<refnamediv> 12498 <refname>struct snd_compr_caps</refname> 12499 <refpurpose> 12500 caps descriptor 12501 </refpurpose> 12502</refnamediv> 12503<refsynopsisdiv> 12504 <title>Synopsis</title> 12505 <programlisting> 12506struct snd_compr_caps { 12507 __u32 num_codecs; 12508 __u32 direction; 12509 __u32 min_fragment_size; 12510 __u32 max_fragment_size; 12511 __u32 min_fragments; 12512 __u32 max_fragments; 12513 __u32 codecs[MAX_NUM_CODECS]; 12514 __u32 reserved[11]; 12515}; </programlisting> 12516</refsynopsisdiv> 12517 <refsect1> 12518 <title>Members</title> 12519 <variablelist> 12520 <varlistentry> <term>num_codecs</term> 12521 <listitem><para> 12522 number of codecs supported 12523 </para></listitem> 12524 </varlistentry> 12525 <varlistentry> <term>direction</term> 12526 <listitem><para> 12527 direction supported. Of type snd_compr_direction 12528 </para></listitem> 12529 </varlistentry> 12530 <varlistentry> <term>min_fragment_size</term> 12531 <listitem><para> 12532 minimum fragment supported by DSP 12533 </para></listitem> 12534 </varlistentry> 12535 <varlistentry> <term>max_fragment_size</term> 12536 <listitem><para> 12537 maximum fragment supported by DSP 12538 </para></listitem> 12539 </varlistentry> 12540 <varlistentry> <term>min_fragments</term> 12541 <listitem><para> 12542 min fragments supported by DSP 12543 </para></listitem> 12544 </varlistentry> 12545 <varlistentry> <term>max_fragments</term> 12546 <listitem><para> 12547 max fragments supported by DSP 12548 </para></listitem> 12549 </varlistentry> 12550 <varlistentry> <term>codecs[MAX_NUM_CODECS]</term> 12551 <listitem><para> 12552 pointer to array of codecs 12553 </para></listitem> 12554 </varlistentry> 12555 <varlistentry> <term>reserved[11]</term> 12556 <listitem><para> 12557 reserved field 12558 </para></listitem> 12559 </varlistentry> 12560 </variablelist> 12561 </refsect1> 12562</refentry> 12563 12564<refentry id="API-struct-snd-compr-codec-caps"> 12565<refentryinfo> 12566 <title>LINUX</title> 12567 <productname>Kernel Hackers Manual</productname> 12568 <date>July 2017</date> 12569</refentryinfo> 12570<refmeta> 12571 <refentrytitle><phrase>struct snd_compr_codec_caps</phrase></refentrytitle> 12572 <manvolnum>9</manvolnum> 12573 <refmiscinfo class="version">4.1.27</refmiscinfo> 12574</refmeta> 12575<refnamediv> 12576 <refname>struct snd_compr_codec_caps</refname> 12577 <refpurpose> 12578 query capability of codec 12579 </refpurpose> 12580</refnamediv> 12581<refsynopsisdiv> 12582 <title>Synopsis</title> 12583 <programlisting> 12584struct snd_compr_codec_caps { 12585 __u32 codec; 12586 __u32 num_descriptors; 12587 struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS]; 12588}; </programlisting> 12589</refsynopsisdiv> 12590 <refsect1> 12591 <title>Members</title> 12592 <variablelist> 12593 <varlistentry> <term>codec</term> 12594 <listitem><para> 12595 codec for which capability is queried 12596 </para></listitem> 12597 </varlistentry> 12598 <varlistentry> <term>num_descriptors</term> 12599 <listitem><para> 12600 number of codec descriptors 12601 </para></listitem> 12602 </varlistentry> 12603 <varlistentry> <term>descriptor[MAX_NUM_CODEC_DESCRIPTORS]</term> 12604 <listitem><para> 12605 array of codec capability descriptor 12606 </para></listitem> 12607 </varlistentry> 12608 </variablelist> 12609 </refsect1> 12610</refentry> 12611 12612<refentry id="API-enum-sndrv-compress-encoder"> 12613<refentryinfo> 12614 <title>LINUX</title> 12615 <productname>Kernel Hackers Manual</productname> 12616 <date>July 2017</date> 12617</refentryinfo> 12618<refmeta> 12619 <refentrytitle><phrase>enum sndrv_compress_encoder</phrase></refentrytitle> 12620 <manvolnum>9</manvolnum> 12621 <refmiscinfo class="version">4.1.27</refmiscinfo> 12622</refmeta> 12623<refnamediv> 12624 <refname>enum sndrv_compress_encoder</refname> 12625 <refpurpose> 12626 </refpurpose> 12627</refnamediv> 12628<refsynopsisdiv> 12629 <title>Synopsis</title> 12630 <programlisting> 12631enum sndrv_compress_encoder { 12632 SNDRV_COMPRESS_ENCODER_PADDING, 12633 SNDRV_COMPRESS_ENCODER_DELAY 12634}; </programlisting> 12635</refsynopsisdiv> 12636<refsect1> 12637 <title>Constants</title> 12638 <variablelist> 12639 <varlistentry> <term>SNDRV_COMPRESS_ENCODER_PADDING</term> 12640 <listitem><para> 12641 no of samples appended by the encoder at the 12642 end of the track 12643 </para></listitem> 12644 </varlistentry> 12645 <varlistentry> <term>SNDRV_COMPRESS_ENCODER_DELAY</term> 12646 <listitem><para> 12647 no of samples inserted by the encoder at the 12648 beginning of the track 12649 </para></listitem> 12650 </varlistentry> 12651 </variablelist> 12652</refsect1> 12653</refentry> 12654 12655<refentry id="API-struct-snd-compr-metadata"> 12656<refentryinfo> 12657 <title>LINUX</title> 12658 <productname>Kernel Hackers Manual</productname> 12659 <date>July 2017</date> 12660</refentryinfo> 12661<refmeta> 12662 <refentrytitle><phrase>struct snd_compr_metadata</phrase></refentrytitle> 12663 <manvolnum>9</manvolnum> 12664 <refmiscinfo class="version">4.1.27</refmiscinfo> 12665</refmeta> 12666<refnamediv> 12667 <refname>struct snd_compr_metadata</refname> 12668 <refpurpose> 12669 compressed stream metadata 12670 </refpurpose> 12671</refnamediv> 12672<refsynopsisdiv> 12673 <title>Synopsis</title> 12674 <programlisting> 12675struct snd_compr_metadata { 12676 __u32 key; 12677 __u32 value[8]; 12678}; </programlisting> 12679</refsynopsisdiv> 12680 <refsect1> 12681 <title>Members</title> 12682 <variablelist> 12683 <varlistentry> <term>key</term> 12684 <listitem><para> 12685 key id 12686 </para></listitem> 12687 </varlistentry> 12688 <varlistentry> <term>value[8]</term> 12689 <listitem><para> 12690 key value 12691 </para></listitem> 12692 </varlistentry> 12693 </variablelist> 12694 </refsect1> 12695</refentry> 12696 12697<refentry id="API-SNDRV-COMPRESS-IOCTL-VERSION"> 12698<refentryinfo> 12699 <title>LINUX</title> 12700 <productname>Kernel Hackers Manual</productname> 12701 <date>July 2017</date> 12702</refentryinfo> 12703<refmeta> 12704 <refentrytitle><phrase>SNDRV_COMPRESS_IOCTL_VERSION</phrase></refentrytitle> 12705 <manvolnum>9</manvolnum> 12706 <refmiscinfo class="version">4.1.27</refmiscinfo> 12707</refmeta> 12708<refnamediv> 12709 <refname>SNDRV_COMPRESS_IOCTL_VERSION</refname> 12710 <refpurpose> 12711 </refpurpose> 12712</refnamediv> 12713<refsynopsisdiv> 12714 <title>Synopsis</title> 12715 <funcsynopsis><funcprototype> 12716 <funcdef> <function>SNDRV_COMPRESS_IOCTL_VERSION </function></funcdef> 12717 <void/> 12718 </funcprototype></funcsynopsis> 12719</refsynopsisdiv> 12720<refsect1> 12721 <title>Arguments</title> 12722 <para> 12723 None 12724 </para> 12725</refsect1> 12726<refsect1> 12727<title>SNDRV_COMPRESS_GET_CAPS</title> 12728<para> 12729 Query capability of DSP 12730</para> 12731</refsect1> 12732<refsect1> 12733<title>SNDRV_COMPRESS_GET_CODEC_CAPS</title> 12734<para> 12735 Query capability of a codec 12736</para> 12737</refsect1> 12738<refsect1> 12739<title>SNDRV_COMPRESS_SET_PARAMS</title> 12740<para> 12741 Set codec and stream parameters 12742</para> 12743</refsect1> 12744<refsect1> 12745<title>Note</title> 12746<para> 12747 only codec params can be changed runtime and stream params cant be 12748</para> 12749</refsect1> 12750<refsect1> 12751<title>SNDRV_COMPRESS_GET_PARAMS</title> 12752<para> 12753 Query codec params 12754</para> 12755</refsect1> 12756<refsect1> 12757<title>SNDRV_COMPRESS_TSTAMP</title> 12758<para> 12759 get the current timestamp value 12760</para> 12761</refsect1> 12762<refsect1> 12763<title>SNDRV_COMPRESS_AVAIL</title> 12764<para> 12765 get the current buffer avail value. 12766 This also queries the tstamp properties 12767</para> 12768</refsect1> 12769<refsect1> 12770<title>SNDRV_COMPRESS_PAUSE</title> 12771<para> 12772 Pause the running stream 12773</para> 12774</refsect1> 12775<refsect1> 12776<title>SNDRV_COMPRESS_RESUME</title> 12777<para> 12778 resume a paused stream 12779</para> 12780</refsect1> 12781<refsect1> 12782<title>SNDRV_COMPRESS_START</title> 12783<para> 12784 Start a stream 12785</para> 12786</refsect1> 12787<refsect1> 12788<title>SNDRV_COMPRESS_STOP</title> 12789<para> 12790 stop a running stream, discarding ring buffer content 12791 and the buffers currently with DSP 12792</para> 12793</refsect1> 12794<refsect1> 12795<title>SNDRV_COMPRESS_DRAIN</title> 12796<para> 12797 Play till end of buffers and stop after that 12798</para> 12799</refsect1> 12800<refsect1> 12801<title>SNDRV_COMPRESS_IOCTL_VERSION</title> 12802<para> 12803 Query the API version 12804</para> 12805</refsect1> 12806</refentry> 12807 12808<!-- include/uapi/sound/compress_params.h --> 12809<refentry id="API-struct-snd-enc-vorbis"> 12810<refentryinfo> 12811 <title>LINUX</title> 12812 <productname>Kernel Hackers Manual</productname> 12813 <date>July 2017</date> 12814</refentryinfo> 12815<refmeta> 12816 <refentrytitle><phrase>struct snd_enc_vorbis</phrase></refentrytitle> 12817 <manvolnum>9</manvolnum> 12818 <refmiscinfo class="version">4.1.27</refmiscinfo> 12819</refmeta> 12820<refnamediv> 12821 <refname>struct snd_enc_vorbis</refname> 12822 <refpurpose> 12823 </refpurpose> 12824</refnamediv> 12825<refsynopsisdiv> 12826 <title>Synopsis</title> 12827 <programlisting> 12828struct snd_enc_vorbis { 12829 __s32 quality; 12830 __u32 managed; 12831 __u32 max_bit_rate; 12832 __u32 min_bit_rate; 12833 __u32 downmix; 12834}; </programlisting> 12835</refsynopsisdiv> 12836 <refsect1> 12837 <title>Members</title> 12838 <variablelist> 12839 <varlistentry> <term>quality</term> 12840 <listitem><para> 12841Sets encoding quality to n, between -1 (low) and 10 (high). 12842In the default mode of operation, the quality level is 3. 12843Normal quality range is 0 - 10. 12844 </para></listitem> 12845 </varlistentry> 12846 <varlistentry> <term>managed</term> 12847 <listitem><para> 12848Boolean. Set bitrate management mode. This turns off the 12849normal VBR encoding, but allows hard or soft bitrate constraints to be 12850enforced by the encoder. This mode can be slower, and may also be 12851lower quality. It is primarily useful for streaming. 12852 </para></listitem> 12853 </varlistentry> 12854 <varlistentry> <term>max_bit_rate</term> 12855 <listitem><para> 12856Enabled only if managed is TRUE 12857 </para></listitem> 12858 </varlistentry> 12859 <varlistentry> <term>min_bit_rate</term> 12860 <listitem><para> 12861Enabled only if managed is TRUE 12862 </para></listitem> 12863 </varlistentry> 12864 <varlistentry> <term>downmix</term> 12865 <listitem><para> 12866Boolean. Downmix input from stereo to mono (has no effect on 12867non-stereo streams). Useful for lower-bitrate encoding. 12868 </para></listitem> 12869 </varlistentry> 12870 </variablelist> 12871 </refsect1> 12872<refsect1> 12873<title>Description</title> 12874<para> 12875 These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc 12876 properties 12877 </para><para> 12878 12879 For best quality users should specify VBR mode and set quality levels. 12880</para> 12881</refsect1> 12882</refentry> 12883 12884<refentry id="API-struct-snd-enc-real"> 12885<refentryinfo> 12886 <title>LINUX</title> 12887 <productname>Kernel Hackers Manual</productname> 12888 <date>July 2017</date> 12889</refentryinfo> 12890<refmeta> 12891 <refentrytitle><phrase>struct snd_enc_real</phrase></refentrytitle> 12892 <manvolnum>9</manvolnum> 12893 <refmiscinfo class="version">4.1.27</refmiscinfo> 12894</refmeta> 12895<refnamediv> 12896 <refname>struct snd_enc_real</refname> 12897 <refpurpose> 12898 </refpurpose> 12899</refnamediv> 12900<refsynopsisdiv> 12901 <title>Synopsis</title> 12902 <programlisting> 12903struct snd_enc_real { 12904 __u32 quant_bits; 12905 __u32 start_region; 12906 __u32 num_regions; 12907}; </programlisting> 12908</refsynopsisdiv> 12909 <refsect1> 12910 <title>Members</title> 12911 <variablelist> 12912 <varlistentry> <term>quant_bits</term> 12913 <listitem><para> 12914 number of coupling quantization bits in the stream 12915 </para></listitem> 12916 </varlistentry> 12917 <varlistentry> <term>start_region</term> 12918 <listitem><para> 12919 coupling start region in the stream 12920 </para></listitem> 12921 </varlistentry> 12922 <varlistentry> <term>num_regions</term> 12923 <listitem><para> 12924 number of regions value 12925 </para></listitem> 12926 </varlistentry> 12927 </variablelist> 12928 </refsect1> 12929<refsect1> 12930<title>Description</title> 12931<para> 12932 These options were extracted from the OpenMAX IL spec 12933</para> 12934</refsect1> 12935</refentry> 12936 12937<refentry id="API-struct-snd-enc-flac"> 12938<refentryinfo> 12939 <title>LINUX</title> 12940 <productname>Kernel Hackers Manual</productname> 12941 <date>July 2017</date> 12942</refentryinfo> 12943<refmeta> 12944 <refentrytitle><phrase>struct snd_enc_flac</phrase></refentrytitle> 12945 <manvolnum>9</manvolnum> 12946 <refmiscinfo class="version">4.1.27</refmiscinfo> 12947</refmeta> 12948<refnamediv> 12949 <refname>struct snd_enc_flac</refname> 12950 <refpurpose> 12951 </refpurpose> 12952</refnamediv> 12953<refsynopsisdiv> 12954 <title>Synopsis</title> 12955 <programlisting> 12956struct snd_enc_flac { 12957 __u32 num; 12958 __u32 gain; 12959}; </programlisting> 12960</refsynopsisdiv> 12961 <refsect1> 12962 <title>Members</title> 12963 <variablelist> 12964 <varlistentry> <term>num</term> 12965 <listitem><para> 12966 serial number, valid only for OGG formats 12967 needs to be set by application 12968 </para></listitem> 12969 </varlistentry> 12970 <varlistentry> <term>gain</term> 12971 <listitem><para> 12972 Add replay gain tags 12973 </para></listitem> 12974 </varlistentry> 12975 </variablelist> 12976 </refsect1> 12977<refsect1> 12978<title>Description</title> 12979<para> 12980 These options were extracted from the FLAC online documentation 12981</para> 12982</refsect1> 12983<refsect1> 12984<title>at http</title> 12985<para> 12986 //flac.sourceforge.net/documentation_tools_flac.html 12987 </para><para> 12988 12989 To make the API simpler, it is assumed that the user will select quality 12990 profiles. Additional options that affect encoding quality and speed can 12991 be added at a later stage if needed. 12992 </para><para> 12993 12994 By default the Subset format is used by encoders. 12995 </para><para> 12996 12997 TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are 12998 not supported in this API. 12999</para> 13000</refsect1> 13001</refentry> 13002 13003<!-- include/sound/compress_driver.h --> 13004<refentry id="API-struct-snd-compr-runtime"> 13005<refentryinfo> 13006 <title>LINUX</title> 13007 <productname>Kernel Hackers Manual</productname> 13008 <date>July 2017</date> 13009</refentryinfo> 13010<refmeta> 13011 <refentrytitle><phrase>struct snd_compr_runtime</phrase></refentrytitle> 13012 <manvolnum>9</manvolnum> 13013 <refmiscinfo class="version">4.1.27</refmiscinfo> 13014</refmeta> 13015<refnamediv> 13016 <refname>struct snd_compr_runtime</refname> 13017 <refpurpose> 13018 </refpurpose> 13019</refnamediv> 13020<refsynopsisdiv> 13021 <title>Synopsis</title> 13022 <programlisting> 13023struct snd_compr_runtime { 13024 snd_pcm_state_t state; 13025 struct snd_compr_ops * ops; 13026 void * buffer; 13027 u64 buffer_size; 13028 u32 fragment_size; 13029 u32 fragments; 13030 u64 total_bytes_available; 13031 u64 total_bytes_transferred; 13032 wait_queue_head_t sleep; 13033 void * private_data; 13034}; </programlisting> 13035</refsynopsisdiv> 13036 <refsect1> 13037 <title>Members</title> 13038 <variablelist> 13039 <varlistentry> <term>state</term> 13040 <listitem><para> 13041stream state 13042 </para></listitem> 13043 </varlistentry> 13044 <varlistentry> <term>ops</term> 13045 <listitem><para> 13046pointer to DSP callbacks 13047 </para></listitem> 13048 </varlistentry> 13049 <varlistentry> <term>buffer</term> 13050 <listitem><para> 13051pointer to kernel buffer, valid only when not in mmap mode or 13052DSP doesn't implement copy 13053 </para></listitem> 13054 </varlistentry> 13055 <varlistentry> <term>buffer_size</term> 13056 <listitem><para> 13057size of the above buffer 13058 </para></listitem> 13059 </varlistentry> 13060 <varlistentry> <term>fragment_size</term> 13061 <listitem><para> 13062size of buffer fragment in bytes 13063 </para></listitem> 13064 </varlistentry> 13065 <varlistentry> <term>fragments</term> 13066 <listitem><para> 13067number of such fragments 13068 </para></listitem> 13069 </varlistentry> 13070 <varlistentry> <term>total_bytes_available</term> 13071 <listitem><para> 13072cumulative number of bytes made available in 13073the ring buffer 13074 </para></listitem> 13075 </varlistentry> 13076 <varlistentry> <term>total_bytes_transferred</term> 13077 <listitem><para> 13078cumulative bytes transferred by offload DSP 13079 </para></listitem> 13080 </varlistentry> 13081 <varlistentry> <term>sleep</term> 13082 <listitem><para> 13083poll sleep 13084 </para></listitem> 13085 </varlistentry> 13086 <varlistentry> <term>private_data</term> 13087 <listitem><para> 13088driver private data pointer 13089 </para></listitem> 13090 </varlistentry> 13091 </variablelist> 13092 </refsect1> 13093</refentry> 13094 13095<refentry id="API-struct-snd-compr-stream"> 13096<refentryinfo> 13097 <title>LINUX</title> 13098 <productname>Kernel Hackers Manual</productname> 13099 <date>July 2017</date> 13100</refentryinfo> 13101<refmeta> 13102 <refentrytitle><phrase>struct snd_compr_stream</phrase></refentrytitle> 13103 <manvolnum>9</manvolnum> 13104 <refmiscinfo class="version">4.1.27</refmiscinfo> 13105</refmeta> 13106<refnamediv> 13107 <refname>struct snd_compr_stream</refname> 13108 <refpurpose> 13109 </refpurpose> 13110</refnamediv> 13111<refsynopsisdiv> 13112 <title>Synopsis</title> 13113 <programlisting> 13114struct snd_compr_stream { 13115 const char * name; 13116 struct snd_compr_ops * ops; 13117 struct snd_compr_runtime * runtime; 13118 struct snd_compr * device; 13119 enum snd_compr_direction direction; 13120 bool metadata_set; 13121 bool next_track; 13122 void * private_data; 13123}; </programlisting> 13124</refsynopsisdiv> 13125 <refsect1> 13126 <title>Members</title> 13127 <variablelist> 13128 <varlistentry> <term>name</term> 13129 <listitem><para> 13130 device name 13131 </para></listitem> 13132 </varlistentry> 13133 <varlistentry> <term>ops</term> 13134 <listitem><para> 13135 pointer to DSP callbacks 13136 </para></listitem> 13137 </varlistentry> 13138 <varlistentry> <term>runtime</term> 13139 <listitem><para> 13140 pointer to runtime structure 13141 </para></listitem> 13142 </varlistentry> 13143 <varlistentry> <term>device</term> 13144 <listitem><para> 13145 device pointer 13146 </para></listitem> 13147 </varlistentry> 13148 <varlistentry> <term>direction</term> 13149 <listitem><para> 13150 stream direction, playback/recording 13151 </para></listitem> 13152 </varlistentry> 13153 <varlistentry> <term>metadata_set</term> 13154 <listitem><para> 13155 metadata set flag, true when set 13156 </para></listitem> 13157 </varlistentry> 13158 <varlistentry> <term>next_track</term> 13159 <listitem><para> 13160 has userspace signal next track transition, true when set 13161 </para></listitem> 13162 </varlistentry> 13163 <varlistentry> <term>private_data</term> 13164 <listitem><para> 13165 pointer to DSP private data 13166 </para></listitem> 13167 </varlistentry> 13168 </variablelist> 13169 </refsect1> 13170</refentry> 13171 13172<refentry id="API-struct-snd-compr-ops"> 13173<refentryinfo> 13174 <title>LINUX</title> 13175 <productname>Kernel Hackers Manual</productname> 13176 <date>July 2017</date> 13177</refentryinfo> 13178<refmeta> 13179 <refentrytitle><phrase>struct snd_compr_ops</phrase></refentrytitle> 13180 <manvolnum>9</manvolnum> 13181 <refmiscinfo class="version">4.1.27</refmiscinfo> 13182</refmeta> 13183<refnamediv> 13184 <refname>struct snd_compr_ops</refname> 13185 <refpurpose> 13186 </refpurpose> 13187</refnamediv> 13188<refsynopsisdiv> 13189 <title>Synopsis</title> 13190 <programlisting> 13191struct snd_compr_ops { 13192 int (* open) (struct snd_compr_stream *stream); 13193 int (* free) (struct snd_compr_stream *stream); 13194 int (* set_params) (struct snd_compr_stream *stream,struct snd_compr_params *params); 13195 int (* get_params) (struct snd_compr_stream *stream,struct snd_codec *params); 13196 int (* set_metadata) (struct snd_compr_stream *stream,struct snd_compr_metadata *metadata); 13197 int (* get_metadata) (struct snd_compr_stream *stream,struct snd_compr_metadata *metadata); 13198 int (* trigger) (struct snd_compr_stream *stream, int cmd); 13199 int (* pointer) (struct snd_compr_stream *stream,struct snd_compr_tstamp *tstamp); 13200 int (* copy) (struct snd_compr_stream *stream, char __user *buf,size_t count); 13201 int (* mmap) (struct snd_compr_stream *stream,struct vm_area_struct *vma); 13202 int (* ack) (struct snd_compr_stream *stream, size_t bytes); 13203 int (* get_caps) (struct snd_compr_stream *stream,struct snd_compr_caps *caps); 13204 int (* get_codec_caps) (struct snd_compr_stream *stream,struct snd_compr_codec_caps *codec); 13205}; </programlisting> 13206</refsynopsisdiv> 13207 <refsect1> 13208 <title>Members</title> 13209 <variablelist> 13210 <varlistentry> <term>open</term> 13211 <listitem><para> 13212 Open the compressed stream 13213 This callback is mandatory and shall keep dsp ready to receive the stream 13214 parameter 13215 </para></listitem> 13216 </varlistentry> 13217 <varlistentry> <term>free</term> 13218 <listitem><para> 13219 Close the compressed stream, mandatory 13220 </para></listitem> 13221 </varlistentry> 13222 <varlistentry> <term>set_params</term> 13223 <listitem><para> 13224 Sets the compressed stream parameters, mandatory 13225 This can be called in during stream creation only to set codec params 13226 and the stream properties 13227 </para></listitem> 13228 </varlistentry> 13229 <varlistentry> <term>get_params</term> 13230 <listitem><para> 13231 retrieve the codec parameters, mandatory 13232 </para></listitem> 13233 </varlistentry> 13234 <varlistentry> <term>set_metadata</term> 13235 <listitem><para> 13236 Set the metadata values for a stream 13237 </para></listitem> 13238 </varlistentry> 13239 <varlistentry> <term>get_metadata</term> 13240 <listitem><para> 13241 retrieves the requested metadata values from stream 13242 </para></listitem> 13243 </varlistentry> 13244 <varlistentry> <term>trigger</term> 13245 <listitem><para> 13246 Trigger operations like start, pause, resume, drain, stop. 13247 This callback is mandatory 13248 </para></listitem> 13249 </varlistentry> 13250 <varlistentry> <term>pointer</term> 13251 <listitem><para> 13252 Retrieve current h/w pointer information. Mandatory 13253 </para></listitem> 13254 </varlistentry> 13255 <varlistentry> <term>copy</term> 13256 <listitem><para> 13257 Copy the compressed data to/from userspace, Optional 13258 Can't be implemented if DSP supports mmap 13259 </para></listitem> 13260 </varlistentry> 13261 <varlistentry> <term>mmap</term> 13262 <listitem><para> 13263 DSP mmap method to mmap DSP memory 13264 </para></listitem> 13265 </varlistentry> 13266 <varlistentry> <term>ack</term> 13267 <listitem><para> 13268 Ack for DSP when data is written to audio buffer, Optional 13269 Not valid if copy is implemented 13270 </para></listitem> 13271 </varlistentry> 13272 <varlistentry> <term>get_caps</term> 13273 <listitem><para> 13274 Retrieve DSP capabilities, mandatory 13275 </para></listitem> 13276 </varlistentry> 13277 <varlistentry> <term>get_codec_caps</term> 13278 <listitem><para> 13279 Retrieve capabilities for a specific codec, mandatory 13280 </para></listitem> 13281 </varlistentry> 13282 </variablelist> 13283 </refsect1> 13284</refentry> 13285 13286<refentry id="API-struct-snd-compr"> 13287<refentryinfo> 13288 <title>LINUX</title> 13289 <productname>Kernel Hackers Manual</productname> 13290 <date>July 2017</date> 13291</refentryinfo> 13292<refmeta> 13293 <refentrytitle><phrase>struct snd_compr</phrase></refentrytitle> 13294 <manvolnum>9</manvolnum> 13295 <refmiscinfo class="version">4.1.27</refmiscinfo> 13296</refmeta> 13297<refnamediv> 13298 <refname>struct snd_compr</refname> 13299 <refpurpose> 13300 </refpurpose> 13301</refnamediv> 13302<refsynopsisdiv> 13303 <title>Synopsis</title> 13304 <programlisting> 13305struct snd_compr { 13306 const char * name; 13307 struct device dev; 13308 struct snd_compr_ops * ops; 13309 void * private_data; 13310 struct snd_card * card; 13311 unsigned int direction; 13312 struct mutex lock; 13313 int device; 13314}; </programlisting> 13315</refsynopsisdiv> 13316 <refsect1> 13317 <title>Members</title> 13318 <variablelist> 13319 <varlistentry> <term>name</term> 13320 <listitem><para> 13321 DSP device name 13322 </para></listitem> 13323 </varlistentry> 13324 <varlistentry> <term>dev</term> 13325 <listitem><para> 13326 associated device instance 13327 </para></listitem> 13328 </varlistentry> 13329 <varlistentry> <term>ops</term> 13330 <listitem><para> 13331 pointer to DSP callbacks 13332 </para></listitem> 13333 </varlistentry> 13334 <varlistentry> <term>private_data</term> 13335 <listitem><para> 13336 pointer to DSP pvt data 13337 </para></listitem> 13338 </varlistentry> 13339 <varlistentry> <term>card</term> 13340 <listitem><para> 13341 sound card pointer 13342 </para></listitem> 13343 </varlistentry> 13344 <varlistentry> <term>direction</term> 13345 <listitem><para> 13346 Playback or capture direction 13347 </para></listitem> 13348 </varlistentry> 13349 <varlistentry> <term>lock</term> 13350 <listitem><para> 13351 device lock 13352 </para></listitem> 13353 </varlistentry> 13354 <varlistentry> <term>device</term> 13355 <listitem><para> 13356 device id 13357 </para></listitem> 13358 </varlistentry> 13359 </variablelist> 13360 </refsect1> 13361</refentry> 13362 13363 </sect1> 13364 </chapter> 13365 <chapter><title>ASoC</title> 13366 <sect1><title>ASoC Core API</title> 13367<!-- include/sound/soc.h --> 13368<refentry id="API-struct-snd-soc-jack-pin"> 13369<refentryinfo> 13370 <title>LINUX</title> 13371 <productname>Kernel Hackers Manual</productname> 13372 <date>July 2017</date> 13373</refentryinfo> 13374<refmeta> 13375 <refentrytitle><phrase>struct snd_soc_jack_pin</phrase></refentrytitle> 13376 <manvolnum>9</manvolnum> 13377 <refmiscinfo class="version">4.1.27</refmiscinfo> 13378</refmeta> 13379<refnamediv> 13380 <refname>struct snd_soc_jack_pin</refname> 13381 <refpurpose> 13382 Describes a pin to update based on jack detection 13383 </refpurpose> 13384</refnamediv> 13385<refsynopsisdiv> 13386 <title>Synopsis</title> 13387 <programlisting> 13388struct snd_soc_jack_pin { 13389 const char * pin; 13390 int mask; 13391 bool invert; 13392}; </programlisting> 13393</refsynopsisdiv> 13394 <refsect1> 13395 <title>Members</title> 13396 <variablelist> 13397 <varlistentry> <term>pin</term> 13398 <listitem><para> 13399name of the pin to update 13400 </para></listitem> 13401 </varlistentry> 13402 <varlistentry> <term>mask</term> 13403 <listitem><para> 13404bits to check for in reported jack status 13405 </para></listitem> 13406 </varlistentry> 13407 <varlistentry> <term>invert</term> 13408 <listitem><para> 13409if non-zero then pin is enabled when status is not reported 13410 </para></listitem> 13411 </varlistentry> 13412 </variablelist> 13413 </refsect1> 13414</refentry> 13415 13416<refentry id="API-struct-snd-soc-jack-zone"> 13417<refentryinfo> 13418 <title>LINUX</title> 13419 <productname>Kernel Hackers Manual</productname> 13420 <date>July 2017</date> 13421</refentryinfo> 13422<refmeta> 13423 <refentrytitle><phrase>struct snd_soc_jack_zone</phrase></refentrytitle> 13424 <manvolnum>9</manvolnum> 13425 <refmiscinfo class="version">4.1.27</refmiscinfo> 13426</refmeta> 13427<refnamediv> 13428 <refname>struct snd_soc_jack_zone</refname> 13429 <refpurpose> 13430 Describes voltage zones of jack detection 13431 </refpurpose> 13432</refnamediv> 13433<refsynopsisdiv> 13434 <title>Synopsis</title> 13435 <programlisting> 13436struct snd_soc_jack_zone { 13437 unsigned int min_mv; 13438 unsigned int max_mv; 13439 unsigned int jack_type; 13440 unsigned int debounce_time; 13441}; </programlisting> 13442</refsynopsisdiv> 13443 <refsect1> 13444 <title>Members</title> 13445 <variablelist> 13446 <varlistentry> <term>min_mv</term> 13447 <listitem><para> 13448 start voltage in mv 13449 </para></listitem> 13450 </varlistentry> 13451 <varlistentry> <term>max_mv</term> 13452 <listitem><para> 13453 end voltage in mv 13454 </para></listitem> 13455 </varlistentry> 13456 <varlistentry> <term>jack_type</term> 13457 <listitem><para> 13458 type of jack that is expected for this voltage 13459 </para></listitem> 13460 </varlistentry> 13461 <varlistentry> <term>debounce_time</term> 13462 <listitem><para> 13463 debounce_time for jack, codec driver should wait for this 13464 duration before reading the adc for voltages 13465 @:list: list container 13466 </para></listitem> 13467 </varlistentry> 13468 </variablelist> 13469 </refsect1> 13470</refentry> 13471 13472<refentry id="API-struct-snd-soc-jack-gpio"> 13473<refentryinfo> 13474 <title>LINUX</title> 13475 <productname>Kernel Hackers Manual</productname> 13476 <date>July 2017</date> 13477</refentryinfo> 13478<refmeta> 13479 <refentrytitle><phrase>struct snd_soc_jack_gpio</phrase></refentrytitle> 13480 <manvolnum>9</manvolnum> 13481 <refmiscinfo class="version">4.1.27</refmiscinfo> 13482</refmeta> 13483<refnamediv> 13484 <refname>struct snd_soc_jack_gpio</refname> 13485 <refpurpose> 13486 Describes a gpio pin for jack detection 13487 </refpurpose> 13488</refnamediv> 13489<refsynopsisdiv> 13490 <title>Synopsis</title> 13491 <programlisting> 13492struct snd_soc_jack_gpio { 13493 unsigned int gpio; 13494 unsigned int idx; 13495 const char * name; 13496 int report; 13497 int invert; 13498 bool wake; 13499 int (* jack_status_check) (void *data); 13500}; </programlisting> 13501</refsynopsisdiv> 13502 <refsect1> 13503 <title>Members</title> 13504 <variablelist> 13505 <varlistentry> <term>gpio</term> 13506 <listitem><para> 13507 legacy gpio number 13508 </para></listitem> 13509 </varlistentry> 13510 <varlistentry> <term>idx</term> 13511 <listitem><para> 13512 gpio descriptor index within the function of the GPIO 13513 consumer device 13514 <parameter>gpiod_dev</parameter> GPIO consumer device 13515 </para></listitem> 13516 </varlistentry> 13517 <varlistentry> <term>name</term> 13518 <listitem><para> 13519 gpio name. Also as connection ID for the GPIO consumer 13520 device function name lookup 13521 </para></listitem> 13522 </varlistentry> 13523 <varlistentry> <term>report</term> 13524 <listitem><para> 13525 value to report when jack detected 13526 </para></listitem> 13527 </varlistentry> 13528 <varlistentry> <term>invert</term> 13529 <listitem><para> 13530 report presence in low state 13531 </para></listitem> 13532 </varlistentry> 13533 <varlistentry> <term>wake</term> 13534 <listitem><para> 13535 enable as wake source 13536 </para></listitem> 13537 </varlistentry> 13538 <varlistentry> <term>jack_status_check</term> 13539 <listitem><para> 13540 callback function which overrides the detection 13541 to provide more complex checks (eg, reading an 13542 ADC). 13543 </para></listitem> 13544 </varlistentry> 13545 </variablelist> 13546 </refsect1> 13547</refentry> 13548 13549<refentry id="API-snd-soc-component-to-codec"> 13550<refentryinfo> 13551 <title>LINUX</title> 13552 <productname>Kernel Hackers Manual</productname> 13553 <date>July 2017</date> 13554</refentryinfo> 13555<refmeta> 13556 <refentrytitle><phrase>snd_soc_component_to_codec</phrase></refentrytitle> 13557 <manvolnum>9</manvolnum> 13558 <refmiscinfo class="version">4.1.27</refmiscinfo> 13559</refmeta> 13560<refnamediv> 13561 <refname>snd_soc_component_to_codec</refname> 13562 <refpurpose> 13563 Casts a component to the CODEC it is embedded in 13564 </refpurpose> 13565</refnamediv> 13566<refsynopsisdiv> 13567 <title>Synopsis</title> 13568 <funcsynopsis><funcprototype> 13569 <funcdef>struct snd_soc_codec * <function>snd_soc_component_to_codec </function></funcdef> 13570 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 13571 </funcprototype></funcsynopsis> 13572</refsynopsisdiv> 13573<refsect1> 13574 <title>Arguments</title> 13575 <variablelist> 13576 <varlistentry> 13577 <term><parameter>component</parameter></term> 13578 <listitem> 13579 <para> 13580 The component to cast to a CODEC 13581 </para> 13582 </listitem> 13583 </varlistentry> 13584 </variablelist> 13585</refsect1> 13586<refsect1> 13587<title>Description</title> 13588<para> 13589 This function must only be used on components that are known to be CODECs. 13590 Otherwise the behavior is undefined. 13591</para> 13592</refsect1> 13593</refentry> 13594 13595<refentry id="API-snd-soc-component-to-platform"> 13596<refentryinfo> 13597 <title>LINUX</title> 13598 <productname>Kernel Hackers Manual</productname> 13599 <date>July 2017</date> 13600</refentryinfo> 13601<refmeta> 13602 <refentrytitle><phrase>snd_soc_component_to_platform</phrase></refentrytitle> 13603 <manvolnum>9</manvolnum> 13604 <refmiscinfo class="version">4.1.27</refmiscinfo> 13605</refmeta> 13606<refnamediv> 13607 <refname>snd_soc_component_to_platform</refname> 13608 <refpurpose> 13609 Casts a component to the platform it is embedded in 13610 </refpurpose> 13611</refnamediv> 13612<refsynopsisdiv> 13613 <title>Synopsis</title> 13614 <funcsynopsis><funcprototype> 13615 <funcdef>struct snd_soc_platform * <function>snd_soc_component_to_platform </function></funcdef> 13616 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 13617 </funcprototype></funcsynopsis> 13618</refsynopsisdiv> 13619<refsect1> 13620 <title>Arguments</title> 13621 <variablelist> 13622 <varlistentry> 13623 <term><parameter>component</parameter></term> 13624 <listitem> 13625 <para> 13626 The component to cast to a platform 13627 </para> 13628 </listitem> 13629 </varlistentry> 13630 </variablelist> 13631</refsect1> 13632<refsect1> 13633<title>Description</title> 13634<para> 13635 This function must only be used on components that are known to be platforms. 13636 Otherwise the behavior is undefined. 13637</para> 13638</refsect1> 13639</refentry> 13640 13641<refentry id="API-snd-soc-dapm-to-component"> 13642<refentryinfo> 13643 <title>LINUX</title> 13644 <productname>Kernel Hackers Manual</productname> 13645 <date>July 2017</date> 13646</refentryinfo> 13647<refmeta> 13648 <refentrytitle><phrase>snd_soc_dapm_to_component</phrase></refentrytitle> 13649 <manvolnum>9</manvolnum> 13650 <refmiscinfo class="version">4.1.27</refmiscinfo> 13651</refmeta> 13652<refnamediv> 13653 <refname>snd_soc_dapm_to_component</refname> 13654 <refpurpose> 13655 Casts a DAPM context to the component it is embedded in 13656 </refpurpose> 13657</refnamediv> 13658<refsynopsisdiv> 13659 <title>Synopsis</title> 13660 <funcsynopsis><funcprototype> 13661 <funcdef>struct snd_soc_component * <function>snd_soc_dapm_to_component </function></funcdef> 13662 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 13663 </funcprototype></funcsynopsis> 13664</refsynopsisdiv> 13665<refsect1> 13666 <title>Arguments</title> 13667 <variablelist> 13668 <varlistentry> 13669 <term><parameter>dapm</parameter></term> 13670 <listitem> 13671 <para> 13672 The DAPM context to cast to the component 13673 </para> 13674 </listitem> 13675 </varlistentry> 13676 </variablelist> 13677</refsect1> 13678<refsect1> 13679<title>Description</title> 13680<para> 13681 This function must only be used on DAPM contexts that are known to be part of 13682 a component (e.g. in a component driver). Otherwise the behavior is 13683 undefined. 13684</para> 13685</refsect1> 13686</refentry> 13687 13688<refentry id="API-snd-soc-dapm-to-codec"> 13689<refentryinfo> 13690 <title>LINUX</title> 13691 <productname>Kernel Hackers Manual</productname> 13692 <date>July 2017</date> 13693</refentryinfo> 13694<refmeta> 13695 <refentrytitle><phrase>snd_soc_dapm_to_codec</phrase></refentrytitle> 13696 <manvolnum>9</manvolnum> 13697 <refmiscinfo class="version">4.1.27</refmiscinfo> 13698</refmeta> 13699<refnamediv> 13700 <refname>snd_soc_dapm_to_codec</refname> 13701 <refpurpose> 13702 Casts a DAPM context to the CODEC it is embedded in 13703 </refpurpose> 13704</refnamediv> 13705<refsynopsisdiv> 13706 <title>Synopsis</title> 13707 <funcsynopsis><funcprototype> 13708 <funcdef>struct snd_soc_codec * <function>snd_soc_dapm_to_codec </function></funcdef> 13709 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 13710 </funcprototype></funcsynopsis> 13711</refsynopsisdiv> 13712<refsect1> 13713 <title>Arguments</title> 13714 <variablelist> 13715 <varlistentry> 13716 <term><parameter>dapm</parameter></term> 13717 <listitem> 13718 <para> 13719 The DAPM context to cast to the CODEC 13720 </para> 13721 </listitem> 13722 </varlistentry> 13723 </variablelist> 13724</refsect1> 13725<refsect1> 13726<title>Description</title> 13727<para> 13728 This function must only be used on DAPM contexts that are known to be part of 13729 a CODEC (e.g. in a CODEC driver). Otherwise the behavior is undefined. 13730</para> 13731</refsect1> 13732</refentry> 13733 13734<refentry id="API-snd-soc-dapm-to-platform"> 13735<refentryinfo> 13736 <title>LINUX</title> 13737 <productname>Kernel Hackers Manual</productname> 13738 <date>July 2017</date> 13739</refentryinfo> 13740<refmeta> 13741 <refentrytitle><phrase>snd_soc_dapm_to_platform</phrase></refentrytitle> 13742 <manvolnum>9</manvolnum> 13743 <refmiscinfo class="version">4.1.27</refmiscinfo> 13744</refmeta> 13745<refnamediv> 13746 <refname>snd_soc_dapm_to_platform</refname> 13747 <refpurpose> 13748 Casts a DAPM context to the platform it is embedded in 13749 </refpurpose> 13750</refnamediv> 13751<refsynopsisdiv> 13752 <title>Synopsis</title> 13753 <funcsynopsis><funcprototype> 13754 <funcdef>struct snd_soc_platform * <function>snd_soc_dapm_to_platform </function></funcdef> 13755 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 13756 </funcprototype></funcsynopsis> 13757</refsynopsisdiv> 13758<refsect1> 13759 <title>Arguments</title> 13760 <variablelist> 13761 <varlistentry> 13762 <term><parameter>dapm</parameter></term> 13763 <listitem> 13764 <para> 13765 The DAPM context to cast to the platform. 13766 </para> 13767 </listitem> 13768 </varlistentry> 13769 </variablelist> 13770</refsect1> 13771<refsect1> 13772<title>Description</title> 13773<para> 13774 This function must only be used on DAPM contexts that are known to be part of 13775 a platform (e.g. in a platform driver). Otherwise the behavior is undefined. 13776</para> 13777</refsect1> 13778</refentry> 13779 13780<refentry id="API-snd-soc-component-get-dapm"> 13781<refentryinfo> 13782 <title>LINUX</title> 13783 <productname>Kernel Hackers Manual</productname> 13784 <date>July 2017</date> 13785</refentryinfo> 13786<refmeta> 13787 <refentrytitle><phrase>snd_soc_component_get_dapm</phrase></refentrytitle> 13788 <manvolnum>9</manvolnum> 13789 <refmiscinfo class="version">4.1.27</refmiscinfo> 13790</refmeta> 13791<refnamediv> 13792 <refname>snd_soc_component_get_dapm</refname> 13793 <refpurpose> 13794 Returns the DAPM context associated with a component 13795 </refpurpose> 13796</refnamediv> 13797<refsynopsisdiv> 13798 <title>Synopsis</title> 13799 <funcsynopsis><funcprototype> 13800 <funcdef>struct snd_soc_dapm_context * <function>snd_soc_component_get_dapm </function></funcdef> 13801 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 13802 </funcprototype></funcsynopsis> 13803</refsynopsisdiv> 13804<refsect1> 13805 <title>Arguments</title> 13806 <variablelist> 13807 <varlistentry> 13808 <term><parameter>component</parameter></term> 13809 <listitem> 13810 <para> 13811 The component for which to get the DAPM context 13812 </para> 13813 </listitem> 13814 </varlistentry> 13815 </variablelist> 13816</refsect1> 13817</refentry> 13818 13819<refentry id="API-snd-soc-dapm-kcontrol-codec"> 13820<refentryinfo> 13821 <title>LINUX</title> 13822 <productname>Kernel Hackers Manual</productname> 13823 <date>July 2017</date> 13824</refentryinfo> 13825<refmeta> 13826 <refentrytitle><phrase>snd_soc_dapm_kcontrol_codec</phrase></refentrytitle> 13827 <manvolnum>9</manvolnum> 13828 <refmiscinfo class="version">4.1.27</refmiscinfo> 13829</refmeta> 13830<refnamediv> 13831 <refname>snd_soc_dapm_kcontrol_codec</refname> 13832 <refpurpose> 13833 Returns the codec associated to a kcontrol 13834 </refpurpose> 13835</refnamediv> 13836<refsynopsisdiv> 13837 <title>Synopsis</title> 13838 <funcsynopsis><funcprototype> 13839 <funcdef>struct snd_soc_codec * <function>snd_soc_dapm_kcontrol_codec </function></funcdef> 13840 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 13841 </funcprototype></funcsynopsis> 13842</refsynopsisdiv> 13843<refsect1> 13844 <title>Arguments</title> 13845 <variablelist> 13846 <varlistentry> 13847 <term><parameter>kcontrol</parameter></term> 13848 <listitem> 13849 <para> 13850 The kcontrol 13851 </para> 13852 </listitem> 13853 </varlistentry> 13854 </variablelist> 13855</refsect1> 13856<refsect1> 13857<title>Description</title> 13858<para> 13859 This function must only be used on DAPM contexts that are known to be part of 13860 a CODEC (e.g. in a CODEC driver). Otherwise the behavior is undefined. 13861</para> 13862</refsect1> 13863</refentry> 13864 13865<refentry id="API-snd-soc-cache-sync"> 13866<refentryinfo> 13867 <title>LINUX</title> 13868 <productname>Kernel Hackers Manual</productname> 13869 <date>July 2017</date> 13870</refentryinfo> 13871<refmeta> 13872 <refentrytitle><phrase>snd_soc_cache_sync</phrase></refentrytitle> 13873 <manvolnum>9</manvolnum> 13874 <refmiscinfo class="version">4.1.27</refmiscinfo> 13875</refmeta> 13876<refnamediv> 13877 <refname>snd_soc_cache_sync</refname> 13878 <refpurpose> 13879 Sync the register cache with the hardware 13880 </refpurpose> 13881</refnamediv> 13882<refsynopsisdiv> 13883 <title>Synopsis</title> 13884 <funcsynopsis><funcprototype> 13885 <funcdef>int <function>snd_soc_cache_sync </function></funcdef> 13886 <paramdef>struct snd_soc_codec * <parameter>codec</parameter></paramdef> 13887 </funcprototype></funcsynopsis> 13888</refsynopsisdiv> 13889<refsect1> 13890 <title>Arguments</title> 13891 <variablelist> 13892 <varlistentry> 13893 <term><parameter>codec</parameter></term> 13894 <listitem> 13895 <para> 13896 CODEC to sync 13897 </para> 13898 </listitem> 13899 </varlistentry> 13900 </variablelist> 13901</refsect1> 13902<refsect1> 13903<title>Note</title> 13904<para> 13905 This function will call <function>regcache_sync</function> 13906</para> 13907</refsect1> 13908</refentry> 13909 13910<refentry id="API-snd-soc-codec-init-regmap"> 13911<refentryinfo> 13912 <title>LINUX</title> 13913 <productname>Kernel Hackers Manual</productname> 13914 <date>July 2017</date> 13915</refentryinfo> 13916<refmeta> 13917 <refentrytitle><phrase>snd_soc_codec_init_regmap</phrase></refentrytitle> 13918 <manvolnum>9</manvolnum> 13919 <refmiscinfo class="version">4.1.27</refmiscinfo> 13920</refmeta> 13921<refnamediv> 13922 <refname>snd_soc_codec_init_regmap</refname> 13923 <refpurpose> 13924 Initialize regmap instance for the CODEC 13925 </refpurpose> 13926</refnamediv> 13927<refsynopsisdiv> 13928 <title>Synopsis</title> 13929 <funcsynopsis><funcprototype> 13930 <funcdef>void <function>snd_soc_codec_init_regmap </function></funcdef> 13931 <paramdef>struct snd_soc_codec * <parameter>codec</parameter></paramdef> 13932 <paramdef>struct regmap * <parameter>regmap</parameter></paramdef> 13933 </funcprototype></funcsynopsis> 13934</refsynopsisdiv> 13935<refsect1> 13936 <title>Arguments</title> 13937 <variablelist> 13938 <varlistentry> 13939 <term><parameter>codec</parameter></term> 13940 <listitem> 13941 <para> 13942 The CODEC for which to initialize the regmap instance 13943 </para> 13944 </listitem> 13945 </varlistentry> 13946 <varlistentry> 13947 <term><parameter>regmap</parameter></term> 13948 <listitem> 13949 <para> 13950 The regmap instance that should be used by the CODEC 13951 </para> 13952 </listitem> 13953 </varlistentry> 13954 </variablelist> 13955</refsect1> 13956<refsect1> 13957<title>Description</title> 13958<para> 13959 This function allows deferred assignment of the regmap instance that is 13960 associated with the CODEC. Only use this if the regmap instance is not yet 13961 ready when the CODEC is registered. The function must also be called before 13962 the first IO attempt of the CODEC. 13963</para> 13964</refsect1> 13965</refentry> 13966 13967<refentry id="API-snd-soc-codec-exit-regmap"> 13968<refentryinfo> 13969 <title>LINUX</title> 13970 <productname>Kernel Hackers Manual</productname> 13971 <date>July 2017</date> 13972</refentryinfo> 13973<refmeta> 13974 <refentrytitle><phrase>snd_soc_codec_exit_regmap</phrase></refentrytitle> 13975 <manvolnum>9</manvolnum> 13976 <refmiscinfo class="version">4.1.27</refmiscinfo> 13977</refmeta> 13978<refnamediv> 13979 <refname>snd_soc_codec_exit_regmap</refname> 13980 <refpurpose> 13981 De-initialize regmap instance for the CODEC 13982 </refpurpose> 13983</refnamediv> 13984<refsynopsisdiv> 13985 <title>Synopsis</title> 13986 <funcsynopsis><funcprototype> 13987 <funcdef>void <function>snd_soc_codec_exit_regmap </function></funcdef> 13988 <paramdef>struct snd_soc_codec * <parameter>codec</parameter></paramdef> 13989 </funcprototype></funcsynopsis> 13990</refsynopsisdiv> 13991<refsect1> 13992 <title>Arguments</title> 13993 <variablelist> 13994 <varlistentry> 13995 <term><parameter>codec</parameter></term> 13996 <listitem> 13997 <para> 13998 The CODEC for which to de-initialize the regmap instance 13999 </para> 14000 </listitem> 14001 </varlistentry> 14002 </variablelist> 14003</refsect1> 14004<refsect1> 14005<title>Description</title> 14006<para> 14007 Calls <function>regmap_exit</function> on the regmap instance associated to the CODEC and 14008 removes the regmap instance from the CODEC. 14009 </para><para> 14010 14011 This function should only be used if <function>snd_soc_codec_init_regmap</function> was used to 14012 initialize the regmap instance. 14013</para> 14014</refsect1> 14015</refentry> 14016 14017<refentry id="API-snd-soc-kcontrol-component"> 14018<refentryinfo> 14019 <title>LINUX</title> 14020 <productname>Kernel Hackers Manual</productname> 14021 <date>July 2017</date> 14022</refentryinfo> 14023<refmeta> 14024 <refentrytitle><phrase>snd_soc_kcontrol_component</phrase></refentrytitle> 14025 <manvolnum>9</manvolnum> 14026 <refmiscinfo class="version">4.1.27</refmiscinfo> 14027</refmeta> 14028<refnamediv> 14029 <refname>snd_soc_kcontrol_component</refname> 14030 <refpurpose> 14031 Returns the component that registered the control 14032 </refpurpose> 14033</refnamediv> 14034<refsynopsisdiv> 14035 <title>Synopsis</title> 14036 <funcsynopsis><funcprototype> 14037 <funcdef>struct snd_soc_component * <function>snd_soc_kcontrol_component </function></funcdef> 14038 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 14039 </funcprototype></funcsynopsis> 14040</refsynopsisdiv> 14041<refsect1> 14042 <title>Arguments</title> 14043 <variablelist> 14044 <varlistentry> 14045 <term><parameter>kcontrol</parameter></term> 14046 <listitem> 14047 <para> 14048 The control for which to get the component 14049 </para> 14050 </listitem> 14051 </varlistentry> 14052 </variablelist> 14053</refsect1> 14054<refsect1> 14055<title>Note</title> 14056<para> 14057 This function will work correctly if the control has been registered 14058 for a component. Either with <function>snd_soc_add_codec_controls</function> or 14059 <function>snd_soc_add_platform_controls</function> or via table based setup for either a 14060 CODEC, a platform or component driver. Otherwise the behavior is undefined. 14061</para> 14062</refsect1> 14063</refentry> 14064 14065<refentry id="API-snd-soc-kcontrol-codec"> 14066<refentryinfo> 14067 <title>LINUX</title> 14068 <productname>Kernel Hackers Manual</productname> 14069 <date>July 2017</date> 14070</refentryinfo> 14071<refmeta> 14072 <refentrytitle><phrase>snd_soc_kcontrol_codec</phrase></refentrytitle> 14073 <manvolnum>9</manvolnum> 14074 <refmiscinfo class="version">4.1.27</refmiscinfo> 14075</refmeta> 14076<refnamediv> 14077 <refname>snd_soc_kcontrol_codec</refname> 14078 <refpurpose> 14079 Returns the CODEC that registered the control 14080 </refpurpose> 14081</refnamediv> 14082<refsynopsisdiv> 14083 <title>Synopsis</title> 14084 <funcsynopsis><funcprototype> 14085 <funcdef>struct snd_soc_codec * <function>snd_soc_kcontrol_codec </function></funcdef> 14086 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 14087 </funcprototype></funcsynopsis> 14088</refsynopsisdiv> 14089<refsect1> 14090 <title>Arguments</title> 14091 <variablelist> 14092 <varlistentry> 14093 <term><parameter>kcontrol</parameter></term> 14094 <listitem> 14095 <para> 14096 The control for which to get the CODEC 14097 </para> 14098 </listitem> 14099 </varlistentry> 14100 </variablelist> 14101</refsect1> 14102<refsect1> 14103<title>Note</title> 14104<para> 14105 This function will only work correctly if the control has been 14106 registered with <function>snd_soc_add_codec_controls</function> or via table based setup of 14107 snd_soc_codec_driver. Otherwise the behavior is undefined. 14108</para> 14109</refsect1> 14110</refentry> 14111 14112<refentry id="API-snd-soc-kcontrol-platform"> 14113<refentryinfo> 14114 <title>LINUX</title> 14115 <productname>Kernel Hackers Manual</productname> 14116 <date>July 2017</date> 14117</refentryinfo> 14118<refmeta> 14119 <refentrytitle><phrase>snd_soc_kcontrol_platform</phrase></refentrytitle> 14120 <manvolnum>9</manvolnum> 14121 <refmiscinfo class="version">4.1.27</refmiscinfo> 14122</refmeta> 14123<refnamediv> 14124 <refname>snd_soc_kcontrol_platform</refname> 14125 <refpurpose> 14126 Returns the platform that registered the control 14127 </refpurpose> 14128</refnamediv> 14129<refsynopsisdiv> 14130 <title>Synopsis</title> 14131 <funcsynopsis><funcprototype> 14132 <funcdef>struct snd_soc_platform * <function>snd_soc_kcontrol_platform </function></funcdef> 14133 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 14134 </funcprototype></funcsynopsis> 14135</refsynopsisdiv> 14136<refsect1> 14137 <title>Arguments</title> 14138 <variablelist> 14139 <varlistentry> 14140 <term><parameter>kcontrol</parameter></term> 14141 <listitem> 14142 <para> 14143 The control for which to get the platform 14144 </para> 14145 </listitem> 14146 </varlistentry> 14147 </variablelist> 14148</refsect1> 14149<refsect1> 14150<title>Note</title> 14151<para> 14152 This function will only work correctly if the control has been 14153 registered with <function>snd_soc_add_platform_controls</function> or via table based setup of 14154 a snd_soc_platform_driver. Otherwise the behavior is undefined. 14155</para> 14156</refsect1> 14157</refentry> 14158 14159<!-- sound/soc/soc-core.c --> 14160<refentry id="API-snd-soc-runtime-set-dai-fmt"> 14161<refentryinfo> 14162 <title>LINUX</title> 14163 <productname>Kernel Hackers Manual</productname> 14164 <date>July 2017</date> 14165</refentryinfo> 14166<refmeta> 14167 <refentrytitle><phrase>snd_soc_runtime_set_dai_fmt</phrase></refentrytitle> 14168 <manvolnum>9</manvolnum> 14169 <refmiscinfo class="version">4.1.27</refmiscinfo> 14170</refmeta> 14171<refnamediv> 14172 <refname>snd_soc_runtime_set_dai_fmt</refname> 14173 <refpurpose> 14174 Change DAI link format for a ASoC runtime 14175 </refpurpose> 14176</refnamediv> 14177<refsynopsisdiv> 14178 <title>Synopsis</title> 14179 <funcsynopsis><funcprototype> 14180 <funcdef>int <function>snd_soc_runtime_set_dai_fmt </function></funcdef> 14181 <paramdef>struct snd_soc_pcm_runtime * <parameter>rtd</parameter></paramdef> 14182 <paramdef>unsigned int <parameter>dai_fmt</parameter></paramdef> 14183 </funcprototype></funcsynopsis> 14184</refsynopsisdiv> 14185<refsect1> 14186 <title>Arguments</title> 14187 <variablelist> 14188 <varlistentry> 14189 <term><parameter>rtd</parameter></term> 14190 <listitem> 14191 <para> 14192 The runtime for which the DAI link format should be changed 14193 </para> 14194 </listitem> 14195 </varlistentry> 14196 <varlistentry> 14197 <term><parameter>dai_fmt</parameter></term> 14198 <listitem> 14199 <para> 14200 The new DAI link format 14201 </para> 14202 </listitem> 14203 </varlistentry> 14204 </variablelist> 14205</refsect1> 14206<refsect1> 14207<title>Description</title> 14208<para> 14209 This function updates the DAI link format for all DAIs connected to the DAI 14210 link for the specified runtime. 14211</para> 14212</refsect1> 14213<refsect1> 14214<title>Note</title> 14215<para> 14216 For setups with a static format set the dai_fmt field in the 14217 corresponding snd_dai_link struct instead of using this function. 14218 </para><para> 14219 14220 Returns 0 on success, otherwise a negative error code. 14221</para> 14222</refsect1> 14223</refentry> 14224 14225<refentry id="API-snd-soc-cnew"> 14226<refentryinfo> 14227 <title>LINUX</title> 14228 <productname>Kernel Hackers Manual</productname> 14229 <date>July 2017</date> 14230</refentryinfo> 14231<refmeta> 14232 <refentrytitle><phrase>snd_soc_cnew</phrase></refentrytitle> 14233 <manvolnum>9</manvolnum> 14234 <refmiscinfo class="version">4.1.27</refmiscinfo> 14235</refmeta> 14236<refnamediv> 14237 <refname>snd_soc_cnew</refname> 14238 <refpurpose> 14239 create new control 14240 </refpurpose> 14241</refnamediv> 14242<refsynopsisdiv> 14243 <title>Synopsis</title> 14244 <funcsynopsis><funcprototype> 14245 <funcdef>struct snd_kcontrol * <function>snd_soc_cnew </function></funcdef> 14246 <paramdef>const struct snd_kcontrol_new * <parameter>_template</parameter></paramdef> 14247 <paramdef>void * <parameter>data</parameter></paramdef> 14248 <paramdef>const char * <parameter>long_name</parameter></paramdef> 14249 <paramdef>const char * <parameter>prefix</parameter></paramdef> 14250 </funcprototype></funcsynopsis> 14251</refsynopsisdiv> 14252<refsect1> 14253 <title>Arguments</title> 14254 <variablelist> 14255 <varlistentry> 14256 <term><parameter>_template</parameter></term> 14257 <listitem> 14258 <para> 14259 control template 14260 </para> 14261 </listitem> 14262 </varlistentry> 14263 <varlistentry> 14264 <term><parameter>data</parameter></term> 14265 <listitem> 14266 <para> 14267 control private data 14268 </para> 14269 </listitem> 14270 </varlistentry> 14271 <varlistentry> 14272 <term><parameter>long_name</parameter></term> 14273 <listitem> 14274 <para> 14275 control long name 14276 </para> 14277 </listitem> 14278 </varlistentry> 14279 <varlistentry> 14280 <term><parameter>prefix</parameter></term> 14281 <listitem> 14282 <para> 14283 control name prefix 14284 </para> 14285 </listitem> 14286 </varlistentry> 14287 </variablelist> 14288</refsect1> 14289<refsect1> 14290<title>Description</title> 14291<para> 14292 Create a new mixer control from a template control. 14293 </para><para> 14294 14295 Returns 0 for success, else error. 14296</para> 14297</refsect1> 14298</refentry> 14299 14300<refentry id="API-snd-soc-add-component-controls"> 14301<refentryinfo> 14302 <title>LINUX</title> 14303 <productname>Kernel Hackers Manual</productname> 14304 <date>July 2017</date> 14305</refentryinfo> 14306<refmeta> 14307 <refentrytitle><phrase>snd_soc_add_component_controls</phrase></refentrytitle> 14308 <manvolnum>9</manvolnum> 14309 <refmiscinfo class="version">4.1.27</refmiscinfo> 14310</refmeta> 14311<refnamediv> 14312 <refname>snd_soc_add_component_controls</refname> 14313 <refpurpose> 14314 Add an array of controls to a component. 14315 </refpurpose> 14316</refnamediv> 14317<refsynopsisdiv> 14318 <title>Synopsis</title> 14319 <funcsynopsis><funcprototype> 14320 <funcdef>int <function>snd_soc_add_component_controls </function></funcdef> 14321 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 14322 <paramdef>const struct snd_kcontrol_new * <parameter>controls</parameter></paramdef> 14323 <paramdef>unsigned int <parameter>num_controls</parameter></paramdef> 14324 </funcprototype></funcsynopsis> 14325</refsynopsisdiv> 14326<refsect1> 14327 <title>Arguments</title> 14328 <variablelist> 14329 <varlistentry> 14330 <term><parameter>component</parameter></term> 14331 <listitem> 14332 <para> 14333 Component to add controls to 14334 </para> 14335 </listitem> 14336 </varlistentry> 14337 <varlistentry> 14338 <term><parameter>controls</parameter></term> 14339 <listitem> 14340 <para> 14341 Array of controls to add 14342 </para> 14343 </listitem> 14344 </varlistentry> 14345 <varlistentry> 14346 <term><parameter>num_controls</parameter></term> 14347 <listitem> 14348 <para> 14349 Number of elements in the array 14350 </para> 14351 </listitem> 14352 </varlistentry> 14353 </variablelist> 14354</refsect1> 14355<refsect1> 14356<title>Return</title> 14357<para> 14358 0 for success, else error. 14359</para> 14360</refsect1> 14361</refentry> 14362 14363<refentry id="API-snd-soc-add-codec-controls"> 14364<refentryinfo> 14365 <title>LINUX</title> 14366 <productname>Kernel Hackers Manual</productname> 14367 <date>July 2017</date> 14368</refentryinfo> 14369<refmeta> 14370 <refentrytitle><phrase>snd_soc_add_codec_controls</phrase></refentrytitle> 14371 <manvolnum>9</manvolnum> 14372 <refmiscinfo class="version">4.1.27</refmiscinfo> 14373</refmeta> 14374<refnamediv> 14375 <refname>snd_soc_add_codec_controls</refname> 14376 <refpurpose> 14377 add an array of controls to a codec. Convenience function to add a list of controls. Many codecs were duplicating this code. 14378 </refpurpose> 14379</refnamediv> 14380<refsynopsisdiv> 14381 <title>Synopsis</title> 14382 <funcsynopsis><funcprototype> 14383 <funcdef>int <function>snd_soc_add_codec_controls </function></funcdef> 14384 <paramdef>struct snd_soc_codec * <parameter>codec</parameter></paramdef> 14385 <paramdef>const struct snd_kcontrol_new * <parameter>controls</parameter></paramdef> 14386 <paramdef>unsigned int <parameter>num_controls</parameter></paramdef> 14387 </funcprototype></funcsynopsis> 14388</refsynopsisdiv> 14389<refsect1> 14390 <title>Arguments</title> 14391 <variablelist> 14392 <varlistentry> 14393 <term><parameter>codec</parameter></term> 14394 <listitem> 14395 <para> 14396 codec to add controls to 14397 </para> 14398 </listitem> 14399 </varlistentry> 14400 <varlistentry> 14401 <term><parameter>controls</parameter></term> 14402 <listitem> 14403 <para> 14404 array of controls to add 14405 </para> 14406 </listitem> 14407 </varlistentry> 14408 <varlistentry> 14409 <term><parameter>num_controls</parameter></term> 14410 <listitem> 14411 <para> 14412 number of elements in the array 14413 </para> 14414 </listitem> 14415 </varlistentry> 14416 </variablelist> 14417</refsect1> 14418<refsect1> 14419<title>Description</title> 14420<para> 14421 Return 0 for success, else error. 14422</para> 14423</refsect1> 14424</refentry> 14425 14426<refentry id="API-snd-soc-add-platform-controls"> 14427<refentryinfo> 14428 <title>LINUX</title> 14429 <productname>Kernel Hackers Manual</productname> 14430 <date>July 2017</date> 14431</refentryinfo> 14432<refmeta> 14433 <refentrytitle><phrase>snd_soc_add_platform_controls</phrase></refentrytitle> 14434 <manvolnum>9</manvolnum> 14435 <refmiscinfo class="version">4.1.27</refmiscinfo> 14436</refmeta> 14437<refnamediv> 14438 <refname>snd_soc_add_platform_controls</refname> 14439 <refpurpose> 14440 add an array of controls to a platform. Convenience function to add a list of controls. 14441 </refpurpose> 14442</refnamediv> 14443<refsynopsisdiv> 14444 <title>Synopsis</title> 14445 <funcsynopsis><funcprototype> 14446 <funcdef>int <function>snd_soc_add_platform_controls </function></funcdef> 14447 <paramdef>struct snd_soc_platform * <parameter>platform</parameter></paramdef> 14448 <paramdef>const struct snd_kcontrol_new * <parameter>controls</parameter></paramdef> 14449 <paramdef>unsigned int <parameter>num_controls</parameter></paramdef> 14450 </funcprototype></funcsynopsis> 14451</refsynopsisdiv> 14452<refsect1> 14453 <title>Arguments</title> 14454 <variablelist> 14455 <varlistentry> 14456 <term><parameter>platform</parameter></term> 14457 <listitem> 14458 <para> 14459 platform to add controls to 14460 </para> 14461 </listitem> 14462 </varlistentry> 14463 <varlistentry> 14464 <term><parameter>controls</parameter></term> 14465 <listitem> 14466 <para> 14467 array of controls to add 14468 </para> 14469 </listitem> 14470 </varlistentry> 14471 <varlistentry> 14472 <term><parameter>num_controls</parameter></term> 14473 <listitem> 14474 <para> 14475 number of elements in the array 14476 </para> 14477 </listitem> 14478 </varlistentry> 14479 </variablelist> 14480</refsect1> 14481<refsect1> 14482<title>Description</title> 14483<para> 14484 Return 0 for success, else error. 14485</para> 14486</refsect1> 14487</refentry> 14488 14489<refentry id="API-snd-soc-add-card-controls"> 14490<refentryinfo> 14491 <title>LINUX</title> 14492 <productname>Kernel Hackers Manual</productname> 14493 <date>July 2017</date> 14494</refentryinfo> 14495<refmeta> 14496 <refentrytitle><phrase>snd_soc_add_card_controls</phrase></refentrytitle> 14497 <manvolnum>9</manvolnum> 14498 <refmiscinfo class="version">4.1.27</refmiscinfo> 14499</refmeta> 14500<refnamediv> 14501 <refname>snd_soc_add_card_controls</refname> 14502 <refpurpose> 14503 add an array of controls to a SoC card. Convenience function to add a list of controls. 14504 </refpurpose> 14505</refnamediv> 14506<refsynopsisdiv> 14507 <title>Synopsis</title> 14508 <funcsynopsis><funcprototype> 14509 <funcdef>int <function>snd_soc_add_card_controls </function></funcdef> 14510 <paramdef>struct snd_soc_card * <parameter>soc_card</parameter></paramdef> 14511 <paramdef>const struct snd_kcontrol_new * <parameter>controls</parameter></paramdef> 14512 <paramdef>int <parameter>num_controls</parameter></paramdef> 14513 </funcprototype></funcsynopsis> 14514</refsynopsisdiv> 14515<refsect1> 14516 <title>Arguments</title> 14517 <variablelist> 14518 <varlistentry> 14519 <term><parameter>soc_card</parameter></term> 14520 <listitem> 14521 <para> 14522 SoC card to add controls to 14523 </para> 14524 </listitem> 14525 </varlistentry> 14526 <varlistentry> 14527 <term><parameter>controls</parameter></term> 14528 <listitem> 14529 <para> 14530 array of controls to add 14531 </para> 14532 </listitem> 14533 </varlistentry> 14534 <varlistentry> 14535 <term><parameter>num_controls</parameter></term> 14536 <listitem> 14537 <para> 14538 number of elements in the array 14539 </para> 14540 </listitem> 14541 </varlistentry> 14542 </variablelist> 14543</refsect1> 14544<refsect1> 14545<title>Description</title> 14546<para> 14547 Return 0 for success, else error. 14548</para> 14549</refsect1> 14550</refentry> 14551 14552<refentry id="API-snd-soc-add-dai-controls"> 14553<refentryinfo> 14554 <title>LINUX</title> 14555 <productname>Kernel Hackers Manual</productname> 14556 <date>July 2017</date> 14557</refentryinfo> 14558<refmeta> 14559 <refentrytitle><phrase>snd_soc_add_dai_controls</phrase></refentrytitle> 14560 <manvolnum>9</manvolnum> 14561 <refmiscinfo class="version">4.1.27</refmiscinfo> 14562</refmeta> 14563<refnamediv> 14564 <refname>snd_soc_add_dai_controls</refname> 14565 <refpurpose> 14566 add an array of controls to a DAI. Convienience function to add a list of controls. 14567 </refpurpose> 14568</refnamediv> 14569<refsynopsisdiv> 14570 <title>Synopsis</title> 14571 <funcsynopsis><funcprototype> 14572 <funcdef>int <function>snd_soc_add_dai_controls </function></funcdef> 14573 <paramdef>struct snd_soc_dai * <parameter>dai</parameter></paramdef> 14574 <paramdef>const struct snd_kcontrol_new * <parameter>controls</parameter></paramdef> 14575 <paramdef>int <parameter>num_controls</parameter></paramdef> 14576 </funcprototype></funcsynopsis> 14577</refsynopsisdiv> 14578<refsect1> 14579 <title>Arguments</title> 14580 <variablelist> 14581 <varlistentry> 14582 <term><parameter>dai</parameter></term> 14583 <listitem> 14584 <para> 14585 DAI to add controls to 14586 </para> 14587 </listitem> 14588 </varlistentry> 14589 <varlistentry> 14590 <term><parameter>controls</parameter></term> 14591 <listitem> 14592 <para> 14593 array of controls to add 14594 </para> 14595 </listitem> 14596 </varlistentry> 14597 <varlistentry> 14598 <term><parameter>num_controls</parameter></term> 14599 <listitem> 14600 <para> 14601 number of elements in the array 14602 </para> 14603 </listitem> 14604 </varlistentry> 14605 </variablelist> 14606</refsect1> 14607<refsect1> 14608<title>Description</title> 14609<para> 14610 Return 0 for success, else error. 14611</para> 14612</refsect1> 14613</refentry> 14614 14615<refentry id="API-snd-soc-dai-set-sysclk"> 14616<refentryinfo> 14617 <title>LINUX</title> 14618 <productname>Kernel Hackers Manual</productname> 14619 <date>July 2017</date> 14620</refentryinfo> 14621<refmeta> 14622 <refentrytitle><phrase>snd_soc_dai_set_sysclk</phrase></refentrytitle> 14623 <manvolnum>9</manvolnum> 14624 <refmiscinfo class="version">4.1.27</refmiscinfo> 14625</refmeta> 14626<refnamediv> 14627 <refname>snd_soc_dai_set_sysclk</refname> 14628 <refpurpose> 14629 configure DAI system or master clock. 14630 </refpurpose> 14631</refnamediv> 14632<refsynopsisdiv> 14633 <title>Synopsis</title> 14634 <funcsynopsis><funcprototype> 14635 <funcdef>int <function>snd_soc_dai_set_sysclk </function></funcdef> 14636 <paramdef>struct snd_soc_dai * <parameter>dai</parameter></paramdef> 14637 <paramdef>int <parameter>clk_id</parameter></paramdef> 14638 <paramdef>unsigned int <parameter>freq</parameter></paramdef> 14639 <paramdef>int <parameter>dir</parameter></paramdef> 14640 </funcprototype></funcsynopsis> 14641</refsynopsisdiv> 14642<refsect1> 14643 <title>Arguments</title> 14644 <variablelist> 14645 <varlistentry> 14646 <term><parameter>dai</parameter></term> 14647 <listitem> 14648 <para> 14649 DAI 14650 </para> 14651 </listitem> 14652 </varlistentry> 14653 <varlistentry> 14654 <term><parameter>clk_id</parameter></term> 14655 <listitem> 14656 <para> 14657 DAI specific clock ID 14658 </para> 14659 </listitem> 14660 </varlistentry> 14661 <varlistentry> 14662 <term><parameter>freq</parameter></term> 14663 <listitem> 14664 <para> 14665 new clock frequency in Hz 14666 </para> 14667 </listitem> 14668 </varlistentry> 14669 <varlistentry> 14670 <term><parameter>dir</parameter></term> 14671 <listitem> 14672 <para> 14673 new clock direction - input/output. 14674 </para> 14675 </listitem> 14676 </varlistentry> 14677 </variablelist> 14678</refsect1> 14679<refsect1> 14680<title>Description</title> 14681<para> 14682 Configures the DAI master (MCLK) or system (SYSCLK) clocking. 14683</para> 14684</refsect1> 14685</refentry> 14686 14687<refentry id="API-snd-soc-codec-set-sysclk"> 14688<refentryinfo> 14689 <title>LINUX</title> 14690 <productname>Kernel Hackers Manual</productname> 14691 <date>July 2017</date> 14692</refentryinfo> 14693<refmeta> 14694 <refentrytitle><phrase>snd_soc_codec_set_sysclk</phrase></refentrytitle> 14695 <manvolnum>9</manvolnum> 14696 <refmiscinfo class="version">4.1.27</refmiscinfo> 14697</refmeta> 14698<refnamediv> 14699 <refname>snd_soc_codec_set_sysclk</refname> 14700 <refpurpose> 14701 configure CODEC system or master clock. 14702 </refpurpose> 14703</refnamediv> 14704<refsynopsisdiv> 14705 <title>Synopsis</title> 14706 <funcsynopsis><funcprototype> 14707 <funcdef>int <function>snd_soc_codec_set_sysclk </function></funcdef> 14708 <paramdef>struct snd_soc_codec * <parameter>codec</parameter></paramdef> 14709 <paramdef>int <parameter>clk_id</parameter></paramdef> 14710 <paramdef>int <parameter>source</parameter></paramdef> 14711 <paramdef>unsigned int <parameter>freq</parameter></paramdef> 14712 <paramdef>int <parameter>dir</parameter></paramdef> 14713 </funcprototype></funcsynopsis> 14714</refsynopsisdiv> 14715<refsect1> 14716 <title>Arguments</title> 14717 <variablelist> 14718 <varlistentry> 14719 <term><parameter>codec</parameter></term> 14720 <listitem> 14721 <para> 14722 CODEC 14723 </para> 14724 </listitem> 14725 </varlistentry> 14726 <varlistentry> 14727 <term><parameter>clk_id</parameter></term> 14728 <listitem> 14729 <para> 14730 DAI specific clock ID 14731 </para> 14732 </listitem> 14733 </varlistentry> 14734 <varlistentry> 14735 <term><parameter>source</parameter></term> 14736 <listitem> 14737 <para> 14738 Source for the clock 14739 </para> 14740 </listitem> 14741 </varlistentry> 14742 <varlistentry> 14743 <term><parameter>freq</parameter></term> 14744 <listitem> 14745 <para> 14746 new clock frequency in Hz 14747 </para> 14748 </listitem> 14749 </varlistentry> 14750 <varlistentry> 14751 <term><parameter>dir</parameter></term> 14752 <listitem> 14753 <para> 14754 new clock direction - input/output. 14755 </para> 14756 </listitem> 14757 </varlistentry> 14758 </variablelist> 14759</refsect1> 14760<refsect1> 14761<title>Description</title> 14762<para> 14763 Configures the CODEC master (MCLK) or system (SYSCLK) clocking. 14764</para> 14765</refsect1> 14766</refentry> 14767 14768<refentry id="API-snd-soc-dai-set-clkdiv"> 14769<refentryinfo> 14770 <title>LINUX</title> 14771 <productname>Kernel Hackers Manual</productname> 14772 <date>July 2017</date> 14773</refentryinfo> 14774<refmeta> 14775 <refentrytitle><phrase>snd_soc_dai_set_clkdiv</phrase></refentrytitle> 14776 <manvolnum>9</manvolnum> 14777 <refmiscinfo class="version">4.1.27</refmiscinfo> 14778</refmeta> 14779<refnamediv> 14780 <refname>snd_soc_dai_set_clkdiv</refname> 14781 <refpurpose> 14782 configure DAI clock dividers. 14783 </refpurpose> 14784</refnamediv> 14785<refsynopsisdiv> 14786 <title>Synopsis</title> 14787 <funcsynopsis><funcprototype> 14788 <funcdef>int <function>snd_soc_dai_set_clkdiv </function></funcdef> 14789 <paramdef>struct snd_soc_dai * <parameter>dai</parameter></paramdef> 14790 <paramdef>int <parameter>div_id</parameter></paramdef> 14791 <paramdef>int <parameter>div</parameter></paramdef> 14792 </funcprototype></funcsynopsis> 14793</refsynopsisdiv> 14794<refsect1> 14795 <title>Arguments</title> 14796 <variablelist> 14797 <varlistentry> 14798 <term><parameter>dai</parameter></term> 14799 <listitem> 14800 <para> 14801 DAI 14802 </para> 14803 </listitem> 14804 </varlistentry> 14805 <varlistentry> 14806 <term><parameter>div_id</parameter></term> 14807 <listitem> 14808 <para> 14809 DAI specific clock divider ID 14810 </para> 14811 </listitem> 14812 </varlistentry> 14813 <varlistentry> 14814 <term><parameter>div</parameter></term> 14815 <listitem> 14816 <para> 14817 new clock divisor. 14818 </para> 14819 </listitem> 14820 </varlistentry> 14821 </variablelist> 14822</refsect1> 14823<refsect1> 14824<title>Description</title> 14825<para> 14826 Configures the clock dividers. This is used to derive the best DAI bit and 14827 frame clocks from the system or master clock. It's best to set the DAI bit 14828 and frame clocks as low as possible to save system power. 14829</para> 14830</refsect1> 14831</refentry> 14832 14833<refentry id="API-snd-soc-dai-set-pll"> 14834<refentryinfo> 14835 <title>LINUX</title> 14836 <productname>Kernel Hackers Manual</productname> 14837 <date>July 2017</date> 14838</refentryinfo> 14839<refmeta> 14840 <refentrytitle><phrase>snd_soc_dai_set_pll</phrase></refentrytitle> 14841 <manvolnum>9</manvolnum> 14842 <refmiscinfo class="version">4.1.27</refmiscinfo> 14843</refmeta> 14844<refnamediv> 14845 <refname>snd_soc_dai_set_pll</refname> 14846 <refpurpose> 14847 configure DAI PLL. 14848 </refpurpose> 14849</refnamediv> 14850<refsynopsisdiv> 14851 <title>Synopsis</title> 14852 <funcsynopsis><funcprototype> 14853 <funcdef>int <function>snd_soc_dai_set_pll </function></funcdef> 14854 <paramdef>struct snd_soc_dai * <parameter>dai</parameter></paramdef> 14855 <paramdef>int <parameter>pll_id</parameter></paramdef> 14856 <paramdef>int <parameter>source</parameter></paramdef> 14857 <paramdef>unsigned int <parameter>freq_in</parameter></paramdef> 14858 <paramdef>unsigned int <parameter>freq_out</parameter></paramdef> 14859 </funcprototype></funcsynopsis> 14860</refsynopsisdiv> 14861<refsect1> 14862 <title>Arguments</title> 14863 <variablelist> 14864 <varlistentry> 14865 <term><parameter>dai</parameter></term> 14866 <listitem> 14867 <para> 14868 DAI 14869 </para> 14870 </listitem> 14871 </varlistentry> 14872 <varlistentry> 14873 <term><parameter>pll_id</parameter></term> 14874 <listitem> 14875 <para> 14876 DAI specific PLL ID 14877 </para> 14878 </listitem> 14879 </varlistentry> 14880 <varlistentry> 14881 <term><parameter>source</parameter></term> 14882 <listitem> 14883 <para> 14884 DAI specific source for the PLL 14885 </para> 14886 </listitem> 14887 </varlistentry> 14888 <varlistentry> 14889 <term><parameter>freq_in</parameter></term> 14890 <listitem> 14891 <para> 14892 PLL input clock frequency in Hz 14893 </para> 14894 </listitem> 14895 </varlistentry> 14896 <varlistentry> 14897 <term><parameter>freq_out</parameter></term> 14898 <listitem> 14899 <para> 14900 requested PLL output clock frequency in Hz 14901 </para> 14902 </listitem> 14903 </varlistentry> 14904 </variablelist> 14905</refsect1> 14906<refsect1> 14907<title>Description</title> 14908<para> 14909 Configures and enables PLL to generate output clock based on input clock. 14910</para> 14911</refsect1> 14912</refentry> 14913 14914<refentry id="API-snd-soc-dai-set-bclk-ratio"> 14915<refentryinfo> 14916 <title>LINUX</title> 14917 <productname>Kernel Hackers Manual</productname> 14918 <date>July 2017</date> 14919</refentryinfo> 14920<refmeta> 14921 <refentrytitle><phrase>snd_soc_dai_set_bclk_ratio</phrase></refentrytitle> 14922 <manvolnum>9</manvolnum> 14923 <refmiscinfo class="version">4.1.27</refmiscinfo> 14924</refmeta> 14925<refnamediv> 14926 <refname>snd_soc_dai_set_bclk_ratio</refname> 14927 <refpurpose> 14928 configure BCLK to sample rate ratio. 14929 </refpurpose> 14930</refnamediv> 14931<refsynopsisdiv> 14932 <title>Synopsis</title> 14933 <funcsynopsis><funcprototype> 14934 <funcdef>int <function>snd_soc_dai_set_bclk_ratio </function></funcdef> 14935 <paramdef>struct snd_soc_dai * <parameter>dai</parameter></paramdef> 14936 <paramdef>unsigned int <parameter>ratio</parameter></paramdef> 14937 </funcprototype></funcsynopsis> 14938</refsynopsisdiv> 14939<refsect1> 14940 <title>Arguments</title> 14941 <variablelist> 14942 <varlistentry> 14943 <term><parameter>dai</parameter></term> 14944 <listitem> 14945 <para> 14946 DAI 14947 <parameter>ratio</parameter> Ratio of BCLK to Sample rate. 14948 </para> 14949 </listitem> 14950 </varlistentry> 14951 <varlistentry> 14952 <term><parameter>ratio</parameter></term> 14953 <listitem> 14954 <para> 14955 -- undescribed -- 14956 </para> 14957 </listitem> 14958 </varlistentry> 14959 </variablelist> 14960</refsect1> 14961<refsect1> 14962<title>Description</title> 14963<para> 14964 Configures the DAI for a preset BCLK to sample rate ratio. 14965</para> 14966</refsect1> 14967</refentry> 14968 14969<refentry id="API-snd-soc-dai-set-fmt"> 14970<refentryinfo> 14971 <title>LINUX</title> 14972 <productname>Kernel Hackers Manual</productname> 14973 <date>July 2017</date> 14974</refentryinfo> 14975<refmeta> 14976 <refentrytitle><phrase>snd_soc_dai_set_fmt</phrase></refentrytitle> 14977 <manvolnum>9</manvolnum> 14978 <refmiscinfo class="version">4.1.27</refmiscinfo> 14979</refmeta> 14980<refnamediv> 14981 <refname>snd_soc_dai_set_fmt</refname> 14982 <refpurpose> 14983 configure DAI hardware audio format. 14984 </refpurpose> 14985</refnamediv> 14986<refsynopsisdiv> 14987 <title>Synopsis</title> 14988 <funcsynopsis><funcprototype> 14989 <funcdef>int <function>snd_soc_dai_set_fmt </function></funcdef> 14990 <paramdef>struct snd_soc_dai * <parameter>dai</parameter></paramdef> 14991 <paramdef>unsigned int <parameter>fmt</parameter></paramdef> 14992 </funcprototype></funcsynopsis> 14993</refsynopsisdiv> 14994<refsect1> 14995 <title>Arguments</title> 14996 <variablelist> 14997 <varlistentry> 14998 <term><parameter>dai</parameter></term> 14999 <listitem> 15000 <para> 15001 DAI 15002 </para> 15003 </listitem> 15004 </varlistentry> 15005 <varlistentry> 15006 <term><parameter>fmt</parameter></term> 15007 <listitem> 15008 <para> 15009 SND_SOC_DAIFMT_ format value. 15010 </para> 15011 </listitem> 15012 </varlistentry> 15013 </variablelist> 15014</refsect1> 15015<refsect1> 15016<title>Description</title> 15017<para> 15018 Configures the DAI hardware format and clocking. 15019</para> 15020</refsect1> 15021</refentry> 15022 15023<refentry id="API-snd-soc-dai-set-tdm-slot"> 15024<refentryinfo> 15025 <title>LINUX</title> 15026 <productname>Kernel Hackers Manual</productname> 15027 <date>July 2017</date> 15028</refentryinfo> 15029<refmeta> 15030 <refentrytitle><phrase>snd_soc_dai_set_tdm_slot</phrase></refentrytitle> 15031 <manvolnum>9</manvolnum> 15032 <refmiscinfo class="version">4.1.27</refmiscinfo> 15033</refmeta> 15034<refnamediv> 15035 <refname>snd_soc_dai_set_tdm_slot</refname> 15036 <refpurpose> 15037 Configures a DAI for TDM operation 15038 </refpurpose> 15039</refnamediv> 15040<refsynopsisdiv> 15041 <title>Synopsis</title> 15042 <funcsynopsis><funcprototype> 15043 <funcdef>int <function>snd_soc_dai_set_tdm_slot </function></funcdef> 15044 <paramdef>struct snd_soc_dai * <parameter>dai</parameter></paramdef> 15045 <paramdef>unsigned int <parameter>tx_mask</parameter></paramdef> 15046 <paramdef>unsigned int <parameter>rx_mask</parameter></paramdef> 15047 <paramdef>int <parameter>slots</parameter></paramdef> 15048 <paramdef>int <parameter>slot_width</parameter></paramdef> 15049 </funcprototype></funcsynopsis> 15050</refsynopsisdiv> 15051<refsect1> 15052 <title>Arguments</title> 15053 <variablelist> 15054 <varlistentry> 15055 <term><parameter>dai</parameter></term> 15056 <listitem> 15057 <para> 15058 The DAI to configure 15059 </para> 15060 </listitem> 15061 </varlistentry> 15062 <varlistentry> 15063 <term><parameter>tx_mask</parameter></term> 15064 <listitem> 15065 <para> 15066 bitmask representing active TX slots. 15067 </para> 15068 </listitem> 15069 </varlistentry> 15070 <varlistentry> 15071 <term><parameter>rx_mask</parameter></term> 15072 <listitem> 15073 <para> 15074 bitmask representing active RX slots. 15075 </para> 15076 </listitem> 15077 </varlistentry> 15078 <varlistentry> 15079 <term><parameter>slots</parameter></term> 15080 <listitem> 15081 <para> 15082 Number of slots in use. 15083 </para> 15084 </listitem> 15085 </varlistentry> 15086 <varlistentry> 15087 <term><parameter>slot_width</parameter></term> 15088 <listitem> 15089 <para> 15090 Width in bits for each slot. 15091 </para> 15092 </listitem> 15093 </varlistentry> 15094 </variablelist> 15095</refsect1> 15096<refsect1> 15097<title>Description</title> 15098<para> 15099 This function configures the specified DAI for TDM operation. <parameter>slot</parameter> contains 15100 the total number of slots of the TDM stream and <parameter>slot_with</parameter> the width of each 15101 slot in bit clock cycles. <parameter>tx_mask</parameter> and <parameter>rx_mask</parameter> are bitmasks specifying the 15102 active slots of the TDM stream for the specified DAI, i.e. which slots the 15103 DAI should write to or read from. If a bit is set the corresponding slot is 15104 active, if a bit is cleared the corresponding slot is inactive. Bit 0 maps to 15105 the first slot, bit 1 to the second slot and so on. The first active slot 15106 maps to the first channel of the DAI, the second active slot to the second 15107 channel and so on. 15108 </para><para> 15109 15110 TDM mode can be disabled by passing 0 for <parameter>slots</parameter>. In this case <parameter>tx_mask</parameter>, 15111 <parameter>rx_mask</parameter> and <parameter>slot_width</parameter> will be ignored. 15112 </para><para> 15113 15114 Returns 0 on success, a negative error code otherwise. 15115</para> 15116</refsect1> 15117</refentry> 15118 15119<refentry id="API-snd-soc-dai-set-channel-map"> 15120<refentryinfo> 15121 <title>LINUX</title> 15122 <productname>Kernel Hackers Manual</productname> 15123 <date>July 2017</date> 15124</refentryinfo> 15125<refmeta> 15126 <refentrytitle><phrase>snd_soc_dai_set_channel_map</phrase></refentrytitle> 15127 <manvolnum>9</manvolnum> 15128 <refmiscinfo class="version">4.1.27</refmiscinfo> 15129</refmeta> 15130<refnamediv> 15131 <refname>snd_soc_dai_set_channel_map</refname> 15132 <refpurpose> 15133 configure DAI audio channel map 15134 </refpurpose> 15135</refnamediv> 15136<refsynopsisdiv> 15137 <title>Synopsis</title> 15138 <funcsynopsis><funcprototype> 15139 <funcdef>int <function>snd_soc_dai_set_channel_map </function></funcdef> 15140 <paramdef>struct snd_soc_dai * <parameter>dai</parameter></paramdef> 15141 <paramdef>unsigned int <parameter>tx_num</parameter></paramdef> 15142 <paramdef>unsigned int * <parameter>tx_slot</parameter></paramdef> 15143 <paramdef>unsigned int <parameter>rx_num</parameter></paramdef> 15144 <paramdef>unsigned int * <parameter>rx_slot</parameter></paramdef> 15145 </funcprototype></funcsynopsis> 15146</refsynopsisdiv> 15147<refsect1> 15148 <title>Arguments</title> 15149 <variablelist> 15150 <varlistentry> 15151 <term><parameter>dai</parameter></term> 15152 <listitem> 15153 <para> 15154 DAI 15155 </para> 15156 </listitem> 15157 </varlistentry> 15158 <varlistentry> 15159 <term><parameter>tx_num</parameter></term> 15160 <listitem> 15161 <para> 15162 how many TX channels 15163 </para> 15164 </listitem> 15165 </varlistentry> 15166 <varlistentry> 15167 <term><parameter>tx_slot</parameter></term> 15168 <listitem> 15169 <para> 15170 pointer to an array which imply the TX slot number channel 15171 0~num-1 uses 15172 </para> 15173 </listitem> 15174 </varlistentry> 15175 <varlistentry> 15176 <term><parameter>rx_num</parameter></term> 15177 <listitem> 15178 <para> 15179 how many RX channels 15180 </para> 15181 </listitem> 15182 </varlistentry> 15183 <varlistentry> 15184 <term><parameter>rx_slot</parameter></term> 15185 <listitem> 15186 <para> 15187 pointer to an array which imply the RX slot number channel 15188 0~num-1 uses 15189 </para> 15190 </listitem> 15191 </varlistentry> 15192 </variablelist> 15193</refsect1> 15194<refsect1> 15195<title>Description</title> 15196<para> 15197 configure the relationship between channel number and TDM slot number. 15198</para> 15199</refsect1> 15200</refentry> 15201 15202<refentry id="API-snd-soc-dai-set-tristate"> 15203<refentryinfo> 15204 <title>LINUX</title> 15205 <productname>Kernel Hackers Manual</productname> 15206 <date>July 2017</date> 15207</refentryinfo> 15208<refmeta> 15209 <refentrytitle><phrase>snd_soc_dai_set_tristate</phrase></refentrytitle> 15210 <manvolnum>9</manvolnum> 15211 <refmiscinfo class="version">4.1.27</refmiscinfo> 15212</refmeta> 15213<refnamediv> 15214 <refname>snd_soc_dai_set_tristate</refname> 15215 <refpurpose> 15216 configure DAI system or master clock. 15217 </refpurpose> 15218</refnamediv> 15219<refsynopsisdiv> 15220 <title>Synopsis</title> 15221 <funcsynopsis><funcprototype> 15222 <funcdef>int <function>snd_soc_dai_set_tristate </function></funcdef> 15223 <paramdef>struct snd_soc_dai * <parameter>dai</parameter></paramdef> 15224 <paramdef>int <parameter>tristate</parameter></paramdef> 15225 </funcprototype></funcsynopsis> 15226</refsynopsisdiv> 15227<refsect1> 15228 <title>Arguments</title> 15229 <variablelist> 15230 <varlistentry> 15231 <term><parameter>dai</parameter></term> 15232 <listitem> 15233 <para> 15234 DAI 15235 </para> 15236 </listitem> 15237 </varlistentry> 15238 <varlistentry> 15239 <term><parameter>tristate</parameter></term> 15240 <listitem> 15241 <para> 15242 tristate enable 15243 </para> 15244 </listitem> 15245 </varlistentry> 15246 </variablelist> 15247</refsect1> 15248<refsect1> 15249<title>Description</title> 15250<para> 15251 Tristates the DAI so that others can use it. 15252</para> 15253</refsect1> 15254</refentry> 15255 15256<refentry id="API-snd-soc-dai-digital-mute"> 15257<refentryinfo> 15258 <title>LINUX</title> 15259 <productname>Kernel Hackers Manual</productname> 15260 <date>July 2017</date> 15261</refentryinfo> 15262<refmeta> 15263 <refentrytitle><phrase>snd_soc_dai_digital_mute</phrase></refentrytitle> 15264 <manvolnum>9</manvolnum> 15265 <refmiscinfo class="version">4.1.27</refmiscinfo> 15266</refmeta> 15267<refnamediv> 15268 <refname>snd_soc_dai_digital_mute</refname> 15269 <refpurpose> 15270 configure DAI system or master clock. 15271 </refpurpose> 15272</refnamediv> 15273<refsynopsisdiv> 15274 <title>Synopsis</title> 15275 <funcsynopsis><funcprototype> 15276 <funcdef>int <function>snd_soc_dai_digital_mute </function></funcdef> 15277 <paramdef>struct snd_soc_dai * <parameter>dai</parameter></paramdef> 15278 <paramdef>int <parameter>mute</parameter></paramdef> 15279 <paramdef>int <parameter>direction</parameter></paramdef> 15280 </funcprototype></funcsynopsis> 15281</refsynopsisdiv> 15282<refsect1> 15283 <title>Arguments</title> 15284 <variablelist> 15285 <varlistentry> 15286 <term><parameter>dai</parameter></term> 15287 <listitem> 15288 <para> 15289 DAI 15290 </para> 15291 </listitem> 15292 </varlistentry> 15293 <varlistentry> 15294 <term><parameter>mute</parameter></term> 15295 <listitem> 15296 <para> 15297 mute enable 15298 </para> 15299 </listitem> 15300 </varlistentry> 15301 <varlistentry> 15302 <term><parameter>direction</parameter></term> 15303 <listitem> 15304 <para> 15305 stream to mute 15306 </para> 15307 </listitem> 15308 </varlistentry> 15309 </variablelist> 15310</refsect1> 15311<refsect1> 15312<title>Description</title> 15313<para> 15314 Mutes the DAI DAC. 15315</para> 15316</refsect1> 15317</refentry> 15318 15319<refentry id="API-snd-soc-register-card"> 15320<refentryinfo> 15321 <title>LINUX</title> 15322 <productname>Kernel Hackers Manual</productname> 15323 <date>July 2017</date> 15324</refentryinfo> 15325<refmeta> 15326 <refentrytitle><phrase>snd_soc_register_card</phrase></refentrytitle> 15327 <manvolnum>9</manvolnum> 15328 <refmiscinfo class="version">4.1.27</refmiscinfo> 15329</refmeta> 15330<refnamediv> 15331 <refname>snd_soc_register_card</refname> 15332 <refpurpose> 15333 Register a card with the ASoC core 15334 </refpurpose> 15335</refnamediv> 15336<refsynopsisdiv> 15337 <title>Synopsis</title> 15338 <funcsynopsis><funcprototype> 15339 <funcdef>int <function>snd_soc_register_card </function></funcdef> 15340 <paramdef>struct snd_soc_card * <parameter>card</parameter></paramdef> 15341 </funcprototype></funcsynopsis> 15342</refsynopsisdiv> 15343<refsect1> 15344 <title>Arguments</title> 15345 <variablelist> 15346 <varlistentry> 15347 <term><parameter>card</parameter></term> 15348 <listitem> 15349 <para> 15350 Card to register 15351 </para> 15352 </listitem> 15353 </varlistentry> 15354 </variablelist> 15355</refsect1> 15356</refentry> 15357 15358<refentry id="API-snd-soc-unregister-card"> 15359<refentryinfo> 15360 <title>LINUX</title> 15361 <productname>Kernel Hackers Manual</productname> 15362 <date>July 2017</date> 15363</refentryinfo> 15364<refmeta> 15365 <refentrytitle><phrase>snd_soc_unregister_card</phrase></refentrytitle> 15366 <manvolnum>9</manvolnum> 15367 <refmiscinfo class="version">4.1.27</refmiscinfo> 15368</refmeta> 15369<refnamediv> 15370 <refname>snd_soc_unregister_card</refname> 15371 <refpurpose> 15372 Unregister a card with the ASoC core 15373 </refpurpose> 15374</refnamediv> 15375<refsynopsisdiv> 15376 <title>Synopsis</title> 15377 <funcsynopsis><funcprototype> 15378 <funcdef>int <function>snd_soc_unregister_card </function></funcdef> 15379 <paramdef>struct snd_soc_card * <parameter>card</parameter></paramdef> 15380 </funcprototype></funcsynopsis> 15381</refsynopsisdiv> 15382<refsect1> 15383 <title>Arguments</title> 15384 <variablelist> 15385 <varlistentry> 15386 <term><parameter>card</parameter></term> 15387 <listitem> 15388 <para> 15389 Card to unregister 15390 </para> 15391 </listitem> 15392 </varlistentry> 15393 </variablelist> 15394</refsect1> 15395</refentry> 15396 15397<refentry id="API-snd-soc-component-init-regmap"> 15398<refentryinfo> 15399 <title>LINUX</title> 15400 <productname>Kernel Hackers Manual</productname> 15401 <date>July 2017</date> 15402</refentryinfo> 15403<refmeta> 15404 <refentrytitle><phrase>snd_soc_component_init_regmap</phrase></refentrytitle> 15405 <manvolnum>9</manvolnum> 15406 <refmiscinfo class="version">4.1.27</refmiscinfo> 15407</refmeta> 15408<refnamediv> 15409 <refname>snd_soc_component_init_regmap</refname> 15410 <refpurpose> 15411 Initialize regmap instance for the component 15412 </refpurpose> 15413</refnamediv> 15414<refsynopsisdiv> 15415 <title>Synopsis</title> 15416 <funcsynopsis><funcprototype> 15417 <funcdef>void <function>snd_soc_component_init_regmap </function></funcdef> 15418 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 15419 <paramdef>struct regmap * <parameter>regmap</parameter></paramdef> 15420 </funcprototype></funcsynopsis> 15421</refsynopsisdiv> 15422<refsect1> 15423 <title>Arguments</title> 15424 <variablelist> 15425 <varlistentry> 15426 <term><parameter>component</parameter></term> 15427 <listitem> 15428 <para> 15429 The component for which to initialize the regmap instance 15430 </para> 15431 </listitem> 15432 </varlistentry> 15433 <varlistentry> 15434 <term><parameter>regmap</parameter></term> 15435 <listitem> 15436 <para> 15437 The regmap instance that should be used by the component 15438 </para> 15439 </listitem> 15440 </varlistentry> 15441 </variablelist> 15442</refsect1> 15443<refsect1> 15444<title>Description</title> 15445<para> 15446 This function allows deferred assignment of the regmap instance that is 15447 associated with the component. Only use this if the regmap instance is not 15448 yet ready when the component is registered. The function must also be called 15449 before the first IO attempt of the component. 15450</para> 15451</refsect1> 15452</refentry> 15453 15454<refentry id="API-snd-soc-component-exit-regmap"> 15455<refentryinfo> 15456 <title>LINUX</title> 15457 <productname>Kernel Hackers Manual</productname> 15458 <date>July 2017</date> 15459</refentryinfo> 15460<refmeta> 15461 <refentrytitle><phrase>snd_soc_component_exit_regmap</phrase></refentrytitle> 15462 <manvolnum>9</manvolnum> 15463 <refmiscinfo class="version">4.1.27</refmiscinfo> 15464</refmeta> 15465<refnamediv> 15466 <refname>snd_soc_component_exit_regmap</refname> 15467 <refpurpose> 15468 De-initialize regmap instance for the component 15469 </refpurpose> 15470</refnamediv> 15471<refsynopsisdiv> 15472 <title>Synopsis</title> 15473 <funcsynopsis><funcprototype> 15474 <funcdef>void <function>snd_soc_component_exit_regmap </function></funcdef> 15475 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 15476 </funcprototype></funcsynopsis> 15477</refsynopsisdiv> 15478<refsect1> 15479 <title>Arguments</title> 15480 <variablelist> 15481 <varlistentry> 15482 <term><parameter>component</parameter></term> 15483 <listitem> 15484 <para> 15485 The component for which to de-initialize the regmap instance 15486 </para> 15487 </listitem> 15488 </varlistentry> 15489 </variablelist> 15490</refsect1> 15491<refsect1> 15492<title>Description</title> 15493<para> 15494 Calls <function>regmap_exit</function> on the regmap instance associated to the component and 15495 removes the regmap instance from the component. 15496 </para><para> 15497 15498 This function should only be used if <function>snd_soc_component_init_regmap</function> was used 15499 to initialize the regmap instance. 15500</para> 15501</refsect1> 15502</refentry> 15503 15504<refentry id="API-snd-soc-unregister-component"> 15505<refentryinfo> 15506 <title>LINUX</title> 15507 <productname>Kernel Hackers Manual</productname> 15508 <date>July 2017</date> 15509</refentryinfo> 15510<refmeta> 15511 <refentrytitle><phrase>snd_soc_unregister_component</phrase></refentrytitle> 15512 <manvolnum>9</manvolnum> 15513 <refmiscinfo class="version">4.1.27</refmiscinfo> 15514</refmeta> 15515<refnamediv> 15516 <refname>snd_soc_unregister_component</refname> 15517 <refpurpose> 15518 Unregister a component from the ASoC core 15519 </refpurpose> 15520</refnamediv> 15521<refsynopsisdiv> 15522 <title>Synopsis</title> 15523 <funcsynopsis><funcprototype> 15524 <funcdef>void <function>snd_soc_unregister_component </function></funcdef> 15525 <paramdef>struct device * <parameter>dev</parameter></paramdef> 15526 </funcprototype></funcsynopsis> 15527</refsynopsisdiv> 15528<refsect1> 15529 <title>Arguments</title> 15530 <variablelist> 15531 <varlistentry> 15532 <term><parameter>dev</parameter></term> 15533 <listitem> 15534 <para> 15535 -- undescribed -- 15536 </para> 15537 </listitem> 15538 </varlistentry> 15539 </variablelist> 15540</refsect1> 15541</refentry> 15542 15543<refentry id="API-snd-soc-add-platform"> 15544<refentryinfo> 15545 <title>LINUX</title> 15546 <productname>Kernel Hackers Manual</productname> 15547 <date>July 2017</date> 15548</refentryinfo> 15549<refmeta> 15550 <refentrytitle><phrase>snd_soc_add_platform</phrase></refentrytitle> 15551 <manvolnum>9</manvolnum> 15552 <refmiscinfo class="version">4.1.27</refmiscinfo> 15553</refmeta> 15554<refnamediv> 15555 <refname>snd_soc_add_platform</refname> 15556 <refpurpose> 15557 Add a platform to the ASoC core 15558 </refpurpose> 15559</refnamediv> 15560<refsynopsisdiv> 15561 <title>Synopsis</title> 15562 <funcsynopsis><funcprototype> 15563 <funcdef>int <function>snd_soc_add_platform </function></funcdef> 15564 <paramdef>struct device * <parameter>dev</parameter></paramdef> 15565 <paramdef>struct snd_soc_platform * <parameter>platform</parameter></paramdef> 15566 <paramdef>const struct snd_soc_platform_driver * <parameter>platform_drv</parameter></paramdef> 15567 </funcprototype></funcsynopsis> 15568</refsynopsisdiv> 15569<refsect1> 15570 <title>Arguments</title> 15571 <variablelist> 15572 <varlistentry> 15573 <term><parameter>dev</parameter></term> 15574 <listitem> 15575 <para> 15576 The parent device for the platform 15577 </para> 15578 </listitem> 15579 </varlistentry> 15580 <varlistentry> 15581 <term><parameter>platform</parameter></term> 15582 <listitem> 15583 <para> 15584 The platform to add 15585 </para> 15586 </listitem> 15587 </varlistentry> 15588 <varlistentry> 15589 <term><parameter>platform_drv</parameter></term> 15590 <listitem> 15591 <para> 15592 -- undescribed -- 15593 </para> 15594 </listitem> 15595 </varlistentry> 15596 </variablelist> 15597</refsect1> 15598</refentry> 15599 15600<refentry id="API-snd-soc-register-platform"> 15601<refentryinfo> 15602 <title>LINUX</title> 15603 <productname>Kernel Hackers Manual</productname> 15604 <date>July 2017</date> 15605</refentryinfo> 15606<refmeta> 15607 <refentrytitle><phrase>snd_soc_register_platform</phrase></refentrytitle> 15608 <manvolnum>9</manvolnum> 15609 <refmiscinfo class="version">4.1.27</refmiscinfo> 15610</refmeta> 15611<refnamediv> 15612 <refname>snd_soc_register_platform</refname> 15613 <refpurpose> 15614 Register a platform with the ASoC core 15615 </refpurpose> 15616</refnamediv> 15617<refsynopsisdiv> 15618 <title>Synopsis</title> 15619 <funcsynopsis><funcprototype> 15620 <funcdef>int <function>snd_soc_register_platform </function></funcdef> 15621 <paramdef>struct device * <parameter>dev</parameter></paramdef> 15622 <paramdef>const struct snd_soc_platform_driver * <parameter>platform_drv</parameter></paramdef> 15623 </funcprototype></funcsynopsis> 15624</refsynopsisdiv> 15625<refsect1> 15626 <title>Arguments</title> 15627 <variablelist> 15628 <varlistentry> 15629 <term><parameter>dev</parameter></term> 15630 <listitem> 15631 <para> 15632 -- undescribed -- 15633 </para> 15634 </listitem> 15635 </varlistentry> 15636 <varlistentry> 15637 <term><parameter>platform_drv</parameter></term> 15638 <listitem> 15639 <para> 15640 -- undescribed -- 15641 </para> 15642 </listitem> 15643 </varlistentry> 15644 </variablelist> 15645</refsect1> 15646</refentry> 15647 15648<refentry id="API-snd-soc-remove-platform"> 15649<refentryinfo> 15650 <title>LINUX</title> 15651 <productname>Kernel Hackers Manual</productname> 15652 <date>July 2017</date> 15653</refentryinfo> 15654<refmeta> 15655 <refentrytitle><phrase>snd_soc_remove_platform</phrase></refentrytitle> 15656 <manvolnum>9</manvolnum> 15657 <refmiscinfo class="version">4.1.27</refmiscinfo> 15658</refmeta> 15659<refnamediv> 15660 <refname>snd_soc_remove_platform</refname> 15661 <refpurpose> 15662 Remove a platform from the ASoC core 15663 </refpurpose> 15664</refnamediv> 15665<refsynopsisdiv> 15666 <title>Synopsis</title> 15667 <funcsynopsis><funcprototype> 15668 <funcdef>void <function>snd_soc_remove_platform </function></funcdef> 15669 <paramdef>struct snd_soc_platform * <parameter>platform</parameter></paramdef> 15670 </funcprototype></funcsynopsis> 15671</refsynopsisdiv> 15672<refsect1> 15673 <title>Arguments</title> 15674 <variablelist> 15675 <varlistentry> 15676 <term><parameter>platform</parameter></term> 15677 <listitem> 15678 <para> 15679 the platform to remove 15680 </para> 15681 </listitem> 15682 </varlistentry> 15683 </variablelist> 15684</refsect1> 15685</refentry> 15686 15687<refentry id="API-snd-soc-unregister-platform"> 15688<refentryinfo> 15689 <title>LINUX</title> 15690 <productname>Kernel Hackers Manual</productname> 15691 <date>July 2017</date> 15692</refentryinfo> 15693<refmeta> 15694 <refentrytitle><phrase>snd_soc_unregister_platform</phrase></refentrytitle> 15695 <manvolnum>9</manvolnum> 15696 <refmiscinfo class="version">4.1.27</refmiscinfo> 15697</refmeta> 15698<refnamediv> 15699 <refname>snd_soc_unregister_platform</refname> 15700 <refpurpose> 15701 Unregister a platform from the ASoC core 15702 </refpurpose> 15703</refnamediv> 15704<refsynopsisdiv> 15705 <title>Synopsis</title> 15706 <funcsynopsis><funcprototype> 15707 <funcdef>void <function>snd_soc_unregister_platform </function></funcdef> 15708 <paramdef>struct device * <parameter>dev</parameter></paramdef> 15709 </funcprototype></funcsynopsis> 15710</refsynopsisdiv> 15711<refsect1> 15712 <title>Arguments</title> 15713 <variablelist> 15714 <varlistentry> 15715 <term><parameter>dev</parameter></term> 15716 <listitem> 15717 <para> 15718 -- undescribed -- 15719 </para> 15720 </listitem> 15721 </varlistentry> 15722 </variablelist> 15723</refsect1> 15724</refentry> 15725 15726<refentry id="API-snd-soc-register-codec"> 15727<refentryinfo> 15728 <title>LINUX</title> 15729 <productname>Kernel Hackers Manual</productname> 15730 <date>July 2017</date> 15731</refentryinfo> 15732<refmeta> 15733 <refentrytitle><phrase>snd_soc_register_codec</phrase></refentrytitle> 15734 <manvolnum>9</manvolnum> 15735 <refmiscinfo class="version">4.1.27</refmiscinfo> 15736</refmeta> 15737<refnamediv> 15738 <refname>snd_soc_register_codec</refname> 15739 <refpurpose> 15740 Register a codec with the ASoC core 15741 </refpurpose> 15742</refnamediv> 15743<refsynopsisdiv> 15744 <title>Synopsis</title> 15745 <funcsynopsis><funcprototype> 15746 <funcdef>int <function>snd_soc_register_codec </function></funcdef> 15747 <paramdef>struct device * <parameter>dev</parameter></paramdef> 15748 <paramdef>const struct snd_soc_codec_driver * <parameter>codec_drv</parameter></paramdef> 15749 <paramdef>struct snd_soc_dai_driver * <parameter>dai_drv</parameter></paramdef> 15750 <paramdef>int <parameter>num_dai</parameter></paramdef> 15751 </funcprototype></funcsynopsis> 15752</refsynopsisdiv> 15753<refsect1> 15754 <title>Arguments</title> 15755 <variablelist> 15756 <varlistentry> 15757 <term><parameter>dev</parameter></term> 15758 <listitem> 15759 <para> 15760 -- undescribed -- 15761 </para> 15762 </listitem> 15763 </varlistentry> 15764 <varlistentry> 15765 <term><parameter>codec_drv</parameter></term> 15766 <listitem> 15767 <para> 15768 -- undescribed -- 15769 </para> 15770 </listitem> 15771 </varlistentry> 15772 <varlistentry> 15773 <term><parameter>dai_drv</parameter></term> 15774 <listitem> 15775 <para> 15776 -- undescribed -- 15777 </para> 15778 </listitem> 15779 </varlistentry> 15780 <varlistentry> 15781 <term><parameter>num_dai</parameter></term> 15782 <listitem> 15783 <para> 15784 -- undescribed -- 15785 </para> 15786 </listitem> 15787 </varlistentry> 15788 </variablelist> 15789</refsect1> 15790</refentry> 15791 15792<refentry id="API-snd-soc-unregister-codec"> 15793<refentryinfo> 15794 <title>LINUX</title> 15795 <productname>Kernel Hackers Manual</productname> 15796 <date>July 2017</date> 15797</refentryinfo> 15798<refmeta> 15799 <refentrytitle><phrase>snd_soc_unregister_codec</phrase></refentrytitle> 15800 <manvolnum>9</manvolnum> 15801 <refmiscinfo class="version">4.1.27</refmiscinfo> 15802</refmeta> 15803<refnamediv> 15804 <refname>snd_soc_unregister_codec</refname> 15805 <refpurpose> 15806 Unregister a codec from the ASoC core 15807 </refpurpose> 15808</refnamediv> 15809<refsynopsisdiv> 15810 <title>Synopsis</title> 15811 <funcsynopsis><funcprototype> 15812 <funcdef>void <function>snd_soc_unregister_codec </function></funcdef> 15813 <paramdef>struct device * <parameter>dev</parameter></paramdef> 15814 </funcprototype></funcsynopsis> 15815</refsynopsisdiv> 15816<refsect1> 15817 <title>Arguments</title> 15818 <variablelist> 15819 <varlistentry> 15820 <term><parameter>dev</parameter></term> 15821 <listitem> 15822 <para> 15823 -- undescribed -- 15824 </para> 15825 </listitem> 15826 </varlistentry> 15827 </variablelist> 15828</refsect1> 15829</refentry> 15830 15831<!-- sound/soc/soc-cache.c --> 15832<refentry> 15833 <refnamediv> 15834 <refname> 15835 .//sound/soc/soc-cache.c 15836 </refname> 15837 <refpurpose> 15838 Document generation inconsistency 15839 </refpurpose> 15840 </refnamediv> 15841 <refsect1> 15842 <title> 15843 Oops 15844 </title> 15845 <warning> 15846 <para> 15847 The template for this document tried to insert 15848 the structured comment from the file 15849 <filename>.//sound/soc/soc-cache.c</filename> at this point, 15850 but none was found. 15851 This dummy section is inserted to allow 15852 generation to continue. 15853 </para> 15854 </warning> 15855 </refsect1> 15856</refentry> 15857<!-- sound/soc/soc-devres.c --> 15858<refentry id="API-devm-snd-soc-register-component"> 15859<refentryinfo> 15860 <title>LINUX</title> 15861 <productname>Kernel Hackers Manual</productname> 15862 <date>July 2017</date> 15863</refentryinfo> 15864<refmeta> 15865 <refentrytitle><phrase>devm_snd_soc_register_component</phrase></refentrytitle> 15866 <manvolnum>9</manvolnum> 15867 <refmiscinfo class="version">4.1.27</refmiscinfo> 15868</refmeta> 15869<refnamediv> 15870 <refname>devm_snd_soc_register_component</refname> 15871 <refpurpose> 15872 resource managed component registration 15873 </refpurpose> 15874</refnamediv> 15875<refsynopsisdiv> 15876 <title>Synopsis</title> 15877 <funcsynopsis><funcprototype> 15878 <funcdef>int <function>devm_snd_soc_register_component </function></funcdef> 15879 <paramdef>struct device * <parameter>dev</parameter></paramdef> 15880 <paramdef>const struct snd_soc_component_driver * <parameter>cmpnt_drv</parameter></paramdef> 15881 <paramdef>struct snd_soc_dai_driver * <parameter>dai_drv</parameter></paramdef> 15882 <paramdef>int <parameter>num_dai</parameter></paramdef> 15883 </funcprototype></funcsynopsis> 15884</refsynopsisdiv> 15885<refsect1> 15886 <title>Arguments</title> 15887 <variablelist> 15888 <varlistentry> 15889 <term><parameter>dev</parameter></term> 15890 <listitem> 15891 <para> 15892 Device used to manage component 15893 </para> 15894 </listitem> 15895 </varlistentry> 15896 <varlistentry> 15897 <term><parameter>cmpnt_drv</parameter></term> 15898 <listitem> 15899 <para> 15900 Component driver 15901 </para> 15902 </listitem> 15903 </varlistentry> 15904 <varlistentry> 15905 <term><parameter>dai_drv</parameter></term> 15906 <listitem> 15907 <para> 15908 DAI driver 15909 </para> 15910 </listitem> 15911 </varlistentry> 15912 <varlistentry> 15913 <term><parameter>num_dai</parameter></term> 15914 <listitem> 15915 <para> 15916 Number of DAIs to register 15917 </para> 15918 </listitem> 15919 </varlistentry> 15920 </variablelist> 15921</refsect1> 15922<refsect1> 15923<title>Description</title> 15924<para> 15925 Register a component with automatic unregistration when the device is 15926 unregistered. 15927</para> 15928</refsect1> 15929</refentry> 15930 15931<refentry id="API-devm-snd-soc-register-platform"> 15932<refentryinfo> 15933 <title>LINUX</title> 15934 <productname>Kernel Hackers Manual</productname> 15935 <date>July 2017</date> 15936</refentryinfo> 15937<refmeta> 15938 <refentrytitle><phrase>devm_snd_soc_register_platform</phrase></refentrytitle> 15939 <manvolnum>9</manvolnum> 15940 <refmiscinfo class="version">4.1.27</refmiscinfo> 15941</refmeta> 15942<refnamediv> 15943 <refname>devm_snd_soc_register_platform</refname> 15944 <refpurpose> 15945 resource managed platform registration 15946 </refpurpose> 15947</refnamediv> 15948<refsynopsisdiv> 15949 <title>Synopsis</title> 15950 <funcsynopsis><funcprototype> 15951 <funcdef>int <function>devm_snd_soc_register_platform </function></funcdef> 15952 <paramdef>struct device * <parameter>dev</parameter></paramdef> 15953 <paramdef>const struct snd_soc_platform_driver * <parameter>platform_drv</parameter></paramdef> 15954 </funcprototype></funcsynopsis> 15955</refsynopsisdiv> 15956<refsect1> 15957 <title>Arguments</title> 15958 <variablelist> 15959 <varlistentry> 15960 <term><parameter>dev</parameter></term> 15961 <listitem> 15962 <para> 15963 Device used to manage platform 15964 </para> 15965 </listitem> 15966 </varlistentry> 15967 <varlistentry> 15968 <term><parameter>platform_drv</parameter></term> 15969 <listitem> 15970 <para> 15971 platform to register 15972 </para> 15973 </listitem> 15974 </varlistentry> 15975 </variablelist> 15976</refsect1> 15977<refsect1> 15978<title>Description</title> 15979<para> 15980 Register a platform driver with automatic unregistration when the device is 15981 unregistered. 15982</para> 15983</refsect1> 15984</refentry> 15985 15986<refentry id="API-devm-snd-soc-register-card"> 15987<refentryinfo> 15988 <title>LINUX</title> 15989 <productname>Kernel Hackers Manual</productname> 15990 <date>July 2017</date> 15991</refentryinfo> 15992<refmeta> 15993 <refentrytitle><phrase>devm_snd_soc_register_card</phrase></refentrytitle> 15994 <manvolnum>9</manvolnum> 15995 <refmiscinfo class="version">4.1.27</refmiscinfo> 15996</refmeta> 15997<refnamediv> 15998 <refname>devm_snd_soc_register_card</refname> 15999 <refpurpose> 16000 resource managed card registration 16001 </refpurpose> 16002</refnamediv> 16003<refsynopsisdiv> 16004 <title>Synopsis</title> 16005 <funcsynopsis><funcprototype> 16006 <funcdef>int <function>devm_snd_soc_register_card </function></funcdef> 16007 <paramdef>struct device * <parameter>dev</parameter></paramdef> 16008 <paramdef>struct snd_soc_card * <parameter>card</parameter></paramdef> 16009 </funcprototype></funcsynopsis> 16010</refsynopsisdiv> 16011<refsect1> 16012 <title>Arguments</title> 16013 <variablelist> 16014 <varlistentry> 16015 <term><parameter>dev</parameter></term> 16016 <listitem> 16017 <para> 16018 Device used to manage card 16019 </para> 16020 </listitem> 16021 </varlistentry> 16022 <varlistentry> 16023 <term><parameter>card</parameter></term> 16024 <listitem> 16025 <para> 16026 Card to register 16027 </para> 16028 </listitem> 16029 </varlistentry> 16030 </variablelist> 16031</refsect1> 16032<refsect1> 16033<title>Description</title> 16034<para> 16035 Register a card with automatic unregistration when the device is 16036 unregistered. 16037</para> 16038</refsect1> 16039</refentry> 16040 16041<refentry id="API-devm-snd-dmaengine-pcm-register"> 16042<refentryinfo> 16043 <title>LINUX</title> 16044 <productname>Kernel Hackers Manual</productname> 16045 <date>July 2017</date> 16046</refentryinfo> 16047<refmeta> 16048 <refentrytitle><phrase>devm_snd_dmaengine_pcm_register</phrase></refentrytitle> 16049 <manvolnum>9</manvolnum> 16050 <refmiscinfo class="version">4.1.27</refmiscinfo> 16051</refmeta> 16052<refnamediv> 16053 <refname>devm_snd_dmaengine_pcm_register</refname> 16054 <refpurpose> 16055 resource managed dmaengine PCM registration 16056 </refpurpose> 16057</refnamediv> 16058<refsynopsisdiv> 16059 <title>Synopsis</title> 16060 <funcsynopsis><funcprototype> 16061 <funcdef>int <function>devm_snd_dmaengine_pcm_register </function></funcdef> 16062 <paramdef>struct device * <parameter>dev</parameter></paramdef> 16063 <paramdef>const struct snd_dmaengine_pcm_config * <parameter>config</parameter></paramdef> 16064 <paramdef>unsigned int <parameter>flags</parameter></paramdef> 16065 </funcprototype></funcsynopsis> 16066</refsynopsisdiv> 16067<refsect1> 16068 <title>Arguments</title> 16069 <variablelist> 16070 <varlistentry> 16071 <term><parameter>dev</parameter></term> 16072 <listitem> 16073 <para> 16074 The parent device for the PCM device 16075 </para> 16076 </listitem> 16077 </varlistentry> 16078 <varlistentry> 16079 <term><parameter>config</parameter></term> 16080 <listitem> 16081 <para> 16082 Platform specific PCM configuration 16083 </para> 16084 </listitem> 16085 </varlistentry> 16086 <varlistentry> 16087 <term><parameter>flags</parameter></term> 16088 <listitem> 16089 <para> 16090 Platform specific quirks 16091 </para> 16092 </listitem> 16093 </varlistentry> 16094 </variablelist> 16095</refsect1> 16096<refsect1> 16097<title>Description</title> 16098<para> 16099 Register a dmaengine based PCM device with automatic unregistration when the 16100 device is unregistered. 16101</para> 16102</refsect1> 16103</refentry> 16104 16105<!-- sound/soc/soc-io.c --> 16106<refentry id="API-snd-soc-component-read"> 16107<refentryinfo> 16108 <title>LINUX</title> 16109 <productname>Kernel Hackers Manual</productname> 16110 <date>July 2017</date> 16111</refentryinfo> 16112<refmeta> 16113 <refentrytitle><phrase>snd_soc_component_read</phrase></refentrytitle> 16114 <manvolnum>9</manvolnum> 16115 <refmiscinfo class="version">4.1.27</refmiscinfo> 16116</refmeta> 16117<refnamediv> 16118 <refname>snd_soc_component_read</refname> 16119 <refpurpose> 16120 Read register value 16121 </refpurpose> 16122</refnamediv> 16123<refsynopsisdiv> 16124 <title>Synopsis</title> 16125 <funcsynopsis><funcprototype> 16126 <funcdef>int <function>snd_soc_component_read </function></funcdef> 16127 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 16128 <paramdef>unsigned int <parameter>reg</parameter></paramdef> 16129 <paramdef>unsigned int * <parameter>val</parameter></paramdef> 16130 </funcprototype></funcsynopsis> 16131</refsynopsisdiv> 16132<refsect1> 16133 <title>Arguments</title> 16134 <variablelist> 16135 <varlistentry> 16136 <term><parameter>component</parameter></term> 16137 <listitem> 16138 <para> 16139 Component to read from 16140 </para> 16141 </listitem> 16142 </varlistentry> 16143 <varlistentry> 16144 <term><parameter>reg</parameter></term> 16145 <listitem> 16146 <para> 16147 Register to read 16148 </para> 16149 </listitem> 16150 </varlistentry> 16151 <varlistentry> 16152 <term><parameter>val</parameter></term> 16153 <listitem> 16154 <para> 16155 Pointer to where the read value is stored 16156 </para> 16157 </listitem> 16158 </varlistentry> 16159 </variablelist> 16160</refsect1> 16161<refsect1> 16162<title>Return</title> 16163<para> 16164 0 on success, a negative error code otherwise. 16165</para> 16166</refsect1> 16167</refentry> 16168 16169<refentry id="API-snd-soc-component-write"> 16170<refentryinfo> 16171 <title>LINUX</title> 16172 <productname>Kernel Hackers Manual</productname> 16173 <date>July 2017</date> 16174</refentryinfo> 16175<refmeta> 16176 <refentrytitle><phrase>snd_soc_component_write</phrase></refentrytitle> 16177 <manvolnum>9</manvolnum> 16178 <refmiscinfo class="version">4.1.27</refmiscinfo> 16179</refmeta> 16180<refnamediv> 16181 <refname>snd_soc_component_write</refname> 16182 <refpurpose> 16183 Write register value 16184 </refpurpose> 16185</refnamediv> 16186<refsynopsisdiv> 16187 <title>Synopsis</title> 16188 <funcsynopsis><funcprototype> 16189 <funcdef>int <function>snd_soc_component_write </function></funcdef> 16190 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 16191 <paramdef>unsigned int <parameter>reg</parameter></paramdef> 16192 <paramdef>unsigned int <parameter>val</parameter></paramdef> 16193 </funcprototype></funcsynopsis> 16194</refsynopsisdiv> 16195<refsect1> 16196 <title>Arguments</title> 16197 <variablelist> 16198 <varlistentry> 16199 <term><parameter>component</parameter></term> 16200 <listitem> 16201 <para> 16202 Component to write to 16203 </para> 16204 </listitem> 16205 </varlistentry> 16206 <varlistentry> 16207 <term><parameter>reg</parameter></term> 16208 <listitem> 16209 <para> 16210 Register to write 16211 </para> 16212 </listitem> 16213 </varlistentry> 16214 <varlistentry> 16215 <term><parameter>val</parameter></term> 16216 <listitem> 16217 <para> 16218 Value to write to the register 16219 </para> 16220 </listitem> 16221 </varlistentry> 16222 </variablelist> 16223</refsect1> 16224<refsect1> 16225<title>Return</title> 16226<para> 16227 0 on success, a negative error code otherwise. 16228</para> 16229</refsect1> 16230</refentry> 16231 16232<refentry id="API-snd-soc-component-update-bits"> 16233<refentryinfo> 16234 <title>LINUX</title> 16235 <productname>Kernel Hackers Manual</productname> 16236 <date>July 2017</date> 16237</refentryinfo> 16238<refmeta> 16239 <refentrytitle><phrase>snd_soc_component_update_bits</phrase></refentrytitle> 16240 <manvolnum>9</manvolnum> 16241 <refmiscinfo class="version">4.1.27</refmiscinfo> 16242</refmeta> 16243<refnamediv> 16244 <refname>snd_soc_component_update_bits</refname> 16245 <refpurpose> 16246 Perform read/modify/write cycle 16247 </refpurpose> 16248</refnamediv> 16249<refsynopsisdiv> 16250 <title>Synopsis</title> 16251 <funcsynopsis><funcprototype> 16252 <funcdef>int <function>snd_soc_component_update_bits </function></funcdef> 16253 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 16254 <paramdef>unsigned int <parameter>reg</parameter></paramdef> 16255 <paramdef>unsigned int <parameter>mask</parameter></paramdef> 16256 <paramdef>unsigned int <parameter>val</parameter></paramdef> 16257 </funcprototype></funcsynopsis> 16258</refsynopsisdiv> 16259<refsect1> 16260 <title>Arguments</title> 16261 <variablelist> 16262 <varlistentry> 16263 <term><parameter>component</parameter></term> 16264 <listitem> 16265 <para> 16266 Component to update 16267 </para> 16268 </listitem> 16269 </varlistentry> 16270 <varlistentry> 16271 <term><parameter>reg</parameter></term> 16272 <listitem> 16273 <para> 16274 Register to update 16275 </para> 16276 </listitem> 16277 </varlistentry> 16278 <varlistentry> 16279 <term><parameter>mask</parameter></term> 16280 <listitem> 16281 <para> 16282 Mask that specifies which bits to update 16283 </para> 16284 </listitem> 16285 </varlistentry> 16286 <varlistentry> 16287 <term><parameter>val</parameter></term> 16288 <listitem> 16289 <para> 16290 New value for the bits specified by mask 16291 </para> 16292 </listitem> 16293 </varlistentry> 16294 </variablelist> 16295</refsect1> 16296<refsect1> 16297<title>Return</title> 16298<para> 16299 1 if the operation was successful and the value of the register 16300 changed, 0 if the operation was successful, but the value did not change. 16301 Returns a negative error code otherwise. 16302</para> 16303</refsect1> 16304</refentry> 16305 16306<refentry id="API-snd-soc-component-update-bits-async"> 16307<refentryinfo> 16308 <title>LINUX</title> 16309 <productname>Kernel Hackers Manual</productname> 16310 <date>July 2017</date> 16311</refentryinfo> 16312<refmeta> 16313 <refentrytitle><phrase>snd_soc_component_update_bits_async</phrase></refentrytitle> 16314 <manvolnum>9</manvolnum> 16315 <refmiscinfo class="version">4.1.27</refmiscinfo> 16316</refmeta> 16317<refnamediv> 16318 <refname>snd_soc_component_update_bits_async</refname> 16319 <refpurpose> 16320 Perform asynchronous read/modify/write cycle 16321 </refpurpose> 16322</refnamediv> 16323<refsynopsisdiv> 16324 <title>Synopsis</title> 16325 <funcsynopsis><funcprototype> 16326 <funcdef>int <function>snd_soc_component_update_bits_async </function></funcdef> 16327 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 16328 <paramdef>unsigned int <parameter>reg</parameter></paramdef> 16329 <paramdef>unsigned int <parameter>mask</parameter></paramdef> 16330 <paramdef>unsigned int <parameter>val</parameter></paramdef> 16331 </funcprototype></funcsynopsis> 16332</refsynopsisdiv> 16333<refsect1> 16334 <title>Arguments</title> 16335 <variablelist> 16336 <varlistentry> 16337 <term><parameter>component</parameter></term> 16338 <listitem> 16339 <para> 16340 Component to update 16341 </para> 16342 </listitem> 16343 </varlistentry> 16344 <varlistentry> 16345 <term><parameter>reg</parameter></term> 16346 <listitem> 16347 <para> 16348 Register to update 16349 </para> 16350 </listitem> 16351 </varlistentry> 16352 <varlistentry> 16353 <term><parameter>mask</parameter></term> 16354 <listitem> 16355 <para> 16356 Mask that specifies which bits to update 16357 </para> 16358 </listitem> 16359 </varlistentry> 16360 <varlistentry> 16361 <term><parameter>val</parameter></term> 16362 <listitem> 16363 <para> 16364 New value for the bits specified by mask 16365 </para> 16366 </listitem> 16367 </varlistentry> 16368 </variablelist> 16369</refsect1> 16370<refsect1> 16371<title>Description</title> 16372<para> 16373 This function is similar to <function>snd_soc_component_update_bits</function>, but the update 16374 operation is scheduled asynchronously. This means it may not be completed 16375 when the function returns. To make sure that all scheduled updates have been 16376 completed <function>snd_soc_component_async_complete</function> must be called. 16377</para> 16378</refsect1> 16379<refsect1> 16380<title>Return</title> 16381<para> 16382 1 if the operation was successful and the value of the register 16383 changed, 0 if the operation was successful, but the value did not change. 16384 Returns a negative error code otherwise. 16385</para> 16386</refsect1> 16387</refentry> 16388 16389<refentry id="API-snd-soc-component-async-complete"> 16390<refentryinfo> 16391 <title>LINUX</title> 16392 <productname>Kernel Hackers Manual</productname> 16393 <date>July 2017</date> 16394</refentryinfo> 16395<refmeta> 16396 <refentrytitle><phrase>snd_soc_component_async_complete</phrase></refentrytitle> 16397 <manvolnum>9</manvolnum> 16398 <refmiscinfo class="version">4.1.27</refmiscinfo> 16399</refmeta> 16400<refnamediv> 16401 <refname>snd_soc_component_async_complete</refname> 16402 <refpurpose> 16403 Ensure asynchronous I/O has completed 16404 </refpurpose> 16405</refnamediv> 16406<refsynopsisdiv> 16407 <title>Synopsis</title> 16408 <funcsynopsis><funcprototype> 16409 <funcdef>void <function>snd_soc_component_async_complete </function></funcdef> 16410 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 16411 </funcprototype></funcsynopsis> 16412</refsynopsisdiv> 16413<refsect1> 16414 <title>Arguments</title> 16415 <variablelist> 16416 <varlistentry> 16417 <term><parameter>component</parameter></term> 16418 <listitem> 16419 <para> 16420 Component for which to wait 16421 </para> 16422 </listitem> 16423 </varlistentry> 16424 </variablelist> 16425</refsect1> 16426<refsect1> 16427<title>Description</title> 16428<para> 16429 This function blocks until all asynchronous I/O which has previously been 16430 scheduled using <function>snd_soc_component_update_bits_async</function> has completed. 16431</para> 16432</refsect1> 16433</refentry> 16434 16435<refentry id="API-snd-soc-component-test-bits"> 16436<refentryinfo> 16437 <title>LINUX</title> 16438 <productname>Kernel Hackers Manual</productname> 16439 <date>July 2017</date> 16440</refentryinfo> 16441<refmeta> 16442 <refentrytitle><phrase>snd_soc_component_test_bits</phrase></refentrytitle> 16443 <manvolnum>9</manvolnum> 16444 <refmiscinfo class="version">4.1.27</refmiscinfo> 16445</refmeta> 16446<refnamediv> 16447 <refname>snd_soc_component_test_bits</refname> 16448 <refpurpose> 16449 Test register for change 16450 </refpurpose> 16451</refnamediv> 16452<refsynopsisdiv> 16453 <title>Synopsis</title> 16454 <funcsynopsis><funcprototype> 16455 <funcdef>int <function>snd_soc_component_test_bits </function></funcdef> 16456 <paramdef>struct snd_soc_component * <parameter>component</parameter></paramdef> 16457 <paramdef>unsigned int <parameter>reg</parameter></paramdef> 16458 <paramdef>unsigned int <parameter>mask</parameter></paramdef> 16459 <paramdef>unsigned int <parameter>value</parameter></paramdef> 16460 </funcprototype></funcsynopsis> 16461</refsynopsisdiv> 16462<refsect1> 16463 <title>Arguments</title> 16464 <variablelist> 16465 <varlistentry> 16466 <term><parameter>component</parameter></term> 16467 <listitem> 16468 <para> 16469 component 16470 </para> 16471 </listitem> 16472 </varlistentry> 16473 <varlistentry> 16474 <term><parameter>reg</parameter></term> 16475 <listitem> 16476 <para> 16477 Register to test 16478 </para> 16479 </listitem> 16480 </varlistentry> 16481 <varlistentry> 16482 <term><parameter>mask</parameter></term> 16483 <listitem> 16484 <para> 16485 Mask that specifies which bits to test 16486 </para> 16487 </listitem> 16488 </varlistentry> 16489 <varlistentry> 16490 <term><parameter>value</parameter></term> 16491 <listitem> 16492 <para> 16493 Value to test against 16494 </para> 16495 </listitem> 16496 </varlistentry> 16497 </variablelist> 16498</refsect1> 16499<refsect1> 16500<title>Description</title> 16501<para> 16502 Tests a register with a new value and checks if the new value is 16503 different from the old value. 16504</para> 16505</refsect1> 16506<refsect1> 16507<title>Return</title> 16508<para> 16509 1 for change, otherwise 0. 16510</para> 16511</refsect1> 16512</refentry> 16513 16514<refentry id="API-snd-soc-update-bits"> 16515<refentryinfo> 16516 <title>LINUX</title> 16517 <productname>Kernel Hackers Manual</productname> 16518 <date>July 2017</date> 16519</refentryinfo> 16520<refmeta> 16521 <refentrytitle><phrase>snd_soc_update_bits</phrase></refentrytitle> 16522 <manvolnum>9</manvolnum> 16523 <refmiscinfo class="version">4.1.27</refmiscinfo> 16524</refmeta> 16525<refnamediv> 16526 <refname>snd_soc_update_bits</refname> 16527 <refpurpose> 16528 update codec register bits 16529 </refpurpose> 16530</refnamediv> 16531<refsynopsisdiv> 16532 <title>Synopsis</title> 16533 <funcsynopsis><funcprototype> 16534 <funcdef>int <function>snd_soc_update_bits </function></funcdef> 16535 <paramdef>struct snd_soc_codec * <parameter>codec</parameter></paramdef> 16536 <paramdef>unsigned int <parameter>reg</parameter></paramdef> 16537 <paramdef>unsigned int <parameter>mask</parameter></paramdef> 16538 <paramdef>unsigned int <parameter>value</parameter></paramdef> 16539 </funcprototype></funcsynopsis> 16540</refsynopsisdiv> 16541<refsect1> 16542 <title>Arguments</title> 16543 <variablelist> 16544 <varlistentry> 16545 <term><parameter>codec</parameter></term> 16546 <listitem> 16547 <para> 16548 audio codec 16549 </para> 16550 </listitem> 16551 </varlistentry> 16552 <varlistentry> 16553 <term><parameter>reg</parameter></term> 16554 <listitem> 16555 <para> 16556 codec register 16557 </para> 16558 </listitem> 16559 </varlistentry> 16560 <varlistentry> 16561 <term><parameter>mask</parameter></term> 16562 <listitem> 16563 <para> 16564 register mask 16565 </para> 16566 </listitem> 16567 </varlistentry> 16568 <varlistentry> 16569 <term><parameter>value</parameter></term> 16570 <listitem> 16571 <para> 16572 new value 16573 </para> 16574 </listitem> 16575 </varlistentry> 16576 </variablelist> 16577</refsect1> 16578<refsect1> 16579<title>Description</title> 16580<para> 16581 Writes new register value. 16582 </para><para> 16583 16584 Returns 1 for change, 0 for no change, or negative error code. 16585</para> 16586</refsect1> 16587</refentry> 16588 16589<refentry id="API-snd-soc-test-bits"> 16590<refentryinfo> 16591 <title>LINUX</title> 16592 <productname>Kernel Hackers Manual</productname> 16593 <date>July 2017</date> 16594</refentryinfo> 16595<refmeta> 16596 <refentrytitle><phrase>snd_soc_test_bits</phrase></refentrytitle> 16597 <manvolnum>9</manvolnum> 16598 <refmiscinfo class="version">4.1.27</refmiscinfo> 16599</refmeta> 16600<refnamediv> 16601 <refname>snd_soc_test_bits</refname> 16602 <refpurpose> 16603 test register for change 16604 </refpurpose> 16605</refnamediv> 16606<refsynopsisdiv> 16607 <title>Synopsis</title> 16608 <funcsynopsis><funcprototype> 16609 <funcdef>int <function>snd_soc_test_bits </function></funcdef> 16610 <paramdef>struct snd_soc_codec * <parameter>codec</parameter></paramdef> 16611 <paramdef>unsigned int <parameter>reg</parameter></paramdef> 16612 <paramdef>unsigned int <parameter>mask</parameter></paramdef> 16613 <paramdef>unsigned int <parameter>value</parameter></paramdef> 16614 </funcprototype></funcsynopsis> 16615</refsynopsisdiv> 16616<refsect1> 16617 <title>Arguments</title> 16618 <variablelist> 16619 <varlistentry> 16620 <term><parameter>codec</parameter></term> 16621 <listitem> 16622 <para> 16623 audio codec 16624 </para> 16625 </listitem> 16626 </varlistentry> 16627 <varlistentry> 16628 <term><parameter>reg</parameter></term> 16629 <listitem> 16630 <para> 16631 codec register 16632 </para> 16633 </listitem> 16634 </varlistentry> 16635 <varlistentry> 16636 <term><parameter>mask</parameter></term> 16637 <listitem> 16638 <para> 16639 register mask 16640 </para> 16641 </listitem> 16642 </varlistentry> 16643 <varlistentry> 16644 <term><parameter>value</parameter></term> 16645 <listitem> 16646 <para> 16647 new value 16648 </para> 16649 </listitem> 16650 </varlistentry> 16651 </variablelist> 16652</refsect1> 16653<refsect1> 16654<title>Description</title> 16655<para> 16656 Tests a register with a new value and checks if the new value is 16657 different from the old value. 16658 </para><para> 16659 16660 Returns 1 for change else 0. 16661</para> 16662</refsect1> 16663</refentry> 16664 16665<!-- sound/soc/soc-pcm.c --> 16666<refentry id="API-snd-soc-set-runtime-hwparams"> 16667<refentryinfo> 16668 <title>LINUX</title> 16669 <productname>Kernel Hackers Manual</productname> 16670 <date>July 2017</date> 16671</refentryinfo> 16672<refmeta> 16673 <refentrytitle><phrase>snd_soc_set_runtime_hwparams</phrase></refentrytitle> 16674 <manvolnum>9</manvolnum> 16675 <refmiscinfo class="version">4.1.27</refmiscinfo> 16676</refmeta> 16677<refnamediv> 16678 <refname>snd_soc_set_runtime_hwparams</refname> 16679 <refpurpose> 16680 set the runtime hardware parameters 16681 </refpurpose> 16682</refnamediv> 16683<refsynopsisdiv> 16684 <title>Synopsis</title> 16685 <funcsynopsis><funcprototype> 16686 <funcdef>int <function>snd_soc_set_runtime_hwparams </function></funcdef> 16687 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 16688 <paramdef>const struct snd_pcm_hardware * <parameter>hw</parameter></paramdef> 16689 </funcprototype></funcsynopsis> 16690</refsynopsisdiv> 16691<refsect1> 16692 <title>Arguments</title> 16693 <variablelist> 16694 <varlistentry> 16695 <term><parameter>substream</parameter></term> 16696 <listitem> 16697 <para> 16698 the pcm substream 16699 </para> 16700 </listitem> 16701 </varlistentry> 16702 <varlistentry> 16703 <term><parameter>hw</parameter></term> 16704 <listitem> 16705 <para> 16706 the hardware parameters 16707 </para> 16708 </listitem> 16709 </varlistentry> 16710 </variablelist> 16711</refsect1> 16712<refsect1> 16713<title>Description</title> 16714<para> 16715 Sets the substream runtime hardware parameters. 16716</para> 16717</refsect1> 16718</refentry> 16719 16720 </sect1> 16721 <sect1><title>ASoC DAPM API</title> 16722<!-- sound/soc/soc-dapm.c --> 16723<refentry id="API-snd-soc-dapm-kcontrol-dapm"> 16724<refentryinfo> 16725 <title>LINUX</title> 16726 <productname>Kernel Hackers Manual</productname> 16727 <date>July 2017</date> 16728</refentryinfo> 16729<refmeta> 16730 <refentrytitle><phrase>snd_soc_dapm_kcontrol_dapm</phrase></refentrytitle> 16731 <manvolnum>9</manvolnum> 16732 <refmiscinfo class="version">4.1.27</refmiscinfo> 16733</refmeta> 16734<refnamediv> 16735 <refname>snd_soc_dapm_kcontrol_dapm</refname> 16736 <refpurpose> 16737 Returns the dapm context associated to a kcontrol 16738 </refpurpose> 16739</refnamediv> 16740<refsynopsisdiv> 16741 <title>Synopsis</title> 16742 <funcsynopsis><funcprototype> 16743 <funcdef>struct snd_soc_dapm_context * <function>snd_soc_dapm_kcontrol_dapm </function></funcdef> 16744 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 16745 </funcprototype></funcsynopsis> 16746</refsynopsisdiv> 16747<refsect1> 16748 <title>Arguments</title> 16749 <variablelist> 16750 <varlistentry> 16751 <term><parameter>kcontrol</parameter></term> 16752 <listitem> 16753 <para> 16754 The kcontrol 16755 </para> 16756 </listitem> 16757 </varlistentry> 16758 </variablelist> 16759</refsect1> 16760<refsect1> 16761<title>Note</title> 16762<para> 16763 This function must only be used on kcontrols that are known to have 16764 been registered for a CODEC. Otherwise the behaviour is undefined. 16765</para> 16766</refsect1> 16767</refentry> 16768 16769<refentry id="API-snd-soc-dapm-sync-unlocked"> 16770<refentryinfo> 16771 <title>LINUX</title> 16772 <productname>Kernel Hackers Manual</productname> 16773 <date>July 2017</date> 16774</refentryinfo> 16775<refmeta> 16776 <refentrytitle><phrase>snd_soc_dapm_sync_unlocked</phrase></refentrytitle> 16777 <manvolnum>9</manvolnum> 16778 <refmiscinfo class="version">4.1.27</refmiscinfo> 16779</refmeta> 16780<refnamediv> 16781 <refname>snd_soc_dapm_sync_unlocked</refname> 16782 <refpurpose> 16783 scan and power dapm paths 16784 </refpurpose> 16785</refnamediv> 16786<refsynopsisdiv> 16787 <title>Synopsis</title> 16788 <funcsynopsis><funcprototype> 16789 <funcdef>int <function>snd_soc_dapm_sync_unlocked </function></funcdef> 16790 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 16791 </funcprototype></funcsynopsis> 16792</refsynopsisdiv> 16793<refsect1> 16794 <title>Arguments</title> 16795 <variablelist> 16796 <varlistentry> 16797 <term><parameter>dapm</parameter></term> 16798 <listitem> 16799 <para> 16800 DAPM context 16801 </para> 16802 </listitem> 16803 </varlistentry> 16804 </variablelist> 16805</refsect1> 16806<refsect1> 16807<title>Description</title> 16808<para> 16809 Walks all dapm audio paths and powers widgets according to their 16810 stream or path usage. 16811 </para><para> 16812 16813 Requires external locking. 16814 </para><para> 16815 16816 Returns 0 for success. 16817</para> 16818</refsect1> 16819</refentry> 16820 16821<refentry id="API-snd-soc-dapm-sync"> 16822<refentryinfo> 16823 <title>LINUX</title> 16824 <productname>Kernel Hackers Manual</productname> 16825 <date>July 2017</date> 16826</refentryinfo> 16827<refmeta> 16828 <refentrytitle><phrase>snd_soc_dapm_sync</phrase></refentrytitle> 16829 <manvolnum>9</manvolnum> 16830 <refmiscinfo class="version">4.1.27</refmiscinfo> 16831</refmeta> 16832<refnamediv> 16833 <refname>snd_soc_dapm_sync</refname> 16834 <refpurpose> 16835 scan and power dapm paths 16836 </refpurpose> 16837</refnamediv> 16838<refsynopsisdiv> 16839 <title>Synopsis</title> 16840 <funcsynopsis><funcprototype> 16841 <funcdef>int <function>snd_soc_dapm_sync </function></funcdef> 16842 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 16843 </funcprototype></funcsynopsis> 16844</refsynopsisdiv> 16845<refsect1> 16846 <title>Arguments</title> 16847 <variablelist> 16848 <varlistentry> 16849 <term><parameter>dapm</parameter></term> 16850 <listitem> 16851 <para> 16852 DAPM context 16853 </para> 16854 </listitem> 16855 </varlistentry> 16856 </variablelist> 16857</refsect1> 16858<refsect1> 16859<title>Description</title> 16860<para> 16861 Walks all dapm audio paths and powers widgets according to their 16862 stream or path usage. 16863 </para><para> 16864 16865 Returns 0 for success. 16866</para> 16867</refsect1> 16868</refentry> 16869 16870<refentry id="API-snd-soc-dapm-add-routes"> 16871<refentryinfo> 16872 <title>LINUX</title> 16873 <productname>Kernel Hackers Manual</productname> 16874 <date>July 2017</date> 16875</refentryinfo> 16876<refmeta> 16877 <refentrytitle><phrase>snd_soc_dapm_add_routes</phrase></refentrytitle> 16878 <manvolnum>9</manvolnum> 16879 <refmiscinfo class="version">4.1.27</refmiscinfo> 16880</refmeta> 16881<refnamediv> 16882 <refname>snd_soc_dapm_add_routes</refname> 16883 <refpurpose> 16884 Add routes between DAPM widgets 16885 </refpurpose> 16886</refnamediv> 16887<refsynopsisdiv> 16888 <title>Synopsis</title> 16889 <funcsynopsis><funcprototype> 16890 <funcdef>int <function>snd_soc_dapm_add_routes </function></funcdef> 16891 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 16892 <paramdef>const struct snd_soc_dapm_route * <parameter>route</parameter></paramdef> 16893 <paramdef>int <parameter>num</parameter></paramdef> 16894 </funcprototype></funcsynopsis> 16895</refsynopsisdiv> 16896<refsect1> 16897 <title>Arguments</title> 16898 <variablelist> 16899 <varlistentry> 16900 <term><parameter>dapm</parameter></term> 16901 <listitem> 16902 <para> 16903 DAPM context 16904 </para> 16905 </listitem> 16906 </varlistentry> 16907 <varlistentry> 16908 <term><parameter>route</parameter></term> 16909 <listitem> 16910 <para> 16911 audio routes 16912 </para> 16913 </listitem> 16914 </varlistentry> 16915 <varlistentry> 16916 <term><parameter>num</parameter></term> 16917 <listitem> 16918 <para> 16919 number of routes 16920 </para> 16921 </listitem> 16922 </varlistentry> 16923 </variablelist> 16924</refsect1> 16925<refsect1> 16926<title>Description</title> 16927<para> 16928 Connects 2 dapm widgets together via a named audio path. The sink is 16929 the widget receiving the audio signal, whilst the source is the sender 16930 of the audio signal. 16931 </para><para> 16932 16933 Returns 0 for success else error. On error all resources can be freed 16934 with a call to <function>snd_soc_card_free</function>. 16935</para> 16936</refsect1> 16937</refentry> 16938 16939<refentry id="API-snd-soc-dapm-del-routes"> 16940<refentryinfo> 16941 <title>LINUX</title> 16942 <productname>Kernel Hackers Manual</productname> 16943 <date>July 2017</date> 16944</refentryinfo> 16945<refmeta> 16946 <refentrytitle><phrase>snd_soc_dapm_del_routes</phrase></refentrytitle> 16947 <manvolnum>9</manvolnum> 16948 <refmiscinfo class="version">4.1.27</refmiscinfo> 16949</refmeta> 16950<refnamediv> 16951 <refname>snd_soc_dapm_del_routes</refname> 16952 <refpurpose> 16953 Remove routes between DAPM widgets 16954 </refpurpose> 16955</refnamediv> 16956<refsynopsisdiv> 16957 <title>Synopsis</title> 16958 <funcsynopsis><funcprototype> 16959 <funcdef>int <function>snd_soc_dapm_del_routes </function></funcdef> 16960 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 16961 <paramdef>const struct snd_soc_dapm_route * <parameter>route</parameter></paramdef> 16962 <paramdef>int <parameter>num</parameter></paramdef> 16963 </funcprototype></funcsynopsis> 16964</refsynopsisdiv> 16965<refsect1> 16966 <title>Arguments</title> 16967 <variablelist> 16968 <varlistentry> 16969 <term><parameter>dapm</parameter></term> 16970 <listitem> 16971 <para> 16972 DAPM context 16973 </para> 16974 </listitem> 16975 </varlistentry> 16976 <varlistentry> 16977 <term><parameter>route</parameter></term> 16978 <listitem> 16979 <para> 16980 audio routes 16981 </para> 16982 </listitem> 16983 </varlistentry> 16984 <varlistentry> 16985 <term><parameter>num</parameter></term> 16986 <listitem> 16987 <para> 16988 number of routes 16989 </para> 16990 </listitem> 16991 </varlistentry> 16992 </variablelist> 16993</refsect1> 16994<refsect1> 16995<title>Description</title> 16996<para> 16997 Removes routes from the DAPM context. 16998</para> 16999</refsect1> 17000</refentry> 17001 17002<refentry id="API-snd-soc-dapm-weak-routes"> 17003<refentryinfo> 17004 <title>LINUX</title> 17005 <productname>Kernel Hackers Manual</productname> 17006 <date>July 2017</date> 17007</refentryinfo> 17008<refmeta> 17009 <refentrytitle><phrase>snd_soc_dapm_weak_routes</phrase></refentrytitle> 17010 <manvolnum>9</manvolnum> 17011 <refmiscinfo class="version">4.1.27</refmiscinfo> 17012</refmeta> 17013<refnamediv> 17014 <refname>snd_soc_dapm_weak_routes</refname> 17015 <refpurpose> 17016 Mark routes between DAPM widgets as weak 17017 </refpurpose> 17018</refnamediv> 17019<refsynopsisdiv> 17020 <title>Synopsis</title> 17021 <funcsynopsis><funcprototype> 17022 <funcdef>int <function>snd_soc_dapm_weak_routes </function></funcdef> 17023 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 17024 <paramdef>const struct snd_soc_dapm_route * <parameter>route</parameter></paramdef> 17025 <paramdef>int <parameter>num</parameter></paramdef> 17026 </funcprototype></funcsynopsis> 17027</refsynopsisdiv> 17028<refsect1> 17029 <title>Arguments</title> 17030 <variablelist> 17031 <varlistentry> 17032 <term><parameter>dapm</parameter></term> 17033 <listitem> 17034 <para> 17035 DAPM context 17036 </para> 17037 </listitem> 17038 </varlistentry> 17039 <varlistentry> 17040 <term><parameter>route</parameter></term> 17041 <listitem> 17042 <para> 17043 audio routes 17044 </para> 17045 </listitem> 17046 </varlistentry> 17047 <varlistentry> 17048 <term><parameter>num</parameter></term> 17049 <listitem> 17050 <para> 17051 number of routes 17052 </para> 17053 </listitem> 17054 </varlistentry> 17055 </variablelist> 17056</refsect1> 17057<refsect1> 17058<title>Description</title> 17059<para> 17060 Mark existing routes matching those specified in the passed array 17061 as being weak, meaning that they are ignored for the purpose of 17062 power decisions. The main intended use case is for sidetone paths 17063 which couple audio between other independent paths if they are both 17064 active in order to make the combination work better at the user 17065 level but which aren't intended to be <quote>used</quote>. 17066 </para><para> 17067 17068 Note that CODEC drivers should not use this as sidetone type paths 17069 can frequently also be used as bypass paths. 17070</para> 17071</refsect1> 17072</refentry> 17073 17074<refentry id="API-snd-soc-dapm-new-widgets"> 17075<refentryinfo> 17076 <title>LINUX</title> 17077 <productname>Kernel Hackers Manual</productname> 17078 <date>July 2017</date> 17079</refentryinfo> 17080<refmeta> 17081 <refentrytitle><phrase>snd_soc_dapm_new_widgets</phrase></refentrytitle> 17082 <manvolnum>9</manvolnum> 17083 <refmiscinfo class="version">4.1.27</refmiscinfo> 17084</refmeta> 17085<refnamediv> 17086 <refname>snd_soc_dapm_new_widgets</refname> 17087 <refpurpose> 17088 add new dapm widgets 17089 </refpurpose> 17090</refnamediv> 17091<refsynopsisdiv> 17092 <title>Synopsis</title> 17093 <funcsynopsis><funcprototype> 17094 <funcdef>int <function>snd_soc_dapm_new_widgets </function></funcdef> 17095 <paramdef>struct snd_soc_card * <parameter>card</parameter></paramdef> 17096 </funcprototype></funcsynopsis> 17097</refsynopsisdiv> 17098<refsect1> 17099 <title>Arguments</title> 17100 <variablelist> 17101 <varlistentry> 17102 <term><parameter>card</parameter></term> 17103 <listitem> 17104 <para> 17105 -- undescribed -- 17106 </para> 17107 </listitem> 17108 </varlistentry> 17109 </variablelist> 17110</refsect1> 17111<refsect1> 17112<title>Description</title> 17113<para> 17114 Checks the codec for any new dapm widgets and creates them if found. 17115 </para><para> 17116 17117 Returns 0 for success. 17118</para> 17119</refsect1> 17120</refentry> 17121 17122<refentry id="API-snd-soc-dapm-get-volsw"> 17123<refentryinfo> 17124 <title>LINUX</title> 17125 <productname>Kernel Hackers Manual</productname> 17126 <date>July 2017</date> 17127</refentryinfo> 17128<refmeta> 17129 <refentrytitle><phrase>snd_soc_dapm_get_volsw</phrase></refentrytitle> 17130 <manvolnum>9</manvolnum> 17131 <refmiscinfo class="version">4.1.27</refmiscinfo> 17132</refmeta> 17133<refnamediv> 17134 <refname>snd_soc_dapm_get_volsw</refname> 17135 <refpurpose> 17136 dapm mixer get callback 17137 </refpurpose> 17138</refnamediv> 17139<refsynopsisdiv> 17140 <title>Synopsis</title> 17141 <funcsynopsis><funcprototype> 17142 <funcdef>int <function>snd_soc_dapm_get_volsw </function></funcdef> 17143 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 17144 <paramdef>struct snd_ctl_elem_value * <parameter>ucontrol</parameter></paramdef> 17145 </funcprototype></funcsynopsis> 17146</refsynopsisdiv> 17147<refsect1> 17148 <title>Arguments</title> 17149 <variablelist> 17150 <varlistentry> 17151 <term><parameter>kcontrol</parameter></term> 17152 <listitem> 17153 <para> 17154 mixer control 17155 </para> 17156 </listitem> 17157 </varlistentry> 17158 <varlistentry> 17159 <term><parameter>ucontrol</parameter></term> 17160 <listitem> 17161 <para> 17162 control element information 17163 </para> 17164 </listitem> 17165 </varlistentry> 17166 </variablelist> 17167</refsect1> 17168<refsect1> 17169<title>Description</title> 17170<para> 17171 Callback to get the value of a dapm mixer control. 17172 </para><para> 17173 17174 Returns 0 for success. 17175</para> 17176</refsect1> 17177</refentry> 17178 17179<refentry id="API-snd-soc-dapm-put-volsw"> 17180<refentryinfo> 17181 <title>LINUX</title> 17182 <productname>Kernel Hackers Manual</productname> 17183 <date>July 2017</date> 17184</refentryinfo> 17185<refmeta> 17186 <refentrytitle><phrase>snd_soc_dapm_put_volsw</phrase></refentrytitle> 17187 <manvolnum>9</manvolnum> 17188 <refmiscinfo class="version">4.1.27</refmiscinfo> 17189</refmeta> 17190<refnamediv> 17191 <refname>snd_soc_dapm_put_volsw</refname> 17192 <refpurpose> 17193 dapm mixer set callback 17194 </refpurpose> 17195</refnamediv> 17196<refsynopsisdiv> 17197 <title>Synopsis</title> 17198 <funcsynopsis><funcprototype> 17199 <funcdef>int <function>snd_soc_dapm_put_volsw </function></funcdef> 17200 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 17201 <paramdef>struct snd_ctl_elem_value * <parameter>ucontrol</parameter></paramdef> 17202 </funcprototype></funcsynopsis> 17203</refsynopsisdiv> 17204<refsect1> 17205 <title>Arguments</title> 17206 <variablelist> 17207 <varlistentry> 17208 <term><parameter>kcontrol</parameter></term> 17209 <listitem> 17210 <para> 17211 mixer control 17212 </para> 17213 </listitem> 17214 </varlistentry> 17215 <varlistentry> 17216 <term><parameter>ucontrol</parameter></term> 17217 <listitem> 17218 <para> 17219 control element information 17220 </para> 17221 </listitem> 17222 </varlistentry> 17223 </variablelist> 17224</refsect1> 17225<refsect1> 17226<title>Description</title> 17227<para> 17228 Callback to set the value of a dapm mixer control. 17229 </para><para> 17230 17231 Returns 0 for success. 17232</para> 17233</refsect1> 17234</refentry> 17235 17236<refentry id="API-snd-soc-dapm-get-enum-double"> 17237<refentryinfo> 17238 <title>LINUX</title> 17239 <productname>Kernel Hackers Manual</productname> 17240 <date>July 2017</date> 17241</refentryinfo> 17242<refmeta> 17243 <refentrytitle><phrase>snd_soc_dapm_get_enum_double</phrase></refentrytitle> 17244 <manvolnum>9</manvolnum> 17245 <refmiscinfo class="version">4.1.27</refmiscinfo> 17246</refmeta> 17247<refnamediv> 17248 <refname>snd_soc_dapm_get_enum_double</refname> 17249 <refpurpose> 17250 dapm enumerated double mixer get callback 17251 </refpurpose> 17252</refnamediv> 17253<refsynopsisdiv> 17254 <title>Synopsis</title> 17255 <funcsynopsis><funcprototype> 17256 <funcdef>int <function>snd_soc_dapm_get_enum_double </function></funcdef> 17257 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 17258 <paramdef>struct snd_ctl_elem_value * <parameter>ucontrol</parameter></paramdef> 17259 </funcprototype></funcsynopsis> 17260</refsynopsisdiv> 17261<refsect1> 17262 <title>Arguments</title> 17263 <variablelist> 17264 <varlistentry> 17265 <term><parameter>kcontrol</parameter></term> 17266 <listitem> 17267 <para> 17268 mixer control 17269 </para> 17270 </listitem> 17271 </varlistentry> 17272 <varlistentry> 17273 <term><parameter>ucontrol</parameter></term> 17274 <listitem> 17275 <para> 17276 control element information 17277 </para> 17278 </listitem> 17279 </varlistentry> 17280 </variablelist> 17281</refsect1> 17282<refsect1> 17283<title>Description</title> 17284<para> 17285 Callback to get the value of a dapm enumerated double mixer control. 17286 </para><para> 17287 17288 Returns 0 for success. 17289</para> 17290</refsect1> 17291</refentry> 17292 17293<refentry id="API-snd-soc-dapm-put-enum-double"> 17294<refentryinfo> 17295 <title>LINUX</title> 17296 <productname>Kernel Hackers Manual</productname> 17297 <date>July 2017</date> 17298</refentryinfo> 17299<refmeta> 17300 <refentrytitle><phrase>snd_soc_dapm_put_enum_double</phrase></refentrytitle> 17301 <manvolnum>9</manvolnum> 17302 <refmiscinfo class="version">4.1.27</refmiscinfo> 17303</refmeta> 17304<refnamediv> 17305 <refname>snd_soc_dapm_put_enum_double</refname> 17306 <refpurpose> 17307 dapm enumerated double mixer set callback 17308 </refpurpose> 17309</refnamediv> 17310<refsynopsisdiv> 17311 <title>Synopsis</title> 17312 <funcsynopsis><funcprototype> 17313 <funcdef>int <function>snd_soc_dapm_put_enum_double </function></funcdef> 17314 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 17315 <paramdef>struct snd_ctl_elem_value * <parameter>ucontrol</parameter></paramdef> 17316 </funcprototype></funcsynopsis> 17317</refsynopsisdiv> 17318<refsect1> 17319 <title>Arguments</title> 17320 <variablelist> 17321 <varlistentry> 17322 <term><parameter>kcontrol</parameter></term> 17323 <listitem> 17324 <para> 17325 mixer control 17326 </para> 17327 </listitem> 17328 </varlistentry> 17329 <varlistentry> 17330 <term><parameter>ucontrol</parameter></term> 17331 <listitem> 17332 <para> 17333 control element information 17334 </para> 17335 </listitem> 17336 </varlistentry> 17337 </variablelist> 17338</refsect1> 17339<refsect1> 17340<title>Description</title> 17341<para> 17342 Callback to set the value of a dapm enumerated double mixer control. 17343 </para><para> 17344 17345 Returns 0 for success. 17346</para> 17347</refsect1> 17348</refentry> 17349 17350<refentry id="API-snd-soc-dapm-info-pin-switch"> 17351<refentryinfo> 17352 <title>LINUX</title> 17353 <productname>Kernel Hackers Manual</productname> 17354 <date>July 2017</date> 17355</refentryinfo> 17356<refmeta> 17357 <refentrytitle><phrase>snd_soc_dapm_info_pin_switch</phrase></refentrytitle> 17358 <manvolnum>9</manvolnum> 17359 <refmiscinfo class="version">4.1.27</refmiscinfo> 17360</refmeta> 17361<refnamediv> 17362 <refname>snd_soc_dapm_info_pin_switch</refname> 17363 <refpurpose> 17364 Info for a pin switch 17365 </refpurpose> 17366</refnamediv> 17367<refsynopsisdiv> 17368 <title>Synopsis</title> 17369 <funcsynopsis><funcprototype> 17370 <funcdef>int <function>snd_soc_dapm_info_pin_switch </function></funcdef> 17371 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 17372 <paramdef>struct snd_ctl_elem_info * <parameter>uinfo</parameter></paramdef> 17373 </funcprototype></funcsynopsis> 17374</refsynopsisdiv> 17375<refsect1> 17376 <title>Arguments</title> 17377 <variablelist> 17378 <varlistentry> 17379 <term><parameter>kcontrol</parameter></term> 17380 <listitem> 17381 <para> 17382 mixer control 17383 </para> 17384 </listitem> 17385 </varlistentry> 17386 <varlistentry> 17387 <term><parameter>uinfo</parameter></term> 17388 <listitem> 17389 <para> 17390 control element information 17391 </para> 17392 </listitem> 17393 </varlistentry> 17394 </variablelist> 17395</refsect1> 17396<refsect1> 17397<title>Description</title> 17398<para> 17399 Callback to provide information about a pin switch control. 17400</para> 17401</refsect1> 17402</refentry> 17403 17404<refentry id="API-snd-soc-dapm-get-pin-switch"> 17405<refentryinfo> 17406 <title>LINUX</title> 17407 <productname>Kernel Hackers Manual</productname> 17408 <date>July 2017</date> 17409</refentryinfo> 17410<refmeta> 17411 <refentrytitle><phrase>snd_soc_dapm_get_pin_switch</phrase></refentrytitle> 17412 <manvolnum>9</manvolnum> 17413 <refmiscinfo class="version">4.1.27</refmiscinfo> 17414</refmeta> 17415<refnamediv> 17416 <refname>snd_soc_dapm_get_pin_switch</refname> 17417 <refpurpose> 17418 Get information for a pin switch 17419 </refpurpose> 17420</refnamediv> 17421<refsynopsisdiv> 17422 <title>Synopsis</title> 17423 <funcsynopsis><funcprototype> 17424 <funcdef>int <function>snd_soc_dapm_get_pin_switch </function></funcdef> 17425 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 17426 <paramdef>struct snd_ctl_elem_value * <parameter>ucontrol</parameter></paramdef> 17427 </funcprototype></funcsynopsis> 17428</refsynopsisdiv> 17429<refsect1> 17430 <title>Arguments</title> 17431 <variablelist> 17432 <varlistentry> 17433 <term><parameter>kcontrol</parameter></term> 17434 <listitem> 17435 <para> 17436 mixer control 17437 </para> 17438 </listitem> 17439 </varlistentry> 17440 <varlistentry> 17441 <term><parameter>ucontrol</parameter></term> 17442 <listitem> 17443 <para> 17444 Value 17445 </para> 17446 </listitem> 17447 </varlistentry> 17448 </variablelist> 17449</refsect1> 17450</refentry> 17451 17452<refentry id="API-snd-soc-dapm-put-pin-switch"> 17453<refentryinfo> 17454 <title>LINUX</title> 17455 <productname>Kernel Hackers Manual</productname> 17456 <date>July 2017</date> 17457</refentryinfo> 17458<refmeta> 17459 <refentrytitle><phrase>snd_soc_dapm_put_pin_switch</phrase></refentrytitle> 17460 <manvolnum>9</manvolnum> 17461 <refmiscinfo class="version">4.1.27</refmiscinfo> 17462</refmeta> 17463<refnamediv> 17464 <refname>snd_soc_dapm_put_pin_switch</refname> 17465 <refpurpose> 17466 Set information for a pin switch 17467 </refpurpose> 17468</refnamediv> 17469<refsynopsisdiv> 17470 <title>Synopsis</title> 17471 <funcsynopsis><funcprototype> 17472 <funcdef>int <function>snd_soc_dapm_put_pin_switch </function></funcdef> 17473 <paramdef>struct snd_kcontrol * <parameter>kcontrol</parameter></paramdef> 17474 <paramdef>struct snd_ctl_elem_value * <parameter>ucontrol</parameter></paramdef> 17475 </funcprototype></funcsynopsis> 17476</refsynopsisdiv> 17477<refsect1> 17478 <title>Arguments</title> 17479 <variablelist> 17480 <varlistentry> 17481 <term><parameter>kcontrol</parameter></term> 17482 <listitem> 17483 <para> 17484 mixer control 17485 </para> 17486 </listitem> 17487 </varlistentry> 17488 <varlistentry> 17489 <term><parameter>ucontrol</parameter></term> 17490 <listitem> 17491 <para> 17492 Value 17493 </para> 17494 </listitem> 17495 </varlistentry> 17496 </variablelist> 17497</refsect1> 17498</refentry> 17499 17500<refentry id="API-snd-soc-dapm-new-controls"> 17501<refentryinfo> 17502 <title>LINUX</title> 17503 <productname>Kernel Hackers Manual</productname> 17504 <date>July 2017</date> 17505</refentryinfo> 17506<refmeta> 17507 <refentrytitle><phrase>snd_soc_dapm_new_controls</phrase></refentrytitle> 17508 <manvolnum>9</manvolnum> 17509 <refmiscinfo class="version">4.1.27</refmiscinfo> 17510</refmeta> 17511<refnamediv> 17512 <refname>snd_soc_dapm_new_controls</refname> 17513 <refpurpose> 17514 create new dapm controls 17515 </refpurpose> 17516</refnamediv> 17517<refsynopsisdiv> 17518 <title>Synopsis</title> 17519 <funcsynopsis><funcprototype> 17520 <funcdef>int <function>snd_soc_dapm_new_controls </function></funcdef> 17521 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 17522 <paramdef>const struct snd_soc_dapm_widget * <parameter>widget</parameter></paramdef> 17523 <paramdef>int <parameter>num</parameter></paramdef> 17524 </funcprototype></funcsynopsis> 17525</refsynopsisdiv> 17526<refsect1> 17527 <title>Arguments</title> 17528 <variablelist> 17529 <varlistentry> 17530 <term><parameter>dapm</parameter></term> 17531 <listitem> 17532 <para> 17533 DAPM context 17534 </para> 17535 </listitem> 17536 </varlistentry> 17537 <varlistentry> 17538 <term><parameter>widget</parameter></term> 17539 <listitem> 17540 <para> 17541 widget array 17542 </para> 17543 </listitem> 17544 </varlistentry> 17545 <varlistentry> 17546 <term><parameter>num</parameter></term> 17547 <listitem> 17548 <para> 17549 number of widgets 17550 </para> 17551 </listitem> 17552 </varlistentry> 17553 </variablelist> 17554</refsect1> 17555<refsect1> 17556<title>Description</title> 17557<para> 17558 Creates new DAPM controls based upon the templates. 17559 </para><para> 17560 17561 Returns 0 for success else error. 17562</para> 17563</refsect1> 17564</refentry> 17565 17566<refentry id="API-snd-soc-dapm-enable-pin-unlocked"> 17567<refentryinfo> 17568 <title>LINUX</title> 17569 <productname>Kernel Hackers Manual</productname> 17570 <date>July 2017</date> 17571</refentryinfo> 17572<refmeta> 17573 <refentrytitle><phrase>snd_soc_dapm_enable_pin_unlocked</phrase></refentrytitle> 17574 <manvolnum>9</manvolnum> 17575 <refmiscinfo class="version">4.1.27</refmiscinfo> 17576</refmeta> 17577<refnamediv> 17578 <refname>snd_soc_dapm_enable_pin_unlocked</refname> 17579 <refpurpose> 17580 enable pin. 17581 </refpurpose> 17582</refnamediv> 17583<refsynopsisdiv> 17584 <title>Synopsis</title> 17585 <funcsynopsis><funcprototype> 17586 <funcdef>int <function>snd_soc_dapm_enable_pin_unlocked </function></funcdef> 17587 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 17588 <paramdef>const char * <parameter>pin</parameter></paramdef> 17589 </funcprototype></funcsynopsis> 17590</refsynopsisdiv> 17591<refsect1> 17592 <title>Arguments</title> 17593 <variablelist> 17594 <varlistentry> 17595 <term><parameter>dapm</parameter></term> 17596 <listitem> 17597 <para> 17598 DAPM context 17599 </para> 17600 </listitem> 17601 </varlistentry> 17602 <varlistentry> 17603 <term><parameter>pin</parameter></term> 17604 <listitem> 17605 <para> 17606 pin name 17607 </para> 17608 </listitem> 17609 </varlistentry> 17610 </variablelist> 17611</refsect1> 17612<refsect1> 17613<title>Description</title> 17614<para> 17615 Enables input/output pin and its parents or children widgets iff there is 17616 a valid audio route and active audio stream. 17617 </para><para> 17618 17619 Requires external locking. 17620</para> 17621</refsect1> 17622<refsect1> 17623<title>NOTE</title> 17624<para> 17625 <function>snd_soc_dapm_sync</function> needs to be called after this for DAPM to 17626 do any widget power switching. 17627</para> 17628</refsect1> 17629</refentry> 17630 17631<refentry id="API-snd-soc-dapm-enable-pin"> 17632<refentryinfo> 17633 <title>LINUX</title> 17634 <productname>Kernel Hackers Manual</productname> 17635 <date>July 2017</date> 17636</refentryinfo> 17637<refmeta> 17638 <refentrytitle><phrase>snd_soc_dapm_enable_pin</phrase></refentrytitle> 17639 <manvolnum>9</manvolnum> 17640 <refmiscinfo class="version">4.1.27</refmiscinfo> 17641</refmeta> 17642<refnamediv> 17643 <refname>snd_soc_dapm_enable_pin</refname> 17644 <refpurpose> 17645 enable pin. 17646 </refpurpose> 17647</refnamediv> 17648<refsynopsisdiv> 17649 <title>Synopsis</title> 17650 <funcsynopsis><funcprototype> 17651 <funcdef>int <function>snd_soc_dapm_enable_pin </function></funcdef> 17652 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 17653 <paramdef>const char * <parameter>pin</parameter></paramdef> 17654 </funcprototype></funcsynopsis> 17655</refsynopsisdiv> 17656<refsect1> 17657 <title>Arguments</title> 17658 <variablelist> 17659 <varlistentry> 17660 <term><parameter>dapm</parameter></term> 17661 <listitem> 17662 <para> 17663 DAPM context 17664 </para> 17665 </listitem> 17666 </varlistentry> 17667 <varlistentry> 17668 <term><parameter>pin</parameter></term> 17669 <listitem> 17670 <para> 17671 pin name 17672 </para> 17673 </listitem> 17674 </varlistentry> 17675 </variablelist> 17676</refsect1> 17677<refsect1> 17678<title>Description</title> 17679<para> 17680 Enables input/output pin and its parents or children widgets iff there is 17681 a valid audio route and active audio stream. 17682</para> 17683</refsect1> 17684<refsect1> 17685<title>NOTE</title> 17686<para> 17687 <function>snd_soc_dapm_sync</function> needs to be called after this for DAPM to 17688 do any widget power switching. 17689</para> 17690</refsect1> 17691</refentry> 17692 17693<refentry id="API-snd-soc-dapm-force-enable-pin-unlocked"> 17694<refentryinfo> 17695 <title>LINUX</title> 17696 <productname>Kernel Hackers Manual</productname> 17697 <date>July 2017</date> 17698</refentryinfo> 17699<refmeta> 17700 <refentrytitle><phrase>snd_soc_dapm_force_enable_pin_unlocked</phrase></refentrytitle> 17701 <manvolnum>9</manvolnum> 17702 <refmiscinfo class="version">4.1.27</refmiscinfo> 17703</refmeta> 17704<refnamediv> 17705 <refname>snd_soc_dapm_force_enable_pin_unlocked</refname> 17706 <refpurpose> 17707 force a pin to be enabled 17708 </refpurpose> 17709</refnamediv> 17710<refsynopsisdiv> 17711 <title>Synopsis</title> 17712 <funcsynopsis><funcprototype> 17713 <funcdef>int <function>snd_soc_dapm_force_enable_pin_unlocked </function></funcdef> 17714 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 17715 <paramdef>const char * <parameter>pin</parameter></paramdef> 17716 </funcprototype></funcsynopsis> 17717</refsynopsisdiv> 17718<refsect1> 17719 <title>Arguments</title> 17720 <variablelist> 17721 <varlistentry> 17722 <term><parameter>dapm</parameter></term> 17723 <listitem> 17724 <para> 17725 DAPM context 17726 </para> 17727 </listitem> 17728 </varlistentry> 17729 <varlistentry> 17730 <term><parameter>pin</parameter></term> 17731 <listitem> 17732 <para> 17733 pin name 17734 </para> 17735 </listitem> 17736 </varlistentry> 17737 </variablelist> 17738</refsect1> 17739<refsect1> 17740<title>Description</title> 17741<para> 17742 Enables input/output pin regardless of any other state. This is 17743 intended for use with microphone bias supplies used in microphone 17744 jack detection. 17745 </para><para> 17746 17747 Requires external locking. 17748</para> 17749</refsect1> 17750<refsect1> 17751<title>NOTE</title> 17752<para> 17753 <function>snd_soc_dapm_sync</function> needs to be called after this for DAPM to 17754 do any widget power switching. 17755</para> 17756</refsect1> 17757</refentry> 17758 17759<refentry id="API-snd-soc-dapm-force-enable-pin"> 17760<refentryinfo> 17761 <title>LINUX</title> 17762 <productname>Kernel Hackers Manual</productname> 17763 <date>July 2017</date> 17764</refentryinfo> 17765<refmeta> 17766 <refentrytitle><phrase>snd_soc_dapm_force_enable_pin</phrase></refentrytitle> 17767 <manvolnum>9</manvolnum> 17768 <refmiscinfo class="version">4.1.27</refmiscinfo> 17769</refmeta> 17770<refnamediv> 17771 <refname>snd_soc_dapm_force_enable_pin</refname> 17772 <refpurpose> 17773 force a pin to be enabled 17774 </refpurpose> 17775</refnamediv> 17776<refsynopsisdiv> 17777 <title>Synopsis</title> 17778 <funcsynopsis><funcprototype> 17779 <funcdef>int <function>snd_soc_dapm_force_enable_pin </function></funcdef> 17780 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 17781 <paramdef>const char * <parameter>pin</parameter></paramdef> 17782 </funcprototype></funcsynopsis> 17783</refsynopsisdiv> 17784<refsect1> 17785 <title>Arguments</title> 17786 <variablelist> 17787 <varlistentry> 17788 <term><parameter>dapm</parameter></term> 17789 <listitem> 17790 <para> 17791 DAPM context 17792 </para> 17793 </listitem> 17794 </varlistentry> 17795 <varlistentry> 17796 <term><parameter>pin</parameter></term> 17797 <listitem> 17798 <para> 17799 pin name 17800 </para> 17801 </listitem> 17802 </varlistentry> 17803 </variablelist> 17804</refsect1> 17805<refsect1> 17806<title>Description</title> 17807<para> 17808 Enables input/output pin regardless of any other state. This is 17809 intended for use with microphone bias supplies used in microphone 17810 jack detection. 17811</para> 17812</refsect1> 17813<refsect1> 17814<title>NOTE</title> 17815<para> 17816 <function>snd_soc_dapm_sync</function> needs to be called after this for DAPM to 17817 do any widget power switching. 17818</para> 17819</refsect1> 17820</refentry> 17821 17822<refentry id="API-snd-soc-dapm-disable-pin-unlocked"> 17823<refentryinfo> 17824 <title>LINUX</title> 17825 <productname>Kernel Hackers Manual</productname> 17826 <date>July 2017</date> 17827</refentryinfo> 17828<refmeta> 17829 <refentrytitle><phrase>snd_soc_dapm_disable_pin_unlocked</phrase></refentrytitle> 17830 <manvolnum>9</manvolnum> 17831 <refmiscinfo class="version">4.1.27</refmiscinfo> 17832</refmeta> 17833<refnamediv> 17834 <refname>snd_soc_dapm_disable_pin_unlocked</refname> 17835 <refpurpose> 17836 disable pin. 17837 </refpurpose> 17838</refnamediv> 17839<refsynopsisdiv> 17840 <title>Synopsis</title> 17841 <funcsynopsis><funcprototype> 17842 <funcdef>int <function>snd_soc_dapm_disable_pin_unlocked </function></funcdef> 17843 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 17844 <paramdef>const char * <parameter>pin</parameter></paramdef> 17845 </funcprototype></funcsynopsis> 17846</refsynopsisdiv> 17847<refsect1> 17848 <title>Arguments</title> 17849 <variablelist> 17850 <varlistentry> 17851 <term><parameter>dapm</parameter></term> 17852 <listitem> 17853 <para> 17854 DAPM context 17855 </para> 17856 </listitem> 17857 </varlistentry> 17858 <varlistentry> 17859 <term><parameter>pin</parameter></term> 17860 <listitem> 17861 <para> 17862 pin name 17863 </para> 17864 </listitem> 17865 </varlistentry> 17866 </variablelist> 17867</refsect1> 17868<refsect1> 17869<title>Description</title> 17870<para> 17871 Disables input/output pin and its parents or children widgets. 17872 </para><para> 17873 17874 Requires external locking. 17875</para> 17876</refsect1> 17877<refsect1> 17878<title>NOTE</title> 17879<para> 17880 <function>snd_soc_dapm_sync</function> needs to be called after this for DAPM to 17881 do any widget power switching. 17882</para> 17883</refsect1> 17884</refentry> 17885 17886<refentry id="API-snd-soc-dapm-disable-pin"> 17887<refentryinfo> 17888 <title>LINUX</title> 17889 <productname>Kernel Hackers Manual</productname> 17890 <date>July 2017</date> 17891</refentryinfo> 17892<refmeta> 17893 <refentrytitle><phrase>snd_soc_dapm_disable_pin</phrase></refentrytitle> 17894 <manvolnum>9</manvolnum> 17895 <refmiscinfo class="version">4.1.27</refmiscinfo> 17896</refmeta> 17897<refnamediv> 17898 <refname>snd_soc_dapm_disable_pin</refname> 17899 <refpurpose> 17900 disable pin. 17901 </refpurpose> 17902</refnamediv> 17903<refsynopsisdiv> 17904 <title>Synopsis</title> 17905 <funcsynopsis><funcprototype> 17906 <funcdef>int <function>snd_soc_dapm_disable_pin </function></funcdef> 17907 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 17908 <paramdef>const char * <parameter>pin</parameter></paramdef> 17909 </funcprototype></funcsynopsis> 17910</refsynopsisdiv> 17911<refsect1> 17912 <title>Arguments</title> 17913 <variablelist> 17914 <varlistentry> 17915 <term><parameter>dapm</parameter></term> 17916 <listitem> 17917 <para> 17918 DAPM context 17919 </para> 17920 </listitem> 17921 </varlistentry> 17922 <varlistentry> 17923 <term><parameter>pin</parameter></term> 17924 <listitem> 17925 <para> 17926 pin name 17927 </para> 17928 </listitem> 17929 </varlistentry> 17930 </variablelist> 17931</refsect1> 17932<refsect1> 17933<title>Description</title> 17934<para> 17935 Disables input/output pin and its parents or children widgets. 17936</para> 17937</refsect1> 17938<refsect1> 17939<title>NOTE</title> 17940<para> 17941 <function>snd_soc_dapm_sync</function> needs to be called after this for DAPM to 17942 do any widget power switching. 17943</para> 17944</refsect1> 17945</refentry> 17946 17947<refentry id="API-snd-soc-dapm-nc-pin-unlocked"> 17948<refentryinfo> 17949 <title>LINUX</title> 17950 <productname>Kernel Hackers Manual</productname> 17951 <date>July 2017</date> 17952</refentryinfo> 17953<refmeta> 17954 <refentrytitle><phrase>snd_soc_dapm_nc_pin_unlocked</phrase></refentrytitle> 17955 <manvolnum>9</manvolnum> 17956 <refmiscinfo class="version">4.1.27</refmiscinfo> 17957</refmeta> 17958<refnamediv> 17959 <refname>snd_soc_dapm_nc_pin_unlocked</refname> 17960 <refpurpose> 17961 permanently disable pin. 17962 </refpurpose> 17963</refnamediv> 17964<refsynopsisdiv> 17965 <title>Synopsis</title> 17966 <funcsynopsis><funcprototype> 17967 <funcdef>int <function>snd_soc_dapm_nc_pin_unlocked </function></funcdef> 17968 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 17969 <paramdef>const char * <parameter>pin</parameter></paramdef> 17970 </funcprototype></funcsynopsis> 17971</refsynopsisdiv> 17972<refsect1> 17973 <title>Arguments</title> 17974 <variablelist> 17975 <varlistentry> 17976 <term><parameter>dapm</parameter></term> 17977 <listitem> 17978 <para> 17979 DAPM context 17980 </para> 17981 </listitem> 17982 </varlistentry> 17983 <varlistentry> 17984 <term><parameter>pin</parameter></term> 17985 <listitem> 17986 <para> 17987 pin name 17988 </para> 17989 </listitem> 17990 </varlistentry> 17991 </variablelist> 17992</refsect1> 17993<refsect1> 17994<title>Description</title> 17995<para> 17996 Marks the specified pin as being not connected, disabling it along 17997 any parent or child widgets. At present this is identical to 17998 <function>snd_soc_dapm_disable_pin</function> but in future it will be extended to do 17999 additional things such as disabling controls which only affect 18000 paths through the pin. 18001 </para><para> 18002 18003 Requires external locking. 18004</para> 18005</refsect1> 18006<refsect1> 18007<title>NOTE</title> 18008<para> 18009 <function>snd_soc_dapm_sync</function> needs to be called after this for DAPM to 18010 do any widget power switching. 18011</para> 18012</refsect1> 18013</refentry> 18014 18015<refentry id="API-snd-soc-dapm-nc-pin"> 18016<refentryinfo> 18017 <title>LINUX</title> 18018 <productname>Kernel Hackers Manual</productname> 18019 <date>July 2017</date> 18020</refentryinfo> 18021<refmeta> 18022 <refentrytitle><phrase>snd_soc_dapm_nc_pin</phrase></refentrytitle> 18023 <manvolnum>9</manvolnum> 18024 <refmiscinfo class="version">4.1.27</refmiscinfo> 18025</refmeta> 18026<refnamediv> 18027 <refname>snd_soc_dapm_nc_pin</refname> 18028 <refpurpose> 18029 permanently disable pin. 18030 </refpurpose> 18031</refnamediv> 18032<refsynopsisdiv> 18033 <title>Synopsis</title> 18034 <funcsynopsis><funcprototype> 18035 <funcdef>int <function>snd_soc_dapm_nc_pin </function></funcdef> 18036 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 18037 <paramdef>const char * <parameter>pin</parameter></paramdef> 18038 </funcprototype></funcsynopsis> 18039</refsynopsisdiv> 18040<refsect1> 18041 <title>Arguments</title> 18042 <variablelist> 18043 <varlistentry> 18044 <term><parameter>dapm</parameter></term> 18045 <listitem> 18046 <para> 18047 DAPM context 18048 </para> 18049 </listitem> 18050 </varlistentry> 18051 <varlistentry> 18052 <term><parameter>pin</parameter></term> 18053 <listitem> 18054 <para> 18055 pin name 18056 </para> 18057 </listitem> 18058 </varlistentry> 18059 </variablelist> 18060</refsect1> 18061<refsect1> 18062<title>Description</title> 18063<para> 18064 Marks the specified pin as being not connected, disabling it along 18065 any parent or child widgets. At present this is identical to 18066 <function>snd_soc_dapm_disable_pin</function> but in future it will be extended to do 18067 additional things such as disabling controls which only affect 18068 paths through the pin. 18069</para> 18070</refsect1> 18071<refsect1> 18072<title>NOTE</title> 18073<para> 18074 <function>snd_soc_dapm_sync</function> needs to be called after this for DAPM to 18075 do any widget power switching. 18076</para> 18077</refsect1> 18078</refentry> 18079 18080<refentry id="API-snd-soc-dapm-get-pin-status"> 18081<refentryinfo> 18082 <title>LINUX</title> 18083 <productname>Kernel Hackers Manual</productname> 18084 <date>July 2017</date> 18085</refentryinfo> 18086<refmeta> 18087 <refentrytitle><phrase>snd_soc_dapm_get_pin_status</phrase></refentrytitle> 18088 <manvolnum>9</manvolnum> 18089 <refmiscinfo class="version">4.1.27</refmiscinfo> 18090</refmeta> 18091<refnamediv> 18092 <refname>snd_soc_dapm_get_pin_status</refname> 18093 <refpurpose> 18094 get audio pin status 18095 </refpurpose> 18096</refnamediv> 18097<refsynopsisdiv> 18098 <title>Synopsis</title> 18099 <funcsynopsis><funcprototype> 18100 <funcdef>int <function>snd_soc_dapm_get_pin_status </function></funcdef> 18101 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 18102 <paramdef>const char * <parameter>pin</parameter></paramdef> 18103 </funcprototype></funcsynopsis> 18104</refsynopsisdiv> 18105<refsect1> 18106 <title>Arguments</title> 18107 <variablelist> 18108 <varlistentry> 18109 <term><parameter>dapm</parameter></term> 18110 <listitem> 18111 <para> 18112 DAPM context 18113 </para> 18114 </listitem> 18115 </varlistentry> 18116 <varlistentry> 18117 <term><parameter>pin</parameter></term> 18118 <listitem> 18119 <para> 18120 audio signal pin endpoint (or start point) 18121 </para> 18122 </listitem> 18123 </varlistentry> 18124 </variablelist> 18125</refsect1> 18126<refsect1> 18127<title>Description</title> 18128<para> 18129 Get audio pin status - connected or disconnected. 18130 </para><para> 18131 18132 Returns 1 for connected otherwise 0. 18133</para> 18134</refsect1> 18135</refentry> 18136 18137<refentry id="API-snd-soc-dapm-ignore-suspend"> 18138<refentryinfo> 18139 <title>LINUX</title> 18140 <productname>Kernel Hackers Manual</productname> 18141 <date>July 2017</date> 18142</refentryinfo> 18143<refmeta> 18144 <refentrytitle><phrase>snd_soc_dapm_ignore_suspend</phrase></refentrytitle> 18145 <manvolnum>9</manvolnum> 18146 <refmiscinfo class="version">4.1.27</refmiscinfo> 18147</refmeta> 18148<refnamediv> 18149 <refname>snd_soc_dapm_ignore_suspend</refname> 18150 <refpurpose> 18151 ignore suspend status for DAPM endpoint 18152 </refpurpose> 18153</refnamediv> 18154<refsynopsisdiv> 18155 <title>Synopsis</title> 18156 <funcsynopsis><funcprototype> 18157 <funcdef>int <function>snd_soc_dapm_ignore_suspend </function></funcdef> 18158 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 18159 <paramdef>const char * <parameter>pin</parameter></paramdef> 18160 </funcprototype></funcsynopsis> 18161</refsynopsisdiv> 18162<refsect1> 18163 <title>Arguments</title> 18164 <variablelist> 18165 <varlistentry> 18166 <term><parameter>dapm</parameter></term> 18167 <listitem> 18168 <para> 18169 DAPM context 18170 </para> 18171 </listitem> 18172 </varlistentry> 18173 <varlistentry> 18174 <term><parameter>pin</parameter></term> 18175 <listitem> 18176 <para> 18177 audio signal pin endpoint (or start point) 18178 </para> 18179 </listitem> 18180 </varlistentry> 18181 </variablelist> 18182</refsect1> 18183<refsect1> 18184<title>Description</title> 18185<para> 18186 Mark the given endpoint or pin as ignoring suspend. When the 18187 system is disabled a path between two endpoints flagged as ignoring 18188 suspend will not be disabled. The path must already be enabled via 18189 normal means at suspend time, it will not be turned on if it was not 18190 already enabled. 18191</para> 18192</refsect1> 18193</refentry> 18194 18195<refentry id="API-snd-soc-dapm-free"> 18196<refentryinfo> 18197 <title>LINUX</title> 18198 <productname>Kernel Hackers Manual</productname> 18199 <date>July 2017</date> 18200</refentryinfo> 18201<refmeta> 18202 <refentrytitle><phrase>snd_soc_dapm_free</phrase></refentrytitle> 18203 <manvolnum>9</manvolnum> 18204 <refmiscinfo class="version">4.1.27</refmiscinfo> 18205</refmeta> 18206<refnamediv> 18207 <refname>snd_soc_dapm_free</refname> 18208 <refpurpose> 18209 free dapm resources 18210 </refpurpose> 18211</refnamediv> 18212<refsynopsisdiv> 18213 <title>Synopsis</title> 18214 <funcsynopsis><funcprototype> 18215 <funcdef>void <function>snd_soc_dapm_free </function></funcdef> 18216 <paramdef>struct snd_soc_dapm_context * <parameter>dapm</parameter></paramdef> 18217 </funcprototype></funcsynopsis> 18218</refsynopsisdiv> 18219<refsect1> 18220 <title>Arguments</title> 18221 <variablelist> 18222 <varlistentry> 18223 <term><parameter>dapm</parameter></term> 18224 <listitem> 18225 <para> 18226 DAPM context 18227 </para> 18228 </listitem> 18229 </varlistentry> 18230 </variablelist> 18231</refsect1> 18232<refsect1> 18233<title>Description</title> 18234<para> 18235 Free all dapm widgets and resources. 18236</para> 18237</refsect1> 18238</refentry> 18239 18240 </sect1> 18241 <sect1><title>ASoC DMA Engine API</title> 18242<!-- sound/soc/soc-generic-dmaengine-pcm.c --> 18243<refentry id="API-snd-dmaengine-pcm-prepare-slave-config"> 18244<refentryinfo> 18245 <title>LINUX</title> 18246 <productname>Kernel Hackers Manual</productname> 18247 <date>July 2017</date> 18248</refentryinfo> 18249<refmeta> 18250 <refentrytitle><phrase>snd_dmaengine_pcm_prepare_slave_config</phrase></refentrytitle> 18251 <manvolnum>9</manvolnum> 18252 <refmiscinfo class="version">4.1.27</refmiscinfo> 18253</refmeta> 18254<refnamediv> 18255 <refname>snd_dmaengine_pcm_prepare_slave_config</refname> 18256 <refpurpose> 18257 Generic prepare_slave_config callback 18258 </refpurpose> 18259</refnamediv> 18260<refsynopsisdiv> 18261 <title>Synopsis</title> 18262 <funcsynopsis><funcprototype> 18263 <funcdef>int <function>snd_dmaengine_pcm_prepare_slave_config </function></funcdef> 18264 <paramdef>struct snd_pcm_substream * <parameter>substream</parameter></paramdef> 18265 <paramdef>struct snd_pcm_hw_params * <parameter>params</parameter></paramdef> 18266 <paramdef>struct dma_slave_config * <parameter>slave_config</parameter></paramdef> 18267 </funcprototype></funcsynopsis> 18268</refsynopsisdiv> 18269<refsect1> 18270 <title>Arguments</title> 18271 <variablelist> 18272 <varlistentry> 18273 <term><parameter>substream</parameter></term> 18274 <listitem> 18275 <para> 18276 PCM substream 18277 </para> 18278 </listitem> 18279 </varlistentry> 18280 <varlistentry> 18281 <term><parameter>params</parameter></term> 18282 <listitem> 18283 <para> 18284 hw_params 18285 </para> 18286 </listitem> 18287 </varlistentry> 18288 <varlistentry> 18289 <term><parameter>slave_config</parameter></term> 18290 <listitem> 18291 <para> 18292 DMA slave config to prepare 18293 </para> 18294 </listitem> 18295 </varlistentry> 18296 </variablelist> 18297</refsect1> 18298<refsect1> 18299<title>Description</title> 18300<para> 18301 This function can be used as a generic prepare_slave_config callback for 18302 platforms which make use of the snd_dmaengine_dai_dma_data struct for their 18303 DAI DMA data. Internally the function will first call 18304 snd_hwparams_to_dma_slave_config to fill in the slave config based on the 18305 hw_params, followed by snd_dmaengine_set_config_from_dai_data to fill in the 18306 remaining fields based on the DAI DMA data. 18307</para> 18308</refsect1> 18309</refentry> 18310 18311<refentry id="API-snd-dmaengine-pcm-register"> 18312<refentryinfo> 18313 <title>LINUX</title> 18314 <productname>Kernel Hackers Manual</productname> 18315 <date>July 2017</date> 18316</refentryinfo> 18317<refmeta> 18318 <refentrytitle><phrase>snd_dmaengine_pcm_register</phrase></refentrytitle> 18319 <manvolnum>9</manvolnum> 18320 <refmiscinfo class="version">4.1.27</refmiscinfo> 18321</refmeta> 18322<refnamediv> 18323 <refname>snd_dmaengine_pcm_register</refname> 18324 <refpurpose> 18325 Register a dmaengine based PCM device 18326 </refpurpose> 18327</refnamediv> 18328<refsynopsisdiv> 18329 <title>Synopsis</title> 18330 <funcsynopsis><funcprototype> 18331 <funcdef>int <function>snd_dmaengine_pcm_register </function></funcdef> 18332 <paramdef>struct device * <parameter>dev</parameter></paramdef> 18333 <paramdef>const struct snd_dmaengine_pcm_config * <parameter>config</parameter></paramdef> 18334 <paramdef>unsigned int <parameter>flags</parameter></paramdef> 18335 </funcprototype></funcsynopsis> 18336</refsynopsisdiv> 18337<refsect1> 18338 <title>Arguments</title> 18339 <variablelist> 18340 <varlistentry> 18341 <term><parameter>dev</parameter></term> 18342 <listitem> 18343 <para> 18344 The parent device for the PCM device 18345 </para> 18346 </listitem> 18347 </varlistentry> 18348 <varlistentry> 18349 <term><parameter>config</parameter></term> 18350 <listitem> 18351 <para> 18352 Platform specific PCM configuration 18353 </para> 18354 </listitem> 18355 </varlistentry> 18356 <varlistentry> 18357 <term><parameter>flags</parameter></term> 18358 <listitem> 18359 <para> 18360 Platform specific quirks 18361 </para> 18362 </listitem> 18363 </varlistentry> 18364 </variablelist> 18365</refsect1> 18366</refentry> 18367 18368<refentry id="API-snd-dmaengine-pcm-unregister"> 18369<refentryinfo> 18370 <title>LINUX</title> 18371 <productname>Kernel Hackers Manual</productname> 18372 <date>July 2017</date> 18373</refentryinfo> 18374<refmeta> 18375 <refentrytitle><phrase>snd_dmaengine_pcm_unregister</phrase></refentrytitle> 18376 <manvolnum>9</manvolnum> 18377 <refmiscinfo class="version">4.1.27</refmiscinfo> 18378</refmeta> 18379<refnamediv> 18380 <refname>snd_dmaengine_pcm_unregister</refname> 18381 <refpurpose> 18382 Removes a dmaengine based PCM device 18383 </refpurpose> 18384</refnamediv> 18385<refsynopsisdiv> 18386 <title>Synopsis</title> 18387 <funcsynopsis><funcprototype> 18388 <funcdef>void <function>snd_dmaengine_pcm_unregister </function></funcdef> 18389 <paramdef>struct device * <parameter>dev</parameter></paramdef> 18390 </funcprototype></funcsynopsis> 18391</refsynopsisdiv> 18392<refsect1> 18393 <title>Arguments</title> 18394 <variablelist> 18395 <varlistentry> 18396 <term><parameter>dev</parameter></term> 18397 <listitem> 18398 <para> 18399 Parent device the PCM was register with 18400 </para> 18401 </listitem> 18402 </varlistentry> 18403 </variablelist> 18404</refsect1> 18405<refsect1> 18406<title>Description</title> 18407<para> 18408 Removes a dmaengine based PCM device previously registered with 18409 snd_dmaengine_pcm_register. 18410</para> 18411</refsect1> 18412</refentry> 18413 18414 </sect1> 18415 </chapter> 18416 <chapter><title>Miscellaneous Functions</title> 18417 <sect1><title>Hardware-Dependent Devices API</title> 18418<!-- sound/core/hwdep.c --> 18419<refentry id="API-snd-hwdep-new"> 18420<refentryinfo> 18421 <title>LINUX</title> 18422 <productname>Kernel Hackers Manual</productname> 18423 <date>July 2017</date> 18424</refentryinfo> 18425<refmeta> 18426 <refentrytitle><phrase>snd_hwdep_new</phrase></refentrytitle> 18427 <manvolnum>9</manvolnum> 18428 <refmiscinfo class="version">4.1.27</refmiscinfo> 18429</refmeta> 18430<refnamediv> 18431 <refname>snd_hwdep_new</refname> 18432 <refpurpose> 18433 create a new hwdep instance 18434 </refpurpose> 18435</refnamediv> 18436<refsynopsisdiv> 18437 <title>Synopsis</title> 18438 <funcsynopsis><funcprototype> 18439 <funcdef>int <function>snd_hwdep_new </function></funcdef> 18440 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 18441 <paramdef>char * <parameter>id</parameter></paramdef> 18442 <paramdef>int <parameter>device</parameter></paramdef> 18443 <paramdef>struct snd_hwdep ** <parameter>rhwdep</parameter></paramdef> 18444 </funcprototype></funcsynopsis> 18445</refsynopsisdiv> 18446<refsect1> 18447 <title>Arguments</title> 18448 <variablelist> 18449 <varlistentry> 18450 <term><parameter>card</parameter></term> 18451 <listitem> 18452 <para> 18453 the card instance 18454 </para> 18455 </listitem> 18456 </varlistentry> 18457 <varlistentry> 18458 <term><parameter>id</parameter></term> 18459 <listitem> 18460 <para> 18461 the id string 18462 </para> 18463 </listitem> 18464 </varlistentry> 18465 <varlistentry> 18466 <term><parameter>device</parameter></term> 18467 <listitem> 18468 <para> 18469 the device index (zero-based) 18470 </para> 18471 </listitem> 18472 </varlistentry> 18473 <varlistentry> 18474 <term><parameter>rhwdep</parameter></term> 18475 <listitem> 18476 <para> 18477 the pointer to store the new hwdep instance 18478 </para> 18479 </listitem> 18480 </varlistentry> 18481 </variablelist> 18482</refsect1> 18483<refsect1> 18484<title>Description</title> 18485<para> 18486 Creates a new hwdep instance with the given index on the card. 18487 The callbacks (hwdep->ops) must be set on the returned instance 18488 after this call manually by the caller. 18489</para> 18490</refsect1> 18491<refsect1> 18492<title>Return</title> 18493<para> 18494 Zero if successful, or a negative error code on failure. 18495</para> 18496</refsect1> 18497</refentry> 18498 18499 </sect1> 18500 <sect1><title>Jack Abstraction Layer API</title> 18501<!-- include/sound/jack.h --> 18502<refentry id="API-enum-snd-jack-types"> 18503<refentryinfo> 18504 <title>LINUX</title> 18505 <productname>Kernel Hackers Manual</productname> 18506 <date>July 2017</date> 18507</refentryinfo> 18508<refmeta> 18509 <refentrytitle><phrase>enum snd_jack_types</phrase></refentrytitle> 18510 <manvolnum>9</manvolnum> 18511 <refmiscinfo class="version">4.1.27</refmiscinfo> 18512</refmeta> 18513<refnamediv> 18514 <refname>enum snd_jack_types</refname> 18515 <refpurpose> 18516 Jack types which can be reported 18517 </refpurpose> 18518</refnamediv> 18519<refsynopsisdiv> 18520 <title>Synopsis</title> 18521 <programlisting> 18522enum snd_jack_types { 18523 SND_JACK_HEADPHONE, 18524 SND_JACK_MICROPHONE, 18525 SND_JACK_HEADSET, 18526 SND_JACK_LINEOUT, 18527 SND_JACK_MECHANICAL, 18528 SND_JACK_VIDEOOUT, 18529 SND_JACK_AVOUT, 18530 SND_JACK_LINEIN, 18531 SND_JACK_BTN_0, 18532 SND_JACK_BTN_1, 18533 SND_JACK_BTN_2, 18534 SND_JACK_BTN_3, 18535 SND_JACK_BTN_4, 18536 SND_JACK_BTN_5 18537}; </programlisting> 18538</refsynopsisdiv> 18539<refsect1> 18540 <title>Constants</title> 18541 <variablelist> 18542 <varlistentry> <term>SND_JACK_HEADPHONE</term> 18543 <listitem><para> 18544Headphone 18545 </para></listitem> 18546 </varlistentry> 18547 <varlistentry> <term>SND_JACK_MICROPHONE</term> 18548 <listitem><para> 18549Microphone 18550 </para></listitem> 18551 </varlistentry> 18552 <varlistentry> <term>SND_JACK_HEADSET</term> 18553 <listitem><para> 18554Headset 18555 </para></listitem> 18556 </varlistentry> 18557 <varlistentry> <term>SND_JACK_LINEOUT</term> 18558 <listitem><para> 18559Line out 18560 </para></listitem> 18561 </varlistentry> 18562 <varlistentry> <term>SND_JACK_MECHANICAL</term> 18563 <listitem><para> 18564Mechanical switch 18565 </para></listitem> 18566 </varlistentry> 18567 <varlistentry> <term>SND_JACK_VIDEOOUT</term> 18568 <listitem><para> 18569Video out 18570 </para></listitem> 18571 </varlistentry> 18572 <varlistentry> <term>SND_JACK_AVOUT</term> 18573 <listitem><para> 18574AV (Audio Video) out 18575 </para></listitem> 18576 </varlistentry> 18577 <varlistentry> <term>SND_JACK_LINEIN</term> 18578 <listitem><para> 18579Line in 18580 </para></listitem> 18581 </varlistentry> 18582 <varlistentry> <term>SND_JACK_BTN_0</term> 18583 <listitem><para> 18584Button 0 18585 </para></listitem> 18586 </varlistentry> 18587 <varlistentry> <term>SND_JACK_BTN_1</term> 18588 <listitem><para> 18589Button 1 18590 </para></listitem> 18591 </varlistentry> 18592 <varlistentry> <term>SND_JACK_BTN_2</term> 18593 <listitem><para> 18594Button 2 18595 </para></listitem> 18596 </varlistentry> 18597 <varlistentry> <term>SND_JACK_BTN_3</term> 18598 <listitem><para> 18599Button 3 18600 </para></listitem> 18601 </varlistentry> 18602 <varlistentry> <term>SND_JACK_BTN_4</term> 18603 <listitem><para> 18604Button 4 18605 </para></listitem> 18606 </varlistentry> 18607 <varlistentry> <term>SND_JACK_BTN_5</term> 18608 <listitem><para> 18609Button 5 18610 </para></listitem> 18611 </varlistentry> 18612 </variablelist> 18613</refsect1> 18614<refsect1> 18615<title>Description</title> 18616<para> 18617 These values are used as a bitmask. 18618 </para><para> 18619 18620 Note that this must be kept in sync with the lookup table in 18621 sound/core/jack.c. 18622</para> 18623</refsect1> 18624</refentry> 18625 18626<!-- sound/core/jack.c --> 18627<refentry id="API-snd-jack-new"> 18628<refentryinfo> 18629 <title>LINUX</title> 18630 <productname>Kernel Hackers Manual</productname> 18631 <date>July 2017</date> 18632</refentryinfo> 18633<refmeta> 18634 <refentrytitle><phrase>snd_jack_new</phrase></refentrytitle> 18635 <manvolnum>9</manvolnum> 18636 <refmiscinfo class="version">4.1.27</refmiscinfo> 18637</refmeta> 18638<refnamediv> 18639 <refname>snd_jack_new</refname> 18640 <refpurpose> 18641 Create a new jack 18642 </refpurpose> 18643</refnamediv> 18644<refsynopsisdiv> 18645 <title>Synopsis</title> 18646 <funcsynopsis><funcprototype> 18647 <funcdef>int <function>snd_jack_new </function></funcdef> 18648 <paramdef>struct snd_card * <parameter>card</parameter></paramdef> 18649 <paramdef>const char * <parameter>id</parameter></paramdef> 18650 <paramdef>int <parameter>type</parameter></paramdef> 18651 <paramdef>struct snd_jack ** <parameter>jjack</parameter></paramdef> 18652 </funcprototype></funcsynopsis> 18653</refsynopsisdiv> 18654<refsect1> 18655 <title>Arguments</title> 18656 <variablelist> 18657 <varlistentry> 18658 <term><parameter>card</parameter></term> 18659 <listitem> 18660 <para> 18661 the card instance 18662 </para> 18663 </listitem> 18664 </varlistentry> 18665 <varlistentry> 18666 <term><parameter>id</parameter></term> 18667 <listitem> 18668 <para> 18669 an identifying string for this jack 18670 </para> 18671 </listitem> 18672 </varlistentry> 18673 <varlistentry> 18674 <term><parameter>type</parameter></term> 18675 <listitem> 18676 <para> 18677 a bitmask of enum snd_jack_type values that can be detected by 18678 this jack 18679 </para> 18680 </listitem> 18681 </varlistentry> 18682 <varlistentry> 18683 <term><parameter>jjack</parameter></term> 18684 <listitem> 18685 <para> 18686 Used to provide the allocated jack object to the caller. 18687 </para> 18688 </listitem> 18689 </varlistentry> 18690 </variablelist> 18691</refsect1> 18692<refsect1> 18693<title>Description</title> 18694<para> 18695 Creates a new jack object. 18696</para> 18697</refsect1> 18698<refsect1> 18699<title>Return</title> 18700<para> 18701 Zero if successful, or a negative error code on failure. 18702 On success <parameter>jjack</parameter> will be initialised. 18703</para> 18704</refsect1> 18705</refentry> 18706 18707<refentry id="API-snd-jack-set-parent"> 18708<refentryinfo> 18709 <title>LINUX</title> 18710 <productname>Kernel Hackers Manual</productname> 18711 <date>July 2017</date> 18712</refentryinfo> 18713<refmeta> 18714 <refentrytitle><phrase>snd_jack_set_parent</phrase></refentrytitle> 18715 <manvolnum>9</manvolnum> 18716 <refmiscinfo class="version">4.1.27</refmiscinfo> 18717</refmeta> 18718<refnamediv> 18719 <refname>snd_jack_set_parent</refname> 18720 <refpurpose> 18721 Set the parent device for a jack 18722 </refpurpose> 18723</refnamediv> 18724<refsynopsisdiv> 18725 <title>Synopsis</title> 18726 <funcsynopsis><funcprototype> 18727 <funcdef>void <function>snd_jack_set_parent </function></funcdef> 18728 <paramdef>struct snd_jack * <parameter>jack</parameter></paramdef> 18729 <paramdef>struct device * <parameter>parent</parameter></paramdef> 18730 </funcprototype></funcsynopsis> 18731</refsynopsisdiv> 18732<refsect1> 18733 <title>Arguments</title> 18734 <variablelist> 18735 <varlistentry> 18736 <term><parameter>jack</parameter></term> 18737 <listitem> 18738 <para> 18739 The jack to configure 18740 </para> 18741 </listitem> 18742 </varlistentry> 18743 <varlistentry> 18744 <term><parameter>parent</parameter></term> 18745 <listitem> 18746 <para> 18747 The device to set as parent for the jack. 18748 </para> 18749 </listitem> 18750 </varlistentry> 18751 </variablelist> 18752</refsect1> 18753<refsect1> 18754<title>Description</title> 18755<para> 18756 Set the parent for the jack devices in the device tree. This 18757 function is only valid prior to registration of the jack. If no 18758 parent is configured then the parent device will be the sound card. 18759</para> 18760</refsect1> 18761</refentry> 18762 18763<refentry id="API-snd-jack-set-key"> 18764<refentryinfo> 18765 <title>LINUX</title> 18766 <productname>Kernel Hackers Manual</productname> 18767 <date>July 2017</date> 18768</refentryinfo> 18769<refmeta> 18770 <refentrytitle><phrase>snd_jack_set_key</phrase></refentrytitle> 18771 <manvolnum>9</manvolnum> 18772 <refmiscinfo class="version">4.1.27</refmiscinfo> 18773</refmeta> 18774<refnamediv> 18775 <refname>snd_jack_set_key</refname> 18776 <refpurpose> 18777 Set a key mapping on a jack 18778 </refpurpose> 18779</refnamediv> 18780<refsynopsisdiv> 18781 <title>Synopsis</title> 18782 <funcsynopsis><funcprototype> 18783 <funcdef>int <function>snd_jack_set_key </function></funcdef> 18784 <paramdef>struct snd_jack * <parameter>jack</parameter></paramdef> 18785 <paramdef>enum snd_jack_types <parameter>type</parameter></paramdef> 18786 <paramdef>int <parameter>keytype</parameter></paramdef> 18787 </funcprototype></funcsynopsis> 18788</refsynopsisdiv> 18789<refsect1> 18790 <title>Arguments</title> 18791 <variablelist> 18792 <varlistentry> 18793 <term><parameter>jack</parameter></term> 18794 <listitem> 18795 <para> 18796 The jack to configure 18797 </para> 18798 </listitem> 18799 </varlistentry> 18800 <varlistentry> 18801 <term><parameter>type</parameter></term> 18802 <listitem> 18803 <para> 18804 Jack report type for this key 18805 </para> 18806 </listitem> 18807 </varlistentry> 18808 <varlistentry> 18809 <term><parameter>keytype</parameter></term> 18810 <listitem> 18811 <para> 18812 Input layer key type to be reported 18813 </para> 18814 </listitem> 18815 </varlistentry> 18816 </variablelist> 18817</refsect1> 18818<refsect1> 18819<title>Description</title> 18820<para> 18821 Map a SND_JACK_BTN_ button type to an input layer key, allowing 18822 reporting of keys on accessories via the jack abstraction. If no 18823 mapping is provided but keys are enabled in the jack type then 18824 BTN_n numeric buttons will be reported. 18825 </para><para> 18826 18827 If jacks are not reporting via the input API this call will have no 18828 effect. 18829 </para><para> 18830 18831 Note that this is intended to be use by simple devices with small 18832 numbers of keys that can be reported. It is also possible to 18833 access the input device directly - devices with complex input 18834 capabilities on accessories should consider doing this rather than 18835 using this abstraction. 18836 </para><para> 18837 18838 This function may only be called prior to registration of the jack. 18839</para> 18840</refsect1> 18841<refsect1> 18842<title>Return</title> 18843<para> 18844 Zero if successful, or a negative error code on failure. 18845</para> 18846</refsect1> 18847</refentry> 18848 18849<refentry id="API-snd-jack-report"> 18850<refentryinfo> 18851 <title>LINUX</title> 18852 <productname>Kernel Hackers Manual</productname> 18853 <date>July 2017</date> 18854</refentryinfo> 18855<refmeta> 18856 <refentrytitle><phrase>snd_jack_report</phrase></refentrytitle> 18857 <manvolnum>9</manvolnum> 18858 <refmiscinfo class="version">4.1.27</refmiscinfo> 18859</refmeta> 18860<refnamediv> 18861 <refname>snd_jack_report</refname> 18862 <refpurpose> 18863 Report the current status of a jack 18864 </refpurpose> 18865</refnamediv> 18866<refsynopsisdiv> 18867 <title>Synopsis</title> 18868 <funcsynopsis><funcprototype> 18869 <funcdef>void <function>snd_jack_report </function></funcdef> 18870 <paramdef>struct snd_jack * <parameter>jack</parameter></paramdef> 18871 <paramdef>int <parameter>status</parameter></paramdef> 18872 </funcprototype></funcsynopsis> 18873</refsynopsisdiv> 18874<refsect1> 18875 <title>Arguments</title> 18876 <variablelist> 18877 <varlistentry> 18878 <term><parameter>jack</parameter></term> 18879 <listitem> 18880 <para> 18881 The jack to report status for 18882 </para> 18883 </listitem> 18884 </varlistentry> 18885 <varlistentry> 18886 <term><parameter>status</parameter></term> 18887 <listitem> 18888 <para> 18889 The current status of the jack 18890 </para> 18891 </listitem> 18892 </varlistentry> 18893 </variablelist> 18894</refsect1> 18895</refentry> 18896 18897<!-- sound/soc/soc-jack.c --> 18898<refentry id="API-snd-soc-card-jack-new"> 18899<refentryinfo> 18900 <title>LINUX</title> 18901 <productname>Kernel Hackers Manual</productname> 18902 <date>July 2017</date> 18903</refentryinfo> 18904<refmeta> 18905 <refentrytitle><phrase>snd_soc_card_jack_new</phrase></refentrytitle> 18906 <manvolnum>9</manvolnum> 18907 <refmiscinfo class="version">4.1.27</refmiscinfo> 18908</refmeta> 18909<refnamediv> 18910 <refname>snd_soc_card_jack_new</refname> 18911 <refpurpose> 18912 Create a new jack 18913 </refpurpose> 18914</refnamediv> 18915<refsynopsisdiv> 18916 <title>Synopsis</title> 18917 <funcsynopsis><funcprototype> 18918 <funcdef>int <function>snd_soc_card_jack_new </function></funcdef> 18919 <paramdef>struct snd_soc_card * <parameter>card</parameter></paramdef> 18920 <paramdef>const char * <parameter>id</parameter></paramdef> 18921 <paramdef>int <parameter>type</parameter></paramdef> 18922 <paramdef>struct snd_soc_jack * <parameter>jack</parameter></paramdef> 18923 <paramdef>struct snd_soc_jack_pin * <parameter>pins</parameter></paramdef> 18924 <paramdef>unsigned int <parameter>num_pins</parameter></paramdef> 18925 </funcprototype></funcsynopsis> 18926</refsynopsisdiv> 18927<refsect1> 18928 <title>Arguments</title> 18929 <variablelist> 18930 <varlistentry> 18931 <term><parameter>card</parameter></term> 18932 <listitem> 18933 <para> 18934 ASoC card 18935 </para> 18936 </listitem> 18937 </varlistentry> 18938 <varlistentry> 18939 <term><parameter>id</parameter></term> 18940 <listitem> 18941 <para> 18942 an identifying string for this jack 18943 </para> 18944 </listitem> 18945 </varlistentry> 18946 <varlistentry> 18947 <term><parameter>type</parameter></term> 18948 <listitem> 18949 <para> 18950 a bitmask of enum snd_jack_type values that can be detected by 18951 this jack 18952 </para> 18953 </listitem> 18954 </varlistentry> 18955 <varlistentry> 18956 <term><parameter>jack</parameter></term> 18957 <listitem> 18958 <para> 18959 structure to use for the jack 18960 </para> 18961 </listitem> 18962 </varlistentry> 18963 <varlistentry> 18964 <term><parameter>pins</parameter></term> 18965 <listitem> 18966 <para> 18967 Array of jack pins to be added to the jack or NULL 18968 </para> 18969 </listitem> 18970 </varlistentry> 18971 <varlistentry> 18972 <term><parameter>num_pins</parameter></term> 18973 <listitem> 18974 <para> 18975 Number of elements in the <parameter>pins</parameter> array 18976 </para> 18977 </listitem> 18978 </varlistentry> 18979 </variablelist> 18980</refsect1> 18981<refsect1> 18982<title>Description</title> 18983<para> 18984 Creates a new jack object. 18985 </para><para> 18986 18987 Returns zero if successful, or a negative error code on failure. 18988 On success jack will be initialised. 18989</para> 18990</refsect1> 18991</refentry> 18992 18993<refentry id="API-snd-soc-jack-report"> 18994<refentryinfo> 18995 <title>LINUX</title> 18996 <productname>Kernel Hackers Manual</productname> 18997 <date>July 2017</date> 18998</refentryinfo> 18999<refmeta> 19000 <refentrytitle><phrase>snd_soc_jack_report</phrase></refentrytitle> 19001 <manvolnum>9</manvolnum> 19002 <refmiscinfo class="version">4.1.27</refmiscinfo> 19003</refmeta> 19004<refnamediv> 19005 <refname>snd_soc_jack_report</refname> 19006 <refpurpose> 19007 Report the current status for a jack 19008 </refpurpose> 19009</refnamediv> 19010<refsynopsisdiv> 19011 <title>Synopsis</title> 19012 <funcsynopsis><funcprototype> 19013 <funcdef>void <function>snd_soc_jack_report </function></funcdef> 19014 <paramdef>struct snd_soc_jack * <parameter>jack</parameter></paramdef> 19015 <paramdef>int <parameter>status</parameter></paramdef> 19016 <paramdef>int <parameter>mask</parameter></paramdef> 19017 </funcprototype></funcsynopsis> 19018</refsynopsisdiv> 19019<refsect1> 19020 <title>Arguments</title> 19021 <variablelist> 19022 <varlistentry> 19023 <term><parameter>jack</parameter></term> 19024 <listitem> 19025 <para> 19026 the jack 19027 </para> 19028 </listitem> 19029 </varlistentry> 19030 <varlistentry> 19031 <term><parameter>status</parameter></term> 19032 <listitem> 19033 <para> 19034 a bitmask of enum snd_jack_type values that are currently detected. 19035 </para> 19036 </listitem> 19037 </varlistentry> 19038 <varlistentry> 19039 <term><parameter>mask</parameter></term> 19040 <listitem> 19041 <para> 19042 a bitmask of enum snd_jack_type values that being reported. 19043 </para> 19044 </listitem> 19045 </varlistentry> 19046 </variablelist> 19047</refsect1> 19048<refsect1> 19049<title>Description</title> 19050<para> 19051 If configured using <function>snd_soc_jack_add_pins</function> then the associated 19052 DAPM pins will be enabled or disabled as appropriate and DAPM 19053 synchronised. 19054</para> 19055</refsect1> 19056<refsect1> 19057<title>Note</title> 19058<para> 19059 This function uses mutexes and should be called from a 19060 context which can sleep (such as a workqueue). 19061</para> 19062</refsect1> 19063</refentry> 19064 19065<refentry id="API-snd-soc-jack-add-zones"> 19066<refentryinfo> 19067 <title>LINUX</title> 19068 <productname>Kernel Hackers Manual</productname> 19069 <date>July 2017</date> 19070</refentryinfo> 19071<refmeta> 19072 <refentrytitle><phrase>snd_soc_jack_add_zones</phrase></refentrytitle> 19073 <manvolnum>9</manvolnum> 19074 <refmiscinfo class="version">4.1.27</refmiscinfo> 19075</refmeta> 19076<refnamediv> 19077 <refname>snd_soc_jack_add_zones</refname> 19078 <refpurpose> 19079 Associate voltage zones with jack 19080 </refpurpose> 19081</refnamediv> 19082<refsynopsisdiv> 19083 <title>Synopsis</title> 19084 <funcsynopsis><funcprototype> 19085 <funcdef>int <function>snd_soc_jack_add_zones </function></funcdef> 19086 <paramdef>struct snd_soc_jack * <parameter>jack</parameter></paramdef> 19087 <paramdef>int <parameter>count</parameter></paramdef> 19088 <paramdef>struct snd_soc_jack_zone * <parameter>zones</parameter></paramdef> 19089 </funcprototype></funcsynopsis> 19090</refsynopsisdiv> 19091<refsect1> 19092 <title>Arguments</title> 19093 <variablelist> 19094 <varlistentry> 19095 <term><parameter>jack</parameter></term> 19096 <listitem> 19097 <para> 19098 ASoC jack 19099 </para> 19100 </listitem> 19101 </varlistentry> 19102 <varlistentry> 19103 <term><parameter>count</parameter></term> 19104 <listitem> 19105 <para> 19106 Number of zones 19107 </para> 19108 </listitem> 19109 </varlistentry> 19110 <varlistentry> 19111 <term><parameter>zones</parameter></term> 19112 <listitem> 19113 <para> 19114 Array of zones 19115 </para> 19116 </listitem> 19117 </varlistentry> 19118 </variablelist> 19119</refsect1> 19120<refsect1> 19121<title>Description</title> 19122<para> 19123 After this function has been called the zones specified in the 19124 array will be associated with the jack. 19125</para> 19126</refsect1> 19127</refentry> 19128 19129<refentry id="API-snd-soc-jack-get-type"> 19130<refentryinfo> 19131 <title>LINUX</title> 19132 <productname>Kernel Hackers Manual</productname> 19133 <date>July 2017</date> 19134</refentryinfo> 19135<refmeta> 19136 <refentrytitle><phrase>snd_soc_jack_get_type</phrase></refentrytitle> 19137 <manvolnum>9</manvolnum> 19138 <refmiscinfo class="version">4.1.27</refmiscinfo> 19139</refmeta> 19140<refnamediv> 19141 <refname>snd_soc_jack_get_type</refname> 19142 <refpurpose> 19143 Based on the mic bias value, this function returns the type of jack from the zones declared in the jack type 19144 </refpurpose> 19145</refnamediv> 19146<refsynopsisdiv> 19147 <title>Synopsis</title> 19148 <funcsynopsis><funcprototype> 19149 <funcdef>int <function>snd_soc_jack_get_type </function></funcdef> 19150 <paramdef>struct snd_soc_jack * <parameter>jack</parameter></paramdef> 19151 <paramdef>int <parameter>micbias_voltage</parameter></paramdef> 19152 </funcprototype></funcsynopsis> 19153</refsynopsisdiv> 19154<refsect1> 19155 <title>Arguments</title> 19156 <variablelist> 19157 <varlistentry> 19158 <term><parameter>jack</parameter></term> 19159 <listitem> 19160 <para> 19161 ASoC jack 19162 </para> 19163 </listitem> 19164 </varlistentry> 19165 <varlistentry> 19166 <term><parameter>micbias_voltage</parameter></term> 19167 <listitem> 19168 <para> 19169 mic bias voltage at adc channel when jack is plugged in 19170 </para> 19171 </listitem> 19172 </varlistentry> 19173 </variablelist> 19174</refsect1> 19175<refsect1> 19176<title>Description</title> 19177<para> 19178 Based on the mic bias value passed, this function helps identify 19179 the type of jack from the already declared jack zones 19180</para> 19181</refsect1> 19182</refentry> 19183 19184<refentry id="API-snd-soc-jack-add-pins"> 19185<refentryinfo> 19186 <title>LINUX</title> 19187 <productname>Kernel Hackers Manual</productname> 19188 <date>July 2017</date> 19189</refentryinfo> 19190<refmeta> 19191 <refentrytitle><phrase>snd_soc_jack_add_pins</phrase></refentrytitle> 19192 <manvolnum>9</manvolnum> 19193 <refmiscinfo class="version">4.1.27</refmiscinfo> 19194</refmeta> 19195<refnamediv> 19196 <refname>snd_soc_jack_add_pins</refname> 19197 <refpurpose> 19198 Associate DAPM pins with an ASoC jack 19199 </refpurpose> 19200</refnamediv> 19201<refsynopsisdiv> 19202 <title>Synopsis</title> 19203 <funcsynopsis><funcprototype> 19204 <funcdef>int <function>snd_soc_jack_add_pins </function></funcdef> 19205 <paramdef>struct snd_soc_jack * <parameter>jack</parameter></paramdef> 19206 <paramdef>int <parameter>count</parameter></paramdef> 19207 <paramdef>struct snd_soc_jack_pin * <parameter>pins</parameter></paramdef> 19208 </funcprototype></funcsynopsis> 19209</refsynopsisdiv> 19210<refsect1> 19211 <title>Arguments</title> 19212 <variablelist> 19213 <varlistentry> 19214 <term><parameter>jack</parameter></term> 19215 <listitem> 19216 <para> 19217 ASoC jack 19218 </para> 19219 </listitem> 19220 </varlistentry> 19221 <varlistentry> 19222 <term><parameter>count</parameter></term> 19223 <listitem> 19224 <para> 19225 Number of pins 19226 </para> 19227 </listitem> 19228 </varlistentry> 19229 <varlistentry> 19230 <term><parameter>pins</parameter></term> 19231 <listitem> 19232 <para> 19233 Array of pins 19234 </para> 19235 </listitem> 19236 </varlistentry> 19237 </variablelist> 19238</refsect1> 19239<refsect1> 19240<title>Description</title> 19241<para> 19242 After this function has been called the DAPM pins specified in the 19243 pins array will have their status updated to reflect the current 19244 state of the jack whenever the jack status is updated. 19245</para> 19246</refsect1> 19247</refentry> 19248 19249<refentry id="API-snd-soc-jack-notifier-register"> 19250<refentryinfo> 19251 <title>LINUX</title> 19252 <productname>Kernel Hackers Manual</productname> 19253 <date>July 2017</date> 19254</refentryinfo> 19255<refmeta> 19256 <refentrytitle><phrase>snd_soc_jack_notifier_register</phrase></refentrytitle> 19257 <manvolnum>9</manvolnum> 19258 <refmiscinfo class="version">4.1.27</refmiscinfo> 19259</refmeta> 19260<refnamediv> 19261 <refname>snd_soc_jack_notifier_register</refname> 19262 <refpurpose> 19263 Register a notifier for jack status 19264 </refpurpose> 19265</refnamediv> 19266<refsynopsisdiv> 19267 <title>Synopsis</title> 19268 <funcsynopsis><funcprototype> 19269 <funcdef>void <function>snd_soc_jack_notifier_register </function></funcdef> 19270 <paramdef>struct snd_soc_jack * <parameter>jack</parameter></paramdef> 19271 <paramdef>struct notifier_block * <parameter>nb</parameter></paramdef> 19272 </funcprototype></funcsynopsis> 19273</refsynopsisdiv> 19274<refsect1> 19275 <title>Arguments</title> 19276 <variablelist> 19277 <varlistentry> 19278 <term><parameter>jack</parameter></term> 19279 <listitem> 19280 <para> 19281 ASoC jack 19282 </para> 19283 </listitem> 19284 </varlistentry> 19285 <varlistentry> 19286 <term><parameter>nb</parameter></term> 19287 <listitem> 19288 <para> 19289 Notifier block to register 19290 </para> 19291 </listitem> 19292 </varlistentry> 19293 </variablelist> 19294</refsect1> 19295<refsect1> 19296<title>Description</title> 19297<para> 19298 Register for notification of the current status of the jack. Note 19299 that it is not possible to report additional jack events in the 19300 callback from the notifier, this is intended to support 19301 applications such as enabling electrical detection only when a 19302 mechanical detection event has occurred. 19303</para> 19304</refsect1> 19305</refentry> 19306 19307<refentry id="API-snd-soc-jack-notifier-unregister"> 19308<refentryinfo> 19309 <title>LINUX</title> 19310 <productname>Kernel Hackers Manual</productname> 19311 <date>July 2017</date> 19312</refentryinfo> 19313<refmeta> 19314 <refentrytitle><phrase>snd_soc_jack_notifier_unregister</phrase></refentrytitle> 19315 <manvolnum>9</manvolnum> 19316 <refmiscinfo class="version">4.1.27</refmiscinfo> 19317</refmeta> 19318<refnamediv> 19319 <refname>snd_soc_jack_notifier_unregister</refname> 19320 <refpurpose> 19321 Unregister a notifier for jack status 19322 </refpurpose> 19323</refnamediv> 19324<refsynopsisdiv> 19325 <title>Synopsis</title> 19326 <funcsynopsis><funcprototype> 19327 <funcdef>void <function>snd_soc_jack_notifier_unregister </function></funcdef> 19328 <paramdef>struct snd_soc_jack * <parameter>jack</parameter></paramdef> 19329 <paramdef>struct notifier_block * <parameter>nb</parameter></paramdef> 19330 </funcprototype></funcsynopsis> 19331</refsynopsisdiv> 19332<refsect1> 19333 <title>Arguments</title> 19334 <variablelist> 19335 <varlistentry> 19336 <term><parameter>jack</parameter></term> 19337 <listitem> 19338 <para> 19339 ASoC jack 19340 </para> 19341 </listitem> 19342 </varlistentry> 19343 <varlistentry> 19344 <term><parameter>nb</parameter></term> 19345 <listitem> 19346 <para> 19347 Notifier block to unregister 19348 </para> 19349 </listitem> 19350 </varlistentry> 19351 </variablelist> 19352</refsect1> 19353<refsect1> 19354<title>Description</title> 19355<para> 19356 Stop notifying for status changes. 19357</para> 19358</refsect1> 19359</refentry> 19360 19361<refentry id="API-snd-soc-jack-add-gpios"> 19362<refentryinfo> 19363 <title>LINUX</title> 19364 <productname>Kernel Hackers Manual</productname> 19365 <date>July 2017</date> 19366</refentryinfo> 19367<refmeta> 19368 <refentrytitle><phrase>snd_soc_jack_add_gpios</phrase></refentrytitle> 19369 <manvolnum>9</manvolnum> 19370 <refmiscinfo class="version">4.1.27</refmiscinfo> 19371</refmeta> 19372<refnamediv> 19373 <refname>snd_soc_jack_add_gpios</refname> 19374 <refpurpose> 19375 Associate GPIO pins with an ASoC jack 19376 </refpurpose> 19377</refnamediv> 19378<refsynopsisdiv> 19379 <title>Synopsis</title> 19380 <funcsynopsis><funcprototype> 19381 <funcdef>int <function>snd_soc_jack_add_gpios </function></funcdef> 19382 <paramdef>struct snd_soc_jack * <parameter>jack</parameter></paramdef> 19383 <paramdef>int <parameter>count</parameter></paramdef> 19384 <paramdef>struct snd_soc_jack_gpio * <parameter>gpios</parameter></paramdef> 19385 </funcprototype></funcsynopsis> 19386</refsynopsisdiv> 19387<refsect1> 19388 <title>Arguments</title> 19389 <variablelist> 19390 <varlistentry> 19391 <term><parameter>jack</parameter></term> 19392 <listitem> 19393 <para> 19394 ASoC jack 19395 </para> 19396 </listitem> 19397 </varlistentry> 19398 <varlistentry> 19399 <term><parameter>count</parameter></term> 19400 <listitem> 19401 <para> 19402 number of pins 19403 </para> 19404 </listitem> 19405 </varlistentry> 19406 <varlistentry> 19407 <term><parameter>gpios</parameter></term> 19408 <listitem> 19409 <para> 19410 array of gpio pins 19411 </para> 19412 </listitem> 19413 </varlistentry> 19414 </variablelist> 19415</refsect1> 19416<refsect1> 19417<title>Description</title> 19418<para> 19419 This function will request gpio, set data direction and request irq 19420 for each gpio in the array. 19421</para> 19422</refsect1> 19423</refentry> 19424 19425<refentry id="API-snd-soc-jack-add-gpiods"> 19426<refentryinfo> 19427 <title>LINUX</title> 19428 <productname>Kernel Hackers Manual</productname> 19429 <date>July 2017</date> 19430</refentryinfo> 19431<refmeta> 19432 <refentrytitle><phrase>snd_soc_jack_add_gpiods</phrase></refentrytitle> 19433 <manvolnum>9</manvolnum> 19434 <refmiscinfo class="version">4.1.27</refmiscinfo> 19435</refmeta> 19436<refnamediv> 19437 <refname>snd_soc_jack_add_gpiods</refname> 19438 <refpurpose> 19439 Associate GPIO descriptor pins with an ASoC jack 19440 </refpurpose> 19441</refnamediv> 19442<refsynopsisdiv> 19443 <title>Synopsis</title> 19444 <funcsynopsis><funcprototype> 19445 <funcdef>int <function>snd_soc_jack_add_gpiods </function></funcdef> 19446 <paramdef>struct device * <parameter>gpiod_dev</parameter></paramdef> 19447 <paramdef>struct snd_soc_jack * <parameter>jack</parameter></paramdef> 19448 <paramdef>int <parameter>count</parameter></paramdef> 19449 <paramdef>struct snd_soc_jack_gpio * <parameter>gpios</parameter></paramdef> 19450 </funcprototype></funcsynopsis> 19451</refsynopsisdiv> 19452<refsect1> 19453 <title>Arguments</title> 19454 <variablelist> 19455 <varlistentry> 19456 <term><parameter>gpiod_dev</parameter></term> 19457 <listitem> 19458 <para> 19459 GPIO consumer device 19460 </para> 19461 </listitem> 19462 </varlistentry> 19463 <varlistentry> 19464 <term><parameter>jack</parameter></term> 19465 <listitem> 19466 <para> 19467 ASoC jack 19468 </para> 19469 </listitem> 19470 </varlistentry> 19471 <varlistentry> 19472 <term><parameter>count</parameter></term> 19473 <listitem> 19474 <para> 19475 number of pins 19476 </para> 19477 </listitem> 19478 </varlistentry> 19479 <varlistentry> 19480 <term><parameter>gpios</parameter></term> 19481 <listitem> 19482 <para> 19483 array of gpio pins 19484 </para> 19485 </listitem> 19486 </varlistentry> 19487 </variablelist> 19488</refsect1> 19489<refsect1> 19490<title>Description</title> 19491<para> 19492 This function will request gpio, set data direction and request irq 19493 for each gpio in the array. 19494</para> 19495</refsect1> 19496</refentry> 19497 19498<refentry id="API-snd-soc-jack-free-gpios"> 19499<refentryinfo> 19500 <title>LINUX</title> 19501 <productname>Kernel Hackers Manual</productname> 19502 <date>July 2017</date> 19503</refentryinfo> 19504<refmeta> 19505 <refentrytitle><phrase>snd_soc_jack_free_gpios</phrase></refentrytitle> 19506 <manvolnum>9</manvolnum> 19507 <refmiscinfo class="version">4.1.27</refmiscinfo> 19508</refmeta> 19509<refnamediv> 19510 <refname>snd_soc_jack_free_gpios</refname> 19511 <refpurpose> 19512 Release GPIO pins' resources of an ASoC jack 19513 </refpurpose> 19514</refnamediv> 19515<refsynopsisdiv> 19516 <title>Synopsis</title> 19517 <funcsynopsis><funcprototype> 19518 <funcdef>void <function>snd_soc_jack_free_gpios </function></funcdef> 19519 <paramdef>struct snd_soc_jack * <parameter>jack</parameter></paramdef> 19520 <paramdef>int <parameter>count</parameter></paramdef> 19521 <paramdef>struct snd_soc_jack_gpio * <parameter>gpios</parameter></paramdef> 19522 </funcprototype></funcsynopsis> 19523</refsynopsisdiv> 19524<refsect1> 19525 <title>Arguments</title> 19526 <variablelist> 19527 <varlistentry> 19528 <term><parameter>jack</parameter></term> 19529 <listitem> 19530 <para> 19531 ASoC jack 19532 </para> 19533 </listitem> 19534 </varlistentry> 19535 <varlistentry> 19536 <term><parameter>count</parameter></term> 19537 <listitem> 19538 <para> 19539 number of pins 19540 </para> 19541 </listitem> 19542 </varlistentry> 19543 <varlistentry> 19544 <term><parameter>gpios</parameter></term> 19545 <listitem> 19546 <para> 19547 array of gpio pins 19548 </para> 19549 </listitem> 19550 </varlistentry> 19551 </variablelist> 19552</refsect1> 19553<refsect1> 19554<title>Description</title> 19555<para> 19556 Release gpio and irq resources for gpio pins associated with an ASoC jack. 19557</para> 19558</refsect1> 19559</refentry> 19560 19561 </sect1> 19562 <sect1><title>ISA DMA Helpers</title> 19563<!-- sound/core/isadma.c --> 19564<refentry id="API-snd-dma-program"> 19565<refentryinfo> 19566 <title>LINUX</title> 19567 <productname>Kernel Hackers Manual</productname> 19568 <date>July 2017</date> 19569</refentryinfo> 19570<refmeta> 19571 <refentrytitle><phrase>snd_dma_program</phrase></refentrytitle> 19572 <manvolnum>9</manvolnum> 19573 <refmiscinfo class="version">4.1.27</refmiscinfo> 19574</refmeta> 19575<refnamediv> 19576 <refname>snd_dma_program</refname> 19577 <refpurpose> 19578 program an ISA DMA transfer 19579 </refpurpose> 19580</refnamediv> 19581<refsynopsisdiv> 19582 <title>Synopsis</title> 19583 <funcsynopsis><funcprototype> 19584 <funcdef>void <function>snd_dma_program </function></funcdef> 19585 <paramdef>unsigned long <parameter>dma</parameter></paramdef> 19586 <paramdef>unsigned long <parameter>addr</parameter></paramdef> 19587 <paramdef>unsigned int <parameter>size</parameter></paramdef> 19588 <paramdef>unsigned short <parameter>mode</parameter></paramdef> 19589 </funcprototype></funcsynopsis> 19590</refsynopsisdiv> 19591<refsect1> 19592 <title>Arguments</title> 19593 <variablelist> 19594 <varlistentry> 19595 <term><parameter>dma</parameter></term> 19596 <listitem> 19597 <para> 19598 the dma number 19599 </para> 19600 </listitem> 19601 </varlistentry> 19602 <varlistentry> 19603 <term><parameter>addr</parameter></term> 19604 <listitem> 19605 <para> 19606 the physical address of the buffer 19607 </para> 19608 </listitem> 19609 </varlistentry> 19610 <varlistentry> 19611 <term><parameter>size</parameter></term> 19612 <listitem> 19613 <para> 19614 the DMA transfer size 19615 </para> 19616 </listitem> 19617 </varlistentry> 19618 <varlistentry> 19619 <term><parameter>mode</parameter></term> 19620 <listitem> 19621 <para> 19622 the DMA transfer mode, DMA_MODE_XXX 19623 </para> 19624 </listitem> 19625 </varlistentry> 19626 </variablelist> 19627</refsect1> 19628<refsect1> 19629<title>Description</title> 19630<para> 19631 Programs an ISA DMA transfer for the given buffer. 19632</para> 19633</refsect1> 19634</refentry> 19635 19636<refentry id="API-snd-dma-disable"> 19637<refentryinfo> 19638 <title>LINUX</title> 19639 <productname>Kernel Hackers Manual</productname> 19640 <date>July 2017</date> 19641</refentryinfo> 19642<refmeta> 19643 <refentrytitle><phrase>snd_dma_disable</phrase></refentrytitle> 19644 <manvolnum>9</manvolnum> 19645 <refmiscinfo class="version">4.1.27</refmiscinfo> 19646</refmeta> 19647<refnamediv> 19648 <refname>snd_dma_disable</refname> 19649 <refpurpose> 19650 stop the ISA DMA transfer 19651 </refpurpose> 19652</refnamediv> 19653<refsynopsisdiv> 19654 <title>Synopsis</title> 19655 <funcsynopsis><funcprototype> 19656 <funcdef>void <function>snd_dma_disable </function></funcdef> 19657 <paramdef>unsigned long <parameter>dma</parameter></paramdef> 19658 </funcprototype></funcsynopsis> 19659</refsynopsisdiv> 19660<refsect1> 19661 <title>Arguments</title> 19662 <variablelist> 19663 <varlistentry> 19664 <term><parameter>dma</parameter></term> 19665 <listitem> 19666 <para> 19667 the dma number 19668 </para> 19669 </listitem> 19670 </varlistentry> 19671 </variablelist> 19672</refsect1> 19673<refsect1> 19674<title>Description</title> 19675<para> 19676 Stops the ISA DMA transfer. 19677</para> 19678</refsect1> 19679</refentry> 19680 19681<refentry id="API-snd-dma-pointer"> 19682<refentryinfo> 19683 <title>LINUX</title> 19684 <productname>Kernel Hackers Manual</productname> 19685 <date>July 2017</date> 19686</refentryinfo> 19687<refmeta> 19688 <refentrytitle><phrase>snd_dma_pointer</phrase></refentrytitle> 19689 <manvolnum>9</manvolnum> 19690 <refmiscinfo class="version">4.1.27</refmiscinfo> 19691</refmeta> 19692<refnamediv> 19693 <refname>snd_dma_pointer</refname> 19694 <refpurpose> 19695 return the current pointer to DMA transfer buffer in bytes 19696 </refpurpose> 19697</refnamediv> 19698<refsynopsisdiv> 19699 <title>Synopsis</title> 19700 <funcsynopsis><funcprototype> 19701 <funcdef>unsigned int <function>snd_dma_pointer </function></funcdef> 19702 <paramdef>unsigned long <parameter>dma</parameter></paramdef> 19703 <paramdef>unsigned int <parameter>size</parameter></paramdef> 19704 </funcprototype></funcsynopsis> 19705</refsynopsisdiv> 19706<refsect1> 19707 <title>Arguments</title> 19708 <variablelist> 19709 <varlistentry> 19710 <term><parameter>dma</parameter></term> 19711 <listitem> 19712 <para> 19713 the dma number 19714 </para> 19715 </listitem> 19716 </varlistentry> 19717 <varlistentry> 19718 <term><parameter>size</parameter></term> 19719 <listitem> 19720 <para> 19721 the dma transfer size 19722 </para> 19723 </listitem> 19724 </varlistentry> 19725 </variablelist> 19726</refsect1> 19727<refsect1> 19728<title>Return</title> 19729<para> 19730 The current pointer in DMA transfer buffer in bytes. 19731</para> 19732</refsect1> 19733</refentry> 19734 19735 </sect1> 19736 <sect1><title>Other Helper Macros</title> 19737<!-- include/sound/core.h --> 19738<refentry id="API-snd-printk"> 19739<refentryinfo> 19740 <title>LINUX</title> 19741 <productname>Kernel Hackers Manual</productname> 19742 <date>July 2017</date> 19743</refentryinfo> 19744<refmeta> 19745 <refentrytitle><phrase>snd_printk</phrase></refentrytitle> 19746 <manvolnum>9</manvolnum> 19747 <refmiscinfo class="version">4.1.27</refmiscinfo> 19748</refmeta> 19749<refnamediv> 19750 <refname>snd_printk</refname> 19751 <refpurpose> 19752 printk wrapper 19753 </refpurpose> 19754</refnamediv> 19755<refsynopsisdiv> 19756 <title>Synopsis</title> 19757 <funcsynopsis><funcprototype> 19758 <funcdef> <function>snd_printk </function></funcdef> 19759 <paramdef> <parameter>fmt</parameter></paramdef> 19760 <paramdef> <parameter>args...</parameter></paramdef> 19761 </funcprototype></funcsynopsis> 19762</refsynopsisdiv> 19763<refsect1> 19764 <title>Arguments</title> 19765 <variablelist> 19766 <varlistentry> 19767 <term><parameter>fmt</parameter></term> 19768 <listitem> 19769 <para> 19770 format string 19771 </para> 19772 </listitem> 19773 </varlistentry> 19774 <varlistentry> 19775 <term><parameter>args...</parameter></term> 19776 <listitem> 19777 <para> 19778 variable arguments 19779 </para> 19780 </listitem> 19781 </varlistentry> 19782 </variablelist> 19783</refsect1> 19784<refsect1> 19785<title>Description</title> 19786<para> 19787 Works like <function>printk</function> but prints the file and the line of the caller 19788 when configured with CONFIG_SND_VERBOSE_PRINTK. 19789</para> 19790</refsect1> 19791</refentry> 19792 19793<refentry id="API-snd-printd"> 19794<refentryinfo> 19795 <title>LINUX</title> 19796 <productname>Kernel Hackers Manual</productname> 19797 <date>July 2017</date> 19798</refentryinfo> 19799<refmeta> 19800 <refentrytitle><phrase>snd_printd</phrase></refentrytitle> 19801 <manvolnum>9</manvolnum> 19802 <refmiscinfo class="version">4.1.27</refmiscinfo> 19803</refmeta> 19804<refnamediv> 19805 <refname>snd_printd</refname> 19806 <refpurpose> 19807 debug printk 19808 </refpurpose> 19809</refnamediv> 19810<refsynopsisdiv> 19811 <title>Synopsis</title> 19812 <funcsynopsis><funcprototype> 19813 <funcdef> <function>snd_printd </function></funcdef> 19814 <paramdef> <parameter>fmt</parameter></paramdef> 19815 <paramdef> <parameter>args...</parameter></paramdef> 19816 </funcprototype></funcsynopsis> 19817</refsynopsisdiv> 19818<refsect1> 19819 <title>Arguments</title> 19820 <variablelist> 19821 <varlistentry> 19822 <term><parameter>fmt</parameter></term> 19823 <listitem> 19824 <para> 19825 format string 19826 </para> 19827 </listitem> 19828 </varlistentry> 19829 <varlistentry> 19830 <term><parameter>args...</parameter></term> 19831 <listitem> 19832 <para> 19833 variable arguments 19834 </para> 19835 </listitem> 19836 </varlistentry> 19837 </variablelist> 19838</refsect1> 19839<refsect1> 19840<title>Description</title> 19841<para> 19842 Works like <function>snd_printk</function> for debugging purposes. 19843 Ignored when CONFIG_SND_DEBUG is not set. 19844</para> 19845</refsect1> 19846</refentry> 19847 19848<refentry id="API-snd-BUG"> 19849<refentryinfo> 19850 <title>LINUX</title> 19851 <productname>Kernel Hackers Manual</productname> 19852 <date>July 2017</date> 19853</refentryinfo> 19854<refmeta> 19855 <refentrytitle><phrase>snd_BUG</phrase></refentrytitle> 19856 <manvolnum>9</manvolnum> 19857 <refmiscinfo class="version">4.1.27</refmiscinfo> 19858</refmeta> 19859<refnamediv> 19860 <refname>snd_BUG</refname> 19861 <refpurpose> 19862 give a BUG warning message and stack trace 19863 </refpurpose> 19864</refnamediv> 19865<refsynopsisdiv> 19866 <title>Synopsis</title> 19867 <funcsynopsis><funcprototype> 19868 <funcdef> <function>snd_BUG </function></funcdef> 19869 <void/> 19870 </funcprototype></funcsynopsis> 19871</refsynopsisdiv> 19872<refsect1> 19873 <title>Arguments</title> 19874 <para> 19875 None 19876 </para> 19877</refsect1> 19878<refsect1> 19879<title>Description</title> 19880<para> 19881 </para><para> 19882 19883 Calls <function>WARN</function> if CONFIG_SND_DEBUG is set. 19884 Ignored when CONFIG_SND_DEBUG is not set. 19885</para> 19886</refsect1> 19887</refentry> 19888 19889<refentry id="API-snd-printd-ratelimit"> 19890<refentryinfo> 19891 <title>LINUX</title> 19892 <productname>Kernel Hackers Manual</productname> 19893 <date>July 2017</date> 19894</refentryinfo> 19895<refmeta> 19896 <refentrytitle><phrase>snd_printd_ratelimit</phrase></refentrytitle> 19897 <manvolnum>9</manvolnum> 19898 <refmiscinfo class="version">4.1.27</refmiscinfo> 19899</refmeta> 19900<refnamediv> 19901 <refname>snd_printd_ratelimit</refname> 19902 <refpurpose> 19903 </refpurpose> 19904</refnamediv> 19905<refsynopsisdiv> 19906 <title>Synopsis</title> 19907 <funcsynopsis><funcprototype> 19908 <funcdef> <function>snd_printd_ratelimit </function></funcdef> 19909 <void/> 19910 </funcprototype></funcsynopsis> 19911</refsynopsisdiv> 19912<refsect1> 19913 <title>Arguments</title> 19914 <para> 19915 None 19916 </para> 19917</refsect1> 19918</refentry> 19919 19920<refentry id="API-snd-BUG-ON"> 19921<refentryinfo> 19922 <title>LINUX</title> 19923 <productname>Kernel Hackers Manual</productname> 19924 <date>July 2017</date> 19925</refentryinfo> 19926<refmeta> 19927 <refentrytitle><phrase>snd_BUG_ON</phrase></refentrytitle> 19928 <manvolnum>9</manvolnum> 19929 <refmiscinfo class="version">4.1.27</refmiscinfo> 19930</refmeta> 19931<refnamediv> 19932 <refname>snd_BUG_ON</refname> 19933 <refpurpose> 19934 debugging check macro 19935 </refpurpose> 19936</refnamediv> 19937<refsynopsisdiv> 19938 <title>Synopsis</title> 19939 <funcsynopsis><funcprototype> 19940 <funcdef> <function>snd_BUG_ON </function></funcdef> 19941 <paramdef> <parameter>cond</parameter></paramdef> 19942 </funcprototype></funcsynopsis> 19943</refsynopsisdiv> 19944<refsect1> 19945 <title>Arguments</title> 19946 <variablelist> 19947 <varlistentry> 19948 <term><parameter>cond</parameter></term> 19949 <listitem> 19950 <para> 19951 condition to evaluate 19952 </para> 19953 </listitem> 19954 </varlistentry> 19955 </variablelist> 19956</refsect1> 19957<refsect1> 19958<title>Description</title> 19959<para> 19960 Has the same behavior as WARN_ON when CONFIG_SND_DEBUG is set, 19961 otherwise just evaluates the conditional and returns the value. 19962</para> 19963</refsect1> 19964</refentry> 19965 19966<refentry id="API-snd-printdd"> 19967<refentryinfo> 19968 <title>LINUX</title> 19969 <productname>Kernel Hackers Manual</productname> 19970 <date>July 2017</date> 19971</refentryinfo> 19972<refmeta> 19973 <refentrytitle><phrase>snd_printdd</phrase></refentrytitle> 19974 <manvolnum>9</manvolnum> 19975 <refmiscinfo class="version">4.1.27</refmiscinfo> 19976</refmeta> 19977<refnamediv> 19978 <refname>snd_printdd</refname> 19979 <refpurpose> 19980 debug printk 19981 </refpurpose> 19982</refnamediv> 19983<refsynopsisdiv> 19984 <title>Synopsis</title> 19985 <funcsynopsis><funcprototype> 19986 <funcdef> <function>snd_printdd </function></funcdef> 19987 <paramdef> <parameter>format</parameter></paramdef> 19988 <paramdef> <parameter>args...</parameter></paramdef> 19989 </funcprototype></funcsynopsis> 19990</refsynopsisdiv> 19991<refsect1> 19992 <title>Arguments</title> 19993 <variablelist> 19994 <varlistentry> 19995 <term><parameter>format</parameter></term> 19996 <listitem> 19997 <para> 19998 format string 19999 </para> 20000 </listitem> 20001 </varlistentry> 20002 <varlistentry> 20003 <term><parameter>args...</parameter></term> 20004 <listitem> 20005 <para> 20006 variable arguments 20007 </para> 20008 </listitem> 20009 </varlistentry> 20010 </variablelist> 20011</refsect1> 20012<refsect1> 20013<title>Description</title> 20014<para> 20015 Works like <function>snd_printk</function> for debugging purposes. 20016 Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. 20017</para> 20018</refsect1> 20019</refentry> 20020 20021 </sect1> 20022 </chapter> 20023 20024</book> 20025