linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier.adi@gmail.com>
To: Yi Li <yi.li@analog.com>
Cc: spi-devel-general@lists.sourceforge.net,
	David Brownell <dbrownell@users.sourceforge.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Bryan Wu <cooloney@kernel.org>
Subject: Re: [PATCH 1/2] spi: new SPI bus lock/unlock functions
Date: Tue, 22 Sep 2009 10:15:37 -0400	[thread overview]
Message-ID: <8bd0f97a0909220715y48fb95bclda87370eca67dfd9@mail.gmail.com> (raw)
In-Reply-To: <1253224997-7422-1-git-send-email-vapier@gentoo.org>

On Thu, Sep 17, 2009 at 18:03, Mike Frysinger wrote:
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -653,6 +653,54 @@ static void spi_complete(void *arg)
> +int spi_lock_bus(struct spi_device *spi)
> +{
> +       if (spi->master->lock_bus)
> +               return spi->master->lock_bus(spi);
> +       else
> +               return 0;
> +}
> +EXPORT_SYMBOL_GPL(spi_lock_bus);
> +
> +int spi_unlock_bus(struct spi_device *spi)
> +{
> +       if (spi->master->unlock_bus)
> +               return spi->master->unlock_bus(spi);
> +       else
> +               return 0;
> +}
> +EXPORT_SYMBOL_GPL(spi_unlock_bus);

there's nothing Blackfin-specific in the implementation of these
functions.  i think the way we should be handling these is by doing:
 - remove {lock,unlock}_bus functions from spi_master
 - move the {lock,unlock}_bus code from spi_bfin5xx.c to spi.c
 - drop the SPI_BFIN_LOCK Kconfig
 - add a new spi_master flag to spi.h like SPI_MASTER_HALF_DUPLEX --
SPI_MASTER_LOCK_BUS
 - have spi_bfin5xx.c/bfin_sport_spi.c add that flag to its master setup
 - have the common spi code key off of that flag to return ENOSYS
 - have the mmc_spi code check that bit in the master before falling
back to its hack
-mike

  parent reply	other threads:[~2009-09-22 14:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17 22:03 Mike Frysinger
2009-09-17 22:03 ` [PATCH 2/2] mmc_spi: lock the SPI bus when accessing the card Mike Frysinger
2009-09-18  0:29   ` [spi-devel-general] [PATCH 2/2] mmc_spi: lock the SPI bus whenaccessing " H Hartley Sweeten
2009-09-18  0:52     ` [PATCH 2/2 v2] mmc_spi: lock the SPI bus when accessing " Mike Frysinger
2009-09-18 21:30       ` Andrew Morton
2009-09-17 22:45 ` [spi-devel-general] [PATCH 1/2] spi: new SPI bus lock/unlockfunctions H Hartley Sweeten
2009-09-17 22:53   ` Mike Frysinger
2009-09-18 23:00     ` H Hartley Sweeten
2009-09-19 19:11       ` Mike Frysinger
2009-09-21  8:08       ` Li Yi
2009-09-18 21:29 ` [PATCH 1/2] spi: new SPI bus lock/unlock functions Andrew Morton
2009-09-21  6:33   ` Li Yi
2009-09-21 13:36     ` Mike Frysinger
2009-09-22 14:15 ` Mike Frysinger [this message]
2009-12-16 22:49 ` [spi-devel-general] [PATCH 1/2] spi: new SPI bus lock/unlockfunctions H Hartley Sweeten
2009-12-16 23:00   ` Mike Frysinger

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=8bd0f97a0909220715y48fb95bclda87370eca67dfd9@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cooloney@kernel.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=yi.li@analog.com \
    --subject='Re: [PATCH 1/2] spi: new SPI bus lock/unlock functions' \
    /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

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).