From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>, Sebastian Reichel <sre@kernel.org>
Cc: Lukas Wunner <lukas@wunner.de>,
Robert Moore <robert.moore@intel.com>,
linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH v6 4/5] ACPI: ac: Add a blacklist with PMIC ACPI HIDs with a native charger driver
Date: Tue, 18 Apr 2017 16:15:44 +0300 [thread overview]
Message-ID: <1492521344.24567.63.camel@linux.intel.com> (raw)
In-Reply-To: <20170418115842.16214-5-hdegoede@redhat.com>
On Tue, 2017-04-18 at 13:58 +0200, Hans de Goede wrote:
> On some systems we have a native PMIC driver which provides Mains
> monitoring, while the ACPI ac driver is broken on these systems
> due to bad DSTDs or because we do not support the proprietary and
> undocumented ACPI opregions these ACPI battery devices rely on
> (e.g. BMOP opregion).
>
> This leads for example to a ADP1 power_supply which reports
> itself as always online even if no mains are connected.
>
> This commit adds a blacklist with PMIC ACPI HIDs for which we've a
> native charger or extcon driver and makes the ACPI ac driver not
> register itself when a PMIC on this list is present.
Same remark, change those minors if something else comes up.
> static int __init acpi_ac_init(void)
> {
> - int result;
> + int i, result;
I would go with
unsigned int i;
(Same for previous patch considering ARRAY_SIZE() in use)
>
> if (acpi_disabled)
> return -ENODEV;
>
> + for (i = 0; i < ARRAY_SIZE(acpi_ac_blacklist); i++)
> + if (acpi_dev_present(acpi_ac_blacklist[i].hid, "1",
> + acpi_ac_blacklist[i].hrv)) {
> + pr_info("ACPI: AC: found native %s PMIC, not
> loading\n",
Do we have PREFIX defined in this module as well?
> + acpi_ac_blacklist[i].hid);
> + return -ENODEV;
> + }
> +
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2017-04-18 13:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-18 11:58 [PATCH v6 0/5] ACPI: new acpi_dev_present helper + ac and battery blacklist patches Hans de Goede
2017-04-18 11:58 ` [PATCH v6 1/5] ACPI: utils: Add new acpi_dev_present helper Hans de Goede
2017-04-18 11:58 ` [PATCH v6 2/5] ACPI: battery: Fix acpi_battery_exit on acpi_battery_init_async errors Hans de Goede
2017-04-18 13:36 ` Rafael J. Wysocki
2017-04-19 8:43 ` Hans de Goede
2017-04-18 11:58 ` [PATCH v6 3/5] ACPI: battery: Add a blacklist with PMIC ACPI HIDs with a native battery driver Hans de Goede
2017-04-18 13:13 ` Andy Shevchenko
2017-04-18 11:58 ` [PATCH v6 4/5] ACPI: ac: Add a blacklist with PMIC ACPI HIDs with a native charger driver Hans de Goede
2017-04-18 13:15 ` Andy Shevchenko [this message]
2017-04-18 11:58 ` [PATCH v6 5/5] power: supply: axp288_charger: Only wait for INT3496 device if present Hans de Goede
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=1492521344.24567.63.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@intel.com \
--cc=sre@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).