|
9 | 9 | #include "dice.h"
|
10 | 10 |
|
11 | 11 | #define READY_TIMEOUT_MS 200
|
12 |
| -#define NOTIFICATION_TIMEOUT_MS (2 * MSEC_PER_SEC) |
| 12 | +#define NOTIFICATION_TIMEOUT_MS 100 |
13 | 13 |
|
14 | 14 | struct reg_params {
|
15 | 15 | unsigned int count;
|
@@ -57,13 +57,9 @@ int snd_dice_stream_get_rate_mode(struct snd_dice *dice, unsigned int rate,
|
57 | 57 | return -EINVAL;
|
58 | 58 | }
|
59 | 59 |
|
60 |
| -/* |
61 |
| - * This operation has an effect to synchronize GLOBAL_STATUS/GLOBAL_SAMPLE_RATE |
62 |
| - * to GLOBAL_STATUS. Especially, just after powering on, these are different. |
63 |
| - */ |
64 |
| -static int ensure_phase_lock(struct snd_dice *dice, unsigned int rate) |
| 60 | +static int select_clock(struct snd_dice *dice, unsigned int rate) |
65 | 61 | {
|
66 |
| - __be32 reg, nominal; |
| 62 | + __be32 reg; |
67 | 63 | u32 data;
|
68 | 64 | int i;
|
69 | 65 | int err;
|
@@ -94,19 +90,8 @@ static int ensure_phase_lock(struct snd_dice *dice, unsigned int rate)
|
94 | 90 | return err;
|
95 | 91 |
|
96 | 92 | if (wait_for_completion_timeout(&dice->clock_accepted,
|
97 |
| - msecs_to_jiffies(NOTIFICATION_TIMEOUT_MS)) == 0) { |
98 |
| - /* |
99 |
| - * Old versions of Dice firmware transfer no notification when |
100 |
| - * the same clock status as current one is set. In this case, |
101 |
| - * just check current clock status. |
102 |
| - */ |
103 |
| - err = snd_dice_transaction_read_global(dice, GLOBAL_STATUS, |
104 |
| - &nominal, sizeof(nominal)); |
105 |
| - if (err < 0) |
106 |
| - return err; |
107 |
| - if (!(be32_to_cpu(nominal) & STATUS_SOURCE_LOCKED)) |
108 |
| - return -ETIMEDOUT; |
109 |
| - } |
| 93 | + msecs_to_jiffies(NOTIFICATION_TIMEOUT_MS)) == 0) |
| 94 | + return -ETIMEDOUT; |
110 | 95 |
|
111 | 96 | return 0;
|
112 | 97 | }
|
@@ -304,7 +289,7 @@ int snd_dice_stream_reserve_duplex(struct snd_dice *dice, unsigned int rate,
|
304 | 289 | // Just after owning the unit (GLOBAL_OWNER), the unit can
|
305 | 290 | // return invalid stream formats. Selecting clock parameters
|
306 | 291 | // have an effect for the unit to refine it.
|
307 |
| - err = ensure_phase_lock(dice, rate); |
| 292 | + err = select_clock(dice, rate); |
308 | 293 | if (err < 0)
|
309 | 294 | return err;
|
310 | 295 |
|
@@ -646,7 +631,7 @@ int snd_dice_stream_detect_current_formats(struct snd_dice *dice)
|
646 | 631 | * invalid stream formats. Selecting clock parameters have an effect
|
647 | 632 | * for the unit to refine it.
|
648 | 633 | */
|
649 |
| - err = ensure_phase_lock(dice, rate); |
| 634 | + err = select_clock(dice, rate); |
650 | 635 | if (err < 0)
|
651 | 636 | return err;
|
652 | 637 |
|
|
0 commit comments