Remove xxx_t typedefs from the PowerMac driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
#endif
#ifdef PMAC_AMP_AVAIL
-typedef struct awacs_amp {
+struct awacs_amp {
unsigned char amp_master;
unsigned char amp_vol[2][2];
unsigned char amp_tone[2];
-} awacs_amp_t;
+};
#define CHECK_CUDA_AMP() (sys_ctrler == SYS_CTRLER_CUDA)
#endif /* PMAC_AMP_AVAIL */
-static void snd_pmac_screamer_wait(pmac_t *chip)
+static void snd_pmac_screamer_wait(struct snd_pmac *chip)
{
long timeout = 2000;
while (!(in_le32(&chip->awacs->codec_stat) & MASK_VALID)) {
* write AWACS register
*/
static void
-snd_pmac_awacs_write(pmac_t *chip, int val)
+snd_pmac_awacs_write(struct snd_pmac *chip, int val)
{
long timeout = 5000000;
}
static void
-snd_pmac_awacs_write_reg(pmac_t *chip, int reg, int val)
+snd_pmac_awacs_write_reg(struct snd_pmac *chip, int reg, int val)
{
snd_pmac_awacs_write(chip, val | (reg << 12));
chip->awacs_reg[reg] = val;
}
static void
-snd_pmac_awacs_write_noreg(pmac_t *chip, int reg, int val)
+snd_pmac_awacs_write_noreg(struct snd_pmac *chip, int reg, int val)
{
snd_pmac_awacs_write(chip, val | (reg << 12));
}
#ifdef CONFIG_PM
/* Recalibrate chip */
-static void screamer_recalibrate(pmac_t *chip)
+static void screamer_recalibrate(struct snd_pmac *chip)
{
if (chip->model != PMAC_SCREAMER)
return;
/* delay for broken crystal part */
msleep(750);
snd_pmac_awacs_write_noreg(chip, 1,
- chip->awacs_reg[1] | MASK_RECALIBRATE | MASK_CMUTE | MASK_AMUTE);
+ chip->awacs_reg[1] | MASK_RECALIBRATE |
+ MASK_CMUTE | MASK_AMUTE);
snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
snd_pmac_awacs_write_noreg(chip, 6, chip->awacs_reg[6]);
}
/*
* additional callback to set the pcm format
*/
-static void snd_pmac_awacs_set_format(pmac_t *chip)
+static void snd_pmac_awacs_set_format(struct snd_pmac *chip)
{
chip->awacs_reg[1] &= ~MASK_SAMPLERATE;
chip->awacs_reg[1] |= chip->rate_index << 3;
/*
* volumes: 0-15 stereo
*/
-static int snd_pmac_awacs_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snd_pmac_awacs_info_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
return 0;
}
-static int snd_pmac_awacs_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_get_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value & 0xff;
int lshift = (kcontrol->private_value >> 8) & 0xff;
int inverted = (kcontrol->private_value >> 16) & 1;
return 0;
}
-static int snd_pmac_awacs_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_put_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value & 0xff;
int lshift = (kcontrol->private_value >> 8) & 0xff;
int inverted = (kcontrol->private_value >> 16) & 1;
/*
* mute master/ogain for AWACS: mono
*/
-static int snd_pmac_awacs_get_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_get_switch(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 8) & 0xff;
int invert = (kcontrol->private_value >> 16) & 1;
return 0;
}
-static int snd_pmac_awacs_put_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_put_switch(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 8) & 0xff;
int invert = (kcontrol->private_value >> 16) & 1;
/*
* level = 0 - 14, 7 = 0 dB
*/
-static void awacs_amp_set_tone(awacs_amp_t *amp, int bass, int treble)
+static void awacs_amp_set_tone(struct awacs_amp *amp, int bass, int treble)
{
amp->amp_tone[0] = bass;
amp->amp_tone[1] = treble;
/*
* vol = 0 - 31 (attenuation), 32 = mute bit, stereo
*/
-static int awacs_amp_set_vol(awacs_amp_t *amp, int index, int lvol, int rvol, int do_check)
+static int awacs_amp_set_vol(struct awacs_amp *amp, int index, int lvol, int rvol,
+ int do_check)
{
if (do_check && amp->amp_vol[index][0] == lvol &&
amp->amp_vol[index][1] == rvol)
/*
* 0 = -79 dB, 79 = 0 dB, 99 = +20 dB
*/
-static void awacs_amp_set_master(awacs_amp_t *amp, int vol)
+static void awacs_amp_set_master(struct awacs_amp *amp, int vol)
{
amp->amp_master = vol;
if (vol <= 79)
awacs_set_cuda(1, vol);
}
-static void awacs_amp_free(pmac_t *chip)
+static void awacs_amp_free(struct snd_pmac *chip)
{
- awacs_amp_t *amp = chip->mixer_data;
+ struct awacs_amp *amp = chip->mixer_data;
snd_assert(amp, return);
kfree(amp);
chip->mixer_data = NULL;
/*
* mixer controls
*/
-static int snd_pmac_awacs_info_volume_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snd_pmac_awacs_info_volume_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
return 0;
}
-static int snd_pmac_awacs_get_volume_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_get_volume_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int index = kcontrol->private_value;
- awacs_amp_t *amp = chip->mixer_data;
+ struct awacs_amp *amp = chip->mixer_data;
snd_assert(amp, return -EINVAL);
snd_assert(index >= 0 && index <= 1, return -EINVAL);
ucontrol->value.integer.value[0] = 31 - (amp->amp_vol[index][0] & 31);
return 0;
}
-static int snd_pmac_awacs_put_volume_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_put_volume_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int index = kcontrol->private_value;
int vol[2];
- awacs_amp_t *amp = chip->mixer_data;
+ struct awacs_amp *amp = chip->mixer_data;
snd_assert(amp, return -EINVAL);
snd_assert(index >= 0 && index <= 1, return -EINVAL);
return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1);
}
-static int snd_pmac_awacs_get_switch_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_get_switch_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int index = kcontrol->private_value;
- awacs_amp_t *amp = chip->mixer_data;
+ struct awacs_amp *amp = chip->mixer_data;
snd_assert(amp, return -EINVAL);
snd_assert(index >= 0 && index <= 1, return -EINVAL);
ucontrol->value.integer.value[0] = (amp->amp_vol[index][0] & 32) ? 0 : 1;
return 0;
}
-static int snd_pmac_awacs_put_switch_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_put_switch_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int index = kcontrol->private_value;
int vol[2];
- awacs_amp_t *amp = chip->mixer_data;
+ struct awacs_amp *amp = chip->mixer_data;
snd_assert(amp, return -EINVAL);
snd_assert(index >= 0 && index <= 1, return -EINVAL);
return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1);
}
-static int snd_pmac_awacs_info_tone_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snd_pmac_awacs_info_tone_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
return 0;
}
-static int snd_pmac_awacs_get_tone_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_get_tone_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int index = kcontrol->private_value;
- awacs_amp_t *amp = chip->mixer_data;
+ struct awacs_amp *amp = chip->mixer_data;
snd_assert(amp, return -EINVAL);
snd_assert(index >= 0 && index <= 1, return -EINVAL);
ucontrol->value.integer.value[0] = amp->amp_tone[index];
return 0;
}
-static int snd_pmac_awacs_put_tone_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_put_tone_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int index = kcontrol->private_value;
- awacs_amp_t *amp = chip->mixer_data;
+ struct awacs_amp *amp = chip->mixer_data;
snd_assert(amp, return -EINVAL);
snd_assert(index >= 0 && index <= 1, return -EINVAL);
if (ucontrol->value.integer.value[0] != amp->amp_tone[index]) {
return 0;
}
-static int snd_pmac_awacs_info_master_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snd_pmac_awacs_info_master_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
return 0;
}
-static int snd_pmac_awacs_get_master_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_get_master_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- awacs_amp_t *amp = chip->mixer_data;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct awacs_amp *amp = chip->mixer_data;
snd_assert(amp, return -EINVAL);
ucontrol->value.integer.value[0] = amp->amp_master;
return 0;
}
-static int snd_pmac_awacs_put_master_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_awacs_put_master_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- awacs_amp_t *amp = chip->mixer_data;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct awacs_amp *amp = chip->mixer_data;
snd_assert(amp, return -EINVAL);
if (ucontrol->value.integer.value[0] != amp->amp_master) {
amp->amp_master = ucontrol->value.integer.value[0];
#define AMP_CH_SPK 0
#define AMP_CH_HD 1
-static snd_kcontrol_new_t snd_pmac_awacs_amp_vol[] __initdata = {
+static struct snd_kcontrol_new snd_pmac_awacs_amp_vol[] __initdata = {
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PC Speaker Playback Volume",
.info = snd_pmac_awacs_info_volume_amp,
},
};
-static snd_kcontrol_new_t snd_pmac_awacs_amp_hp_sw __initdata = {
+static struct snd_kcontrol_new snd_pmac_awacs_amp_hp_sw __initdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Headphone Playback Switch",
.info = snd_pmac_boolean_stereo_info,
.private_value = AMP_CH_HD,
};
-static snd_kcontrol_new_t snd_pmac_awacs_amp_spk_sw __initdata = {
+static struct snd_kcontrol_new snd_pmac_awacs_amp_spk_sw __initdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PC Speaker Playback Switch",
.info = snd_pmac_boolean_stereo_info,
/*
* mic boost for screamer
*/
-static int snd_pmac_screamer_mic_boost_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snd_pmac_screamer_mic_boost_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
return 0;
}
-static int snd_pmac_screamer_mic_boost_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_screamer_mic_boost_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int val;
unsigned long flags;
return 0;
}
-static int snd_pmac_screamer_mic_boost_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_screamer_mic_boost_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
int val0, val6;
unsigned long flags;
/*
* lists of mixer elements
*/
-static snd_kcontrol_new_t snd_pmac_awacs_mixers[] __initdata = {
+static struct snd_kcontrol_new snd_pmac_awacs_mixers[] __initdata = {
AWACS_VOLUME("Master Playback Volume", 2, 6, 1),
AWACS_SWITCH("Master Capture Switch", 1, SHIFT_LOOPTHRU, 0),
AWACS_VOLUME("Capture Volume", 0, 4, 0),
/* FIXME: is this correct order?
* screamer (powerbook G3 pismo) seems to have different bits...
*/
-static snd_kcontrol_new_t snd_pmac_awacs_mixers2[] __initdata = {
+static struct snd_kcontrol_new snd_pmac_awacs_mixers2[] __initdata = {
AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_LINE, 0),
AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_MIC, 0),
};
-static snd_kcontrol_new_t snd_pmac_screamer_mixers2[] __initdata = {
+static struct snd_kcontrol_new snd_pmac_screamer_mixers2[] __initdata = {
AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0),
AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_LINE, 0),
};
-static snd_kcontrol_new_t snd_pmac_awacs_master_sw __initdata =
+static struct snd_kcontrol_new snd_pmac_awacs_master_sw __initdata =
AWACS_SWITCH("Master Playback Switch", 1, SHIFT_HDMUTE, 1);
-static snd_kcontrol_new_t snd_pmac_awacs_mic_boost[] __initdata = {
+static struct snd_kcontrol_new snd_pmac_awacs_mic_boost[] __initdata = {
AWACS_SWITCH("Mic Boost", 0, SHIFT_GAINLINE, 0),
};
-static snd_kcontrol_new_t snd_pmac_screamer_mic_boost[] __initdata = {
+static struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] __initdata = {
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Mic Boost",
.info = snd_pmac_screamer_mic_boost_info,
},
};
-static snd_kcontrol_new_t snd_pmac_awacs_speaker_vol[] __initdata = {
+static struct snd_kcontrol_new snd_pmac_awacs_speaker_vol[] __initdata = {
AWACS_VOLUME("PC Speaker Playback Volume", 4, 6, 1),
};
-static snd_kcontrol_new_t snd_pmac_awacs_speaker_sw __initdata =
+static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw __initdata =
AWACS_SWITCH("PC Speaker Playback Switch", 1, SHIFT_SPKMUTE, 1);
/*
* add new mixer elements to the card
*/
-static int build_mixers(pmac_t *chip, int nums, snd_kcontrol_new_t *mixers)
+static int build_mixers(struct snd_pmac *chip, int nums, struct snd_kcontrol_new *mixers)
{
int i, err;
/*
* restore all registers
*/
-static void awacs_restore_all_regs(pmac_t *chip)
+static void awacs_restore_all_regs(struct snd_pmac *chip)
{
snd_pmac_awacs_write_noreg(chip, 0, chip->awacs_reg[0]);
snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
}
#ifdef CONFIG_PM
-static void snd_pmac_awacs_suspend(pmac_t *chip)
+static void snd_pmac_awacs_suspend(struct snd_pmac *chip)
{
snd_pmac_awacs_write_noreg(chip, 1, (chip->awacs_reg[1]
| MASK_AMUTE | MASK_CMUTE));
}
-static void snd_pmac_awacs_resume(pmac_t *chip)
+static void snd_pmac_awacs_resume(struct snd_pmac *chip)
{
if (machine_is_compatible("PowerBook3,1")
|| machine_is_compatible("PowerBook3,2")) {
screamer_recalibrate(chip);
#ifdef PMAC_AMP_AVAIL
if (chip->mixer_data) {
- awacs_amp_t *amp = chip->mixer_data;
+ struct awacs_amp *amp = chip->mixer_data;
awacs_amp_set_vol(amp, 0, amp->amp_vol[0][0], amp->amp_vol[0][1], 0);
awacs_amp_set_vol(amp, 1, amp->amp_vol[1][0], amp->amp_vol[1][1], 0);
awacs_amp_set_tone(amp, amp->amp_tone[0], amp->amp_tone[1]);
/*
* auto-mute stuffs
*/
-static int snd_pmac_awacs_detect_headphone(pmac_t *chip)
+static int snd_pmac_awacs_detect_headphone(struct snd_pmac *chip)
{
return (in_le32(&chip->awacs->codec_stat) & chip->hp_stat_mask) ? 1 : 0;
}
#ifdef PMAC_AMP_AVAIL
-static int toggle_amp_mute(awacs_amp_t *amp, int index, int mute)
+static int toggle_amp_mute(struct awacs_amp *amp, int index, int mute)
{
int vol[2];
vol[0] = amp->amp_vol[index][0] & 31;
}
#endif
-static void snd_pmac_awacs_update_automute(pmac_t *chip, int do_notify)
+static void snd_pmac_awacs_update_automute(struct snd_pmac *chip, int do_notify)
{
if (chip->auto_mute) {
#ifdef PMAC_AMP_AVAIL
if (chip->mixer_data) {
- awacs_amp_t *amp = chip->mixer_data;
+ struct awacs_amp *amp = chip->mixer_data;
int changed;
if (snd_pmac_awacs_detect_headphone(chip)) {
changed = toggle_amp_mute(amp, AMP_CH_HD, 0);
* initialize chip
*/
int __init
-snd_pmac_awacs_init(pmac_t *chip)
+snd_pmac_awacs_init(struct snd_pmac *chip)
{
int err, vol;
chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf;
#ifdef PMAC_AMP_AVAIL
if (chip->revision == 3 && chip->has_iic && CHECK_CUDA_AMP()) {
- awacs_amp_t *amp = kmalloc(sizeof(*amp), GFP_KERNEL);
+ struct awacs_amp *amp = kmalloc(sizeof(*amp), GFP_KERNEL);
if (! amp)
return -ENOMEM;
chip->mixer_data = amp;
#include <sound/control.h>
#include "pmac.h"
-struct snd_pmac_beep {
+struct pmac_beep {
int running; /* boolean */
int volume; /* mixer volume: 0-100 */
int volume_play; /* currently playing volume */
/*
* stop beep if running
*/
-void snd_pmac_beep_stop(pmac_t *chip)
+void snd_pmac_beep_stop(struct snd_pmac *chip)
{
- pmac_beep_t *beep = chip->beep;
+ struct pmac_beep *beep = chip->beep;
if (beep && beep->running) {
beep->running = 0;
snd_pmac_beep_dma_stop(chip);
#define BEEP_BUFLEN 512
#define BEEP_VOLUME 15 /* 0 - 100 */
-static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type, unsigned int code, int hz)
+static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type,
+ unsigned int code, int hz)
{
- pmac_t *chip;
- pmac_beep_t *beep;
+ struct snd_pmac *chip;
+ struct pmac_beep *beep;
unsigned long flags;
int beep_speed = 0;
int srate;
* beep volume mixer
*/
-static int snd_pmac_info_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snd_pmac_info_beep(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
return 0;
}
-static int snd_pmac_get_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_get_beep(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
snd_assert(chip->beep, return -ENXIO);
ucontrol->value.integer.value[0] = chip->beep->volume;
return 0;
}
-static int snd_pmac_put_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_put_beep(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int oval;
snd_assert(chip->beep, return -ENXIO);
oval = chip->beep->volume;
return oval != chip->beep->volume;
}
-static snd_kcontrol_new_t snd_pmac_beep_mixer = {
+static struct snd_kcontrol_new snd_pmac_beep_mixer = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Beep Playback Volume",
.info = snd_pmac_info_beep,
};
/* Initialize beep stuff */
-int __init snd_pmac_attach_beep(pmac_t *chip)
+int __init snd_pmac_attach_beep(struct snd_pmac *chip)
{
- pmac_beep_t *beep;
+ struct pmac_beep *beep;
struct input_dev *input_dev;
void *dmabuf;
int err = -ENOMEM;
return err;
}
-void snd_pmac_detach_beep(pmac_t *chip)
+void snd_pmac_detach_beep(struct snd_pmac *chip)
{
if (chip->beep) {
input_unregister_device(chip->beep->dev);
/* Waits for busy flag to clear */
static inline void
-snd_pmac_burgundy_busy_wait(pmac_t *chip)
+snd_pmac_burgundy_busy_wait(struct snd_pmac *chip)
{
int timeout = 50;
while ((in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) && timeout--)
}
static inline void
-snd_pmac_burgundy_extend_wait(pmac_t *chip)
+snd_pmac_burgundy_extend_wait(struct snd_pmac *chip)
{
int timeout;
timeout = 50;
}
static void
-snd_pmac_burgundy_wcw(pmac_t *chip, unsigned addr, unsigned val)
+snd_pmac_burgundy_wcw(struct snd_pmac *chip, unsigned addr, unsigned val)
{
out_le32(&chip->awacs->codec_ctrl, addr + 0x200c00 + (val & 0xff));
snd_pmac_burgundy_busy_wait(chip);
}
static unsigned
-snd_pmac_burgundy_rcw(pmac_t *chip, unsigned addr)
+snd_pmac_burgundy_rcw(struct snd_pmac *chip, unsigned addr)
{
unsigned val = 0;
unsigned long flags;
}
static void
-snd_pmac_burgundy_wcb(pmac_t *chip, unsigned int addr, unsigned int val)
+snd_pmac_burgundy_wcb(struct snd_pmac *chip, unsigned int addr, unsigned int val)
{
out_le32(&chip->awacs->codec_ctrl, addr + 0x300000 + (val & 0xff));
snd_pmac_burgundy_busy_wait(chip);
}
static unsigned
-snd_pmac_burgundy_rcb(pmac_t *chip, unsigned int addr)
+snd_pmac_burgundy_rcb(struct snd_pmac *chip, unsigned int addr)
{
unsigned val = 0;
unsigned long flags;
* Burgundy volume: 0 - 100, stereo
*/
static void
-snd_pmac_burgundy_write_volume(pmac_t *chip, unsigned int address, long *volume, int shift)
+snd_pmac_burgundy_write_volume(struct snd_pmac *chip, unsigned int address,
+ long *volume, int shift)
{
int hardvolume, lvolume, rvolume;
}
static void
-snd_pmac_burgundy_read_volume(pmac_t *chip, unsigned int address, long *volume, int shift)
+snd_pmac_burgundy_read_volume(struct snd_pmac *chip, unsigned int address,
+ long *volume, int shift)
{
int wvolume;
#define BASE2ADDR(base) ((base) << 12)
#define ADDR2BASE(addr) ((addr) >> 12)
-static int snd_pmac_burgundy_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snd_pmac_burgundy_info_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
return 0;
}
-static int snd_pmac_burgundy_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_burgundy_get_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff);
int shift = (kcontrol->private_value >> 8) & 0xff;
- snd_pmac_burgundy_read_volume(chip, addr, ucontrol->value.integer.value, shift);
+ snd_pmac_burgundy_read_volume(chip, addr, ucontrol->value.integer.value,
+ shift);
return 0;
}
-static int snd_pmac_burgundy_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_burgundy_put_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff);
int shift = (kcontrol->private_value >> 8) & 0xff;
long nvoices[2];
- snd_pmac_burgundy_write_volume(chip, addr, ucontrol->value.integer.value, shift);
+ snd_pmac_burgundy_write_volume(chip, addr, ucontrol->value.integer.value,
+ shift);
snd_pmac_burgundy_read_volume(chip, addr, nvoices, shift);
return (nvoices[0] != ucontrol->value.integer.value[0] ||
nvoices[1] != ucontrol->value.integer.value[1]);
/* lineout/speaker */
-static int snd_pmac_burgundy_info_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snd_pmac_burgundy_info_switch_out(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
int stereo = (kcontrol->private_value >> 24) & 1;
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
return 0;
}
-static int snd_pmac_burgundy_get_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_burgundy_get_switch_out(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int lmask = kcontrol->private_value & 0xff;
int rmask = (kcontrol->private_value >> 8) & 0xff;
int stereo = (kcontrol->private_value >> 24) & 1;
return 0;
}
-static int snd_pmac_burgundy_put_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_burgundy_put_switch_out(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
int lmask = kcontrol->private_value & 0xff;
int rmask = (kcontrol->private_value >> 8) & 0xff;
int stereo = (kcontrol->private_value >> 24) & 1;
.private_value = ((lmask) | ((rmask) << 8) | ((stereo) << 24)) }
/* line/speaker output volume */
-static int snd_pmac_burgundy_info_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snd_pmac_burgundy_info_volume_out(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
int stereo = (kcontrol->private_value >> 24) & 1;
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
return 0;
}
-static int snd_pmac_burgundy_get_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_burgundy_get_volume_out(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff);
int stereo = (kcontrol->private_value >> 24) & 1;
int oval;
return 0;
}
-static int snd_pmac_burgundy_put_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snd_pmac_burgundy_put_volume_out(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff);
int stereo = (kcontrol->private_value >> 24) & 1;
int oval, val;
.put = snd_pmac_burgundy_put_volume_out,\
.private_value = (ADDR2BASE(addr) | ((stereo) << 24)) }
-static snd_kcontrol_new_t snd_pmac_burgundy_mixers[] __initdata = {
+static struct snd_kcontrol_new snd_pmac_burgundy_mixers[] __initdata = {
BURGUNDY_VOLUME("Master Playback Volume", 0, MASK_ADDR_BURGUNDY_MASTER_VOLUME, 8),
BURGUNDY_VOLUME("Line Playback Volume", 0, MASK_ADDR_BURGUNDY_VOLLINE, 16),
BURGUNDY_VOLUME("CD Playback Volume", 0, MASK_ADDR_BURGUNDY_VOLCD, 16),
/*BURGUNDY_OUTPUT_VOLUME("PCM Playback Volume", 0, MASK_ADDR_BURGUNDY_ATTENLINEOUT, 1),*/
BURGUNDY_OUTPUT_VOLUME("Headphone Playback Volume", 0, MASK_ADDR_BURGUNDY_ATTENSPEAKER, 1),
};
-static snd_kcontrol_new_t snd_pmac_burgundy_master_sw __initdata =
+static struct snd_kcontrol_new snd_pmac_burgundy_master_sw __initdata =
BURGUNDY_OUTPUT_SWITCH("Headphone Playback Switch", 0, BURGUNDY_OUTPUT_LEFT, BURGUNDY_OUTPUT_RIGHT, 1);
-static snd_kcontrol_new_t snd_pmac_burgundy_speaker_sw __initdata =
+static struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw __initdata =
BURGUNDY_OUTPUT_SWITCH("PC Speaker Playback Switch", 0, BURGUNDY_OUTPUT_INTERN, 0, 0);
/*
* auto-mute stuffs
*/
-static int snd_pmac_burgundy_detect_headphone(pmac_t *chip)
+static int snd_pmac_burgundy_detect_headphone(struct snd_pmac *chip)
{
return (in_le32(&chip->awacs->codec_stat) & chip->hp_stat_mask) ? 1 : 0;
}
-static void snd_pmac_burgundy_update_automute(pmac_t *chip, int do_notify)
+static void snd_pmac_burgundy_update_automute(struct snd_pmac *chip, int do_notify)
{
if (chip->auto_mute) {
int reg, oreg;
/*
* initialize burgundy
*/
-int __init snd_pmac_burgundy_init(pmac_t *chip)
+int __init snd_pmac_burgundy_init(struct snd_pmac *chip)
{
int i, err;
#define DACA_VOL_MAX 0x38
-typedef struct pmac_daca_t {
- pmac_keywest_t i2c;
+struct pmac_daca {
+ struct pmac_keywest i2c;
int left_vol, right_vol;
unsigned int deemphasis : 1;
unsigned int amp_on : 1;
-} pmac_daca_t;
+};
/*
* initialize / detect DACA
*/
-static int daca_init_client(pmac_keywest_t *i2c)
+static int daca_init_client(struct pmac_keywest *i2c)
{
unsigned short wdata = 0x00;
/* SR: no swap, 1bit delay, 32-48kHz */
/*
* update volume
*/
-static int daca_set_volume(pmac_daca_t *mix)
+static int daca_set_volume(struct pmac_daca *mix)
{
unsigned char data[2];
/* deemphasis switch */
-static int daca_info_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int daca_info_deemphasis(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1;
return 0;
}
-static int daca_get_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int daca_get_deemphasis(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_daca_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_daca *mix;
if (! (mix = chip->mixer_data))
return -ENODEV;
ucontrol->value.integer.value[0] = mix->deemphasis ? 1 : 0;
return 0;
}
-static int daca_put_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int daca_put_deemphasis(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_daca_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_daca *mix;
int change;
if (! (mix = chip->mixer_data))
}
/* output volume */
-static int daca_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int daca_info_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
return 0;
}
-static int daca_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int daca_get_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_daca_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_daca *mix;
if (! (mix = chip->mixer_data))
return -ENODEV;
ucontrol->value.integer.value[0] = mix->left_vol;
return 0;
}
-static int daca_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int daca_put_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_daca_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_daca *mix;
int change;
if (! (mix = chip->mixer_data))
/* amplifier switch */
#define daca_info_amp daca_info_deemphasis
-static int daca_get_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int daca_get_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_daca_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_daca *mix;
if (! (mix = chip->mixer_data))
return -ENODEV;
ucontrol->value.integer.value[0] = mix->amp_on ? 1 : 0;
return 0;
}
-static int daca_put_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int daca_put_amp(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_daca_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_daca *mix;
int change;
if (! (mix = chip->mixer_data))
return change;
}
-static snd_kcontrol_new_t daca_mixers[] = {
+static struct snd_kcontrol_new daca_mixers[] = {
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Deemphasis Switch",
.info = daca_info_deemphasis,
#ifdef CONFIG_PM
-static void daca_resume(pmac_t *chip)
+static void daca_resume(struct snd_pmac *chip)
{
- pmac_daca_t *mix = chip->mixer_data;
+ struct pmac_daca *mix = chip->mixer_data;
i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_SR, 0x08);
i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG,
mix->amp_on ? 0x05 : 0x04);
#endif /* CONFIG_PM */
-static void daca_cleanup(pmac_t *chip)
+static void daca_cleanup(struct snd_pmac *chip)
{
- pmac_daca_t *mix = chip->mixer_data;
+ struct pmac_daca *mix = chip->mixer_data;
if (! mix)
return;
snd_pmac_keywest_cleanup(&mix->i2c);
}
/* exported */
-int __init snd_pmac_daca_init(pmac_t *chip)
+int __init snd_pmac_daca_init(struct snd_pmac *chip)
{
int i, err;
- pmac_daca_t *mix;
+ struct pmac_daca *mix;
#ifdef CONFIG_KMOD
if (current->fs->root)
* we have to keep a static variable here since i2c attach_adapter
* callback cannot pass a private data.
*/
-static pmac_keywest_t *keywest_ctx;
+static struct pmac_keywest *keywest_ctx;
#define I2C_DRIVERID_KEYWEST 0xFEBA
}
/* exported */
-void snd_pmac_keywest_cleanup(pmac_keywest_t *i2c)
+void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c)
{
if (keywest_ctx && keywest_ctx == i2c) {
i2c_del_driver(&keywest_driver);
}
/* exported */
-int __init snd_pmac_keywest_init(pmac_keywest_t *i2c)
+int __init snd_pmac_keywest_init(struct pmac_keywest *i2c)
{
int err;
#ifdef CONFIG_PM
-static int snd_pmac_register_sleep_notifier(pmac_t *chip);
-static int snd_pmac_unregister_sleep_notifier(pmac_t *chip);
-static int snd_pmac_suspend(snd_card_t *card, pm_message_t state);
-static int snd_pmac_resume(snd_card_t *card);
+static int snd_pmac_register_sleep_notifier(struct snd_pmac *chip);
+static int snd_pmac_unregister_sleep_notifier(struct snd_pmac *chip);
+static int snd_pmac_suspend(struct snd_card *card, pm_message_t state);
+static int snd_pmac_resume(struct snd_card *card);
#endif
/*
* allocate DBDMA command arrays
*/
-static int snd_pmac_dbdma_alloc(pmac_t *chip, pmac_dbdma_t *rec, int size)
+static int snd_pmac_dbdma_alloc(struct snd_pmac *chip, struct pmac_dbdma *rec, int size)
{
unsigned int rsize = sizeof(struct dbdma_cmd) * (size + 1);
return 0;
}
-static void snd_pmac_dbdma_free(pmac_t *chip, pmac_dbdma_t *rec)
+static void snd_pmac_dbdma_free(struct snd_pmac *chip, struct pmac_dbdma *rec)
{
if (rec) {
unsigned int rsize = sizeof(struct dbdma_cmd) * (rec->size + 1);
* look up frequency table
*/
-unsigned int snd_pmac_rate_index(pmac_t *chip, pmac_stream_t *rec, unsigned int rate)
+unsigned int snd_pmac_rate_index(struct snd_pmac *chip, struct pmac_stream *rec, unsigned int rate)
{
int i, ok, found;
/*
* allocate buffers
*/
-static int snd_pmac_pcm_hw_params(snd_pcm_substream_t *subs,
- snd_pcm_hw_params_t *hw_params)
+static int snd_pmac_pcm_hw_params(struct snd_pcm_substream *subs,
+ struct snd_pcm_hw_params *hw_params)
{
return snd_pcm_lib_malloc_pages(subs, params_buffer_bytes(hw_params));
}
/*
* release buffers
*/
-static int snd_pmac_pcm_hw_free(snd_pcm_substream_t *subs)
+static int snd_pmac_pcm_hw_free(struct snd_pcm_substream *subs)
{
snd_pcm_lib_free_pages(subs);
return 0;
/*
* get a stream of the opposite direction
*/
-static pmac_stream_t *snd_pmac_get_stream(pmac_t *chip, int stream)
+static struct pmac_stream *snd_pmac_get_stream(struct snd_pmac *chip, int stream)
{
switch (stream) {
case SNDRV_PCM_STREAM_PLAYBACK:
* wait while run status is on
*/
static inline void
-snd_pmac_wait_ack(pmac_stream_t *rec)
+snd_pmac_wait_ack(struct pmac_stream *rec)
{
int timeout = 50000;
while ((in_le32(&rec->dma->status) & RUN) && timeout-- > 0)
* set the format and rate to the chip.
* call the lowlevel function if defined (e.g. for AWACS).
*/
-static void snd_pmac_pcm_set_format(pmac_t *chip)
+static void snd_pmac_pcm_set_format(struct snd_pmac *chip)
{
/* set up frequency and format */
out_le32(&chip->awacs->control, chip->control_mask | (chip->rate_index << 8));
/*
* stop the DMA transfer
*/
-static inline void snd_pmac_dma_stop(pmac_stream_t *rec)
+static inline void snd_pmac_dma_stop(struct pmac_stream *rec)
{
out_le32(&rec->dma->control, (RUN|WAKE|FLUSH|PAUSE) << 16);
snd_pmac_wait_ack(rec);
/*
* set the command pointer address
*/
-static inline void snd_pmac_dma_set_command(pmac_stream_t *rec, pmac_dbdma_t *cmd)
+static inline void snd_pmac_dma_set_command(struct pmac_stream *rec, struct pmac_dbdma *cmd)
{
out_le32(&rec->dma->cmdptr, cmd->addr);
}
/*
* start the DMA
*/
-static inline void snd_pmac_dma_run(pmac_stream_t *rec, int status)
+static inline void snd_pmac_dma_run(struct pmac_stream *rec, int status)
{
out_le32(&rec->dma->control, status | (status << 16));
}
/*
* prepare playback/capture stream
*/
-static int snd_pmac_pcm_prepare(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substream_t *subs)
+static int snd_pmac_pcm_prepare(struct snd_pmac *chip, struct pmac_stream *rec, struct snd_pcm_substream *subs)
{
int i;
volatile struct dbdma_cmd __iomem *cp;
- snd_pcm_runtime_t *runtime = subs->runtime;
+ struct snd_pcm_runtime *runtime = subs->runtime;
int rate_index;
long offset;
- pmac_stream_t *astr;
+ struct pmac_stream *astr;
rec->dma_size = snd_pcm_lib_buffer_bytes(subs);
rec->period_size = snd_pcm_lib_period_bytes(subs);
/*
* PCM trigger/stop
*/
-static int snd_pmac_pcm_trigger(pmac_t *chip, pmac_stream_t *rec,
- snd_pcm_substream_t *subs, int cmd)
+static int snd_pmac_pcm_trigger(struct snd_pmac *chip, struct pmac_stream *rec,
+ struct snd_pcm_substream *subs, int cmd)
{
volatile struct dbdma_cmd __iomem *cp;
int i, command;
* return the current pointer
*/
inline
-static snd_pcm_uframes_t snd_pmac_pcm_pointer(pmac_t *chip, pmac_stream_t *rec,
- snd_pcm_substream_t *subs)
+static snd_pcm_uframes_t snd_pmac_pcm_pointer(struct snd_pmac *chip,
+ struct pmac_stream *rec,
+ struct snd_pcm_substream *subs)
{
int count = 0;
* playback
*/
-static int snd_pmac_playback_prepare(snd_pcm_substream_t *subs)
+static int snd_pmac_playback_prepare(struct snd_pcm_substream *subs)
{
- pmac_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pmac *chip = snd_pcm_substream_chip(subs);
return snd_pmac_pcm_prepare(chip, &chip->playback, subs);
}
-static int snd_pmac_playback_trigger(snd_pcm_substream_t *subs,
+static int snd_pmac_playback_trigger(struct snd_pcm_substream *subs,
int cmd)
{
- pmac_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pmac *chip = snd_pcm_substream_chip(subs);
return snd_pmac_pcm_trigger(chip, &chip->playback, subs, cmd);
}
-static snd_pcm_uframes_t snd_pmac_playback_pointer(snd_pcm_substream_t *subs)
+static snd_pcm_uframes_t snd_pmac_playback_pointer(struct snd_pcm_substream *subs)
{
- pmac_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pmac *chip = snd_pcm_substream_chip(subs);
return snd_pmac_pcm_pointer(chip, &chip->playback, subs);
}
* capture
*/
-static int snd_pmac_capture_prepare(snd_pcm_substream_t *subs)
+static int snd_pmac_capture_prepare(struct snd_pcm_substream *subs)
{
- pmac_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pmac *chip = snd_pcm_substream_chip(subs);
return snd_pmac_pcm_prepare(chip, &chip->capture, subs);
}
-static int snd_pmac_capture_trigger(snd_pcm_substream_t *subs,
+static int snd_pmac_capture_trigger(struct snd_pcm_substream *subs,
int cmd)
{
- pmac_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pmac *chip = snd_pcm_substream_chip(subs);
return snd_pmac_pcm_trigger(chip, &chip->capture, subs, cmd);
}
-static snd_pcm_uframes_t snd_pmac_capture_pointer(snd_pcm_substream_t *subs)
+static snd_pcm_uframes_t snd_pmac_capture_pointer(struct snd_pcm_substream *subs)
{
- pmac_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pmac *chip = snd_pcm_substream_chip(subs);
return snd_pmac_pcm_pointer(chip, &chip->capture, subs);
}
/*
* update playback/capture pointer from interrupts
*/
-static void snd_pmac_pcm_update(pmac_t *chip, pmac_stream_t *rec)
+static void snd_pmac_pcm_update(struct snd_pmac *chip, struct pmac_stream *rec)
{
volatile struct dbdma_cmd __iomem *cp;
int c;
* hw info
*/
-static snd_pcm_hardware_t snd_pmac_playback =
+static struct snd_pcm_hardware snd_pmac_playback =
{
.info = (SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP |
.periods_max = PMAC_MAX_FRAGS,
};
-static snd_pcm_hardware_t snd_pmac_capture =
+static struct snd_pcm_hardware snd_pmac_capture =
{
.info = (SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP |
#if 0 // NYI
-static int snd_pmac_hw_rule_rate(snd_pcm_hw_params_t *params,
- snd_pcm_hw_rule_t *rule)
+static int snd_pmac_hw_rule_rate(struct snd_pcm_hw_params *params,
+ struct snd_pcm_hw_rule *rule)
{
- pmac_t *chip = rule->private;
- pmac_stream_t *rec = snd_pmac_get_stream(chip, rule->deps[0]);
+ struct snd_pmac *chip = rule->private;
+ struct pmac_stream *rec = snd_pmac_get_stream(chip, rule->deps[0]);
int i, freq_table[8], num_freqs;
if (! rec)
num_freqs, freq_table, 0);
}
-static int snd_pmac_hw_rule_format(snd_pcm_hw_params_t *params,
- snd_pcm_hw_rule_t *rule)
+static int snd_pmac_hw_rule_format(struct snd_pcm_hw_params *params,
+ struct snd_pcm_hw_rule *rule)
{
- pmac_t *chip = rule->private;
- pmac_stream_t *rec = snd_pmac_get_stream(chip, rule->deps[0]);
+ struct snd_pmac *chip = rule->private;
+ struct pmac_stream *rec = snd_pmac_get_stream(chip, rule->deps[0]);
if (! rec)
return -EINVAL;
}
#endif // NYI
-static int snd_pmac_pcm_open(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substream_t *subs)
+static int snd_pmac_pcm_open(struct snd_pmac *chip, struct pmac_stream *rec,
+ struct snd_pcm_substream *subs)
{
- snd_pcm_runtime_t *runtime = subs->runtime;
+ struct snd_pcm_runtime *runtime = subs->runtime;
int i, j, fflags;
static int typical_freqs[] = {
44100,
return 0;
}
-static int snd_pmac_pcm_close(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substream_t *subs)
+static int snd_pmac_pcm_close(struct snd_pmac *chip, struct pmac_stream *rec,
+ struct snd_pcm_substream *subs)
{
- pmac_stream_t *astr;
+ struct pmac_stream *astr;
snd_pmac_dma_stop(rec);
return 0;
}
-static int snd_pmac_playback_open(snd_pcm_substream_t *subs)
+static int snd_pmac_playback_open(struct snd_pcm_substream *subs)
{
- pmac_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pmac *chip = snd_pcm_substream_chip(subs);
subs->runtime->hw = snd_pmac_playback;
return snd_pmac_pcm_open(chip, &chip->playback, subs);
}
-static int snd_pmac_capture_open(snd_pcm_substream_t *subs)
+static int snd_pmac_capture_open(struct snd_pcm_substream *subs)
{
- pmac_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pmac *chip = snd_pcm_substream_chip(subs);
subs->runtime->hw = snd_pmac_capture;
return snd_pmac_pcm_open(chip, &chip->capture, subs);
}
-static int snd_pmac_playback_close(snd_pcm_substream_t *subs)
+static int snd_pmac_playback_close(struct snd_pcm_substream *subs)
{
- pmac_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pmac *chip = snd_pcm_substream_chip(subs);
return snd_pmac_pcm_close(chip, &chip->playback, subs);
}
-static int snd_pmac_capture_close(snd_pcm_substream_t *subs)
+static int snd_pmac_capture_close(struct snd_pcm_substream *subs)
{
- pmac_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pmac *chip = snd_pcm_substream_chip(subs);
return snd_pmac_pcm_close(chip, &chip->capture, subs);
}
/*
*/
-static snd_pcm_ops_t snd_pmac_playback_ops = {
+static struct snd_pcm_ops snd_pmac_playback_ops = {
.open = snd_pmac_playback_open,
.close = snd_pmac_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.pointer = snd_pmac_playback_pointer,
};
-static snd_pcm_ops_t snd_pmac_capture_ops = {
+static struct snd_pcm_ops snd_pmac_capture_ops = {
.open = snd_pmac_capture_open,
.close = snd_pmac_capture_close,
.ioctl = snd_pcm_lib_ioctl,
.pointer = snd_pmac_capture_pointer,
};
-int __init snd_pmac_pcm_new(pmac_t *chip)
+int __init snd_pmac_pcm_new(struct snd_pmac *chip)
{
- snd_pcm_t *pcm;
+ struct snd_pcm *pcm;
int err;
int num_captures = 1;
}
-static void snd_pmac_dbdma_reset(pmac_t *chip)
+static void snd_pmac_dbdma_reset(struct snd_pmac *chip)
{
out_le32(&chip->playback.dma->control, (RUN|PAUSE|FLUSH|WAKE|DEAD) << 16);
snd_pmac_wait_ack(&chip->playback);
/*
* handling beep
*/
-void snd_pmac_beep_dma_start(pmac_t *chip, int bytes, unsigned long addr, int speed)
+void snd_pmac_beep_dma_start(struct snd_pmac *chip, int bytes, unsigned long addr, int speed)
{
- pmac_stream_t *rec = &chip->playback;
+ struct pmac_stream *rec = &chip->playback;
snd_pmac_dma_stop(rec);
st_le16(&chip->extra_dma.cmds->req_count, bytes);
snd_pmac_dma_run(rec, RUN);
}
-void snd_pmac_beep_dma_stop(pmac_t *chip)
+void snd_pmac_beep_dma_stop(struct snd_pmac *chip)
{
snd_pmac_dma_stop(&chip->playback);
st_le16(&chip->extra_dma.cmds->command, DBDMA_STOP);
static irqreturn_t
snd_pmac_tx_intr(int irq, void *devid, struct pt_regs *regs)
{
- pmac_t *chip = devid;
+ struct snd_pmac *chip = devid;
snd_pmac_pcm_update(chip, &chip->playback);
return IRQ_HANDLED;
}
static irqreturn_t
snd_pmac_rx_intr(int irq, void *devid, struct pt_regs *regs)
{
- pmac_t *chip = devid;
+ struct snd_pmac *chip = devid;
snd_pmac_pcm_update(chip, &chip->capture);
return IRQ_HANDLED;
}
static irqreturn_t
snd_pmac_ctrl_intr(int irq, void *devid, struct pt_regs *regs)
{
- pmac_t *chip = devid;
+ struct snd_pmac *chip = devid;
int ctrl = in_le32(&chip->awacs->control);
/*printk("pmac: control interrupt.. 0x%x\n", ctrl);*/
/*
* a wrapper to feature call for compatibility
*/
-static void snd_pmac_sound_feature(pmac_t *chip, int enable)
+static void snd_pmac_sound_feature(struct snd_pmac *chip, int enable)
{
if (ppc_md.feature_call)
ppc_md.feature_call(PMAC_FTR_SOUND_CHIP_ENABLE, chip->node, 0, enable);
* release resources
*/
-static int snd_pmac_free(pmac_t *chip)
+static int snd_pmac_free(struct snd_pmac *chip)
{
/* stop sounds */
if (chip->initialized) {
/*
* free the device
*/
-static int snd_pmac_dev_free(snd_device_t *device)
+static int snd_pmac_dev_free(struct snd_device *device)
{
- pmac_t *chip = device->device_data;
+ struct snd_pmac *chip = device->device_data;
return snd_pmac_free(chip);
}
* check the machine support byteswap (little-endian)
*/
-static void __init detect_byte_swap(pmac_t *chip)
+static void __init detect_byte_swap(struct snd_pmac *chip)
{
struct device_node *mio;
/*
* detect a sound chip
*/
-static int __init snd_pmac_detect(pmac_t *chip)
+static int __init snd_pmac_detect(struct snd_pmac *chip)
{
struct device_node *sound = NULL;
unsigned int *prop, l;
/*
* exported - boolean info callbacks for ease of programming
*/
-int snd_pmac_boolean_stereo_info(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_info_t *uinfo)
+int snd_pmac_boolean_stereo_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 2;
return 0;
}
-int snd_pmac_boolean_mono_info(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_info_t *uinfo)
+int snd_pmac_boolean_mono_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1;
/*
* auto-mute
*/
-static int pmac_auto_mute_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int pmac_auto_mute_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = chip->auto_mute;
return 0;
}
-static int pmac_auto_mute_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int pmac_auto_mute_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
if (ucontrol->value.integer.value[0] != chip->auto_mute) {
chip->auto_mute = ucontrol->value.integer.value[0];
if (chip->update_automute)
return 0;
}
-static int pmac_hp_detect_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int pmac_hp_detect_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
if (chip->detect_headphone)
ucontrol->value.integer.value[0] = chip->detect_headphone(chip);
else
return 0;
}
-static snd_kcontrol_new_t auto_mute_controls[] __initdata = {
+static struct snd_kcontrol_new auto_mute_controls[] __initdata = {
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Auto Mute Switch",
.info = snd_pmac_boolean_mono_info,
},
};
-int __init snd_pmac_add_automute(pmac_t *chip)
+int __init snd_pmac_add_automute(struct snd_pmac *chip)
{
int err;
chip->auto_mute = 1;
/*
* create and detect a pmac chip record
*/
-int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return)
+int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
{
- pmac_t *chip;
+ struct snd_pmac *chip;
struct device_node *np;
int i, err;
unsigned long ctrl_addr, txdma_addr, rxdma_addr;
- static snd_device_ops_t ops = {
+ static struct snd_device_ops ops = {
.dev_free = snd_pmac_dev_free,
};
* Save state when going to sleep, restore it afterwards.
*/
-static int snd_pmac_suspend(snd_card_t *card, pm_message_t state)
+static int snd_pmac_suspend(struct snd_card *card, pm_message_t state)
{
- pmac_t *chip = card->pm_private_data;
+ struct snd_pmac *chip = card->pm_private_data;
unsigned long flags;
if (chip->suspend)
return 0;
}
-static int snd_pmac_resume(snd_card_t *card)
+static int snd_pmac_resume(struct snd_card *card)
{
- pmac_t *chip = card->pm_private_data;
+ struct snd_pmac *chip = card->pm_private_data;
snd_pmac_sound_feature(chip, 1);
if (chip->resume)
/* the chip is stored statically by snd_pmac_register_sleep_notifier
* because we can't have any private data for notify callback.
*/
-static pmac_t *sleeping_pmac = NULL;
+static struct snd_pmac *sleeping_pmac = NULL;
static int snd_pmac_sleep_notify(struct pmu_sleep_notifier *self, int when)
{
- pmac_t *chip;
+ struct snd_pmac *chip;
chip = sleeping_pmac;
if (! chip)
snd_pmac_sleep_notify, SLEEP_LEVEL_SOUND,
};
-static int __init snd_pmac_register_sleep_notifier(pmac_t *chip)
+static int __init snd_pmac_register_sleep_notifier(struct snd_pmac *chip)
{
/* should be protected here.. */
snd_assert(! sleeping_pmac, return -EBUSY);
return 0;
}
-static int snd_pmac_unregister_sleep_notifier(pmac_t *chip)
+static int snd_pmac_unregister_sleep_notifier(struct snd_pmac *chip)
{
/* should be protected here.. */
snd_assert(sleeping_pmac == chip, return -ENODEV);
#define PMAC_SUPPORT_AUTOMUTE
-/*
- * typedefs
- */
-typedef struct snd_pmac pmac_t;
-typedef struct snd_pmac_stream pmac_stream_t;
-typedef struct snd_pmac_beep pmac_beep_t;
-typedef struct snd_pmac_dbdma pmac_dbdma_t;
-
-
/*
* DBDMA space
*/
-struct snd_pmac_dbdma {
+struct pmac_dbdma {
dma_addr_t dma_base;
dma_addr_t addr;
struct dbdma_cmd __iomem *cmds;
/*
* playback/capture stream
*/
-struct snd_pmac_stream {
+struct pmac_stream {
int running; /* boolean */
int stream; /* PLAYBACK/CAPTURE */
int buffer_size; /* in kbytes */
int nperiods, cur_period;
- pmac_dbdma_t cmd;
+ struct pmac_dbdma cmd;
volatile struct dbdma_regs __iomem *dma;
- snd_pcm_substream_t *substream;
+ struct snd_pcm_substream *substream;
unsigned int cur_freqs; /* currently available frequencies */
unsigned int cur_formats; /* currently available formats */
};
struct snd_pmac {
- snd_card_t *card;
+ struct snd_card *card;
/* h/w info */
struct device_node *node;
unsigned char __iomem *latch_base;
unsigned char __iomem *macio_base;
- pmac_stream_t playback;
- pmac_stream_t capture;
+ struct pmac_stream playback;
+ struct pmac_stream capture;
- pmac_dbdma_t extra_dma;
+ struct pmac_dbdma extra_dma;
int irq, tx_irq, rx_irq;
- snd_pcm_t *pcm;
+ struct snd_pcm *pcm;
- pmac_beep_t *beep;
+ struct pmac_beep *beep;
unsigned int control_mask; /* control mask */
/* mixer stuffs */
void *mixer_data;
- void (*mixer_free)(pmac_t *);
- snd_kcontrol_t *master_sw_ctl;
- snd_kcontrol_t *speaker_sw_ctl;
- snd_kcontrol_t *drc_sw_ctl; /* only used for tumbler -ReneR */
- snd_kcontrol_t *hp_detect_ctl;
- snd_kcontrol_t *lineout_sw_ctl;
+ void (*mixer_free)(struct snd_pmac *);
+ struct snd_kcontrol *master_sw_ctl;
+ struct snd_kcontrol *speaker_sw_ctl;
+ struct snd_kcontrol *drc_sw_ctl; /* only used for tumbler -ReneR */
+ struct snd_kcontrol *hp_detect_ctl;
+ struct snd_kcontrol *lineout_sw_ctl;
/* lowlevel callbacks */
- void (*set_format)(pmac_t *chip);
- void (*update_automute)(pmac_t *chip, int do_notify);
- int (*detect_headphone)(pmac_t *chip);
+ void (*set_format)(struct snd_pmac *chip);
+ void (*update_automute)(struct snd_pmac *chip, int do_notify);
+ int (*detect_headphone)(struct snd_pmac *chip);
#ifdef CONFIG_PM
- void (*suspend)(pmac_t *chip);
- void (*resume)(pmac_t *chip);
+ void (*suspend)(struct snd_pmac *chip);
+ void (*resume)(struct snd_pmac *chip);
#endif
};
/* exported functions */
-int snd_pmac_new(snd_card_t *card, pmac_t **chip_return);
-int snd_pmac_pcm_new(pmac_t *chip);
-int snd_pmac_attach_beep(pmac_t *chip);
-void snd_pmac_detach_beep(pmac_t *chip);
-void snd_pmac_beep_stop(pmac_t *chip);
-unsigned int snd_pmac_rate_index(pmac_t *chip, pmac_stream_t *rec, unsigned int rate);
+int snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return);
+int snd_pmac_pcm_new(struct snd_pmac *chip);
+int snd_pmac_attach_beep(struct snd_pmac *chip);
+void snd_pmac_detach_beep(struct snd_pmac *chip);
+void snd_pmac_beep_stop(struct snd_pmac *chip);
+unsigned int snd_pmac_rate_index(struct snd_pmac *chip, struct pmac_stream *rec, unsigned int rate);
-void snd_pmac_beep_dma_start(pmac_t *chip, int bytes, unsigned long addr, int speed);
-void snd_pmac_beep_dma_stop(pmac_t *chip);
+void snd_pmac_beep_dma_start(struct snd_pmac *chip, int bytes, unsigned long addr, int speed);
+void snd_pmac_beep_dma_stop(struct snd_pmac *chip);
/* initialize mixer */
-int snd_pmac_awacs_init(pmac_t *chip);
-int snd_pmac_burgundy_init(pmac_t *chip);
-int snd_pmac_daca_init(pmac_t *chip);
-int snd_pmac_tumbler_init(pmac_t *chip);
+int snd_pmac_awacs_init(struct snd_pmac *chip);
+int snd_pmac_burgundy_init(struct snd_pmac *chip);
+int snd_pmac_daca_init(struct snd_pmac *chip);
+int snd_pmac_tumbler_init(struct snd_pmac *chip);
int snd_pmac_tumbler_post_init(void);
-int snd_pmac_toonie_init(pmac_t *chip);
+int snd_pmac_toonie_init(struct snd_pmac *chip);
/* i2c functions */
-typedef struct snd_pmac_keywest {
+struct pmac_keywest {
int addr;
struct i2c_client *client;
int id;
- int (*init_client)(struct snd_pmac_keywest *i2c);
+ int (*init_client)(struct pmac_keywest *i2c);
char *name;
-} pmac_keywest_t;
+};
-int snd_pmac_keywest_init(pmac_keywest_t *i2c);
-void snd_pmac_keywest_cleanup(pmac_keywest_t *i2c);
+int snd_pmac_keywest_init(struct pmac_keywest *i2c);
+void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c);
/* misc */
-int snd_pmac_boolean_stereo_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo);
-int snd_pmac_boolean_mono_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo);
+int snd_pmac_boolean_stereo_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
+int snd_pmac_boolean_mono_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
-int snd_pmac_add_automute(pmac_t *chip);
+int snd_pmac_add_automute(struct snd_pmac *chip);
#endif /* __PMAC_H */
* card entry
*/
-static snd_card_t *snd_pmac_card = NULL;
+static struct snd_card *snd_pmac_card = NULL;
/*
*/
static int __init snd_pmac_probe(void)
{
- snd_card_t *card;
- pmac_t *chip;
+ struct snd_card *card;
+ struct snd_pmac *chip;
char *name_ext;
int err;
enum { TOONIE_MUTE_HP, TOONIE_MUTE_AMP };
-static int toonie_get_mute_switch(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int toonie_get_mute_switch(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
struct pmac_toonie *mix = chip->mixer_data;
struct pmac_gpio *gp;
return 0;
}
-static int toonie_put_mute_switch(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int toonie_put_mute_switch(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
struct pmac_toonie *mix = chip->mixer_data;
struct pmac_gpio *gp;
int val;
return 0;
}
-static snd_kcontrol_new_t toonie_hp_sw __initdata = {
+static struct snd_kcontrol_new toonie_hp_sw __initdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Headphone Playback Switch",
.info = snd_pmac_boolean_mono_info,
.put = toonie_put_mute_switch,
.private_value = TOONIE_MUTE_HP,
};
-static snd_kcontrol_new_t toonie_speaker_sw __initdata = {
+static struct snd_kcontrol_new toonie_speaker_sw __initdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PC Speaker Playback Switch",
.info = snd_pmac_boolean_mono_info,
/*
* auto-mute stuffs
*/
-static int toonie_detect_headphone(pmac_t *chip)
+static int toonie_detect_headphone(struct snd_pmac *chip)
{
struct pmac_toonie *mix = chip->mixer_data;
int detect = 0;
return detect;
}
-static void toonie_check_mute(pmac_t *chip, struct pmac_gpio *gp, int val,
- int do_notify, snd_kcontrol_t *sw)
+static void toonie_check_mute(struct snd_pmac *chip, struct pmac_gpio *gp, int val,
+ int do_notify, struct snd_kcontrol *sw)
{
if (check_audio_gpio(gp) != val) {
write_audio_gpio(gp, val);
static void toonie_detect_handler(void *self)
{
- pmac_t *chip = (pmac_t*) self;
+ struct snd_pmac *chip = (struct snd_pmac *) self;
struct pmac_toonie *mix;
int headphone;
}
}
-static void toonie_update_automute(pmac_t *chip, int do_notify)
+static void toonie_update_automute(struct snd_pmac *chip, int do_notify)
{
if (chip->auto_mute) {
struct pmac_toonie *mix;
/* interrupt - headphone plug changed */
static irqreturn_t toonie_hp_intr(int irq, void *devid, struct pt_regs *regs)
{
- pmac_t *chip = devid;
+ struct snd_pmac *chip = devid;
if (chip->update_automute && chip->initialized) {
chip->update_automute(chip, 1);
return (np->n_intrs > 0) ? np->intrs[0].line : 0;
}
-static void toonie_cleanup(pmac_t *chip)
+static void toonie_cleanup(struct snd_pmac *chip)
{
struct pmac_toonie *mix = chip->mixer_data;
if (! mix)
chip->mixer_data = NULL;
}
-int snd_pmac_toonie_init(pmac_t *chip)
+int snd_pmac_toonie_init(struct snd_pmac *chip)
{
struct pmac_toonie *mix;
VOL_IDX_LAST_MIX
};
-typedef struct pmac_gpio {
+struct pmac_gpio {
unsigned int addr;
u8 active_val;
u8 inactive_val;
u8 active_state;
-} pmac_gpio_t;
-
-typedef struct pmac_tumbler_t {
- pmac_keywest_t i2c;
- pmac_gpio_t audio_reset;
- pmac_gpio_t amp_mute;
- pmac_gpio_t line_mute;
- pmac_gpio_t line_detect;
- pmac_gpio_t hp_mute;
- pmac_gpio_t hp_detect;
+};
+
+struct pmac_tumbler {
+ struct pmac_keywest i2c;
+ struct pmac_gpio audio_reset;
+ struct pmac_gpio amp_mute;
+ struct pmac_gpio line_mute;
+ struct pmac_gpio line_detect;
+ struct pmac_gpio hp_mute;
+ struct pmac_gpio hp_detect;
int headphone_irq;
int lineout_irq;
unsigned int save_master_vol[2];
int auto_mute_notify;
int reset_on_sleep;
u8 acs;
-} pmac_tumbler_t;
+};
/*
*/
-static int send_init_client(pmac_keywest_t *i2c, unsigned int *regs)
+static int send_init_client(struct pmac_keywest *i2c, unsigned int *regs)
{
while (*regs > 0) {
int err, count = 10;
}
-static int tumbler_init_client(pmac_keywest_t *i2c)
+static int tumbler_init_client(struct pmac_keywest *i2c)
{
static unsigned int regs[] = {
/* normal operation, SCLK=64fps, i2s output, i2s input, 16bit width */
return send_init_client(i2c, regs);
}
-static int snapper_init_client(pmac_keywest_t *i2c)
+static int snapper_init_client(struct pmac_keywest *i2c)
{
static unsigned int regs[] = {
/* normal operation, SCLK=64fps, i2s output, 16bit width */
pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, (gp)->addr, 0)
#define tumbler_gpio_free(gp) /* NOP */
-static void write_audio_gpio(pmac_gpio_t *gp, int active)
+static void write_audio_gpio(struct pmac_gpio *gp, int active)
{
if (! gp->addr)
return;
DBG("(I) gpio %x write %d\n", gp->addr, active);
}
-static int check_audio_gpio(pmac_gpio_t *gp)
+static int check_audio_gpio(struct pmac_gpio *gp)
{
int ret;
return (ret & 0xd) == (gp->active_val & 0xd);
}
-static int read_audio_gpio(pmac_gpio_t *gp)
+static int read_audio_gpio(struct pmac_gpio *gp)
{
int ret;
if (! gp->addr)
/*
* update master volume
*/
-static int tumbler_set_master_volume(pmac_tumbler_t *mix)
+static int tumbler_set_master_volume(struct pmac_tumbler *mix)
{
unsigned char block[6];
unsigned int left_vol, right_vol;
/* output volume */
-static int tumbler_info_master_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int tumbler_info_master_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
return 0;
}
-static int tumbler_get_master_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_get_master_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix = chip->mixer_data;
snd_assert(mix, return -ENODEV);
ucontrol->value.integer.value[0] = mix->master_vol[0];
ucontrol->value.integer.value[1] = mix->master_vol[1];
return 0;
}
-static int tumbler_put_master_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_put_master_volume(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix = chip->mixer_data;
int change;
snd_assert(mix, return -ENODEV);
}
/* output switch */
-static int tumbler_get_master_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_get_master_switch(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix = chip->mixer_data;
snd_assert(mix, return -ENODEV);
ucontrol->value.integer.value[0] = mix->master_switch[0];
ucontrol->value.integer.value[1] = mix->master_switch[1];
return 0;
}
-static int tumbler_put_master_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_put_master_switch(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix = chip->mixer_data;
int change;
snd_assert(mix, return -ENODEV);
#define TAS3001_DRC_MAX 0x5f
-static int tumbler_set_drc(pmac_tumbler_t *mix)
+static int tumbler_set_drc(struct pmac_tumbler *mix)
{
unsigned char val[2];
#define TAS3004_DRC_MAX 0xef
-static int snapper_set_drc(pmac_tumbler_t *mix)
+static int snapper_set_drc(struct pmac_tumbler *mix)
{
unsigned char val[6];
return 0;
}
-static int tumbler_info_drc_value(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int tumbler_info_drc_value(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
uinfo->value.integer.min = 0;
return 0;
}
-static int tumbler_get_drc_value(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_get_drc_value(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix;
if (! (mix = chip->mixer_data))
return -ENODEV;
ucontrol->value.integer.value[0] = mix->drc_range;
return 0;
}
-static int tumbler_put_drc_value(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_put_drc_value(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix;
int change;
if (! (mix = chip->mixer_data))
return change;
}
-static int tumbler_get_drc_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_get_drc_switch(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix;
if (! (mix = chip->mixer_data))
return -ENODEV;
ucontrol->value.integer.value[0] = mix->drc_enable;
return 0;
}
-static int tumbler_put_drc_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_put_drc_switch(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix;
int change;
if (! (mix = chip->mixer_data))
unsigned int *table;
};
-static int tumbler_set_mono_volume(pmac_tumbler_t *mix, struct tumbler_mono_vol *info)
+static int tumbler_set_mono_volume(struct pmac_tumbler *mix,
+ struct tumbler_mono_vol *info)
{
unsigned char block[4];
unsigned int vol;
return 0;
}
-static int tumbler_info_mono(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int tumbler_info_mono(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
struct tumbler_mono_vol *info = (struct tumbler_mono_vol *)kcontrol->private_value;
return 0;
}
-static int tumbler_get_mono(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_get_mono(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
struct tumbler_mono_vol *info = (struct tumbler_mono_vol *)kcontrol->private_value;
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix;
if (! (mix = chip->mixer_data))
return -ENODEV;
ucontrol->value.integer.value[0] = mix->mono_vol[info->index];
return 0;
}
-static int tumbler_put_mono(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_put_mono(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
struct tumbler_mono_vol *info = (struct tumbler_mono_vol *)kcontrol->private_value;
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix;
int change;
if (! (mix = chip->mixer_data))
* snapper mixer volumes
*/
-static int snapper_set_mix_vol1(pmac_tumbler_t *mix, int idx, int ch, int reg)
+static int snapper_set_mix_vol1(struct pmac_tumbler *mix, int idx, int ch, int reg)
{
int i, j, vol;
unsigned char block[9];
return 0;
}
-static int snapper_set_mix_vol(pmac_tumbler_t *mix, int idx)
+static int snapper_set_mix_vol(struct pmac_tumbler *mix, int idx)
{
if (! mix->i2c.client)
return -ENODEV;
return 0;
}
-static int snapper_info_mix(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snapper_info_mix(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
return 0;
}
-static int snapper_get_mix(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snapper_get_mix(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
int idx = (int)kcontrol->private_value;
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix;
if (! (mix = chip->mixer_data))
return -ENODEV;
ucontrol->value.integer.value[0] = mix->mix_vol[idx][0];
return 0;
}
-static int snapper_put_mix(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snapper_put_mix(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
int idx = (int)kcontrol->private_value;
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix;
int change;
if (! (mix = chip->mixer_data))
enum { TUMBLER_MUTE_HP, TUMBLER_MUTE_AMP, TUMBLER_MUTE_LINE };
-static int tumbler_get_mute_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_get_mute_switch(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix;
- pmac_gpio_t *gp;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix;
+ struct pmac_gpio *gp;
if (! (mix = chip->mixer_data))
return -ENODEV;
switch(kcontrol->private_value) {
return 0;
}
-static int tumbler_put_mute_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int tumbler_put_mute_switch(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix;
- pmac_gpio_t *gp;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix;
+ struct pmac_gpio *gp;
int val;
#ifdef PMAC_SUPPORT_AUTOMUTE
if (chip->update_automute && chip->auto_mute)
return 0;
}
-static int snapper_set_capture_source(pmac_tumbler_t *mix)
+static int snapper_set_capture_source(struct pmac_tumbler *mix)
{
if (! mix->i2c.client)
return -ENODEV;
return i2c_smbus_write_byte_data(mix->i2c.client, TAS_REG_ACS, mix->acs);
}
-static int snapper_info_capture_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+static int snapper_info_capture_source(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
static char *texts[2] = {
"Line", "Mic"
return 0;
}
-static int snapper_get_capture_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snapper_get_capture_source(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix = chip->mixer_data;
snd_assert(mix, return -ENODEV);
ucontrol->value.integer.value[0] = mix->capture_source;
return 0;
}
-static int snapper_put_capture_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+static int snapper_put_capture_source(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- pmac_t *chip = snd_kcontrol_chip(kcontrol);
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
+ struct pmac_tumbler *mix = chip->mixer_data;
int change;
snd_assert(mix, return -ENODEV);
/*
*/
-static snd_kcontrol_new_t tumbler_mixers[] __initdata = {
+static struct snd_kcontrol_new tumbler_mixers[] __initdata = {
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Volume",
.info = tumbler_info_master_volume,
},
};
-static snd_kcontrol_new_t snapper_mixers[] __initdata = {
+static struct snd_kcontrol_new snapper_mixers[] __initdata = {
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Volume",
.info = tumbler_info_master_volume,
},
};
-static snd_kcontrol_new_t tumbler_hp_sw __initdata = {
+static struct snd_kcontrol_new tumbler_hp_sw __initdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Headphone Playback Switch",
.info = snd_pmac_boolean_mono_info,
.put = tumbler_put_mute_switch,
.private_value = TUMBLER_MUTE_HP,
};
-static snd_kcontrol_new_t tumbler_speaker_sw __initdata = {
+static struct snd_kcontrol_new tumbler_speaker_sw __initdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PC Speaker Playback Switch",
.info = snd_pmac_boolean_mono_info,
.put = tumbler_put_mute_switch,
.private_value = TUMBLER_MUTE_AMP,
};
-static snd_kcontrol_new_t tumbler_lineout_sw __initdata = {
+static struct snd_kcontrol_new tumbler_lineout_sw __initdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Line Out Playback Switch",
.info = snd_pmac_boolean_mono_info,
.put = tumbler_put_mute_switch,
.private_value = TUMBLER_MUTE_LINE,
};
-static snd_kcontrol_new_t tumbler_drc_sw __initdata = {
+static struct snd_kcontrol_new tumbler_drc_sw __initdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "DRC Switch",
.info = snd_pmac_boolean_mono_info,
/*
* auto-mute stuffs
*/
-static int tumbler_detect_headphone(pmac_t *chip)
+static int tumbler_detect_headphone(struct snd_pmac *chip)
{
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct pmac_tumbler *mix = chip->mixer_data;
int detect = 0;
if (mix->hp_detect.addr)
return detect;
}
-static int tumbler_detect_lineout(pmac_t *chip)
+static int tumbler_detect_lineout(struct snd_pmac *chip)
{
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct pmac_tumbler *mix = chip->mixer_data;
int detect = 0;
if (mix->line_detect.addr)
return detect;
}
-static void check_mute(pmac_t *chip, pmac_gpio_t *gp, int val, int do_notify, snd_kcontrol_t *sw)
+static void check_mute(struct snd_pmac *chip, struct pmac_gpio *gp, int val, int do_notify,
+ struct snd_kcontrol *sw)
{
if (check_audio_gpio(gp) != val) {
write_audio_gpio(gp, val);
static void device_change_handler(void *self)
{
- pmac_t *chip = (pmac_t*) self;
- pmac_tumbler_t *mix;
+ struct snd_pmac *chip = self;
+ struct pmac_tumbler *mix;
int headphone, lineout;
if (!chip)
tumbler_set_master_volume(mix);
}
-static void tumbler_update_automute(pmac_t *chip, int do_notify)
+static void tumbler_update_automute(struct snd_pmac *chip, int do_notify)
{
if (chip->auto_mute) {
- pmac_tumbler_t *mix;
+ struct pmac_tumbler *mix;
mix = chip->mixer_data;
snd_assert(mix, return);
mix->auto_mute_notify = do_notify;
/* interrupt - headphone plug changed */
static irqreturn_t headphone_intr(int irq, void *devid, struct pt_regs *regs)
{
- pmac_t *chip = devid;
+ struct snd_pmac *chip = devid;
if (chip->update_automute && chip->initialized) {
chip->update_automute(chip, 1);
return IRQ_HANDLED;
}
/* find an audio device and get its address */
-static long tumbler_find_device(const char *device, const char *platform, pmac_gpio_t *gp, int is_compatible)
+static long tumbler_find_device(const char *device, const char *platform,
+ struct pmac_gpio *gp, int is_compatible)
{
struct device_node *node;
u32 *base, addr;
}
/* reset audio */
-static void tumbler_reset_audio(pmac_t *chip)
+static void tumbler_reset_audio(struct snd_pmac *chip)
{
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct pmac_tumbler *mix = chip->mixer_data;
if (mix->anded_reset) {
DBG("(I) codec anded reset !\n");
#ifdef CONFIG_PM
/* suspend mixer */
-static void tumbler_suspend(pmac_t *chip)
+static void tumbler_suspend(struct snd_pmac *chip)
{
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct pmac_tumbler *mix = chip->mixer_data;
if (mix->headphone_irq >= 0)
disable_irq(mix->headphone_irq);
}
/* resume mixer */
-static void tumbler_resume(pmac_t *chip)
+static void tumbler_resume(struct snd_pmac *chip)
{
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct pmac_tumbler *mix = chip->mixer_data;
snd_assert(mix, return);
#endif
/* initialize tumbler */
-static int __init tumbler_init(pmac_t *chip)
+static int __init tumbler_init(struct snd_pmac *chip)
{
int irq;
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct pmac_tumbler *mix = chip->mixer_data;
snd_assert(mix, return -EINVAL);
if (tumbler_find_device("audio-hw-reset",
return 0;
}
-static void tumbler_cleanup(pmac_t *chip)
+static void tumbler_cleanup(struct snd_pmac *chip)
{
- pmac_tumbler_t *mix = chip->mixer_data;
+ struct pmac_tumbler *mix = chip->mixer_data;
if (! mix)
return;
}
/* exported */
-int __init snd_pmac_tumbler_init(pmac_t *chip)
+int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
{
int i, err;
- pmac_tumbler_t *mix;
+ struct pmac_tumbler *mix;
u32 *paddr;
struct device_node *tas_node, *np;
char *chipname;