Lines Matching refs:adata
25 static int acp3x_power_on(struct acp3x_dev_data *adata) in acp3x_power_on() argument
27 void __iomem *acp3x_base = adata->acp3x_base; in acp3x_power_on()
47 rv_writel(adata->pme_en, acp3x_base + mmACP_PME_EN); in acp3x_power_on()
92 static int acp3x_init(struct acp3x_dev_data *adata) in acp3x_init() argument
94 void __iomem *acp3x_base = adata->acp3x_base; in acp3x_init()
98 ret = acp3x_power_on(adata); in acp3x_init()
130 struct acp3x_dev_data *adata; in snd_acp3x_probe() local
151 adata = devm_kzalloc(&pci->dev, sizeof(struct acp3x_dev_data), in snd_acp3x_probe()
153 if (!adata) { in snd_acp3x_probe()
161 adata->acp3x_base = devm_ioremap(&pci->dev, addr, in snd_acp3x_probe()
163 if (!adata->acp3x_base) { in snd_acp3x_probe()
168 pci_set_drvdata(pci, adata); in snd_acp3x_probe()
170 adata->pme_en = rv_readl(adata->acp3x_base + mmACP_PME_EN); in snd_acp3x_probe()
171 ret = acp3x_init(adata); in snd_acp3x_probe()
175 val = rv_readl(adata->acp3x_base + mmACP_I2S_PIN_CONFIG); in snd_acp3x_probe()
178 adata->res = devm_kzalloc(&pci->dev, in snd_acp3x_probe()
181 if (!adata->res) { in snd_acp3x_probe()
186 adata->res[0].name = "acp3x_i2s_iomem"; in snd_acp3x_probe()
187 adata->res[0].flags = IORESOURCE_MEM; in snd_acp3x_probe()
188 adata->res[0].start = addr; in snd_acp3x_probe()
189 adata->res[0].end = addr + (ACP3x_REG_END - ACP3x_REG_START); in snd_acp3x_probe()
191 adata->res[1].name = "acp3x_i2s_sp"; in snd_acp3x_probe()
192 adata->res[1].flags = IORESOURCE_MEM; in snd_acp3x_probe()
193 adata->res[1].start = addr + ACP3x_I2STDM_REG_START; in snd_acp3x_probe()
194 adata->res[1].end = addr + ACP3x_I2STDM_REG_END; in snd_acp3x_probe()
196 adata->res[2].name = "acp3x_i2s_bt"; in snd_acp3x_probe()
197 adata->res[2].flags = IORESOURCE_MEM; in snd_acp3x_probe()
198 adata->res[2].start = addr + ACP3x_BT_TDM_REG_START; in snd_acp3x_probe()
199 adata->res[2].end = addr + ACP3x_BT_TDM_REG_END; in snd_acp3x_probe()
201 adata->res[3].name = "acp3x_i2s_irq"; in snd_acp3x_probe()
202 adata->res[3].flags = IORESOURCE_IRQ; in snd_acp3x_probe()
203 adata->res[3].start = pci->irq; in snd_acp3x_probe()
204 adata->res[3].end = adata->res[3].start; in snd_acp3x_probe()
206 adata->acp3x_audio_mode = ACP3x_I2S_MODE; in snd_acp3x_probe()
213 pdevinfo[0].res = &adata->res[0]; in snd_acp3x_probe()
221 pdevinfo[1].res = &adata->res[1]; in snd_acp3x_probe()
227 pdevinfo[2].res = &adata->res[1]; in snd_acp3x_probe()
233 pdevinfo[3].res = &adata->res[2]; in snd_acp3x_probe()
235 adata->pdev[i] = in snd_acp3x_probe()
237 if (IS_ERR(adata->pdev[i])) { in snd_acp3x_probe()
240 ret = PTR_ERR(adata->pdev[i]); in snd_acp3x_probe()
258 platform_device_unregister(adata->pdev[i]); in snd_acp3x_probe()
260 if (acp3x_deinit(adata->acp3x_base)) in snd_acp3x_probe()
273 struct acp3x_dev_data *adata; in snd_acp3x_suspend() local
275 adata = dev_get_drvdata(dev); in snd_acp3x_suspend()
276 ret = acp3x_deinit(adata->acp3x_base); in snd_acp3x_suspend()
288 struct acp3x_dev_data *adata; in snd_acp3x_resume() local
290 adata = dev_get_drvdata(dev); in snd_acp3x_resume()
291 ret = acp3x_init(adata); in snd_acp3x_resume()
307 struct acp3x_dev_data *adata; in snd_acp3x_remove() local
310 adata = pci_get_drvdata(pci); in snd_acp3x_remove()
311 if (adata->acp3x_audio_mode == ACP3x_I2S_MODE) { in snd_acp3x_remove()
313 platform_device_unregister(adata->pdev[i]); in snd_acp3x_remove()
315 ret = acp3x_deinit(adata->acp3x_base); in snd_acp3x_remove()