aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc/beep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/ppc/beep.c')
-rw-r--r--sound/ppc/beep.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/sound/ppc/beep.c b/sound/ppc/beep.c
index d4ec6cc3f1c5..5fec1e58f310 100644
--- a/sound/ppc/beep.c
+++ b/sound/ppc/beep.c
@@ -30,7 +30,7 @@
30#include <sound/control.h> 30#include <sound/control.h>
31#include "pmac.h" 31#include "pmac.h"
32 32
33struct snd_pmac_beep { 33struct pmac_beep {
34 int running; /* boolean */ 34 int running; /* boolean */
35 int volume; /* mixer volume: 0-100 */ 35 int volume; /* mixer volume: 0-100 */
36 int volume_play; /* currently playing volume */ 36 int volume_play; /* currently playing volume */
@@ -44,9 +44,9 @@ struct snd_pmac_beep {
44/* 44/*
45 * stop beep if running 45 * stop beep if running
46 */ 46 */
47void snd_pmac_beep_stop(pmac_t *chip) 47void snd_pmac_beep_stop(struct snd_pmac *chip)
48{ 48{
49 pmac_beep_t *beep = chip->beep; 49 struct pmac_beep *beep = chip->beep;
50 if (beep && beep->running) { 50 if (beep && beep->running) {
51 beep->running = 0; 51 beep->running = 0;
52 snd_pmac_beep_dma_stop(chip); 52 snd_pmac_beep_dma_stop(chip);
@@ -97,10 +97,11 @@ static short beep_wform[256] = {
97#define BEEP_BUFLEN 512 97#define BEEP_BUFLEN 512
98#define BEEP_VOLUME 15 /* 0 - 100 */ 98#define BEEP_VOLUME 15 /* 0 - 100 */
99 99
100static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type, unsigned int code, int hz) 100static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type,
101 unsigned int code, int hz)
101{ 102{
102 pmac_t *chip; 103 struct snd_pmac *chip;
103 pmac_beep_t *beep; 104 struct pmac_beep *beep;
104 unsigned long flags; 105 unsigned long flags;
105 int beep_speed = 0; 106 int beep_speed = 0;
106 int srate; 107 int srate;
@@ -171,7 +172,8 @@ static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type, unsigne
171 * beep volume mixer 172 * beep volume mixer
172 */ 173 */
173 174
174static int snd_pmac_info_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 175static int snd_pmac_info_beep(struct snd_kcontrol *kcontrol,
176 struct snd_ctl_elem_info *uinfo)
175{ 177{
176 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 178 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
177 uinfo->count = 1; 179 uinfo->count = 1;
@@ -180,17 +182,19 @@ static int snd_pmac_info_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin
180 return 0; 182 return 0;
181} 183}
182 184
183static int snd_pmac_get_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 185static int snd_pmac_get_beep(struct snd_kcontrol *kcontrol,
186 struct snd_ctl_elem_value *ucontrol)
184{ 187{
185 pmac_t *chip = snd_kcontrol_chip(kcontrol); 188 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
186 snd_assert(chip->beep, return -ENXIO); 189 snd_assert(chip->beep, return -ENXIO);
187 ucontrol->value.integer.value[0] = chip->beep->volume; 190 ucontrol->value.integer.value[0] = chip->beep->volume;
188 return 0; 191 return 0;
189} 192}
190 193
191static int snd_pmac_put_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 194static int snd_pmac_put_beep(struct snd_kcontrol *kcontrol,
195 struct snd_ctl_elem_value *ucontrol)
192{ 196{
193 pmac_t *chip = snd_kcontrol_chip(kcontrol); 197 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
194 int oval; 198 int oval;
195 snd_assert(chip->beep, return -ENXIO); 199 snd_assert(chip->beep, return -ENXIO);
196 oval = chip->beep->volume; 200 oval = chip->beep->volume;
@@ -198,7 +202,7 @@ static int snd_pmac_put_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
198 return oval != chip->beep->volume; 202 return oval != chip->beep->volume;
199} 203}
200 204
201static snd_kcontrol_new_t snd_pmac_beep_mixer = { 205static struct snd_kcontrol_new snd_pmac_beep_mixer = {
202 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 206 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
203 .name = "Beep Playback Volume", 207 .name = "Beep Playback Volume",
204 .info = snd_pmac_info_beep, 208 .info = snd_pmac_info_beep,
@@ -207,9 +211,9 @@ static snd_kcontrol_new_t snd_pmac_beep_mixer = {
207}; 211};
208 212
209/* Initialize beep stuff */ 213/* Initialize beep stuff */
210int __init snd_pmac_attach_beep(pmac_t *chip) 214int __init snd_pmac_attach_beep(struct snd_pmac *chip)
211{ 215{
212 pmac_beep_t *beep; 216 struct pmac_beep *beep;
213 struct input_dev *input_dev; 217 struct input_dev *input_dev;
214 void *dmabuf; 218 void *dmabuf;
215 int err = -ENOMEM; 219 int err = -ENOMEM;
@@ -255,7 +259,7 @@ int __init snd_pmac_attach_beep(pmac_t *chip)
255 return err; 259 return err;
256} 260}
257 261
258void snd_pmac_detach_beep(pmac_t *chip) 262void snd_pmac_detach_beep(struct snd_pmac *chip)
259{ 263{
260 if (chip->beep) { 264 if (chip->beep) {
261 input_unregister_device(chip->beep->dev); 265 input_unregister_device(chip->beep->dev);