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>
21 #include "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 .intf
= PHY_INTERFACE_MODE_RMII
,
162 .init
= gplugd_eth_init
,
165 static void __init
select_disp_freq(void)
167 /* set GPIO 35 & clear GPIO 85 to set LCD External Clock to 74.25 MHz */
168 if (unlikely(gpio_request(35, "DISP_FREQ_SEL"))) {
169 printk(KERN_ERR
"Can't get hold of GPIO 35 to select display "
172 gpio_direction_output(35, 1);
176 if (unlikely(gpio_request(85, "DISP_FREQ_SEL_2"))) {
177 printk(KERN_ERR
"Can't get hold of GPIO 85 to select display "
180 gpio_direction_output(85, 0);
185 static void __init
gplugd_init(void)
187 mfp_config(ARRAY_AND_SIZE(gplugd_pin_config
));
191 /* on-chip devices */
194 pxa168_add_twsi(0, NULL
, ARRAY_AND_SIZE(gplugd_i2c_board_info
));
195 platform_device_add_data(&pxa168_device_gpio
, &pxa168_gpio_pdata
,
196 sizeof(struct pxa_gpio_platform_data
));
197 platform_device_register(&pxa168_device_gpio
);
199 pxa168_add_eth(&gplugd_eth_platform_data
);
202 MACHINE_START(GPLUGD
, "PXA168-based GuruPlug Display (gplugD) Platform")
203 .map_io
= mmp_map_io
,
204 .nr_irqs
= MMP_NR_IRQS
,
205 .init_irq
= pxa168_init_irq
,
206 .init_time
= pxa168_timer_init
,
207 .init_machine
= gplugd_init
,
208 .restart
= pxa168_restart
,