alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: "Rojewski, Cezary" <cezary.rojewski@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "pierre-louis.bossart@linux.intel.com"
	<pierre-louis.bossart@linux.intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"Kaczmarski, Filip" <filip.kaczmarski@intel.com>,
	"N, Harshapriya" <harshapriya.n@intel.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"Barlik, Marcin" <marcin.barlik@intel.com>,
	"zwisler@google.com" <zwisler@google.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"Proborszcz, Filip" <filip.proborszcz@intel.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"amadeuszx.slawinski@linux.intel.com"
	<amadeuszx.slawinski@linux.intel.com>,
	"Wasko, Michal" <michal.wasko@intel.com>,
	"cujomalainey@chromium.org" <cujomalainey@chromium.org>,
	"Hejmowski, Krzysztof" <krzysztof.hejmowski@intel.com>,
	"ppapierkowski@habana.ai" <ppapierkowski@habana.ai>,
	"Gopal,  Vamshi Krishna" <vamshi.krishna.gopal@intel.com>
Subject: RE: [PATCH v8 09/14] ASoC: Intel: catpt: Simple sysfs attributes
Date: Wed, 23 Sep 2020 18:31:08 +0000	[thread overview]
Message-ID: <4e590f061dec474195a10482b1a9bc22@intel.com> (raw)
In-Reply-To: <20200923133427.GL3956970@smile.fi.intel.com>

On 2020-09-23 3:34 PM, Andy Shevchenko wrote:
> On Wed, Sep 23, 2020 at 02:25:03PM +0200, Cezary Rojewski wrote:
>> Add sysfs entries for displaying version of FW currently in use as well
>> as dumping full FW information including build and log-providers hashes.

...

>>   #include "registers.h"
> 
>>   struct catpt_dev;
>> +extern const struct attribute_group *catpt_attr_groups[];
> 
> Grouping these are not okay — they are different by meaning, just put blank
> line in between.
> 

Sure, ack.

...

>> +#include <linux/pm_runtime.h>
>> +#include "core.h"
>> +
>> +static ssize_t fw_version_show(struct device *dev,
>> +			       struct device_attribute *attr, char *buf)
>> +{
>> +	struct catpt_dev *cdev = dev_get_drvdata(dev);
>> +	struct catpt_fw_version version;
>> +	int ret;
> 
>> +	pm_runtime_get_sync(cdev->dev);
>> +
>> +	ret = catpt_ipc_get_fw_version(cdev, &version);
>> +
>> +	pm_runtime_mark_last_busy(cdev->dev);
>> +	pm_runtime_put_autosuspend(cdev->dev);
> 
> Is it subject to change at run-time?
> 

No it does not. However, I do not intent to have the fw_version occupy
memory for device's drvdata (i.e. send the IPC internally and store it
inside struct catpt_dev). So, I'd rather wake the device, dump the
version and leave the bytes alone.

One could think about statics but then again, how many times this sysfs
file is going to get read anyway?
It's more readable and simple this way, losing nothing in return TBH.

>> +	if (ret)
>> +		return CATPT_IPC_ERROR(ret);
>> +
>> +	return sprintf(buf, "%d.%d.%d.%d\n", version.type, version.major,
>> +		       version.minor, version.build);
>> +}
> 
>> +
> 
> This blank line is not needed.
> 

Ack.

>> +static DEVICE_ATTR_RO(fw_version);
>> +
>> +static ssize_t fw_info_show(struct device *dev,
>> +			    struct device_attribute *attr, char *buf)
>> +{
>> +	struct catpt_dev *cdev = dev_get_drvdata(dev);
>> +
>> +	return sprintf(buf, "%s\n", cdev->ipc.config.fw_info);
>> +}
> 
>> +
> 
> This blank line is not needed.
> 

Ack.

  reply	other threads:[~2020-09-23 18:32 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 12:24 [PATCH v8 00/14] ASoC: Intel: Catpt - Lynx and Wildcat point Cezary Rojewski
2020-09-23 12:24 ` [PATCH v8 01/14] ASoC: Intel: Add catpt base members Cezary Rojewski
2020-09-23 13:18   ` Andy Shevchenko
2020-09-23 12:24 ` [PATCH v8 02/14] ASoC: Intel: catpt: Implement IPC protocol Cezary Rojewski
2020-09-23 13:17   ` Andy Shevchenko
2020-09-23 19:24     ` Rojewski, Cezary
2020-09-23 19:33       ` Rojewski, Cezary
2020-09-23 12:24 ` [PATCH v8 03/14] ASoC: Intel: catpt: Add IPC message handlers Cezary Rojewski
2020-09-23 13:25   ` Andy Shevchenko
2020-09-23 12:24 ` [PATCH v8 04/14] ASoC: Intel: catpt: Define DSP operations Cezary Rojewski
2020-09-23 13:26   ` Andy Shevchenko
2020-09-23 12:24 ` [PATCH v8 05/14] ASoC: Intel: catpt: Firmware loading and context restore Cezary Rojewski
2020-09-23 13:29   ` Andy Shevchenko
2020-09-23 12:25 ` [PATCH v8 06/14] ASoC: Intel: catpt: PCM operations Cezary Rojewski
2020-09-23 13:54   ` Andy Shevchenko
2020-09-23 14:53     ` Mark Brown
2020-09-23 18:23     ` Rojewski, Cezary
2020-09-24 14:22       ` Andy Shevchenko
2020-09-26  8:52         ` Rojewski, Cezary
2020-09-23 12:25 ` [PATCH v8 07/14] ASoC: Intel: catpt: Device driver lifecycle Cezary Rojewski
2020-09-23 13:31   ` Andy Shevchenko
2020-09-23 12:25 ` [PATCH v8 08/14] ASoC: Intel: catpt: Event tracing Cezary Rojewski
2020-09-23 13:29   ` Andy Shevchenko
2020-09-23 12:25 ` [PATCH v8 09/14] ASoC: Intel: catpt: Simple sysfs attributes Cezary Rojewski
2020-09-23 13:34   ` Andy Shevchenko
2020-09-23 18:31     ` Rojewski, Cezary [this message]
2020-09-24 14:24       ` Andy Shevchenko
2020-09-23 17:17   ` Greg KH
2020-09-23 12:25 ` [PATCH v8 10/14] ASoC: Intel: haswell: Remove haswell-solution specific code Cezary Rojewski
2020-09-23 12:25 ` [PATCH v8 11/14] ASoC: Intel: broadwell: " Cezary Rojewski
2020-09-23 12:25 ` [PATCH v8 12/14] ASoC: Intel: bdw-5650: " Cezary Rojewski
2020-09-23 12:25 ` [PATCH v8 13/14] ASoC: Intel: bdw-5677: " Cezary Rojewski
2020-09-23 12:25 ` [PATCH v8 14/14] ASoC: Intel: Select catpt and deprecate haswell Cezary Rojewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e590f061dec474195a10482b1a9bc22@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=cujomalainey@chromium.org \
    --cc=filip.kaczmarski@intel.com \
    --cc=filip.proborszcz@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=harshapriya.n@intel.com \
    --cc=krzysztof.hejmowski@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=marcin.barlik@intel.com \
    --cc=michal.wasko@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ppapierkowski@habana.ai \
    --cc=tiwai@suse.com \
    --cc=vamshi.krishna.gopal@intel.com \
    --cc=zwisler@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).