mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox <barebox@lists.infradead.org>
Subject: SPI chip select problem
Date: Mon, 25 Jun 2012 11:45:06 +0400	[thread overview]
Message-ID: <CAA4bVAHvo6i3uOoEao=q8RCP+i3NZ+9XnmvA=mKjEYZztrmB2g@mail.gmail.com> (raw)

Hi!

I have added spi controller driver for one of my MIPS boards and
found, that there is a problem with chip select.

During initialisation we call *_spi_setup() method. It switch chip
select and frequency for every probing spi slave chip.
But after initialisation __we never__ call this method. So if I have
more than 1 spi slave chip, I can use only last of them.

There is the 'cs_change' flag for *_spi_transfer() method, but this
flag does not used at all!

I have made quick-and-dirty patch:

--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -196,6 +196,8 @@ EXPORT_SYMBOL(spi_register_master);

 int spi_sync(struct spi_device *spi, struct spi_message *message)
 {
+       spi->master->setup(spi);
+
        return spi->master->transfer(spi, message);
 }

-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2012-06-25  7:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25  7:45 Antony Pavlov [this message]
2012-06-25  8:53 ` Johannes Stezenbach
2012-06-25 10:07   ` Antony Pavlov
2012-06-25 10:48     ` Johannes Stezenbach

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='CAA4bVAHvo6i3uOoEao=q8RCP+i3NZ+9XnmvA=mKjEYZztrmB2g@mail.gmail.com' \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /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