From e0a364fccbf6ff2bceb5b246cf8b0fcd5e8bc4b1 Mon Sep 17 00:00:00 2001 From: "DooHyun.Hwang" Date: Wed, 8 Sep 2010 09:58:23 +0900 Subject: S5PC11X: GPS: Add GPS init driver for Herring Add : GPS_init func. for control GPIO sysfs for GPS GPS daemon control GPS module by using /sys/class/sec/gps/ Change-Id: Ib8cc342c816c6630a3a00104ff2501ca11b278e2 Signed-off-by: DooHyun.Hwang --- arch/arm/mach-s5pv210/mach-herring.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-s5pv210/mach-herring.c b/arch/arm/mach-s5pv210/mach-herring.c index 244a265..1ebd2a7 100644 --- a/arch/arm/mach-s5pv210/mach-herring.c +++ b/arch/arm/mach-s5pv210/mach-herring.c @@ -108,6 +108,37 @@ static struct notifier_block herring_reboot_notifier = { .notifier_call = herring_notifier_call, }; +static void gps_gpio_init(void) +{ + struct device *gps_dev; + + gps_dev = device_create(sec_class, NULL, 0, NULL, "gps"); + if (IS_ERR(gps_dev)) { + pr_err("Failed to create device(gps)!\n"); + goto err; + } + + gpio_request(GPIO_GPS_nRST, "GPS_nRST"); /* XMMC3CLK */ + s3c_gpio_setpull(GPIO_GPS_nRST, S3C_GPIO_PULL_NONE); + s3c_gpio_cfgpin(GPIO_GPS_nRST, S3C_GPIO_OUTPUT); + gpio_direction_output(GPIO_GPS_nRST, 1); + + gpio_request(GPIO_GPS_PWR_EN, "GPS_PWR_EN"); /* XMMC3CLK */ + s3c_gpio_setpull(GPIO_GPS_PWR_EN, S3C_GPIO_PULL_NONE); + s3c_gpio_cfgpin(GPIO_GPS_PWR_EN, S3C_GPIO_OUTPUT); + gpio_direction_output(GPIO_GPS_PWR_EN, 0); + + s3c_gpio_setpull(GPIO_GPS_RXD, S3C_GPIO_PULL_UP); + gpio_export(GPIO_GPS_nRST, 1); + gpio_export(GPIO_GPS_PWR_EN, 1); + + gpio_export_link(gps_dev, "GPS_nRST", GPIO_GPS_nRST); + gpio_export_link(gps_dev, "GPS_PWR_EN", GPIO_GPS_PWR_EN); + + err: + return; +} + static void jupiter_switch_init(void) { sec_class = class_create(THIS_MODULE, "sec"); @@ -2627,6 +2658,8 @@ static void __init herring_machine_init(void) register_reboot_notifier(&herring_reboot_notifier); jupiter_switch_init(); + + gps_gpio_init(); } #ifdef CONFIG_USB_SUPPORT -- cgit v1.1