linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
To: Harini Katakam
	<harinikatakamlinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2/2] spi: cadence: Configure SPI clock in the prepare_message() callback
Date: Thu, 10 Jul 2014 12:50:05 +0200	[thread overview]
Message-ID: <53BE6FDD.6050206@metafoo.de> (raw)
In-Reply-To: <CAFcVEC+yX7Zm2rq=XU0V8cs-vgxeLX5HsM=NySXwe9iEazC5eA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 07/10/2014 12:43 PM, Harini Katakam wrote:
> Hi,
>
> On Thu, Jul 10, 2014 at 2:56 PM, Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org> wrote:
>> Currently the cadence SPI driver does the SPI clock configuration (setup CPOL
>> and CPHA) in the prepare_transfer_hardware() callback. The
>> prepare_transfer_hardware() callback is only called though when the controller
>> transitions from a idle state to a non-idle state. Such a transitions happens
>> when the message queue goes from empty to non-empty. If multiple messages from
>> different SPI slaves with different clock settings are in the message queue the
>> clock settings will not be properly updated when switching from one slave device
>> to another. Instead do the updating of the clock configuration in the
>> prepare_message() callback which will be called for each individual message.
>>
>
> Yes, the requirement from the controller is that CPOL/CPHA setting changes
> will not take effect when SPI is enabled. CPOL/CPHA setting is done in
> prepare_hardware
> before SPI is enabled. So this works.
> According to your patches I understand that you might change CPOL/CPHA for
> each message. Is this possible? Is this a requirement?

The message can be from different SPI devices, so yes this is a requirement. 
I'm seeing the issue in one of my setups.

- Lars

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-07-10 10:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10  9:26 [PATCH 1/2] spi: cadence: Make sure that clock polarity changes are applied Lars-Peter Clausen
     [not found] ` <1404984389-12802-1-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2014-07-10  9:26   ` [PATCH 2/2] spi: cadence: Configure SPI clock in the prepare_message() callback Lars-Peter Clausen
     [not found]     ` <1404984389-12802-2-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2014-07-10 10:43       ` Harini Katakam
     [not found]         ` <CAFcVEC+yX7Zm2rq=XU0V8cs-vgxeLX5HsM=NySXwe9iEazC5eA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-10 10:50           ` Lars-Peter Clausen [this message]
2014-07-11 13:39   ` [PATCH 1/2] spi: cadence: Make sure that clock polarity changes are applied Mark Brown

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=53BE6FDD.6050206@metafoo.de \
    --to=lars-qo5elluwu/uelga04laivw@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=harinikatakamlinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@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).