abb-fg: edit msg
Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: add debug mask
abb-fg: forgot to add moduleparam entry
Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Add sysfs kobject interfaces

fg_refresh:		Reinit fg stats, refresh battery level.
lowbat_tolerance:	The range of lowbat threshold
lowbat_zero:		The lowbat detection thershold
lowbat_wakelock:	Use lowbat_wakelock for detecting lowbat status

To configurate the lowbat hw threshold:

	cd /d/ab8500
	echo write 0x02 0x03 `val` > hwreg

Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Disable LowBat wakelock by default

This wakelock takes about 20min every time when battery voltage is low.

Disable it.

Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Add Cycle Charging Control

It's similar to Battery Life eXtender by Ezekeel.
Original idea: Ezekeel

When battery level reaches the discharging threshold,
It will disable charger.

When battery level drops under the recharging threshold,
It will enable charger.

It can be used to limit battert charge between a range.

In fact, in normal charging, when battery is fully charged, charger will be disabled,
then battery drops, charger will be re-enabled to charge the battery.

Valued in /sys/kernel/abb-fg/fg-cyc

Enable:
	echo on > fg-cyc

Disable:
	echo off > fg-cyc

Thresholds:
	echo reinit=?? > fg-cyc
	echo rechar=?? > fg-cyc		# Battery level
	echo dischar=?? > fg-cyc	# Battery level

	Haven't strict the theshold store function.

Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Disable lowbat poweroff wakelock

When battery is in low level, fg machine will hold this wakelock to wait for
poweroff.
That's what I don't like.

Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Hacky poweroff threshold

By default, poweroff threshold is 3300mV, now we make it 3000mV.

Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Code style
abb-fg: Adjust poweroff threshold 3000mV -> 3100mV

When battery is too low,
it might be unable to supply some stuff like
sdcard slot which require maximum voltage 2.8V.

Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Allow to report battery capacity goes up

Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Disable BATTOK register

Because of BATTOK dectection, when battery is low,
AB8500 will shut down instead of using software method,
which may lose user data. Disable it.

Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Adjust poweroff threshold
Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Workarond for fixing laziness on low capacity
Signed-off-by: cocafe <cocafehj@gmail.com>
abb-fg: Fix missing poweroff_threshold interface

Thanks zwliew@Gtihub

Signed-off-by: cocafe <136279202@qq.com>