From 3c4a1161634e1b425c9f1154b1935c6b9f422394 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 22 Jan 2010 12:59:41 +0100 Subject: gta02: Configure pcf50633-gpio device and add a regulator device which represents the power switch in front of the gsm modem. --- arch/arm/mach-s3c2442/mach-gta02.c | 53 +++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-s3c2442/mach-gta02.c') diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c index cdd569885cd..eb41ad901cf 100644 --- a/arch/arm/mach-s3c2442/mach-gta02.c +++ b/arch/arm/mach-s3c2442/mach-gta02.c @@ -305,6 +305,39 @@ static struct platform_device gta02_pm_wlan_dev = { .name = "gta02-pm-wlan", }; +static struct regulator_consumer_supply gsm_supply_consumer = { + .dev = >a02_pm_gsm_dev.dev, + .supply = "GSM", +}; + +static struct regulator_init_data gsm_supply_init_data = { + .constraints = { + .min_uV = 3700000, + .max_uV = 3700000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &gsm_supply_consumer, +}; + +static struct fixed_voltage_config gsm_supply_config = { + .supply_name = "GSM", + .microvolts = 3700000, + .gpio = GTA02_GPIO_PCF(PCF50633_GPIO2), + .enable_high = 1, + .init_data = &gsm_supply_init_data, +}; + +static struct platform_device gta02_gsm_supply_device = { + .name = "reg-fixed-voltage", + .id = 1, + .dev = { + .platform_data = &gsm_supply_config, + }, +}; + + #ifdef CONFIG_CHARGER_PCF50633 /* * On GTA02 the 1A charger features a 48K resistor to 0V on the ID pin. @@ -343,7 +376,7 @@ gta02_configure_pmu_for_charger(struct pcf50633 *pcf, void *unused, int res) * Sanity - stop GPO driving out now that we have a 1A charger * GPO controls USB Host power generation on GTA02 */ - pcf50633_gpio_set(pcf, PCF50633_GPO, 0); + /*pcf50633_gpio_set(pcf, PCF50633_GPO, 0);*/ ma = 1000; } else @@ -1073,6 +1106,14 @@ struct gta02_device_children { void (*probed_callback)(struct device *dev); }; +static struct platform_device* gta02_pcf50633_gpio_children[] = { + >a02_gsm_supply_device, +}; + +static struct platform_device* gta02_gsm_supply_children[] = { + >a02_pm_gsm_dev, +}; + static struct platform_device* gta02_hdq_children[] = { &bq27000_battery_device, }; @@ -1087,6 +1128,16 @@ static struct gta02_device_children gta02_device_children[] = { .dev_name = "spi2.0", .probed_callback = gta02_jbt6k74_probe_completed, }, + { + .dev_name = "pcf50633-gpio", + .num_children = 1, + .children = gta02_pcf50633_gpio_children, + }, + { + .dev_name = "reg-fixed-voltage.1", + .num_children = 1, + .children = gta02_gsm_supply_children, + } }; static int gta02_add_child_devices(struct device *parent, -- cgit v1.2.3