Thread (31 messages) 31 messages, 5 authors, 2021-05-17

Re: [PATCH 02/17] staging: nuc-wmi: detect WMI API detection

From: Dan Carpenter <hidden>
Date: 2021-05-17 09:37:18
Also in: linux-staging, lkml

On Sun, May 16, 2021 at 12:53:30PM +0200, Mauro Carvalho Chehab wrote:
-	leds = output[0];
+	if (ver != LED_API_NUC6) {
+		ret = nuc_nmi_cmd(dev, LED_VERSION_CONTROL, input, output);
Does this need to be checked?

	if (ret)
		return ret;
+		ver = output[0] | output[1] << 16;
+		if (!ver)
+			ver = LED_API_REV_0_64;
+		else if (ver == 0x0126)
+			ver = LED_API_REV_1_0;
+	}
+
+	/* Currently, only API Revision 0.64 is supported */
+	if (ver != LED_API_REV_0_64)
+		return -ENODEV;
+
 	if (!leds) {
 		dev_warn(dev, "No LEDs found\n");
 		return -ENODEV;
regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help