Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1507970

Re: [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Joel Holdsworth <joel@airwebreathe.org.uk>
Newsgroups linux.kernel
Subject Re: [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs
Date Tue, 25 Oct 2016 07:00:01 +0200
Message-ID <sw209-Rp-1@gated-at.bofh.it> (permalink)
References <svFGi-35B-15@gated-at.bofh.it> <svFGi-35B-13@gated-at.bofh.it> <svW4p-5oE-13@gated-at.bofh.it> <svW4p-5oE-11@gated-at.bofh.it>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Painless-Spam-Score -4.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 31
Organization linux.* mail to news gateway
X-Original-Cc ijc+devicetree@hellion.org.uk, galak@codeaurora.org, mark.rutland@arm.com, pawel.moll@arm.com, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Mon, 24 Oct 2016 22:51:48 -0600
X-Original-Message-ID <331cd8da-f69a-b51a-ddbd-f18ee44cac8a@airwebreathe.org.uk>
X-Original-References <1477283989-21947-1-git-send-email-joel@airwebreathe.org.uk> <1477283989-21947-2-git-send-email-joel@airwebreathe.org.uk> <alpine.DEB.2.02.1610241615280.14525@linuxheads99> <20161024222805.GA5754@live.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1507970

Show key headers only | View raw



On 10/24/2016 04:28 PM, Moritz Fischer wrote:
> Hi Joel,
>
> Ha, finally someone beat me to submitting my driver,
> I had an ugly hack to bitbang the SPI since I couldn't figure
> out a good way to assert the creset after the CS.
>
> Thanks!
>

Hi Moritz - yeah I figured someone might have a driver in the works.

I think my set_cs() function is ok-ish. It's copied from spi_set_cs() in 
drivers/spi/spi.c . This function is a static internal helper, so I 
copy/pasted the function into the ice40 driver. Given that it's only 
4-lines of code, it didn't seem too bad - though I'm not exactly sure 
why spi_set_cs() isn't a public API. It seems like quite a common-place 
thing to need to do with certain devices.

However, perhaps the function is internal because the authors of the SPI 
framework foresaw how easy it would be to screw up a shared bus with 
that function. I had to take care to make sure the SPI bus was locked 
throughout.

Do you agree that it's the right thing to copy the function in? Or do 
you think it would be better to ask for spi_set_cs to be exposed publicly?

Best Regards
Joel

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[v2 1/2] of: Add vendor prefix for Lattice Semiconductor Joel Holdsworth <joel@airwebreathe.org.uk> - 2016-10-24 07:10 +0200
  [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs Joel Holdsworth <joel@airwebreathe.org.uk> - 2016-10-24 07:10 +0200
    Re: [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs Moritz Fischer <moritz.fischer@ettus.com> - 2016-10-25 00:40 +0200
      Re: [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs Joel Holdsworth <joel@airwebreathe.org.uk> - 2016-10-25 07:00 +0200
        Re: [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs Moritz Fischer <moritz.fischer@ettus.com> - 2016-10-25 18:50 +0200
    Re: [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs Joel Holdsworth <joel@airwebreathe.org.uk> - 2016-10-25 07:10 +0200
      Re: [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs Joel Holdsworth <joel@airwebreathe.org.uk> - 2016-10-25 18:40 +0200
      Re: [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs Moritz Fischer <moritz.fischer@ettus.com> - 2016-10-25 18:40 +0200

csiph-web