diff options
Diffstat (limited to 'sound/drivers/mts64.c')
-rw-r--r-- | sound/drivers/mts64.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index dcc90f995294..87ba1ddc0115 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c | |||
@@ -18,7 +18,6 @@ | |||
18 | * | 18 | * |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <sound/driver.h> | ||
22 | #include <linux/init.h> | 21 | #include <linux/init.h> |
23 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
24 | #include <linux/parport.h> | 23 | #include <linux/parport.h> |
@@ -461,13 +460,14 @@ static int snd_mts64_ctl_smpte_switch_put(struct snd_kcontrol* kctl, | |||
461 | { | 460 | { |
462 | struct mts64 *mts = snd_kcontrol_chip(kctl); | 461 | struct mts64 *mts = snd_kcontrol_chip(kctl); |
463 | int changed = 0; | 462 | int changed = 0; |
463 | int val = !!uctl->value.integer.value[0]; | ||
464 | 464 | ||
465 | spin_lock_irq(&mts->lock); | 465 | spin_lock_irq(&mts->lock); |
466 | if (mts->smpte_switch == uctl->value.integer.value[0]) | 466 | if (mts->smpte_switch == val) |
467 | goto __out; | 467 | goto __out; |
468 | 468 | ||
469 | changed = 1; | 469 | changed = 1; |
470 | mts->smpte_switch = uctl->value.integer.value[0]; | 470 | mts->smpte_switch = val; |
471 | if (mts->smpte_switch) { | 471 | if (mts->smpte_switch) { |
472 | mts64_smpte_start(mts->pardev->port, | 472 | mts64_smpte_start(mts->pardev->port, |
473 | mts->time[0], mts->time[1], | 473 | mts->time[0], mts->time[1], |
@@ -541,12 +541,13 @@ static int snd_mts64_ctl_smpte_time_put(struct snd_kcontrol *kctl, | |||
541 | { | 541 | { |
542 | struct mts64 *mts = snd_kcontrol_chip(kctl); | 542 | struct mts64 *mts = snd_kcontrol_chip(kctl); |
543 | int idx = kctl->private_value; | 543 | int idx = kctl->private_value; |
544 | unsigned int time = uctl->value.integer.value[0] % 60; | ||
544 | int changed = 0; | 545 | int changed = 0; |
545 | 546 | ||
546 | spin_lock_irq(&mts->lock); | 547 | spin_lock_irq(&mts->lock); |
547 | if (mts->time[idx] != uctl->value.integer.value[0]) { | 548 | if (mts->time[idx] != time) { |
548 | changed = 1; | 549 | changed = 1; |
549 | mts->time[idx] = uctl->value.integer.value[0]; | 550 | mts->time[idx] = time; |
550 | } | 551 | } |
551 | spin_unlock_irq(&mts->lock); | 552 | spin_unlock_irq(&mts->lock); |
552 | 553 | ||
@@ -636,6 +637,8 @@ static int snd_mts64_ctl_smpte_fps_put(struct snd_kcontrol *kctl, | |||
636 | struct mts64 *mts = snd_kcontrol_chip(kctl); | 637 | struct mts64 *mts = snd_kcontrol_chip(kctl); |
637 | int changed = 0; | 638 | int changed = 0; |
638 | 639 | ||
640 | if (uctl->value.enumerated.item[0] >= 5) | ||
641 | return -EINVAL; | ||
639 | spin_lock_irq(&mts->lock); | 642 | spin_lock_irq(&mts->lock); |
640 | if (mts->fps != uctl->value.enumerated.item[0]) { | 643 | if (mts->fps != uctl->value.enumerated.item[0]) { |
641 | changed = 1; | 644 | changed = 1; |
@@ -662,7 +665,7 @@ static int __devinit snd_mts64_ctl_create(struct snd_card *card, | |||
662 | struct mts64 *mts) | 665 | struct mts64 *mts) |
663 | { | 666 | { |
664 | int err, i; | 667 | int err, i; |
665 | static struct snd_kcontrol_new *control[] = { | 668 | static struct snd_kcontrol_new *control[] __devinitdata = { |
666 | &mts64_ctl_smpte_switch, | 669 | &mts64_ctl_smpte_switch, |
667 | &mts64_ctl_smpte_time_hours, | 670 | &mts64_ctl_smpte_time_hours, |
668 | &mts64_ctl_smpte_time_minutes, | 671 | &mts64_ctl_smpte_time_minutes, |
@@ -1004,6 +1007,8 @@ static int __devinit snd_mts64_probe(struct platform_device *pdev) | |||
1004 | 1007 | ||
1005 | platform_set_drvdata(pdev, card); | 1008 | platform_set_drvdata(pdev, card); |
1006 | 1009 | ||
1010 | snd_card_set_dev(card, &pdev->dev); | ||
1011 | |||
1007 | /* At this point card will be usable */ | 1012 | /* At this point card will be usable */ |
1008 | if ((err = snd_card_register(card)) < 0) { | 1013 | if ((err = snd_card_register(card)) < 0) { |
1009 | snd_printd("Cannot register card\n"); | 1014 | snd_printd("Cannot register card\n"); |