linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Erik Gilling <konkers@android.com>
Cc: linux-tegra@vger.kernel.org,
	spi-devel-general@lists.sourceforge.net,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Russell King <linux@arm.linux.org.uk>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4] spi: add spi_tegra driver
Date: Thu, 2 Sep 2010 08:22:49 -0600	[thread overview]
Message-ID: <AANLkTimonLa1mUVSHR=QnR48HPtAZ5BW3BsVsg7MWALy@mail.gmail.com> (raw)
In-Reply-To: <1283379393-14831-1-git-send-email-konkers@android.com>

On Wed, Sep 1, 2010 at 4:16 PM, Erik Gilling <konkers@android.com> wrote:
> v2 changes:
>  from Thierry Reding:
>    * add "select TEGRA_SYSTEM_DMA" to Kconfig
>  from Grant Likely:
>    * add oneline description to header
>    * inline references to DRIVER_NAME
>    * inline references to BUSY_TIMEOUT
>    * open coded bytes_per_word()
>    * spi_readl/writel -> spi_tegra_readl/writel
>    * move transfer validation to spi_tegra_transfer
>    * don't request_mem_region iomem as platform bus does that for us
>    * __exit -> __devexit
>
> v3 changes:
>  from Russell King:
>    * put request_mem_region back int
>  from Grant Likely:
>    * remove #undef DEBUG
>    * add SLINK_ to register bit defines
>    * remove unused bytes_per_word
>    * make spi_tegra_readl/writel static linine
>    * various refactoring for clarity
>    * mark err if BSY bit is not cleared after 1000 retries
>    * move spinlock to protect setting of RDY bit
>    * subsys_initcall -> module_init
>
> v3 changes:
>  from Grant Likely:
>    * update spi_tegra to use PTR_ERRless dma API
>
> Signed-off-by: Erik Gilling <konkers@android.com>
> Cc: Thierry Reding <thierry.reding@avionic-design.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Russell King <linux@arm.linux.org.uk>

Hi Erik,

Go ahead and add my Acked-by line and merge this via the tegra tree to
avoid ordering issues.  I also have a few more minor comments below.

g.

> +       /* FIXME: should probably control CS manually so that we can be sure
> +        * it does not go low between transfer and to support delay_usecs
> +        * correctly.
> +        */

Yes, you'll probably want to revisit this.  A lot of SPI hardware
doesn't understand that the actual transfer may be longer that the
data it immediately knows about.  Also, it is common to use GPIOs as
chip selects.

> +static void spi_tegra_cleanup(struct spi_device *spi)
> +{
> +       dev_dbg(&spi->dev, "cleanup\n");
> +}

Remove the empty hook

> +static int __init spi_tegra_probe(struct platform_device *pdev)
> +{
> +       struct spi_master       *master;
> +       struct spi_tegra_data   *tspi;
> +       struct resource         *r;
> +       int ret;
> +
> +       master = spi_alloc_master(&pdev->dev, sizeof *tspi);
> +       if (master == NULL) {
> +               dev_err(&pdev->dev, "master allocation failed\n");
> +               return -ENOMEM;
> +       }
> +
> +       /* the spi->mode bits understood by this driver: */
> +       master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
> +
> +       if (pdev->id != -1)
> +               master->bus_num = pdev->id;

even if pdev->id is -1, you probably want to set master->bus_num to is
so that a spi bus number can be dynamically assigned.

  parent reply	other threads:[~2010-09-02 14:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30  0:37 [PATCH] spi: add spi_tegra driver Colin Cross
2010-07-30  7:54 ` Thierry Reding
     [not found]   ` <20100730075443.GA17814-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2010-08-02 18:48     ` Erik Gilling
2010-08-01  6:21 ` Grant Likely
     [not found]   ` <AANLkTimUm_wj+gyxTa=X+845kLj1sZ9GF+jsmsBwxnLN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-12  0:31     ` Erik Gilling
2010-08-12 15:24       ` Russell King - ARM Linux
     [not found]         ` <20100812152424.GB31982-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2010-08-12 18:44           ` Erik Gilling
     [not found] ` <1280450224-25118-1-git-send-email-ccross-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2010-08-12  0:47   ` [PATCH v2] " Erik Gilling
     [not found]     ` <1281574023-25160-1-git-send-email-konkers-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>
2010-08-12 19:54       ` Grant Likely
     [not found]         ` <AANLkTim4nL+Re=qc55CGS+ksq+ACtGe=vqOeGQ3HbQWM-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-25 21:22           ` Erik Gilling
     [not found]             ` <AANLkTincgapUK5ncs_t3ax=1Kt_56GdR_RVwRqdCm5ge-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-27 19:26               ` Erik Gilling
     [not found]                 ` <AANLkTin4HxVLt=4VH-NQWhB-p_2EpX_yoTcwEOTJP3m_-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-27 20:13                   ` Grant Likely
2010-08-25 21:23       ` [PATCH v3] " Erik Gilling
2010-09-01 22:16         ` [PATCH v4] " Erik Gilling
2010-09-01 22:18           ` Erik Gilling
2010-09-02 14:22           ` Grant Likely [this message]
     [not found]             ` <AANLkTimonLa1mUVSHR=QnR48HPtAZ5BW3BsVsg7MWALy-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-10  6:31               ` Grant Likely
     [not found]                 ` <AANLkTini_PA3J+R4gEP4DzFpcAxHhdmDbcXxOtj2h81O-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-11 21:01                   ` Erik Gilling

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='AANLkTimonLa1mUVSHR=QnR48HPtAZ5BW3BsVsg7MWALy@mail.gmail.com' \
    --to=grant.likely@secretlab.ca \
    --cc=konkers@android.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=thierry.reding@avionic-design.de \
    /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;
as well as URLs for NNTP newsgroup(s).