Skip to content

Commit 39f5a81

Browse files
committed
platform/x86: apple-gmux: Move port defines to apple-gmux.h
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: 21245df ("ACPI: video: Add Apple GMUX brightness control detection") Link: https://lore.kernel.org/platform-driver-x86/[email protected]/ Reported-by: Emmanouil Kouroupakis <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ce95010 commit 39f5a81

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

drivers/platform/x86/apple-gmux.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,6 @@ struct apple_gmux_data {
6464

6565
static struct apple_gmux_data *apple_gmux_data;
6666

67-
/*
68-
* gmux port offsets. Many of these are not yet used, but may be in the
69-
* future, and it's useful to have them documented here anyhow.
70-
*/
71-
#define GMUX_PORT_VERSION_MAJOR 0x04
72-
#define GMUX_PORT_VERSION_MINOR 0x05
73-
#define GMUX_PORT_VERSION_RELEASE 0x06
74-
#define GMUX_PORT_SWITCH_DISPLAY 0x10
75-
#define GMUX_PORT_SWITCH_GET_DISPLAY 0x11
76-
#define GMUX_PORT_INTERRUPT_ENABLE 0x14
77-
#define GMUX_PORT_INTERRUPT_STATUS 0x16
78-
#define GMUX_PORT_SWITCH_DDC 0x28
79-
#define GMUX_PORT_SWITCH_EXTERNAL 0x40
80-
#define GMUX_PORT_SWITCH_GET_EXTERNAL 0x41
81-
#define GMUX_PORT_DISCRETE_POWER 0x50
82-
#define GMUX_PORT_MAX_BRIGHTNESS 0x70
83-
#define GMUX_PORT_BRIGHTNESS 0x74
84-
#define GMUX_PORT_VALUE 0xc2
85-
#define GMUX_PORT_READ 0xd0
86-
#define GMUX_PORT_WRITE 0xd4
87-
88-
#define GMUX_MIN_IO_LEN (GMUX_PORT_BRIGHTNESS + 4)
89-
9067
#define GMUX_INTERRUPT_ENABLE 0xff
9168
#define GMUX_INTERRUPT_DISABLE 0x00
9269

include/linux/apple-gmux.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,29 @@
1111

1212
#define GMUX_ACPI_HID "APP000B"
1313

14+
/*
15+
* gmux port offsets. Many of these are not yet used, but may be in the
16+
* future, and it's useful to have them documented here anyhow.
17+
*/
18+
#define GMUX_PORT_VERSION_MAJOR 0x04
19+
#define GMUX_PORT_VERSION_MINOR 0x05
20+
#define GMUX_PORT_VERSION_RELEASE 0x06
21+
#define GMUX_PORT_SWITCH_DISPLAY 0x10
22+
#define GMUX_PORT_SWITCH_GET_DISPLAY 0x11
23+
#define GMUX_PORT_INTERRUPT_ENABLE 0x14
24+
#define GMUX_PORT_INTERRUPT_STATUS 0x16
25+
#define GMUX_PORT_SWITCH_DDC 0x28
26+
#define GMUX_PORT_SWITCH_EXTERNAL 0x40
27+
#define GMUX_PORT_SWITCH_GET_EXTERNAL 0x41
28+
#define GMUX_PORT_DISCRETE_POWER 0x50
29+
#define GMUX_PORT_MAX_BRIGHTNESS 0x70
30+
#define GMUX_PORT_BRIGHTNESS 0x74
31+
#define GMUX_PORT_VALUE 0xc2
32+
#define GMUX_PORT_READ 0xd0
33+
#define GMUX_PORT_WRITE 0xd4
34+
35+
#define GMUX_MIN_IO_LEN (GMUX_PORT_BRIGHTNESS + 4)
36+
1437
#if IS_ENABLED(CONFIG_APPLE_GMUX)
1538

1639
/**

0 commit comments

Comments
 (0)