mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Tomasz Bojanowski <tomasz@bojanowski.me>
Cc: linux-hwmon@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] hwmon: Add driver for MSI Mystic Light controller voltage sensors
Date: Sat, 7 Nov 2026 11:40:57 -0800	[thread overview]
Message-ID: <e79d3e26-4ca5-4ca4-9159-427a5a6f1129@roeck-us.net> (raw)
In-Reply-To: <20261107181518.385136-1-tomasz@bojanowski.me>

Hi Tomasz,

On 11/7/26 10:15, Tomasz Bojanowski wrote:
> Hi Guenter,
> 
> On 11/7/26 10:02, Guenter Roeck wrote:
>> What am I missing ?
> 
> Sorry, my earlier description was not clear about how the request is
> sent. From the vendor software, it looks like this:
> 
> - The request goes out as an output report with report ID 0xfa, not
>    as a feature report. If I read usbhid_set_raw_report() correctly,
>    it puts reportnum into buf[0], so with MSI_ML_SENSOR_REPORT_ID the
>    controller would have received a feature report 0xf0 instead.
> - The reply seems to come back as an input report on the interrupt
>    endpoint, not through GET_REPORT. As long as the driver calls
>    hid_hw_open(), it should show up in .raw_event().
> 
> Roughly like this (untested, I have none of these boards):
> 
>          buf[0] = 0xfa;
>          buf[1] = 0xa0;
>          buf[9] = 0x01;
>          buf[10] = 0xfc;
>          reinit_completion(&priv->done);
>          ret = hid_hw_output_report(hdev, buf, 64);
>          if (ret == -ENOSYS)
>                  ret = hid_hw_raw_request(hdev, 0xfa, buf, 64,
>                                           HID_OUTPUT_REPORT,
>                                           HID_REQ_SET_REPORT);
>          ...
>          wait_for_completion_timeout(&priv->done, msecs_to_jiffies(500));
> 
> In .raw_event(), the reply could be accepted when data[0] == 0xfa,
> data[2] == 0x01 and size == 64, followed by complete().
> 
> The report ID should stay a constant 0xfa: with 0x01, the same buffer
> would be the bootloader command.
> 
Great, that works. I published a repository at
https://github.com/groeck/mystic_light.git
to make working on the code easier. The first two patches on top
of yours rearrange the code to simplify adding support for new boards,
and the last one adds support for the boards I own.

Here is what I get:

MAG B550M MORTAR MAX WIFI (MS-7C94):

     msi_mystic_light-hid-3-4
     Adapter: HID adapter
     CPU VDDP:    1000.00 uV         <-- looks wrong
     PROM Core:     1.04 V

MAG B650 TOMAHAWK WIFI (MS-7D75):

     msi_mystic_light-hid-3-5
     Adapter: HID adapter
     CPU 1P8:       1.81 V
     CHIP Core:     1.06 V
     VDD MISC:      1.10 V

MAG B650M MORTAR WIFI (MS-7D76):

     msi_mystic_light-hid-3-5
     Adapter: HID adapter
     CPU 1P8:       1.80 V
     CHIP Core:     1.04 V
     VDD MISC:      1.10 V

7D75 and 7D76 seem ok, but 7C94 looks wrong. A raw dump of 7C94 report data shows:

fa a0 01 00 00 00 00 00 00 01 fc 02 00 0e 04 f3 04 00 00 7d 7d 7d 00 00 00 00 00 00 00 00 00 00
                                  ^^^^^ ^^^^^
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Offset 11 does not seem to show a valid voltage. On the other side, offset 15
would reflect a value that at least makes sense.

Please let me know if the code still works for you.

Thanks,
Guenter


  reply	other threads:[~2026-11-07 19:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07  8:28 Tomasz Bojanowski
2026-11-07 15:56 ` Guenter Roeck
2026-11-07 16:12   ` Tomasz Bojanowski
2026-11-07 18:02     ` Guenter Roeck
2026-11-07 18:15       ` Tomasz Bojanowski
2026-11-07 19:40         ` Guenter Roeck [this message]
2026-11-07 20:33           ` Tomasz Bojanowski
2026-11-07 20:54             ` Tomasz Bojanowski
2026-11-07 21:06             ` Guenter Roeck
2026-11-07 21:47               ` Tomasz Bojanowski
2026-11-07 22:05                 ` Guenter Roeck

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=e79d3e26-4ca5-4ca4-9159-427a5a6f1129@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tomasz@bojanowski.me \
    /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

all inboxes | Powered by JetHome®