platform/x86: apple-gmux: Move port defines to apple-gmux.h
authorHans de Goede <hdegoede@redhat.com>
Tue, 24 Jan 2023 10:57:52 +0000 (11:57 +0100)
committerHans de Goede <hdegoede@redhat.com>
Tue, 24 Jan 2023 12:41:57 +0000 (13:41 +0100)
This is a preparation patch for adding a new static inline
apple_gmux_detect() helper which actually checks a supported
gmux is present, rather then only checking an ACPI device with
the HID is there as apple_gmux_present() does.

Fixes: 21245df307cb ("ACPI: video: Add Apple GMUX brightness control detection")
Link: https://lore.kernel.org/platform-driver-x86/20230123113750.462144-1-hdegoede@redhat.com/
Reported-by: Emmanouil Kouroupakis <kartebi@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230124105754.62167-2-hdegoede@redhat.com
drivers/platform/x86/apple-gmux.c
include/linux/apple-gmux.h

index ca33df7ea550ee1f88aeaa82578863d44b9afe2e..a0af01f6a0fd4fc9032847ba91e6879a584f341d 100644 (file)
@@ -64,29 +64,6 @@ struct apple_gmux_data {
 
 static struct apple_gmux_data *apple_gmux_data;
 
-/*
- * gmux port offsets. Many of these are not yet used, but may be in the
- * future, and it's useful to have them documented here anyhow.
- */
-#define GMUX_PORT_VERSION_MAJOR                0x04
-#define GMUX_PORT_VERSION_MINOR                0x05
-#define GMUX_PORT_VERSION_RELEASE      0x06
-#define GMUX_PORT_SWITCH_DISPLAY       0x10
-#define GMUX_PORT_SWITCH_GET_DISPLAY   0x11
-#define GMUX_PORT_INTERRUPT_ENABLE     0x14
-#define GMUX_PORT_INTERRUPT_STATUS     0x16
-#define GMUX_PORT_SWITCH_DDC           0x28
-#define GMUX_PORT_SWITCH_EXTERNAL      0x40
-#define GMUX_PORT_SWITCH_GET_EXTERNAL  0x41
-#define GMUX_PORT_DISCRETE_POWER       0x50
-#define GMUX_PORT_MAX_BRIGHTNESS       0x70
-#define GMUX_PORT_BRIGHTNESS           0x74
-#define GMUX_PORT_VALUE                        0xc2
-#define GMUX_PORT_READ                 0xd0
-#define GMUX_PORT_WRITE                        0xd4
-
-#define GMUX_MIN_IO_LEN                        (GMUX_PORT_BRIGHTNESS + 4)
-
 #define GMUX_INTERRUPT_ENABLE          0xff
 #define GMUX_INTERRUPT_DISABLE         0x00
 
index ddb10aa67b14360ee0f6f63b5f733b1176557588..80efaaf89e072e1052969ade6b355673c4f1cc10 100644 (file)
 
 #define GMUX_ACPI_HID "APP000B"
 
+/*
+ * gmux port offsets. Many of these are not yet used, but may be in the
+ * future, and it's useful to have them documented here anyhow.
+ */
+#define GMUX_PORT_VERSION_MAJOR                0x04
+#define GMUX_PORT_VERSION_MINOR                0x05
+#define GMUX_PORT_VERSION_RELEASE      0x06
+#define GMUX_PORT_SWITCH_DISPLAY       0x10
+#define GMUX_PORT_SWITCH_GET_DISPLAY   0x11
+#define GMUX_PORT_INTERRUPT_ENABLE     0x14
+#define GMUX_PORT_INTERRUPT_STATUS     0x16
+#define GMUX_PORT_SWITCH_DDC           0x28
+#define GMUX_PORT_SWITCH_EXTERNAL      0x40
+#define GMUX_PORT_SWITCH_GET_EXTERNAL  0x41
+#define GMUX_PORT_DISCRETE_POWER       0x50
+#define GMUX_PORT_MAX_BRIGHTNESS       0x70
+#define GMUX_PORT_BRIGHTNESS           0x74
+#define GMUX_PORT_VALUE                        0xc2
+#define GMUX_PORT_READ                 0xd0
+#define GMUX_PORT_WRITE                        0xd4
+
+#define GMUX_MIN_IO_LEN                        (GMUX_PORT_BRIGHTNESS + 4)
+
 #if IS_ENABLED(CONFIG_APPLE_GMUX)
 
 /**