aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/em-x270.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/em-x270.c')
-rw-r--r--arch/arm/mach-pxa/em-x270.c63
1 files changed, 58 insertions, 5 deletions
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 243e0802b5f4..63b10d9bb1d3 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -30,6 +30,7 @@
30#include <linux/apm-emulation.h> 30#include <linux/apm-emulation.h>
31#include <linux/i2c.h> 31#include <linux/i2c.h>
32#include <linux/i2c/pca953x.h> 32#include <linux/i2c/pca953x.h>
33#include <linux/regulator/userspace-consumer.h>
33 34
34#include <media/soc_camera.h> 35#include <media/soc_camera.h>
35 36
@@ -735,6 +736,7 @@ static struct pxa2xx_spi_chip em_x270_libertas_chip = {
735 .rx_threshold = 1, 736 .rx_threshold = 1,
736 .tx_threshold = 1, 737 .tx_threshold = 1,
737 .timeout = 1000, 738 .timeout = 1000,
739 .gpio_cs = 14,
738}; 740};
739 741
740static unsigned long em_x270_libertas_pin_config[] = { 742static unsigned long em_x270_libertas_pin_config[] = {
@@ -803,7 +805,6 @@ static int em_x270_libertas_teardown(struct spi_device *spi)
803 805
804struct libertas_spi_platform_data em_x270_libertas_pdata = { 806struct libertas_spi_platform_data em_x270_libertas_pdata = {
805 .use_dummy_writes = 1, 807 .use_dummy_writes = 1,
806 .gpio_cs = 14,
807 .setup = em_x270_libertas_setup, 808 .setup = em_x270_libertas_setup,
808 .teardown = em_x270_libertas_teardown, 809 .teardown = em_x270_libertas_teardown,
809}; 810};
@@ -838,10 +839,14 @@ static void __init em_x270_init_spi(void)
838static inline void em_x270_init_spi(void) {} 839static inline void em_x270_init_spi(void) {}
839#endif 840#endif
840 841
841#if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE) 842#if defined(CONFIG_SND_PXA2XX_LIB_AC97)
843static pxa2xx_audio_ops_t em_x270_ac97_info = {
844 .reset_gpio = 113,
845};
846
842static void __init em_x270_init_ac97(void) 847static void __init em_x270_init_ac97(void)
843{ 848{
844 pxa_set_ac97_info(NULL); 849 pxa_set_ac97_info(&em_x270_ac97_info);
845} 850}
846#else 851#else
847static inline void em_x270_init_ac97(void) {} 852static inline void em_x270_init_ac97(void) {}
@@ -1038,6 +1043,52 @@ static void __init em_x270_init_camera(void)
1038static inline void em_x270_init_camera(void) {} 1043static inline void em_x270_init_camera(void) {}
1039#endif 1044#endif
1040 1045
1046static struct regulator_bulk_data em_x270_gps_consumer_supply = {
1047 .supply = "vcc gps",
1048};
1049
1050static struct regulator_userspace_consumer_data em_x270_gps_consumer_data = {
1051 .name = "vcc gps",
1052 .num_supplies = 1,
1053 .supplies = &em_x270_gps_consumer_supply,
1054};
1055
1056static struct platform_device em_x270_gps_userspace_consumer = {
1057 .name = "reg-userspace-consumer",
1058 .id = 0,
1059 .dev = {
1060 .platform_data = &em_x270_gps_consumer_data,
1061 },
1062};
1063
1064static struct regulator_bulk_data em_x270_gprs_consumer_supply = {
1065 .supply = "vcc gprs",
1066};
1067
1068static struct regulator_userspace_consumer_data em_x270_gprs_consumer_data = {
1069 .name = "vcc gprs",
1070 .num_supplies = 1,
1071 .supplies = &em_x270_gprs_consumer_supply
1072};
1073
1074static struct platform_device em_x270_gprs_userspace_consumer = {
1075 .name = "reg-userspace-consumer",
1076 .id = 1,
1077 .dev = {
1078 .platform_data = &em_x270_gprs_consumer_data,
1079 }
1080};
1081
1082static struct platform_device *em_x270_userspace_consumers[] = {
1083 &em_x270_gps_userspace_consumer,
1084 &em_x270_gprs_userspace_consumer,
1085};
1086
1087static void __init em_x270_userspace_consumers_init(void)
1088{
1089 platform_add_devices(ARRAY_AND_SIZE(em_x270_userspace_consumers));
1090}
1091
1041/* DA9030 related initializations */ 1092/* DA9030 related initializations */
1042#define REGULATOR_CONSUMER(_name, _dev, _supply) \ 1093#define REGULATOR_CONSUMER(_name, _dev, _supply) \
1043 static struct regulator_consumer_supply _name##_consumers[] = { \ 1094 static struct regulator_consumer_supply _name##_consumers[] = { \
@@ -1047,11 +1098,11 @@ static inline void em_x270_init_camera(void) {}
1047 }, \ 1098 }, \
1048 } 1099 }
1049 1100
1050REGULATOR_CONSUMER(ldo3, NULL, "vcc gps"); 1101REGULATOR_CONSUMER(ldo3, &em_x270_gps_userspace_consumer.dev, "vcc gps");
1051REGULATOR_CONSUMER(ldo5, NULL, "vcc cam"); 1102REGULATOR_CONSUMER(ldo5, NULL, "vcc cam");
1052REGULATOR_CONSUMER(ldo10, &pxa_device_mci.dev, "vcc sdio"); 1103REGULATOR_CONSUMER(ldo10, &pxa_device_mci.dev, "vcc sdio");
1053REGULATOR_CONSUMER(ldo12, NULL, "vcc usb"); 1104REGULATOR_CONSUMER(ldo12, NULL, "vcc usb");
1054REGULATOR_CONSUMER(ldo19, NULL, "vcc gprs"); 1105REGULATOR_CONSUMER(ldo19, &em_x270_gprs_userspace_consumer.dev, "vcc gprs");
1055 1106
1056#define REGULATOR_INIT(_ldo, _min_uV, _max_uV, _ops_mask) \ 1107#define REGULATOR_INIT(_ldo, _min_uV, _max_uV, _ops_mask) \
1057 static struct regulator_init_data _ldo##_data = { \ 1108 static struct regulator_init_data _ldo##_data = { \
@@ -1062,6 +1113,7 @@ REGULATOR_CONSUMER(ldo19, NULL, "vcc gprs");
1062 .enabled = 0, \ 1113 .enabled = 0, \
1063 }, \ 1114 }, \
1064 .valid_ops_mask = _ops_mask, \ 1115 .valid_ops_mask = _ops_mask, \
1116 .apply_uV = 1, \
1065 }, \ 1117 }, \
1066 .num_consumer_supplies = ARRAY_SIZE(_ldo##_consumers), \ 1118 .num_consumer_supplies = ARRAY_SIZE(_ldo##_consumers), \
1067 .consumer_supplies = _ldo##_consumers, \ 1119 .consumer_supplies = _ldo##_consumers, \
@@ -1240,6 +1292,7 @@ static void __init em_x270_init(void)
1240 em_x270_init_spi(); 1292 em_x270_init_spi();
1241 em_x270_init_i2c(); 1293 em_x270_init_i2c();
1242 em_x270_init_camera(); 1294 em_x270_init_camera();
1295 em_x270_userspace_consumers_init();
1243} 1296}
1244 1297
1245MACHINE_START(EM_X270, "Compulab EM-X270") 1298MACHINE_START(EM_X270, "Compulab EM-X270")