All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Scott Jiang
	<scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org
Cc: Scott Jiang <scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 2/6] spi: spi-bfin-sport: move word length setup to transfer handler
Date: Fri, 27 Apr 2012 12:21:29 -0600	[thread overview]
Message-ID: <20120427182129.7E1EE3E171B@localhost> (raw)
In-Reply-To: <1335219493-24184-2-git-send-email-scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Mon, 23 Apr 2012 18:18:09 -0400, Scott Jiang <scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Each transfer may have its own bits per word.
> 
> Signed-off-by: Scott Jiang <scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Applied, thanks.

g.

> ---
>  drivers/spi/spi-bfin-sport.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-bfin-sport.c b/drivers/spi/spi-bfin-sport.c
> index 248a2cc..bfd9047 100644
> --- a/drivers/spi/spi-bfin-sport.c
> +++ b/drivers/spi/spi-bfin-sport.c
> @@ -252,19 +252,15 @@ static void
>  bfin_sport_spi_restore_state(struct bfin_sport_spi_master_data *drv_data)
>  {
>  	struct bfin_sport_spi_slave_data *chip = drv_data->cur_chip;
> -	unsigned int bits = (drv_data->ops == &bfin_sport_transfer_ops_u8 ? 7 : 15);
>  
>  	bfin_sport_spi_disable(drv_data);
>  	dev_dbg(drv_data->dev, "restoring spi ctl state\n");
>  
>  	bfin_write(&drv_data->regs->tcr1, chip->ctl_reg);
> -	bfin_write(&drv_data->regs->tcr2, bits);
>  	bfin_write(&drv_data->regs->tclkdiv, chip->baud);
> -	bfin_write(&drv_data->regs->tfsdiv, bits);
>  	SSYNC();
>  
>  	bfin_write(&drv_data->regs->rcr1, chip->ctl_reg & ~(ITCLK | ITFS));
> -	bfin_write(&drv_data->regs->rcr2, bits);
>  	SSYNC();
>  
>  	bfin_sport_spi_cs_active(chip);
> @@ -425,6 +421,9 @@ bfin_sport_spi_pump_transfers(unsigned long data)
>  		drv_data->ops = &bfin_sport_transfer_ops_u8;
>  	else
>  		drv_data->ops = &bfin_sport_transfer_ops_u16;
> +	bfin_write(&drv_data->regs->tcr2, bits_per_word - 1);
> +	bfin_write(&drv_data->regs->tfsdiv, bits_per_word - 1);
> +	bfin_write(&drv_data->regs->rcr2, bits_per_word - 1);
>  
>  	drv_data->state = RUNNING_STATE;
>  
> -- 
> 1.7.0.4
> 
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

  parent reply	other threads:[~2012-04-27 18:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 22:18 [PATCH 1/6] spi: rename config macro name for bfin5xx spi controller driver Scott Jiang
     [not found] ` <1335219493-24184-1-git-send-email-scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-04-23 22:18   ` [PATCH 2/6] spi: spi-bfin-sport: move word length setup to transfer handler Scott Jiang
     [not found]     ` <1335219493-24184-2-git-send-email-scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-04-27 18:21       ` Grant Likely
2012-04-27 18:21       ` Grant Likely [this message]
2012-04-23 22:18   ` [PATCH 3/6] spi/bfin_spi: drop bits_per_word from client data Scott Jiang
     [not found]     ` <1335219493-24184-3-git-send-email-scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-04-27 18:21       ` Grant Likely
2012-04-23 22:18   ` [PATCH 4/6] spi/spi_bfin_sport: " Scott Jiang
     [not found]     ` <1335219493-24184-4-git-send-email-scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-04-27 18:21       ` Grant Likely
2012-04-23 22:18   ` [PATCH 5/6] spi: spi-bfin5xx: reverse if condition in interrupt mode Scott Jiang
     [not found]     ` <1335219493-24184-5-git-send-email-scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-04-27 18:21       ` Grant Likely
2012-04-23 22:18   ` [PATCH 6/6] spi: spi-bfin5xx: flush spi after each transfer Scott Jiang
     [not found]     ` <1335219493-24184-6-git-send-email-scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-04-27 18:35       ` Grant Likely
2012-04-28  4:04         ` Mike Frysinger
2012-04-27 17:21   ` [PATCH 1/6] spi: rename config macro name for bfin5xx spi controller driver Grant Likely
2012-04-28  4:00     ` Mike Frysinger
2012-04-27 18:20   ` Grant Likely

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=20120427182129.7E1EE3E171B@localhost \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=scott.jiang.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@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 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.