From: Guenter Roeck <linux@roeck-us.net>
To: Joshua Grisham <josh@joshuagrisham.com>,
ilpo.jarvinen@linux.intel.com, hdegoede@redhat.com,
platform-driver-x86@vger.kernel.org, corbet@lwn.net,
linux-doc@vger.kernel.org, jdelvare@suse.com,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: samsung-galaxybook: Add samsung-galaxybook driver
Date: Mon, 9 Dec 2024 08:58:18 -0800 [thread overview]
Message-ID: <f8db26af-c6c6-478c-a69c-0bc811e0b59d@roeck-us.net> (raw)
In-Reply-To: <20241209163720.17597-1-josh@joshuagrisham.com>
On 12/9/24 08:37, Joshua Grisham wrote:
> This patch will add a new driver for Samsung Galaxy Book series notebook
> devices. This should hopefully include all suggestions from my original
> mailing list feedback thread [1], as well as a first version for
> associated updates to the documentation, Kconfig, Makefile, and the
> MAINTAINERS file related to this new driver.
>
> I have tested the driver both using m and y in the config, as well as
> with various other options mentioned in the patch checklist of the
> documentation.
>
> Other users with other device IDs have also tested successfully using
> a version of these same driver updates which I have maintained in a
> separate branch of my GitHub repository [2].
>
> I have made an attempt with the coding style to find a balance between what
> is written in the kernel documentation and what actually exists in current
> x86 platform drivers, but any feedback on this (or anything else) is
> certainly welcome!
>
> [1]: https://lore.kernel.org/platform-driver-x86/CAMF+KeYus9dW00WNJMLVxLLHdG9JgCfrGJ491fu7NM8GAEqqCg@mail.gmail.com/
> [2]: https://github.com/joshuagrisham/samsung-galaxybook-extras/pull/44
>
> Signed-off-by: Joshua Grisham <josh@joshuagrisham.com>
> ---
...
> +/*
> + * Hwmon device
> + */
> +
> +#if IS_ENABLED(CONFIG_HWMON)
> +static umode_t galaxybook_hwmon_is_visible(const void *drvdata, enum hwmon_sensor_types type,
> + u32 attr, int channel)
> +{
> + switch (type) {
> + case hwmon_fan:
> + if (channel < galaxybook_ptr->fans_count &&
> + (attr == hwmon_fan_input || attr == hwmon_fan_label))
> + return 0444;
> + return 0;
> + default:
> + return 0;
> + }
> +}
> +
> +static int galaxybook_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
> + u32 attr, int channel, long *val)
> +{
> + unsigned int speed;
> +
> + switch (type) {
> + case hwmon_fan:
> + if (channel < galaxybook_ptr->fans_count && attr == hwmon_fan_input) {
Why is this check necesary ? The is_visible function should have masked it out.
> + if (fan_speed_get(&galaxybook_ptr->fans[channel], &speed))
> + return -EIO;
> + *val = speed;
> + return 0;
> + }
> + return -EOPNOTSUPP;
> + default:
> + return -EOPNOTSUPP;
> + }
> +}
> +
> +static int galaxybook_hwmon_read_string(struct device *dev, enum hwmon_sensor_types type,
> + u32 attr, int channel, const char **str)
> +{
> + switch (type) {
> + case hwmon_fan:
> + if (channel < galaxybook_ptr->fans_count && attr == hwmon_fan_label) {
> + *str = galaxybook_ptr->fans[channel].description;
> + return 0;
> + }
Same as above.
Guenter
next prev parent reply other threads:[~2024-12-09 16:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 16:37 [PATCH] platform/x86: samsung-galaxybook: Add samsung-galaxybook driver Joshua Grisham
2024-12-09 16:58 ` Guenter Roeck [this message]
2024-12-15 14:41 ` Joshua Grisham
2024-12-09 17:03 ` Randy Dunlap
2024-12-15 16:09 ` Joshua Grisham
2024-12-15 16:35 ` Guenter Roeck
2024-12-15 17:19 ` Joshua Grisham
2024-12-15 18:23 ` Guenter Roeck
2024-12-15 16:53 ` Randy Dunlap
2024-12-09 18:48 ` Ilpo Järvinen
2024-12-15 17:16 ` Joshua Grisham
2024-12-10 6:29 ` Armin Wolf
2024-12-16 14:11 ` Joshua Grisham
2024-12-17 1:41 ` Armin Wolf
2024-12-17 15:07 ` Hans de Goede
2024-12-15 14:13 ` [PATCH v2] " Joshua Grisham
2024-12-15 20:02 ` Armin Wolf
2024-12-15 22:51 ` Joshua Grisham
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=f8db26af-c6c6-478c-a69c-0bc811e0b59d@roeck-us.net \
--to=linux@roeck-us.net \
--cc=corbet@lwn.net \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jdelvare@suse.com \
--cc=josh@joshuagrisham.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.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