Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20107f84 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Don't check invalid HP pin
  ALSA: dummy - Fix descriptions of pcm_substreams parameter
  ALSA: pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (sound)
  ALSA: hda: Use quirk mask for Dell Inspiron Mini9/Vostro A90 using ALC268
  sound: via82xx: deactivate DXS controls of inactive streams
  ALSA: snd-usb-caiaq: Bump version number to 1.3.20
  ALSA: snd-usb-caiaq: Lock on stream start/unpause
  ALSA: snd-usb-caiaq: Missing lock around use of buffer positions
  ALSA: sound/parisc: Move dereference after NULL test
  ALSA: sound: Move dereference after NULL test and drop unnecessary NULL tests
  ALSA: hda_intel: Add the Linux device ID for NVIDIA HDA controller
  ALSA: pcsp - Fix nforce workaround
  ALSA: SND_CS5535AUDIO: Remove the X86 platform dependency
  ASoC: Amstrad Delta: add info about the line discipline requirement to Kconfig help text
  ASoC: Fix possible codec_dai->ops NULL pointer problems
  ALSA: hda - Fix capture source checks for ALC662/663 codecs
  ASoC: Serialize access to dapm_power_widgets()
parents 3fe866ca 8fd6959d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -522,7 +522,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
    pcm_devs       - Number of PCM devices assigned to each card
                     (default = 1, up to 4)
    pcm_substreams - Number of PCM substreams assigned to each PCM
                     (default = 8, up to 16)
                     (default = 8, up to 128)
    hrtimer        - Use hrtimer (=1, default) or system timer (=0)
    fake_buffer    - Fake buffer allocations (default = 1)

+3 −2
Original line number Diff line number Diff line
@@ -953,11 +953,12 @@ static int snd_pcm_dev_register(struct snd_device *device)
	struct snd_pcm_substream *substream;
	struct snd_pcm_notify *notify;
	char str[16];
	struct snd_pcm *pcm = device->device_data;
	struct snd_pcm *pcm;
	struct device *dev;

	if (snd_BUG_ON(!pcm || !device))
	if (snd_BUG_ON(!device || !device->device_data))
		return -ENXIO;
	pcm = device->device_data;
	mutex_lock(&register_mutex);
	err = snd_pcm_add(pcm);
	if (err) {
+1 −3
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ MODULE_PARM_DESC(enable, "Enable this dummy soundcard.");
module_param_array(pcm_devs, int, NULL, 0444);
MODULE_PARM_DESC(pcm_devs, "PCM devices # (0-4) for dummy driver.");
module_param_array(pcm_substreams, int, NULL, 0444);
MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-16) for dummy driver.");
MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-128) for dummy driver.");
//module_param_array(midi_devs, int, NULL, 0444);
//MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver.");
module_param(fake_buffer, bool, 0444);
@@ -808,8 +808,6 @@ static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy)
	unsigned int idx;
	int err;

	if (snd_BUG_ON(!dummy))
		return -EINVAL;
	spin_lock_init(&dummy->mixer_lock);
	strcpy(card->mixername, "Dummy Mixer");

+34 −31
Original line number Diff line number Diff line
@@ -39,25 +39,20 @@ static DECLARE_TASKLET(pcsp_pcm_tasklet, pcsp_call_pcm_elapsed, 0);
/* write the port and returns the next expire time in ns;
 * called at the trigger-start and in hrtimer callback
 */
static unsigned long pcsp_timer_update(struct hrtimer *handle)
static u64 pcsp_timer_update(struct snd_pcsp *chip)
{
	unsigned char timer_cnt, val;
	u64 ns;
	struct snd_pcm_substream *substream;
	struct snd_pcm_runtime *runtime;
	struct snd_pcsp *chip = container_of(handle, struct snd_pcsp, timer);
	unsigned long flags;

	if (chip->thalf) {
		outb(chip->val61, 0x61);
		chip->thalf = 0;
		if (!atomic_read(&chip->timer_active))
			return 0;
		return chip->ns_rem;
	}

	if (!atomic_read(&chip->timer_active))
		return 0;
	substream = chip->playback_substream;
	if (!substream)
		return 0;
@@ -88,24 +83,17 @@ static unsigned long pcsp_timer_update(struct hrtimer *handle)
	return ns;
}

enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
static void pcsp_pointer_update(struct snd_pcsp *chip)
{
	struct snd_pcsp *chip = container_of(handle, struct snd_pcsp, timer);
	struct snd_pcm_substream *substream;
	int periods_elapsed, pointer_update;
	size_t period_bytes, buffer_bytes;
	unsigned long ns;
	int periods_elapsed;
	unsigned long flags;

	pointer_update = !chip->thalf;
	ns = pcsp_timer_update(handle);
	if (!ns)
		return HRTIMER_NORESTART;

	/* update the playback position */
	substream = chip->playback_substream;
	if (!substream)
		return HRTIMER_NORESTART;
		return;

	period_bytes = snd_pcm_lib_period_bytes(substream);
	buffer_bytes = snd_pcm_lib_buffer_bytes(substream);
@@ -134,6 +122,26 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)

	if (periods_elapsed)
		tasklet_schedule(&pcsp_pcm_tasklet);
}

enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
{
	struct snd_pcsp *chip = container_of(handle, struct snd_pcsp, timer);
	int pointer_update;
	u64 ns;

	if (!atomic_read(&chip->timer_active) || !chip->playback_substream)
		return HRTIMER_NORESTART;

	pointer_update = !chip->thalf;
	ns = pcsp_timer_update(chip);
	if (!ns) {
		printk(KERN_WARNING "PCSP: unexpected stop\n");
		return HRTIMER_NORESTART;
	}

	if (pointer_update)
		pcsp_pointer_update(chip);

	hrtimer_forward(handle, hrtimer_get_expires(handle), ns_to_ktime(ns));

@@ -142,8 +150,6 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)

static int pcsp_start_playing(struct snd_pcsp *chip)
{
	unsigned long ns;

#if PCSP_DEBUG
	printk(KERN_INFO "PCSP: start_playing called\n");
#endif
@@ -159,11 +165,7 @@ static int pcsp_start_playing(struct snd_pcsp *chip)
	atomic_set(&chip->timer_active, 1);
	chip->thalf = 0;

	ns = pcsp_timer_update(&pcsp_chip.timer);
	if (!ns)
		return -EIO;

	hrtimer_start(&pcsp_chip.timer, ktime_set(0, ns), HRTIMER_MODE_REL);
	hrtimer_start(&pcsp_chip.timer, ktime_set(0, 0), HRTIMER_MODE_REL);
	return 0;
}

@@ -232,21 +234,22 @@ static int snd_pcsp_playback_hw_free(struct snd_pcm_substream *substream)
static int snd_pcsp_playback_prepare(struct snd_pcm_substream *substream)
{
	struct snd_pcsp *chip = snd_pcm_substream_chip(substream);
	pcsp_sync_stop(chip);
	chip->playback_ptr = 0;
	chip->period_ptr = 0;
	chip->fmt_size =
		snd_pcm_format_physical_width(substream->runtime->format) >> 3;
	chip->is_signed = snd_pcm_format_signed(substream->runtime->format);
#if PCSP_DEBUG
	printk(KERN_INFO "PCSP: prepare called, "
			"size=%zi psize=%zi f=%zi f1=%i\n",
			"size=%zi psize=%zi f=%zi f1=%i fsize=%i\n",
			snd_pcm_lib_buffer_bytes(substream),
			snd_pcm_lib_period_bytes(substream),
			snd_pcm_lib_buffer_bytes(substream) /
			snd_pcm_lib_period_bytes(substream),
			substream->runtime->periods);
			substream->runtime->periods,
			chip->fmt_size);
#endif
	pcsp_sync_stop(chip);
	chip->playback_ptr = 0;
	chip->period_ptr = 0;
	chip->fmt_size =
		snd_pcm_format_physical_width(substream->runtime->format) >> 3;
	chip->is_signed = snd_pcm_format_signed(substream->runtime->format);
	return 0;
}

+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ static int pcsp_treble_put(struct snd_kcontrol *kcontrol,
	if (treble != chip->treble) {
		chip->treble = treble;
#if PCSP_DEBUG
		printk(KERN_INFO "PCSP: rate set to %i\n", PCSP_RATE());
		printk(KERN_INFO "PCSP: rate set to %li\n", PCSP_RATE());
#endif
		changed = 1;
	}
Loading