From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751774AbcFUMyW (ORCPT ); Tue, 21 Jun 2016 08:54:22 -0400 Received: from mga14.intel.com ([192.55.52.115]:63680 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631AbcFUMyR (ORCPT ); Tue, 21 Jun 2016 08:54:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,504,1459839600"; d="asc'?scan'208";a="1006642234" From: Felipe Balbi To: Baolin Wang Cc: Greg KH , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , robh@kernel.org, Jun Li , Marek Szyprowski , Ruslan Bilovol , Peter Chen , Alan Stern , r.baldyga@samsung.com, grygorii.strashko@ti.com, Yoshihiro Shimoda , Lee Jones , Mark Brown , Charles Keepax , patches@opensource.wolfsonmicro.com, Linux PM list , USB , device-mainlining@lists.linuxfoundation.org, LKML Subject: Re: [PATCH v12 2/4] gadget: Support for the usb charger framework In-Reply-To: References: <87bn2uomzd.fsf@linux.intel.com> <87twgmn4m7.fsf@linux.intel.com> <87inx2n2vs.fsf@linux.intel.com> <87d1nan2ft.fsf@linux.intel.com> User-Agent: Notmuch/0.22+51~gcc1a6d2 (http://notmuchmail.org) Emacs/25.0.93.2 (x86_64-pc-linux-gnu) Date: Tue, 21 Jun 2016 15:53:35 +0300 Message-ID: <87a8ien1o0.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Baolin Wang writes: >>>>>>>> Can't you just tie a charger to a UDC and avoid the charger class >>>>>>>> completely? >>>>>>> >>>>>>> Yeah, I also hope so. But we really want something to manage the >>>>>>> charger devices, do you have any good suggestion to avoid the 'clas= s' >>>>>>> but also can manage the charger devices? >>>>>> >>>>>> manage in what way? It seems to me that they don't need to be real >>>>>> devices, just a handle as part of struct usb_gadget, no? >>>>> >>>>> Although charger device is not one real hardware device, we also use >>>>> one 'struct device' to describe it in charger.c file. So we should >>>>> manage the 'struct device' with one proper way. >>>> >>>> that's fine, but why do you think they need a struct device to start w= ith? >>> >>> We can get/put usb charger and mange usb charger attributes with the >>> device model if we use a struct device. >> >> We already have that as part of struct usb_udc. Why don't you just >> create a subdirectory called charger which will hold all your >> charger-related attributes. That directory will only be created if a >> valid ->charger pointer exists. > > That means we can remove all the device and class things in charger.c > file, right? OK, I try to do that. Thanks. right. Keep your charger.c file, because to conditionally compile and link that to udc-core.ko, but remove all the class initialization and all of that extra code. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXaTjPAAoJEIaOsuA1yqREMLMQAKpOxTa27nUQ/3pnXWMQPx93 rD22m7cVvHvFt5Ke41ZJg/n/t0XspJMNitoMqqJzUKNUA7akKcNY5ZfOkvU7hi3Z N/mG5ujf/J8Ev47QJTaDrRIicdTiIea+GHsm+g85ch6SaDlsiSuqbTJbcMymkLCs /VzPJIKtTNb9rA117UpIhgDVqZcbK03HM7tefOspfC9SEWYieI2HT4gU0oWTIb6N kcbt0zcve+EwR/6Ee4MYeHTpH944kUNnrQCqZvun9S38nK6felqg78b3Ut9rS5Dy gg0HBTceBs0P12xTWRGf/JK2SSxOt4ScWbWx2fdyjXpoT9QxxZFcstLl1anKYv6n FGTbGoaK0ddcISMr7TNOLCqTlZ2hscsEMhos+SnaXn5YjDiZQof5YeSOe3OsdKkD LTpaEyu2Ie5FeVxhvlYVth19Fws5jejFNCHAoUX5Obd9cbMn3Ta6OIXUVauifgjP jp8T8Fal1pjmV7HoakIPMCfi7+ejAPFKoST4cLuVmdOBkCsT2p7tOzndJ3TZDKj1 ONNbNclEiX35GlFS2pJpoN1fbaH8uAmVSYt1IsU/O6FsNAtmZIMebkFGXX1YL/h6 jE2zxdEDTF5sKu6TVLw1nEDfFx4tcTaRc+r4f0eLI19N4sLcXwkXEvvgc58Qr3rx YUQxqD8lb2G0LKyvky4F =tXIK -----END PGP SIGNATURE----- --=-=-=--