Skip to content

[TEST] soundwire: properly assign ACPI_COMPANION - #2630

Closed
plbossart wants to merge 1 commit into
thesofproject:topic/sof-devfrom
plbossart:sdw/fix-acpi-companion
Closed

plbossart wants to merge 1 commit into
thesofproject:topic/sof-devfrom
plbossart:sdw/fix-acpi-companion

Conversation

@plbossart

Copy link
Copy Markdown
Member

We never used ACPI_SET_COMPANION which is used by others, e.g. I2C
adapters.

Suggested-by: Andy Shevchenko andriy.shevchenko@linux.intel.com
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com

We never used ACPI_SET_COMPANION which is used by others, e.g. I2C
adapters.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart

Copy link
Copy Markdown
Member Author

testing suggestion of @andy-shev in #2616 (comment)

@plbossart plbossart changed the title soundwire: properly assign ACPI_COMPANION [TEST] soundwire: properly assign ACPI_COMPANION Dec 11, 2020
@plbossart
plbossart requested a review from bardliao December 11, 2020 20:51
@bardliao

Copy link
Copy Markdown
Collaborator

@plbossart I tested it and it worked with two changes

  1. It is not needed for platform devices
  2. It is needed for codec devices.
--- a/drivers/soundwire/slave.c
+++ b/drivers/soundwire/slave.c
@@ -61,6 +61,7 @@ int sdw_slave_add(struct sdw_bus *bus,
        init_completion(&slave->probe_complete);
        slave->probed = false;
        slave->first_interrupt_done = false;
+       ACPI_COMPANION_SET(&slave->dev, ACPI_COMPANION(bus->dev));

        for (i = 0; i < SDW_MAX_PORTS; i++)
                init_completion(&slave->port_ready[i]);

@bardliao

Copy link
Copy Markdown
Collaborator

@plbossart I tested it and it worked with two changes

  1. It is not needed for platform devices
  2. It is needed for codec devices.
--- a/drivers/soundwire/slave.c
+++ b/drivers/soundwire/slave.c
@@ -61,6 +61,7 @@ int sdw_slave_add(struct sdw_bus *bus,
        init_completion(&slave->probe_complete);
        slave->probed = false;
        slave->first_interrupt_done = false;
+       ACPI_COMPANION_SET(&slave->dev, ACPI_COMPANION(bus->dev));

        for (i = 0; i < SDW_MAX_PORTS; i++)
                init_completion(&slave->port_ready[i]);

Sorry @plbossart I have to revise my commit. We need to set ACPI_COMPANION_SET(&slave->dev, ACPI_COMPANION(&slave->dev)); here since Slave devices are real devices. And I think we still need ACPI_COMPANION_SET() here, otherwise, set_primary_fwnode(dev, fwnode) will not be called.

@plbossart

Copy link
Copy Markdown
Member Author

replaced by PR #2625

@plbossart plbossart closed this Dec 14, 2020
@andy-shev

andy-shev commented Dec 15, 2020 •

Copy link
Copy Markdown

We need to set ACPI_COMPANION_SET(&slave->dev, ACPI_COMPANION(&slave->dev));

This make no sense. It's a no-op.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants