From: Peter Chen <peter.chen@nxp.com>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Sebastian Reichel <sre@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"od@zcrc.me" <od@zcrc.me>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: RE: [PATCH v2 3/3] power/supply: Add generic USB charger driver
Date: Mon, 16 Dec 2019 01:24:35 +0000 [thread overview]
Message-ID: <VI1PR04MB5327401FFD2D32E937548DD48B510@VI1PR04MB5327.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <1576270147.3.0@crapouillou.net>
> >> +
> >> + desc = &charger->desc;
> >> + desc->name = "usb-charger";
> >> + desc->properties = usb_charger_properties;
> >> + desc->num_properties = ARRAY_SIZE(usb_charger_properties);
> >> + desc->get_property = usb_charger_get_property;
> >> + desc->type = POWER_SUPPLY_TYPE_USB;
> >
> > What's your further plan for this generic USB charger?
> > To support BC1.2, we need to know charger type, and how we could get
> > it?
> >
> > Peter
>
> Well I don't really know. The USB role framework does not give any info about
> what's plugged.
>
What's the use case for this patch set? How it be used?
Thanks,
Peter
> -Paul
>
>
> >
> >> +
> >> + charger->charger = devm_power_supply_register(dev, desc, &cfg);
> >> + if (IS_ERR(charger->charger)) {
> >> + dev_err(dev, "Unable to register charger");
> >> + return PTR_ERR(charger->charger);
> >> + }
> >> +
> >> + err = usb_role_switch_register_notifier(charger->role,
> >> &charger->nb);
> >> + if (err) {
> >> + dev_err(dev, "Unable to register USB role switch notifier");
> >> + return err;
> >> + }
> >> +
> >> + return devm_add_action_or_reset(dev, usb_charger_unregister,
> >> charger);
> >> +}
> >> +
> >> +static const struct of_device_id usb_charger_of_match[] = {
> >> + { .compatible = "usb-charger" },
> >> + { /* sentinel */ },
> >> +};
> >> +MODULE_DEVICE_TABLE(of, usb_charger_of_match); + +static struct
> >> platform_driver usb_charger_driver = {
> >> + .driver = {
> >> + .name = "usb-charger",
> >> + .of_match_table = of_match_ptr(usb_charger_of_match),
> >> + },
> >> + .probe = usb_charger_probe,
> >> +};
> >> +module_platform_driver(usb_charger_driver);
> >> +
> >> +MODULE_DESCRIPTION("Simple USB charger driver");
> >> +MODULE_AUTHOR("Paul Cercueil <paul@crapouillou.net>");
> >> +MODULE_LICENSE("GPL");
> >> --
> >> 2.24.0
> >>
> >
> > --
> >
> > Thanks,
> > Peter Chen
>
next prev parent reply other threads:[~2019-12-16 1:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 15:50 [PATCH v2 1/3] dt-bindings: power/supply: Document generic USB charger Paul Cercueil
2019-12-11 15:50 ` [PATCH v2 2/3] usb: roles: Add API to register notifiers Paul Cercueil
2019-12-11 15:50 ` [PATCH v2 3/3] power/supply: Add generic USB charger driver Paul Cercueil
2019-12-12 9:18 ` Peter Chen
2019-12-13 20:49 ` Paul Cercueil
2019-12-16 1:24 ` Peter Chen [this message]
[not found] ` <VI1PR04MB5327401FFD2D32E937548DD48B510@VI1PR04MB5327.eurprd04.prod.outlook.c om>
2019-12-16 10:52 ` Paul Cercueil
2019-12-17 1:32 ` Peter Chen
[not found] ` <VI1PR04MB5327B8EF35340FC4B2D02DE88B500@VI1PR04MB5327.eurprd04.prod.outlook.c om>
2019-12-17 21:24 ` Paul Cercueil
2019-12-18 2:46 ` Peter Chen
[not found] ` <VI1PR04MB53273342340E350BFFFDE12F8B530@VI1PR04MB5327.eurprd04.prod.outlook.c om>
2019-12-19 11:35 ` Paul Cercueil
2019-12-19 21:38 ` Rob Herring
2019-12-21 13:55 ` Paul Cercueil
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=VI1PR04MB5327401FFD2D32E937548DD48B510@VI1PR04MB5327.eurprd04.prod.outlook.com \
--to=peter.chen@nxp.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=od@zcrc.me \
--cc=paul@crapouillou.net \
--cc=robh+dt@kernel.org \
--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).