From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Quadros Subject: Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface Date: Mon, 20 Jun 2016 11:25:32 +0300 Message-ID: <5767A87C.20704@ti.com> References: <1465564043-27163-1-git-send-email-rogerq@ti.com> <1465564043-27163-7-git-send-email-rogerq@ti.com> <87k2hkxr4d.fsf@linux.intel.com> <57679B30.6030809@ti.com> <87d1ncxopa.fsf@linux.intel.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pP6Pi2139uEV8g5ubXLLcxeibTIe5h3vn" Return-path: In-Reply-To: <87d1ncxopa.fsf-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Felipe Balbi , peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org Cc: tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, mathias.nyman-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, Joao.Pinto-HKixBCOQz3hWk0Htik3J/w@public.gmane.org, sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org, jun.li-KZfg59tc24xl57MIdRCFDg@public.gmane.org, grygorii.strashko-l0cyMroinI0@public.gmane.org, yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org, robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, nsekhar-l0cyMroinI0@public.gmane.org, b-liu-l0cyMroinI0@public.gmane.org, joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org --pP6Pi2139uEV8g5ubXLLcxeibTIe5h3vn Content-Type: multipart/mixed; boundary="LLXSl9up7oBuHeEtExINwMXuOLF5vJH0h" From: Roger Quadros To: Felipe Balbi , peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org Cc: tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, mathias.nyman-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, Joao.Pinto-HKixBCOQz3hWk0Htik3J/w@public.gmane.org, sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org, jun.li-KZfg59tc24xl57MIdRCFDg@public.gmane.org, grygorii.strashko-l0cyMroinI0@public.gmane.org, yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org, robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, nsekhar-l0cyMroinI0@public.gmane.org, b-liu-l0cyMroinI0@public.gmane.org, joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Message-ID: <5767A87C.20704-l0cyMroinI0@public.gmane.org> Subject: Re: [PATCH v10 06/14] usb: gadget.h: Add OTG to gadget interface References: <1465564043-27163-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org> <1465564043-27163-7-git-send-email-rogerq-l0cyMroinI0@public.gmane.org> <87k2hkxr4d.fsf-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> <57679B30.6030809-l0cyMroinI0@public.gmane.org> <87d1ncxopa.fsf-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> In-Reply-To: <87d1ncxopa.fsf-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> --LLXSl9up7oBuHeEtExINwMXuOLF5vJH0h Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 20/06/16 11:13, Felipe Balbi wrote: >=20 > Hi, >=20 > Roger Quadros writes: >> [ Unknown signature status ] >> On 20/06/16 10:21, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Roger Quadros writes: >>>> The OTG core will use struct otg_gadget_ops to >>>> start/stop the gadget controller. >>>> >>>> The main purpose of this interface is to avoid directly >>>> calling usb_gadget_start/stop() from the OTG core as they >>>> wouldn't be defined in the built-in symbol table if >>>> CONFIG_USB_GADGET is m. >>>> >>>> Signed-off-by: Roger Quadros >>>> --- >>>> include/linux/usb/gadget.h | 16 ++++++++++++++++ >>>> 1 file changed, 16 insertions(+) >>>> >>>> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h= >>>> index 2dd9e6b..f4fc0aa 100644 >>>> --- a/include/linux/usb/gadget.h >>>> +++ b/include/linux/usb/gadget.h >>>> @@ -639,6 +639,22 @@ struct usb_gadget_driver { >>>> }; >>>> =20 >>>> =20 >>>> +/*-----------------------------------------------------------------= --------*/ >>>> + >>>> +/** >>>> + * struct otg_gadget_ops - Interface between OTG core and gadget >>>> + * >>>> + * Provided by the gadget core to allow the OTG core to start/stop = the gadget >>>> + * >>>> + * @start: function to start the gadget >>>> + * @stop: function to stop the gadget >>>> + * @connect_control: function to connect/disconnect from the bus >>>> + */ >>>> +struct otg_gadget_ops { >>>> + int (*start)(struct usb_gadget *gadget); >>>> + int (*stop)(struct usb_gadget *gadget); >>>> + int (*connect_control)(struct usb_gadget *gadget, bool connect); >>>> +}; >>> >>> you shouldn't need these at all. They are already part of the gadget >>> framework as ->udc_start(), ->udc_stop() and ->pullup() >>> >> >> This is to avoid the undefined symbol errors during build when OTG has= is >> built-in because USB (host) is built-in but GADGET is still a module. >=20 > change your Kconfig dependencies. OTG layer shouldn't be built-in unles= s > both Gadget and Host are built-in. >=20 That is only one side of the story. What happens if OTG is (m), Host is (m) but Gadget is (built in). Gadget build will fail because of undefined symbol errors for all of the OTG APIs. cheers, -roger --LLXSl9up7oBuHeEtExINwMXuOLF5vJH0h-- --pP6Pi2139uEV8g5ubXLLcxeibTIe5h3vn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXZ6h8AAoJENJaa9O+djCTR2EQAJA5EScakswQpPR3aSFSZBH/ ELRCAX2JV2JAI/0x3EpDyLPEUZsJ/3Qb6sV/I3DlGjuvBOZ+PH6AV9lB8r5iiddm +qckTzlOf2uf+AFjAAGBFWE9dBQx9N3DgMv37gsJMRzTV/Xikrf4K63SZV3BqIi2 oDY40fU3zzGLkv7s2vQFJXbR9ENEKADUxz8D0ayS1OKXqVojmPrwxujPMhdGyNxQ eCsk0Tb3OaTRlDqH6g8o3dXhKT4K0pJe/19J+s2YGxjSLIDKe8cGI6+QWePpMbpi ZzH2eQjK1hj2+4Xxx8k2DuQicdC/FI3bA494FURCGpyn0mZWDcTnXbsB7XtoM7xF v3iF1NmwcH99lPWw+mxbUfVr6+avya+IKgQgXwX3CATK9oCnzN0wSzjZ9GqURuJm QMVLataskEn/TbqN7z2/ATey1c/oed7fnlSMpufOVYYs28X//blJsk6mcG4osZC/ eGODWQc6NhUlnSYDk53z11DAJzR64q8kvArwo7ZMyS7LIcafYTACGz3OGqbCPWHq 0KyyBpMvNNeKxoIVYIkAc10vrlJc5PODp4WSaabG3ZhqZwxfj8wR5uj95wJrvAh6 JYofZo+TPc3vqOIuvxxV7Di2F8QFP3uHDgbGB6JHwRaPHyEcwyhp2kbPAHvoPje6 OiS6cbY0rvQivApWK/LR =6QDi -----END PGP SIGNATURE----- --pP6Pi2139uEV8g5ubXLLcxeibTIe5h3vn-- -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html