Re: [PATCH] OMAP3 McSPI: Adds context save/restore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 30, 2009 at 07:23:16AM +0100, ext Hemanth V wrote:
> 
> ----- Original Message -----
> From: "Imre Deak" <imre.deak@xxxxxxxxx>
> To: "ext Nayak, Rajendra" <rnayak@xxxxxx>
> Cc: <linux-omap@xxxxxxxxxxxxxxx>; "Kevin Hilman"
> <khilman@xxxxxxxxxxxxxxxxxxx>; "V, Hemanth" <hemanthv@xxxxxx>
> 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@xxxxxx>
> >>
> >> 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@xxxxxx>
> >>
> >> ---
> >>  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
> >
> >
> >
> >
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux