| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - * s3c24xx-i2s.c -- ALSA Soc Audio Layer |
|---|
| 3 | | - * |
|---|
| 4 | | - * (c) 2006 Wolfson Microelectronics PLC. |
|---|
| 5 | | - * Graeme Gregory graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com |
|---|
| 6 | | - * |
|---|
| 7 | | - * Copyright 2004-2005 Simtec Electronics |
|---|
| 8 | | - * http://armlinux.simtec.co.uk/ |
|---|
| 9 | | - * Ben Dooks <ben@simtec.co.uk> |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 12 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 13 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 14 | | - * option) any later version. |
|---|
| 15 | | - */ |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 2 | +// |
|---|
| 3 | +// s3c24xx-i2s.c -- ALSA Soc Audio Layer |
|---|
| 4 | +// |
|---|
| 5 | +// (c) 2006 Wolfson Microelectronics PLC. |
|---|
| 6 | +// Graeme Gregory graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com |
|---|
| 7 | +// |
|---|
| 8 | +// Copyright 2004-2005 Simtec Electronics |
|---|
| 9 | +// http://armlinux.simtec.co.uk/ |
|---|
| 10 | +// Ben Dooks <ben@simtec.co.uk> |
|---|
| 16 | 11 | |
|---|
| 17 | 12 | #include <linux/delay.h> |
|---|
| 18 | 13 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 23 | 18 | #include <sound/soc.h> |
|---|
| 24 | 19 | #include <sound/pcm_params.h> |
|---|
| 25 | 20 | |
|---|
| 26 | | -#include <mach/gpio-samsung.h> |
|---|
| 27 | | -#include <plat/gpio-cfg.h> |
|---|
| 28 | 21 | #include "regs-iis.h" |
|---|
| 29 | | - |
|---|
| 30 | 22 | #include "dma.h" |
|---|
| 31 | 23 | #include "s3c24xx-i2s.h" |
|---|
| 32 | 24 | |
|---|
| .. | .. |
|---|
| 353 | 345 | if (ret) |
|---|
| 354 | 346 | return ret; |
|---|
| 355 | 347 | |
|---|
| 356 | | - /* Configure the I2S pins (GPE0...GPE4) in correct mode */ |
|---|
| 357 | | - s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), |
|---|
| 358 | | - S3C_GPIO_PULL_NONE); |
|---|
| 359 | | - |
|---|
| 360 | 348 | writel(S3C2410_IISCON_IISEN, s3c24xx_i2s.regs + S3C2410_IISCON); |
|---|
| 361 | 349 | |
|---|
| 362 | 350 | s3c24xx_snd_txctrl(0); |
|---|
| .. | .. |
|---|
| 366 | 354 | } |
|---|
| 367 | 355 | |
|---|
| 368 | 356 | #ifdef CONFIG_PM |
|---|
| 369 | | -static int s3c24xx_i2s_suspend(struct snd_soc_dai *cpu_dai) |
|---|
| 357 | +static int s3c24xx_i2s_suspend(struct snd_soc_component *component) |
|---|
| 370 | 358 | { |
|---|
| 371 | 359 | s3c24xx_i2s.iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON); |
|---|
| 372 | 360 | s3c24xx_i2s.iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); |
|---|
| .. | .. |
|---|
| 378 | 366 | return 0; |
|---|
| 379 | 367 | } |
|---|
| 380 | 368 | |
|---|
| 381 | | -static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai) |
|---|
| 369 | +static int s3c24xx_i2s_resume(struct snd_soc_component *component) |
|---|
| 382 | 370 | { |
|---|
| 383 | 371 | int ret; |
|---|
| 384 | 372 | |
|---|
| .. | .. |
|---|
| 413 | 401 | |
|---|
| 414 | 402 | static struct snd_soc_dai_driver s3c24xx_i2s_dai = { |
|---|
| 415 | 403 | .probe = s3c24xx_i2s_probe, |
|---|
| 416 | | - .suspend = s3c24xx_i2s_suspend, |
|---|
| 417 | | - .resume = s3c24xx_i2s_resume, |
|---|
| 418 | 404 | .playback = { |
|---|
| 419 | 405 | .channels_min = 2, |
|---|
| 420 | 406 | .channels_max = 2, |
|---|
| .. | .. |
|---|
| 430 | 416 | |
|---|
| 431 | 417 | static const struct snd_soc_component_driver s3c24xx_i2s_component = { |
|---|
| 432 | 418 | .name = "s3c24xx-i2s", |
|---|
| 419 | + .suspend = s3c24xx_i2s_suspend, |
|---|
| 420 | + .resume = s3c24xx_i2s_resume, |
|---|
| 433 | 421 | }; |
|---|
| 434 | 422 | |
|---|
| 435 | 423 | static int s3c24xx_iis_dev_probe(struct platform_device *pdev) |
|---|
| .. | .. |
|---|
| 446 | 434 | s3c24xx_i2s_pcm_stereo_in.addr = res->start + S3C2410_IISFIFO; |
|---|
| 447 | 435 | |
|---|
| 448 | 436 | ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL, |
|---|
| 449 | | - NULL, NULL); |
|---|
| 437 | + "tx", "rx", NULL); |
|---|
| 450 | 438 | if (ret) { |
|---|
| 451 | 439 | dev_err(&pdev->dev, "Failed to register the DMA: %d\n", ret); |
|---|
| 452 | 440 | return ret; |
|---|