Example #1
0
static int pxa_ssp_resume(struct snd_soc_dai *cpu_dai)
{
	struct ssp_priv *priv = snd_soc_dai_get_drvdata(cpu_dai);
	struct ssp_device *ssp = priv->ssp;
	uint32_t sssr = SSSR_ROR | SSSR_TUR | SSSR_BCE;

	clk_enable(ssp->clk);

	__raw_writel(sssr, ssp->mmio_base + SSSR);
	__raw_writel(priv->cr0 & ~SSCR0_SSE, ssp->mmio_base + SSCR0);
	__raw_writel(priv->cr1, ssp->mmio_base + SSCR1);
	__raw_writel(priv->to,  ssp->mmio_base + SSTO);
	__raw_writel(priv->psp, ssp->mmio_base + SSPSP);

	if (cpu_dai->active)
		pxa_ssp_enable(ssp);
	else
		clk_disable(ssp->clk);

	return 0;
}
static struct ssp_device *ssp_lcd_init(void)
{
	struct ssp_device *ssp;

	ssp = pxa_ssp_request(1, "SSP");
	if (ssp == NULL) {
		printk(KERN_ERR "SSP1 for lcd init failed\n");
		return NULL;
	}

	clk_enable(ssp->clk);

	/*disable SSP*/
	pxa_ssp_disable(ssp);

	/* set up port type, speed, port settings */
	pxa_ssp_write_reg(ssp, SSCR1, 0x18);
	pxa_ssp_write_reg(ssp, SSPSP, 0);
	pxa_ssp_write_reg(ssp, SSCR0, 0x00000588 & (~SSCR0_SSE));

	pxa_ssp_enable(ssp);

	return ssp;
}