2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 03:04:01 +08:00
linux-next/arch/arm/mach-omap1/leds.c
Tony Lindgren 4b25408f1f ARM: OMAP: Move gpio.h to include/linux/platform_data
This way we can remove includes of plat/gpio.h which won't work
with the single zImage support.

Note that we also remove the cpu_class_is_omap2() check
in gpio-omap.c as the drivers should not call it as we need to
make it local to arch/arm/mach-omap2 for single zImage support.

While at it, arrange the related includes in the standard way.

Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: linux-mtd@lists.infradead.org
Cc: alsa-devel@alsa-project.org
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-09-12 18:06:30 -07:00

71 lines
1.5 KiB
C

/*
* linux/arch/arm/mach-omap1/leds.c
*
* OMAP LEDs dispatcher
*/
#include <linux/gpio.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_data/gpio-omap.h>
#include <asm/leds.h>
#include <asm/mach-types.h>
#include <plat/mux.h>
#include "leds.h"
static int __init
omap_leds_init(void)
{
if (!cpu_class_is_omap1())
return -ENODEV;
if (machine_is_omap_innovator())
leds_event = innovator_leds_event;
else if (machine_is_omap_h2()
|| machine_is_omap_h3()
|| machine_is_omap_perseus2())
leds_event = h2p2_dbg_leds_event;
else if (machine_is_omap_osk())
leds_event = osk_leds_event;
else
return -1;
if (machine_is_omap_h2()
|| machine_is_omap_h3()
#ifdef CONFIG_OMAP_OSK_MISTRAL
|| machine_is_omap_osk()
#endif
) {
/* LED1/LED2 pins can be used as GPIO (as done here), or by
* the LPG (works even in deep sleep!), to drive a bicolor
* LED on the H2 sample board, and another on the H2/P2
* "surfer" expansion board.
*
* The same pins drive a LED on the OSK Mistral board, but
* that's a different kind of LED (just one color at a time).
*/
omap_cfg_reg(P18_1610_GPIO3);
if (gpio_request(3, "LED red") == 0)
gpio_direction_output(3, 1);
else
printk(KERN_WARNING "LED: can't get GPIO3/red?\n");
omap_cfg_reg(MPUIO4);
if (gpio_request(OMAP_MPUIO(4), "LED green") == 0)
gpio_direction_output(OMAP_MPUIO(4), 1);
else
printk(KERN_WARNING "LED: can't get MPUIO4/green?\n");
}
leds_event(led_start);
return 0;
}
__initcall(omap_leds_init);