Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Nov 7, 2005
2 parents 8e33ba4 + b00e844 commit 8f0cb14
Show file tree
Hide file tree
Showing 165 changed files with 3,682 additions and 3,019 deletions.
29 changes: 20 additions & 9 deletions Documentation/sound/alsa/ALSA-Configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
spdif - Support SPDIF I/O
- Default: disabled

Module supports autoprobe and multiple chips (max 8).
This module supports one chip and autoprobe.

The power-management is supported.

Expand Down Expand Up @@ -206,7 +206,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
See "AC97 Quirk Option" section below.
spdif_aclink - S/PDIF transfer over AC-link (default = 1)

This module supports up to 8 cards and autoprobe.
This module supports one card and autoprobe.

ATI IXP has two different methods to control SPDIF output. One is
over AC-link and another is over the "direct" SPDIF output. The
Expand All @@ -218,7 +218,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.

Module for ATI IXP 150/200/250 AC97 modem controllers.

Module supports up to 8 cards.
This module supports one card and autoprobe.

Note: The default index value of this module is -2, i.e. the first
slot is excluded.
Expand Down Expand Up @@ -637,7 +637,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
model - force the model name
position_fix - Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size)

Module supports up to 8 cards.
This module supports one card and autoprobe.

Each codec may have a model table for different configurations.
If your machine isn't listed there, the default (usually minimal)
Expand All @@ -663,6 +663,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y

ALC260
hp HP machines
fujitsu Fujitsu S7020

CMI9880
minimal 3-jack in back
min_fp 3-jack in back, 2-jack in front
Expand Down Expand Up @@ -811,7 +815,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
semaphores (e.g. on some ASUS laptops)
(default off)

Module supports autoprobe and multiple bus-master chips (max 8).
This module supports one chip and autoprobe.

Note: the latest driver supports auto-detection of chip clock.
if you still encounter too fast playback, specify the clock
Expand All @@ -830,7 +834,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.

ac97_clock - AC'97 codec clock base (0 = auto-detect)

This module supports up to 8 cards and autoprobe.
This module supports one card and autoprobe.

Note: The default index value of this module is -2, i.e. the first
slot is excluded.
Expand Down Expand Up @@ -950,8 +954,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
use_cache - 0 or 1 (disabled by default)
vaio_hack - alias buffer_top=0x25a800
reset_workaround - enable AC97 RESET workaround for some laptops
reset_workaround2 - enable extended AC97 RESET workaround for some
other laptops

Module supports autoprobe and multiple chips (max 8).
This module supports one chip and autoprobe.

The power-management is supported.

Expand Down Expand Up @@ -980,6 +986,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
workaround is enabled automatically. For other laptops with a
hard freeze, you can try reset_workaround=1 option.

Note: Dell Latitude CSx laptops have another problem regarding
AC97 RESET. On these laptops, reset_workaround2 option is
turned on as default. This option is worth to try if the
previous reset_workaround option doesn't help.

Note: This driver is really crappy. It's a porting from the
OSS driver, which is a result of black-magic reverse engineering.
The detection of codec will fail if the driver is loaded *after*
Expand Down Expand Up @@ -1310,7 +1321,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
ac97_quirk - AC'97 workaround for strange hardware
See "AC97 Quirk Option" section below.

Module supports autoprobe and multiple bus-master chips (max 8).
This module supports one chip and autoprobe.

Note: on some SMP motherboards like MSI 694D the interrupts might
not be generated properly. In such a case, please try to
Expand Down Expand Up @@ -1352,7 +1363,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.

ac97_clock - AC'97 codec clock base (default 48000Hz)

Module supports up to 8 cards.
This module supports one card and autoprobe.

Note: The default index value of this module is -2, i.e. the first
slot is excluded.
Expand Down
56 changes: 15 additions & 41 deletions Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</affiliation>
</author>

<date>March 6, 2005</date>
<edition>0.3.4</edition>
<date>October 6, 2005</date>
<edition>0.3.5</edition>

<abstract>
<para>
Expand All @@ -30,7 +30,7 @@

<legalnotice>
<para>
Copyright (c) 2002-2004 Takashi Iwai <email>tiwai@suse.de</email>
Copyright (c) 2002-2005 Takashi Iwai <email>tiwai@suse.de</email>
</para>

<para>
Expand Down Expand Up @@ -1433,25 +1433,10 @@
<informalexample>
<programlisting>
<![CDATA[
if (chip->res_port) {
release_resource(chip->res_port);
kfree_nocheck(chip->res_port);
}
release_and_free_resource(chip->res_port);
]]>
</programlisting>
</informalexample>

As you can see, the resource pointer is also to be freed
via <function>kfree_nocheck()</function> after
<function>release_resource()</function> is called. You
cannot use <function>kfree()</function> here, because on ALSA,
<function>kfree()</function> may be a wrapper to its own
allocator with the memory debugging. Since the resource pointer
is allocated externally outside the ALSA, it must be released
via the native
<function>kfree()</function>.
<function>kfree_nocheck()</function> is used for that; it calls
the native <function>kfree()</function> without wrapper.
</para>

