/* Although these variables are used in interrupt context, it makes no sense to *protectthem.Nouserisabletoproduceenoughkeyeventspersecondand *noticetheerrorsthatmighthappen.
*/ staticint pmac_backlight_key_queued; staticint pmac_backlight_set_legacy_queued;
/* The via-pmu code allows the backlight to be grabbed, in which case the *in-kernelcontrolofthebrightnessneedstobedisabled.Thisshould *onlybeusedbyreallyoldPowerBooks.
*/ static atomic_t kernel_backlight_disabled = ATOMIC_INIT(0);
/* Protect the pmac_backlight variable below. Youshouldholdthislockwhenusingthepmac_backlightpointerto
prevent its potential removal. */
DEFINE_MUTEX(pmac_backlight_mutex);
/* This function is called in interrupt context */ void pmac_backlight_key(int direction)
{ if (atomic_read(&kernel_backlight_disabled)) return;
/* we can receive multiple interrupts here, but the scheduled work *willrunonlyonce,withthelastvalue
*/
pmac_backlight_key_queued = direction;
schedule_work(&pmac_backlight_key_work);
}
staticint __pmac_backlight_set_legacy_brightness(int brightness)
{ int error = -ENXIO;
mutex_lock(&pmac_backlight_mutex); if (pmac_backlight) { struct backlight_properties *props;
/* This function is called in interrupt context */ void pmac_backlight_set_legacy_brightness_pmu(int brightness) { if (atomic_read(&kernel_backlight_disabled)) return;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.