Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1987f17d authored by James Morris's avatar James Morris
Browse files

Merge branch 'master' into next

parents 7198e2ee 0384e295
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -12,7 +12,8 @@ DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \
	    kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
	    kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
	    gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
	    gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
	    genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
	    genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
	    mac80211.xml debugobjects.xml sh.xml regulator.xml
	    mac80211.xml debugobjects.xml sh.xml regulator.xml \
	    alsa-driver-api.xml writing-an-alsa-driver.xml


###
###
# The build process is as follows (targets):
# The build process is as follows (targets):
+13 −4
Original line number Original line Diff line number Diff line
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
<book>
	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
<?dbhtml filename="index.html">


<!-- ****************************************************** -->
<!-- ****************************************************** -->
<!-- Header  -->
<!-- Header  -->
<!-- ****************************************************** -->
<!-- ****************************************************** -->
<book id="ALSA-Driver-API">
  <bookinfo>
  <bookinfo>
    <title>The ALSA Driver API</title>
    <title>The ALSA Driver API</title>


@@ -35,6 +35,8 @@


  </bookinfo>
  </bookinfo>


<toc></toc>

  <chapter><title>Management of Cards and Devices</title>
  <chapter><title>Management of Cards and Devices</title>
     <sect1><title>Card Management</title>
     <sect1><title>Card Management</title>
!Esound/core/init.c
!Esound/core/init.c
@@ -71,6 +73,10 @@
!Esound/pci/ac97/ac97_codec.c
!Esound/pci/ac97/ac97_codec.c
!Esound/pci/ac97/ac97_pcm.c
!Esound/pci/ac97/ac97_pcm.c
     </sect1>
     </sect1>
     <sect1><title>Virtual Master Control API</title>
!Esound/core/vmaster.c
!Iinclude/sound/control.h
     </sect1>
  </chapter>
  </chapter>
  <chapter><title>MIDI API</title>
  <chapter><title>MIDI API</title>
     <sect1><title>Raw MIDI API</title>
     <sect1><title>Raw MIDI API</title>
@@ -88,6 +94,9 @@
  <chapter><title>Miscellaneous Functions</title>
  <chapter><title>Miscellaneous Functions</title>
     <sect1><title>Hardware-Dependent Devices API</title>
     <sect1><title>Hardware-Dependent Devices API</title>
!Esound/core/hwdep.c
!Esound/core/hwdep.c
     </sect1>
     <sect1><title>Jack Abstraction Layer API</title>
!Esound/core/jack.c
     </sect1>
     </sect1>
     <sect1><title>ISA DMA Helpers</title>
     <sect1><title>ISA DMA Helpers</title>
!Esound/core/isadma.c
!Esound/core/isadma.c
+25 −4
Original line number Original line Diff line number Diff line
@@ -41,6 +41,13 @@ GPL version 2.
</abstract>
</abstract>


<revhistory>
<revhistory>
	<revision>
	<revnumber>0.8</revnumber>
	<date>2008-12-24</date>
	<authorinitials>hjk</authorinitials>
	<revremark>Added name attributes in mem and portio sysfs directories.
		</revremark>
	</revision>
	<revision>
	<revision>
	<revnumber>0.7</revnumber>
	<revnumber>0.7</revnumber>
	<date>2008-12-23</date>
	<date>2008-12-23</date>
@@ -303,10 +310,17 @@ interested in translating it, please email me
	appear if the size of the mapping is not 0.
	appear if the size of the mapping is not 0.
</para>
</para>
<para>
<para>
	Each <filename>mapX/</filename> directory contains two read-only files
	Each <filename>mapX/</filename> directory contains four read-only files
	that show start address and size of the memory:
	that show attributes of the memory:
</para>
</para>
<itemizedlist>
<itemizedlist>
<listitem>
	<para>
	<filename>name</filename>: A string identifier for this mapping. This
	is optional, the string can be empty. Drivers can set this to make it
	easier for userspace to find the correct mapping.
	</para>
</listitem>
<listitem>
<listitem>
	<para>
	<para>
	<filename>addr</filename>: The address of memory that can be mapped.
	<filename>addr</filename>: The address of memory that can be mapped.
@@ -366,10 +380,17 @@ offset = N * getpagesize();
	<filename>/sys/class/uio/uioX/portio/</filename>.
	<filename>/sys/class/uio/uioX/portio/</filename>.