<para>
Expand Down Expand Up @@ -2190,8 +2175,7 @@ struct _snd_pcm_runtime {
unsigned int rate_den;

/* -- SW params -- */
int tstamp_timespec; /* use timeval (0) or timespec (1) */
snd_pcm_tstamp_t tstamp_mode; /* mmap timestamp is updated */
struct timespec tstamp_mode; /* mmap timestamp is updated */
unsigned int period_step;
unsigned int sleep_min; /* min ticks to sleep */
snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */
Expand Down Expand Up @@ -3709,8 +3693,7 @@ struct _snd_pcm_runtime {
<para>
Here, the chip instance is retrieved via
<function>snd_kcontrol_chip()</function> macro. This macro
converts from kcontrol-&gt;private_data to the type defined by
<type>chip_t</type>. The
just accesses to kcontrol-&gt;private_data. The
kcontrol-&gt;private_data field is
given as the argument of <function>snd_ctl_new()</function>
(see the later subsection
Expand Down Expand Up @@ -5998,32 +5981,23 @@ struct _snd_pcm_runtime {
The first argument is the expression to evaluate, and the
second argument is the action if it fails. When
<constant>CONFIG_SND_DEBUG</constant>, is set, it will show an
error message such as <computeroutput>BUG? (xxx) (called from
yyy)</computeroutput>. When no debug flag is set, this is
ignored.
error message such as <computeroutput>BUG? (xxx)</computeroutput>
together with stack trace.
</para>
</section>

<section id="useful-functions-snd-runtime-check">
<title><function>snd_runtime_check()</function></title>
<para>
This macro is quite similar with
<function>snd_assert()</function>. Unlike
<function>snd_assert()</function>, the expression is always
evaluated regardless of
<constant>CONFIG_SND_DEBUG</constant>. When
<constant>CONFIG_SND_DEBUG</constant> is set, the macro will
show a message like <computeroutput>ERROR (xx) (called from
yyy)</computeroutput>.
When no debug flag is set, this macro is ignored.
</para>
</section>

<section id="useful-functions-snd-bug">
<title><function>snd_BUG()</function></title>
<para>
It calls <function>snd_assert(0,)</function> -- that is, just
prints the error message at the point. It's useful to show that
a fatal error happens there.
It shows <computeroutput>BUG?</computeroutput> message and
stack trace as well as <function>snd_assert</function> at the point.
It's useful to show that a fatal error happens there.
</para>
<para>
When no debug flag is set, this macro is ignored.
</para>
</section>
</chapter>
Expand Down
65 changes: 38 additions & 27 deletions drivers/char/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,22 @@ static void get_rtc_alm_time (struct rtc_time *alm_tm);
#ifdef RTC_IRQ
static void rtc_dropped_irq(unsigned long data);

static void set_rtc_irq_bit(unsigned char bit);
static void mask_rtc_irq_bit(unsigned char bit);
static void set_rtc_irq_bit_locked(unsigned char bit);
static void mask_rtc_irq_bit_locked(unsigned char bit);

static inline void set_rtc_irq_bit(unsigned char bit)
{
spin_lock_irq(&rtc_lock);
set_rtc_irq_bit_locked(bit);
spin_unlock_irq(&rtc_lock);
}

static void mask_rtc_irq_bit(unsigned char bit)
{
spin_lock_irq(&rtc_lock);
mask_rtc_irq_bit_locked(bit);
spin_unlock_irq(&rtc_lock);
}
#endif

static int rtc_proc_open(struct inode *inode, struct file *file);
Expand Down Expand Up @@ -401,18 +415,19 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
}
case RTC_PIE_OFF: /* Mask periodic int. enab. bit */
{
mask_rtc_irq_bit(RTC_PIE);
unsigned long flags; /* can be called from isr via rtc_control() */
spin_lock_irqsave (&rtc_lock, flags);
mask_rtc_irq_bit_locked(RTC_PIE);
if (rtc_status & RTC_TIMER_ON) {
spin_lock_irq (&rtc_lock);
rtc_status &= ~RTC_TIMER_ON;
del_timer(&rtc_irq_timer);
spin_unlock_irq (&rtc_lock);
}
spin_unlock_irqrestore (&rtc_lock, flags);
return 0;
}
case RTC_PIE_ON: /* Allow periodic ints */
{

unsigned long flags; /* can be called from isr via rtc_control() */
/*
* We don't really want Joe User enabling more
* than 64Hz of interrupts on a multi-user machine.
Expand All @@ -421,14 +436,14 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
(!capable(CAP_SYS_RESOURCE)))
return -EACCES;

spin_lock_irqsave (&rtc_lock, flags);
if (!(rtc_status & RTC_TIMER_ON)) {
spin_lock_irq (&rtc_lock);
rtc_irq_timer.expires = jiffies + HZ/rtc_freq + 2*HZ/100;
add_timer(&rtc_irq_timer);
rtc_status |= RTC_TIMER_ON;
spin_unlock_irq (&rtc_lock);
}
set_rtc_irq_bit(RTC_PIE);
set_rtc_irq_bit_locked(RTC_PIE);
spin_unlock_irqrestore (&rtc_lock, flags);
return 0;
}
case RTC_UIE_OFF: /* Mask ints from RTC updates. */
Expand Down Expand Up @@ -609,6 +624,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
{
int tmp = 0;
unsigned char val;
unsigned long flags; /* can be called from isr via rtc_control() */

/*
* The max we can do is 8192Hz.
Expand All @@ -631,17 +647,17 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
if (arg != (1<<tmp))
return -EINVAL;

spin_lock_irq(&rtc_lock);
spin_lock_irqsave(&rtc_lock, flags);
if (hpet_set_periodic_freq(arg)) {
spin_unlock_irq(&rtc_lock);
spin_unlock_irqrestore(&rtc_lock, flags);
return 0;
}
rtc_freq = arg;

val = CMOS_READ(RTC_FREQ_SELECT) & 0xf0;
val |= (16 - tmp);
CMOS_WRITE(val, RTC_FREQ_SELECT);
spin_unlock_irq(&rtc_lock);
spin_unlock_irqrestore(&rtc_lock, flags);
return 0;
}
#endif
Expand Down Expand Up @@ -844,12 +860,15 @@ int rtc_control(rtc_task_t *task, unsigned int cmd, unsigned long arg)
#ifndef RTC_IRQ
return -EIO;
#else
spin_lock_irq(&rtc_task_lock);
unsigned long flags;
if (cmd != RTC_PIE_ON && cmd != RTC_PIE_OFF && cmd != RTC_IRQP_SET)
return -EINVAL;
spin_lock_irqsave(&rtc_task_lock, flags);
if (rtc_callback != task) {
spin_unlock_irq(&rtc_task_lock);
spin_unlock_irqrestore(&rtc_task_lock, flags);
return -ENXIO;
}
spin_unlock_irq(&rtc_task_lock);
spin_unlock_irqrestore(&rtc_task_lock, flags);
return rtc_do_ioctl(cmd, arg, 1);
#endif
}
Expand Down Expand Up @@ -1306,40 +1325,32 @@ static void get_rtc_alm_time(struct rtc_time *alm_tm)
* meddles with the interrupt enable/disable bits.
*/

static void mask_rtc_irq_bit(unsigned char bit)
static void mask_rtc_irq_bit_locked(unsigned char bit)
{
unsigned char val;

spin_lock_irq(&rtc_lock);
if (hpet_mask_rtc_irq_bit(bit)) {
spin_unlock_irq(&rtc_lock);
if (hpet_mask_rtc_irq_bit(bit))
return;
}
val = CMOS_READ(RTC_CONTROL);
val &= ~bit;
CMOS_WRITE(val, RTC_CONTROL);
CMOS_READ(RTC_INTR_FLAGS);

rtc_irq_data = 0;
spin_unlock_irq(&rtc_lock);
}

static void set_rtc_irq_bit(unsigned char bit)
static void set_rtc_irq_bit_locked(unsigned char bit)
{
unsigned char val;

spin_lock_irq(&rtc_lock);
if (hpet_set_rtc_irq_bit(bit)) {
spin_unlock_irq(&rtc_lock);
if (hpet_set_rtc_irq_bit(bit))
return;
}
val = CMOS_READ(RTC_CONTROL);
val |= bit;
CMOS_WRITE(val, RTC_CONTROL);
CMOS_READ(RTC_INTR_FLAGS);

rtc_irq_data = 0;
spin_unlock_irq(&rtc_lock);
}
#endif

Expand Down
10 changes: 0 additions & 10 deletions include/sound/ac97_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,6 @@
#define AC97_RATES_MIC_ADC 4
#define AC97_RATES_SPDIF 5

/* shared controllers */
enum {
AC97_SHARED_TYPE_NONE,
AC97_SHARED_TYPE_ICH,
AC97_SHARED_TYPE_ATIIXP,
AC97_SHARED_TYPE_VIA,
AC97_SHARED_TYPES
};

/*
*
*/
Expand Down Expand Up @@ -468,7 +459,6 @@ struct _snd_ac97_bus {
unsigned short used_slots[2][4]; /* actually used PCM slots */
unsigned short pcms_count; /* count of PCMs */
struct ac97_pcm *pcms;
unsigned int shared_type; /* type of shared controller betwen audio and modem */
ac97_t *codec[4];
snd_info_entry_t *proc;
};
Expand Down
Loading

0 comments on commit 8f0cb14

Please sign in to comment.