Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 151638 | Differences between
and this patch

Collapse All | Expand All

(-)hsfmodem-7.47.00.03full/modules/GPL/hda/patch_cnxthsf.c (+60 lines)
Lines 441-446 Link Here
441
441
442
#include <sound/pcm_params.h>
442
#include <sound/pcm_params.h>
443
443
444
#ifndef FOUND_SND_PCM_HW_PARAM_SET
445
static int snd_interval_refine_set(struct snd_interval *i, unsigned int val)
446
{
447
	struct snd_interval t;
448
	t.empty = 0;
449
	t.min = t.max = val;
450
	t.openmin = t.openmax = 0;
451
	t.integer = 1;
452
	return snd_interval_refine(i, &t);
453
}
454
455
static int _snd_pcm_hw_param_set(struct snd_pcm_hw_params *params,
456
				 snd_pcm_hw_param_t var, unsigned int val,
457
				 int dir)
458
{
459
	int changed;
460
	if (hw_is_mask(var)) {
461
		struct snd_mask *m = hw_param_mask(params, var);
462
		if (val == 0 && dir < 0) {
463
			changed = -EINVAL;
464
			snd_mask_none(m);
465
		} else {
466
			if (dir > 0)
467
				val++;
468
			else if (dir < 0)
469
				val--;
470
			changed = snd_mask_refine_set(hw_param_mask(params, var), val);
471
		}
472
	} else if (hw_is_interval(var)) {
473
		struct snd_interval *i = hw_param_interval(params, var);
474
		if (val == 0 && dir < 0) {
475
			changed = -EINVAL;
476
			snd_interval_none(i);
477
		} else if (dir == 0)
478
			changed = snd_interval_refine_set(i, val);
479
		else {
480
			struct snd_interval t;
481
			t.openmin = 1;
482
			t.openmax = 1;
483
			t.empty = 0;
484
			t.integer = 0;
485
			if (dir < 0) {
486
				t.min = val - 1;
487
				t.max = val;
488
			} else {
489
				t.min = val;
490
				t.max = val+1;
491
			}
492
			changed = snd_interval_refine(i, &t);
493
		}
494
	} else
495
		return -EINVAL;
496
	if (changed) {
497
		params->cmask |= 1 << var;
498
		params->rmask |= 1 << var;
499
	}
500
	return changed;
501
}
502
#endif /* !FOUND_SND_PCM_HW_PARAM_SET */
503
444
static int cnxthsf_snd_pcm_change_params(struct snd_pcm_substream *substream, int hw_param_buffer_bytes)
504
static int cnxthsf_snd_pcm_change_params(struct snd_pcm_substream *substream, int hw_param_buffer_bytes)
445
{
505
{
446
	//snd_pcm_runtime_t *runtime = substream->runtime;
506
	//snd_pcm_runtime_t *runtime = substream->runtime;
(-)hsfmodem-7.47.00.03full/modules/Makefile (-1 / +2 lines)
Lines 100-107 Link Here
100
FOUND_KZALLOC := $(shell grep -q 'kzalloc' ${REAL_KERNELSRC}/include/linux/slab.h 2>/dev/null && echo -DFOUND_KZALLOC)
100
FOUND_KZALLOC := $(shell grep -q 'kzalloc' ${REAL_KERNELSRC}/include/linux/slab.h 2>/dev/null && echo -DFOUND_KZALLOC)
101
FOUND_OPEN_SUBSTREAM_FILE := $(shell grep -q 'snd_pcm_open_substream.*struct[ \t]*file' ${REAL_KERNELSRC}/include/sound/pcm.h 2>/dev/null && echo -DFOUND_OPEN_SUBSTREAM_FILE)
101
FOUND_OPEN_SUBSTREAM_FILE := $(shell grep -q 'snd_pcm_open_substream.*struct[ \t]*file' ${REAL_KERNELSRC}/include/sound/pcm.h 2>/dev/null && echo -DFOUND_OPEN_SUBSTREAM_FILE)
102
FOUND_TLV := $(shell test -e ${REAL_KERNELSRC}/include/sound/tlv.h 2>/dev/null && echo -DFOUND_TLV)
102
FOUND_TLV := $(shell test -e ${REAL_KERNELSRC}/include/sound/tlv.h 2>/dev/null && echo -DFOUND_TLV)
103
FOUND_SND_PCM_HW_PARAM_SET := $(shell grep -q '_snd_pcm_hw_param_set' ${REAL_KERNELSRC}/include/sound/pcm_params.h 2>/dev/null && echo -DFOUND_SND_PCM_HW_PARAM_SET)
103
104
104
HDA_CFLAGS := $(FOUND_KZALLOC) $(FOUND_OPEN_SUBSTREAM_FILE) $(FOUND_TLV)
105
HDA_CFLAGS := $(FOUND_KZALLOC) $(FOUND_OPEN_SUBSTREAM_FILE) $(FOUND_TLV) $(FOUND_SND_PCM_HW_PARAM_SET) 
105
106
106
else
107
else
107
KO= o
108
KO= o

Return to bug 151638