2 * arch/arm/mach-pxa/colibri-pxa3xx.c
4 * Common functions for all Toradex PXA3xx modules
6 * Daniel Mack <daniel@caiaq.de>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/init.h>
14 #include <linux/kernel.h>
15 #include <linux/platform_device.h>
16 #include <linux/gpio.h>
17 #include <asm/mach-types.h>
18 #include <mach/hardware.h>
19 #include <asm/sizes.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/irq.h>
22 #include <mach/pxa3xx-regs.h>
23 #include <mach/mfp-pxa300.h>
24 #include <mach/colibri.h>
26 #include <mach/pxafb.h>
31 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
32 static int mmc_detect_pin;
34 static int colibri_pxa3xx_mci_init(struct device *dev,
35 irq_handler_t colibri_mmc_detect_int,
40 ret = gpio_request(mmc_detect_pin, "mmc card detect");
44 gpio_direction_input(mmc_detect_pin);
45 ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int,
46 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
47 "MMC card detect", data);
49 gpio_free(mmc_detect_pin);
56 static void colibri_pxa3xx_mci_exit(struct device *dev, void *data)
58 free_irq(mmc_detect_pin, data);
59 gpio_free(gpio_to_irq(mmc_detect_pin));
62 static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = {
64 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
65 .init = colibri_pxa3xx_mci_init,
66 .exit = colibri_pxa3xx_mci_exit,
69 void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin)
71 pxa3xx_mfp_config(pins, len);
72 mmc_detect_pin = detect_pin;
73 pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data);
75 #endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */
77 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
78 static int lcd_bl_pin;
81 * LCD panel (Sharp LQ043T3DX02)
83 static void colibri_lcd_backlight(int on)
85 gpio_set_value(lcd_bl_pin, !!on);
88 static struct pxafb_mode_info sharp_lq43_mode = {
104 static struct pxafb_mach_info sharp_lq43_info = {
105 .modes = &sharp_lq43_mode,
109 .lcd_conn = LCD_COLOR_TFT_18BPP,
110 .pxafb_backlight_power = colibri_lcd_backlight,
113 void __init colibri_pxa3xx_init_lcd(int bl_pin)
116 gpio_request(bl_pin, "lcd backlight");
117 gpio_direction_output(bl_pin, 0);
118 set_pxa_fb_info(&sharp_lq43_info);