/* * via-pmu LED class device * * Copyright 2006 Johannes Berg <johannes@sipsolutions.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or * NON INFRINGEMENT. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
*/ #include <linux/types.h> #include <linux/kernel.h> #include <linux/device.h> #include <linux/leds.h> #include <linux/adb.h> #include <linux/pmu.h> #include <linux/of.h>
static spinlock_t pmu_blink_lock; staticstruct adb_request pmu_blink_req; /* -1: no change, 0: request off, 1: request on */ staticint requested_change;
spin_lock_irqsave(&pmu_blink_lock, flags); /* if someone requested a change in the meantime * (we only see the last one which is fine)
* then apply it now */ if (requested_change != -1 && !pmu_sys_suspended)
pmu_request(&pmu_blink_req, NULL, 4, 0xee, 4, 0, requested_change); /* reset requested change */
requested_change = -1;
spin_unlock_irqrestore(&pmu_blink_lock, flags);
}
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.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.