Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion sound/soc/codecs/tas2783-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_registers.h>
#include <linux/soundwire/sdw_type.h>
#include <linux/pci.h>
#include <sound/sdca_function.h>
#include <sound/sdw.h>
#include <sound/soc.h>
Expand Down Expand Up @@ -1171,15 +1172,35 @@ static const struct dev_pm_ops tas2783_sdca_pm = {
RUNTIME_PM_OPS(tas2783_sdca_dev_suspend, tas2783_sdca_dev_resume, NULL)
};

static struct pci_dev *tas_get_pci_dev(struct sdw_slave *peripheral)
{
struct device *dev = &peripheral->dev;

for (; dev; dev = dev->parent)
if (dev->bus == &pci_bus_type)
return to_pci_dev(dev);

return NULL;
}

static s32 tas_io_init(struct device *dev, struct sdw_slave *slave)
{
struct pci_dev *pci;
struct sdw_bus *bus;
struct tas2783_prv *tas_dev = dev_get_drvdata(dev);
s32 ret;
u8 unique_id = tas_dev->sdw_peripheral->id.unique_id;

if (tas_dev->hw_init)
return 0;

pci = tas_get_pci_dev(slave);
if (!pci) {
dev_err(dev, "pci device id can't be read");
return -EINVAL;
}

bus = slave->bus;
Comment thread
ranj063 marked this conversation as resolved.
tas_dev->fw_dl_task_done = false;
tas_dev->fw_dl_success = false;

Expand All @@ -1190,8 +1211,10 @@ static s32 tas_io_init(struct device *dev, struct sdw_slave *slave)
}
usleep_range(2000, 2200);

/* subsystem_id-link_id-unique_id */
scnprintf(tas_dev->rca_binaryname, sizeof(tas_dev->rca_binaryname),
"tas2783-%01x.bin", unique_id);
"%04X-%1X-%1X.bin", pci->subsystem_device, bus->link_id,
unique_id);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charleskeepax submitted the Add SDCA UMP/FDL support series. Maybe you can use the FDL function, too?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao
Due to compatibility reasons with windows project, we will be using custom firmware binary file for tas2783A.
We will switch to the FDL FSM for new devices.


ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT,
tas_dev->rca_binaryname, tas_dev->dev,
Expand Down