Re: [PATCH] OMAP: McBSP: Wakeups utilized

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

 



* ext-eero.nurkkala@xxxxxxxxx <ext-eero.nurkkala@xxxxxxxxx> [090122 22:49]:
> From: Eero Nurkkala <ext-eero.nurkkala@xxxxxxxxx>
> 
> This patch enables the smart idle mode while
> McBPS is being utilized. Once it's done,
> force idle mode is taken instead. 

Adding to omap-upstream and pushing to linux-omap.

Tony

> Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@xxxxxxxxx>
> ---
>  arch/arm/plat-omap/include/mach/mcbsp.h |   16 ++++++++++++++++
>  arch/arm/plat-omap/mcbsp.c              |   28 ++++++++++++++++++++++++++++
>  2 files changed, 44 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h
> index 113c246..7232950 100644
> --- a/arch/arm/plat-omap/include/mach/mcbsp.h
> +++ b/arch/arm/plat-omap/include/mach/mcbsp.h
> @@ -249,8 +249,24 @@
>  #define RDISABLE		0x0001
>  
>  /********************** McBSP SYSCONFIG bit definitions ********************/
> +#define SIDLEMODE(value)	((value)<<3)
> +#define ENAWAKEUP		0x0004
>  #define SOFTRST			0x0002
>  
> +/********************** McBSP WAKEUPEN bit definitions *********************/
> +#define XEMPTYEOFEN		0x4000
> +#define XRDYEN			0x0400
> +#define XEOFEN			0x0200
> +#define XFSXEN			0x0100
> +#define XSYNCERREN		0x0080
> +#define RRDYEN			0x0008
> +#define REOFEN			0x0004
> +#define RFSREN			0x0002
> +#define RSYNCERREN		0x0001
> +#define WAKEUPEN_ALL		(XEMPTYEOFEN | XRDYEN | XEOFEN | XFSXEN | \
> +				 XSYNCERREN | RRDYEN | REOFEN | RFSREN | \
> +				 RSYNCERREN)
> +
>  /* we don't do multichannel for now */
>  struct omap_mcbsp_reg_cfg {
>  	u16 spcr2;
> diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
> index e5842e3..ce9d09f 100644
> --- a/arch/arm/plat-omap/mcbsp.c
> +++ b/arch/arm/plat-omap/mcbsp.c
> @@ -216,6 +216,7 @@ int omap_mcbsp_request(unsigned int id)
>  	struct omap_mcbsp *mcbsp;
>  	int i;
>  	int err;
> +	u16 syscon;
>  
>  	if (!omap_mcbsp_check_valid_id(id)) {
>  		printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
> @@ -241,6 +242,19 @@ int omap_mcbsp_request(unsigned int id)
>  	spin_unlock(&mcbsp->lock);
>  
>  	/*
> +	 * Enable wakup behavior, smart idle and all wakeups
> +	 * REVISIT: some wakeups may be unnecessary
> +	 */
> +	if (cpu_is_omap34xx()) {
> +		syscon = OMAP_MCBSP_READ(mcbsp->io_base, SYSCON);
> +		syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03));
> +		syscon |= (ENAWAKEUP | SIDLEMODE(0x02));
> +		OMAP_MCBSP_WRITE(mcbsp->io_base, SYSCON, syscon);
> +
> +		OMAP_MCBSP_WRITE(mcbsp->io_base, WAKEUPEN, WAKEUPEN_ALL);
> +	}
> +
> +	/*
>  	 * Make sure that transmitter, receiver and sample-rate generator are
>  	 * not running before activating IRQs.
>  	 */
> @@ -278,6 +292,7 @@ EXPORT_SYMBOL(omap_mcbsp_request);
>  void omap_mcbsp_free(unsigned int id)
>  {
>  	struct omap_mcbsp *mcbsp;
> +	u16 syscon, wakeupen;
>  	int i;
>  
>  	if (!omap_mcbsp_check_valid_id(id)) {
> @@ -286,6 +301,19 @@ void omap_mcbsp_free(unsigned int id)
>  	}
>  	mcbsp = id_to_mcbsp_ptr(id);
>  
> +	/*
> +	 * Disable wakup behavior, smart idle and all wakeups
> +	 */
> +	if (cpu_is_omap34xx()) {
> +		syscon = OMAP_MCBSP_READ(mcbsp->io_base, SYSCON);
> +		syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03));
> +		OMAP_MCBSP_WRITE(mcbsp->io_base, SYSCON, syscon);
> +
> +		wakeupen = OMAP_MCBSP_READ(mcbsp->io_base, WAKEUPEN);
> +		wakeupen &= ~WAKEUPEN_ALL;
> +		OMAP_MCBSP_WRITE(mcbsp->io_base, WAKEUPEN, wakeupen);
> +	}
> +
>  	if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free)
>  		mcbsp->pdata->ops->free(id);
>  
> -- 
> 1.6.0
> 
> --
> 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
--
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