From: dkota@codeaurora.org
To: Stephen Boyd <swboyd@chromium.org>,
linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>,
linux-spi@vger.kernel.org, sdharia@codeaurora.org,
kramasub@codeaurora.org, dianders@chromium.org,
linux-arm-msm@vger.kernel.org, "Mahadevan,
Girish" <girishm@codeaurora.org>
Subject: Re: [PATCH] spi: spi-geni-qcom: Add SPI driver support for GENI based QUP
Date: Fri, 03 Aug 2018 17:48:35 +0530 [thread overview]
Message-ID: <61f2e1fb394bfe47ace42352f2e1b3a6@codeaurora.org> (raw)
In-Reply-To: <28d8ab5fdeb34e52eba7ca771a17bc06@codeaurora.org>
Hi Stephen and Mark,
>>> Do you mean spi-rx-delay-us and spi-tx-delay-us properties? Those are
>>> documented but don't seem to be used. There's also the delay_usecs
>>> part
>>> of the spi_transfer structure, which may be what you're talking
>>> about.
>>
>> delay_usecs is for inter-transfer delays within a message rather than
>> after the initial chip select assert (it can be used to keep chip
>> select
>> asserted for longer after the final transfer too). Obviously this is
>> also something that shouldn't be configured in a driver specific
>> fashion.
>>
>
> Hmmm ok, so you mean don't send these as controller_data, rather add
> new
> members to the spi_device struct ?
spi_cs_clk_delay -> Adds Delay from CS line toggle to Clock line toggle
spi_inter_words_delay -> Adds inter-word delay for each transfer.
Could you please provide more information on accommodating these
parameters in
SPI core structures like spi_device or spi_transfer? Why because these
are very
specific to SPI GENI controller.
>> + if (of_property_read_u32(pdev->dev.of_node,
>> "spi-max-frequency",
>> + &spi->max_speed_hz)) {
> Why does this need to come from DT?
This is required to set the SPI controller max frequency.
As it is specific to the controller, so looks meaningful to specify it
in dtsi.
Also, spi core framework will set the transfer speed to controller max
frequency
if transfer frequency is greater than controller max frequency.
Please mention if you have a other opinion.
Code snippet from spi.c
====
2826 if (ctlr->max_speed_hz && xfer->speed_hz > ctlr->max_speed_hz)
2827 xfer->speed_hz = ctlr->max_speed_hz;
====
>> + mas->cur_speed_hz = spi_slv->max_speed_hz;
>
> Why can't you use clk_get_rate() instead? Or call clk_set_rate() with
> the rate you want the master clk to run at and then divide that down
> from there?
>
>
>> > Not sure I follow, the intention is to run the controller clock based on
>> > the slave's max frequency.
>
>> That's good. The problem I see is that we have to specify the max
>> frequency in the controller/bus node, and also in the child/slave
>> node.
>> It should only need to be specified in the slave node, so making the
>> cur_speed_hz equal the max_speed_hz is problematic. The current speed
>> of
>> the master should be determined by calling clk_get_rate().
>
> We don't require that the slaves all individually set a speed since it
> gets a bit redundant, it should be enough to just use the default the
> controller provides. A bigger problem with this is that the driver
> will
> never see a transfer which doesn't explicitly have a speed set as the
> core will ensure something is set, open coding this logic in every
> driver would obviously be tiresome.
clock_get_rate() will returns the rate which got set as per the
clock plan(which was the rounded up frequency). For that reason
using the cur_speed_hz.
next prev parent reply other threads:[~2018-08-03 12:18 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 21:34 [PATCH] spi: spi-geni-qcom: Add SPI driver support for GENI based QUP Girish Mahadevan
2018-05-03 23:38 ` Mark Brown
2018-05-07 21:40 ` Mahadevan, Girish
[not found] ` <0c26e96c-85ad-c2a2-9abd-33096d76008b@codeaurora.org>
2018-05-17 7:21 ` Mark Brown
2018-05-21 21:45 ` Mahadevan, Girish
2018-05-22 17:32 ` Mark Brown
2018-05-11 22:30 ` Stephen Boyd
2018-05-21 15:52 ` Mahadevan, Girish
2018-05-22 16:46 ` Stephen Boyd
2018-05-22 17:30 ` Mark Brown
2018-05-24 16:25 ` Mahadevan, Girish
2018-05-24 16:29 ` Mark Brown
[not found] ` <28d8ab5fdeb34e52eba7ca771a17bc06@codeaurora.org>
2018-08-03 12:18 ` dkota [this message]
2018-08-09 18:03 ` Doug Anderson
2018-08-09 18:24 ` Trent Piepho
2018-08-09 19:37 ` Doug Anderson
2018-08-10 18:43 ` Trent Piepho
2018-08-10 10:52 ` Mark Brown
2018-08-10 15:40 ` Doug Anderson
2018-08-10 16:13 ` Mark Brown
2018-08-10 16:27 ` Doug Anderson
2018-08-10 16:43 ` Mark Brown
2018-08-10 16:47 ` Doug Anderson
2018-08-10 16:29 ` dkota
2018-08-10 16:46 ` Mark Brown
2018-08-14 9:00 ` dkota
2018-08-14 15:03 ` Mark Brown
2018-08-17 10:36 ` dkota
2018-08-17 14:59 ` Mark Brown
2018-08-24 11:00 ` dkota
2018-08-10 16:49 ` Doug Anderson
2018-08-10 17:55 ` Trent Piepho
2018-06-08 23:34 ` Matthias Kaehlcke
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=61f2e1fb394bfe47ace42352f2e1b3a6@codeaurora.org \
--to=dkota@codeaurora.org \
--cc=broonie@kernel.org \
--cc=dianders@chromium.org \
--cc=girishm@codeaurora.org \
--cc=kramasub@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=sdharia@codeaurora.org \
--cc=swboyd@chromium.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).