Re: [PATCH 1/2] powerpc: add platform registration for ALSA SoC drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Grant Likely wrote:

> Can you not dynamically assign an id?  If alsa soc needs a unique id
> number, then just create a lookup function. 

What I need is something like a hashing function that can convert a "struct device_node *" into an "int".  I'm going to have two functions that independently parse the device tree and locate a specific node.  Both functions will "register the node" with asoc, but they'll use an integer ID to uniquely identify the node.

At least, that's the way ASoC likes to operate.  AsoC takes a fixed string plus a unique integer.  I could technically create a unique string for each DMA device, and have the integer always be 0.

> Something like
> of_asoc_phandle_to_codec_id() that will either return a previously
> assigned id, or will assign a new id.  You shouldn't ever need to add
> data to the tree at runtime.

I know.  It just would have been nice if my nodes already had phandles in them.

-- 
Timur Tabi
Linux kernel developer at Freescale
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux