<div dir="ltr"><div>is this Finally Working or you are facing some issues ?<br><br></div>Regards<br>Sanjeev Sharma<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 13, 2014 at 6:43 PM, Josh Cartwright <span dir="ltr"><<a href="mailto:joshc@eso.teric.us" target="_blank">joshc@eso.teric.us</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Thu, Jun 12, 2014 at 04:39:25PM +0300, amit mehta wrote:<br>
> We are working on a school project in which we are trying to develop a<br>
> audio mixer on Zedboard (Development board from Digilent). We have<br>
> developed the IP and have integrated it with the overall hardware<br>
> using Programmable logic. This board has ARM core. We have a Digilent<br>
> pre-configured Linux source which we cross-compiled for ARM board,<br>
> device tree blob and bootloader for Zync(BOOT.BIN). The system boots<br>
> fine with Linux, but now to expose the recently added hardware<br>
> implementation of audio mixer, we are trying to develop the driver<br>
> using the platform driver API. Currently, In our reconfigurable<br>
> hardware, we have 2 channels and a mixer and we want to access those<br>
> individually as some file nodes under /proc FS. The sample code is<br>
> shown below:<br>
><br>
</div>[..]<br>
<br>
It wasn't clear what your problem was, or if you were just asking for<br>
advice, but I will add one comment that will hopefully save you some<br>
debugging time:<br>
<br>
> #include <linux/kernel.h><br>
> #include <linux/module.h><br>
> #include <asm/uaccess.h> /*Needed for copy_from_user */<br>
> #include <asm/io.h> /*Needed for IO Read/Write Functions */<br>
> #include <linux/proc_fs.h> /*Needed for Proc File System Functions */<br>
> #include <linux/seq_file.h> /*Needed for Sequence File Operations */<br>
> #include <linux/platform_device.h> /*Needed for Platform Driver Functions */<br>
><br>
> /* Define Driver Name */<br>
> #define DRIVER_NAME "myiir"<br>
><br>
> unsigned long *base_addr; /* Vitual Base Address */<br>
> struct resource *res; /* Device Resource Structure */<br>
> unsigned long remap_size; /* Device Memory Size */<br>
<br>
The way this driver is written, you will actually be probed three times,<br>
once per node in the device tree. The drivers' use of global state here<br>
is going to bite you.<br>
<br>
[..]<br>
> static int __devinit myiir_probe(struct platform_device *pdev)<br>
> {<br>
> struct proc_dir_entry *myiir_proc_entry[3];<br>
> int ret = 0;<br>
><br>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);<br>
> if (!res) {<br>
> dev_err(&pdev->dev, "No memory resource\n");<br>
> return -ENODEV;<br>
<div class="">> }<br>
> remap_size = res->end - res->start + 1;<br>
><br>
</div>> if (!request_mem_region(res->start, remap_size, pdev->name)) {<br>
> dev_err(&pdev->dev, "Cannot request IO\n");<br>
> return -ENXIO;<br>
<div class="">> }<br>
><br>
> base_addr = ioremap(res->start, remap_size);<br>
</div>> if (base_addr == NULL) {<br>
> dev_err(&pdev->dev, "Couldn't ioremap memory at 0x%08lx\n",<br>
> (unsigned long)res->start);<br>
> ret = -ENOMEM;<br>
> goto err_release_region;<br>
> }<br>
[..]<br>
<div class="">> static const struct of_device_id myiir_of_match[] __devinitconst = {<br>
> {.compatible = "dglnt,myiir-audio-ch0"},<br>
> {.compatible = "dglnt,myiir-audio-ch1"},<br>
> {.compatible = "dglnt,myiir-audio-mix0"},<br>
> {},<br>
> };<br>
<br>
</div>Are these really separate IP blocks entirely, or just multiple instances<br>
of the same IP block (perhaps with different parameters used during<br>
synthesis)? If the latter, then they should really share a compatible<br>
string that reflects the name/version of the IP block; handling which<br>
block is which channel should be done at a higher level.<br>
<br>
Good luck,<br>
<br>
Josh<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br></div>