module_param_array(index, int, boot_devs, 0444);
MODULE_PARM_DESC(index, "Index value for Sun AMD7930 soundcard.");
-MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
module_param_array(id, charp, boot_devs, 0444);
MODULE_PARM_DESC(id, "ID string for Sun AMD7930 soundcard.");
-MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
module_param_array(enable, bool, boot_devs, 0444);
MODULE_PARM_DESC(enable, "Enable Sun AMD7930 soundcard.");
-MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_AUTHOR("Thomas K. Dyas and David S. Miller");
MODULE_DESCRIPTION("Sun AMD7930");
MODULE_LICENSE("GPL");
-MODULE_CLASSES("{sound}");
-MODULE_DEVICES("{{Sun,AMD7930}}");
+MODULE_SUPPORTED_DEVICE("{{Sun,AMD7930}}");
/* Device register layout. */
typedef struct snd_amd7930 {
spinlock_t lock;
- unsigned long regs;
+ void __iomem *regs;
u32 flags;
#define AMD7930_FLAG_PLAYBACK 0x00000001
#define AMD7930_FLAG_CAPTURE 0x00000002
unsigned int regs_size;
struct snd_amd7930 *next;
} amd7930_t;
-#define chip_t amd7930_t
static amd7930_t *amd7930_list;
0x000b, /* 16.9 dB */
0x000f /* 18. dB */
};
-#define NR_GER_COEFFS (sizeof(ger_coeff) / sizeof(ger_coeff[0]))
/* Update amd7930_map settings and program them into the hardware.
* The amd->lock is held and local interrupts are disabled.
map->gx = gx_coeff[amd->rgain];
map->stgr = gx_coeff[amd->mgain];
- level = (amd->pgain * (256 + NR_GER_COEFFS)) >> 8;
+ level = (amd->pgain * (256 + ARRAY_SIZE(ger_coeff))) >> 8;
if (level >= 256) {
map->ger = ger_coeff[level - 256];
map->gr = gx_coeff[255];
static void snd_amd7930_pcm_free(snd_pcm_t *pcm)
{
- amd7930_t *amd = snd_magic_cast(amd7930_t, pcm->private_data, return);
+ amd7930_t *amd = pcm->private_data;
amd->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
},
};
-#define NUM_AMD7930_CONTROLS (sizeof(amd7930_controls)/sizeof(snd_kcontrol_new_t))
-
static int __init snd_amd7930_mixer(amd7930_t *amd)
{
snd_card_t *card;
card = amd->card;
strcpy(card->mixername, card->shortname);
- for (idx = 0; idx < NUM_AMD7930_CONTROLS; idx++) {
+ for (idx = 0; idx < ARRAY_SIZE(amd7930_controls); idx++) {
if ((err = snd_ctl_add(card,
snd_ctl_new1(&amd7930_controls[idx], amd))) < 0)
return err;
if (amd->regs)
sbus_iounmap(amd->regs, amd->regs_size);
- snd_magic_kfree(amd);
+ kfree(amd);
return 0;
}
static int snd_amd7930_dev_free(snd_device_t *device)
{
- amd7930_t *amd = snd_magic_cast(amd7930_t, device->device_data, return -ENXIO);
+ amd7930_t *amd = device->device_data;
return snd_amd7930_free(amd);
}
int err;
*ramd = NULL;
- amd = snd_magic_kcalloc(amd7930_t, 0, GFP_KERNEL);
+ amd = kcalloc(1, sizeof(*amd), GFP_KERNEL);
if (amd == NULL)
return -ENOMEM;