From e7afcc773b419b5186a5697f61c3ad29ac486613 Mon Sep 17 00:00:00 2001 From: Balaji Rao Date: Thu, 20 Nov 2008 19:46:50 +0000 Subject: gta02_regulator_constraints.patch Specify regulator constraints for gta02. For now, constraints for only the current used devices are specified. --- arch/arm/mach-s3c2440/mach-gta02.c | 50 +++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c index f0ecc641790..96f4502b2b2 100644 --- a/arch/arm/mach-s3c2440/mach-gta02.c +++ b/arch/arm/mach-s3c2440/mach-gta02.c @@ -47,6 +47,8 @@ #include +#include + #include #include @@ -555,11 +557,19 @@ static struct platform_device gta02_glamo_dev; static void mangle_glamo_res_by_system_rev(void); static void gta02_pcf50633_attach_child_devices(struct device *parent_device); +static void gta02_pcf50633_regulator_registered(struct pcf50633_data *pcf, int id); static struct platform_device gta02_pm_wlan_dev = { .name = "gta02-pm-wlan", }; +static struct regulator_consumer_supply ldo4_consumers[] = { + { + .dev = >a01_pm_bt_dev.dev, + .supply = "BT_3V2", + }, +}; + struct pcf50633_platform_data gta02_pcf_pdata = { .used_features = PCF50633_FEAT_MBC | PCF50633_FEAT_BBC | @@ -675,7 +685,22 @@ struct pcf50633_platform_data gta02_pcf_pdata = { }, .defer_resume_backlight = 1, .resume_backlight_ramp_speed = 5, - .attach_child_devices = gta02_pcf50633_attach_child_devices + .attach_child_devices = gta02_pcf50633_attach_child_devices, + .regulator_registered = gta02_pcf50633_regulator_registered, + + .reg_init_data = { + [PCF50633_REGULATOR_LDO4] = { + .constraints = { + .min_uV = 3200000, + .max_uV = 3200000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .apply_uV = 1, + }, + .num_consumer_supplies = 1, + .consumer_supplies = ldo4_consumers, + }, + + }, }; @@ -1512,11 +1537,10 @@ static struct platform_device *gta02_devices[] __initdata = { /* these guys DO need to be children of PMU */ static struct platform_device *gta02_devices_pmu_children[] = { - >a02_glamo_dev, /* glamo-mci power handling depends on PMU */ + >a02_glamo_dev, &s3c_device_ts, /* input 1 */ - >a01_pm_gps_dev, - >a01_pm_bt_dev, >a02_pm_gsm_dev, + >a01_pm_gps_dev, >a02_pm_usbhost_dev, &s3c_device_spi_acc1, /* input 2 */ &s3c_device_spi_acc2, /* input 3 */ @@ -1524,6 +1548,24 @@ static struct platform_device *gta02_devices_pmu_children[] = { >a02_resume_reason_device, }; +static void gta02_pcf50633_regulator_registered(struct pcf50633_data *pcf, int id) +{ + struct platform_device *regulator, *pdev; + + regulator = pcf->regulator_pdev[id]; + + switch(id) { + case PCF50633_REGULATOR_LDO4: + pdev = >a01_pm_bt_dev; + break; + default: + return; + } + + pdev->dev.parent = ®ulator->dev; + platform_device_register(pdev); +} + /* this is called when pc50633 is probed, unfortunately quite late in the * day since it is an I2C bus device. Here we can belatedly define some * platform devices with the advantage that we can mark the pcf50633 as the -- cgit v1.2.3