Hammer LED Class Driver

UserSpace Access

the LED onboard the hammer as well as the LED on the carrier board can be accessed from userspace via the sysfs interface. example interfaces are in /sys/devices/platform/s3c24xx_led.0/leds:led0/ and /sys/devices/platform/s3c24xx_led.1/leds:led1/. both directories include a file entry "brightness". to turn a LED on, echo a non zero value to the brightness file entry:

echo 1 > /sys/devices/platform/s3c24xx_led.0/leds:led0/brightness

to turn a LED off, echo a zero to the the brightness file entry:

echo 0 > /sys/devices/platform/s3c24xx_led.0/leds:led0/brightness

you can also check the current status of the LED by using cat on the brightness file entry:

cat /sys/devices/platform/s3c24xx_led.0/leds:led0/brightness

Adding New LEDS

a new LED connected via a GPIO can be defined in the linux-2.6.xx/arch/arm/mach-s3c2410/mach-tct_hammer.c file. each LED will need to include some platform data and a platform device definition. Make sure the platform data and the platform device are above the platform declaration: