X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=sound%2Fdrivers%2Fmts64.c;h=87ba1ddc01151fdfb5bd8f38d80103a68964aa5a;hb=4f199629b0fba95fd5caecbf35ed68417d9a9b7a;hp=6c9f4c9bfeb6c3616063daf1b8fe127a65360f17;hpb=b0138a6cb7923a997d278b47c176778534d1095b;p=linux-2.6-omap-h63xx.git diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index 6c9f4c9bfeb..87ba1ddc011 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -18,7 +18,6 @@ * */ -#include #include #include #include @@ -440,15 +439,7 @@ static void mts64_write_midi(struct mts64 *mts, u8 c, *********************************************************************/ /* SMPTE Switch */ -static int snd_mts64_ctl_smpte_switch_info(struct snd_kcontrol *kctl, - struct snd_ctl_elem_info *uinfo) -{ - uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; - uinfo->count = 1; - uinfo->value.integer.min = 0; - uinfo->value.integer.max = 1; - return 0; -} +#define snd_mts64_ctl_smpte_switch_info snd_ctl_boolean_mono_info static int snd_mts64_ctl_smpte_switch_get(struct snd_kcontrol* kctl, struct snd_ctl_elem_value *uctl) @@ -469,13 +460,14 @@ static int snd_mts64_ctl_smpte_switch_put(struct snd_kcontrol* kctl, { struct mts64 *mts = snd_kcontrol_chip(kctl); int changed = 0; + int val = !!uctl->value.integer.value[0]; spin_lock_irq(&mts->lock); - if (mts->smpte_switch == uctl->value.integer.value[0]) + if (mts->smpte_switch == val) goto __out; changed = 1; - mts->smpte_switch = uctl->value.integer.value[0]; + mts->smpte_switch = val; if (mts->smpte_switch) { mts64_smpte_start(mts->pardev->port, mts->time[0], mts->time[1], @@ -549,12 +541,13 @@ static int snd_mts64_ctl_smpte_time_put(struct snd_kcontrol *kctl, { struct mts64 *mts = snd_kcontrol_chip(kctl); int idx = kctl->private_value; + unsigned int time = uctl->value.integer.value[0] % 60; int changed = 0; spin_lock_irq(&mts->lock); - if (mts->time[idx] != uctl->value.integer.value[0]) { + if (mts->time[idx] != time) { changed = 1; - mts->time[idx] = uctl->value.integer.value[0]; + mts->time[idx] = time; } spin_unlock_irq(&mts->lock); @@ -644,6 +637,8 @@ static int snd_mts64_ctl_smpte_fps_put(struct snd_kcontrol *kctl, struct mts64 *mts = snd_kcontrol_chip(kctl); int changed = 0; + if (uctl->value.enumerated.item[0] >= 5) + return -EINVAL; spin_lock_irq(&mts->lock); if (mts->fps != uctl->value.enumerated.item[0]) { changed = 1; @@ -670,7 +665,7 @@ static int __devinit snd_mts64_ctl_create(struct snd_card *card, struct mts64 *mts) { int err, i; - static struct snd_kcontrol_new *control[] = { + static struct snd_kcontrol_new *control[] __devinitdata = { &mts64_ctl_smpte_switch, &mts64_ctl_smpte_time_hours, &mts64_ctl_smpte_time_minutes, @@ -838,7 +833,7 @@ static int __devinit snd_mts64_rawmidi_create(struct snd_card *card) /********************************************************************* * parport stuff *********************************************************************/ -static void snd_mts64_interrupt(int irq, void *private) +static void snd_mts64_interrupt(void *private) { struct mts64 *mts = ((struct snd_card*)private)->private_data; u16 ret; @@ -892,13 +887,13 @@ static void __devinit snd_mts64_attach(struct parport *p) struct platform_device *device; device = platform_device_alloc(PLATFORM_DRIVER, device_count); - if (!device) + if (!device) return; /* Temporary assignment to forward the parport */ platform_set_drvdata(device, p); - if (platform_device_register(device) < 0) { + if (platform_device_add(device) < 0) { platform_device_put(device); return; } @@ -1012,6 +1007,8 @@ static int __devinit snd_mts64_probe(struct platform_device *pdev) platform_set_drvdata(pdev, card); + snd_card_set_dev(card, &pdev->dev); + /* At this point card will be usable */ if ((err = snd_card_register(card)) < 0) { snd_printd("Cannot register card\n"); @@ -1048,7 +1045,7 @@ static struct platform_driver snd_mts64_driver = { /********************************************************************* * module init stuff *********************************************************************/ -static void __init_or_module snd_mts64_unregister_all(void) +static void snd_mts64_unregister_all(void) { int i;