RE: [RFC 1/4] power_supply: Introduce charging object table

Tc, Jenny
2015-03-09T12:26:58Z

Hi,

> > +#define PSY_MAX_BAT_NAME_LEN 8
> > +#define PSY_MAX_TEMP_ZONE 6
> > +
> > +struct psy_charging_obj {
>
> This is not just about charging data, but also about the batteries
> thermal limits, technology and full capacity, so how about
>
> struct psy_battery_information {

Ok, Agree.
>
> > + char name[PSY_MAX_BAT_NAME_LEN];
>
> char *name;
>
> No need for arbitrary length limitation.

The length limitation is introduced to form a packed structure so that
the data can be read directly from memory without parsing.

>
> > + int battery_type;
> > + int temp_max;
> > + int temp_min;
> > + int full_condition_soc;
>
> Please be more verbose about the information being stored here.

Ok..Agree.
>
> > + int full_condition_capacity;
> > + int full_condition_voltage;
> > + int iterm; /* charge termination current */
> > + /* CC/CV table for different temperature range */
> > + int temp_mon_count; /* number of entries in temp_mon_table */
> > + struct psy_temp_mon_table temp_mon_table[PSY_MAX_TEMP_ZONE];
>
> No need to embed this into the struct. Just point to the array and
> remove the size limitation.

This is to make sure that the array is packed so that the data can be
read directly from memory without parsing.

-Jenny