Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ab8500-mfd: add regulator support to ab8500 mfd device

Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-By: Mattias Wallin <mattias.wallin@stericsson.com>
Acked-By: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>

authored by

Sundar R Iyer and committed by
Liam Girdwood
549931f9 1880a2fc

+34 -1
+3 -1
drivers/mfd/ab8500-core.c
··· 16 16 #include <linux/platform_device.h> 17 17 #include <linux/mfd/core.h> 18 18 #include <linux/mfd/ab8500.h> 19 + #include <linux/regulator/ab8500.h> 19 20 20 21 /* 21 22 * Interrupt register offsets ··· 353 352 { .name = "ab8500-audio", }, 354 353 { .name = "ab8500-usb", }, 355 354 { .name = "ab8500-pwm", }, 355 + { .name = "ab8500-regulator", }, 356 356 }; 357 357 358 358 int __devinit ab8500_init(struct ab8500 *ab8500) ··· 413 411 goto out_removeirq; 414 412 } 415 413 416 - ret = mfd_add_devices(ab8500->dev, -1, ab8500_devs, 414 + ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, 417 415 ARRAY_SIZE(ab8500_devs), NULL, 418 416 ab8500->irq_base); 419 417 if (ret)
+6
include/linux/mfd/ab8500.h
··· 76 76 #define AB8500_NR_IRQS 104 77 77 #define AB8500_NUM_IRQ_REGS 13 78 78 79 + #define AB8500_NUM_REGULATORS 15 80 + 79 81 /** 80 82 * struct ab8500 - ab8500 internal structure 81 83 * @dev: parent device ··· 110 108 u8 oldmask[AB8500_NUM_IRQ_REGS]; 111 109 }; 112 110 111 + struct regulator_init_data; 112 + 113 113 /** 114 114 * struct ab8500_platform_data - AB8500 platform data 115 115 * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used 116 116 * @init: board-specific initialization after detection of ab8500 117 + * @regulator: machine-specific constraints for regulators 117 118 */ 118 119 struct ab8500_platform_data { 119 120 int irq_base; 120 121 void (*init) (struct ab8500 *); 122 + struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; 121 123 }; 122 124 123 125 extern int ab8500_write(struct ab8500 *a8500, u16 addr, u8 data);
+25
include/linux/regulator/ab8500.h
··· 1 + /* 2 + * Copyright (C) ST-Ericsson SA 2010 3 + * 4 + * License Terms: GNU General Public License v2 5 + * 6 + * Author: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson 7 + * 8 + */ 9 + 10 + #ifndef __LINUX_MFD_AB8500_REGULATOR_H 11 + #define __LINUX_MFD_AB8500_REGULATOR_H 12 + 13 + /* AB8500 regulators */ 14 + #define AB8500_LDO_AUX1 0 15 + #define AB8500_LDO_AUX2 1 16 + #define AB8500_LDO_AUX3 2 17 + #define AB8500_LDO_INTCORE 3 18 + #define AB8500_LDO_TVOUT 4 19 + #define AB8500_LDO_AUDIO 5 20 + #define AB8500_LDO_ANAMIC1 6 21 + #define AB8500_LDO_ANAMIC2 7 22 + #define AB8500_LDO_DMIC 8 23 + #define AB8500_LDO_ANA 9 24 + 25 + #endif