summaryrefslogtreecommitdiff
path: root/drivers/power/abx500_chargalg.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-02-15 10:53:57 +0000
committerLee Jones <lee.jones@linaro.org>2013-03-07 12:35:35 +0800
commit330b7ebfa59d70ea5b814a04a28b8c7d8e462a81 (patch)
tree67a39965bfd503f4c5e325c5219ba678fd4fe4de /drivers/power/abx500_chargalg.c
parent584f970339bb259d4ac7dd82b355f283550193b2 (diff)
abx500-chargalg: Store the AB8500 MFD parent device for platform differentiation
Any platform can be dynamically probed for model and version number provided the AB8500 MFD parent device pointer is available. This patch obtains that pointer and stores it in a locally controlled struct for later use. Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/power/abx500_chargalg.c')
-rw-r--r--drivers/power/abx500_chargalg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c
index f043c0851a76..31507bfe549c 100644
--- a/drivers/power/abx500_chargalg.c
+++ b/drivers/power/abx500_chargalg.c
@@ -204,6 +204,7 @@ enum maxim_ret {
* @batt_data: data of the battery
* @susp_status: current charger suspension status
* @bm: Platform specific battery management information
+ * @parent: pointer to the struct abx500
* @chargalg_psy: structure that holds the battery properties exposed by
* the charging algorithm
* @events: structure for information about events triggered
@@ -227,6 +228,7 @@ struct abx500_chargalg {
struct abx500_chargalg_charger_info chg_info;
struct abx500_chargalg_battery_data batt_data;
struct abx500_chargalg_suspension_status susp_status;
+ struct ab8500 *parent;
struct abx500_bm_data *bm;
struct power_supply chargalg_psy;
struct ux500_charger *ac_chg;
@@ -1873,8 +1875,9 @@ static int abx500_chargalg_probe(struct platform_device *pdev)
}
}
- /* get device struct */
+ /* get device struct and parent */
di->dev = &pdev->dev;
+ di->parent = dev_get_drvdata(pdev->dev.parent);
/* chargalg supply */
di->chargalg_psy.name = "abx500_chargalg";