2 * linux/arch/arm/mach-mmp/gplugd.c
4 * Support for the Marvell PXA168-based GuruPlug Display (gplugD) Platform.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * publishhed by the Free Software Foundation.
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
13 #include <linux/gpio.h>
14 #include <linux/gpio-pxa.h>
16 #include <asm/mach/arch.h>
17 #include <asm/mach-types.h>
19 #include <mach/irqs.h>
20 #include <mach/pxa168.h>
21 #include <mach/mfp-pxa168.h>
25 static unsigned long gplugd_pin_config
[] __initdata
= {
43 /* LCD & HDMI clock selection GPIO: 0: 74.176MHz, 1: 74.25 MHz */
45 GPIO36_GPIO
, /* CEC Interrupt */
108 GPIO104_GPIO
, /* Reset PHY */
117 /* SPI NOR Flash on SSP2 */
120 GPIO110_GPIO
, /* SPI_CSn */
132 static struct pxa_gpio_platform_data pxa168_gpio_pdata
= {
133 .irq_base
= MMP_GPIO_TO_IRQ(0),
136 static struct i2c_board_info gplugd_i2c_board_info
[] = {
143 /* Bring PHY out of reset by setting GPIO 104 */
144 static int gplugd_eth_init(void)
146 if (unlikely(gpio_request(104, "ETH_RESET_N"))) {
147 printk(KERN_ERR
"Can't get hold of GPIO 104 to bring Ethernet "
148 "PHY out of reset\n");
152 gpio_direction_output(104, 1);
157 struct pxa168_eth_platform_data gplugd_eth_platform_data
= {
160 .speed
= 0, /* Autonagotiation */
161 .init
= gplugd_eth_init
,
164 static void __init
select_disp_freq(void)
166 /* set GPIO 35 & clear GPIO 85 to set LCD External Clock to 74.25 MHz */
167 if (unlikely(gpio_request(35, "DISP_FREQ_SEL"))) {
168 printk(KERN_ERR
"Can't get hold of GPIO 35 to select display "
171 gpio_direction_output(35, 1);
175 if (unlikely(gpio_request(85, "DISP_FREQ_SEL_2"))) {
176 printk(KERN_ERR
"Can't get hold of GPIO 85 to select display "
179 gpio_direction_output(85, 0);
184 static void __init
gplugd_init(void)
186 mfp_config(ARRAY_AND_SIZE(gplugd_pin_config
));
190 /* on-chip devices */
193 pxa168_add_twsi(0, NULL
, ARRAY_AND_SIZE(gplugd_i2c_board_info
));
194 platform_device_add_data(&pxa168_device_gpio
, &pxa168_gpio_pdata
,
195 sizeof(struct pxa_gpio_platform_data
));
196 platform_device_register(&pxa168_device_gpio
);
198 pxa168_add_eth(&gplugd_eth_platform_data
);
201 MACHINE_START(GPLUGD
, "PXA168-based GuruPlug Display (gplugD) Platform")
202 .map_io
= mmp_map_io
,
203 .nr_irqs
= MMP_NR_IRQS
,
204 .init_irq
= pxa168_init_irq
,
205 .init_time
= pxa168_timer_init
,
206 .init_machine
= gplugd_init
,
207 .restart
= pxa168_restart
,