RE: [RFC 1/4] power_supply: Introduce charging object table
From: Tc, Jenny
Date: Mon Mar 09 2015 - 08:27:04 EST
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
--
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/