On Fri, 10 Dec 2010 22:15:10 +0000
David Woodhouse <[email protected]> wrote:
> On Fri, 2010-12-10 at 23:05 +0100, Sascha Silbe wrote:
> >
> > +
> > + switch (tech.intval) {
> > + case POWER_SUPPLY_TECHNOLOGY_NiMH:
> > + switch (mfr) {
> > + case 1: /* Gold Peak */
> > + val->intval = 3000000*.8;
> > + break;
> > + default:
> > + return -EIO;
> > + }
> > + break;
> > +
> > + case POWER_SUPPLY_TECHNOLOGY_LiFe:
> > + switch (mfr) {
> > + case 1: /* Gold Peak */
> > + val->intval = 2800000;
> > + break;
> > + case 2: /* BYD */
> > + val->intval = 3100000;
> > + break;
> > + default:
> > + return -EIO;
> > + }
> > + break;
> > +
> > + default:
> > + return -EIO;
> > + }
> > +
> > + return ret;
> > +}
>
> I don't much like hard-coding it in the kernel. Can the firmware
> expose these values in the device-tree?
>
It there is, it's not at all clear. The values are fetched from the
EC, which get them from the EEPROM. The DT has a battery entry, but it
contains nothing useful:
/proc/device-tree/batt...@0/name
/proc/device-tree/batt...@0/reg
/proc/device-tree/batt...@0/.node
Nor is there anything in the DT related to the battery EEPROM.
_______________________________________________
Devel mailing list
[email protected]
http://lists.laptop.org/listinfo/devel