aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c64xx/mach-smartq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c64xx/mach-smartq.c')
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index 028d080dcd35..3a9639bc3d9b 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -16,6 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/pwm_backlight.h> 17#include <linux/pwm_backlight.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/spi/spi_gpio.h>
19#include <linux/usb/gpio_vbus.h> 20#include <linux/usb/gpio_vbus.h>
20 21
21#include <asm/mach-types.h> 22#include <asm/mach-types.h>
@@ -166,7 +167,7 @@ static struct s3c2410_ts_mach_info smartq_touchscreen_pdata __initdata = {
166 167
167static struct s3c_sdhci_platdata smartq_internal_hsmmc_pdata = { 168static struct s3c_sdhci_platdata smartq_internal_hsmmc_pdata = {
168 .max_width = 4, 169 .max_width = 4,
169 /*.broken_card_detection = true,*/ 170 .cd_type = S3C_SDHCI_CD_PERMANENT,
170}; 171};
171 172
172static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = { 173static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = {
@@ -184,6 +185,33 @@ static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = {
184 }, 185 },
185}; 186};
186 187
188static int __init smartq_lcd_setup_gpio(void)
189{
190 int ret;
191
192 ret = gpio_request(S3C64XX_GPM(3), "LCD power");
193 if (ret < 0)
194 return ret;
195
196 /* turn power off */
197 gpio_direction_output(S3C64XX_GPM(3), 0);
198
199 return 0;
200}
201
202/* GPM0 -> CS */
203static struct spi_gpio_platform_data smartq_lcd_control = {
204 .sck = S3C64XX_GPM(1),
205 .mosi = S3C64XX_GPM(2),
206 .miso = S3C64XX_GPM(2),
207};
208
209static struct platform_device smartq_lcd_control_device = {
210 .name = "spi-gpio",
211 .id = 1,
212 .dev.platform_data = &smartq_lcd_control,
213};
214
187static void smartq_lcd_power_set(struct plat_lcd_data *pd, unsigned int power) 215static void smartq_lcd_power_set(struct plat_lcd_data *pd, unsigned int power)
188{ 216{
189 gpio_direction_output(S3C64XX_GPM(3), power); 217 gpio_direction_output(S3C64XX_GPM(3), power);
@@ -199,6 +227,9 @@ static struct platform_device smartq_lcd_power_device = {
199 .dev.platform_data = &smartq_lcd_power_data, 227 .dev.platform_data = &smartq_lcd_power_data,
200}; 228};
201 229
230static struct i2c_board_info smartq_i2c_devs[] __initdata = {
231 { I2C_BOARD_INFO("wm8987", 0x1a), },
232};
202 233
203static struct platform_device *smartq_devices[] __initdata = { 234static struct platform_device *smartq_devices[] __initdata = {
204 &s3c_device_hsmmc1, /* Init iNAND first, ... */ 235 &s3c_device_hsmmc1, /* Init iNAND first, ... */
@@ -213,7 +244,9 @@ static struct platform_device *smartq_devices[] __initdata = {
213 &s3c_device_timer[1], 244 &s3c_device_timer[1],
214 &s3c_device_ts, 245 &s3c_device_ts,
215 &s3c_device_usb_hsotg, 246 &s3c_device_usb_hsotg,
247 &s3c64xx_device_iis0,
216 &smartq_backlight_device, 248 &smartq_backlight_device,
249 &smartq_lcd_control_device,
217 &smartq_lcd_power_device, 250 &smartq_lcd_power_device,
218 &smartq_usb_otg_vbus_dev, 251 &smartq_usb_otg_vbus_dev,
219}; 252};
@@ -252,7 +285,6 @@ static int __init smartq_power_off_init(void)
252 /* leave power on */ 285 /* leave power on */
253 gpio_direction_output(S3C64XX_GPK(15), 0); 286 gpio_direction_output(S3C64XX_GPK(15), 0);
254 287
255
256 pm_power_off = smartq_power_off; 288 pm_power_off = smartq_power_off;
257 289
258 return ret; 290 return ret;
@@ -354,6 +386,10 @@ void __init smartq_machine_init(void)
354 s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata); 386 s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata);
355 s3c24xx_ts_set_platdata(&smartq_touchscreen_pdata); 387 s3c24xx_ts_set_platdata(&smartq_touchscreen_pdata);
356 388
389 i2c_register_board_info(0, smartq_i2c_devs,
390 ARRAY_SIZE(smartq_i2c_devs));
391
392 WARN_ON(smartq_lcd_setup_gpio());
357 WARN_ON(smartq_power_off_init()); 393 WARN_ON(smartq_power_off_init());
358 WARN_ON(smartq_usb_host_init()); 394 WARN_ON(smartq_usb_host_init());
359 WARN_ON(smartq_usb_otg_init()); 395 WARN_ON(smartq_usb_otg_init());