Skip to content

Commit

Permalink
[ALSA] Remove xxx_t typedefs: PowerMac
Browse files Browse the repository at this point in the history
Remove xxx_t typedefs from the PowerMac driver.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent bbe85bb commit 65b29f5
Show file tree
Hide file tree
Showing 10 changed files with 503 additions and 436 deletions.
175 changes: 98 additions & 77 deletions sound/ppc/awacs.c

Large diffs are not rendered by default.

34 changes: 19 additions & 15 deletions sound/ppc/beep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -180,25 +182,27 @@ 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;
chip->beep->volume = ucontrol->value.integer.value[0];
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,
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
75 changes: 44 additions & 31 deletions sound/ppc/burgundy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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--)
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;
Expand All @@ -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]);
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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),
Expand All @@ -317,22 +330,22 @@ 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);


#ifdef PMAC_SUPPORT_AUTOMUTE
/*
* 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;
Expand Down Expand Up @@ -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;

Expand Down
Loading

0 comments on commit 65b29f5

Please sign in to comment.