diff options
author | Nishanth Menon <nm@ti.com> | 2011-06-28 20:22:29 -0700 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2011-06-29 13:31:08 -0700 |
commit | 744ff7f5aa20f437aa2b17e18bc1cb77d477f5b5 (patch) | |
tree | b231833bf8752eb155a7b616733d162968946cc6 /arch/arm/mach-omap2/omap_pmic.c | |
parent | 3e5fbbae24a661c6c31e80d389f4f75fc519b03a (diff) | |
download | kernel_samsung_tuna-744ff7f5aa20f437aa2b17e18bc1cb77d477f5b5.zip kernel_samsung_tuna-744ff7f5aa20f437aa2b17e18bc1cb77d477f5b5.tar.gz kernel_samsung_tuna-744ff7f5aa20f437aa2b17e18bc1cb77d477f5b5.tar.bz2 |
OMAP2+: PMIC: add ability to modify the map
This allows temporary maps to be setup and updated. This allows
platforms to modify the pre-existing default maps as needed.
Acked-by: Colin Cross <ccross@google.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_pmic.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_pmic.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_pmic.c b/arch/arm/mach-omap2/omap_pmic.c index ddf1b9d..6febc36 100644 --- a/arch/arm/mach-omap2/omap_pmic.c +++ b/arch/arm/mach-omap2/omap_pmic.c @@ -11,6 +11,7 @@ #include <linux/init.h> #include <linux/kernel.h> +#include <linux/string.h> #include "voltage.h" @@ -73,3 +74,24 @@ next: return 0; } + +int __init omap_pmic_update(struct omap_pmic_map *tmp_map, char *name, + u16 old_chip_id, u16 new_chip_id) +{ + while (tmp_map->name != NULL) { + if (!strcmp(tmp_map->name, name) && + (tmp_map->omap_chip.oc & new_chip_id)) { + WARN("%s: this map already exists\n", __func__, name, + new_chip_id); + return -1; + } + if (!strcmp(tmp_map->name, name) && + (tmp_map->omap_chip.oc & old_chip_id)) + break; + tmp_map++; + } + if (tmp_map->name != NULL) { + tmp_map->omap_chip.oc = new_chip_id; + return 0; + } +} |