Commit 65b29f50 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: PowerMac

Remove xxx_t typedefs from the PowerMac driver.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bbe85bbd
This diff is collapsed.
......@@ -30,7 +30,7 @@
#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 */
......@@ -44,9 +44,9 @@ struct snd_pmac_beep {
/*
* 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);
......@@ -97,10 +97,11 @@ static short beep_wform[256] = {
#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;
......@@ -171,7 +172,8 @@ static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type, unsigne
* 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;
......@@ -180,17 +182,19 @@ static int snd_pmac_info_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin
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;
......@@ -198,7 +202,7 @@ static int snd_pmac_put_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
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,
......@@ -207,9 +211,9 @@ static snd_kcontrol_new_t snd_pmac_beep_mixer = {
};
/* 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;
......@@ -255,7 +259,7 @@ int __init snd_pmac_attach_beep(pmac_t *chip)
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);
......
......@@ -31,7 +31,7 @@
/* 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--)
......@@ -41,7 +41,7 @@ snd_pmac_burgundy_busy_wait(pmac_t *chip)
}
static inline void
snd_pmac_burgundy_extend_wait(pmac_t *chip)
snd_pmac_burgundy_extend_wait(struct snd_pmac *chip)
{
int timeout;
timeout = 50;
......@@ -57,7 +57,7 @@ snd_pmac_burgundy_extend_wait(pmac_t *chip)
}
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);
......@@ -70,7 +70,7 @@ snd_pmac_burgundy_wcw(pmac_t *chip, unsigned addr, unsigned val)
}
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;
......@@ -103,14 +103,14 @@ snd_pmac_burgundy_rcw(pmac_t *chip, unsigned addr)
}
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;
......@@ -131,7 +131,8 @@ snd_pmac_burgundy_rcb(pmac_t *chip, unsigned int addr)
* 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;
......@@ -146,7 +147,8 @@ snd_pmac_burgundy_write_volume(pmac_t *chip, unsigned int address, long *volume,
}
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;
......@@ -171,7 +173,8 @@ snd_pmac_burgundy_read_volume(pmac_t *chip, unsigned int address, long *volume,
#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;
......@@ -180,23 +183,27 @@ static int snd_pmac_burgundy_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_
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]);
......@@ -211,7 +218,8 @@ static int snd_pmac_burgundy_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_v
/* 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;
......@@ -221,9 +229,10 @@ static int snd_pmac_burgundy_info_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_e
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;
......@@ -234,9 +243,10 @@ static int snd_pmac_burgundy_get_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_el
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;
......@@ -259,7 +269,8 @@ static int snd_pmac_burgundy_put_switch_out(snd_kcontrol_t *kcontrol, snd_ctl_el
.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;
......@@ -269,9 +280,10 @@ static int snd_pmac_burgundy_info_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_e
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;
......@@ -283,9 +295,10 @@ static int snd_pmac_burgundy_get_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_el
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;
......@@ -308,7 +321,7 @@ static int snd_pmac_burgundy_put_volume_out(snd_kcontrol_t *kcontrol, snd_ctl_el
.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),
......@@ -317,9 +330,9 @@ static snd_kcontrol_new_t snd_pmac_burgundy_mixers[] __initdata = {
/*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);
......@@ -327,12 +340,12 @@ BURGUNDY_OUTPUT_SWITCH("PC Speaker Playback Switch", 0, BURGUNDY_OUTPUT_INTERN,
/*
* 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;
......@@ -361,7 +374,7 @@ static void snd_pmac_burgundy_update_automute(pmac_t *chip, int do_notify)
/*
* initialize burgundy
*/
int __init snd_pmac_burgundy_init(pmac_t *chip)
int __init snd_pmac_burgundy_init(struct snd_pmac *chip)
{
int i, err;
......
......@@ -40,18 +40,18 @@
#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 */
......@@ -66,7 +66,7 @@ static int daca_init_client(pmac_keywest_t *i2c)
/*
* update volume
*/
static int daca_set_volume(pmac_daca_t *mix)
static int daca_set_volume(struct pmac_daca *mix)
{
unsigned char data[2];
......@@ -92,7 +92,8 @@ static int daca_set_volume(pmac_daca_t *mix)
/* 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;
......@@ -101,20 +102,22 @@ static int daca_info_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *u
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))
......@@ -128,7 +131,8 @@ static int daca_put_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u
}
/* 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;
......@@ -137,10 +141,11 @@ static int daca_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo
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;
......@@ -148,10 +153,11 @@ static int daca_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
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))
......@@ -169,20 +175,22 @@ static int daca_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
/* 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))
......@@ -196,7 +204,7 @@ static int daca_put_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol
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,
......@@ -219,9 +227,9 @@ static snd_kcontrol_new_t daca_mixers[] = {
#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);
......@@ -230,9 +238,9 @@ static void daca_resume(pmac_t *chip)
#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);
......@@ -241,10 +249,10 @@ static void daca_cleanup(pmac_t *chip)
}
/* 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)
......
......@@ -32,7 +32,7 @@
* 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
......@@ -106,7 +106,7 @@ static int keywest_detach_client(struct i2c_client *client)
}
/* 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);
......@@ -126,7 +126,7 @@ int __init snd_pmac_tumbler_post_init(void)
}
/* exported */
int __init snd_pmac_keywest_init(pmac_keywest_t *i2c)
int __init snd_pmac_keywest_init(struct pmac_keywest *i2c)
{
int err;
......
This diff is collapsed.
......@@ -46,19 +46,10 @@
#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;
......@@ -69,7 +60,7 @@ struct snd_pmac_dbdma {
/*
* playback/capture stream
*/
struct snd_pmac_stream {
struct pmac_stream {
int running; /* boolean */
int stream; /* PLAYBACK/CAPTURE */
......@@ -79,10 +70,10 @@ struct snd_pmac_stream {
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 */
......@@ -98,7 +89,7 @@ enum snd_pmac_model {
};
struct snd_pmac {
snd_card_t *card;
struct snd_card *card;
/* h/w info */
struct device_node *node;
......@@ -140,75 +131,75 @@ struct snd_pmac {
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 */
......@@ -49,15 +49,15 @@ MODULE_PARM_DESC(enable_beep, "Enable beep using PCM.");
* 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;
......
......@@ -101,10 +101,10 @@ static int read_audio_gpio(struct pmac_gpio *gp)
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;
......@@ -124,10 +124,10 @@ static int toonie_get_mute_switch(snd_kcontrol_t *kcontrol,
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;
......@@ -156,7 +156,7 @@ static int toonie_put_mute_switch(snd_kcontrol_t *kcontrol,
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,
......@@ -164,7 +164,7 @@ static snd_kcontrol_new_t toonie_hp_sw __initdata = {
.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,
......@@ -176,7 +176,7 @@ static snd_kcontrol_new_t toonie_speaker_sw __initdata = {
/*
* 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;
......@@ -186,8 +186,8 @@ static int toonie_detect_headphone(pmac_t *chip)
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);
......@@ -199,7 +199,7 @@ static void toonie_check_mute(pmac_t *chip, struct pmac_gpio *gp, int 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;
......@@ -232,7 +232,7 @@ static void toonie_detect_handler(void *self)
}
}
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;
......@@ -246,7 +246,7 @@ static void toonie_update_automute(pmac_t *chip, int do_notify)
/* 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);
......@@ -325,7 +325,7 @@ static int find_audio_gpio(const char *name, const char *platform,
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)
......@@ -336,7 +336,7 @@ static void toonie_cleanup(pmac_t *chip)
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;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment