Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8757a08e authored by Loic Pallardy's avatar Loic Pallardy Committed by Lee Jones
Browse files

pm2301: Remove volt_now & curr_now properties



There is no support to measure the main charger voltage and
current using AB9540 gpadc. Therefore this has been removed
from the driver.

Signed-off-by: default avatarRajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Reviewed-by: default avatarMichel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: default avatarRabin VINCENT <rabin.vincent@stericsson.com>
Tested-by: default avatarMichel JAOUEN <michel.jaouen@stericsson.com>
parent 006f82d6
Loading
Loading
Loading
Loading
+0 −35
Original line number Original line Diff line number Diff line
@@ -47,9 +47,7 @@ static enum power_supply_property pm2xxx_charger_ac_props[] = {
	POWER_SUPPLY_PROP_HEALTH,
	POWER_SUPPLY_PROP_HEALTH,
	POWER_SUPPLY_PROP_PRESENT,
	POWER_SUPPLY_PROP_PRESENT,
	POWER_SUPPLY_PROP_ONLINE,
	POWER_SUPPLY_PROP_ONLINE,
	POWER_SUPPLY_PROP_VOLTAGE_NOW,
	POWER_SUPPLY_PROP_VOLTAGE_AVG,
	POWER_SUPPLY_PROP_VOLTAGE_AVG,
	POWER_SUPPLY_PROP_CURRENT_NOW,
};
};


static int pm2xxx_charger_voltage_map[] = {
static int pm2xxx_charger_voltage_map[] = {
@@ -438,19 +436,6 @@ static irqreturn_t pm2xxx_irq_int(int irq, void *data)
	return IRQ_HANDLED;
	return IRQ_HANDLED;
}
}


static int pm2xxx_charger_get_ac_voltage(struct pm2xxx_charger *pm2)
{
	int vch = 0;

	if (pm2->ac.charger_connected) {
		vch = ab8500_gpadc_convert(pm2->gpadc, MAIN_CHARGER_V);
		if (vch < 0)
			dev_err(pm2->dev, "%s gpadc conv failed,\n", __func__);
	}

	return vch;
}

static int pm2xxx_charger_get_ac_cv(struct pm2xxx_charger *pm2)
static int pm2xxx_charger_get_ac_cv(struct pm2xxx_charger *pm2)
{
{
	int ret = 0;
	int ret = 0;
@@ -473,19 +458,6 @@ static int pm2xxx_charger_get_ac_cv(struct pm2xxx_charger *pm2)
	return ret;
	return ret;
}
}


static int pm2xxx_charger_get_ac_current(struct pm2xxx_charger *pm2)
{
	int ich = 0;

	if (pm2->ac.charger_online) {
		ich = ab8500_gpadc_convert(pm2->gpadc, MAIN_CHARGER_C);
		if (ich < 0)
			dev_err(pm2->dev, "%s gpadc conv failed\n", __func__);
	}

	return ich;
}

static int pm2xxx_current_to_regval(int curr)
static int pm2xxx_current_to_regval(int curr)
{
{
	int i;
	int i;
@@ -585,17 +557,10 @@ static int pm2xxx_charger_ac_get_property(struct power_supply *psy,
	case POWER_SUPPLY_PROP_PRESENT:
	case POWER_SUPPLY_PROP_PRESENT:
		val->intval = pm2->ac.charger_connected;
		val->intval = pm2->ac.charger_connected;
		break;
		break;
	case POWER_SUPPLY_PROP_VOLTAGE_NOW:
		pm2->ac.charger_voltage = pm2xxx_charger_get_ac_voltage(pm2);
		val->intval = pm2->ac.charger_voltage * 1000;
		break;
	case POWER_SUPPLY_PROP_VOLTAGE_AVG:
	case POWER_SUPPLY_PROP_VOLTAGE_AVG:
		pm2->ac.cv_active = pm2xxx_charger_get_ac_cv(pm2);
		pm2->ac.cv_active = pm2xxx_charger_get_ac_cv(pm2);
		val->intval = pm2->ac.cv_active;
		val->intval = pm2->ac.cv_active;
		break;
		break;
	case POWER_SUPPLY_PROP_CURRENT_NOW:
		val->intval = pm2xxx_charger_get_ac_current(pm2) * 1000;
		break;
	default:
	default:
		return -EINVAL;
		return -EINVAL;
	}
	}
+0 −1
Original line number Original line Diff line number Diff line
@@ -456,7 +456,6 @@ enum pm2xxx_source_reg_int6 {
struct pm2xxx_charger_info {
struct pm2xxx_charger_info {
	int charger_connected;
	int charger_connected;
	int charger_online;
	int charger_online;
	int charger_voltage;
	int cv_active;
	int cv_active;
	bool wd_expired;
	bool wd_expired;
};
};