~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/firewire/dice/dice-tcelectronic.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /sound/firewire/dice/dice-tcelectronic.c (Version linux-6.12-rc7) and /sound/firewire/dice/dice-tcelectronic.c (Version linux-5.18.19)


  1 // SPDX-License-Identifier: GPL-2.0                 1 // SPDX-License-Identifier: GPL-2.0
  2 /*                                                  2 /*
  3  * dice-tc_electronic.c - a part of driver for      3  * dice-tc_electronic.c - a part of driver for DICE based devices
  4  *                                                  4  *
  5  * Copyright (c) 2018 Takashi Sakamoto              5  * Copyright (c) 2018 Takashi Sakamoto
  6  */                                                 6  */
  7                                                     7 
  8 #include "dice.h"                                   8 #include "dice.h"
  9                                                     9 
 10 struct dice_tc_spec {                              10 struct dice_tc_spec {
 11         unsigned int tx_pcm_chs[MAX_STREAMS][S     11         unsigned int tx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT];
 12         unsigned int rx_pcm_chs[MAX_STREAMS][S     12         unsigned int rx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT];
 13         bool has_midi;                             13         bool has_midi;
 14 };                                                 14 };
 15                                                    15 
 16 static const struct dice_tc_spec desktop_konne     16 static const struct dice_tc_spec desktop_konnekt6 = {
 17         .tx_pcm_chs = {{6, 6, 2}, {0, 0, 0} },     17         .tx_pcm_chs = {{6, 6, 2}, {0, 0, 0} },
 18         .rx_pcm_chs = {{6, 6, 4}, {0, 0, 0} },     18         .rx_pcm_chs = {{6, 6, 4}, {0, 0, 0} },
 19         .has_midi = false,                         19         .has_midi = false,
 20 };                                                 20 };
 21                                                    21 
 22 static const struct dice_tc_spec impact_twin =     22 static const struct dice_tc_spec impact_twin = {
 23         .tx_pcm_chs = {{14, 10, 6}, {0, 0, 0}      23         .tx_pcm_chs = {{14, 10, 6}, {0, 0, 0} },
 24         .rx_pcm_chs = {{14, 10, 6}, {0, 0, 0}      24         .rx_pcm_chs = {{14, 10, 6}, {0, 0, 0} },
 25         .has_midi = true,                          25         .has_midi = true,
 26 };                                                 26 };
 27                                                    27 
 28 static const struct dice_tc_spec konnekt_8 = {     28 static const struct dice_tc_spec konnekt_8 = {
 29         .tx_pcm_chs = {{4, 4, 3}, {0, 0, 0} },     29         .tx_pcm_chs = {{4, 4, 3}, {0, 0, 0} },
 30         .rx_pcm_chs = {{4, 4, 3}, {0, 0, 0} },     30         .rx_pcm_chs = {{4, 4, 3}, {0, 0, 0} },
 31         .has_midi = true,                          31         .has_midi = true,
 32 };                                                 32 };
 33                                                    33 
 34 static const struct dice_tc_spec konnekt_24d =     34 static const struct dice_tc_spec konnekt_24d = {
 35         .tx_pcm_chs = {{16, 16, 6}, {0, 0, 0}      35         .tx_pcm_chs = {{16, 16, 6}, {0, 0, 0} },
 36         .rx_pcm_chs = {{16, 16, 6}, {0, 0, 0}      36         .rx_pcm_chs = {{16, 16, 6}, {0, 0, 0} },
 37         .has_midi = true,                          37         .has_midi = true,
 38 };                                                 38 };
 39                                                    39 
 40 static const struct dice_tc_spec konnekt_live      40 static const struct dice_tc_spec konnekt_live = {
 41         .tx_pcm_chs = {{16, 16, 6}, {0, 0, 0}      41         .tx_pcm_chs = {{16, 16, 6}, {0, 0, 0} },
 42         .rx_pcm_chs = {{16, 16, 6}, {0, 0, 0}      42         .rx_pcm_chs = {{16, 16, 6}, {0, 0, 0} },
 43         .has_midi = true,                          43         .has_midi = true,
 44 };                                                 44 };
 45                                                    45 
 46 static const struct dice_tc_spec studio_konnek     46 static const struct dice_tc_spec studio_konnekt_48 = {
 47         .tx_pcm_chs = {{16, 16, 8}, {16, 16, 7     47         .tx_pcm_chs = {{16, 16, 8}, {16, 16, 7} },
 48         .rx_pcm_chs = {{16, 16, 8}, {14, 14, 7     48         .rx_pcm_chs = {{16, 16, 8}, {14, 14, 7} },
 49         .has_midi = true,                          49         .has_midi = true,
 50 };                                                 50 };
 51                                                    51 
 52 static const struct dice_tc_spec digital_konne     52 static const struct dice_tc_spec digital_konnekt_x32 = {
 53         .tx_pcm_chs = {{16, 16, 4}, {0, 0, 0}      53         .tx_pcm_chs = {{16, 16, 4}, {0, 0, 0} },
 54         .rx_pcm_chs = {{16, 16, 4}, {0, 0, 0}      54         .rx_pcm_chs = {{16, 16, 4}, {0, 0, 0} },
 55         .has_midi = false,                         55         .has_midi = false,
 56 };                                                 56 };
 57                                                    57 
 58 int snd_dice_detect_tcelectronic_formats(struc     58 int snd_dice_detect_tcelectronic_formats(struct snd_dice *dice)
 59 {                                                  59 {
 60         static const struct {                      60         static const struct {
 61                 u32 model_id;                      61                 u32 model_id;
 62                 const struct dice_tc_spec *spe     62                 const struct dice_tc_spec *spec;
 63         } *entry, entries[] = {                    63         } *entry, entries[] = {
 64                 {0x00000020, &konnekt_24d},        64                 {0x00000020, &konnekt_24d},
 65                 {0x00000021, &konnekt_8},          65                 {0x00000021, &konnekt_8},
 66                 {0x00000022, &studio_konnekt_4     66                 {0x00000022, &studio_konnekt_48},
 67                 {0x00000023, &konnekt_live},       67                 {0x00000023, &konnekt_live},
 68                 {0x00000024, &desktop_konnekt6     68                 {0x00000024, &desktop_konnekt6},
 69                 {0x00000027, &impact_twin},        69                 {0x00000027, &impact_twin},
 70                 {0x00000030, &digital_konnekt_     70                 {0x00000030, &digital_konnekt_x32},
 71         };                                         71         };
 72         struct fw_csr_iterator it;                 72         struct fw_csr_iterator it;
 73         int key, val, model_id;                    73         int key, val, model_id;
 74         int i;                                     74         int i;
 75                                                    75 
 76         model_id = 0;                              76         model_id = 0;
 77         fw_csr_iterator_init(&it, dice->unit->     77         fw_csr_iterator_init(&it, dice->unit->directory);
 78         while (fw_csr_iterator_next(&it, &key,     78         while (fw_csr_iterator_next(&it, &key, &val)) {
 79                 if (key == CSR_MODEL) {            79                 if (key == CSR_MODEL) {
 80                         model_id = val;            80                         model_id = val;
 81                         break;                     81                         break;
 82                 }                                  82                 }
 83         }                                          83         }
 84                                                    84 
 85         for (i = 0; i < ARRAY_SIZE(entries); +     85         for (i = 0; i < ARRAY_SIZE(entries); ++i) {
 86                 entry = entries + i;               86                 entry = entries + i;
 87                 if (entry->model_id == model_i     87                 if (entry->model_id == model_id)
 88                         break;                     88                         break;
 89         }                                          89         }
 90         if (i == ARRAY_SIZE(entries))              90         if (i == ARRAY_SIZE(entries))
 91                 return -ENODEV;                    91                 return -ENODEV;
 92                                                    92 
 93         memcpy(dice->tx_pcm_chs, entry->spec->     93         memcpy(dice->tx_pcm_chs, entry->spec->tx_pcm_chs,
 94                MAX_STREAMS * SND_DICE_RATE_MOD     94                MAX_STREAMS * SND_DICE_RATE_MODE_COUNT * sizeof(unsigned int));
 95         memcpy(dice->rx_pcm_chs, entry->spec->     95         memcpy(dice->rx_pcm_chs, entry->spec->rx_pcm_chs,
 96                MAX_STREAMS * SND_DICE_RATE_MOD     96                MAX_STREAMS * SND_DICE_RATE_MODE_COUNT * sizeof(unsigned int));
 97                                                    97 
 98         if (entry->spec->has_midi) {               98         if (entry->spec->has_midi) {
 99                 dice->tx_midi_ports[0] = 1;        99                 dice->tx_midi_ports[0] = 1;
100                 dice->rx_midi_ports[0] = 1;       100                 dice->rx_midi_ports[0] = 1;
101         }                                         101         }
102                                                   102 
103         return 0;                                 103         return 0;
104 }                                                 104 }
105                                                   105 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php