03 Sep, 2020

1 commit

  • The existing code allocates memory for the total number of ports.
    This only works if the ports are contiguous, but will break if e.g. a
    Devices uses port0, 1, and 14. The port_ready[] array would contain 3
    elements, which would lead to an out-of-bounds access. Conversely in
    other cases, the wrong port index would be used leading to timeouts on
    prepare.

    This can be fixed by allocating for the worst-case of 15
    ports (DP0..DP14). In addition since the number is now fixed, we can
    use an array instead of a dynamic allocation.

    Signed-off-by: Pierre-Louis Bossart
    Signed-off-by: Bard Liao
    Reviewed-by: Rander Wang
    Reviewed-by: Guennadi Liakhovetski
    Link: https://lore.kernel.org/r/20200831134318.11443-4-yung-chuan.liao@linux.intel.com
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     

20 May, 2020

1 commit

  • Use more meaningful member names in preparation for sysfs support.
    No functionality change.

    Signed-off-by: Pierre-Louis Bossart
    Signed-off-by: Bard Liao
    Link: https://lore.kernel.org/r/20200518203551.2053-2-yung-chuan.liao@linux.intel.com
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     

02 Aug, 2019

1 commit


27 May, 2019

4 commits

  • The existing definitions are ambiguous and possibly misleading.

    For DP0, 'flow-control' is only relevant for the BRA protocol and
    should not be confused with async modes explicitly not supported for
    DP0, add prefix to follow MIPI DisCo definition

    The use of 'device_interrupts' is also questionable. The MIPI
    SoundWire spec defines Slave-, DP0- and DPN-level
    implementation-defined interrupts. Using the 'device' prefix in the
    last two cases is misleading, not only is the term 'device' overloaded
    but these properties are only valid at the DP0 and DPn levels. Rename
    to follow the MIPI definitions, no need to be creative here.

    Signed-off-by: Pierre-Louis Bossart
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     
  • Fix support for clock_stop_mode0 and 1. The existing code uses a
    bitmask between enums, one of which being zero. Or-ing with zero is
    not very useful in general...Fix by or-ing with a BIT dependent on the
    enum value.

    Signed-off-by: Pierre-Louis Bossart
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     
  • Rename all fields with 'freq' as 'clk_freq' to follow the MIPI
    specification and avoid confusion between bus clock and audio clocks.

    No functionality change.

    Signed-off-by: Pierre-Louis Bossart
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     
  • The MIPI DisCo specification for SoundWire defines the
    "mipi-sdw-link-N-subproperties" for slaves and
    "mipi-sdw-master-N-subproperties" for controllers. This is a mistake
    that was not identified until now.

    Existing Intel DSDT tables use 'link' everywhere, and the MIPI spec
    will be updated to deprecate "mipi-sdw-master-N-subproperties"

    Fix to parse firmware information on existing devices. If we ever see
    a system with 'master-N-subproperties' I guess we'll have to try both.

    Signed-off-by: Pierre-Louis Bossart
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     

02 May, 2019

3 commits


19 Dec, 2017

1 commit

  • MIPI Discovery And Configuration (DisCo) Specification for SoundWire
    specifies properties to be implemented for SoundWire Masters and
    Slaves. The DisCo spec doesn't mandate these properties. However,
    SDW bus cannot work without knowing these values.

    The helper functions read the Master and Slave properties.
    Implementers of Master or Slave drivers can use any of the below
    three mechanisms:
    a) Use these APIs here as .read_prop() callback for Master
    and Slave
    b) Implement own methods and set those as .read_prop(), but invoke
    APIs in this file for generic read and override the values with
    platform specific data
    c) Implement ones own methods which do not use anything provided
    here

    Signed-off-by: Sanyog Kale
    Reviewed-by: Philippe Ombredanne
    Acked-By: Pierre-Louis Bossart
    Reviewed-by: Takashi Iwai
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Vinod Koul