* merged HAL layer (patches from Brian)
*/
-/* $Id: sa11xx-uda1341.c,v 1.15 2004/05/03 17:36:50 tiwai Exp $ */
+/* $Id: sa11xx-uda1341.c,v 1.18 2004/07/20 15:54:09 cladisch Exp $ */
/***************************************************************************************************
*
MODULE_AUTHOR("Tomas Kasparek <tomas.kasparek@seznam.cz>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("SA1100/SA1111 + UDA1341TS driver for ALSA");
-MODULE_CLASSES("{sound}");
-MODULE_DEVICES("{{UDA1341,iPAQ H3600 UDA1341TS}}");
+MODULE_SUPPORTED_DEVICE("{{UDA1341,iPAQ H3600 UDA1341TS}}");
static char *id = NULL; /* ID for this card */
module_param(id, charp, 0444);
MODULE_PARM_DESC(id, "ID string for SA1100/SA1111 + UDA1341TS soundcard.");
-#define chip_t sa11xx_uda1341_t
-
typedef struct audio_stream {
char *id; /* identification string */
int stream_id; /* numeric identification */
29400, 32000, 44100, 48000,
};
-#define RATES sizeof(rates) / sizeof(rates[0])
-
static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
- .count = RATES,
+ .count = ARRAY_SIZE(rates),
.list = rates,
.mask = 0,
};
static int snd_sa11xx_uda1341_suspend(snd_card_t *card, unsigned int state)
{
- sa11xx_uda1341_t *chip = snd_magic_cast(sa11x_uda1341_t, card->pm_private_data, return -EINVAL);
+ sa11xx_uda1341_t *chip = card->pm_private_data;
snd_pcm_suspend_all(chip->pcm);
#ifdef HH_VERSION
static int snd_sa11xx_uda1341_resume(snd_card_t *card, unsigned int state)
{
- sa11xx_uda1341_t *chip = snd_magic_cast(sa11x_uda1341_t, card->pm_private_data, return -EINVAL);
+ sa11xx_uda1341_t *chip = card->pm_private_data;
sa11xx_uda1341_audio_init(chip);
l3_command(chip->uda1341, CMD_RESUME, NULL);
void snd_sa11xx_uda1341_free(snd_card_t *card)
{
- sa11xx_uda1341_t *chip = snd_magic_cast(sa11xx_uda1341_t, card->private_data, return);
+ sa11xx_uda1341_t *chip = card->private_data;
audio_dma_free(&chip->s[SNDRV_PCM_STREAM_PLAYBACK]);
audio_dma_free(&chip->s[SNDRV_PCM_STREAM_CAPTURE]);
if (card == NULL)
return -ENOMEM;
- sa11xx_uda1341 = snd_magic_kcalloc(sa11xx_uda1341_t, 0, GFP_KERNEL);
+ sa11xx_uda1341 = kcalloc(1, sizeof(*sa11xx_uda1341), GFP_KERNEL);
if (sa11xx_uda1341 == NULL)
return -ENOMEM;
spin_lock_init(&chip->s[0].dma_lock);