[PATCH 1/3] olpc-battery: add support for CHARGE_FULL_DESIGN

David Woodhouse dwmw2 at infradead.org
Fri Dec 10 17:15:10 EST 2010


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?

-- 
dwmw2




More information about the Devel mailing list