linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: Andrei Konovalov <akonovalov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linuxppc-embedded-mnsaURCQ41sdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH] Simple driver for Xilinx SPI controler.
Date: Thu, 7 Jun 2007 12:21:00 -0700	[thread overview]
Message-ID: <200706071221.00571.david-b@pacbell.net> (raw)
In-Reply-To: <466850FB.5030505-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>

On Thursday 07 June 2007, Andrei Konovalov wrote:

> >> +/* Simple macros to get the code more readable */
> >> +#define xspi_in16(addr)		in_be16((u16 __iomem *)(addr))
> >> +#define xspi_in32(addr)		in_be32((u32 __iomem *)(addr))
> >> +#define xspi_out16(addr, value)	out_be16((u16 __iomem *)(addr), (value))
> >> +#define xspi_out32(addr, value)	out_be32((u32 __iomem *)(addr), (value))
> > 
> > I'm rather used to seeing I/O addressses passed around as "void __iomem *"
> > so those sorts of cast are not needed...  :)
> 
> I've decided to make the base_address (u8 __iomem *) to make it easier to
> add the register offsets to the base. Like that:

Adding register offsets works with "void __iomem *" too ...


> > You should not need an abort primitive.  ...
> 
> I am paranoid enough not to rely 100% on the spi_device's and the spi_bitbang
> doing all that :)
> Agreed, xspi_abort_transfer is bad name here. But I still would like to
> leave these two writes:
> 
> +	/* Deselect the slave on the SPI bus */
> +	xspi_out32(regs_base + XSPI_SSR_OFFSET, 0xffff);
> +	/* Disable the transmitter */
> +	xspi_out16(regs_base + XSPI_CR_OFFSET,
> +		   XSPI_CR_TRANS_INHIBIT | XSPI_CR_MANUAL_SSELECT);
> 
> in xilinx_spi_remove(). Just in case :)

What happens when you add a BUG_ON to catch the device still being active?

Really, you need to rely on the rest of the system working correctly.



> > I take it you can't support SPI_CS_HIGH??
> 
> There is no clear indication in the SPI controller docs that SPI_CS_HIGH
> would work. I suspect it would as we don't use the ability of the controller
> to generate the chip selects automatically (the auto mode doesn't support SPI_CS_HIGH).
> But it is more safe to advertise SPI_CS_HIGH is not supported.

If you don't explicitly support it, it's unlikely to work.  :)

- Dave


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

  parent reply	other threads:[~2007-06-07 19:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 14:05 [PATCH] Simple driver for Xilinx SPI controler Andrei Konovalov
2007-06-06 16:03 ` Stephen Neuendorffer
2007-06-06 17:57   ` Andrei Konovalov
2007-06-06 18:06     ` Stephen Neuendorffer
2007-06-06 19:00       ` Grant Likely
     [not found]         ` <fa686aa40706061200u1141fcc9k73b7cc80c07240d1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-06-06 19:06           ` Stephen Neuendorffer
2007-06-06 19:55             ` Grant Likely
2007-06-06 20:49         ` Wolfgang Reissnegger
2007-06-06 20:55           ` Grant Likely
     [not found] ` <4666BF47.8080103-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
2007-06-07  5:09   ` David Brownell
2007-06-07 18:39     ` [spi-devel-general] " Andrei Konovalov
     [not found]       ` <466850FB.5030505-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
2007-06-07 19:21         ` David Brownell [this message]
     [not found]     ` <200706062209.09731.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-09 16:58       ` Andrei Konovalov
     [not found]         ` <466ADC4B.4050806-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
2007-06-12 16:28           ` David Brownell
     [not found]             ` <200706120928.09176.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-06-13 14:55               ` Andrei Konovalov

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=200706071221.00571.david-b@pacbell.net \
    --to=david-b-ybekhbn/0ldr7s880joybq@public.gmane.org \
    --cc=akonovalov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org \
    --cc=linuxppc-embedded-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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;
as well as URLs for NNTP newsgroup(s).