forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/pci/oxygen/oxygen_lib.c
....@@ -1,20 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * C-Media CMI8788 driver - main driver module
34 *
45 * Copyright (c) Clemens Ladisch <clemens@ladisch.de>
5
- *
6
- *
7
- * This driver is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License, version 2.
9
- *
10
- * This driver is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this driver; if not, write to the Free Software
17
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
186 */
197
208 #include <linux/delay.h>
....@@ -244,10 +232,7 @@
244232
245233 static void oxygen_proc_init(struct oxygen *chip)
246234 {
247
- struct snd_info_entry *entry;
248
-
249
- if (!snd_card_proc_new(chip->card, "oxygen", &entry))
250
- snd_info_set_text_ops(entry, chip, oxygen_proc_read);
235
+ snd_card_ro_proc_new(chip->card, "oxygen", chip, oxygen_proc_read);
251236 }
252237
253238 static const struct pci_device_id *
....@@ -373,7 +358,7 @@
373358 for (i = 0; i < 8; ++i)
374359 chip->dac_volume[i] = chip->model.dac_volume_min;
375360 chip->dac_mute = 1;
376
- chip->spdif_playback_enable = 1;
361
+ chip->spdif_playback_enable = 0;
377362 chip->spdif_bits = OXYGEN_SPDIF_C | OXYGEN_SPDIF_ORIGINAL |
378363 (IEC958_AES1_CON_PCM_CODER << OXYGEN_SPDIF_CATEGORY_SHIFT);
379364 chip->spdif_pcm_bits = chip->spdif_bits;
....@@ -676,6 +661,7 @@
676661 goto err_card;
677662 }
678663 chip->irq = pci->irq;
664
+ card->sync_irq = chip->irq;
679665
680666 strcpy(card->driver, chip->model.chip);
681667 strcpy(card->shortname, chip->model.shortname);
....@@ -744,12 +730,9 @@
744730 {
745731 struct snd_card *card = dev_get_drvdata(dev);
746732 struct oxygen *chip = card->private_data;
747
- unsigned int i, saved_interrupt_mask;
733
+ unsigned int saved_interrupt_mask;
748734
749735 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
750
-
751
- for (i = 0; i < PCM_COUNT; ++i)
752
- snd_pcm_suspend(chip->streams[i]);
753736
754737 if (chip->model.suspend)
755738 chip->model.suspend(chip);
....@@ -761,7 +744,6 @@
761744 oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0);
762745 spin_unlock_irq(&chip->reg_lock);
763746
764
- synchronize_irq(chip->irq);
765747 flush_work(&chip->spdif_input_bits_work);
766748 flush_work(&chip->gpio_work);
767749 chip->interrupt_mask = saved_interrupt_mask;