| 696 | /* The way the rate is managed is the same across G2 and G3 devices, |
---|

| 697 | * but the actual bits used in the clock control register is different. |
---|

| 698 | */ |
---|

| 699 | if (getDeviceGeneration() == MOTU_DEVICE_G2) { |
---|

| 700 | rate_base_mask = MOTU_RATE_BASE_MASK; |
---|

| 701 | rate_base48k = MOTU_RATE_BASE_48000; |
---|

| 702 | rate_mult_mask = MOTU_RATE_MULTIPLIER_MASK; |
---|

| 703 | rate_mult2 = MOTU_RATE_MULTIPLIER_2X; |
---|

| 704 | rate_mult4 = MOTU_RATE_MULTIPLIER_4X; |
---|

| 705 | } else { |
---|

| 706 | rate_base_mask = MOTU_G3_RATE_BASE_MASK; |
---|

| 707 | rate_base48k = MOTU_G3_RATE_BASE_48000; |
---|

| 708 | rate_mult_mask = MOTU_G3_RATE_MULTIPLIER_MASK; |
---|

| 709 | rate_mult2 = MOTU_G3_RATE_MULTIPLIER_2X; |
---|

| 710 | rate_mult4 = MOTU_G3_RATE_MULTIPLIER_4X; |
---|

| 711 | } |
---|

| 712 | |
---|

695 | | switch (q & MOTU_RATE_BASE_MASK) { |
---|

696 | | case MOTU_RATE_BASE_44100: |
---|

697 | | rate = 44100; |
---|

698 | | break; |
---|

699 | | case MOTU_RATE_BASE_48000: |
---|

700 | | rate = 48000; |
---|

701 | | break; |
---|

702 | | } |
---|

703 | | switch (q & MOTU_RATE_MULTIPLIER_MASK) { |
---|

704 | | case MOTU_RATE_MULTIPLIER_2X: |
---|

705 | | rate *= 2; |
---|

706 | | break; |
---|

707 | | case MOTU_RATE_MULTIPLIER_4X: |
---|

708 | | rate *= 4; |
---|

709 | | break; |
---|

710 | | } |
---|

| 714 | if ((q & rate_base_mask) == rate_base48k) |
---|

| 715 | rate = 48000; |
---|

| 716 | else |
---|

| 717 | rate = 44100; |
---|

| 718 | if ((q & rate_mult_mask) == rate_mult4) |
---|

| 719 | rate *= 4; |
---|

| 720 | else |
---|

| 721 | if ((q & rate_mult_mask) == rate_mult2) |
---|

| 722 | rate *= 2; |
---|

| 723 | |
---|