Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-03-14 Thread Linus Walleij
On Thu, Mar 13, 2014 at 10:12 AM, Pavel Machek pa...@ucw.cz wrote: Hi! 30*HZ means 30 seconds in the kernel... what is hard to understand about it? Well I might be picky, but since it is a charging algorithm dealing with ampères, volts, constant-current/constant-voltage, watchdogs and

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-03-14 Thread Mark Brown
On Fri, Mar 14, 2014 at 11:36:40AM +0100, Linus Walleij wrote: On Thu, Mar 13, 2014 at 10:12 AM, Pavel Machek pa...@ucw.cz wrote: But... what would actually help: I believe we should introduce milivolt_t, miliamp_t, milisec_t etc... types. Storing milivolts in int, then having comment

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-03-13 Thread Pavel Machek
Hi! 30*HZ means 30 seconds in the kernel... what is hard to understand about it? Well I might be picky, but since it is a charging algorithm dealing with ampères, volts, constant-current/constant-voltage, watchdogs and timeouts, all stated in SI units, it would be nice if all such

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-03-12 Thread Linus Walleij
On Fri, Mar 7, 2014 at 9:10 PM, Pavel Machek pa...@ucw.cz wrote: On Fri 2014-03-07 11:04:59, Linus Walleij wrote: On Fri, Feb 28, 2014 at 6:01 PM, Pavel Machek pa...@ucw.cz wrote: On Thu 2014-02-27 21:08:01, Linus Walleij wrote: On Thu, Feb 20, 2014 at 6:53 AM, Jenny TC jenny...@intel.com

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-03-07 Thread Pavel Machek
Hi! +++ b/include/linux/power/power_supply_charger.h +#define MAX_CUR_VOLT_SAMPLES 3 +#define DEF_CUR_VOLT_SAMPLE_JIFF (30*HZ) Why are things defined in Jiffies like this insead of seconds, milliseconds etc? This will vary with the current operating frequency of the system, why

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-03-07 Thread Pavel Machek
On Fri 2014-03-07 11:04:59, Linus Walleij wrote: On Fri, Feb 28, 2014 at 6:01 PM, Pavel Machek pa...@ucw.cz wrote: On Thu 2014-02-27 21:08:01, Linus Walleij wrote: On Thu, Feb 20, 2014 at 6:53 AM, Jenny TC jenny...@intel.com wrote: +++ b/include/linux/power/power_supply_charger.h

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-03-06 Thread Linus Walleij
On Fri, Feb 28, 2014 at 12:27 PM, Jenny Tc jenny...@intel.com wrote: On Thu, Feb 27, 2014 at 09:08:01PM +0100, Linus Walleij wrote: On Thu, Feb 20, 2014 at 6:53 AM, Jenny TC jenny...@intel.com wrote: +++ b/include/linux/power/power_supply_charger.h +#define MAX_CUR_VOLT_SAMPLES 3

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-03-06 Thread Linus Walleij
On Fri, Feb 28, 2014 at 6:01 PM, Pavel Machek pa...@ucw.cz wrote: On Thu 2014-02-27 21:08:01, Linus Walleij wrote: On Thu, Feb 20, 2014 at 6:53 AM, Jenny TC jenny...@intel.com wrote: +++ b/include/linux/power/power_supply_charger.h +#define MAX_CUR_VOLT_SAMPLES 3 +#define

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-03-06 Thread Jenny Tc
On Fri, Mar 07, 2014 at 11:03:02AM +0800, Linus Walleij wrote: On Fri, Feb 28, 2014 at 12:27 PM, Jenny Tc jenny...@intel.com wrote: On Thu, Feb 27, 2014 at 09:08:01PM +0100, Linus Walleij wrote: On Thu, Feb 20, 2014 at 6:53 AM, Jenny TC jenny...@intel.com wrote: +++

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-02-28 Thread Pavel Machek
On Thu 2014-02-27 21:08:01, Linus Walleij wrote: On Thu, Feb 20, 2014 at 6:53 AM, Jenny TC jenny...@intel.com wrote: +++ b/include/linux/power/power_supply_charger.h +#define MAX_CUR_VOLT_SAMPLES 3 +#define DEF_CUR_VOLT_SAMPLE_JIFF (30*HZ) Why are things defined in Jiffies like this

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-02-27 Thread Linus Walleij
On Thu, Feb 20, 2014 at 6:53 AM, Jenny TC jenny...@intel.com wrote: +++ b/include/linux/power/power_supply_charger.h +#define MAX_CUR_VOLT_SAMPLES 3 +#define DEF_CUR_VOLT_SAMPLE_JIFF (30*HZ) Why are things defined in Jiffies like this insead of seconds, milliseconds etc? This will vary with

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-02-27 Thread Jenny Tc
On Thu, Feb 27, 2014 at 09:08:01PM +0100, Linus Walleij wrote: On Thu, Feb 20, 2014 at 6:53 AM, Jenny TC jenny...@intel.com wrote: +++ b/include/linux/power/power_supply_charger.h +#define MAX_CUR_VOLT_SAMPLES 3 +#define DEF_CUR_VOLT_SAMPLE_JIFF (30*HZ) Why are things defined in

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-02-12 Thread Pavel Machek
On Wed 2014-02-05 13:44:58, Jenny Tc wrote: On Tue, Feb 04, 2014 at 12:36:30PM +0100, Pavel Machek wrote: +struct psy_charger_context { + bool is_usb_cable_evt_reg; + int psyc_cnt; + int batt_status; + /*cache battery and charger properties */ Comment coding style. Please run

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-02-12 Thread Jingoo Han
On Wednesday, February 12, 2014 8:00 PM, Pavel Machek wrote: On Wed 2014-02-05 13:44:58, Jenny Tc wrote: On Tue, Feb 04, 2014 at 12:36:30PM +0100, Pavel Machek wrote: +struct psy_charger_context { + bool is_usb_cable_evt_reg; + int psyc_cnt; + int batt_status;

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-02-05 Thread Jenny Tc
On Tue, Feb 04, 2014 at 12:36:30PM +0100, Pavel Machek wrote: +struct psy_charger_context { + bool is_usb_cable_evt_reg; + int psyc_cnt; + int batt_status; + /*cache battery and charger properties */ Comment coding style. Please run you patches through checkpatch. checkpatch

Re: [PATCH 2/4] power_supply: Introduce generic psy charging driver

2014-02-04 Thread Pavel Machek
Hi! +Throttling configuration example: + +struct psy_throttle_state my_throttle_states[] = { + + /* Level 0: Limit charge current to 1500mA. Normal Level */ + { + .throttle_action = PSY_THROTTLE_CC_LIMIT, + .throttle_val = 1500, + }, + + /*