Re: [ibm-acpi-devel] [PATCH v2] thinkpad_acpi: Support the battery wear control

2017-12-09 Thread Ognjen Galić
On 09/12/2017, Pavel Machek  wrote:
> Yeah, what I'm saying is that maybe we need to extend generic power
> supply driver.

I don't know about that, you would have to ask the maintainers if that
is appropriate.

Thanks for the time!
Ognjen

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH v2] thinkpad_acpi: Support the battery wear control

2017-12-09 Thread Pavel Machek
On Sat 2017-12-09 11:29:51, Ognjen Galić wrote:
> On 09/12/2017, Pavel Machek  wrote:
> > In newer series (I can't find it at the moment, sorry)
> 
> The new series is a 3-patch patchset that obsoletes this
> patch. It is in the testing stage and will be pushed to
> the mailing lists and maintainers in a few days.
> 
> > Maybe we should have separate status "not charging due to wear
> > control"?
> 
> No, because the ACPI battery driver is a extension to the generic
> power supply driver, that does not understand the battery wear control.
> Also, Rafael specifically noted NOT to include any thinkpad_acpi-specific
> behavior to the generic drivers.

Yeah, what I'm saying is that maybe we need to extend generic power
supply driver.

On small devices, we usually have enough control over hardware to be
able to implement "wear control" in kernel. Nokia N900 is an
example. "Wear control" is certainly not thinkpad-specific concept.

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH v2] thinkpad_acpi: Support the battery wear control

2017-12-09 Thread Ognjen Galić
On 09/12/2017, Pavel Machek  wrote:
> In newer series (I can't find it at the moment, sorry)

The new series is a 3-patch patchset that obsoletes this
patch. It is in the testing stage and will be pushed to
the mailing lists and maintainers in a few days.

> Maybe we should have separate status "not charging due to wear
> control"?

No, because the ACPI battery driver is a extension to the generic
power supply driver, that does not understand the battery wear control.
Also, Rafael specifically noted NOT to include any thinkpad_acpi-specific
behavior to the generic drivers.

That behavior you are describing can be implemented in the userspace.

Thanks for the time!
Ognjen

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH v2] thinkpad_acpi: Support the battery wear control

2017-12-09 Thread Pavel Machek
Hi!

In newer series (I can't find it at the moment, sorry) you return
"NOT_CHARGING" status when not charging because of wear control.

Maybe we should have separate status "not charging due to wear
control"?

Thanks,

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] [PATCH v2] thinkpad_acpi: Support the battery wear control

2017-12-07 Thread Ognjen Galic
On Mon, Dec 04, 2017 at 03:53:32PM +0100, Rafael J. Wysocki wrote:

> Not really.
> 
> This is generic code, so no thinkpad_acpi-specific stuff in this file, please,
> even under #ifdefs.
> 

I have some ideas, and I want your confirmation if that would be
acceptable.

Can I do this:

Expose a new API from battery.c for platform specific hooks:

struct battery_hook {
int (*add_battery)(struct acpi_battery* battery);
int (*remove_battery)(struct acpi_battery *battery);
};

battery_hook_register(struct battery_hook *hook)
battery_hook_unregister(struct battery_hook *hook)

When that hook is invoked from some other module, battery.c 
calls the add_battery method for each battery that is added and
remove_battery for each battery that is removed.

battery.c would keep a list of the battery_hook structs and invoke 
the add_battery and remove_battery methods as batteries get added 
and removed. 

With this API, we can add more hooks for battery features in 
the future, not just the ThinkPad hooks.

I hope you like the proposal :)


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel