Update of /cvsroot/blob/blob/src/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv27097/src/lib
Modified Files:
Makefile.am
Added Files:
led-pxa.c
Log Message:
pxa led breakout
--- NEW FILE: led-pxa.c ---
/*
* led-pxa.c: simple LED control functions
*
* Copyright (C) 1999 2001 Erik Mouw (J.A...@it...)
* Copyright (C) 1999 2003 stefan Eletzhofer <ste...@in...>
*
* $Id: led-pxa.c,v 1.1 2003/11/10 17:06:41 seletz Exp $
*
* 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. 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/*
* All functions assume that the LED is properly initialised by the code
* in ledasm-pxa.S.
*
*/
#ident "$Id: led-pxa.c,v 1.1 2003/11/10 17:06:41 seletz Exp $"
#ifdef HAVE_CONFIG_H
# include <blob/config.h>
#endif
#include <blob/main.h>
#include <blob/arch.h>
#include <blob/led.h>
#include <blob/init.h>
static int led_state;
static int led_locked;
static void pxa_led_on (void)
{
if (!led_locked) {
GPSR0 = LED_GPIO;
led_state = 1;
}
}
static void pxa_led_off (void)
{
if (!led_locked) {
GPCR0 = LED_GPIO;
led_state = 0;
}
}
static void pxa_led_toggle (void)
{
if (led_state)
pxa_led_off ();
else
pxa_led_on ();
}
static void pxa_led_lock (void)
{
led_locked = 1;
}
static void pxa_led_unlock (void)
{
led_locked = 0;
}
static led_driver_t pxa_gpio_led_driver = {
.led_on = pxa_led_on,
.led_off = pxa_led_off,
.led_toggle = pxa_led_toggle,
.led_lock = pxa_led_lock,
.led_unlock = pxa_led_unlock
};
Index: Makefile.am
===================================================================
RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- Makefile.am 4 Sep 2003 18:03:09 -0000 1.33
+++ Makefile.am 10 Nov 2003 17:06:41 -0000 1.34
@@ -57,6 +57,7 @@
led-mmap.c \
led-s3c2500.c \
led-sa11x0.c \
+ led-pxa.c \
reboot-pxa.c \
reboot-s3c2500.c \
reboot-sa11x0.c \
|