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/gpio.h>
20 #include <linux/irq.h>
21 #include <linux/platform_device.h>
23 #include <asm/mach/arch.h>
25 #include <mach/common.h>
26 #include <mach/iomux.h>
27 #include <mach/imxfb.h>
28 #include <mach/hardware.h>
33 static int pcm970_pins[] = {
41 GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN, /* card detect */
71 * it seems the data line misses a pullup, so we must enable
72 * the internal pullup as a local workaround
74 PD17_PF_I2C_DATA | GPIO_PUEN,
91 static int pcm970_sdhc2_get_ro(struct device *dev)
93 return gpio_get_value(GPIO_PORTC + 28);
96 static int pcm970_sdhc2_init(struct device *dev, irq_handler_t detect_irq, void *data)
100 ret = request_irq(IRQ_GPIOC(29), detect_irq, IRQF_TRIGGER_FALLING,
101 "imx-mmc-detect", data);
105 ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro");
107 free_irq(IRQ_GPIOC(29), data);
111 gpio_direction_input(GPIO_PORTC + 28);
116 static void pcm970_sdhc2_exit(struct device *dev, void *data)
118 free_irq(IRQ_GPIOC(29), data);
119 gpio_free(GPIO_PORTC + 28);
122 static struct imxmmc_platform_data sdhc_pdata = {
123 .get_ro = pcm970_sdhc2_get_ro,
124 .init = pcm970_sdhc2_init,
125 .exit = pcm970_sdhc2_exit,
129 * Connected is a portrait Sharp-QVGA display
130 * of type: LQ035Q7DH06
132 static struct imx_fb_platform_data pcm038_fb_data = {
133 .pixclock = 188679, /* in ps (5.3MHz) */
145 .fixed_screen_cpu = 0,
148 * - HSYNC active high
149 * - VSYNC active high
150 * - clk notenabled while idle
151 * - clock not inverted
152 * - data not inverted
153 * - data enable low active
154 * - enable sharp mode
163 * system init for baseboard usage. Will be called by pcm038 init.
165 * Add platform devices present on this baseboard and init
166 * them from CPU side as far as required to use them later on
168 void __init pcm970_baseboard_init(void)
170 mxc_gpio_setup_multiple_pins(pcm970_pins, ARRAY_SIZE(pcm970_pins),
173 mxc_register_device(&mxc_fb_device, &pcm038_fb_data);
174 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);