From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from down.free-electrons.com ([37.187.137.238]:56787 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751127AbcGYJpp (ORCPT ); Mon, 25 Jul 2016 05:45:45 -0400 From: maxime.ripard@free-electrons.com Date: Mon, 25 Jul 2016 11:45:42 +0200 To: Dmitry Torokhov Cc: Quentin Schulz , jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, wens@csie.org, lee.jones@linaro.org, antoine.tenart@free-electrons.com, thomas.petazzoni@free-electrons.com, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org Subject: Re: [PATCH 4/5] input: touchscreen: support Allwinner SoCs' touchscreen Message-ID: <20160725094542.GI7419@lukather> References: <1469003351-15263-1-git-send-email-quentin.schulz@free-electrons.com> <1469003351-15263-5-git-send-email-quentin.schulz@free-electrons.com> <20160721062950.GB5993@lukather> <20160721064140.GA17658@dtor-ws> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U3s59FfKcByyGl+j" In-Reply-To: <20160721064140.GA17658@dtor-ws> Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org --U3s59FfKcByyGl+j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Dmitry, On Wed, Jul 20, 2016 at 11:41:40PM -0700, Dmitry Torokhov wrote: > On Thu, Jul 21, 2016 at 08:29:50AM +0200, Maxime Ripard wrote: > > On Wed, Jul 20, 2016 at 10:29:10AM +0200, Quentin Schulz wrote: > > > + irq =3D regmap_irq_get_virq(sunxi_gpadc_mfd_dev->regmap_irqc, irq); > > > + ret =3D devm_request_any_context_irq(&pdev->dev, irq, > > > + sunxi_gpadc_tp_up_irq_handler, 0, > > > + "tp_up", info); > > > + if (ret < 0) { > > > + dev_err(&pdev->dev, > > > + "could not request TP_UP_PENDING interrupt: %d\n", ret); > > > + goto err; > > > + } > >=20 > > You enable the interrupts... > >=20 > > > + info->tp_up_irq =3D irq; > > > + disable_irq(irq); > > > + > > > + ret =3D input_register_device(input); > > > + if (ret) { > > > + dev_err(&pdev->dev, "failed to register input device\n"); > > > + goto err; > > > + } > >=20 > > ... but your driver isn't registered yet. How does input_report and > > input_sync behave in such a case? >=20 > This is explicitly allowed: >=20 > " > ... > * NOTE: input_event() may be safely used right after input device was > * allocated with input_allocate_device(), even before it is registered > * with input_register_device(), but the event will not reach any of the > * input handlers. Such early invocation of input_event() may be used > * to 'seed' initial state of a switch or initial position of absolute > * axis, etc. > */ > " Good to know. Still, it feels like it should be handled explicitly, instead of relying on the fact that we only call input_event in our handler and that it works that way. Thanks, Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --U3s59FfKcByyGl+j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXld/GAAoJEBx+YmzsjxAgoDkQAK/0llggCKpX/rro04nf3efp fQfNUf1Pf2xs2AR7HDDBs6XySakrVZtUR1hgSRg5+MfM/dMFmG40sQ/m+RX9me0I B76ksA8pNR/FszHQuphOYWCg2uulvDgjv1dSeYP2uvP1ilCb8fBxt/yFrJGEJ5H1 VoGRQtrr/waet5VOaZCCh4rt+w7jCeIvqGO/Ly+OHWPWRIFUXyVoC/Eu9fOKAGu3 erQ81mTW7WbTp6eL6LMZ846AiYeqMWHjHOyBJhDygsIoJWcMD7SaQSfJKo8LZTAY +ZZscTHKnfnUqk+eKCBA+Gd+5alk9JlRB2LbeLzGFV9E6Uld3HxptADjt2Yb30A+ A6oYdLvK3k2f+eoRXVMRgxE1DyBajijXmw/YFvj43I4HThwbcOwYXMBkkJWCJsFz TS0EvFm7494jURoUgE9NXbPTVim5nb58tsAYO2iIoJILVuBGscUbfyXgGQt7XldN h8XO5+Mui/58NJWjkzwg58D6x9vDFy0lifQqfujl7R5qH0mNWU8ZTS87s5CHnRIZ wc7DWur8YhS7fgieA2Yqc5osx3R2R+vVdk3SIwLW0JLNJitlWKQKvLjxNoh4q/zo R+T+KUZ9oLhzf2sMNXdx3QxkZMSjq1D9xmVgM4O+rlOOCrItQIPwzgap9qSKzOm/ I3uwwIWB93aq6S6AVyQK =RIpj -----END PGP SIGNATURE----- --U3s59FfKcByyGl+j--