Lines Matching refs:opregion
242 struct opregion_swsci *swsci = dev_priv->opregion.swsci; in swsci()
257 if ((dev_priv->opregion.swsci_sbcb_sub_functions & in swsci()
261 if ((dev_priv->opregion.swsci_gbda_sub_functions & in swsci()
415 struct opregion_asle *asle = dev_priv->opregion.asle; in asle_set_backlight()
522 struct intel_opregion *opregion = in asle_work() local
525 container_of(opregion, struct drm_i915_private, opregion); in asle_work()
527 struct opregion_asle *asle = dev_priv->opregion.asle; in asle_work()
577 if (dev_priv->opregion.asle) in intel_opregion_asle_intr()
578 schedule_work(&dev_priv->opregion.asle_work); in intel_opregion_asle_intr()
625 static u32 get_did(struct intel_opregion *opregion, int i) in get_did() argument
629 if (i < ARRAY_SIZE(opregion->acpi->didl)) { in get_did()
630 did = opregion->acpi->didl[i]; in get_did()
632 i -= ARRAY_SIZE(opregion->acpi->didl); in get_did()
634 if (WARN_ON(i >= ARRAY_SIZE(opregion->acpi->did2))) in get_did()
637 did = opregion->acpi->did2[i]; in get_did()
643 static void set_did(struct intel_opregion *opregion, int i, u32 val) in set_did() argument
645 if (i < ARRAY_SIZE(opregion->acpi->didl)) { in set_did()
646 opregion->acpi->didl[i] = val; in set_did()
648 i -= ARRAY_SIZE(opregion->acpi->didl); in set_did()
650 if (WARN_ON(i >= ARRAY_SIZE(opregion->acpi->did2))) in set_did()
653 opregion->acpi->did2[i] = val; in set_did()
660 struct intel_opregion *opregion = &dev_priv->opregion; in intel_didl_outputs() local
696 max_outputs = ARRAY_SIZE(opregion->acpi->didl) + in intel_didl_outputs()
697 ARRAY_SIZE(opregion->acpi->did2); in intel_didl_outputs()
710 set_did(opregion, i++, (u32)(device_id & 0x0f0f)); in intel_didl_outputs()
719 set_did(opregion, i, 0); in intel_didl_outputs()
753 temp = get_did(opregion, i); in intel_didl_outputs()
754 set_did(opregion, i, temp | (1 << 31) | output_type | i); in intel_didl_outputs()
763 struct intel_opregion *opregion = &dev_priv->opregion; in intel_setup_cadls() local
774 disp_id = get_did(opregion, i); in intel_setup_cadls()
775 opregion->acpi->cadl[i] = disp_id; in intel_setup_cadls()
782 struct intel_opregion *opregion = &dev_priv->opregion; in intel_opregion_init() local
784 if (!opregion->header) in intel_opregion_init()
787 if (opregion->acpi) { in intel_opregion_init()
794 opregion->acpi->csts = 0; in intel_opregion_init()
795 opregion->acpi->drdy = 1; in intel_opregion_init()
797 system_opregion = opregion; in intel_opregion_init()
801 if (opregion->asle) { in intel_opregion_init()
802 opregion->asle->tche = ASLE_TCHE_BLC_EN; in intel_opregion_init()
803 opregion->asle->ardy = ASLE_ARDY_READY; in intel_opregion_init()
810 struct intel_opregion *opregion = &dev_priv->opregion; in intel_opregion_fini() local
812 if (!opregion->header) in intel_opregion_fini()
815 if (opregion->asle) in intel_opregion_fini()
816 opregion->asle->ardy = ASLE_ARDY_NOT_READY; in intel_opregion_fini()
818 cancel_work_sync(&dev_priv->opregion.asle_work); in intel_opregion_fini()
820 if (opregion->acpi) { in intel_opregion_fini()
821 opregion->acpi->drdy = 0; in intel_opregion_fini()
828 memunmap(opregion->header); in intel_opregion_fini()
829 opregion->header = NULL; in intel_opregion_fini()
830 opregion->acpi = NULL; in intel_opregion_fini()
831 opregion->swsci = NULL; in intel_opregion_fini()
832 opregion->asle = NULL; in intel_opregion_fini()
833 opregion->vbt = NULL; in intel_opregion_fini()
834 opregion->lid_state = NULL; in intel_opregion_fini()
840 struct intel_opregion *opregion = &dev_priv->opregion; in swsci_setup() local
845 opregion->swsci_gbda_sub_functions = 1; in swsci_setup()
846 opregion->swsci_sbcb_sub_functions = 1; in swsci_setup()
852 opregion->swsci_gbda_sub_functions |= tmp; in swsci_setup()
862 opregion->swsci_sbcb_sub_functions |= tmp; in swsci_setup()
879 u32 req = opregion->swsci_sbcb_sub_functions; in swsci_setup()
885 opregion->swsci_sbcb_sub_functions |= tmp; in swsci_setup()
890 opregion->swsci_gbda_sub_functions, in swsci_setup()
891 opregion->swsci_sbcb_sub_functions); in swsci_setup()
900 struct intel_opregion *opregion = &dev_priv->opregion; in intel_opregion_setup() local
919 INIT_WORK(&opregion->asle_work, asle_work); in intel_opregion_setup()
933 opregion->header = base; in intel_opregion_setup()
934 opregion->vbt = base + OPREGION_VBT_OFFSET; in intel_opregion_setup()
936 opregion->lid_state = base + ACPI_CLID; in intel_opregion_setup()
938 mboxes = opregion->header->mboxes; in intel_opregion_setup()
941 opregion->acpi = base + OPREGION_ACPI_OFFSET; in intel_opregion_setup()
946 opregion->swsci = base + OPREGION_SWSCI_OFFSET; in intel_opregion_setup()
951 opregion->asle = base + OPREGION_ASLE_OFFSET; in intel_opregion_setup()
953 opregion->asle->ardy = ASLE_ARDY_NOT_READY; in intel_opregion_setup()