lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87eg7qon3r.fsf@linux.intel.com>
Date:	Tue, 21 Jun 2016 13:25:12 +0300
From:	Felipe Balbi <balbi@...nel.org>
To:	Baolin Wang <baolin.wang@...aro.org>, gregkh@...uxfoundation.org,
	sre@...nel.org, dbaryshkov@...il.com, dwmw2@...radead.org
Cc:	robh@...nel.org, jun.li@....com, m.szyprowski@...sung.com,
	ruslan.bilovol@...il.com, peter.chen@...escale.com,
	stern@...land.harvard.edu, r.baldyga@...sung.com,
	grygorii.strashko@...com, yoshihiro.shimoda.uh@...esas.com,
	lee.jones@...aro.org, broonie@...nel.org,
	ckeepax@...nsource.wolfsonmicro.com,
	patches@...nsource.wolfsonmicro.com, baolin.wang@...aro.org,
	linux-pm@...r.kernel.org, linux-usb@...r.kernel.org,
	device-mainlining@...ts.linuxfoundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v12 1/4] gadget: Introduce the usb charger framework


Hi,

Baolin Wang <baolin.wang@...aro.org> writes:
> This patch introduces the usb charger driver based on usb gadget that
> makes an enhancement to a power driver. It works well in practice but
> that requires a system with suitable hardware.
>
> The basic conception of the usb charger is that, when one usb charger
> is added or removed by reporting from the usb gadget state change or
> the extcon device state change, the usb charger will report to power
> user to set the current limitation.
>
> The usb charger will register notifiees on the usb gadget or the extcon
> device to get notified the usb charger state. It also supplies the
> notification mechanism to userspace When the usb charger state is changed.
>
> Power user will register a notifiee on the usb charger to get notified
> by status changes from the usb charger. It will report to power user
> to set the current limitation when detecting the usb charger is added
> or removed from extcon device state or usb gadget state.
>
> This patch doesn't yet integrate with the gadget code, so some functions
> which rely on the 'gadget' are not completed, that will be implemented
> in the following patches.
>
> Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
> Reviewed-by: Li Jun <jun.li@....com>
> Tested-by: Li Jun <jun.li@....com>
> ---
>  drivers/usb/gadget/Kconfig       |    7 +
>  drivers/usb/gadget/udc/Makefile  |    1 +
>  drivers/usb/gadget/udc/charger.c |  770 ++++++++++++++++++++++++++++++++++++++
>  include/linux/usb/charger.h      |  191 ++++++++++
>  include/uapi/linux/usb/charger.h |   31 ++
>  5 files changed, 1000 insertions(+)
>  create mode 100644 drivers/usb/gadget/udc/charger.c
>  create mode 100644 include/linux/usb/charger.h
>  create mode 100644 include/uapi/linux/usb/charger.h
>
> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
> index 2057add..89f4e9b 100644
> --- a/drivers/usb/gadget/Kconfig
> +++ b/drivers/usb/gadget/Kconfig
> @@ -134,6 +134,13 @@ config U_SERIAL_CONSOLE
>  	help
>  	   It supports the serial gadget can be used as a console.
>  
> +config USB_CHARGER
> +	bool "USB charger support"

you didn't build test all possibilities, did you?

I have a feeling this won't link if USB_GADGET=m. Can you test that?

> diff --git a/drivers/usb/gadget/udc/charger.c b/drivers/usb/gadget/udc/charger.c
[...]
> +struct class *usb_charger_class;

We already have a UDC class, do we really, really need another class
here?

> +subsys_initcall(usb_charger_class_init);

this should always work as module_init(). Please make sure that's the
case.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (819 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