diff options
-rw-r--r-- | arch/arm/mach-s3c2440/mach-gta02.c | 50 | ||||
-rw-r--r-- | drivers/regulator/pcf50633-regulator.c | 2 | ||||
-rw-r--r-- | include/linux/pcf50633.h | 2 |
3 files changed, 48 insertions, 6 deletions
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 <linux/i2c.h> +#include <linux/regulator/machine.h> + #include <linux/pcf50633.h> #include <linux/lis302dl.h> @@ -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 diff --git a/drivers/regulator/pcf50633-regulator.c b/drivers/regulator/pcf50633-regulator.c index 371d02f9824..e34e344965c 100644 --- a/drivers/regulator/pcf50633-regulator.c +++ b/drivers/regulator/pcf50633-regulator.c @@ -266,7 +266,7 @@ int __init pcf50633_regulator_probe(struct platform_device *pdev) return PTR_ERR(rdev); if (pcf->pdata->regulator_registered) - pcf->pdata->regulator_registered(pdev->id); + pcf->pdata->regulator_registered(pcf, pdev->id); return 0; } diff --git a/include/linux/pcf50633.h b/include/linux/pcf50633.h index bcd19fe3249..ab73cb99ad0 100644 --- a/include/linux/pcf50633.h +++ b/include/linux/pcf50633.h @@ -200,7 +200,7 @@ struct pcf50633_platform_data { struct regulator_init_data reg_init_data[__NUM_PCF50633_REGULATORS]; /* Called when a regulator has been registered */ - void (*regulator_registered)(int regulator_id); + void (*regulator_registered)(struct pcf50633_data *pcf, int id); /* Runtime data */ struct pcf50633_data *pcf; |