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

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

 



On Mon, Jan 28, 2019 at 6:50 AM Bastien Nocera <hadess@xxxxxxxxxx> wrote:
>
> 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?

I was trying to be consistent with hid-sony's behavior. It checks if
the controller's cable is plugged in in order to set it to
STATUS_FULL.



[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