struct i2s_dai *pri_dai, *sec_dai = NULL;
struct s3c_audio_pdata *i2s_pdata = pdev->dev.platform_data;
struct resource *res;
- u32 regs_base, quirks = 0, idma_addr = 0;
+ u32 regs_base, idma_addr = 0;
struct device_node *np = pdev->dev.of_node;
const struct samsung_i2s_dai_data *i2s_dai_data;
int num_dais, ret;
if (!priv)
return -ENOMEM;
- quirks = np ? i2s_dai_data->quirks : i2s_pdata->type.quirks;
- num_dais = (quirks & QUIRK_SEC_DAI) ? 2 : 1;
+ if (np) {
+ priv->quirks = i2s_dai_data->quirks;
+ } else {
+ if (!i2s_pdata) {
+ dev_err(&pdev->dev, "Missing platform data\n");
+ return -EINVAL;
+ }
+ priv->quirks = i2s_pdata->type.quirks;
+ }
+
+ num_dais = (priv->quirks & QUIRK_SEC_DAI) ? 2 : 1;
priv->pdev = pdev;
priv->variant_regs = i2s_dai_data->i2s_variant_regs;
- priv->quirks = quirks;
ret = i2s_alloc_dais(priv, i2s_dai_data, num_dais);
if (ret < 0)
spin_lock_init(&priv->pcm_lock);
if (!np) {
- if (i2s_pdata == NULL) {
- dev_err(&pdev->dev, "Can't work without s3c_audio_pdata\n");
- return -EINVAL;
- }
-
pri_dai->dma_playback.filter_data = i2s_pdata->dma_playback;
pri_dai->dma_capture.filter_data = i2s_pdata->dma_capture;
pri_dai->filter = i2s_pdata->dma_filter;
} else {
if (of_property_read_u32(np, "samsung,idma-addr",
&idma_addr)) {
- if (quirks & QUIRK_SUPPORTS_IDMA) {
+ if (priv->quirks & QUIRK_SUPPORTS_IDMA) {
dev_info(&pdev->dev, "idma address is not"\
"specified");
}
pri_dai->dma_capture.addr_width = 4;
pri_dai->priv = priv;
- if (quirks & QUIRK_PRI_6CHAN)
+ if (priv->quirks & QUIRK_PRI_6CHAN)
pri_dai->drv->playback.channels_max = 6;
ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
if (ret < 0)
goto err_disable_clk;
- if (quirks & QUIRK_SEC_DAI) {
+ if (priv->quirks & QUIRK_SEC_DAI) {
sec_dai = &priv->dai[SAMSUNG_I2S_ID_SECONDARY - 1];
sec_dai->dma_playback.addr = regs_base + I2STXDS;