H A D | mmp-sspa.c | 2 * linux/sound/soc/pxa/mmp-sspa.c 39 #include "mmp-sspa.h" 45 struct ssp_device *sspa; member in struct:sspa_priv 53 static void mmp_sspa_write_reg(struct ssp_device *sspa, u32 reg, u32 val) mmp_sspa_write_reg() argument 55 __raw_writel(val, sspa->mmio_base + reg); mmp_sspa_write_reg() 58 static u32 mmp_sspa_read_reg(struct ssp_device *sspa, u32 reg) mmp_sspa_read_reg() argument 60 return __raw_readl(sspa->mmio_base + reg); mmp_sspa_read_reg() 63 static void mmp_sspa_tx_enable(struct ssp_device *sspa) mmp_sspa_tx_enable() argument 67 sspa_sp = mmp_sspa_read_reg(sspa, SSPA_TXSP); mmp_sspa_tx_enable() 70 mmp_sspa_write_reg(sspa, SSPA_TXSP, sspa_sp); mmp_sspa_tx_enable() 73 static void mmp_sspa_tx_disable(struct ssp_device *sspa) mmp_sspa_tx_disable() argument 77 sspa_sp = mmp_sspa_read_reg(sspa, SSPA_TXSP); mmp_sspa_tx_disable() 80 mmp_sspa_write_reg(sspa, SSPA_TXSP, sspa_sp); mmp_sspa_tx_disable() 83 static void mmp_sspa_rx_enable(struct ssp_device *sspa) mmp_sspa_rx_enable() argument 87 sspa_sp = mmp_sspa_read_reg(sspa, SSPA_RXSP); mmp_sspa_rx_enable() 90 mmp_sspa_write_reg(sspa, SSPA_RXSP, sspa_sp); mmp_sspa_rx_enable() 93 static void mmp_sspa_rx_disable(struct ssp_device *sspa) mmp_sspa_rx_disable() argument 97 sspa_sp = mmp_sspa_read_reg(sspa, SSPA_RXSP); mmp_sspa_rx_disable() 100 mmp_sspa_write_reg(sspa, SSPA_RXSP, sspa_sp); mmp_sspa_rx_disable() 109 clk_enable(priv->sspa->clk); mmp_sspa_startup() 119 clk_disable(priv->sspa->clk); mmp_sspa_shutdown() 165 ret = clk_set_rate(priv->sspa->clk, freq_out); mmp_sspa_set_dai_pll() 177 * Set up the sspa dai format. The sspa port must be inactive 185 struct ssp_device *sspa = sspa_priv->sspa; mmp_sspa_set_dai_fmt() local 193 if ((mmp_sspa_read_reg(sspa, SSPA_TXSP) & SSPA_SP_S_EN) || mmp_sspa_set_dai_fmt() 194 (mmp_sspa_read_reg(sspa, SSPA_RXSP) & SSPA_SP_S_EN)) { mmp_sspa_set_dai_fmt() 195 dev_err(&sspa->pdev->dev, mmp_sspa_set_dai_fmt() 232 mmp_sspa_write_reg(sspa, SSPA_TXSP, sspa_sp); mmp_sspa_set_dai_fmt() 233 mmp_sspa_write_reg(sspa, SSPA_RXSP, sspa_sp); mmp_sspa_set_dai_fmt() 236 mmp_sspa_write_reg(sspa, SSPA_TXSP, sspa_sp); mmp_sspa_set_dai_fmt() 237 mmp_sspa_write_reg(sspa, SSPA_RXSP, sspa_sp); mmp_sspa_set_dai_fmt() 247 mmp_sspa_write_reg(sspa, SSPA_TXSP, sspa_sp); mmp_sspa_set_dai_fmt() 249 mmp_sspa_write_reg(sspa, SSPA_TXCTL, sspa_ctrl); mmp_sspa_set_dai_fmt() 250 mmp_sspa_write_reg(sspa, SSPA_RXCTL, sspa_ctrl); mmp_sspa_set_dai_fmt() 271 struct ssp_device *sspa = sspa_priv->sspa; mmp_sspa_hw_params() local 276 sspa_ctrl = mmp_sspa_read_reg(sspa, SSPA_TXCTL); mmp_sspa_hw_params() 278 sspa_ctrl = mmp_sspa_read_reg(sspa, SSPA_RXCTL); mmp_sspa_hw_params() 307 mmp_sspa_write_reg(sspa, SSPA_TXCTL, sspa_ctrl); mmp_sspa_hw_params() 308 mmp_sspa_write_reg(sspa, SSPA_TXFIFO_LL, 0x1); mmp_sspa_hw_params() 310 mmp_sspa_write_reg(sspa, SSPA_RXCTL, sspa_ctrl); mmp_sspa_hw_params() 311 mmp_sspa_write_reg(sspa, SSPA_RXFIFO_UL, 0x0); mmp_sspa_hw_params() 316 (sspa->phys_base + SSPA_TXD) : mmp_sspa_hw_params() 317 (sspa->phys_base + SSPA_RXD); mmp_sspa_hw_params() 326 struct ssp_device *sspa = sspa_priv->sspa; mmp_sspa_trigger() local 340 mmp_sspa_rx_enable(sspa); mmp_sspa_trigger() 343 mmp_sspa_tx_enable(sspa); mmp_sspa_trigger() 354 mmp_sspa_tx_disable(sspa); mmp_sspa_trigger() 358 mmp_sspa_rx_disable(sspa); mmp_sspa_trigger() 412 .name = "mmp-sspa", 425 priv->sspa = devm_kzalloc(&pdev->dev, asoc_mmp_sspa_probe() 427 if (priv->sspa == NULL) asoc_mmp_sspa_probe() 437 priv->sspa->mmio_base = devm_ioremap_resource(&pdev->dev, res); asoc_mmp_sspa_probe() 438 if (IS_ERR(priv->sspa->mmio_base)) asoc_mmp_sspa_probe() 439 return PTR_ERR(priv->sspa->mmio_base); asoc_mmp_sspa_probe() 441 priv->sspa->clk = devm_clk_get(&pdev->dev, NULL); asoc_mmp_sspa_probe() 442 if (IS_ERR(priv->sspa->clk)) asoc_mmp_sspa_probe() 443 return PTR_ERR(priv->sspa->clk); asoc_mmp_sspa_probe() 474 .name = "mmp-sspa-dai",
|