power: sbs-battery: remove exported API for charger status update
Laxman Dewangan [Wed, 19 Jun 2013 07:46:48 +0000 (12:46 +0530)]
Battery gauge driver, sbs-battery, have the communication with charger
driver through battery-charger-gauge communication framework and so
no need to export the API for same purpose.

Removing the status_update() API.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/240070
(cherry picked from commit 91447f03fe459dfb74938f316fa89feb651de92f)

Change-Id: Ib161f7f8189c44beb8bc42deeafe3ae10d222423
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/253349
Reviewed-by: Automatic_Commit_Validation_User

drivers/power/sbs-battery.c
include/linux/power/sbs-battery.h

index 30f5f07..2f1c4a9 100644 (file)
@@ -158,7 +158,6 @@ struct sbs_info {
        int                             shutdown_complete;
        struct mutex                    mutex;
 };
-struct sbs_info *tchip;
 
 static int sbs_read_word_data(struct i2c_client *client, u8 address)
 {
@@ -586,37 +585,6 @@ static void sbs_external_power_changed(struct power_supply *psy)
        chip->poll_time = chip->plat_data.poll_retry_count;
 }
 
-void sbs_update(void)
-{
-       int ret;
-
-       if (tchip != NULL) {
-               ret = sbs_read_word_data(tchip->client,
-                               sbs_data[REG_STATUS].addr);
-               /* if the read failed, give up on this work */
-               if (ret < 0) {
-                       tchip->poll_time = 0;
-                       return;
-               }
-
-               if (ret & BATTERY_FULL_CHARGED)
-                       ret = POWER_SUPPLY_STATUS_FULL;
-               else if (ret & BATTERY_FULL_DISCHARGED)
-                       ret = POWER_SUPPLY_STATUS_NOT_CHARGING;
-               else if (ret & BATTERY_DISCHARGING)
-                       ret = POWER_SUPPLY_STATUS_DISCHARGING;
-               else
-                       ret = POWER_SUPPLY_STATUS_CHARGING;
-
-               if (tchip->last_state != ret) {
-                       tchip->poll_time = 0;
-                       power_supply_changed(&tchip->power_supply);
-                       return;
-               }
-       }
-}
-EXPORT_SYMBOL_GPL(sbs_update);
-
 static int sbs_update_battery_status(struct battery_gauge_dev *bg_dev,
        enum battery_charger_status status)
 {
@@ -662,7 +630,7 @@ static void sbs_delayed_work(struct work_struct *work)
 
        chip = container_of(work, struct sbs_info, work.work);
 
-       power_supply_changed(&tchip->power_supply);
+       power_supply_changed(&chip->power_supply);
        schedule_delayed_work(&chip->work, HZ*2);
 }
 
@@ -787,8 +755,6 @@ static int sbs_probe(struct i2c_client *client,
        chip->last_state = POWER_SUPPLY_STATUS_UNKNOWN;
        chip->power_supply.external_power_changed = sbs_external_power_changed;
 
-       tchip = chip;
-
        pdata = sbs_of_populate_pdata(client);
        if (pdata) {
                chip->gpio_detect = gpio_is_valid(pdata->battery_detect);
index 7b0c47e..139555e 100644 (file)
@@ -39,5 +39,4 @@ struct sbs_platform_data {
        int poll_retry_count;
 };
 extern int sbs_battery_detect(void);
-extern void sbs_update(void);
 #endif