2 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 #include <linux/platform_device.h>
20 #include <linux/gpio.h>
21 #include <linux/irq.h>
23 #include <asm/mach/arch.h>
25 #include <mach/hardware.h>
26 #include <mach/common.h>
28 #include <mach/imxfb.h>
29 #include <mach/iomux.h>
33 static int pcm970_sdhc2_get_ro(struct device
*dev
)
35 return gpio_get_value(GPIO_PORTC
+ 28);
38 static int pcm970_sdhc2_pins
[] = {
47 static int pcm970_sdhc2_init(struct device
*dev
, irq_handler_t detect_irq
, void *data
)
51 ret
= mxc_gpio_setup_multiple_pins(pcm970_sdhc2_pins
,
52 ARRAY_SIZE(pcm970_sdhc2_pins
), "sdhc2");
56 ret
= request_irq(IRQ_GPIOC(29), detect_irq
, 0,
57 "imx-mmc-detect", data
);
59 goto out_release_gpio
;
61 set_irq_type(IRQ_GPIOC(29), IRQF_TRIGGER_FALLING
);
63 ret
= gpio_request(GPIO_PORTC
+ 28, "imx-mmc-ro");
65 goto out_release_gpio
;
67 mxc_gpio_mode((GPIO_PORTC
| 28) | GPIO_GPIO
| GPIO_IN
);
68 gpio_direction_input(GPIO_PORTC
+ 28);
73 mxc_gpio_release_multiple_pins(pcm970_sdhc2_pins
,
74 ARRAY_SIZE(pcm970_sdhc2_pins
));
78 static void pcm970_sdhc2_exit(struct device
*dev
, void *data
)
80 free_irq(IRQ_GPIOC(29), data
);
81 gpio_free(GPIO_PORTC
+ 28);
82 mxc_gpio_release_multiple_pins(pcm970_sdhc2_pins
,
83 ARRAY_SIZE(pcm970_sdhc2_pins
));
86 static struct imxmmc_platform_data sdhc_pdata
= {
87 .get_ro
= pcm970_sdhc2_get_ro
,
88 .init
= pcm970_sdhc2_init
,
89 .exit
= pcm970_sdhc2_exit
,
92 static int mxc_fb_pins
[] = {
93 PA5_PF_LSCLK
, PA6_PF_LD0
, PA7_PF_LD1
, PA8_PF_LD2
,
94 PA9_PF_LD3
, PA10_PF_LD4
, PA11_PF_LD5
, PA12_PF_LD6
,
95 PA13_PF_LD7
, PA14_PF_LD8
, PA15_PF_LD9
, PA16_PF_LD10
,
96 PA17_PF_LD11
, PA18_PF_LD12
, PA19_PF_LD13
, PA20_PF_LD14
,
97 PA21_PF_LD15
, PA22_PF_LD16
, PA23_PF_LD17
, PA24_PF_REV
,
98 PA25_PF_CLS
, PA26_PF_PS
, PA27_PF_SPL_SPR
, PA28_PF_HSYNC
,
99 PA29_PF_VSYNC
, PA30_PF_CONTRAST
, PA31_PF_OE_ACD
102 static int pcm038_fb_init(struct platform_device
*pdev
)
104 return mxc_gpio_setup_multiple_pins(mxc_fb_pins
,
105 ARRAY_SIZE(mxc_fb_pins
), "FB");
108 static int pcm038_fb_exit(struct platform_device
*pdev
)
110 mxc_gpio_release_multiple_pins(mxc_fb_pins
, ARRAY_SIZE(mxc_fb_pins
));
116 * Connected is a portrait Sharp-QVGA display
117 * of type: LQ035Q7DH06
119 static struct imx_fb_platform_data pcm038_fb_data
= {
120 .pixclock
= 188679, /* in ps (5.3MHz) */
132 .fixed_screen_cpu
= 0,
135 * - HSYNC active high
136 * - VSYNC active high
137 * - clk notenabled while idle
138 * - clock not inverted
139 * - data not inverted
140 * - data enable low active
141 * - enable sharp mode
148 .init
= pcm038_fb_init
,
149 .exit
= pcm038_fb_exit
,
153 * system init for baseboard usage. Will be called by pcm038 init.
155 * Add platform devices present on this baseboard and init
156 * them from CPU side as far as required to use them later on
158 void __init
pcm970_baseboard_init(void)
160 mxc_register_device(&mxc_fb_device
, &pcm038_fb_data
);
161 mxc_register_device(&mxc_sdhc_device1
, &sdhc_pdata
);