32 #define OPREGION_HEADER_OFFSET 0
33 #define OPREGION_ACPI_OFFSET 0x100
34 #define ACPI_CLID 0x01ac
35 #define ACPI_CDCK 0x01b0
36 #define OPREGION_SWSCI_OFFSET 0x200
37 #define OPREGION_ASLE_OFFSET 0x300
38 #define OPREGION_VBT_OFFSET 0x400
40 #define OPREGION_SIGNATURE "IntelGraphicsMem"
41 #define MBOX_ACPI (1<<0)
42 #define MBOX_SWSCI (1<<1)
43 #define MBOX_ASLE (1<<2)
101 #define ASLE_SET_ALS_ILLUM (1 << 0)
102 #define ASLE_SET_BACKLIGHT (1 << 1)
103 #define ASLE_SET_PFIT (1 << 2)
104 #define ASLE_SET_PWM_FREQ (1 << 3)
105 #define ASLE_REQ_MSK 0xf
108 #define ASLE_ALS_ILLUM_FAILED (1<<10)
109 #define ASLE_BACKLIGHT_FAILED (1<<12)
110 #define ASLE_PFIT_FAILED (1<<14)
111 #define ASLE_PWM_FREQ_FAILED (1<<16)
114 #define ASLE_BCLP_VALID (1<<31)
115 #define ASLE_BCLP_MSK (~(1<<31))
118 #define ASLE_PFIT_VALID (1<<31)
119 #define ASLE_PFIT_CENTER (1<<0)
120 #define ASLE_PFIT_STRETCH_TEXT (1<<1)
121 #define ASLE_PFIT_STRETCH_GFX (1<<2)
124 #define ASLE_ALS_ILLUM_FAILED (1<<10)
125 #define ASLE_BACKLIGHT_FAILED (1<<12)
126 #define ASLE_PFIT_FAILED (1<<14)
127 #define ASLE_PWM_FREQ_FAILED (1<<16)
130 #define ASLE_BCLP_VALID (1<<31)
131 #define ASLE_BCLP_MSK (~(1<<31))
134 #define ASLE_PFIT_VALID (1<<31)
135 #define ASLE_PFIT_CENTER (1<<0)
136 #define ASLE_PFIT_STRETCH_TEXT (1<<1)
137 #define ASLE_PFIT_STRETCH_GFX (1<<2)
140 #define ASLE_PFMB_BRIGHTNESS_MASK (0xff)
141 #define ASLE_PFMB_BRIGHTNESS_VALID (1<<8)
142 #define ASLE_PFMB_PWM_MASK (0x7ffffe00)
143 #define ASLE_PFMB_PWM_VALID (1<<31)
145 #define ASLE_CBLV_VALID (1<<31)
155 DRM_DEBUG_DRIVER(
"asle set backlight %x\n", bclp);
189 DRM_DEBUG_DRIVER(
"non asle set request??\n");
194 asle_stat |= asle_set_backlight(dev, asle->
bclp);
196 asle->
aslc = asle_stat;
199 #define ASLE_ALS_EN (1<<0)
200 #define ASLE_BLC_EN (1<<1)
201 #define ASLE_PFIT_EN (1<<2)
202 #define ASLE_PFMB_EN (1<<3)
209 if (asle && system_opregion ) {
221 #define ACPI_EV_DISPLAY_SWITCH (1<<0)
222 #define ACPI_EV_LID (1<<1)
223 #define ACPI_EV_DOCK (1<<2)
226 static int psb_intel_opregion_video_event(
struct notifier_block *nb,
238 if (!system_opregion)
241 acpi = system_opregion->
acpi;
248 .notifier_call = psb_intel_opregion_video_event,
259 if (opregion->
acpi) {
263 opregion->
acpi->csts = 0;
264 opregion->
acpi->drdy = 1;
266 system_opregion = opregion;
279 if (opregion->
acpi) {
280 opregion->
acpi->drdy = 0;
282 system_opregion =
NULL;
303 pci_read_config_dword(dev->pdev,
PCI_ASLS, &opregion_phy);
304 if (opregion_phy == 0) {
305 DRM_DEBUG_DRIVER(
"ACPI Opregion not supported\n");
308 DRM_DEBUG(
"OpRegion detected at 0x%8x\n", opregion_phy);
309 base = acpi_os_ioremap(opregion_phy, 8*1024);
314 DRM_DEBUG_DRIVER(
"opregion signature mismatch\n");
324 mboxes = opregion->
header->mboxes;
326 DRM_DEBUG_DRIVER(
"Public ACPI methods supported\n");
331 DRM_DEBUG_DRIVER(
"ASLE supported\n");