Lines Matching +full:inverted +full:- +full:tx
4 * Copyright (c) by Levent Guendogdu <levon@feature-it.com>
22 * - cleanup and rewrite
24 * - source code cleanup
26 * - fixed compilation problem with alsa 1.0.6a (removed MODULE_CLASSES,
30 * - added 2.6 kernel support
32 …* - added parport_unregister_driver to the startup routine if the driver fails to detect a po…
33 * - added support for all 4 output ports in portman_putmidi
35 * - added checks for opened input device in interrupt handler
37 * - ported from alsa 0.5 to 1.0
107 return -ENOMEM; in portman_create()
110 spin_lock_init(&pm->reg_lock); in portman_create()
111 pm->card = card; in portman_create()
112 pm->pardev = pardev; in portman_create()
124 #define PP_STAT_BSY 0x80 /* Busy status. Inverted. */
125 #define PP_STAT_ACK 0x40 /* Acknowledge. Non-Inverted. */
126 #define PP_STAT_POUT 0x20 /* Paper Out. Non-Inverted. */
127 #define PP_STAT_SEL 0x10 /* Select. Non-Inverted. */
128 #define PP_STAT_ERR 0x08 /* Error. Non-Inverted. */
131 #define PP_CMD_IEN 0x10 /* IRQ Enable. Non-Inverted. */
132 #define PP_CMD_SELI 0x08 /* Select Input. Inverted. */
133 #define PP_CMD_INIT 0x04 /* Init Printer. Non-Inverted. */
134 #define PP_CMD_FEED 0x02 /* Auto Feed. Inverted. */
135 #define PP_CMD_STB 0x01 /* Strobe. Inverted. */
166 * --------
170 #define SYNC_STAT PP_STAT_SEL /* Reserved - Sync Status. 0 1 0 */
172 #define TXEMPTY PP_STAT_SEL /* Tx Empty, channel 0. 1 0 0 */
173 // TXEMPTY1 PP_STAT_SEL /* Tx Empty, channel 1. 1 0 1 */
174 // TXEMPTY2 PP_STAT_SEL /* Tx Empty, channel 2. 1 1 0 */
175 // TXEMPTY3 PP_STAT_SEL /* Tx Empty, channel 3. 1 1 1 */
178 * --------
182 #define SYNC_DATA PP_STAT_BSY /* Reserved - Sync Data. 0 1 0 */
196 parport_write_control(pm->pardev->port, value); in portman_write_command()
201 return parport_read_control(pm->pardev->port); in portman_read_command()
206 return parport_read_status(pm->pardev->port); in portman_read_status()
211 return parport_read_data(pm->pardev->port); in portman_read_data()
216 parport_write_data(pm->pardev->port, value); in portman_write_data()
225 * Set up Tx Channel address field for use with PP Cmd Register. in portman_write_midi()
236 * write the address associated with the current Tx channel to the in portman_write_midi()
269 /* Release strobe and immediately re-allow interrupts. */ in portman_write_midi()
289 * Return -1 if no data
310 return -1; /* No data. */ in portman_read_midi()
359 /* De-assert Strobe and return data. */ in portman_read_midi()
469 return 1; /* CODE 1 - Strobe Failure. */ in portman_probe()
477 return 1; /* CODE 1 - Strobe Failure. */ in portman_probe()
482 /* Check if Tx circuitry is functioning properly. If initialized in portman_probe()
486 parport_write_control(p, TXDATA0); /* Tx channel 0, strobe off. */ in portman_probe()
523 struct portman *pm = substream->rmidi->private_data; in snd_portman_midi_input_trigger()
526 spin_lock_irqsave(&pm->reg_lock, flags); in snd_portman_midi_input_trigger()
528 pm->mode[substream->number] |= PORTMAN2X4_MODE_INPUT_TRIGGERED; in snd_portman_midi_input_trigger()
530 pm->mode[substream->number] &= ~PORTMAN2X4_MODE_INPUT_TRIGGERED; in snd_portman_midi_input_trigger()
531 spin_unlock_irqrestore(&pm->reg_lock, flags); in snd_portman_midi_input_trigger()
537 struct portman *pm = substream->rmidi->private_data; in snd_portman_midi_output_trigger()
541 spin_lock_irqsave(&pm->reg_lock, flags); in snd_portman_midi_output_trigger()
544 portman_write_midi(pm, substream->number, byte); in snd_portman_midi_output_trigger()
546 spin_unlock_irqrestore(&pm->reg_lock, flags); in snd_portman_midi_output_trigger()
564 struct portman *pm = card->private_data; in snd_portman_rawmidi_create()
576 rmidi->private_data = pm; in snd_portman_rawmidi_create()
577 strcpy(rmidi->name, CARD_NAME); in snd_portman_rawmidi_create()
578 rmidi->info_flags = SNDRV_RAWMIDI_INFO_OUTPUT | in snd_portman_rawmidi_create()
582 pm->rmidi = rmidi; in snd_portman_rawmidi_create()
593 &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams, in snd_portman_rawmidi_create()
595 sprintf(substream->name, in snd_portman_rawmidi_create()
596 "Portman2x4 %d", substream->number+1); in snd_portman_rawmidi_create()
600 &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT].substreams, in snd_portman_rawmidi_create()
602 pm->midi_input[substream->number] = substream; in snd_portman_rawmidi_create()
603 sprintf(substream->name, in snd_portman_rawmidi_create()
604 "Portman2x4 %d", substream->number+1); in snd_portman_rawmidi_create()
616 struct portman *pm = ((struct snd_card*)userdata)->private_data; in snd_portman_interrupt()
618 spin_lock(&pm->reg_lock); in snd_portman_interrupt()
628 if (pm->mode[0] & PORTMAN2X4_MODE_INPUT_TRIGGERED) in snd_portman_interrupt()
629 snd_rawmidi_receive(pm->midi_input[0], in snd_portman_interrupt()
639 if (pm->mode[1] & PORTMAN2X4_MODE_INPUT_TRIGGERED) in snd_portman_interrupt()
640 snd_rawmidi_receive(pm->midi_input[1], in snd_portman_interrupt()
646 spin_unlock(&pm->reg_lock); in snd_portman_interrupt()
684 if (strcmp(pardev->name, DRIVER_NAME)) in snd_portman_dev_probe()
685 return -ENODEV; in snd_portman_dev_probe()
703 struct portman *pm = card->private_data; in snd_portman_card_private_free()
704 struct pardevice *pardev = pm->pardev; in snd_portman_card_private_free()
718 int dev = pdev->id; in snd_portman_probe()
733 return -ENODEV; in snd_portman_probe()
735 return -ENOENT; in snd_portman_probe()
737 err = snd_card_new(&pdev->dev, index[dev], id[dev], THIS_MODULE, in snd_portman_probe()
743 strcpy(card->driver, DRIVER_NAME); in snd_portman_probe()
744 strcpy(card->shortname, CARD_NAME); in snd_portman_probe()
745 sprintf(card->longname, "%s at 0x%lx, irq %i", in snd_portman_probe()
746 card->shortname, p->base, p->irq); in snd_portman_probe()
752 pdev->id); /* device number */ in snd_portman_probe()
755 err = -EIO; in snd_portman_probe()
761 snd_printd("Cannot claim parport 0x%lx\n", pardev->port->base); in snd_portman_probe()
762 err = -EIO; in snd_portman_probe()
770 card->private_data = pm; in snd_portman_probe()
771 card->private_free = snd_portman_card_private_free; in snd_portman_probe()
775 err = -EIO; in snd_portman_probe()
796 snd_printk(KERN_INFO "Portman 2x4 on 0x%lx\n", p->base); in snd_portman_probe()
853 return -EIO; in snd_portman_module_init()
858 return -ENODEV; in snd_portman_module_init()