diff options
Diffstat (limited to 'arch/arm/mach-s5pv210/mach-goni.c')
-rw-r--r-- | arch/arm/mach-s5pv210/mach-goni.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c index 30ad59f6970f..435b68f07086 100644 --- a/arch/arm/mach-s5pv210/mach-goni.c +++ b/arch/arm/mach-s5pv210/mach-goni.c | |||
@@ -17,6 +17,9 @@ | |||
17 | #include <linux/i2c-gpio.h> | 17 | #include <linux/i2c-gpio.h> |
18 | #include <linux/mfd/max8998.h> | 18 | #include <linux/mfd/max8998.h> |
19 | #include <linux/regulator/fixed.h> | 19 | #include <linux/regulator/fixed.h> |
20 | #include <linux/spi/spi.h> | ||
21 | #include <linux/spi/spi_gpio.h> | ||
22 | #include <linux/lcd.h> | ||
20 | #include <linux/gpio_keys.h> | 23 | #include <linux/gpio_keys.h> |
21 | #include <linux/input.h> | 24 | #include <linux/input.h> |
22 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
@@ -113,6 +116,65 @@ static struct s3c_fb_platdata goni_lcd_pdata __initdata = { | |||
113 | .setup_gpio = s5pv210_fb_gpio_setup_24bpp, | 116 | .setup_gpio = s5pv210_fb_gpio_setup_24bpp, |
114 | }; | 117 | }; |
115 | 118 | ||
119 | static int lcd_power_on(struct lcd_device *ld, int enable) | ||
120 | { | ||
121 | return 1; | ||
122 | } | ||
123 | |||
124 | static int reset_lcd(struct lcd_device *ld) | ||
125 | { | ||
126 | static unsigned int first = 1; | ||
127 | int reset_gpio = -1; | ||
128 | |||
129 | reset_gpio = S5PV210_MP05(5); | ||
130 | |||
131 | if (first) { | ||
132 | gpio_request(reset_gpio, "MLCD_RST"); | ||
133 | first = 0; | ||
134 | } | ||
135 | |||
136 | gpio_direction_output(reset_gpio, 1); | ||
137 | return 1; | ||
138 | } | ||
139 | |||
140 | static struct lcd_platform_data goni_lcd_platform_data = { | ||
141 | .reset = reset_lcd, | ||
142 | .power_on = lcd_power_on, | ||
143 | .lcd_enabled = 0, | ||
144 | .reset_delay = 120, /* 120ms */ | ||
145 | .power_on_delay = 25, /* 25ms */ | ||
146 | .power_off_delay = 200, /* 200ms */ | ||
147 | }; | ||
148 | |||
149 | #define LCD_BUS_NUM 3 | ||
150 | static struct spi_board_info spi_board_info[] __initdata = { | ||
151 | { | ||
152 | .modalias = "s6e63m0", | ||
153 | .platform_data = &goni_lcd_platform_data, | ||
154 | .max_speed_hz = 1200000, | ||
155 | .bus_num = LCD_BUS_NUM, | ||
156 | .chip_select = 0, | ||
157 | .mode = SPI_MODE_3, | ||
158 | .controller_data = (void *)S5PV210_MP01(1), /* DISPLAY_CS */ | ||
159 | }, | ||
160 | }; | ||
161 | |||
162 | static struct spi_gpio_platform_data lcd_spi_gpio_data = { | ||
163 | .sck = S5PV210_MP04(1), /* DISPLAY_CLK */ | ||
164 | .mosi = S5PV210_MP04(3), /* DISPLAY_SI */ | ||
165 | .miso = SPI_GPIO_NO_MISO, | ||
166 | .num_chipselect = 1, | ||
167 | }; | ||
168 | |||
169 | static struct platform_device goni_spi_gpio = { | ||
170 | .name = "spi_gpio", | ||
171 | .id = LCD_BUS_NUM, | ||
172 | .dev = { | ||
173 | .parent = &s3c_device_fb.dev, | ||
174 | .platform_data = &lcd_spi_gpio_data, | ||
175 | }, | ||
176 | }; | ||
177 | |||
116 | /* KEYPAD */ | 178 | /* KEYPAD */ |
117 | static uint32_t keymap[] __initdata = { | 179 | static uint32_t keymap[] __initdata = { |
118 | /* KEY(row, col, keycode) */ | 180 | /* KEY(row, col, keycode) */ |
@@ -513,6 +575,7 @@ static void goni_setup_sdhci(void) | |||
513 | static struct platform_device *goni_devices[] __initdata = { | 575 | static struct platform_device *goni_devices[] __initdata = { |
514 | &s3c_device_fb, | 576 | &s3c_device_fb, |
515 | &s5p_device_onenand, | 577 | &s5p_device_onenand, |
578 | &goni_spi_gpio, | ||
516 | &goni_i2c_gpio_pmic, | 579 | &goni_i2c_gpio_pmic, |
517 | &mmc2_fixed_voltage, | 580 | &mmc2_fixed_voltage, |
518 | &goni_device_gpiokeys, | 581 | &goni_device_gpiokeys, |
@@ -545,6 +608,9 @@ static void __init goni_machine_init(void) | |||
545 | /* FB */ | 608 | /* FB */ |
546 | s3c_fb_set_platdata(&goni_lcd_pdata); | 609 | s3c_fb_set_platdata(&goni_lcd_pdata); |
547 | 610 | ||
611 | /* SPI */ | ||
612 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); | ||
613 | |||
548 | /* KEYPAD */ | 614 | /* KEYPAD */ |
549 | samsung_keypad_set_platdata(&keypad_data); | 615 | samsung_keypad_set_platdata(&keypad_data); |
550 | 616 | ||