FreeBSD/sys/dev/drm2/radeon/radeon_acpi.c
/**
 * radeon_atif_handler - handle ATIF notify requests
 *
 * @rdev: radeon_device pointer
 * @event: atif sbios request struct
 *
 * Checks the acpi event and if it matches an atif event,
 * handles it.
 * Returns NOTIFY code
 */
handle ATIF notify requests
@rdev: radeon_device pointer
@event: atif sbios request struct

Checks the acpi event and if it matches an atif event,
handles it.
Returns NOTIFY code
handle ATIF notify requests @rdev : radeon_device pointer @event : atif sbios request struct Checks the acpi event and if it matches an atif event handles it . Returns NOTIFY code
void radeon_atif_handler(struct radeon_device *rdev,
    UINT32 type)
{
	struct radeon_atif *atif = &rdev->atif;
	struct atif_sbios_requests req;
	ACPI_HANDLE handle;
	int count;
	DRM_DEBUG_DRIVER("event, type = %#x\n",
			type);
	if (!atif->notification_cfg.enabled ||
			type != atif->notification_cfg.command_code)
		return;
	handle = rdev->acpi.handle;
	count = radeon_atif_get_sbios_requests(handle, &req);
	if (count <= 0)
		return;
	DRM_DEBUG_DRIVER("ATIF: %d pending SBIOS requests\n", count);
	if (req.pending & ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST) {
		struct radeon_encoder *enc = atif->encoder_for_bl;
		if (enc) {
			DRM_DEBUG_DRIVER("Changing brightness to %d\n",
					req.backlight_level);
			radeon_set_backlight_level(rdev, enc, req.backlight_level);
#ifdef FREEBSD_WIP
			if (rdev->is_atom_bios) {
				struct radeon_encoder_atom_dig *dig = enc->enc_priv;
				backlight_force_update(dig->bl_dev,
						       BACKLIGHT_UPDATE_HOTKEY);
			} else {
				struct radeon_encoder_lvds *dig = enc->enc_priv;
				backlight_force_update(dig->bl_dev,
						       BACKLIGHT_UPDATE_HOTKEY);
			}
#endif 
		}
	}
}
void radeon_atif_handler ( struct radeon_device * rdev , UINT32 type ) { struct radeon_atif * atif = & rdev -> atif ; struct atif_sbios_requests req ; ACPI_HANDLE handle ; int count ; DRM_DEBUG_DRIVER ( " \n " , type ) ; if ( ! atif -> notification_cfg . enabled || type != atif -> notification_cfg . command_code ) return ; handle = rdev -> acpi . handle ; count = radeon_atif_get_sbios_requests ( handle , & req ) ; if ( count <= 0 ) return ; DRM_DEBUG_DRIVER ( " \n " , count ) ; if ( req . pending & ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST ) { struct radeon_encoder * enc = atif -> encoder_for_bl ; if ( enc ) { DRM_DEBUG_DRIVER ( " \n " , req . backlight_level ) ; radeon_set_backlight_level ( rdev , enc , req . backlight_level ) ; #ifdef FREEBSD_WIP if ( rdev -> is_atom_bios ) { struct radeon_encoder_atom_dig * dig = enc -> enc_priv ; backlight_force_update ( dig -> bl_dev , BACKLIGHT_UPDATE_HOTKEY ) ; } else { struct radeon_encoder_lvds * dig = enc -> enc_priv ; backlight_force_update ( dig -> bl_dev , BACKLIGHT_UPDATE_HOTKEY ) ; } #endif } } }
radeon_atif_handler - handle ATIF notify requests
 @rdev: radeon_device pointer
 @event: atif sbios request struct
radeon_atif_handler - handle ATIF notify requests @rdev : radeon_device pointer @event : atif sbios request struct
/* Not our event */ /* Check pending SBIOS requests */ /* FREEBSD_WIP */ /* TODO: check other events */ /* We've handled the event, stop the notifier chain. The ACPI interface
	 * overloads ACPI_VIDEO_NOTIFY_PROBE, we don't want to send that to
	 * userspace if the event was generated only to signal a SBIOS
	 * request.
	 */