From: Greg KH <gregkh@linuxfoundation.org>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: platform-driver-x86@vger.kernel.org,
Hans de Goede <hdegoede@redhat.com>,
Mark Gross <markgross@kernel.org>,
Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] platform/x86: Add Steam Deck driver
Date: Tue, 8 Feb 2022 09:51:04 +0100 [thread overview]
Message-ID: <YgIu+Lrt0p85yog1@kroah.com> (raw)
In-Reply-To: <20220206022023.376142-1-andrew.smirnov@gmail.com>
On Sat, Feb 05, 2022 at 06:20:23PM -0800, Andrey Smirnov wrote:
> +#define STEAMDECK_ATTR_RO(_name, _method) \
> + static ssize_t _name##_show(struct device *dev, \
> + struct device_attribute *attr, \
> + char *buf) \
> + { \
> + struct steamdeck *jup = dev_get_drvdata(dev); \
> + unsigned long long val; \
> + \
> + if (ACPI_FAILURE(acpi_evaluate_integer( \
> + jup->adev->handle, \
> + _method, NULL, &val))) \
> + return -EIO; \
> + \
> + return sprintf(buf, "%llu\n", val); \
Please use sysfs_emit() for this and any other sysfs show functions.
Also, you have no Documenation/ABI/ entries for all of these new sysfs
files you are creating. How do we know what these entries are for, and
what they contain? Please add that in future versions of this commit,
as-is we can't take this :(
> + } \
> + static DEVICE_ATTR_RO(_name)
> +
> +STEAMDECK_ATTR_RO(firmware_version, "PDFW");
> +STEAMDECK_ATTR_RO(board_id, "BOID");
> +STEAMDECK_ATTR_RO(pdcs, "PDCS");
> +
> +static umode_t
> +steamdeck_is_visible(struct kobject *kobj, struct attribute *attr, int index)
> +{
> + return attr->mode;
> +}
As Guenter pointed out, this is not needed.
> +
> +static struct attribute *steamdeck_attributes[] = {
> + &dev_attr_target_cpu_temp.attr,
> + &dev_attr_gain.attr,
> + &dev_attr_ramp_rate.attr,
> + &dev_attr_hysteresis.attr,
> + &dev_attr_maximum_battery_charge_rate.attr,
> + &dev_attr_recalculate.attr,
> + &dev_attr_power_cycle_display.attr,
> +
> + &dev_attr_led_brightness.attr,
> + &dev_attr_content_adaptive_brightness.attr,
> + &dev_attr_gamma_set.attr,
> + &dev_attr_display_brightness.attr,
> + &dev_attr_ctrl_display.attr,
> + &dev_attr_cabc_minimum_brightness.attr,
> + &dev_attr_memory_data_access_control.attr,
> +
> + &dev_attr_display_normal_mode_on.attr,
> + &dev_attr_display_inversion_off.attr,
> + &dev_attr_display_inversion_on.attr,
> + &dev_attr_idle_mode_on.attr,
> +
> + &dev_attr_firmware_version.attr,
> + &dev_attr_board_id.attr,
> + &dev_attr_pdcs.attr,
> +
> + NULL
> +};
> +
> +static const struct attribute_group steamdeck_group = {
> + .attrs = steamdeck_attributes,
> + .is_visible = steamdeck_is_visible,
> +};
> +
> +static const struct attribute_group *steamdeck_groups[] = {
> + &steamdeck_group,
> + NULL
> +};
ATTRIBUTE_GROUPS()?
thanks,
greg k-h
next prev parent reply other threads:[~2022-02-08 8:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-06 2:20 [PATCH] platform/x86: Add Steam Deck driver Andrey Smirnov
2022-02-06 5:33 ` Guenter Roeck
2022-02-12 22:36 ` Andrey Smirnov
2022-02-06 15:19 ` Barnabás Pőcze
2022-02-12 23:30 ` Andrey Smirnov
2022-02-17 16:28 ` Hans de Goede
2022-02-06 17:51 ` Guenter Roeck
2022-02-12 23:34 ` Andrey Smirnov
2022-02-08 8:51 ` Greg KH [this message]
2022-02-12 23:37 ` Andrey Smirnov
2024-04-24 15:40 ` Clayton Craft
2024-05-12 17:21 ` Andrey Smirnov
2022-02-17 16:26 ` Hans de Goede
2022-02-17 16:41 ` Hans de Goede
2022-02-19 21:08 ` Andrey Smirnov
2022-02-22 17:17 ` Hans de Goede
2022-02-17 16:35 ` Hans de Goede
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=YgIu+Lrt0p85yog1@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=andrew.smirnov@gmail.com \
--cc=hdegoede@redhat.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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