Skip to content

refine the code of read/write HDA registers  #941

Closed

Description

@zhuyingjiang

There are 4 ways used to read/write HDA registers in current code,
1: the HDA lib code with prefix snd_hdac_ head macro defines
2: the HDA lib code with prefix snd_hdac_ in C files
3: the SOF defined function with prefix snd_sof_dsp_
4: directly read/write the registers
Currently, the 4 ways are all used in the code, we need to simplify this to make the read/write consistence, to make code more readable.
Some discussions are already in #877.
From Pierre:

if SND_SOC_SOF_HDA is not defined, we shall not use any code from the hdac library. We may use structures from include files (as done for streams).

If SND_SOC_SOF_HDA is defined, we may use code from the hdac library, but if we already have code in SOF we should be consistent and use this only. In other words, the SOF code is trying to be self-contained and use the hdac library only if strictly necessary

From Keyon:

we should use snd_hdac_() version in all possible places, as those snd_hdac_() are all headers only, the io_ops implementation is in our hda_bus.c.

As we aligned before SOF HDA/HDMI implemented last year, we came out to that we can use hdac library header files for both I2S(BSD) and HDA/HDMI(GPL), since we have already used snd_hdac_() inside hdac library(during invoking hdac APIs), so I suggest changing to use this unified interface in our sof hda related registers read/write operations, for both I2S and HDA/HDMI cases

let's continue this topic here.

Activity

  1. plbossart commented on May 14, 2019

    @plbossart
    Member

    I don't understand @keyonjie 's proposal. It makes no sense to re-implement the same functions with a different license, it's completely unmaintainable.

  2. zhuyingjiang commented on May 15, 2019

    @zhuyingjiang
    Author

    @lgirdwood Could you provide your comments. Or I will mark this as won't fix.

  3. plbossart commented on May 15, 2019

    @plbossart
    Member

    how about @keyonjie explains his views? It's not very helpful to have a one-way conversation.

  4. mengdonglin commented on May 16, 2019

    @mengdonglin

    Paste @keyonjie 's previous comments for further discussion:
    #877 (comment)

    "Hi @plbossart IMHO, we should use snd_hdac_() version in all possible places, as those snd_hdac_() are all headers only, the io_ops implementation is in our hda_bus.c.

    As we aligned before SOF HDA/HDMI implemented last year, we came out to that we can use hdac library header files for both I2S(BSD) and HDA/HDMI(GPL), since we have already used snd_hdac_() inside hdac library(during invoking hdac APIs), so I suggest changing to use this unified interface in our sof hda related registers read/write operations, for both I2S and HDA/HDMI cases."

  5. self-assigned this
    on May 16, 2019
  6. plbossart commented on May 16, 2019

    @plbossart
    Member

    @keyonjie are you seriously recommending using the same interface with TWO implementations using TWO licenses?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions