Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52708d05 authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branch 'asoc/topic/intel' into asoc-next

parents 14eec477 c1aee1d8
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
What:		/sys/devices/platform/8086%x:00/firmware_version
Date:		November 2016
KernelVersion:	4.10
Contact:	"Sebastien Guiriec" <sebastien.guiriec@intel.com>
Description:
		LPE Firmware version for SST driver on all atom
		plaforms (BYT/CHT/Merrifield/BSW).
		If the FW has never been loaded it will display:
			"FW not yet loaded"
		If FW has been loaded it will display:
			"v01.aa.bb.cc"
		aa: Major version is reflecting SoC version:
			0d: BYT FW
			0b: BSW FW
			07: Merrifield FW
		bb: Minor version
		cc: Build version
+7 −1
Original line number Diff line number Diff line
@@ -157,6 +157,10 @@
 *
 * %SKL_TKN_STR_LIB_NAME:       Specifies the library name
 *
 * %SKL_TKN_U32_PMODE:		Specifies the power mode for pipe
 *
 * %SKL_TKL_U32_D0I3_CAPS:	Specifies the D0i3 capability for module
 *
 * module_id and loadable flags dont have tokens as these values will be
 * read from the DSP FW manifest
 */
@@ -208,7 +212,9 @@ enum SKL_TKNS {
	SKL_TKN_U32_PROC_DOMAIN,
	SKL_TKN_U32_LIB_COUNT,
	SKL_TKN_STR_LIB_NAME,
	SKL_TKN_MAX = SKL_TKN_STR_LIB_NAME,
	SKL_TKN_U32_PMODE,
	SKL_TKL_U32_D0I3_CAPS,
	SKL_TKN_MAX = SKL_TKL_U32_D0I3_CAPS,
};

#endif
+1 −1
Original line number Diff line number Diff line
@@ -937,7 +937,7 @@ int send_ssp_cmd(struct snd_soc_dai *dai, const char *id, bool enable)
	struct sst_data *drv = snd_soc_dai_get_drvdata(dai);
	int ssp_id;

	dev_info(dai->dev, "Enter: enable=%d port_name=%s\n", enable, id);
	dev_dbg(dai->dev, "Enter: enable=%d port_name=%s\n", enable, id);

	if (strcmp(id, "ssp0-port") == 0)
		ssp_id = SSP_MODEM;
+39 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <linux/pm_qos.h>
#include <linux/async.h>
#include <linux/acpi.h>
#include <linux/sysfs.h>
#include <sound/core.h>
#include <sound/soc.h>
#include <asm/platform_sst_audio.h>
@@ -242,6 +243,32 @@ int sst_alloc_drv_context(struct intel_sst_drv **ctx,
}
EXPORT_SYMBOL_GPL(sst_alloc_drv_context);

static ssize_t firmware_version_show(struct device *dev,
			    struct device_attribute *attr, char *buf)
{
	struct intel_sst_drv *ctx = dev_get_drvdata(dev);

	if (ctx->fw_version.type == 0 && ctx->fw_version.major == 0 &&
	    ctx->fw_version.minor == 0 && ctx->fw_version.build == 0)
		return sprintf(buf, "FW not yet loaded\n");
	else
		return sprintf(buf, "v%02x.%02x.%02x.%02x\n",
			       ctx->fw_version.type, ctx->fw_version.major,
			       ctx->fw_version.minor, ctx->fw_version.build);

}

DEVICE_ATTR_RO(firmware_version);

static const struct attribute *sst_fw_version_attrs[] = {
	&dev_attr_firmware_version.attr,
	NULL,
};

static const struct attribute_group sst_fw_version_attr_group = {
	.attrs = (struct attribute **)sst_fw_version_attrs,
};

int sst_context_init(struct intel_sst_drv *ctx)
{
	int ret = 0, i;
@@ -315,8 +342,19 @@ int sst_context_init(struct intel_sst_drv *ctx)
		dev_err(ctx->dev, "Firmware download failed:%d\n", ret);
		goto do_free_mem;
	}

	ret = sysfs_create_group(&ctx->dev->kobj,
				 &sst_fw_version_attr_group);
	if (ret) {
		dev_err(ctx->dev,
			"Unable to create sysfs\n");
		goto err_sysfs;
	}

	sst_register(ctx->dev);
	return 0;
err_sysfs:
	sysfs_remove_group(&ctx->dev->kobj, &sst_fw_version_attr_group);

do_free_mem:
	destroy_workqueue(ctx->post_msg_wq);
@@ -330,6 +368,7 @@ void sst_context_cleanup(struct intel_sst_drv *ctx)
	pm_runtime_disable(ctx->dev);
	sst_unregister(ctx->dev);
	sst_set_fw_state_locked(ctx, SST_SHUTDOWN);
	sysfs_remove_group(&ctx->dev->kobj, &sst_fw_version_attr_group);
	flush_scheduled_work();
	destroy_workqueue(ctx->post_msg_wq);
	pm_qos_remove_request(ctx->qos);
+1 −0
Original line number Diff line number Diff line
@@ -436,6 +436,7 @@ struct intel_sst_drv {
	 */
	char firmware_name[FW_NAME_SIZE];

	struct snd_sst_fw_version fw_version;
	struct sst_fw_save	*fw_save;
};

Loading