Re: [PATCH 2/7] power_supply: Add charger control properties

From: Anton Vorontsov
Date: Sun Nov 18 2012 - 19:53:37 EST


On Thu, Oct 18, 2012 at 10:14:01PM +0530, Jenny TC wrote:
> The battery charger needs to have control path along
> with the reporting charger properties. In existing solutions
> this is implemented using regulator framework. A regulator
> framework doesn't fit a charger driver requirement because of the
> following reason
> Charger needs support two paths - charger path (charger to platform)
> and charging (charger to battery).Disabling the charging path alone
> (eg over battery temperature) will allow the platform to work with
> power from charger without discharging the battery. And the charger
> may need to be disabled completely based on the charger temperature
> or the platform temperature.
> Charger has more than one pair of voltage/current to control (CC,CV,INLMT)
> These features will not directly fit in the regulator framework
>
> Since the charger driver sits in the power supply subsystem it make sense
> to add the properties to control the charger.
>
> Also this patch adds/modify the power supply properties to meet the
> requirements for charger control
>
> Signed-off-by: Jenny TC <jenny.tc@xxxxxxxxx>
> ---
> drivers/power/power_supply_sysfs.c | 16 ++++++++++++----
> include/linux/power_supply.h | 24 ++++++++++++++++--------
> 2 files changed, 28 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
> index 40fa3b7..3166d00 100644
> --- a/drivers/power/power_supply_sysfs.c
> +++ b/drivers/power/power_supply_sysfs.c
> @@ -160,12 +160,13 @@ static struct device_attribute power_supply_attrs[] = {
> POWER_SUPPLY_ATTR(charge_now),
> POWER_SUPPLY_ATTR(charge_avg),
> POWER_SUPPLY_ATTR(charge_counter),
> - POWER_SUPPLY_ATTR(constant_charge_current),
> - POWER_SUPPLY_ATTR(constant_charge_current_max),
> - POWER_SUPPLY_ATTR(constant_charge_voltage),
> - POWER_SUPPLY_ATTR(constant_charge_voltage_max),

Sorry, but you can't just remove properites like this. They're already
used by a lot of drivers.

Thanks,
Anton.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/