p16v.c (8dd06ef34b6e2f41b29fbf5fc1663780f2524285) p16v.c (12bda1076c76c87d40fbd9d5dfa5ddf6f60a1772)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk>
4 * Driver p16v chips
5 * Version: 0.25
6 *
7 * FEATURES currently supported:
8 * Output fixed at S32_LE, 2 channel to hw:0,0

--- 180 unchanged lines hidden (view full) ---

189 dev_dbg(emu->card->dev,
190 "p16v: open channel_id=%d, channel=%p, use=0x%x\n",
191 channel_id, channel, channel->use);
192 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n",
193 channel_id, chip, channel);
194#endif /* debug */
195 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
196 channel->epcm = epcm;
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk>
4 * Driver p16v chips
5 * Version: 0.25
6 *
7 * FEATURES currently supported:
8 * Output fixed at S32_LE, 2 channel to hw:0,0

--- 180 unchanged lines hidden (view full) ---

189 dev_dbg(emu->card->dev,
190 "p16v: open channel_id=%d, channel=%p, use=0x%x\n",
191 channel_id, channel, channel->use);
192 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n",
193 channel_id, chip, channel);
194#endif /* debug */
195 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
196 channel->epcm = epcm;
197 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
197 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
198 if (err < 0)
198 return err;
199
200 runtime->sync.id32[0] = substream->pcm->card->number;
201 runtime->sync.id32[1] = 'P';
202 runtime->sync.id32[2] = 16;
203 runtime->sync.id32[3] = 'V';
204
205 return 0;

--- 31 unchanged lines hidden (view full) ---

237 dev_dbg(emu->card->dev,
238 "p16v: open channel_id=%d, channel=%p, use=0x%x\n",
239 channel_id, channel, channel->use);
240 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n",
241 channel_id, chip, channel);
242#endif /* debug */
243 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
244 channel->epcm = epcm;
199 return err;
200
201 runtime->sync.id32[0] = substream->pcm->card->number;
202 runtime->sync.id32[1] = 'P';
203 runtime->sync.id32[2] = 16;
204 runtime->sync.id32[3] = 'V';
205
206 return 0;

--- 31 unchanged lines hidden (view full) ---

238 dev_dbg(emu->card->dev,
239 "p16v: open channel_id=%d, channel=%p, use=0x%x\n",
240 channel_id, channel, channel->use);
241 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n",
242 channel_id, chip, channel);
243#endif /* debug */
244 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
245 channel->epcm = epcm;
245 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
246 err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
247 if (err < 0)
246 return err;
247
248 return 0;
249}
250
251
252/* close callback */
253static int snd_p16v_pcm_close_playback(struct snd_pcm_substream *substream)

--- 330 unchanged lines hidden (view full) ---

584 struct snd_pcm *pcm;
585 struct snd_pcm_substream *substream;
586 int err;
587 int capture=1;
588
589 /* dev_dbg(emu->card->dev, "snd_p16v_pcm called. device=%d\n", device); */
590 emu->p16v_device_offset = device;
591
248 return err;
249
250 return 0;
251}
252
253
254/* close callback */
255static int snd_p16v_pcm_close_playback(struct snd_pcm_substream *substream)

--- 330 unchanged lines hidden (view full) ---

586 struct snd_pcm *pcm;
587 struct snd_pcm_substream *substream;
588 int err;
589 int capture=1;
590
591 /* dev_dbg(emu->card->dev, "snd_p16v_pcm called. device=%d\n", device); */
592 emu->p16v_device_offset = device;
593
592 if ((err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm)) < 0)
594 err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm);
595 if (err < 0)
593 return err;
594
595 pcm->private_data = emu;
596 // Single playback 8 channel device.
597 // Single capture 2 channel device.
598 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_p16v_playback_front_ops);
599 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_p16v_capture_ops);
600

--- 202 unchanged lines hidden (view full) ---

803
804
805int snd_p16v_mixer(struct snd_emu10k1 *emu)
806{
807 int i, err;
808 struct snd_card *card = emu->card;
809
810 for (i = 0; i < ARRAY_SIZE(p16v_mixer_controls); i++) {
596 return err;
597
598 pcm->private_data = emu;
599 // Single playback 8 channel device.
600 // Single capture 2 channel device.
601 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_p16v_playback_front_ops);
602 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_p16v_capture_ops);
603

--- 202 unchanged lines hidden (view full) ---

806
807
808int snd_p16v_mixer(struct snd_emu10k1 *emu)
809{
810 int i, err;
811 struct snd_card *card = emu->card;
812
813 for (i = 0; i < ARRAY_SIZE(p16v_mixer_controls); i++) {
811 if ((err = snd_ctl_add(card, snd_ctl_new1(&p16v_mixer_controls[i],
812 emu))) < 0)
814 err = snd_ctl_add(card, snd_ctl_new1(&p16v_mixer_controls[i], emu));
815 if (err < 0)
813 return err;
814 }
815 return 0;
816}
817
818#ifdef CONFIG_PM_SLEEP
819
820#define NUM_CHS 1 /* up to 4, but only first channel is used */

--- 36 unchanged lines hidden ---
816 return err;
817 }
818 return 0;
819}
820
821#ifdef CONFIG_PM_SLEEP
822
823#define NUM_CHS 1 /* up to 4, but only first channel is used */

--- 36 unchanged lines hidden ---