* [PATCH 1/3] ASoC: intel: atom: Add debug information related to FW version
@ 2016-11-04 8:04 Sebastien Guiriec
2016-11-04 8:04 ` [PATCH 2/3] ASoC: Intel: atom: save " Sebastien Guiriec
2016-11-04 8:04 ` [PATCH 3/3] ASoC: Intel: atom: Add sysfs entry in order to store " Sebastien Guiriec
0 siblings, 2 replies; 8+ messages in thread
From: Sebastien Guiriec @ 2016-11-04 8:04 UTC (permalink / raw)
To: alsa-devel, vind.koul, pierre-louis.bossart, liam.r.girdwood
Cc: Sebastien Guiriec
This patch is adding debug information related to SST FW version.
Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
---
sound/soc/intel/atom/sst/sst_ipc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c
index 8afa6fe..92ffeaa 100644
--- a/sound/soc/intel/atom/sst/sst_ipc.c
+++ b/sound/soc/intel/atom/sst/sst_ipc.c
@@ -236,6 +236,9 @@ static void process_fw_init(struct intel_sst_drv *sst_drv_ctx,
retval = init->result;
goto ret;
}
+ dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
+ init->fw_version.type, init->fw_version.major,
+ init->fw_version.minor, init->fw_version.build);
ret:
sst_wake_up_block(sst_drv_ctx, retval, FW_DWNL_ID, 0 , NULL, 0);
--
2.9.3
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] ASoC: Intel: atom: save FW version
2016-11-04 8:04 [PATCH 1/3] ASoC: intel: atom: Add debug information related to FW version Sebastien Guiriec
@ 2016-11-04 8:04 ` Sebastien Guiriec
2016-11-07 21:01 ` Vinod Koul
2016-11-04 8:04 ` [PATCH 3/3] ASoC: Intel: atom: Add sysfs entry in order to store " Sebastien Guiriec
1 sibling, 1 reply; 8+ messages in thread
From: Sebastien Guiriec @ 2016-11-04 8:04 UTC (permalink / raw)
To: alsa-devel, vind.koul, pierre-louis.bossart, liam.r.girdwood
Cc: Sebastien Guiriec
After the boot of the SST FW the firmware version is send back
to the driver. This patch is saving the FW version inside the
driver.
Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
---
sound/soc/intel/atom/sst/sst.h | 1 +
sound/soc/intel/atom/sst/sst_ipc.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/sound/soc/intel/atom/sst/sst.h b/sound/soc/intel/atom/sst/sst.h
index 3f49386..5c9a51cc 100644
--- a/sound/soc/intel/atom/sst/sst.h
+++ b/sound/soc/intel/atom/sst/sst.h
@@ -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;
};
diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c
index 92ffeaa..8e88211 100644
--- a/sound/soc/intel/atom/sst/sst_ipc.c
+++ b/sound/soc/intel/atom/sst/sst_ipc.c
@@ -240,6 +240,11 @@ static void process_fw_init(struct intel_sst_drv *sst_drv_ctx,
init->fw_version.type, init->fw_version.major,
init->fw_version.minor, init->fw_version.build);
+ /* Save FW version */
+ sst_drv_ctx->fw_version.type = init->fw_version.type;
+ sst_drv_ctx->fw_version.major = init->fw_version.major;
+ sst_drv_ctx->fw_version.minor = init->fw_version.minor;
+ sst_drv_ctx->fw_version.build = init->fw_version.build;
ret:
sst_wake_up_block(sst_drv_ctx, retval, FW_DWNL_ID, 0 , NULL, 0);
}
--
2.9.3
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] ASoC: Intel: atom: Add sysfs entry in order to store FW version
2016-11-04 8:04 [PATCH 1/3] ASoC: intel: atom: Add debug information related to FW version Sebastien Guiriec
2016-11-04 8:04 ` [PATCH 2/3] ASoC: Intel: atom: save " Sebastien Guiriec
@ 2016-11-04 8:04 ` Sebastien Guiriec
2016-11-07 21:02 ` Vinod Koul
1 sibling, 1 reply; 8+ messages in thread
From: Sebastien Guiriec @ 2016-11-04 8:04 UTC (permalink / raw)
To: alsa-devel, vind.koul, pierre-louis.bossart, liam.r.girdwood
Cc: Sebastien Guiriec
This patch is adding a sysfs entry in order to be able to get
access to SST FW version.
Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
---
sound/soc/intel/atom/sst/sst.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
index a4b458e..dabbd06 100644
--- a/sound/soc/intel/atom/sst/sst.c
+++ b/sound/soc/intel/atom/sst/sst.c
@@ -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>
@@ -241,6 +242,28 @@ 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);
+
+ 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;
@@ -314,8 +337,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);
@@ -329,6 +363,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);
--
2.9.3
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] ASoC: Intel: atom: save FW version
2016-11-04 8:04 ` [PATCH 2/3] ASoC: Intel: atom: save " Sebastien Guiriec
@ 2016-11-07 21:01 ` Vinod Koul
2016-11-08 7:15 ` Sebastien Guiriec
0 siblings, 1 reply; 8+ messages in thread
From: Vinod Koul @ 2016-11-07 21:01 UTC (permalink / raw)
To: Sebastien Guiriec
Cc: liam.r.girdwood, alsa-devel, vind.koul, pierre-louis.bossart
On Fri, Nov 04, 2016 at 09:04:10AM +0100, Sebastien Guiriec wrote:
> After the boot of the SST FW the firmware version is send back
> to the driver. This patch is saving the FW version inside the
> driver.
>
> Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
> ---
> sound/soc/intel/atom/sst/sst.h | 1 +
> sound/soc/intel/atom/sst/sst_ipc.c | 5 +++++
> 2 files changed, 6 insertions(+)
>
> diff --git a/sound/soc/intel/atom/sst/sst.h b/sound/soc/intel/atom/sst/sst.h
> index 3f49386..5c9a51cc 100644
> --- a/sound/soc/intel/atom/sst/sst.h
> +++ b/sound/soc/intel/atom/sst/sst.h
> @@ -436,6 +436,7 @@ struct intel_sst_drv {
> */
> char firmware_name[FW_NAME_SIZE];
>
> + struct snd_sst_fw_version fw_version;
Can you check if this is initialzed to zero, otherwise we should reset it..
> struct sst_fw_save *fw_save;
> };
>
> diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c
> index 92ffeaa..8e88211 100644
> --- a/sound/soc/intel/atom/sst/sst_ipc.c
> +++ b/sound/soc/intel/atom/sst/sst_ipc.c
> @@ -240,6 +240,11 @@ static void process_fw_init(struct intel_sst_drv *sst_drv_ctx,
> init->fw_version.type, init->fw_version.major,
> init->fw_version.minor, init->fw_version.build);
>
> + /* Save FW version */
> + sst_drv_ctx->fw_version.type = init->fw_version.type;
> + sst_drv_ctx->fw_version.major = init->fw_version.major;
> + sst_drv_ctx->fw_version.minor = init->fw_version.minor;
> + sst_drv_ctx->fw_version.build = init->fw_version.build;
> ret:
> sst_wake_up_block(sst_drv_ctx, retval, FW_DWNL_ID, 0 , NULL, 0);
> }
> --
> 2.9.3
>
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris,
> 92196 Meudon Cedex, France
> Registration Number: 302 456 199 R.C.S. NANTERRE
> Capital: 4,572,000 Euros
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
--
~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] ASoC: Intel: atom: Add sysfs entry in order to store FW version
2016-11-04 8:04 ` [PATCH 3/3] ASoC: Intel: atom: Add sysfs entry in order to store " Sebastien Guiriec
@ 2016-11-07 21:02 ` Vinod Koul
2016-11-08 8:29 ` Sebastien Guiriec
0 siblings, 1 reply; 8+ messages in thread
From: Vinod Koul @ 2016-11-07 21:02 UTC (permalink / raw)
To: Sebastien Guiriec
Cc: liam.r.girdwood, alsa-devel, vind.koul, pierre-louis.bossart
On Fri, Nov 04, 2016 at 09:04:11AM +0100, Sebastien Guiriec wrote:
> This patch is adding a sysfs entry in order to be able to get
> access to SST FW version.
>
> Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
> ---
> sound/soc/intel/atom/sst/sst.c | 35 +++++++++++++++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
> index a4b458e..dabbd06 100644
> --- a/sound/soc/intel/atom/sst/sst.c
> +++ b/sound/soc/intel/atom/sst/sst.c
> @@ -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>
> @@ -241,6 +242,28 @@ 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);
> +
> + 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);
we should do this only after FW load, can you add that bit please. ALso
check we dont leak kernel memory when this is not set
--
~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] ASoC: Intel: atom: save FW version
2016-11-07 21:01 ` Vinod Koul
@ 2016-11-08 7:15 ` Sebastien Guiriec
0 siblings, 0 replies; 8+ messages in thread
From: Sebastien Guiriec @ 2016-11-08 7:15 UTC (permalink / raw)
To: Vinod Koul; +Cc: liam.r.girdwood, alsa-devel, pierre-louis.bossart, viond.koul
Hi Vinod,
On 07/11/2016 22:01, Vinod Koul wrote:
> On Fri, Nov 04, 2016 at 09:04:10AM +0100, Sebastien Guiriec wrote:
>> After the boot of the SST FW the firmware version is send back
>> to the driver. This patch is saving the FW version inside the
>> driver.
>>
>> Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
>> ---
>> sound/soc/intel/atom/sst/sst.h | 1 +
>> sound/soc/intel/atom/sst/sst_ipc.c | 5 +++++
>> 2 files changed, 6 insertions(+)
>>
>> diff --git a/sound/soc/intel/atom/sst/sst.h b/sound/soc/intel/atom/sst/sst.h
>> index 3f49386..5c9a51cc 100644
>> --- a/sound/soc/intel/atom/sst/sst.h
>> +++ b/sound/soc/intel/atom/sst/sst.h
>> @@ -436,6 +436,7 @@ struct intel_sst_drv {
>> */
>> char firmware_name[FW_NAME_SIZE];
>>
>> + struct snd_sst_fw_version fw_version;
>
> Can you check if this is initialzed to zero, otherwise we should reset it..
>
Driver is using devm_kzalloc so it is set to 0.
Seb
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] ASoC: Intel: atom: Add sysfs entry in order to store FW version
2016-11-07 21:02 ` Vinod Koul
@ 2016-11-08 8:29 ` Sebastien Guiriec
2016-11-09 10:21 ` Vinod Koul
0 siblings, 1 reply; 8+ messages in thread
From: Sebastien Guiriec @ 2016-11-08 8:29 UTC (permalink / raw)
Cc: vinod.koul, liam.r.girdwood, alsa-devel, pierre-louis.bossart
Hi Vinod,
On 07/11/2016 22:02, Vinod Koul wrote:
> On Fri, Nov 04, 2016 at 09:04:11AM +0100, Sebastien Guiriec wrote:
>> This patch is adding a sysfs entry in order to be able to get
>> access to SST FW version.
>>
>> Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
>> ---
>> sound/soc/intel/atom/sst/sst.c | 35 +++++++++++++++++++++++++++++++++++
>> 1 file changed, 35 insertions(+)
>>
>> diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
>> index a4b458e..dabbd06 100644
>> --- a/sound/soc/intel/atom/sst/sst.c
>> +++ b/sound/soc/intel/atom/sst/sst.c
>> @@ -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>
>> @@ -241,6 +242,28 @@ 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);
>> +
>> + 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);
>
> we should do this only after FW load, can you add that bit please. ALso
> check we dont leak kernel memory when this is not set
>
Ok in case of v00.00.00.00 I will return "FW not yet Loaded".
Is it ok for you?
Seb
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] ASoC: Intel: atom: Add sysfs entry in order to store FW version
2016-11-08 8:29 ` Sebastien Guiriec
@ 2016-11-09 10:21 ` Vinod Koul
0 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2016-11-09 10:21 UTC (permalink / raw)
To: Sebastien Guiriec; +Cc: liam.r.girdwood, alsa-devel, pierre-louis.bossart
On Tue, Nov 08, 2016 at 09:29:15AM +0100, Sebastien Guiriec wrote:
> >we should do this only after FW load, can you add that bit please. ALso
> >check we dont leak kernel memory when this is not set
> >
>
> Ok in case of v00.00.00.00 I will return "FW not yet Loaded".
> Is it ok for you?
Yes sounds good to me :)
--
~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-11-09 10:12 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 8:04 [PATCH 1/3] ASoC: intel: atom: Add debug information related to FW version Sebastien Guiriec
2016-11-04 8:04 ` [PATCH 2/3] ASoC: Intel: atom: save " Sebastien Guiriec
2016-11-07 21:01 ` Vinod Koul
2016-11-08 7:15 ` Sebastien Guiriec
2016-11-04 8:04 ` [PATCH 3/3] ASoC: Intel: atom: Add sysfs entry in order to store " Sebastien Guiriec
2016-11-07 21:02 ` Vinod Koul
2016-11-08 8:29 ` Sebastien Guiriec
2016-11-09 10:21 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).