亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? writing-an-alsa-driver.tmpl

?? 優龍2410linux2.6.8內核源代碼
?? TMPL
?? 第 1 頁 / 共 5 頁
字號:
  };]]>          </programlisting>        </informalexample>        and the allocation would be (assuming its size is 512 bytes):        <informalexample>          <programlisting><![CDATA[  chip->iobase_phys = pci_resource_start(pci, 0);  chip->iobase_virt = (unsigned long)                      ioremap_nocache(chip->iobase_phys, 512);  if ((chip->res_port = request_mem_region(chip->iobase_phys, 512,                                           "My Chip")) == NULL) {          printk(KERN_ERR "cannot allocate the memory region\n");          snd_mychip_free(chip);          return -EBUSY;  }]]>          </programlisting>        </informalexample>                and the corresponding destructor would be:        <informalexample>          <programlisting><![CDATA[  static int snd_mychip_free(mychip_t *chip)  {          ....          if (chip->iobase_virt)                  iounmap((void *)chip->iobase_virt);          if (chip->res_iobase) {                  release_resource(chip->res_iobase);                  kfree_nocheck(chip->res_iobase);          }          ....  }]]>          </programlisting>        </informalexample>      </para>    </section>    <section id="pci-resource-entries">      <title>PCI Entries</title>      <para>        So far, so good. Let's finish the rest of missing PCI      stuffs. At first, we need a      <structname>pci_device_id</structname> table for this      chipset. It's a table of PCI vendor/device ID number, and some      masks.       </para>      <para>        For example,        <informalexample>          <programlisting><![CDATA[  static struct pci_device_id snd_mychip_ids[] = {          { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,            PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },          ....          { 0, }  };  MODULE_DEVICE_TABLE(pci, snd_mychip_ids);]]>          </programlisting>        </informalexample>      </para>      <para>        The first and second fields of      <structname>pci_device_id</structname> struct are the vendor and      device IDs. If you have nothing special to filter the matching      devices, you can use the rest of fields like above. The last      field of <structname>pci_device_id</structname> struct is a      private data for this entry. You can specify any value here, for      example, to tell the type of different operations per each      device IDs. Such an example is found in intel8x0 driver.       </para>      <para>        The last entry of this list is the terminator. You must      specify this all-zero entry.       </para>      <para>        Then, prepare the <structname>pci_driver</structname> record:        <informalexample>          <programlisting><![CDATA[  static struct pci_driver driver = {          .name = "My Own Chip",          .id_table = snd_mychip_ids,          .probe = snd_mychip_probe,          .remove = __devexit_p(snd_mychip_remove),  };]]>          </programlisting>        </informalexample>      </para>      <para>        The <structfield>probe</structfield> and      <structfield>remove</structfield> functions are what we already      defined in       the previous sections. The <structfield>remove</structfield> should      be defined with       <function>__devexit_p()</function> macro, so that it's not      defined for built-in (and non-hot-pluggable) case. The      <structfield>name</structfield>       field is the name string of this device. Note that you must not      use a slash <quote>/</quote> in this string.       </para>      <para>        And at last, the module entries:        <informalexample>          <programlisting><![CDATA[  static int __init alsa_card_mychip_init(void)  {          return pci_module_init(&driver);  }  static void __exit alsa_card_mychip_exit(void)  {          pci_unregister_driver(&driver);  }  module_init(alsa_card_mychip_init)  module_exit(alsa_card_mychip_exit)]]>          </programlisting>        </informalexample>      </para>      <para>        Note that these module entries are tagged with      <parameter>__init</parameter> and       <parameter>__exit</parameter> prefixes, not      <parameter>__devinit</parameter> nor      <parameter>__devexit</parameter>.      </para>      <para>        Oh, one thing was forgotten. If you have no exported symbols,        you need to declare it on 2.2 or 2.4 kernels (on 2.6 kernels        it's not necessary, though).        <informalexample>          <programlisting><![CDATA[  EXPORT_NO_SYMBOLS;]]>          </programlisting>        </informalexample>        That's all!      </para>    </section>  </chapter><!-- ****************************************************** --><!-- PCM Interface  --><!-- ****************************************************** -->  <chapter id="pcm-interface">    <title>PCM Interface</title>    <section id="pcm-interface-general">      <title>General</title>      <para>        The PCM middle layer of ALSA is quite powerful and it is only      necessary for each driver to implement the low-level functions      to access its hardware.      </para>      <para>        For accessing to the PCM layer, you need to include      <filename>&lt;sound/pcm.h&gt;</filename> above all. In addition,      <filename>&lt;sound/pcm_params.h&gt;</filename> might be needed      if you access to some functions related with hw_param.       </para>      <para>        Each card device can have up to four pcm instances. A pcm      instance corresponds to a pcm device file. The limitation of      number of instances comes only from the available bit size of      the linux's device number. Once when 64bit device number is      used, we'll have more available pcm instances.       </para>      <para>        A pcm instance consists of pcm playback and capture streams,      and each pcm stream consists of one or more pcm substreams. Some      soundcard supports the multiple-playback function. For example,      emu10k1 has a PCM playback of 32 stereo substreams. In this case, at      each open, a free substream is (usually) automatically chosen      and opened. Meanwhile, when only one substream exists and it was      already opened, the succeeding open will result in the blocking      or the error with <constant>EAGAIN</constant> according to the      file open mode. But you don't have to know the detail in your      driver. The PCM middle layer will take all such jobs.       </para>    </section>    <section id="pcm-interface-example">      <title>Full Code Example</title>      <para>      The example code below does not include any hardware access      routines but shows only the skeleton, how to build up the PCM      interfaces.        <example>          <title>PCM Example Code</title>          <programlisting><![CDATA[  #include <sound/pcm.h>  ....  #define chip_t mychip_t  ....  /* hardware definition */  static snd_pcm_hardware_t snd_mychip_playback_hw = {          .info = (SNDRV_PCM_INFO_MMAP |                   SNDRV_PCM_INFO_INTERLEAVED |                   SNDRV_PCM_INFO_BLOCK_TRANSFER |                   SNDRV_PCM_INFO_MMAP_VALID),          .formats =          SNDRV_PCM_FMTBIT_S16_LE,          .rates =            SNDRV_PCM_RATE_8000_48000,          .rate_min =         8000,          .rate_max =         48000,          .channels_min =     2,          .channels_max =     2,          .buffer_bytes_max = 32768,          .period_bytes_min = 4096,          .period_bytes_max = 32768,          .periods_min =      1,          .periods_max =      1024,  };  /* hardware definition */  static snd_pcm_hardware_t snd_mychip_capture_hw = {          .info = (SNDRV_PCM_INFO_MMAP |                   SNDRV_PCM_INFO_INTERLEAVED |                   SNDRV_PCM_INFO_BLOCK_TRANSFER |                   SNDRV_PCM_INFO_MMAP_VALID),          .formats =          SNDRV_PCM_FMTBIT_S16_LE,          .rates =            SNDRV_PCM_RATE_8000_48000,          .rate_min =         8000,          .rate_max =         48000,          .channels_min =     2,          .channels_max =     2,          .buffer_bytes_max = 32768,          .period_bytes_min = 4096,          .period_bytes_max = 32768,          .periods_min =      1,          .periods_max =      1024,  };  /* open callback */  static int snd_mychip_playback_open(snd_pcm_substream_t *substream)  {          mychip_t *chip = snd_pcm_substream_chip(substream);          snd_pcm_runtime_t *runtime = substream->runtime;          runtime->hw = snd_mychip_playback_hw;          // more hardware-initialization will be done here          return 0;  }  /* close callback */  static int snd_mychip_playback_close(snd_pcm_substream_t *substream)  {          mychip_t *chip = snd_pcm_substream_chip(substream);          // the hardware-specific codes will be here          return 0;  }  /* open callback */  static int snd_mychip_capture_open(snd_pcm_substream_t *substream)  {          mychip_t *chip = snd_pcm_substream_chip(substream);          snd_pcm_runtime_t *runtime = substream->runtime;          runtime->hw = snd_mychip_capture_hw;          // more hardware-initialization will be done here          return 0;  }  /* close callback */  static int snd_mychip_capture_close(snd_pcm_substream_t *substream)  {          mychip_t *chip = snd_pcm_substream_chip(substream);          // the hardware-specific codes will be here          return 0;  }  /* hw_params callback */  static int snd_mychip_pcm_hw_params(snd_pcm_substream_t *substream,                               snd_pcm_hw_params_t * hw_params)  {          return snd_pcm_lib_malloc_pages(substream,                                     params_buffer_bytes(hw_params));  }  /* hw_free callback */  static int snd_mychip_pcm_hw_free(snd_pcm_substream_t *substream)  {          return snd_pcm_lib_free_pages(substream);  }  /* prepare callback */  static int snd_mychip_pcm_prepare(snd_pcm_substream_t *substream)  {          mychip_t *chip = snd_pcm_substream_chip(substream);          snd_pcm_runtime_t *runtime = substream->runtime;          // set up the hardware with the current configuration          // for example...          mychip_set_sample_format(chip, runtime->format);          mychip_set_sample_rate(chip, runtime->rate);          mychip_set_channels(chip, runtime->channels);          mychip_set_dma_setup(chip, runtime->dma_area,                               chip->buffer_size,                               chip->period_size);          return 0;  }  /* trigger callback */  static int snd_mychip_pcm_trigger(snd_pcm_substream_t *substream,                                    int cmd)  {          switch (cmd) {          case SNDRV_PCM_TRIGGER_START:                  // do something to start the PCM engine                  break;          case SNDRV_PCM_TRIGGER_STOP:                  // do something to stop the PCM engine                  break;          default:                  return -EINVAL;          }  }  /* pointer callback */  static snd_pcm_uframes_t  snd_mychip_pcm_pointer(snd_pcm_substream_t *substream)  {          mychip_t *chip = snd_pcm_substream_chip(substream);          unsigned int current_ptr;          // get the current hardware pointer          current_ptr = mychip_get_hw_pointer(chip);          return current_ptr;  }  /* operators */  static snd_pcm_ops_t snd_mychip_playback_ops = {          .open =        snd_mychip_playback_open,          .close =       snd_mychip_playback_close,          .ioctl =       snd_pcm_lib_ioctl,          .hw_params =   snd_mychip_pcm_hw_params,          .hw_free =     snd_mychip_pcm_hw_free,          .prepare =     snd_mychip_pcm_prepare,          .trigger =     snd_mychip_pcm_trigger,          .pointer =     snd_mychip_pcm_pointer,  };  /* operators */  static snd_pcm_ops_t snd_mychip_capture_ops = {          .open =        snd_mychip_capture_open,          .close =       snd_mychip_capture_close,          .ioctl =       snd_pcm_lib_ioctl,          .hw_params =   snd_mychip_pcm_hw_params,          .hw_free =     snd_mychip_pcm_hw_free,          .prepare =     snd_mychip_pcm_prepare,          .trigger =     snd_mychip_pcm_trigger,          .pointer =     snd_mychip_pcm_pointer,  };  /*   *  definitions of capture are omitted here...   */  /* create a pcm device */  static int __devinit snd_mychip_new_pcm(mychip_t *chip)  {          snd_pcm_t *pcm;          int err;          if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1,                                 &pcm)) < 0)                   r

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
67194成人在线观看| 丝袜美腿一区二区三区| 波多野洁衣一区| 色婷婷精品大在线视频| 色综合久久综合中文综合网| 色噜噜狠狠成人网p站| 7777精品久久久大香线蕉 | 亚洲天堂a在线| xfplay精品久久| 一区二区三区电影在线播| 亚洲国产另类精品专区| 久久精品国产精品亚洲精品| 国产剧情在线观看一区二区| 色婷婷综合久久久中文一区二区 | 国产河南妇女毛片精品久久久 | 日本伊人色综合网| 成人免费观看av| 日韩欧美自拍偷拍| 亚洲狼人国产精品| 成人免费精品视频| 精品久久国产字幕高潮| 亚洲自拍偷拍图区| 99视频一区二区| 欧美国产日韩a欧美在线观看 | 欧美日韩精品一区二区三区| 中文av一区特黄| 国产精品一区三区| 日韩无一区二区| 男女男精品视频| 欧美日韩久久久| 性久久久久久久| 欧美精品乱码久久久久久按摩| 国产精品婷婷午夜在线观看| 国产成人啪午夜精品网站男同| 精品久久久久久久久久久院品网| 日韩专区欧美专区| 91精品欧美综合在线观看最新| 天天av天天翘天天综合网色鬼国产 | av亚洲产国偷v产偷v自拍| 国产日韩成人精品| 成人aa视频在线观看| 国产精品私人影院| 成人国产精品免费观看视频| 国产精品乱人伦中文| 在线观看www91| 蜜桃av一区二区| 久久精品一区二区三区四区| av不卡一区二区三区| 一区二区三区在线观看动漫 | 亚洲v日本v欧美v久久精品| 欧美一级欧美三级在线观看| 国产精品亚洲视频| 亚洲欧美日韩精品久久久久| 9191国产精品| av电影天堂一区二区在线| 亚洲第一综合色| 久久久欧美精品sm网站| 欧美三级三级三级爽爽爽| 国产一区二区免费在线| 亚洲精品一二三四区| 久久精品人人做人人综合| 欧美色综合久久| 高清免费成人av| 蜜桃久久精品一区二区| 亚洲欧美另类图片小说| 精品免费国产一区二区三区四区| 色素色在线综合| 东方欧美亚洲色图在线| 久久er99热精品一区二区| 亚洲激情图片小说视频| 中文字幕永久在线不卡| 久久精品视频一区| 欧美精品一区二区三区久久久 | 国产精品资源网| 久久99热狠狠色一区二区| 偷窥少妇高潮呻吟av久久免费| 亚洲精品欧美专区| 亚洲一区在线观看视频| 中文字幕综合网| 亚洲日本一区二区| 亚洲精品欧美激情| 一区二区三区免费在线观看| 亚洲黄一区二区三区| 亚洲一区二区三区不卡国产欧美| 亚洲欧洲中文日韩久久av乱码| 亚洲视频精选在线| 亚洲国产视频a| 日韩中文字幕亚洲一区二区va在线| 性做久久久久久免费观看欧美| 日韩成人午夜精品| 久久99国产精品免费网站| 国产成人高清视频| 日本高清不卡一区| 日韩你懂的在线播放| 亚洲欧洲一区二区在线播放| 亚洲美女区一区| 捆绑调教美女网站视频一区| 国产一区二区主播在线| 91在线视频播放| 精品少妇一区二区三区在线视频| 久久久不卡网国产精品二区| 亚洲色图在线播放| 裸体健美xxxx欧美裸体表演| 99久久久无码国产精品| 欧美一级xxx| 亚洲精品国产品国语在线app| 日韩av在线播放中文字幕| 97国产精品videossex| 日韩免费视频一区| 亚洲成人你懂的| 99久久99久久精品免费看蜜桃| 精品日韩av一区二区| 亚洲成av人片在线观看无码| 成人免费看视频| 欧美激情在线观看视频免费| 丝袜脚交一区二区| 在线亚洲精品福利网址导航| 中文字幕第一页久久| 粉嫩欧美一区二区三区高清影视 | 国产一区二区三区香蕉| 欧美一区二区精美| 精品一二三四区| 中文在线免费一区三区高中清不卡| 亚洲综合在线观看视频| 亚洲欧美另类综合偷拍| 五月天中文字幕一区二区| 免费观看在线色综合| 成人av片在线观看| 日韩精品一区二区三区中文不卡 | 色婷婷综合在线| 国产精品欧美久久久久无广告| 国产麻豆精品在线观看| 久久综合av免费| 成人午夜精品在线| 亚洲人妖av一区二区| 国产一区二区在线观看视频| 国产一区日韩二区欧美三区| 色哟哟一区二区在线观看| 日韩欧美高清在线| 国产伦理精品不卡| 18成人在线视频| 欧美日韩久久一区| 国产高清不卡二三区| 亚洲免费资源在线播放| 欧美成人女星排行榜| 成人激情午夜影院| 免费人成精品欧美精品| 中文字幕一区二区三| 精品国产一区二区三区av性色| 国产成人夜色高潮福利影视| 亚洲人成亚洲人成在线观看图片| 欧美一区二区在线观看| 91福利在线看| 精品一区二区三区影院在线午夜 | 国产一区二区精品在线观看| 亚洲一二三四在线| 国产精品不卡一区| 精品国精品国产尤物美女| 欧美日韩国产大片| 99国产精品视频免费观看| 国产成人免费xxxxxxxx| 另类小说欧美激情| 免费在线看成人av| 亚洲一区二区三区四区五区中文| 国产精品色婷婷| 久久久久久久久久久久久久久99 | 国产精品免费视频观看| 久久精品一区四区| 国产午夜亚洲精品羞羞网站| 欧美成人欧美edvon| 欧美精品一区男女天堂| 欧美成人三级在线| 国产日韩成人精品| 国产精品无人区| 亚洲你懂的在线视频| 一区二区三区在线观看欧美| 亚洲女子a中天字幕| 亚洲精品福利视频网站| 亚洲一二三四在线| 免费观看成人鲁鲁鲁鲁鲁视频| 激情亚洲综合在线| 成人h动漫精品一区二| 色视频一区二区| 日韩色在线观看| 亚洲国产精品传媒在线观看| 一区二区视频在线| 另类人妖一区二区av| 粉嫩av一区二区三区在线播放| 99国产精品国产精品久久| 欧美丰满少妇xxxxx高潮对白| 美女mm1313爽爽久久久蜜臀| 国产成人99久久亚洲综合精品| 成人av网址在线| 欧美一区二区在线播放| 国产精品美女久久久久久久| 三级久久三级久久久| 成人精品小蝌蚪| 欧美一区二区观看视频| 中文字幕永久在线不卡| 免费成人在线观看|