.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for ESS Maestro 1/2/2E Sound Card (started 21.8.99) |
---|
3 | 4 | * Copyright (c) by Matze Braun <MatzeBraun@gmx.de>. |
---|
.. | .. |
---|
9 | 10 | * |
---|
10 | 11 | * TODO: |
---|
11 | 12 | * Perhaps Synth |
---|
12 | | - * |
---|
13 | | - * This program is free software; you can redistribute it and/or modify |
---|
14 | | - * it under the terms of the GNU General Public License as published by |
---|
15 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
16 | | - * (at your option) any later version. |
---|
17 | | - * |
---|
18 | | - * This program is distributed in the hope that it will be useful, |
---|
19 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | | - * GNU General Public License for more details. |
---|
22 | | - * |
---|
23 | | - * You should have received a copy of the GNU General Public License |
---|
24 | | - * along with this program; if not, write to the Free Software |
---|
25 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
26 | | - * |
---|
27 | 13 | * |
---|
28 | 14 | * Notes from Zach Brown about the driver code |
---|
29 | 15 | * |
---|
.. | .. |
---|
1436 | 1422 | int err; |
---|
1437 | 1423 | struct esm_memory *chunk; |
---|
1438 | 1424 | |
---|
1439 | | - chip->dma.dev.type = SNDRV_DMA_TYPE_DEV; |
---|
1440 | | - chip->dma.dev.dev = snd_dma_pci_data(chip->pci); |
---|
1441 | 1425 | err = snd_dma_alloc_pages_fallback(SNDRV_DMA_TYPE_DEV, |
---|
1442 | | - snd_dma_pci_data(chip->pci), |
---|
| 1426 | + &chip->pci->dev, |
---|
1443 | 1427 | chip->total_bufsize, &chip->dma); |
---|
1444 | 1428 | if (err < 0 || ! chip->dma.area) { |
---|
1445 | 1429 | dev_err(chip->card->dev, |
---|
.. | .. |
---|
1680 | 1664 | static const struct snd_pcm_ops snd_es1968_playback_ops = { |
---|
1681 | 1665 | .open = snd_es1968_playback_open, |
---|
1682 | 1666 | .close = snd_es1968_playback_close, |
---|
1683 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
1684 | 1667 | .hw_params = snd_es1968_hw_params, |
---|
1685 | 1668 | .hw_free = snd_es1968_hw_free, |
---|
1686 | 1669 | .prepare = snd_es1968_pcm_prepare, |
---|
.. | .. |
---|
1691 | 1674 | static const struct snd_pcm_ops snd_es1968_capture_ops = { |
---|
1692 | 1675 | .open = snd_es1968_capture_open, |
---|
1693 | 1676 | .close = snd_es1968_capture_close, |
---|
1694 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
1695 | 1677 | .hw_params = snd_es1968_hw_params, |
---|
1696 | 1678 | .hw_free = snd_es1968_hw_free, |
---|
1697 | 1679 | .prepare = snd_es1968_pcm_prepare, |
---|
.. | .. |
---|
2025 | 2007 | struct snd_ctl_elem_id elem_id; |
---|
2026 | 2008 | #endif |
---|
2027 | 2009 | int err; |
---|
2028 | | - static struct snd_ac97_bus_ops ops = { |
---|
| 2010 | + static const struct snd_ac97_bus_ops ops = { |
---|
2029 | 2011 | .write = snd_es1968_ac97_write, |
---|
2030 | 2012 | .read = snd_es1968_ac97_read, |
---|
2031 | 2013 | }; |
---|
.. | .. |
---|
2392 | 2374 | chip->in_suspend = 1; |
---|
2393 | 2375 | cancel_work_sync(&chip->hwvol_work); |
---|
2394 | 2376 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
---|
2395 | | - snd_pcm_suspend_all(chip->pcm); |
---|
2396 | 2377 | snd_ac97_suspend(chip->ac97); |
---|
2397 | 2378 | snd_es1968_bob_stop(chip); |
---|
2398 | 2379 | return 0; |
---|
.. | .. |
---|
2548 | 2529 | char *name; |
---|
2549 | 2530 | }; |
---|
2550 | 2531 | |
---|
2551 | | -static struct snd_es1968_tea575x_gpio snd_es1968_tea575x_gpios[] = { |
---|
| 2532 | +static const struct snd_es1968_tea575x_gpio snd_es1968_tea575x_gpios[] = { |
---|
2552 | 2533 | { .data = 6, .clk = 7, .wren = 8, .most = 9, .name = "SF64-PCE2" }, |
---|
2553 | 2534 | { .data = 7, .clk = 8, .wren = 6, .most = 10, .name = "M56VAP" }, |
---|
2554 | 2535 | }; |
---|
.. | .. |
---|
2621 | 2602 | #endif |
---|
2622 | 2603 | |
---|
2623 | 2604 | if (chip->io_port) { |
---|
2624 | | - if (chip->irq >= 0) |
---|
2625 | | - synchronize_irq(chip->irq); |
---|
2626 | 2605 | outw(1, chip->io_port + 0x04); /* clear WP interrupts */ |
---|
2627 | 2606 | outw(0, chip->io_port + ESM_PORT_HOST_IRQ); /* disable IRQ */ |
---|
2628 | 2607 | } |
---|
.. | .. |
---|
2652 | 2631 | unsigned short vendor; /* subsystem vendor id */ |
---|
2653 | 2632 | }; |
---|
2654 | 2633 | |
---|
2655 | | -static struct ess_device_list pm_whitelist[] = { |
---|
| 2634 | +static const struct ess_device_list pm_allowlist[] = { |
---|
2656 | 2635 | { TYPE_MAESTRO2E, 0x0e11 }, /* Compaq Armada */ |
---|
2657 | 2636 | { TYPE_MAESTRO2E, 0x1028 }, |
---|
2658 | 2637 | { TYPE_MAESTRO2E, 0x103c }, |
---|
.. | .. |
---|
2663 | 2642 | { TYPE_MAESTRO2, 0x125d }, /* a PCI card, e.g. SF64-PCE2 */ |
---|
2664 | 2643 | }; |
---|
2665 | 2644 | |
---|
2666 | | -static struct ess_device_list mpu_blacklist[] = { |
---|
| 2645 | +static const struct ess_device_list mpu_denylist[] = { |
---|
2667 | 2646 | { TYPE_MAESTRO2, 0x125d }, |
---|
2668 | 2647 | }; |
---|
2669 | 2648 | |
---|
.. | .. |
---|
2677 | 2656 | int radio_nr, |
---|
2678 | 2657 | struct es1968 **chip_ret) |
---|
2679 | 2658 | { |
---|
2680 | | - static struct snd_device_ops ops = { |
---|
| 2659 | + static const struct snd_device_ops ops = { |
---|
2681 | 2660 | .dev_free = snd_es1968_dev_free, |
---|
2682 | 2661 | }; |
---|
2683 | 2662 | struct es1968 *chip; |
---|
.. | .. |
---|
2731 | 2710 | return -EBUSY; |
---|
2732 | 2711 | } |
---|
2733 | 2712 | chip->irq = pci->irq; |
---|
| 2713 | + card->sync_irq = chip->irq; |
---|
2734 | 2714 | |
---|
2735 | 2715 | /* Clear Maestro_map */ |
---|
2736 | 2716 | for (i = 0; i < 32; i++) |
---|
.. | .. |
---|
2744 | 2724 | pci_set_master(pci); |
---|
2745 | 2725 | |
---|
2746 | 2726 | if (do_pm > 1) { |
---|
2747 | | - /* disable power-management if not on the whitelist */ |
---|
| 2727 | + /* disable power-management if not on the allowlist */ |
---|
2748 | 2728 | unsigned short vend; |
---|
2749 | 2729 | pci_read_config_word(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); |
---|
2750 | | - for (i = 0; i < (int)ARRAY_SIZE(pm_whitelist); i++) { |
---|
2751 | | - if (chip->type == pm_whitelist[i].type && |
---|
2752 | | - vend == pm_whitelist[i].vendor) { |
---|
| 2730 | + for (i = 0; i < (int)ARRAY_SIZE(pm_allowlist); i++) { |
---|
| 2731 | + if (chip->type == pm_allowlist[i].type && |
---|
| 2732 | + vend == pm_allowlist[i].vendor) { |
---|
2753 | 2733 | do_pm = 1; |
---|
2754 | 2734 | break; |
---|
2755 | 2735 | } |
---|
.. | .. |
---|
2868 | 2848 | } |
---|
2869 | 2849 | |
---|
2870 | 2850 | if (enable_mpu[dev] == 2) { |
---|
2871 | | - /* check the black list */ |
---|
| 2851 | + /* check the deny list */ |
---|
2872 | 2852 | unsigned short vend; |
---|
2873 | 2853 | pci_read_config_word(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); |
---|
2874 | | - for (i = 0; i < ARRAY_SIZE(mpu_blacklist); i++) { |
---|
2875 | | - if (chip->type == mpu_blacklist[i].type && |
---|
2876 | | - vend == mpu_blacklist[i].vendor) { |
---|
| 2854 | + for (i = 0; i < ARRAY_SIZE(mpu_denylist); i++) { |
---|
| 2855 | + if (chip->type == mpu_denylist[i].type && |
---|
| 2856 | + vend == mpu_denylist[i].vendor) { |
---|
2877 | 2857 | enable_mpu[dev] = 0; |
---|
2878 | 2858 | break; |
---|
2879 | 2859 | } |
---|