[alsa-devel] [PATCH v3 3/3] ASoC: Intel: atom: Add sysfs entry in order to store FW version

Vinod Koul vinod.koul at intel.com
Wed Nov 23 09:08:47 CET 2016


On Wed, Nov 23, 2016 at 08:45:13AM +0100, Sebastien Guiriec wrote:

> +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,
> +};

Hi Seb,

With each sysfs file (which is an ABI) we are supposed to update
Documentation/ABI/ as well, can you please add it

Sorry should have told you in last rev :(

-- 
~Vinod


More information about the Alsa-devel mailing list