Commit graph

6 commits

Author SHA1 Message Date
Anton Vorontsov
5ae2b822e4 ab8500_fg: Fix some build warnings on x86_64
Noticed the following warnings:

  CC      drivers/power/ab8500_fg.o
drivers/power/ab8500_fg.c: In function 'charge_full_store':
drivers/power/ab8500_fg.c:2258:2: warning: format '%d' expects argument of type 'int', but argument 4 has type 'ssize_t' [-Wformat]
drivers/power/ab8500_fg.c: In function ‘charge_now_store’:
drivers/power/ab8500_fg.c:2280:2: warning: format '%d' expects argument of type 'int', but argument 4 has type 'ssize_t' [-Wformat]

This patch fixes the issues.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26 20:41:26 +04:00
Anton Vorontsov
64eb9b02bf ab8500: Turn unneeded global symbols into local ones
The patch fixes the following sparse warning:

drivers/power/ab8500_charger.c:1619:6: warning: symbol 'ab8500_charger_detect_usb_type_work' was not declared. Should it be static?
drivers/power/abx500_chargalg.c:1709:24: warning: symbol 'abx500_chargalg_sysfs_ops' was not declared. Should it be static?
drivers/power/ab8500_fg.c:2328:24: warning: symbol 'ab8500_fg_sysfs_ops' was not declared. Should it be static?

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26 20:41:14 +04:00
Anton Vorontsov
0fff22ee79 ab8500_fg: Fix copy-paste error
ab8500_fg_discharge_state_to() function should accept
'enum ab8500_fg_discharge_state' argument, not
'enum ab8500_fg_charge_state'.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26 20:41:12 +04:00
Anton Vorontsov
c34a61b4e7 ab8500_fg: Get rid of 'struct battery_type'
The struct is duplicated, plus causes the following flood:

  CC      drivers/power/ab8500_fg.o
ab8500_fg.c: In function ‘ab8500_fg_get_ext_psy_data’:
b8500_fg.c:2081:8: warning: assignment from incompatible pointer type [enabled by default]

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26 20:41:11 +04:00
Anton Vorontsov
450ceb2b23 ab8500_fg: Get rid of 'struct v_to_cap'
The struct is duplicated, plus when used it causes the following
warnings:

  CHECK   drivers/power/ab8500_fg.c
ab8500_fg.c:818:13: warning: incorrect type in assignment (different base types)
ab8500_fg.c:818:13:    expected struct v_to_cap *tbl
ab8500_fg.c:818:13:    got struct abx500_v_to_cap *const v_to_cap_tbl
  CC      drivers/power/ab8500_fg.o
ab8500_fg.c: In function 'ab8500_fg_volt_to_capacity':
ab8500_fg.c:818:6: warning: assignment from incompatible pointer type [enabled by default]

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26 20:41:10 +04:00
Arun Murthy
13151631b5 ab8500-fg: A8500 fuel gauge driver
This driver is responsible for provide battery parameters to user space via
sysfs by registers to power supply class. It uses fuel gauge and gpadc driver
in obtaining the battery parameters. These battery properties are used by
abx500 charging algorithm driver to monitor the battery.

Signed-off-by: Arun Murthy <arun.murthy@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26 20:41:05 +04:00