Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * linux/arch/arm/mach-omap2/mcbsp.c
0004  *
0005  * Copyright (C) 2008 Instituto Nokia de Tecnologia
0006  * Contact: Eduardo Valentin <eduardo.valentin@indt.org.br>
0007  *
0008  * Multichannel mode not supported.
0009  */
0010 #include <linux/module.h>
0011 #include <linux/init.h>
0012 #include <linux/clk.h>
0013 #include <linux/err.h>
0014 #include <linux/io.h>
0015 #include <linux/of.h>
0016 #include <linux/platform_device.h>
0017 #include <linux/slab.h>
0018 #include <linux/platform_data/asoc-ti-mcbsp.h>
0019 #include <linux/pm_runtime.h>
0020 
0021 #include <linux/omap-dma.h>
0022 
0023 #include "soc.h"
0024 #include "omap_device.h"
0025 #include "clock.h"
0026 
0027 /*
0028  * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle.
0029  * Sidetone needs non-gated ICLK and sidetone autoidle is broken.
0030  */
0031 #include "cm3xxx.h"
0032 #include "cm-regbits-34xx.h"
0033 
0034 static int omap3_mcbsp_force_ick_on(struct clk *clk, bool force_on)
0035 {
0036     if (!clk)
0037         return 0;
0038 
0039     if (force_on)
0040         return omap2_clk_deny_idle(clk);
0041     else
0042         return omap2_clk_allow_idle(clk);
0043 }
0044 
0045 void __init omap3_mcbsp_init_pdata_callback(
0046                     struct omap_mcbsp_platform_data *pdata)
0047 {
0048     if (!pdata)
0049         return;
0050 
0051     pdata->force_ick_on = omap3_mcbsp_force_ick_on;
0052 }