public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <anton@enomsg.org>
To: Philippe De Swert <philippe.deswert@jollamobile.com>
Cc: dwmw2@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] power:power_supply_syfs : Treat PROP_TYPE as a regular attribute first
Date: Fri, 25 Oct 2013 15:15:05 -0700	[thread overview]
Message-ID: <20131025221504.GA31842@teo> (raw)
In-Reply-To: <1376521798-16985-1-git-send-email-philippe.deswert@jollamobile.com>

On Thu, Aug 15, 2013 at 02:09:58AM +0300, Philippe De Swert wrote:
> These days we often have USB powered devices. This means that often the
> type is variable. Common examples are smartphones which can be charged
> through a normal USB port on a PC/laptop, a dedicated charger, etc...
> Often those chips also have support for other charger types like a
> mains/DC charger. This means that often there are several psy structures
> in the driver and makes it impossible to stick to just one type.

I would guess that a lot of userland code assumes that the type is fixed.
We can't break this assumption. Plus I don't think we really need the
changing types.

> Userspace sometimes needs to behave differently based on the type of charger
> connected to such devices.

A system with several charger should either:

1. Register all of them (mains, usb, etc.) as a separate power supply
device, and then use PROP_ONLINE to specify whether something is connected
to the port or not.

2. Register only the charger type that is currently connected to the
system.

This is how we've been doing things from the very start.

Thanks,

Anton

  reply	other threads:[~2013-10-25 22:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 23:09 [PATCH] power:power_supply_syfs : Treat PROP_TYPE as a regular attribute first Philippe De Swert
2013-10-25 22:15 ` Anton Vorontsov [this message]
2013-10-25 23:01   ` Philippe De Swert
2013-10-28  6:35     ` Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131025221504.GA31842@teo \
    --to=anton@enomsg.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philippe.deswert@jollamobile.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox