-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASoC: Intel: avs: Expose FW version with sysfs
Add functionality to read version of loaded FW from sysfs. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20240209085256.121261-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
- Loading branch information
Cezary Rojewski
authored and
Mark Brown
committed
Feb 9, 2024
1 parent
4089d82
commit f7fc624
Showing
5 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
What: /sys/devices/pci0000:00/<dev>/avs/fw_version | ||
Date: February 2024 | ||
Contact: Cezary Rojewski <cezary.rojewski@intel.com> | ||
Description: | ||
Version of AudioDSP firmware ASoC avs driver is communicating | ||
with. | ||
|
||
Format: %d.%d.%d.%d, type:major:minor:build. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
// | ||
// Copyright(c) 2021-2024 Intel Corporation. All rights reserved. | ||
// | ||
// Authors: Cezary Rojewski <cezary.rojewski@intel.com> | ||
// Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com> | ||
// | ||
|
||
#include <linux/sysfs.h> | ||
#include "avs.h" | ||
|
||
static ssize_t fw_version_show(struct device *dev, struct device_attribute *attr, char *buf) | ||
{ | ||
struct avs_dev *adev = to_avs_dev(dev); | ||
struct avs_fw_version *fw_version = &adev->fw_cfg.fw_version; | ||
|
||
return sysfs_emit(buf, "%d.%d.%d.%d\n", fw_version->major, fw_version->minor, | ||
fw_version->hotfix, fw_version->build); | ||
} | ||
static DEVICE_ATTR_RO(fw_version); | ||
|
||
static struct attribute *avs_fw_attrs[] = { | ||
&dev_attr_fw_version.attr, | ||
NULL | ||
}; | ||
|
||
static const struct attribute_group avs_attr_group = { | ||
.name = "avs", | ||
.attrs = avs_fw_attrs, | ||
}; | ||
|
||
const struct attribute_group *avs_attr_groups[] = { | ||
&avs_attr_group, | ||
NULL | ||
}; |