~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/arm/mach-omap2/board-apollon.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <linux/err.h>
28
28
#include <linux/clk.h>
29
29
#include <linux/smc91x.h>
 
30
#include <linux/gpio.h>
30
31
 
31
32
#include <mach/hardware.h>
32
33
#include <asm/mach-types.h>
33
34
#include <asm/mach/arch.h>
34
35
#include <asm/mach/flash.h>
35
36
 
36
 
#include <mach/gpio.h>
37
37
#include <plat/led.h>
38
38
#include <plat/usb.h>
39
39
#include <plat/board.h>
202
202
        unsigned int rate;
203
203
        struct clk *gpmc_fck;
204
204
        int eth_cs;
 
205
        int err;
205
206
 
206
207
        gpmc_fck = clk_get(NULL, "gpmc_fck");   /* Always on ENABLE_ON_INIT */
207
208
        if (IS_ERR(gpmc_fck)) {
245
246
        apollon_smc91x_resources[0].end   = base + 0x30f;
246
247
        udelay(100);
247
248
 
248
 
        omap_mux_init_gpio(74, 0);
249
 
        if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) {
 
249
        omap_mux_init_gpio(APOLLON_ETHR_GPIO_IRQ, 0);
 
250
        err = gpio_request_one(APOLLON_ETHR_GPIO_IRQ, GPIOF_IN, "SMC91x irq");
 
251
        if (err) {
250
252
                printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
251
253
                        APOLLON_ETHR_GPIO_IRQ);
252
254
                gpmc_cs_free(APOLLON_ETH_CS);
253
 
                goto out;
254
255
        }
255
 
        gpio_direction_input(APOLLON_ETHR_GPIO_IRQ);
256
 
 
257
256
out:
258
257
        clk_disable(gpmc_fck);
259
258
        clk_put(gpmc_fck);
280
279
        omap2_init_common_devices(NULL, NULL);
281
280
}
282
281
 
 
282
static struct gpio apollon_gpio_leds[] __initdata = {
 
283
        { LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0" }, /* LED0 - AA10 */
 
284
        { LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1" }, /* LED1 - AA6  */
 
285
        { LED2_GPIO15, GPIOF_OUT_INIT_LOW, "LED2" }, /* LED2 - AA4  */
 
286
};
 
287
 
283
288
static void __init apollon_led_init(void)
284
289
{
285
 
        /* LED0 - AA10 */
286
290
        omap_mux_init_signal("vlynq_clk.gpio_13", 0);
287
 
        gpio_request(LED0_GPIO13, "LED0");
288
 
        gpio_direction_output(LED0_GPIO13, 0);
289
 
        /* LED1  - AA6 */
290
291
        omap_mux_init_signal("vlynq_rx1.gpio_14", 0);
291
 
        gpio_request(LED1_GPIO14, "LED1");
292
 
        gpio_direction_output(LED1_GPIO14, 0);
293
 
        /* LED2  - AA4 */
294
292
        omap_mux_init_signal("vlynq_rx0.gpio_15", 0);
295
 
        gpio_request(LED2_GPIO15, "LED2");
296
 
        gpio_direction_output(LED2_GPIO15, 0);
 
293
 
 
294
        gpio_request_array(apollon_gpio_leds, ARRAY_SIZE(apollon_gpio_leds));
297
295
}
298
296
 
299
297
static void __init apollon_usb_init(void)
301
299
        /* USB device */
302
300
        /* DEVICE_SUSPEND */
303
301
        omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
304
 
        gpio_request(12, "USB suspend");
305
 
        gpio_direction_output(12, 0);
 
302
        gpio_request_one(12, GPIOF_OUT_INIT_LOW, "USB suspend");
306
303
        omap2_usbfs_init(&apollon_usb_config);
307
304
}
308
305