mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Subhasish Ghosh" <subhasish@mistralsolutions.com>
To: "Nori, Sekhar" <nsekhar@ti.com>
Cc: "Greg KH" <greg@kroah.com>,
	<davinci-linux-open-source@linux.davincidsp.com>,
	<linux-arm-kernel@lists.infradead.org>,
	"Watkins, Melissa" <m-watkins@ti.com>,
	<sachi@mistralsolutions.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Randy Dunlap" <randy.dunlap@oracle.com>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 08/11] tty: add pruss SUART driver
Date: Fri, 20 May 2011 12:44:00 +0530	[thread overview]
Message-ID: <B7F8B2D7C5D5428B911477CBC0320090@subhasishg> (raw)
In-Reply-To: <B85A65D85D7EB246BE421B3FB0FBB593024CF13FC2@dbde02.ent.ti.com>

Hi Sekhar,

>> > ok, so what you are suggesting is that I implement some
>> > callbacks (like .fifo_alloc, .fifo_dealloc) which can allocate
>> > memory using sram_alloc.
>> > My doubt is, if already such API's are there (by Russel) or you
>> > are suggesting to implement them.
>>
>> I can add the fifo_alloc/dealloc as part of the suart platform_data,
>> Is that's what you are suggesting. If you may please point me out
>> to any example. I am just not clear with this.
>
> Yes, that's what I am suggesting. I don't have an exact example
> for you, but for an example of how function pointers can be passed
> along in platform data you can look at the platform data for
> DA8x FB driver in include/video/da8xx-fb.h.
>

Does this look ok.
This code snippet is in the driver file.

        if (soft_uart->use_sram) {
                soft_uart->suart_iomap.p_fifo_buff_virt_base =
                pdata->fifo_alloc(SUART_CNTX_SZ * NR_SUART * 2,
                (dma_addr_t *) 
&soft_uart->suart_iomap.p_fifo_buff_phys_base);
                if (!soft_uart->suart_iomap.p_fifo_buff_virt_base) {
                        soft_uart->suart_iomap.p_fifo_buff_virt_base =
                        dma_alloc_coherent(&pdev->dev,
                        SUART_CNTX_SZ * NR_SUART * 2,
                        (dma_addr_t *) &soft_uart->suart_iomap.
                        p_fifo_buff_phys_base, GFP_KERNEL);
                        soft_uart->use_sram = false;
                        if (!soft_uart->suart_iomap.p_fifo_buff_virt_base)
                                goto probe_exit_iounmap;
                }
        } else {
                soft_uart->suart_iomap.p_fifo_buff_virt_base =
                dma_alloc_coherent(&pdev->dev,
                SUART_CNTX_SZ * NR_SUART * 2,
                (dma_addr_t *) &soft_uart->suart_iomap.
                p_fifo_buff_phys_base, GFP_KERNEL);
                if (!soft_uart->suart_iomap.p_fifo_buff_virt_base)
                        goto probe_exit_iounmap;
        }

I added the fifo_alloc into the suart_data of the board file.

static struct da850_evm_pruss_suart_data suart_data = {
        .version        = 1,
        .setup          = da850_evm_pruss_suart_setup,
        .fifo_alloc     = sram_alloc,
        .fifo_free      = sram_free,
};

Best Regards,
Subhasish Ghosh
 


  reply	other threads:[~2011-05-20  7:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16  5:17 Subhasish Ghosh
2011-05-17 18:32 ` Nori, Sekhar
2011-05-20  7:14   ` Subhasish Ghosh [this message]
     [not found] <1303474109-6212-1-git-send-email-subhasish@mistralsolutions.com>
2011-04-22 12:08 ` Subhasish Ghosh
2011-04-25 21:20   ` Greg KH
2011-04-26  6:51     ` Nori, Sekhar
2011-04-26 12:45       ` Greg KH
2011-04-27  5:23         ` Subhasish Ghosh
2011-04-27 11:19           ` Nori, Sekhar
2011-04-27 13:15             ` Subhasish Ghosh
2011-04-27 17:50               ` Nori, Sekhar
2011-05-02  8:34                 ` Subhasish Ghosh
2011-05-02 17:15                   ` Nori, Sekhar
2011-05-10 10:54             ` Subhasish Ghosh
2011-05-10 13:13               ` Nori, Sekhar
2011-05-13 12:10                 ` Subhasish Ghosh
2011-05-09 13:39   ` Subhasish Ghosh
2011-05-09 13:46     ` Alan Cox
2011-05-09 13:50       ` Subhasish Ghosh
2011-05-09 13:55         ` Alan Cox
2011-05-10  6:17           ` Subhasish Ghosh
2011-05-10 13:32             ` Alan Cox
2011-05-11  7:01               ` Subhasish Ghosh
2011-05-11 10:35                 ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B7F8B2D7C5D5428B911477CBC0320090@subhasishg \
    --to=subhasish@mistralsolutions.com \
    --cc=akpm@linux-foundation.org \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=greg@kroah.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-watkins@ti.com \
    --cc=nsekhar@ti.com \
    --cc=randy.dunlap@oracle.com \
    --cc=sachi@mistralsolutions.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®