.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for NeoMagic 256AV and 256ZX chipsets. |
---|
3 | 4 | * Copyright (c) 2000 by Takashi Iwai <tiwai@suse.de> |
---|
.. | .. |
---|
7 | 8 | * so I just put my acknoledgment to him/her here. |
---|
8 | 9 | * The original author's web page is found at |
---|
9 | 10 | * http://www.uglx.org/sony.html |
---|
10 | | - * |
---|
11 | | - * |
---|
12 | | - * This program is free software; you can redistribute it and/or modify |
---|
13 | | - * it under the terms of the GNU General Public License as published by |
---|
14 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
15 | | - * (at your option) any later version. |
---|
16 | | - * |
---|
17 | | - * This program is distributed in the hope that it will be useful, |
---|
18 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
19 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
20 | | - * GNU General Public License for more details. |
---|
21 | | - * |
---|
22 | | - * You should have received a copy of the GNU General Public License |
---|
23 | | - * along with this program; if not, write to the Free Software |
---|
24 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
25 | 11 | */ |
---|
26 | 12 | |
---|
27 | 13 | #include <linux/io.h> |
---|
.. | .. |
---|
313 | 299 | } |
---|
314 | 300 | |
---|
315 | 301 | static inline void |
---|
316 | | -snd_nm256_write_buffer(struct nm256 *chip, void *src, int offset, int size) |
---|
| 302 | +snd_nm256_write_buffer(struct nm256 *chip, const void *src, int offset, int size) |
---|
317 | 303 | { |
---|
318 | 304 | offset -= chip->buffer_start; |
---|
319 | 305 | #ifdef CONFIG_SND_DEBUG |
---|
.. | .. |
---|
474 | 460 | return -EBUSY; |
---|
475 | 461 | } |
---|
476 | 462 | chip->irq = chip->pci->irq; |
---|
| 463 | + chip->card->sync_irq = chip->irq; |
---|
477 | 464 | } |
---|
478 | 465 | chip->irq_acks++; |
---|
479 | 466 | mutex_unlock(&chip->irq_mutex); |
---|
.. | .. |
---|
489 | 476 | if (chip->irq_acks == 0 && chip->irq >= 0) { |
---|
490 | 477 | free_irq(chip->irq, chip); |
---|
491 | 478 | chip->irq = -1; |
---|
| 479 | + chip->card->sync_irq = -1; |
---|
492 | 480 | } |
---|
493 | 481 | mutex_unlock(&chip->irq_mutex); |
---|
494 | 482 | } |
---|
.. | .. |
---|
572 | 560 | switch (cmd) { |
---|
573 | 561 | case SNDRV_PCM_TRIGGER_RESUME: |
---|
574 | 562 | s->suspended = 0; |
---|
575 | | - /* fallthru */ |
---|
| 563 | + fallthrough; |
---|
576 | 564 | case SNDRV_PCM_TRIGGER_START: |
---|
577 | 565 | if (! s->running) { |
---|
578 | 566 | snd_nm256_playback_start(chip, s, substream); |
---|
.. | .. |
---|
581 | 569 | break; |
---|
582 | 570 | case SNDRV_PCM_TRIGGER_SUSPEND: |
---|
583 | 571 | s->suspended = 1; |
---|
584 | | - /* fallthru */ |
---|
| 572 | + fallthrough; |
---|
585 | 573 | case SNDRV_PCM_TRIGGER_STOP: |
---|
586 | 574 | if (s->running) { |
---|
587 | 575 | snd_nm256_playback_stop(chip); |
---|
.. | .. |
---|
797 | 785 | /* |
---|
798 | 786 | * hardware info |
---|
799 | 787 | */ |
---|
800 | | -static struct snd_pcm_hardware snd_nm256_playback = |
---|
| 788 | +static const struct snd_pcm_hardware snd_nm256_playback = |
---|
801 | 789 | { |
---|
802 | 790 | .info = SNDRV_PCM_INFO_MMAP_IOMEM |SNDRV_PCM_INFO_MMAP_VALID | |
---|
803 | 791 | SNDRV_PCM_INFO_INTERLEAVED | |
---|
.. | .. |
---|
816 | 804 | .period_bytes_max = 128 * 1024, |
---|
817 | 805 | }; |
---|
818 | 806 | |
---|
819 | | -static struct snd_pcm_hardware snd_nm256_capture = |
---|
| 807 | +static const struct snd_pcm_hardware snd_nm256_capture = |
---|
820 | 808 | { |
---|
821 | 809 | .info = SNDRV_PCM_INFO_MMAP_IOMEM | SNDRV_PCM_INFO_MMAP_VALID | |
---|
822 | 810 | SNDRV_PCM_INFO_INTERLEAVED | |
---|
.. | .. |
---|
850 | 838 | */ |
---|
851 | 839 | static void snd_nm256_setup_stream(struct nm256 *chip, struct nm256_stream *s, |
---|
852 | 840 | struct snd_pcm_substream *substream, |
---|
853 | | - struct snd_pcm_hardware *hw_ptr) |
---|
| 841 | + const struct snd_pcm_hardware *hw_ptr) |
---|
854 | 842 | { |
---|
855 | 843 | struct snd_pcm_runtime *runtime = substream->runtime; |
---|
856 | 844 | |
---|
.. | .. |
---|
920 | 908 | static const struct snd_pcm_ops snd_nm256_playback_ops = { |
---|
921 | 909 | .open = snd_nm256_playback_open, |
---|
922 | 910 | .close = snd_nm256_playback_close, |
---|
923 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
924 | 911 | .hw_params = snd_nm256_pcm_hw_params, |
---|
925 | 912 | .prepare = snd_nm256_pcm_prepare, |
---|
926 | 913 | .trigger = snd_nm256_playback_trigger, |
---|
.. | .. |
---|
936 | 923 | static const struct snd_pcm_ops snd_nm256_capture_ops = { |
---|
937 | 924 | .open = snd_nm256_capture_open, |
---|
938 | 925 | .close = snd_nm256_capture_close, |
---|
939 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
940 | 926 | .hw_params = snd_nm256_pcm_hw_params, |
---|
941 | 927 | .prepare = snd_nm256_pcm_prepare, |
---|
942 | 928 | .trigger = snd_nm256_capture_trigger, |
---|
.. | .. |
---|
1193 | 1179 | unsigned short value; |
---|
1194 | 1180 | }; |
---|
1195 | 1181 | |
---|
1196 | | -static struct initialValues nm256_ac97_init_val[] = |
---|
| 1182 | +static const struct initialValues nm256_ac97_init_val[] = |
---|
1197 | 1183 | { |
---|
1198 | 1184 | { AC97_MASTER, 0x8000 }, |
---|
1199 | 1185 | { AC97_HEADPHONE, 0x8000 }, |
---|
.. | .. |
---|
1323 | 1309 | struct snd_ac97_bus *pbus; |
---|
1324 | 1310 | struct snd_ac97_template ac97; |
---|
1325 | 1311 | int err; |
---|
1326 | | - static struct snd_ac97_bus_ops ops = { |
---|
| 1312 | + static const struct snd_ac97_bus_ops ops = { |
---|
1327 | 1313 | .reset = snd_nm256_ac97_reset, |
---|
1328 | 1314 | .write = snd_nm256_ac97_write, |
---|
1329 | 1315 | .read = snd_nm256_ac97_read, |
---|
.. | .. |
---|
1367 | 1353 | unsigned long pointer_found = chip->buffer_end - 0x1400; |
---|
1368 | 1354 | u32 sig; |
---|
1369 | 1355 | |
---|
1370 | | - temp = ioremap_nocache(chip->buffer_addr + chip->buffer_end - 0x400, 16); |
---|
| 1356 | + temp = ioremap(chip->buffer_addr + chip->buffer_end - 0x400, 16); |
---|
1371 | 1357 | if (temp == NULL) { |
---|
1372 | 1358 | dev_err(chip->card->dev, |
---|
1373 | 1359 | "Unable to scan for card signature in video RAM\n"); |
---|
.. | .. |
---|
1413 | 1399 | struct nm256 *chip = card->private_data; |
---|
1414 | 1400 | |
---|
1415 | 1401 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
---|
1416 | | - snd_pcm_suspend_all(chip->pcm); |
---|
1417 | 1402 | snd_ac97_suspend(chip->ac97); |
---|
1418 | 1403 | chip->coeffs_current = 0; |
---|
1419 | 1404 | return 0; |
---|
.. | .. |
---|
1486 | 1471 | { |
---|
1487 | 1472 | struct nm256 *chip; |
---|
1488 | 1473 | int err, pval; |
---|
1489 | | - static struct snd_device_ops ops = { |
---|
| 1474 | + static const struct snd_device_ops ops = { |
---|
1490 | 1475 | .dev_free = snd_nm256_dev_free, |
---|
1491 | 1476 | }; |
---|
1492 | 1477 | u32 addr; |
---|
.. | .. |
---|
1533 | 1518 | err = -EBUSY; |
---|
1534 | 1519 | goto __error; |
---|
1535 | 1520 | } |
---|
1536 | | - chip->cport = ioremap_nocache(chip->cport_addr, NM_PORT2_SIZE); |
---|
| 1521 | + chip->cport = ioremap(chip->cport_addr, NM_PORT2_SIZE); |
---|
1537 | 1522 | if (chip->cport == NULL) { |
---|
1538 | 1523 | dev_err(card->dev, "unable to map control port %lx\n", |
---|
1539 | 1524 | chip->cport_addr); |
---|
.. | .. |
---|
1604 | 1589 | err = -EBUSY; |
---|
1605 | 1590 | goto __error; |
---|
1606 | 1591 | } |
---|
1607 | | - chip->buffer = ioremap_nocache(chip->buffer_addr, chip->buffer_size); |
---|
| 1592 | + chip->buffer = ioremap(chip->buffer_addr, chip->buffer_size); |
---|
1608 | 1593 | if (chip->buffer == NULL) { |
---|
1609 | 1594 | err = -ENOMEM; |
---|
1610 | 1595 | dev_err(card->dev, "unable to map ring buffer at %lx\n", |
---|
.. | .. |
---|
1647 | 1632 | } |
---|
1648 | 1633 | |
---|
1649 | 1634 | |
---|
1650 | | -enum { NM_BLACKLISTED, NM_RESET_WORKAROUND, NM_RESET_WORKAROUND_2 }; |
---|
| 1635 | +enum { NM_IGNORED, NM_RESET_WORKAROUND, NM_RESET_WORKAROUND_2 }; |
---|
1651 | 1636 | |
---|
1652 | | -static struct snd_pci_quirk nm256_quirks[] = { |
---|
| 1637 | +static const struct snd_pci_quirk nm256_quirks[] = { |
---|
1653 | 1638 | /* HP omnibook 4150 has cs4232 codec internally */ |
---|
1654 | | - SND_PCI_QUIRK(0x103c, 0x0007, "HP omnibook 4150", NM_BLACKLISTED), |
---|
| 1639 | + SND_PCI_QUIRK(0x103c, 0x0007, "HP omnibook 4150", NM_IGNORED), |
---|
1655 | 1640 | /* Reset workarounds to avoid lock-ups */ |
---|
1656 | 1641 | SND_PCI_QUIRK(0x104d, 0x8041, "Sony PCG-F305", NM_RESET_WORKAROUND), |
---|
1657 | 1642 | SND_PCI_QUIRK(0x1028, 0x0080, "Dell Latitude LS", NM_RESET_WORKAROUND), |
---|
.. | .. |
---|
1673 | 1658 | dev_dbg(&pci->dev, "Enabled quirk for %s.\n", |
---|
1674 | 1659 | snd_pci_quirk_name(q)); |
---|
1675 | 1660 | switch (q->value) { |
---|
1676 | | - case NM_BLACKLISTED: |
---|
| 1661 | + case NM_IGNORED: |
---|
1677 | 1662 | dev_info(&pci->dev, |
---|
1678 | | - "The device is blacklisted. Loading stopped\n"); |
---|
| 1663 | + "The device is on the denylist. Loading stopped\n"); |
---|
1679 | 1664 | return -ENODEV; |
---|
1680 | 1665 | case NM_RESET_WORKAROUND_2: |
---|
1681 | 1666 | reset_workaround_2 = 1; |
---|
1682 | | - /* Fall-through */ |
---|
| 1667 | + fallthrough; |
---|
1683 | 1668 | case NM_RESET_WORKAROUND: |
---|
1684 | 1669 | reset_workaround = 1; |
---|
1685 | 1670 | break; |
---|