Ignore:
Timestamp:
Apr 3, 2017, 4:51:56 PM (8 years ago)
Author:
David Azarewicz
Message:

Merged/reintegrated v2 branch into trunk. Trunk is now v2

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/pci/fm801.c

    r410 r598  
    5656 *    2 = MediaForte 256-PCPR
    5757 *    3 = MediaForte 64-PCR
    58  *   16 = setup tuner only (this is additional bit), i.e. SF-64-PCR FM card
     58 *   16 = setup tuner only (this is additional bit), i.e. SF64-PCR FM card
    5959 *  High 16-bits are video (radio) device number + 1
    6060 */
     
    6868MODULE_PARM_DESC(enable, "Enable FM801 soundcard.");
    6969module_param_array(tea575x_tuner, int, NULL, 0444);
    70 MODULE_PARM_DESC(tea575x_tuner, "Enable TEA575x tuner.");
     70MODULE_PARM_DESC(tea575x_tuner, "TEA575x tuner access method (1 = SF256-PCS, 2=SF256-PCPR, 3=SF64-PCR, +16=tuner-only).");
     71
     72#define TUNER_ONLY              (1<<4)
     73#define TUNER_TYPE_MASK         (~TUNER_ONLY & 0xFFFF)
    7174
    7275/*
     
    161164                     secondary: 1;      /* secondary codec */
    162165        unsigned char secondary_addr;   /* address of the secondary codec */
    163         unsigned int tea575x_tuner;     /* tuner flags */
     166        unsigned int tea575x_tuner;     /* tuner access method & flags */
    164167
    165168        unsigned short ply_ctrl; /* playback control */
     
    203206};
    204207
    205 static struct pci_device_id snd_fm801_ids[] = {
     208static DEFINE_PCI_DEVICE_TABLE(snd_fm801_ids) = {
    206209        { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, },   /* FM801 */
    207210        { 0x5213, 0x0510, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, },   /* Gallant Odyssey Sound 4 */
     
    12881291        unsigned short cmdw;
    12891292
    1290         if (chip->tea575x_tuner & 0x0010)
     1293        if (chip->tea575x_tuner & TUNER_ONLY)
    12911294                goto __ac97_ok;
    12921295
     
    12971300        outw(0, FM801_REG(chip, CODEC_CTRL));
    12981301
    1299         if (wait_for_codec(chip, 0, AC97_RESET, msecs_to_jiffies(750)) < 0) {
    1300                 snd_printk(KERN_ERR "Primary AC'97 codec not found\n");
    1301                 if (! resume)
    1302                         return -EIO;
    1303         }
     1302        if (wait_for_codec(chip, 0, AC97_RESET, msecs_to_jiffies(750)) < 0)
     1303                if (!resume) {
     1304                        snd_printk(KERN_INFO "Primary AC'97 codec not found, "
     1305                                            "assume SF64-PCR (tuner-only)\n");
     1306                        chip->tea575x_tuner = 3 | TUNER_ONLY;
     1307                        goto __ac97_ok;
     1308                }
    13041309
    13051310        if (chip->multichannel) {
     
    14151420        }
    14161421        chip->port = pci_resource_start(pci, 0);
    1417         if ((tea575x_tuner & 0x0010) == 0) {
     1422        if ((tea575x_tuner & TUNER_ONLY) == 0) {
    14181423                if (request_irq(pci->irq, snd_fm801_interrupt, IRQF_SHARED,
    14191424                                "FM801", chip)) {
     
    14341439
    14351440        snd_fm801_chip_init(chip, 0);
     1441        /* init might set tuner access method */
     1442        tea575x_tuner = chip->tea575x_tuner;
     1443
     1444        if (chip->irq >= 0 && (tea575x_tuner & TUNER_ONLY)) {
     1445                pci_clear_master(pci);
     1446                free_irq(chip->irq, chip);
     1447                chip->irq = -1;
     1448        }
    14361449
    14371450        if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
     
    14431456
    14441457#ifdef TEA575X_RADIO
    1445         if (tea575x_tuner > 0 && (tea575x_tuner & 0x000f) < 4) {
     1458        if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 &&
     1459            (tea575x_tuner & TUNER_TYPE_MASK) < 4) {
    14461460                chip->tea.dev_nr = tea575x_tuner >> 16;
    14471461                chip->tea.card = card;
    14481462                chip->tea.freq_fixup = 10700;
    14491463                chip->tea.private_data = chip;
    1450                 chip->tea.ops = &snd_fm801_tea_ops[(tea575x_tuner & 0x000f) - 1];
     1464                chip->tea.ops = &snd_fm801_tea_ops[(tea575x_tuner & TUNER_TYPE_MASK) - 1];
    14511465                snd_tea575x_init(&chip->tea);
    14521466        }
     
    14881502                card->shortname, chip->port, chip->irq);
    14891503
    1490         if (tea575x_tuner[dev] & 0x0010)
     1504        if (chip->tea575x_tuner & TUNER_ONLY)
    14911505                goto __fm801_tuner_only;
    14921506
Note: See TracChangeset for help on using the changeset viewer.