mbox series

[00/14] ALSA: firewire-motu: code refactoring to obsolete protocol structure

Message ID 20200519111641.123211-1-o-takashi@sakamocchi.jp (mailing list archive)
Headers show
Series ALSA: firewire-motu: code refactoring to obsolete protocol structure | expand

Message

Takashi Sakamoto May 19, 2020, 11:16 a.m. UTC
Hi,

ALSA firewire-motu driver becomes to support more models since its first
commit 2017. As a result, the original structure for generation-dependent
protocol is not suitable for differences between models in some cases.

This patchset is for refactoring the driver to obsolete the protocol
structure. Some helper functions are added with condition statement for
protocol version so that the function calls protocol-dependent function.
Instead of the protocol structure, specification structure is used to
represent model information and to choose model-dependent operation so
that it's easy to handle model-dependent quirks.

Additionally, this patchset changes the way to calculate the number of
chunks in data block. Current implementation calculates by the fixed
number of analog input/output ports and flags in the specification
structure. Although the flags can represent any physical input/output
of the model, it's difficult to debug for supported model and to add
support new models, especially for model-dependent quirks. This
patchset adds each table for the fixed number of chunks of each model.
The calculation is just done for differed part of chunks.

Takashi Sakamoto (14):
  ALSA: firewire-motu: move spec data to v2 protocol file
  ALSA: firewire-motu: move spec data to v3 protocol file
  ALSA: firewire-motu: localize protocol data
  ALSA: firewire-motu: add wrapper functions for protocol-dependent
    operations
  ALSA: firewire-motu: drop protocol structure
  ALSA: firewire-motu: add model-specific table of chunk count
  ALSA: firewire-motu: add alternative functions to detect packet format
    for protocol v2
  ALSA: firewire-motu: add alternative functions to detect packet format
    for protocol v3
  ALSA: firewire-motu: use table-based calculation of packet formats for
    proc
  ALSA: firewire-motu: use table-based calculation of packet formats for
    stream management
  ALSA: firewire-motu: remove obsoleted codes
  ALSA: firewire-motu: refactoring protocol v2 for clock source getter
  ALSA: firewire-motu: refactoring protocol v3 for clock source getter
  ALSA: firewire-motu: refactoring protocol v2 for fetching mode switch

 sound/firewire/motu/amdtp-motu.c       |  19 +-
 sound/firewire/motu/motu-pcm.c         |  14 +-
 sound/firewire/motu/motu-proc.c        |  20 +-
 sound/firewire/motu/motu-protocol-v2.c | 314 +++++++++++++++----------
 sound/firewire/motu/motu-protocol-v3.c | 303 ++++++++++++------------
 sound/firewire/motu/motu-stream.c      |  16 +-
 sound/firewire/motu/motu.c             | 113 +--------
 sound/firewire/motu/motu.h             | 124 +++++++---
 8 files changed, 463 insertions(+), 460 deletions(-)

Comments

Takashi Iwai May 22, 2020, 2:53 p.m. UTC | #1
On Tue, 19 May 2020 13:16:27 +0200,
Takashi Sakamoto wrote:
> 
> Hi,
> 
> ALSA firewire-motu driver becomes to support more models since its first
> commit 2017. As a result, the original structure for generation-dependent
> protocol is not suitable for differences between models in some cases.
> 
> This patchset is for refactoring the driver to obsolete the protocol
> structure. Some helper functions are added with condition statement for
> protocol version so that the function calls protocol-dependent function.
> Instead of the protocol structure, specification structure is used to
> represent model information and to choose model-dependent operation so
> that it's easy to handle model-dependent quirks.
> 
> Additionally, this patchset changes the way to calculate the number of
> chunks in data block. Current implementation calculates by the fixed
> number of analog input/output ports and flags in the specification
> structure. Although the flags can represent any physical input/output
> of the model, it's difficult to debug for supported model and to add
> support new models, especially for model-dependent quirks. This
> patchset adds each table for the fixed number of chunks of each model.
> The calculation is just done for differed part of chunks.
> 
> Takashi Sakamoto (14):
>   ALSA: firewire-motu: move spec data to v2 protocol file
>   ALSA: firewire-motu: move spec data to v3 protocol file
>   ALSA: firewire-motu: localize protocol data
>   ALSA: firewire-motu: add wrapper functions for protocol-dependent
>     operations
>   ALSA: firewire-motu: drop protocol structure
>   ALSA: firewire-motu: add model-specific table of chunk count
>   ALSA: firewire-motu: add alternative functions to detect packet format
>     for protocol v2
>   ALSA: firewire-motu: add alternative functions to detect packet format
>     for protocol v3
>   ALSA: firewire-motu: use table-based calculation of packet formats for
>     proc
>   ALSA: firewire-motu: use table-based calculation of packet formats for
>     stream management
>   ALSA: firewire-motu: remove obsoleted codes
>   ALSA: firewire-motu: refactoring protocol v2 for clock source getter
>   ALSA: firewire-motu: refactoring protocol v3 for clock source getter
>   ALSA: firewire-motu: refactoring protocol v2 for fetching mode switch

Applied all 14 patches now to for-next branch.


thanks,

Takashi