Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoundWire: introduce controller_id #4616

Merged

Commits on Oct 5, 2023

  1. soundwire: bus: introduce controller_id

    The existing SoundWire support misses a clear Controller/Manager
    hiearchical definition to deal with all variants across SOC vendors.
    
    a) Intel platforms have one controller with 4 or more Managers.
    b) AMD platforms have two controllers with one Manager each, but due
    to BIOS issues use two different link_id values within the scope of a
    single controller.
    c) QCOM platforms have one or more controller with one Manager each.
    
    This patch adds a 'controller_id' which can be set by higher
    levels. If assigned to -1, the controller_id will be set to the
    system-unique IDA-assigned bus->id.
    
    The main change is that the bus->id is no longer used for any device
    name, which makes the definition completely predictable and not
    dependent on any enumeration order. The bus->id is only used to insert
    the Managers in the stream rt context.
    
    Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    plbossart committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    5516596 View commit details
    Browse the repository at this point in the history
  2. soundwire: fix initializing sysfs for same devices on different buses

    If same devices with same device IDs are present on different soundwire
    buses, the probe fails due to conflicting device names and sysfs
    entries:
    
      sysfs: cannot create duplicate filename '/bus/soundwire/devices/sdw:0:0217:0204:00:0'
    
    The link ID is 0 for both devices, so they should be differentiated by
    the controller ID. Add the controller ID so, the device names and sysfs entries look
    like:
    
      sdw:1:0:0217:0204:00:0 -> ../../../devices/platform/soc@0/6ab0000.soundwire-controller/sdw-master-1-0/sdw:1:0:0217:0204:00:0
      sdw:3:0:0217:0204:00:0 -> ../../../devices/platform/soc@0/6b10000.soundwire-controller/sdw-master-3-0/sdw:3:0:0217:0204:00:0
    
    [PLB changes: use bus->controller_id instead of bus->id]
    
    Fixes: 7c3cd18 ("soundwire: Add Master registration")
    Cc: <stable@vger.kernel.org>
    Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    krzk authored and plbossart committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    cdbc439 View commit details
    Browse the repository at this point in the history