Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188516
b: refs/heads/master
c: f8e6dbf
h: refs/heads/master
v: v3
  • Loading branch information
Sonic Zhang authored and Mike Frysinger committed Mar 9, 2010
1 parent 4953eea commit 2c2ebe6
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5f9531c7e588ee62e3aeddb14613ea80e7c2ca2
refs/heads/master: f8e6dbffa7a6cb3da3bcaf1fde3039896e1ac764
99 changes: 99 additions & 0 deletions trunk/arch/blackfin/mach-bf537/boards/stamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
#include <asm/reboot.h>
#include <asm/portmux.h>
#include <asm/dpmc.h>
#ifdef CONFIG_REGULATOR_ADP_SWITCH
#include <linux/regulator/adp_switch.h>
#endif
#ifdef CONFIG_REGULATOR_AD5398
#include <linux/regulator/ad5398.h>
#endif
Expand Down Expand Up @@ -2008,6 +2011,93 @@ static struct platform_device bfin_ac97 = {
};
#endif

#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
#define REGULATOR_ADP122 "adp122"
#define REGULATOR_ADP150 "adp150"

static struct regulator_consumer_supply adp122_consumers = {
.supply = REGULATOR_ADP122,
};

static struct regulator_consumer_supply adp150_consumers = {
.supply = REGULATOR_ADP150,
};

static struct regulator_init_data adp_switch_regulator_data[] = {
{
.constraints = {
.name = REGULATOR_ADP122,
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 1, /* only 1 */
.consumer_supplies = &adp122_consumers,
.driver_data = (void *)GPIO_PF2, /* gpio port only */
},
{
.constraints = {
.name = REGULATOR_ADP150,
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 1, /* only 1 */
.consumer_supplies = &adp150_consumers,
.driver_data = (void *)GPIO_PF3, /* gpio port only */
},
};

static struct adp_switch_platform_data adp_switch_pdata = {
.regulator_num = ARRAY_SIZE(adp_switch_regulator_data),
.regulator_data = adp_switch_regulator_data,
};

static struct platform_device adp_switch_device = {
.name = "adp_switch",
.id = 0,
.dev = {
.platform_data = &adp_switch_pdata,
},
};

#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
static struct regulator_bulk_data adp122_bulk_data = {
.supply = REGULATOR_ADP122,
};

static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = {
.name = REGULATOR_ADP122,
.num_supplies = 1,
.supplies = &adp122_bulk_data,
};

static struct platform_device adp122_userspace_consumer_device = {
.name = "reg-userspace-consumer",
.id = 0,
.dev = {
.platform_data = &adp122_userspace_comsumer_data,
},
};

static struct regulator_bulk_data adp150_bulk_data = {
.supply = REGULATOR_ADP150,
};

static struct regulator_userspace_consumer_data adp150_userspace_comsumer_data = {
.name = REGULATOR_ADP150,
.num_supplies = 1,
.supplies = &adp150_bulk_data,
};

static struct platform_device adp150_userspace_consumer_device = {
.name = "reg-userspace-consumer",
.id = 1,
.dev = {
.platform_data = &adp150_userspace_comsumer_data,
},
};
#endif
#endif


static struct platform_device *stamp_devices[] __initdata = {

&bfin_dpmc,
Expand Down Expand Up @@ -2138,6 +2228,15 @@ static struct platform_device *stamp_devices[] __initdata = {
&ad5398_userspace_consumer_device,
#endif
#endif

#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
&adp_switch_device,
#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
&adp122_userspace_consumer_device,
&adp150_userspace_consumer_device,
#endif
#endif
};

static int __init stamp_init(void)
Expand Down

0 comments on commit 2c2ebe6

Please sign in to comment.