All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Joel Holdsworth <joel@airwebreathe.org.uk>,
	Moritz Fischer <moritz.fischer@ettus.com>
Cc: Alan Tull <atull@opensource.altera.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Rob Herring <robh@kernel.org>,
	Devicetree List <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-spi@vger.kernel.org, Clifford Wolf <clifford@clifford.at>
Subject: Re: [PATCH v8 3/3] fpga: Add support for Lattice iCE40 FPGAs
Date: Wed, 9 Nov 2016 19:39:59 +0100	[thread overview]
Message-ID: <a580bfa4-7852-aaf8-3a44-24da717f3d51@denx.de> (raw)
In-Reply-To: <5828eb84-ab29-49e2-34f0-3cd7e527ca66@airwebreathe.org.uk>

On 11/09/2016 07:37 PM, Joel Holdsworth wrote:
> On 09/11/16 05:01, Marek Vasut wrote:
>> On 11/08/2016 06:30 PM, Joel Holdsworth wrote:
>>>>>> On the whole, I don't think the zero-length transfers are too
>>>>>> egregiously bad, and all the alternatives seem worse to me.
>>>>>
>>>>> So why not turn the CS line into GPIO and just toggle the GPIO?
>>>>
>>>> Does that work with *all* SPI controllers?
>>>>
>>>
>>> It does not - no. See my other email.
>>
>> And is that line an actual CS of that lattice chip or a generic input
>> which almost works like CS?
>>
> 
> I mean a generic output vs. a special CS output built into the SPI
> master of the application processor. Take a look at how spi_set_cs(..)
> works:

No. I am asking whether the signal which is INPUT on the iCE40 side is
really a chipselect signal for the SPI bus OR something which mostly
behaves/looks like a chipselect but is not really a chipselect.

> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/spi.c?id=refs/tags/v4.9-rc4#n695
> 
> 
> static void spi_set_cs(struct spi_device *spi, bool enable)
> {
>     if (spi->mode & SPI_CS_HIGH)
>         enable = !enable;
> 
>     if (gpio_is_valid(spi->cs_gpio))
>         gpio_set_value(spi->cs_gpio, !enable);
>     else if (spi->master->set_cs)
>         spi->master->set_cs(spi, !enable);
> }
> 
> So on some SPI masters, spi->master->set_cs is handled separately from
> normal GPIOs. Hence why I want to use this machinery, rather than doing
> it with a GPIO.

This is not relevant. FYI: using separate GPIO as a SPI chip select has
it's own problems.

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2016-11-09 18:48 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07  2:49 [PATCH v8 1/3] of: Add vendor prefix for Lattice Semiconductor Joel Holdsworth
2016-11-07  2:49 ` Joel Holdsworth
2016-11-07  2:49 ` [PATCH v8 2/3] Documentation: Add binding document for Lattice iCE40 FPGA manager Joel Holdsworth
2016-11-07 17:53   ` Marek Vasut
2016-11-07 17:53     ` Marek Vasut
2016-11-07 18:57     ` Joel Holdsworth
2016-11-14 16:11   ` Rob Herring
2016-11-18 18:56     ` atull
2016-11-18 18:56       ` atull
2016-11-18 19:17       ` Moritz Fischer
2016-11-18 19:17         ` Moritz Fischer
2016-11-18 19:28         ` Marek Vasut
2016-11-18 19:28           ` Marek Vasut
2016-11-07  2:49 ` [PATCH v8 3/3] fpga: Add support for Lattice iCE40 FPGAs Joel Holdsworth
2016-11-07  2:49   ` Joel Holdsworth
2016-11-07 18:01   ` Marek Vasut
2016-11-07 18:01     ` Marek Vasut
2016-11-07 18:49     ` Joel Holdsworth
2016-11-07 18:49       ` Joel Holdsworth
2016-11-07 18:53       ` Marek Vasut
2016-11-08 17:06         ` Moritz Fischer
2016-11-08 17:30           ` Joel Holdsworth
2016-11-08 17:30             ` Joel Holdsworth
2016-11-09 12:01             ` Marek Vasut
2016-11-09 18:37               ` Joel Holdsworth
2016-11-09 18:39                 ` Marek Vasut [this message]
2016-11-09 18:54                   ` Joel Holdsworth
2016-11-09 18:54                     ` Joel Holdsworth
2016-11-10 12:11                     ` Marek Vasut
2016-11-10 12:11                       ` Marek Vasut
2016-11-08 17:13         ` Joel Holdsworth
2016-11-08 17:13           ` Joel Holdsworth
2016-11-07 18:26   ` Moritz Fischer
2016-11-07 18:26     ` Moritz Fischer
2016-11-07 19:02     ` Joel Holdsworth
2016-11-07 19:02       ` Joel Holdsworth
2016-11-07 21:41       ` Moritz Fischer
2016-11-07 21:41         ` Moritz Fischer

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=a580bfa4-7852-aaf8-3a44-24da717f3d51@denx.de \
    --to=marex@denx.de \
    --cc=atull@opensource.altera.com \
    --cc=clifford@clifford.at \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=joel@airwebreathe.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=moritz.fischer@ettus.com \
    --cc=robh@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.