public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@nokia.com>
To: ext Hemanth V <hemanthv@ti.com>
Cc: "ext Nayak, Rajendra" <rnayak@ti.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	Kevin Hilman <khilman@deeprootsystems.com>
Subject: Re: [PATCH] OMAP3 McSPI:  Adds context save/restore
Date: Fri, 30 Jan 2009 10:06:28 +0200	[thread overview]
Message-ID: <20090130080628.GA1682@localhost> (raw)
In-Reply-To: <015001c982a3$3e25e200$LocalHost@wipultra793>

On Fri, Jan 30, 2009 at 07:23:16AM +0100, ext Hemanth V wrote:
> 
> ----- Original Message -----
> From: "Imre Deak" <imre.deak@nokia.com>
> To: "ext Nayak, Rajendra" <rnayak@ti.com>
> Cc: <linux-omap@vger.kernel.org>; "Kevin Hilman"
> <khilman@deeprootsystems.com>; "V, Hemanth" <hemanthv@ti.com>
> Sent: Friday, January 30, 2009 12:36 AM
> Subject: Re: [PATCH] OMAP3 McSPI: Adds context save/restore
> 
> 
> > On Wed, Jan 28, 2009 at 10:11:29AM +0100, ext Nayak, Rajendra wrote:
> >> From: Hemanth V <hemanthv@ti.com>
> >>
> >> This patch adds context save/restore feature to McSPI driver.
> >> This has been tested by instrumenting the driver code i.e by
> >> adding a McSPI softreset in omap2_mcspi_disable_clocks function.
> >>
> >> This patch includes review comment fixes
> >>
> >> Signed-off-by: Hemanth V <hemanthv@ti.com>
> >>
> >> ---
> >>  drivers/spi/omap2_mcspi.c |   97
> >> ++++++++++++++++++++++++++++++++++++----------
> >>  1 files changed, 77 insertions(+), 20 deletions(-)
> >>
> >> Index: linux-omap-2.6/drivers/spi/omap2_mcspi.c
> >> ===================================================================
> >> --- linux-omap-2.6.orig/drivers/spi/omap2_mcspi.c       2009-01-27
> >> 11:45:06.000000000 +0530
> >> +++ linux-omap-2.6/drivers/spi/omap2_mcspi.c    2009-01-27
> >> 11:53:16.000000000 +0530
> >>
> >> [...]
> >>
> >> +static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
> >> +{
> >> +       struct spi_master *spi_cntrl;
> >> +       spi_cntrl = mcspi->master;
> >> +
> >> +       /* McSPI: context restore */
> >> +       mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_MODULCTRL,
> >> +                       omap2_mcspi_ctx[spi_cntrl->bus_num -
> >> 1].modulctrl);
> >> +
> >> +       mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_SYSCONFIG,
> >> +                       omap2_mcspi_ctx[spi_cntrl->bus_num -
> >> 1].sysconfig);
> >> +
> >> +       mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_CHCONF0,
> >> +                       omap2_mcspi_ctx[spi_cntrl->bus_num - 1].chconf0);
> >
> > You have to restore this to the proper CHCONF register. And in the
> > current form you have to restore all of them.
> 
> Currently only CS0 CHCONF i.e chconf0 is being saved and restored, since its
> the only one configured and used
> by the driver.

What do you mean, your specific HW configuration has only an SPI device
with CS0? This driver _will_ use all CHCONFx registers based on what CS
lines are used by the SPI devices on a given board.

--Imre

> 
> >
> >> +
> >> +
> >> +       mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_WAKEUPENABLE,
> >> +                       omap2_mcspi_ctx[spi_cntrl->bus_num -
> >> 1].wakeupenable);
> >> +}
> >> +static void omap2_mcspi_disable_clocks(struct omap2_mcspi *mcspi)
> >> +{
> >> +       clk_disable(mcspi->ick);
> >> +       clk_disable(mcspi->fck);
> >> +}
> >> +
> >> [...]
> >>
> >> @@ -537,6 +593,8 @@
> >>
> >>         mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, l);
> >>
> >> +       omap2_mcspi_ctx[spi_cntrl->bus_num - 1].chconf0 = l;
> >
> > And here save it to a slot based on CS.
> >
> > --Imre
> >
> >
> >
> >
> 

  reply	other threads:[~2009-01-30  8:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28  9:11 [PATCH] OMAP3 McSPI: Adds context save/restore Nayak, Rajendra
2009-01-28 16:18 ` Kevin Hilman
2009-01-29 19:06 ` Imre Deak
2009-01-30  6:23   ` Hemanth V
2009-01-30  8:06     ` Imre Deak [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-01-21 10:24 Hemanth V
2009-01-21 17:16 ` Kevin Hilman
2009-01-22  5:48   ` Hemanth V
2009-01-23  6:56     ` Hemanth V
2009-01-23 17:05       ` Kevin Hilman
2009-01-27  6:50         ` Hemanth V
2009-01-27 14:59           ` Kevin Hilman

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=20090130080628.GA1682@localhost \
    --to=imre.deak@nokia.com \
    --cc=hemanthv@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=rnayak@ti.com \
    /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