-
Notifications
You must be signed in to change notification settings - Fork 140
Tas2783a 4ch newbin1 #5569
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
base: topic/sof-dev
Are you sure you want to change the base?
Tas2783a 4ch newbin1 #5569
Changes from 1 commit
b0c39f2
6f0b47b
ed73984
9b5ed96
e6fe84e
c458b92
bc01d50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
The firmware file for tas2783A contains the device and algorithm settings. So the firmware files are unique for a system and driver should have the ability to distinctly identify and pick the right firmware. This commit adds the method to uniquely identify the firmware for a system based on the below format. <Subsystem>-<Link>-<Unique>.bin * Subsystem is the PCI device subsystem-id * Link is the SoundWire link id on which the device recides. * Unique is the SoundWire slave unique id in the system. Signed-off-by: Niranjan H Y <niranjan.hy@ti.com> --- v2: - rename get_hwid to get_pci_dev - update commit message
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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> | ||
|
|
@@ -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; | ||
| tas_dev->fw_dl_task_done = false; | ||
| tas_dev->fw_dl_success = false; | ||
|
|
||
|
|
@@ -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); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bardliao |
||
|
|
||
| ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, | ||
| tas_dev->rca_binaryname, tas_dev->dev, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.