~ubuntu-branches/ubuntu/lucid/linux-rt/lucid

« back to all changes in this revision

Viewing changes to arch/arm/mach-pxa/palmz72.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-08-05 23:00:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090805230052-7xedvqcyk9dnnxb2
Tags: 2.6.31-1.1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <linux/pda_power.h>
28
28
#include <linux/pwm_backlight.h>
29
29
#include <linux/gpio.h>
 
30
#include <linux/wm97xx_batt.h>
30
31
#include <linux/power_supply.h>
 
32
#include <linux/usb/gpio_vbus.h>
31
33
 
32
34
#include <asm/mach-types.h>
33
35
#include <asm/mach/arch.h>
34
36
#include <asm/mach/map.h>
35
37
 
 
38
#include <mach/pxa27x.h>
36
39
#include <mach/audio.h>
37
40
#include <mach/palmz72.h>
38
41
#include <mach/mmc.h>
39
42
#include <mach/pxafb.h>
40
 
#include <mach/pxa-regs.h>
41
 
#include <mach/pxa2xx-regs.h>
42
 
#include <mach/mfp-pxa27x.h>
43
43
#include <mach/irda.h>
44
44
#include <mach/pxa27x_keypad.h>
45
45
#include <mach/udc.h>
 
46
#include <mach/palmasoc.h>
 
47
 
46
48
#include <mach/pm.h>
47
49
 
48
50
#include "generic.h"
68
70
        GPIO29_AC97_SDATA_IN_0,
69
71
        GPIO30_AC97_SDATA_OUT,
70
72
        GPIO31_AC97_SYNC,
 
73
        GPIO89_AC97_SYSCLK,
 
74
        GPIO113_AC97_nRESET,
71
75
 
72
76
        /* IrDA */
73
77
        GPIO49_GPIO,    /* ir disable */
79
83
 
80
84
        /* USB */
81
85
        GPIO15_GPIO,    /* usb detect */
82
 
        GPIO12_GPIO,    /* usb pullup */
83
 
        GPIO95_GPIO,    /* usb power */
 
86
        GPIO95_GPIO,    /* usb pullup */
84
87
 
85
88
        /* Matrix keypad */
86
89
        GPIO100_KP_MKIN_0       | WAKEUP_ON_LEVEL_HIGH,
357
360
};
358
361
 
359
362
/******************************************************************************
 
363
 * UDC
 
364
 ******************************************************************************/
 
365
static struct gpio_vbus_mach_info palmz72_udc_info = {
 
366
        .gpio_vbus              = GPIO_NR_PALMZ72_USB_DETECT_N,
 
367
        .gpio_pullup            = GPIO_NR_PALMZ72_USB_PULLUP,
 
368
};
 
369
 
 
370
static struct platform_device palmz72_gpio_vbus = {
 
371
        .name   = "gpio-vbus",
 
372
        .id     = -1,
 
373
        .dev    = {
 
374
                .platform_data  = &palmz72_udc_info,
 
375
        },
 
376
};
 
377
 
 
378
/******************************************************************************
360
379
 * Power supply
361
380
 ******************************************************************************/
362
381
static int power_supply_init(struct device *dev)
424
443
};
425
444
 
426
445
/******************************************************************************
 
446
 * WM97xx battery
 
447
 ******************************************************************************/
 
448
static struct wm97xx_batt_info wm97xx_batt_pdata = {
 
449
        .batt_aux       = WM97XX_AUX_ID3,
 
450
        .temp_aux       = WM97XX_AUX_ID2,
 
451
        .charge_gpio    = -1,
 
452
        .max_voltage    = PALMZ72_BAT_MAX_VOLTAGE,
 
453
        .min_voltage    = PALMZ72_BAT_MIN_VOLTAGE,
 
454
        .batt_mult      = 1000,
 
455
        .batt_div       = 414,
 
456
        .temp_mult      = 1,
 
457
        .temp_div       = 1,
 
458
        .batt_tech      = POWER_SUPPLY_TECHNOLOGY_LIPO,
 
459
        .batt_name      = "main-batt",
 
460
};
 
461
 
 
462
/******************************************************************************
 
463
 * aSoC audio
 
464
 ******************************************************************************/
 
465
static struct platform_device palmz72_asoc = {
 
466
        .name = "palm27x-asoc",
 
467
        .id   = -1,
 
468
};
 
469
 
 
470
/******************************************************************************
427
471
 * Framebuffer
428
472
 ******************************************************************************/
429
473
static struct pxafb_mode_info palmz72_lcd_modes[] = {
529
573
static struct platform_device *devices[] __initdata = {
530
574
        &palmz72_backlight,
531
575
        &palmz72_leds,
 
576
        &palmz72_asoc,
532
577
        &power_supply,
 
578
        &palmz72_gpio_vbus,
533
579
};
534
580
 
 
581
/* setup udc GPIOs initial state */
 
582
static void __init palmz72_udc_init(void)
 
583
{
 
584
        if (!gpio_request(GPIO_NR_PALMZ72_USB_PULLUP, "USB Pullup")) {
 
585
                gpio_direction_output(GPIO_NR_PALMZ72_USB_PULLUP, 0);
 
586
                gpio_free(GPIO_NR_PALMZ72_USB_PULLUP);
 
587
        }
 
588
}
 
589
 
535
590
static void __init palmz72_init(void)
536
591
{
537
592
        pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config));
 
593
 
538
594
        set_pxa_fb_info(&palmz72_lcd_screen);
539
595
        pxa_set_mci_info(&palmz72_mci_platform_data);
 
596
        palmz72_udc_init();
540
597
        pxa_set_ac97_info(NULL);
541
598
        pxa_set_ficp_info(&palmz72_ficp_platform_data);
542
599
        pxa_set_keypad_info(&palmz72_keypad_platform_data);
 
600
        wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
 
601
 
543
602
        platform_add_devices(devices, ARRAY_SIZE(devices));
544
603
}
545
604