• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/sound/drivers/

Lines Matching refs:pm

92 static int portman_free(struct portman *pm)
94 kfree(pm);
102 struct portman *pm;
106 pm = kzalloc(sizeof(struct portman), GFP_KERNEL);
107 if (pm == NULL)
111 spin_lock_init(&pm->reg_lock);
112 pm->card = card;
113 pm->pardev = pardev;
115 *rchip = pm;
195 static inline void portman_write_command(struct portman *pm, u8 value)
197 parport_write_control(pm->pardev->port, value);
200 static inline u8 portman_read_command(struct portman *pm)
202 return parport_read_control(pm->pardev->port);
205 static inline u8 portman_read_status(struct portman *pm)
207 return parport_read_status(pm->pardev->port);
210 static inline u8 portman_read_data(struct portman *pm)
212 return parport_read_data(pm->pardev->port);
215 static inline void portman_write_data(struct portman *pm, u8 value)
217 parport_write_data(pm->pardev->port, value);
220 static void portman_write_midi(struct portman *pm,
242 portman_write_command(pm, command);
248 portman_write_data(pm, mididata);
253 } while ((portman_read_status(pm) & TXEMPTY) != TXEMPTY);
260 portman_write_command(pm, command | STROBE);
267 while ((portman_read_status(pm) & ESTB) == 0)
271 portman_write_command(pm, command);
273 while ((portman_read_status(pm) & ESTB) == ESTB)
280 while ((portman_read_status(pm) & BUSY) == BUSY)
292 static int portman_read_midi(struct portman *pm, int port)
298 portman_write_data(pm, 0); /* Make sure edge is down. */
302 portman_write_command(pm, cmdout);
304 while ((portman_read_status(pm) & ESTB) == ESTB)
310 if ((portman_read_status(pm) & RXAVAIL) == 0)
314 portman_write_command(pm, cmdout | STROBE); /* Write address+IE+Strobe. */
316 while ((portman_read_status(pm) & ESTB) == 0)
320 midi_data = (portman_read_status(pm) & 128);
321 portman_write_data(pm, 1); /* Cause rising edge, which shifts data. */
324 portman_write_data(pm, 0); /* Cause falling edge while data settles. */
325 midi_data |= (portman_read_status(pm) >> 1) & 64;
326 portman_write_data(pm, 1); /* Cause rising edge, which shifts data. */
329 portman_write_data(pm, 0); /* Cause falling edge while data settles. */
330 midi_data |= (portman_read_status(pm) >> 2) & 32;
331 portman_write_data(pm, 1); /* Cause rising edge, which shifts data. */
334 portman_write_data(pm, 0); /* Cause falling edge while data settles. */
335 midi_data |= (portman_read_status(pm) >> 3) & 16;
336 portman_write_data(pm, 1); /* Cause rising edge, which shifts data. */
339 portman_write_data(pm, 0); /* Cause falling edge while data settles. */
340 midi_data |= (portman_read_status(pm) >> 4) & 8;
341 portman_write_data(pm, 1); /* Cause rising edge, which shifts data. */
344 portman_write_data(pm, 0); /* Cause falling edge while data settles. */
345 midi_data |= (portman_read_status(pm) >> 5) & 4;
346 portman_write_data(pm, 1); /* Cause rising edge, which shifts data. */
349 portman_write_data(pm, 0); /* Cause falling edge while data settles. */
350 midi_data |= (portman_read_status(pm) >> 6) & 2;
351 portman_write_data(pm, 1); /* Cause rising edge, which shifts data. */
354 portman_write_data(pm, 0); /* Cause falling edge while data settles. */
355 midi_data |= (portman_read_status(pm) >> 7) & 1;
356 portman_write_data(pm, 1); /* Cause rising edge, which shifts data. */
357 portman_write_data(pm, 0); /* Return data clock low. */
361 portman_write_command(pm, cmdout); /* Output saved address+IE. */
364 while ((portman_read_status(pm) & ESTB) == ESTB)
374 static int portman_data_avail(struct portman *pm, int channel)
386 portman_write_command(pm, command);
388 if ((portman_read_status(pm) & RXAVAIL) == RXAVAIL)
399 static void portman_flush_input(struct portman *pm, unsigned char port)
420 portman_write_command(pm, command);
423 portman_write_command(pm, command | STROBE);
426 while ((portman_read_status(pm) & ESTB) == 0)
430 portman_write_data(pm, 0);
434 portman_write_data(pm, 1);
435 portman_write_data(pm, 0);
439 portman_write_command(pm, command | INT_EN);
442 while ((portman_read_status(pm) & ESTB) == ESTB)
500 static int portman_device_init(struct portman *pm)
502 portman_flush_input(pm, 0);
503 portman_flush_input(pm, 1);
524 struct portman *pm = substream->rmidi->private_data;
527 spin_lock_irqsave(&pm->reg_lock, flags);
529 pm->mode[substream->number] |= PORTMAN2X4_MODE_INPUT_TRIGGERED;
531 pm->mode[substream->number] &= ~PORTMAN2X4_MODE_INPUT_TRIGGERED;
532 spin_unlock_irqrestore(&pm->reg_lock, flags);
538 struct portman *pm = substream->rmidi->private_data;
542 spin_lock_irqsave(&pm->reg_lock, flags);
545 portman_write_midi(pm, substream->number, byte);
547 spin_unlock_irqrestore(&pm->reg_lock, flags);
565 struct portman *pm = card->private_data;
577 rmidi->private_data = pm;
583 pm->rmidi = rmidi;
603 pm->midi_input[substream->number] = substream;
617 struct portman *pm = ((struct snd_card*)userdata)->private_data;
619 spin_lock(&pm->reg_lock);
622 while ((portman_read_status(pm) & INT_REQ) == INT_REQ) {
625 if (portman_data_avail(pm, 0)) {
627 midivalue = portman_read_midi(pm, 0);
629 if (pm->mode[0] & PORTMAN2X4_MODE_INPUT_TRIGGERED)
630 snd_rawmidi_receive(pm->midi_input[0],
636 if (portman_data_avail(pm, 1)) {
638 midivalue = portman_read_midi(pm, 1);
640 if (pm->mode[1] & PORTMAN2X4_MODE_INPUT_TRIGGERED)
641 snd_rawmidi_receive(pm->midi_input[1],
647 spin_unlock(&pm->reg_lock);
718 struct portman *pm = card->private_data;
719 struct pardevice *pardev = pm->pardev;
722 if (pm->pardev_claimed)
727 portman_free(pm);
736 struct portman *pm = NULL;
773 if ((err = portman_create(card, pardev, &pm)) < 0) {
778 card->private_data = pm;
792 pm->pardev_claimed = 1;
795 if ((err = portman_device_init(pm)) < 0)