</para>
</para>
<para>
<para>
	Each <filename>portX/</filename> directory contains three read-only
	Each <filename>portX/</filename> directory contains four read-only
	files that show start, size, and type of the port region:
	files that show name, start, size, and type of the port region:
</para>
</para>
<itemizedlist>
<itemizedlist>
<listitem>
	<para>
	<filename>name</filename>: A string identifier for this port region.
	The string is optional and can be empty. Drivers can set it to make it
	easier for userspace to find a certain port region.
	</para>
</listitem>
<listitem>
<listitem>
	<para>
	<para>
	<filename>start</filename>: The first port of this region.
	<filename>start</filename>: The first port of this region.
+29 −23
Original line number Original line Diff line number Diff line
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
<book>
	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
<?dbhtml filename="index.html">


<!-- ****************************************************** -->
<!-- ****************************************************** -->
<!-- Header  -->
<!-- Header  -->
<!-- ****************************************************** -->
<!-- ****************************************************** -->
<book id="Writing-an-ALSA-Driver">
  <bookinfo>
  <bookinfo>
    <title>Writing an ALSA Driver</title>
    <title>Writing an ALSA Driver</title>
    <author>
    <author>
@@ -492,9 +492,9 @@
          }
          }


          /* (2) */
          /* (2) */
          card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
          err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
          if (card == NULL)
          if (err < 0)
                  return -ENOMEM;
                  return err;


          /* (3) */
          /* (3) */
          err = snd_mychip_create(card, pci, &chip);
          err = snd_mychip_create(card, pci, &chip);
@@ -590,8 +590,9 @@
            <programlisting>
            <programlisting>
<![CDATA[
<![CDATA[
  struct snd_card *card;
  struct snd_card *card;
  int err;
  ....
  ....
  card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
  err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
]]>
]]>
            </programlisting>
            </programlisting>
          </informalexample>
          </informalexample>
@@ -809,26 +810,28 @@


      <para>
      <para>
        As mentioned above, to create a card instance, call
        As mentioned above, to create a card instance, call
      <function>snd_card_new()</function>.
      <function>snd_card_create()</function>.


        <informalexample>
        <informalexample>
          <programlisting>
          <programlisting>
<![CDATA[
<![CDATA[
  struct snd_card *card;
  struct snd_card *card;
  card = snd_card_new(index, id, module, extra_size);
  int err;
  err = snd_card_create(index, id, module, extra_size, &card);
]]>
]]>
          </programlisting>
          </programlisting>
        </informalexample>
        </informalexample>
      </para>
      </para>


      <para>
      <para>
        The function takes four arguments, the card-index number, the
        The function takes five arguments, the card-index number, the
        id string, the module pointer (usually
        id string, the module pointer (usually
        <constant>THIS_MODULE</constant>),
        <constant>THIS_MODULE</constant>),
        and the size of extra-data space.  The last argument is used to
        the size of extra-data space, and the pointer to return the
        card instance.  The extra_size argument is used to
        allocate card-&gt;private_data for the
        allocate card-&gt;private_data for the
        chip-specific data.  Note that these data
        chip-specific data.  Note that these data
        are allocated by <function>snd_card_new()</function>.
        are allocated by <function>snd_card_create()</function>.
      </para>
      </para>
    </section>
    </section>


@@ -915,15 +918,16 @@
      </para>
      </para>


      <section id="card-management-chip-specific-snd-card-new">
      <section id="card-management-chip-specific-snd-card-new">
        <title>1. Allocating via <function>snd_card_new()</function>.</title>
        <title>1. Allocating via <function>snd_card_create()</function>.</title>
        <para>
        <para>
          As mentioned above, you can pass the extra-data-length
          As mentioned above, you can pass the extra-data-length
	  to the 4th argument of <function>snd_card_new()</function>, i.e.
	  to the 4th argument of <function>snd_card_create()</function>, i.e.


          <informalexample>
          <informalexample>
            <programlisting>
            <programlisting>
<![CDATA[
<![CDATA[
  card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct mychip));
  err = snd_card_create(index[dev], id[dev], THIS_MODULE,
                        sizeof(struct mychip), &card);
]]>
]]>
            </programlisting>
            </programlisting>
          </informalexample>
          </informalexample>
@@ -952,8 +956,8 @@


        <para>
        <para>
          After allocating a card instance via
          After allocating a card instance via
          <function>snd_card_new()</function> (with
          <function>snd_card_create()</function> (with
          <constant>NULL</constant> on the 4th arg), call
          <constant>0</constant> on the 4th arg), call
          <function>kzalloc()</function>. 
          <function>kzalloc()</function>. 


          <informalexample>
          <informalexample>
@@ -961,7 +965,7 @@
<![CDATA[
<![CDATA[
  struct snd_card *card;
  struct snd_card *card;
  struct mychip *chip;
  struct mychip *chip;
  card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL);
  err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
  .....
  .....
  chip = kzalloc(sizeof(*chip), GFP_KERNEL);
  chip = kzalloc(sizeof(*chip), GFP_KERNEL);
]]>
]]>
@@ -5750,8 +5754,9 @@ struct _snd_pcm_runtime {
          ....
          ....
          struct snd_card *card;
          struct snd_card *card;
          struct mychip *chip;
          struct mychip *chip;
          int err;
          ....
          ....
          card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL);
          err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
          ....
          ....
          chip = kzalloc(sizeof(*chip), GFP_KERNEL);
          chip = kzalloc(sizeof(*chip), GFP_KERNEL);
          ....
          ....
@@ -5763,7 +5768,7 @@ struct _snd_pcm_runtime {
      </informalexample>
      </informalexample>


	When you created the chip data with
	When you created the chip data with
	<function>snd_card_new()</function>, it's anyway accessible
	<function>snd_card_create()</function>, it's anyway accessible
	via <structfield>private_data</structfield> field.
	via <structfield>private_data</structfield> field.


      <informalexample>
      <informalexample>
@@ -5775,9 +5780,10 @@ struct _snd_pcm_runtime {
          ....
          ....
          struct snd_card *card;
          struct snd_card *card;
          struct mychip *chip;
          struct mychip *chip;
          int err;
          ....
          ....
          card = snd_card_new(index[dev], id[dev], THIS_MODULE,
          err = snd_card_create(index[dev], id[dev], THIS_MODULE,
                              sizeof(struct mychip));
                                sizeof(struct mychip), &card);
          ....
          ....
          chip = card->private_data;
          chip = card->private_data;
          ....
          ....
+22 −4
Original line number Original line Diff line number Diff line
@@ -117,10 +117,28 @@ accessible parameters:
sampling_rate: measured in uS (10^-6 seconds), this is how often you
sampling_rate: measured in uS (10^-6 seconds), this is how often you
want the kernel to look at the CPU usage and to make decisions on
want the kernel to look at the CPU usage and to make decisions on
what to do about the frequency.  Typically this is set to values of
what to do about the frequency.  Typically this is set to values of
around '10000' or more.
around '10000' or more. It's default value is (cmp. with users-guide.txt):

transition_latency * 1000
show_sampling_rate_(min|max): the minimum and maximum sampling rates
The lowest value you can set is:
available that you may set 'sampling_rate' to.
transition_latency * 100 or it may get restricted to a value where it
makes not sense for the kernel anymore to poll that often which depends
on your HZ config variable (HZ=1000: max=20000us, HZ=250: max=5000).
Be aware that transition latency is in ns and sampling_rate is in us, so you
get the same sysfs value by default.
Sampling rate should always get adjusted considering the transition latency
To set the sampling rate 750 times as high as the transition latency
in the bash (as said, 1000 is default), do:
echo `$(($(cat cpuinfo_transition_latency) * 750 / 1000)) \
    >ondemand/sampling_rate

show_sampling_rate_(min|max): THIS INTERFACE IS DEPRECATED, DON'T USE IT.
You can use wider ranges now and the general
cpuinfo_transition_latency variable (cmp. with user-guide.txt) can be
used to obtain exactly the same info:
show_sampling_rate_min = transtition_latency * 500    / 1000
show_sampling_rate_max = transtition_latency * 500000 / 1000
(divided by 1000 is to illustrate that sampling rate is in us and
transition latency is exported ns).


up_threshold: defines what the average CPU usage between the samplings
up_threshold: defines what the average CPU usage between the samplings
of 'sampling_rate' needs to be for the kernel to make a decision on
of 'sampling_rate' needs to be for the kernel to make a decision on
Loading