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/gpio.h>
14 #include <asm/mach/arch.h>
15 #include <asm/mach-types.h>
17 #include <mach/irqs.h>
18 #include <mach/pxa168.h>
19 #include <mach/mfp-pxa168.h>
23 static unsigned long gplugd_pin_config
[] __initdata
= {
41 /* LCD & HDMI clock selection GPIO: 0: 74.176MHz, 1: 74.25 MHz */
43 GPIO36_GPIO
, /* CEC Interrupt */
106 GPIO104_GPIO
, /* Reset PHY */
115 /* SPI NOR Flash on SSP2 */
118 GPIO110_GPIO
, /* SPI_CSn */
130 static struct i2c_board_info gplugd_i2c_board_info
[] = {
137 /* Bring PHY out of reset by setting GPIO 104 */
138 static int gplugd_eth_init(void)
140 if (unlikely(gpio_request(104, "ETH_RESET_N"))) {
141 printk(KERN_ERR
"Can't get hold of GPIO 104 to bring Ethernet "
142 "PHY out of reset\n");
146 gpio_direction_output(104, 1);
151 struct pxa168_eth_platform_data gplugd_eth_platform_data
= {
154 .speed
= 0, /* Autonagotiation */
155 .init
= gplugd_eth_init
,
158 static void __init
select_disp_freq(void)
160 /* set GPIO 35 & clear GPIO 85 to set LCD External Clock to 74.25 MHz */
161 if (unlikely(gpio_request(35, "DISP_FREQ_SEL"))) {
162 printk(KERN_ERR
"Can't get hold of GPIO 35 to select display "
165 gpio_direction_output(35, 1);
169 if (unlikely(gpio_request(85, "DISP_FREQ_SEL_2"))) {
170 printk(KERN_ERR
"Can't get hold of GPIO 85 to select display "
173 gpio_direction_output(85, 0);
178 static void __init
gplugd_init(void)
180 mfp_config(ARRAY_AND_SIZE(gplugd_pin_config
));
184 /* on-chip devices */
187 pxa168_add_twsi(0, NULL
, ARRAY_AND_SIZE(gplugd_i2c_board_info
));
188 platform_device_register(&pxa168_device_gpio
);
190 pxa168_add_eth(&gplugd_eth_platform_data
);
193 MACHINE_START(GPLUGD
, "PXA168-based GuruPlug Display (gplugD) Platform")
194 .map_io
= mmp_map_io
,
195 .nr_irqs
= MMP_NR_IRQS
,
196 .init_irq
= pxa168_init_irq
,
197 .timer
= &pxa168_timer
,
198 .init_machine
= gplugd_init
,
199 .restart
= pxa168_restart
,