All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugene Shalygin <eugene.shalygin@gmail.com>
To: Denis Pauk <pauk.denis@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@intel.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Jean Delvare <jdelvare@suse.com>,
	linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org
Subject: Re: [PATCH 3/3] hwmon: (asus_wmi_sensors) Support access via Asus WMI.
Date: Mon, 4 Oct 2021 16:31:45 +0200	[thread overview]
Message-ID: <CAB95QAScBpn_GioELY8QNxxOAu6rvKkk+Fb=U6_pgN_7SrMHbA@mail.gmail.com> (raw)
In-Reply-To: <20211003234852.213bcd87@penguin.lxd>

Hello,

When I first wrote the EC sensor driver, I thought there were only a
few sensor configurations, but it turned out the assumption was wrong
and even with currently supported 6 boards the sensor to board mapping
is already hardly readable. Thus I redone that part in a declarative
way so that the sensor list for each board is condensed and is easy to
digest [1]. Please consider updating the submitted patches.

Best regards,
Eugene

[1] https://github.com/zeule/asus-wmi-ec-sensors/pull/4

On Sun, 3 Oct 2021 at 22:49, Denis Pauk <pauk.denis@gmail.com> wrote:
>
> Hi Eugene,
>
> On Sat, 2 Oct 2021 23:56:20 +0200
> Eugene Shalygin <eugene.shalygin@gmail.com> wrote:
>
> > Hi, Denis!
> >
> > Thank you for submitting this driver to the mainline! I have a few
> > comments/suggestions, please find them below.
> >
> > > +#define HWMON_MAX      9
> >
> > There is a hwmon_max enum member, whose current value is 10.
> Thank you, I will check.
>
> >
> > > +#define ASUS_WMI_BLOCK_READ_REGISTERS_MAX 0x10 /* from the ASUS
> > > DSDT source */ +/* from the ASUS_WMI_BLOCK_READ_REGISTERS_MAX value
> > > */ +#define ASUS_WMI_MAX_BUF_LEN 0x80
> > Suggestion:
> > #define ASUS_WMI_MAX_BUF_LEN 0x80 /* from the
> > ASUS_WMI_BLOCK_READ_REGISTERS_MAX value */
> >
> > > +#define ASUSWMI_SENSORS_MAX 11
> > This one is for the EC only, maybe rename it accordingly?
> >
> Thank you, I will check.
>
> > > +struct asus_wmi_data {
> > > +       int ec_board;
> > > +};
> >
> > Duplicates the value in the asus_wmi_sensors struct. Refactoring
> > artifact?
> >
> I have used different structures for data in platform and device.
>
> >              asus_wmi_ec_set_sensor_info(si++, "Water", hwmon_fan,
> > > +
> > > asus_wmi_ec_make_sensor_address(2, 0x00, 0xBC),
> > > +                                           &ec->nr_registers);
> > This one is named "W_FLOW" in the BIOS and ASUS software. Maybe append
> > "_flow" to the label?
> >
> Thank you, I will check.
>
> > > + * The next four functions converts to/from BRxx string argument
> > > format
> > convert (remove "s")
> >
> > > +       // assert(len <= 30)
> > Makes little sense in the kernel.
> >
> Thank you, I will check.
>
> > > +static void asus_wmi_ec_make_block_read_query(struct
> > > asus_wmi_ec_info *ec) +{
> > > +       u16 registers[ASUS_EC_KNOWN_EC_REGISTERS];
> > > +       u8 i, j, register_idx = 0;
> > > +
> > > +       /* if we can get values for all the registers in a single
> > > query,
> > > +        * the query will not change from call to call
> > > +        */
> > > +       if (ec->nr_registers <= ASUS_WMI_BLOCK_READ_REGISTERS_MAX &&
> > > +           ec->read_arg[0] > 0) {
> > > +               /* no need to update */
> > > +               return;
> > > +       }
> > > +
> > I would add a test for ec->nr_registers >
> > ASUS_WMI_BLOCK_READ_REGISTERS_MAX and a warning log message here.
> >
> Thank you, I will check.
>
> > > +static int asus_wmi_probe(struct platform_device *pdev)
> >
> > Can we add a module alias or to load the module automatically by other
> > means? For module aliases we know DMI parameters for the supported
> > boards.
> >
> I will look, I prefer to reuse same module code for boards with/without
> EC endpoints same as in
> https://bugzilla.kernel.org/show_bug.cgi?id=204807#c128.
>
> > Best regards,
> > Eugene
>
> Best regards,
>             Denis.

  reply	other threads:[~2021-10-04 14:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-02 21:08 [PATCH 0/3] Update ASUS WMI supported boards Denis Pauk
2021-10-02 21:08 ` [PATCH 1/3] hwmon: (nct6775) Add additional ASUS motherboards Denis Pauk
2021-10-03  9:48   ` Andy Shevchenko
2021-10-02 21:08 ` [PATCH 2/3] hwmon: (nct6775) Use custom scale for " Denis Pauk
2021-10-03  6:30   ` Andy Shevchenko
2021-10-05 13:52   ` Guenter Roeck
2021-10-02 21:08 ` [PATCH 3/3] hwmon: (asus_wmi_sensors) Support access via Asus WMI Denis Pauk
2021-10-02 21:56   ` Eugene Shalygin
2021-10-03 18:35     ` Eugene Shalygin
2021-10-03 20:48     ` Denis Pauk
2021-10-04 14:31       ` Eugene Shalygin [this message]
2021-10-03 10:34   ` Andy Shevchenko
2021-10-02 21:34 ` [PATCH 0/3] Update ASUS WMI supported boards Denis Pauk
2021-10-03  6:24   ` Andy Shevchenko
2021-10-03  6:39 ` Andy Shevchenko
2021-10-03 11:50 ` Oleksandr Natalenko
2021-10-03 12:47   ` Oleksandr Natalenko
2021-10-03 12:53     ` Eugene Shalygin
2021-10-03 13:00       ` Oleksandr Natalenko

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='CAB95QAScBpn_GioELY8QNxxOAu6rvKkk+Fb=U6_pgN_7SrMHbA@mail.gmail.com' \
    --to=eugene.shalygin@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pauk.denis@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.