aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/abx500_chargalg.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-02-15 05:53:57 -0500
committerLee Jones <lee.jones@linaro.org>2013-03-06 23:35:35 -0500
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 {
204 * @batt_data: data of the battery 204 * @batt_data: data of the battery
205 * @susp_status: current charger suspension status 205 * @susp_status: current charger suspension status
206 * @bm: Platform specific battery management information 206 * @bm: Platform specific battery management information
207 * @parent: pointer to the struct abx500
207 * @chargalg_psy: structure that holds the battery properties exposed by 208 * @chargalg_psy: structure that holds the battery properties exposed by
208 * the charging algorithm 209 * the charging algorithm
209 * @events: structure for information about events triggered 210 * @events: structure for information about events triggered
@@ -227,6 +228,7 @@ struct abx500_chargalg {
227 struct abx500_chargalg_charger_info chg_info; 228 struct abx500_chargalg_charger_info chg_info;
228 struct abx500_chargalg_battery_data batt_data; 229 struct abx500_chargalg_battery_data batt_data;
229 struct abx500_chargalg_suspension_status susp_status; 230 struct abx500_chargalg_suspension_status susp_status;
231 struct ab8500 *parent;
230 struct abx500_bm_data *bm; 232 struct abx500_bm_data *bm;
231 struct power_supply chargalg_psy; 233 struct power_supply chargalg_psy;
232 struct ux500_charger *ac_chg; 234 struct ux500_charger *ac_chg;
@@ -1873,8 +1875,9 @@ static int abx500_chargalg_probe(struct platform_device *pdev)
1873 } 1875 }
1874 } 1876 }
1875 1877
1876 /* get device struct */ 1878 /* get device struct and parent */
1877 di->dev = &pdev->dev; 1879 di->dev = &pdev->dev;
1880 di->parent = dev_get_drvdata(pdev->dev.parent);
1878 1881
1879 /* chargalg supply */ 1882 /* chargalg supply */
1880 di->chargalg_psy.name = "abx500_chargalg"; 1883 di->chargalg_psy.name = "abx500_chargalg";