BigW Consortium Gitlab

Commit d9a5ac0d by David Frey

bq27xxx: make driver build on 9x15 platforms

parent 459c9401
sources:
{
bq27xxx_battery_i2c.c
devres_backport.c
bq27xxx_battery_source.c
power_supply_backport.c
......
......@@ -20,6 +20,7 @@
#include <asm/unaligned.h>
#include "bq27xxx_battery.h"
#include "bq27426-platform-data.h"
#include "device_backport.h"
static DEFINE_IDR(battery_id);
static DEFINE_MUTEX(battery_mutex);
......
......@@ -58,6 +58,8 @@
//#include "power_supply_backport.h"
#include "bq27xxx_battery.h"
#include "bq27426-platform-data.h"
#include <linux/version.h>
#define BQ27XXX_MANUFACTURER "Texas Instruments"
/* BQ27XXX Flags */
......@@ -1915,7 +1917,11 @@ int bq27xxx_battery_setup(struct bq27xxx_device_info *di, struct bq27426_platfor
di->bat.external_power_changed = bq27xxx_external_power_changed;
dev_info(di->dev, " in the setup fourth break");
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
ret = power_supply_register(di->dev, &di->bat);
#else
ret = power_supply_register_no_ws(di->dev, &di->bat);
#endif
if (ret != 0) {
dev_err(di->dev, "failed to register battery\n");
return ret;
......
......@@ -65,5 +65,3 @@ char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...)
EXPORT_SYMBOL_GPL(devm_kasprintf);
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) */
MODULE_LICENSE("GPL");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment