Hi
I'm designing ANDROID custom device with reference of Beaglebone, OS version is ICS.
I'm trying to implement user LED in GPIO. My process is blink the LED when the usb is connected and data transferring and "mmc0" is connected and transferring data.
Its my works done for implement LED
1--> configured the LED Support in kernel AOSP/kernel$: make menuconfig drivers-->LED Support, and also i have tried the following commands
AOSP/kernel$ CONFIG_LEDS_CLASS=y
AOSP/kernel$ CONFIG_LEDS_GPIO=y
AOSP/kernel$ CONFIG_LEDS_GPIO_PLATFORM=y
( after build completed LED support is unchecked as default, i don't know what happen at there.)
2--> write the code in board-am335xevm.c
#include <linux/leds.h>
static struct pinmux_config bone_pin_mux[] = {
/* User LED gpios (gpio1_21 to gpio1_24) */
{"gpmc_a5.rgmii2_td0", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
{"gpmc_a6.rgmii2_tclk", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
{"gpmc_a7.rgmii2_rclk", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
{"gpmc_a8.rgmii2_rd3", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
/* Grounding gpio1_6 (pin 3 Conn A) signals bone tester to start diag tests */
{"gpmc_ad6.gpio1_6", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
};
/* LEDS - gpio1_21 -> gpio1_24 */
#define BEAGLEBONE_USR1_LED GPIO_TO_PIN(1, 21)
#define BEAGLEBONE_USR2_LED GPIO_TO_PIN(1, 22)
#define BEAGLEBONE_USR3_LED GPIO_TO_PIN(1, 23)
#define BEAGLEBONE_USR4_LED GPIO_TO_PIN(1, 24)
static struct gpio_led bone_gpio_leds[] = {
{
.name = "beaglebone::usr0",
.default_trigger = "heartbeat",
.gpio = BEAGLEBONE_USR1_LED,
},
{
.name = "beaglebone::usr1",
.default_trigger = "mmc0",
.gpio = BEAGLEBONE_USR2_LED,
},
{
.name = "beaglebone::usr2",
.gpio = BEAGLEBONE_USR3_LED,
},
{
.name = "beaglebone::usr3",
.gpio = BEAGLEBONE_USR4_LED,
},
};
static struct gpio_led_platform_data bone_gpio_led_info = {
.leds = bone_gpio_leds,
.num_leds = ARRAY_SIZE(bone_gpio_leds),
};
static struct platform_device bone_leds_gpio = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &bone_gpio_led_info,
},
};
static void boneleds_init(int evm_id, int profile )
{
int err;
setup_pin_mux(bone_pin_mux);
err = platform_device_register(&bone_leds_gpio);
if (err)
pr_err("failed to register BeagleBone LEDS\n");
}
/* Beaglebone Rev A3 and after */
static struct evm_dev_cfg beaglebone_dev_cfg[] = {
{boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
{NULL, 0, 0},
};
After booting the LED is not blinking.
3--> when i try to access sys/class/leds there is no leds directory
Can anyone guess at where i did the mistake.
Can anyone help me to drive the LED in BEAGLEBONE.
Note: i have tried Beaglebone LED patch that's also not working.
Thanks in advance.