These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / sound / firewire / bebob / bebob_maudio.c
index 9ee25a6..07e5abd 100644 (file)
@@ -340,9 +340,12 @@ end:
 }
 
 /* Clock source control for special firmware */
-static const char *const special_clk_labels[] = {
-       SND_BEBOB_CLOCK_INTERNAL " with Digital Mute", "Digital",
-       "Word Clock", SND_BEBOB_CLOCK_INTERNAL};
+static enum snd_bebob_clock_type special_clk_types[] = {
+       SND_BEBOB_CLOCK_TYPE_INTERNAL,  /* With digital mute */
+       SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* SPDIF/ADAT */
+       SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* Word Clock */
+       SND_BEBOB_CLOCK_TYPE_INTERNAL,
+};
 static int special_clk_get(struct snd_bebob *bebob, unsigned int *id)
 {
        struct special_params *params = bebob->maudio_special_quirk;
@@ -352,7 +355,13 @@ static int special_clk_get(struct snd_bebob *bebob, unsigned int *id)
 static int special_clk_ctl_info(struct snd_kcontrol *kctl,
                                struct snd_ctl_elem_info *einf)
 {
-       return snd_ctl_enum_info(einf, 1, ARRAY_SIZE(special_clk_labels),
+       static const char *const special_clk_labels[] = {
+               "Internal with Digital Mute",
+               "Digital",
+               "Word Clock",
+               "Internal"
+       };
+       return snd_ctl_enum_info(einf, 1, ARRAY_SIZE(special_clk_types),
                                 special_clk_labels);
 }
 static int special_clk_ctl_get(struct snd_kcontrol *kctl,
@@ -371,7 +380,7 @@ static int special_clk_ctl_put(struct snd_kcontrol *kctl,
        int err, id;
 
        id = uval->value.enumerated.item[0];
-       if (id >= ARRAY_SIZE(special_clk_labels))
+       if (id >= ARRAY_SIZE(special_clk_types))
                return -EINVAL;
 
        mutex_lock(&bebob->mutex);
@@ -619,7 +628,7 @@ static const char *const special_meter_labels[] = {
 static int
 special_meter_get(struct snd_bebob *bebob, u32 *target, unsigned int size)
 {
-       u16 *buf;
+       __be16 *buf;
        unsigned int i, c, channels;
        int err;
 
@@ -678,7 +687,7 @@ static const char *const nrv10_meter_labels[] = {
 static int
 normal_meter_get(struct snd_bebob *bebob, u32 *buf, unsigned int size)
 {
-       struct snd_bebob_meter_spec *spec = bebob->spec->meter;
+       const struct snd_bebob_meter_spec *spec = bebob->spec->meter;
        unsigned int c, channels;
        int err;
 
@@ -703,85 +712,85 @@ end:
 }
 
 /* for special customized devices */
-static struct snd_bebob_rate_spec special_rate_spec = {
+static const struct snd_bebob_rate_spec special_rate_spec = {
        .get    = &special_get_rate,
        .set    = &special_set_rate,
 };
-static struct snd_bebob_clock_spec special_clk_spec = {
-       .num    = ARRAY_SIZE(special_clk_labels),
-       .labels = special_clk_labels,
+static const struct snd_bebob_clock_spec special_clk_spec = {
+       .num    = ARRAY_SIZE(special_clk_types),
+       .types  = special_clk_types,
        .get    = &special_clk_get,
 };
-static struct snd_bebob_meter_spec special_meter_spec = {
+static const struct snd_bebob_meter_spec special_meter_spec = {
        .num    = ARRAY_SIZE(special_meter_labels),
        .labels = special_meter_labels,
        .get    = &special_meter_get
 };
-struct snd_bebob_spec maudio_special_spec = {
+const struct snd_bebob_spec maudio_special_spec = {
        .clock  = &special_clk_spec,
        .rate   = &special_rate_spec,
        .meter  = &special_meter_spec
 };
 
 /* Firewire 410 specification */
-static struct snd_bebob_rate_spec usual_rate_spec = {
+static const struct snd_bebob_rate_spec usual_rate_spec = {
        .get    = &snd_bebob_stream_get_rate,
        .set    = &snd_bebob_stream_set_rate,
 };
-static struct snd_bebob_meter_spec fw410_meter_spec = {
+static const struct snd_bebob_meter_spec fw410_meter_spec = {
        .num    = ARRAY_SIZE(fw410_meter_labels),
        .labels = fw410_meter_labels,
        .get    = &normal_meter_get
 };
-struct snd_bebob_spec maudio_fw410_spec = {
+const struct snd_bebob_spec maudio_fw410_spec = {
        .clock  = NULL,
        .rate   = &usual_rate_spec,
        .meter  = &fw410_meter_spec
 };
 
 /* Firewire Audiophile specification */
-static struct snd_bebob_meter_spec audiophile_meter_spec = {
+static const struct snd_bebob_meter_spec audiophile_meter_spec = {
        .num    = ARRAY_SIZE(audiophile_meter_labels),
        .labels = audiophile_meter_labels,
        .get    = &normal_meter_get
 };
-struct snd_bebob_spec maudio_audiophile_spec = {
+const struct snd_bebob_spec maudio_audiophile_spec = {
        .clock  = NULL,
        .rate   = &usual_rate_spec,
        .meter  = &audiophile_meter_spec
 };
 
 /* Firewire Solo specification */
-static struct snd_bebob_meter_spec solo_meter_spec = {
+static const struct snd_bebob_meter_spec solo_meter_spec = {
        .num    = ARRAY_SIZE(solo_meter_labels),
        .labels = solo_meter_labels,
        .get    = &normal_meter_get
 };
-struct snd_bebob_spec maudio_solo_spec = {
+const struct snd_bebob_spec maudio_solo_spec = {
        .clock  = NULL,
        .rate   = &usual_rate_spec,
        .meter  = &solo_meter_spec
 };
 
 /* Ozonic specification */
-static struct snd_bebob_meter_spec ozonic_meter_spec = {
+static const struct snd_bebob_meter_spec ozonic_meter_spec = {
        .num    = ARRAY_SIZE(ozonic_meter_labels),
        .labels = ozonic_meter_labels,
        .get    = &normal_meter_get
 };
-struct snd_bebob_spec maudio_ozonic_spec = {
+const struct snd_bebob_spec maudio_ozonic_spec = {
        .clock  = NULL,
        .rate   = &usual_rate_spec,
        .meter  = &ozonic_meter_spec
 };
 
 /* NRV10 specification */
-static struct snd_bebob_meter_spec nrv10_meter_spec = {
+static const struct snd_bebob_meter_spec nrv10_meter_spec = {
        .num    = ARRAY_SIZE(nrv10_meter_labels),
        .labels = nrv10_meter_labels,
        .get    = &normal_meter_get
 };
-struct snd_bebob_spec maudio_nrv10_spec = {
+const struct snd_bebob_spec maudio_nrv10_spec = {
        .clock  = NULL,
        .rate   = &usual_rate_spec,
        .meter  = &nrv10_meter_spec