Skip to content

Commit

Permalink
abx500-chargalg: Store the AB8500 MFD parent device for platform diff…
Browse files Browse the repository at this point in the history
…erentiation

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>
  • Loading branch information
Lee Jones committed Mar 7, 2013
1 parent 584f970 commit 330b7eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/power/abx500_chargalg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 330b7eb

Please sign in to comment.