From: Joel Holdsworth <joel@airwebreathe.org.uk>
To: Moritz Fischer <moritz.fischer@ettus.com>,
atull <atull@opensource.altera.com>
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
Subject: Re: [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs
Date: Mon, 24 Oct 2016 22:51:48 -0600 [thread overview]
Message-ID: <331cd8da-f69a-b51a-ddbd-f18ee44cac8a@airwebreathe.org.uk> (raw)
In-Reply-To: <20161024222805.GA5754@live.com>
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
next prev parent reply other threads:[~2016-10-25 4:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 4:39 [v2 1/2] of: Add vendor prefix for Lattice Semiconductor Joel Holdsworth
[not found] ` <1477283989-21947-1-git-send-email-joel-IJEoVVyKhCJXvIrf17iDB/XRex20P6io@public.gmane.org>
2016-10-24 4:39 ` [v2 2/2] fpga: Add support for Lattice iCE40 FPGAs Joel Holdsworth
2016-10-24 21:55 ` atull
2016-10-24 22:28 ` Moritz Fischer
2016-10-25 4:51 ` Joel Holdsworth [this message]
2016-10-25 16:48 ` Moritz Fischer
[not found] ` <CAAtXAHfcfveozw_3kpXz9pA0ZSTeuo9CNs9vRq1Y+BhrNuim7A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-29 21:38 ` Joel Holdsworth
2016-10-25 5:05 ` Joel Holdsworth
2016-10-25 14:47 ` atull
2016-10-25 16:31 ` Joel Holdsworth
2016-10-25 16:34 ` 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=331cd8da-f69a-b51a-ddbd-f18ee44cac8a@airwebreathe.org.uk \
--to=joel@airwebreathe.org.uk \
--cc=atull@opensource.altera.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=moritz.fischer@ettus.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@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 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).