From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: Nick Crews <ncrews@chromium.org>,
bleung@chromium.org, linux-leds@vger.kernel.org,
jacek.anaszewski@gmail.com, pavel@ucw.cz
Cc: linux-kernel@vger.kernel.org, arnd@arndb.de,
weiyongjun1@huawei.com, dlaurie@chromium.org,
djkurtz@chromium.org, dtor@google.com, sjg@chromium.org,
groeck@chromium.com, Daniel Campello <campello@chromium.org>
Subject: Re: [PATCH v8 2/2] power_supply: platform/chrome: wilco_ec: Add charging config driver
Date: Wed, 6 Nov 2019 16:16:45 +0100 [thread overview]
Message-ID: <94adea8f-6836-c026-7e34-8ea196a558ee@collabora.com> (raw)
In-Reply-To: <20191024222805.183642-2-ncrews@chromium.org>
Hi Nick, Daniel,
On 25/10/19 0:28, Nick Crews wrote:
> Add a device to control the charging algorithm used on Wilco devices,
> which will be picked up by the drivers/power/supply/wilco-charger.c
> driver. See Documentation/ABI/testing/sysfs-class-power-wilco for the
> userspace interface and other info.
>
> Signed-off-by: Nick Crews <ncrews@chromium.org>
Applied for 5.5.
Thanks,
Enric
> ---
> drivers/platform/chrome/wilco_ec/core.c | 15 ++++++++++++++-
> include/linux/platform_data/wilco-ec.h | 2 ++
> 2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/chrome/wilco_ec/core.c b/drivers/platform/chrome/wilco_ec/core.c
> index 36c78e52ff3c..5210c357feef 100644
> --- a/drivers/platform/chrome/wilco_ec/core.c
> +++ b/drivers/platform/chrome/wilco_ec/core.c
> @@ -98,6 +98,16 @@ static int wilco_ec_probe(struct platform_device *pdev)
> goto unregister_rtc;
> }
>
> + /* Register child device to be found by charger config driver. */
> + ec->charger_pdev = platform_device_register_data(dev, "wilco-charger",
> + PLATFORM_DEVID_AUTO,
> + NULL, 0);
> + if (IS_ERR(ec->charger_pdev)) {
> + dev_err(dev, "Failed to create charger platform device\n");
> + ret = PTR_ERR(ec->charger_pdev);
> + goto remove_sysfs;
> + }
> +
> /* Register child device that will be found by the telemetry driver. */
> ec->telem_pdev = platform_device_register_data(dev, "wilco_telem",
> PLATFORM_DEVID_AUTO,
> @@ -105,11 +115,13 @@ static int wilco_ec_probe(struct platform_device *pdev)
> if (IS_ERR(ec->telem_pdev)) {
> dev_err(dev, "Failed to create telemetry platform device\n");
> ret = PTR_ERR(ec->telem_pdev);
> - goto remove_sysfs;
> + goto unregister_charge_config;
> }
>
> return 0;
>
> +unregister_charge_config:
> + platform_device_unregister(ec->charger_pdev);
> remove_sysfs:
> wilco_ec_remove_sysfs(ec);
> unregister_rtc:
> @@ -125,6 +137,7 @@ static int wilco_ec_remove(struct platform_device *pdev)
> {
> struct wilco_ec_device *ec = platform_get_drvdata(pdev);
>
> + platform_device_unregister(ec->charger_pdev);
> wilco_ec_remove_sysfs(ec);
> platform_device_unregister(ec->telem_pdev);
> platform_device_unregister(ec->rtc_pdev);
> diff --git a/include/linux/platform_data/wilco-ec.h b/include/linux/platform_data/wilco-ec.h
> index 0f7df3498a24..afede15a95bf 100644
> --- a/include/linux/platform_data/wilco-ec.h
> +++ b/include/linux/platform_data/wilco-ec.h
> @@ -29,6 +29,7 @@
> * @data_size: Size of the data buffer used for EC communication.
> * @debugfs_pdev: The child platform_device used by the debugfs sub-driver.
> * @rtc_pdev: The child platform_device used by the RTC sub-driver.
> + * @charger_pdev: Child platform_device used by the charger config sub-driver.
> * @telem_pdev: The child platform_device used by the telemetry sub-driver.
> */
> struct wilco_ec_device {
> @@ -41,6 +42,7 @@ struct wilco_ec_device {
> size_t data_size;
> struct platform_device *debugfs_pdev;
> struct platform_device *rtc_pdev;
> + struct platform_device *charger_pdev;
> struct platform_device *telem_pdev;
> };
>
>
next prev parent reply other threads:[~2019-11-06 15:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 22:28 [PATCH v8 1/2] platform/chrome: wilco_ec: Add keyboard backlight LED support Nick Crews
2019-10-24 22:28 ` [PATCH v8 2/2] power_supply: platform/chrome: wilco_ec: Add charging config driver Nick Crews
2019-11-06 15:16 ` Enric Balletbo i Serra [this message]
2019-10-25 17:33 ` [PATCH v8 1/2] platform/chrome: wilco_ec: Add keyboard backlight LED support Daniel Campello
2019-10-25 19:18 ` Nick Crews
2019-11-06 15:15 ` Enric Balletbo i Serra
[not found] ` <CAHcu+VYdMxoFbcxYxB1FnDSdsM=w9UsVKjF0S48LZGG0ZxKUDA@mail.gmail.com>
2019-11-06 16:39 ` Daniel Campello
-- strict thread matches above, loose matches on Subject: below --
2019-04-24 16:56 [PATCH v8 1/2] platform/chrome: wilco_ec: Add property helper library Nick Crews
2019-04-24 16:56 ` [PATCH v8 2/2] power_supply: platform/chrome: wilco_ec: Add charging config driver Nick Crews
2019-05-02 20:38 ` Sebastian Reichel
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=94adea8f-6836-c026-7e34-8ea196a558ee@collabora.com \
--to=enric.balletbo@collabora.com \
--cc=arnd@arndb.de \
--cc=bleung@chromium.org \
--cc=campello@chromium.org \
--cc=djkurtz@chromium.org \
--cc=dlaurie@chromium.org \
--cc=dtor@google.com \
--cc=groeck@chromium.com \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=ncrews@chromium.org \
--cc=pavel@ucw.cz \
--cc=sjg@chromium.org \
--cc=weiyongjun1@huawei.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;
as well as URLs for NNTP newsgroup(s).