Loading Documentation/DocBook/writing-an-alsa-driver.tmpl +27 −45 Original line number Diff line number Diff line Loading @@ -468,8 +468,6 @@ return err; } snd_card_set_dev(card, &pci->dev); *rchip = chip; return 0; } Loading @@ -492,7 +490,8 @@ } /* (2) */ err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, 0, &card); if (err < 0) return err; Loading Loading @@ -591,7 +590,8 @@ struct snd_card *card; int err; .... err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, 0, &card); ]]> </programlisting> </informalexample> Loading Loading @@ -809,28 +809,34 @@ <para> As mentioned above, to create a card instance, call <function>snd_card_create()</function>. <function>snd_card_new()</function>. <informalexample> <programlisting> <![CDATA[ struct snd_card *card; int err; err = snd_card_create(index, id, module, extra_size, &card); err = snd_card_new(&pci->dev, index, id, module, extra_size, &card); ]]> </programlisting> </informalexample> </para> <para> The function takes five arguments, the card-index number, the id string, the module pointer (usually The function takes six arguments: the parent device pointer, the card-index number, the id string, the module pointer (usually <constant>THIS_MODULE</constant>), the size of extra-data space, and the pointer to return the card instance. The extra_size argument is used to allocate card->private_data for the chip-specific data. Note that these data are allocated by <function>snd_card_create()</function>. are allocated by <function>snd_card_new()</function>. </para> <para> The first argument, the pointer of struct <structname>device</structname>, specifies the parent device. For PCI devices, typically &pci-> is passed there. </para> </section> Loading Loading @@ -916,15 +922,15 @@ </para> <section id="card-management-chip-specific-snd-card-new"> <title>1. Allocating via <function>snd_card_create()</function>.</title> <title>1. Allocating via <function>snd_card_new()</function>.</title> <para> As mentioned above, you can pass the extra-data-length to the 4th argument of <function>snd_card_create()</function>, i.e. to the 5th argument of <function>snd_card_new()</function>, i.e. <informalexample> <programlisting> <![CDATA[ err = snd_card_create(index[dev], id[dev], THIS_MODULE, err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, sizeof(struct mychip), &card); ]]> </programlisting> Loading Loading @@ -954,7 +960,7 @@ <para> After allocating a card instance via <function>snd_card_create()</function> (with <function>snd_card_new()</function> (with <constant>0</constant> on the 4th arg), call <function>kzalloc()</function>. Loading @@ -963,7 +969,8 @@ <![CDATA[ struct snd_card *card; struct mychip *chip; err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, 0, &card); ..... chip = kzalloc(sizeof(*chip), GFP_KERNEL); ]]> Loading Loading @@ -1170,8 +1177,6 @@ return err; } snd_card_set_dev(card, &pci->dev); *rchip = chip; return 0; } Loading Loading @@ -1526,30 +1531,6 @@ </section> <section id="pci-resource-device-struct"> <title>Registration of Device Struct</title> <para> At some point, typically after calling <function>snd_device_new()</function>, you need to register the struct <structname>device</structname> of the chip you're handling for udev and co. ALSA provides a macro for compatibility with older kernels. Simply call like the following: <informalexample> <programlisting> <![CDATA[ snd_card_set_dev(card, &pci->dev); ]]> </programlisting> </informalexample> so that it stores the PCI's device pointer to the card. This will be referred by ALSA core functions later when the devices are registered. </para> <para> In the case of non-PCI, pass the proper device struct pointer of the BUS instead. (In the case of legacy ISA without PnP, you don't have to do anything.) </para> </section> <section id="pci-resource-entries"> <title>PCI Entries</title> <para> Loading Loading @@ -5740,7 +5721,8 @@ struct _snd_pcm_runtime { struct mychip *chip; int err; .... err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, 0, &card); .... chip = kzalloc(sizeof(*chip), GFP_KERNEL); .... Loading @@ -5752,7 +5734,7 @@ struct _snd_pcm_runtime { </informalexample> When you created the chip data with <function>snd_card_create()</function>, it's anyway accessible <function>snd_card_new()</function>, it's anyway accessible via <structfield>private_data</structfield> field. <informalexample> Loading @@ -5766,7 +5748,7 @@ struct _snd_pcm_runtime { struct mychip *chip; int err; .... err = snd_card_create(index[dev], id[dev], THIS_MODULE, err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, sizeof(struct mychip), &card); .... chip = card->private_data; Loading Documentation/devicetree/bindings/i2c/trivial-devices.txt +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ atmel,24c02 i2c serial eeprom (24cxx) atmel,at97sc3204t i2c trusted platform module (TPM) capella,cm32181 CM32181: Ambient Light Sensor catalyst,24c32 i2c serial eeprom cirrus,cs42l51 Cirrus Logic CS42L51 audio codec dallas,ds1307 64 x 8, Serial, I2C Real-Time Clock dallas,ds1338 I2C RTC with 56-Byte NV RAM dallas,ds1339 I2C Serial Real-Time Clock Loading Documentation/devicetree/bindings/misc/atmel-ssc.txt +8 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,14 @@ Required properties for devices compatible with "atmel,at91sam9g45-ssc": See Documentation/devicetree/bindings/dma/atmel-dma.txt for details. - dma-names: Must be "tx", "rx". Optional properties: - atmel,clk-from-rk-pin: bool property. - When SSC works in slave mode, according to the hardware design, the clock can get from TK pin, and also can get from RK pin. So, add this parameter to choose where the clock from. - By default the clock is from TK pin, if the clock from RK pin, this property is needed. Examples: - PDC transfer: ssc0: ssc@fffbc000 { Loading Documentation/devicetree/bindings/sound/armada-370db-audio.txt 0 → 100644 +27 −0 Original line number Diff line number Diff line Device Tree bindings for the Armada 370 DB audio ================================================ These Device Tree bindings are used to describe the audio complex found on the Armada 370 DB platform. Mandatory properties: * compatible: must be "marvell,a370db-audio" * marvell,audio-controller: a phandle that points to the audio controller of the Armada 370 SoC. * marvell,audio-codec: a set of three phandles that points to: 1/ the analog audio codec connected to the Armada 370 SoC 2/ the S/PDIF transceiver 3/ the S/PDIF receiver Example: sound { compatible = "marvell,a370db-audio"; marvell,audio-controller = <&audio_controller>; marvell,audio-codec = <&audio_codec &spdif_out &spdif_in>; status = "okay"; }; Documentation/devicetree/bindings/sound/cs42xx8.txt 0 → 100644 +28 −0 Original line number Diff line number Diff line CS42448/CS42888 audio CODEC Required properties: - compatible : must contain one of "cirrus,cs42448" and "cirrus,cs42888" - reg : the I2C address of the device for I2C - clocks : a list of phandles + clock-specifiers, one for each entry in clock-names - clock-names : must contain "mclk" - VA-supply, VD-supply, VLS-supply, VLC-supply: power supplies for the device, as covered in Documentation/devicetree/bindings/regulator/regulator.txt Example: codec: cs42888@48 { compatible = "cirrus,cs42888"; reg = <0x48>; clocks = <&codec_mclk 0>; clock-names = "mclk"; VA-supply = <®_audio>; VD-supply = <®_audio>; VLS-supply = <®_audio>; VLC-supply = <®_audio>; }; Loading
Documentation/DocBook/writing-an-alsa-driver.tmpl +27 −45 Original line number Diff line number Diff line Loading @@ -468,8 +468,6 @@ return err; } snd_card_set_dev(card, &pci->dev); *rchip = chip; return 0; } Loading @@ -492,7 +490,8 @@ } /* (2) */ err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, 0, &card); if (err < 0) return err; Loading Loading @@ -591,7 +590,8 @@ struct snd_card *card; int err; .... err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, 0, &card); ]]> </programlisting> </informalexample> Loading Loading @@ -809,28 +809,34 @@ <para> As mentioned above, to create a card instance, call <function>snd_card_create()</function>. <function>snd_card_new()</function>. <informalexample> <programlisting> <![CDATA[ struct snd_card *card; int err; err = snd_card_create(index, id, module, extra_size, &card); err = snd_card_new(&pci->dev, index, id, module, extra_size, &card); ]]> </programlisting> </informalexample> </para> <para> The function takes five arguments, the card-index number, the id string, the module pointer (usually The function takes six arguments: the parent device pointer, the card-index number, the id string, the module pointer (usually <constant>THIS_MODULE</constant>), the size of extra-data space, and the pointer to return the card instance. The extra_size argument is used to allocate card->private_data for the chip-specific data. Note that these data are allocated by <function>snd_card_create()</function>. are allocated by <function>snd_card_new()</function>. </para> <para> The first argument, the pointer of struct <structname>device</structname>, specifies the parent device. For PCI devices, typically &pci-> is passed there. </para> </section> Loading Loading @@ -916,15 +922,15 @@ </para> <section id="card-management-chip-specific-snd-card-new"> <title>1. Allocating via <function>snd_card_create()</function>.</title> <title>1. Allocating via <function>snd_card_new()</function>.</title> <para> As mentioned above, you can pass the extra-data-length to the 4th argument of <function>snd_card_create()</function>, i.e. to the 5th argument of <function>snd_card_new()</function>, i.e. <informalexample> <programlisting> <![CDATA[ err = snd_card_create(index[dev], id[dev], THIS_MODULE, err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, sizeof(struct mychip), &card); ]]> </programlisting> Loading Loading @@ -954,7 +960,7 @@ <para> After allocating a card instance via <function>snd_card_create()</function> (with <function>snd_card_new()</function> (with <constant>0</constant> on the 4th arg), call <function>kzalloc()</function>. Loading @@ -963,7 +969,8 @@ <![CDATA[ struct snd_card *card; struct mychip *chip; err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, 0, &card); ..... chip = kzalloc(sizeof(*chip), GFP_KERNEL); ]]> Loading Loading @@ -1170,8 +1177,6 @@ return err; } snd_card_set_dev(card, &pci->dev); *rchip = chip; return 0; } Loading Loading @@ -1526,30 +1531,6 @@ </section> <section id="pci-resource-device-struct"> <title>Registration of Device Struct</title> <para> At some point, typically after calling <function>snd_device_new()</function>, you need to register the struct <structname>device</structname> of the chip you're handling for udev and co. ALSA provides a macro for compatibility with older kernels. Simply call like the following: <informalexample> <programlisting> <![CDATA[ snd_card_set_dev(card, &pci->dev); ]]> </programlisting> </informalexample> so that it stores the PCI's device pointer to the card. This will be referred by ALSA core functions later when the devices are registered. </para> <para> In the case of non-PCI, pass the proper device struct pointer of the BUS instead. (In the case of legacy ISA without PnP, you don't have to do anything.) </para> </section> <section id="pci-resource-entries"> <title>PCI Entries</title> <para> Loading Loading @@ -5740,7 +5721,8 @@ struct _snd_pcm_runtime { struct mychip *chip; int err; .... err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, 0, &card); .... chip = kzalloc(sizeof(*chip), GFP_KERNEL); .... Loading @@ -5752,7 +5734,7 @@ struct _snd_pcm_runtime { </informalexample> When you created the chip data with <function>snd_card_create()</function>, it's anyway accessible <function>snd_card_new()</function>, it's anyway accessible via <structfield>private_data</structfield> field. <informalexample> Loading @@ -5766,7 +5748,7 @@ struct _snd_pcm_runtime { struct mychip *chip; int err; .... err = snd_card_create(index[dev], id[dev], THIS_MODULE, err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, sizeof(struct mychip), &card); .... chip = card->private_data; Loading
Documentation/devicetree/bindings/i2c/trivial-devices.txt +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ atmel,24c02 i2c serial eeprom (24cxx) atmel,at97sc3204t i2c trusted platform module (TPM) capella,cm32181 CM32181: Ambient Light Sensor catalyst,24c32 i2c serial eeprom cirrus,cs42l51 Cirrus Logic CS42L51 audio codec dallas,ds1307 64 x 8, Serial, I2C Real-Time Clock dallas,ds1338 I2C RTC with 56-Byte NV RAM dallas,ds1339 I2C Serial Real-Time Clock Loading
Documentation/devicetree/bindings/misc/atmel-ssc.txt +8 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,14 @@ Required properties for devices compatible with "atmel,at91sam9g45-ssc": See Documentation/devicetree/bindings/dma/atmel-dma.txt for details. - dma-names: Must be "tx", "rx". Optional properties: - atmel,clk-from-rk-pin: bool property. - When SSC works in slave mode, according to the hardware design, the clock can get from TK pin, and also can get from RK pin. So, add this parameter to choose where the clock from. - By default the clock is from TK pin, if the clock from RK pin, this property is needed. Examples: - PDC transfer: ssc0: ssc@fffbc000 { Loading
Documentation/devicetree/bindings/sound/armada-370db-audio.txt 0 → 100644 +27 −0 Original line number Diff line number Diff line Device Tree bindings for the Armada 370 DB audio ================================================ These Device Tree bindings are used to describe the audio complex found on the Armada 370 DB platform. Mandatory properties: * compatible: must be "marvell,a370db-audio" * marvell,audio-controller: a phandle that points to the audio controller of the Armada 370 SoC. * marvell,audio-codec: a set of three phandles that points to: 1/ the analog audio codec connected to the Armada 370 SoC 2/ the S/PDIF transceiver 3/ the S/PDIF receiver Example: sound { compatible = "marvell,a370db-audio"; marvell,audio-controller = <&audio_controller>; marvell,audio-codec = <&audio_codec &spdif_out &spdif_in>; status = "okay"; };
Documentation/devicetree/bindings/sound/cs42xx8.txt 0 → 100644 +28 −0 Original line number Diff line number Diff line CS42448/CS42888 audio CODEC Required properties: - compatible : must contain one of "cirrus,cs42448" and "cirrus,cs42888" - reg : the I2C address of the device for I2C - clocks : a list of phandles + clock-specifiers, one for each entry in clock-names - clock-names : must contain "mclk" - VA-supply, VD-supply, VLS-supply, VLC-supply: power supplies for the device, as covered in Documentation/devicetree/bindings/regulator/regulator.txt Example: codec: cs42888@48 { compatible = "cirrus,cs42888"; reg = <0x48>; clocks = <&codec_mclk 0>; clock-names = "mclk"; VA-supply = <®_audio>; VD-supply = <®_audio>; VLS-supply = <®_audio>; VLC-supply = <®_audio>; };