Re: [PATCH v3 3/3] HID: switchcon: add power supply support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2019-01-27 at 22:04 -0600, Daniel J. Ogorchock wrote:
> +       case POWER_SUPPLY_PROP_STATUS:

See my reply to the cover letter for what API to implement here to
advertise the coarse battery level.

> +               if (charging)
> +                       val->intval = POWER_SUPPLY_STATUS_CHARGING;
> +               else if (capacity == 100 && powered)
> +                       val->intval = POWER_SUPPLY_STATUS_FULL;

If full is full, you don't need the "&& powered" condition, do you?

> +               else
> +                       val->intval =
> POWER_SUPPLY_STATUS_DISCHARGING;
> +               break;




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux