ALSA: oxfw: code refactoring for wrong_dbs quirk
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 18 May 2021 08:45:56 +0000 (17:45 +0900)
committerTakashi Iwai <tiwai@suse.de>
Tue, 18 May 2021 10:24:08 +0000 (12:24 +0200)
A new entry is added to the quirk enumeration for wrong_dbs quirk to
obsolete structure member.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210518084557.102681-11-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/oxfw/oxfw-stream.c
sound/firewire/oxfw/oxfw.c
sound/firewire/oxfw/oxfw.h

index c06173f..5771ff4 100644 (file)
@@ -163,7 +163,7 @@ static int init_stream(struct snd_oxfw *oxfw, struct amdtp_stream *stream)
 
                if (oxfw->quirks & SND_OXFW_QUIRK_JUMBO_PAYLOAD)
                        flags |= CIP_JUMBO_PAYLOAD;
-               if (oxfw->wrong_dbs)
+               if (oxfw->quirks & SND_OXFW_QUIRK_WRONG_DBS)
                        flags |= CIP_WRONG_DBS;
        } else {
                conn = &oxfw->in_conn;
index 90a66e1..966697d 100644 (file)
@@ -176,7 +176,7 @@ static int detect_quirks(struct snd_oxfw *oxfw)
         * value in 'dbs' field of CIP header against its format information.
         */
        if (vendor == VENDOR_LOUD && model == MODEL_SATELLITE)
-               oxfw->wrong_dbs = true;
+               oxfw->quirks |= SND_OXFW_QUIRK_WRONG_DBS;
 
        return 0;
 }
index 07aa0d2..4002998 100644 (file)
@@ -36,6 +36,8 @@ enum snd_oxfw_quirk {
        // Postpone transferring packets during handling asynchronous transaction. As a result,
        // next isochronous packet includes more events than one packet can include.
        SND_OXFW_QUIRK_JUMBO_PAYLOAD = 0x01,
+       // The dbs field of CIP header in tx packet is wrong.
+       SND_OXFW_QUIRK_WRONG_DBS = 0x02,
 };
 
 /* This is an arbitrary number for convinience. */
@@ -51,7 +53,6 @@ struct snd_oxfw {
 
        // The combination of snd_oxfw_quirk enumeration-constants.
        unsigned int quirks;
-       bool wrong_dbs;
        bool has_output;
        bool has_input;
        u8 *tx_stream_formats[SND_OXFW_STREAM_FORMAT_ENTRIES];