From: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: Carlo Caione <carlo-KA+7E9HrN00dnm+yROfE0A@public.gmane.org> Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org, hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, emilio-0Z03zUJReD5OxF6Tv1QG9Q@public.gmane.org, wens-jdAy2FN1RRM@public.gmane.org, sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org Subject: Re: Re: [PATCH v3 04/10] input: misc: Add driver for AXP20x Power Enable Key Date: Sat, 29 Mar 2014 12:05:11 -0700 [thread overview] Message-ID: <20140329190511.GA10710@core.coreip.homeip.net> (raw) In-Reply-To: <20140329153624.GA3952-bi+AKbBUZKZeIdyRz4JgOMwOAu8XWILU@public.gmane.org> On Sat, Mar 29, 2014 at 04:36:24PM +0100, Carlo Caione wrote: > On Fri, Mar 28, 2014 at 12:38:03AM -0700, Dmitry Torokhov wrote: > > Hi Carlo, > > Hi Dmitry, > > > > > On Thu, Mar 27, 2014 at 10:29:18PM +0100, Carlo Caione wrote: [...] > > > + > > > + error = devm_request_threaded_irq(&pdev->dev, axp20x_pek->irq_dbr, > > > + NULL, axp20x_pek_irq, 0, > > > + "axp20x-pek-dbr", idev); > > > > Why does it have to be threaded IRQ? > > Because this is already handled as a nested irq from a irq thread. The > parent threaded irq is installed by regmap_add_irq_chip() in the MFD > driver core. Then you probably want to use devm_request_any_context_irq() - the driver does not necessarily care if IRQ is threaded or not, t can work either way. > > > > + if (error) { > > > + dev_err(axp20x->dev, "Failed to request dbr IRQ#%d: %d\n", > > > + axp20x_pek->irq_dbr, error); > > > + > > > + return error; > > > + } > > > + > > > + error = devm_request_threaded_irq(&pdev->dev, axp20x_pek->irq_dbf, > > > + NULL, axp20x_pek_irq, 0, > > > + "axp20x-pek-dbf", idev); > > > + if (error) { > > > + dev_err(axp20x->dev, "Failed to request dbf IRQ#%d: %d\n", > > > + axp20x_pek->irq_dbf, error); > > > + return error; > > > + } > > > + > > > + idev->dev.groups = dev_attr_groups; > > > > These are not generic input attributes so they should belong to the platform > > device, not input device. > > Ok. Can I ask why they cannot be considered an input attributes? Input layer is an abstraction; I am trying to keep all attributes generic and applicable to all input devices. If you look at other input drivers you will see that attributes that control hardware behavior are attached to the devices representing the hardware itself. For example attributes to control report rate of PS/2 mouse belong to serio port that represents the physical mouse device; typematic rate of AT keyboards also tied to serio port, etc, etc. Thanks. -- Dmitry
WARNING: multiple messages have this Message-ID (diff)
From: dmitry.torokhov@gmail.com (Dmitry Torokhov) To: linux-arm-kernel@lists.infradead.org Subject: [linux-sunxi] Re: [PATCH v3 04/10] input: misc: Add driver for AXP20x Power Enable Key Date: Sat, 29 Mar 2014 12:05:11 -0700 [thread overview] Message-ID: <20140329190511.GA10710@core.coreip.homeip.net> (raw) In-Reply-To: <20140329153624.GA3952@localhost.fastwebnet.it> On Sat, Mar 29, 2014 at 04:36:24PM +0100, Carlo Caione wrote: > On Fri, Mar 28, 2014 at 12:38:03AM -0700, Dmitry Torokhov wrote: > > Hi Carlo, > > Hi Dmitry, > > > > > On Thu, Mar 27, 2014 at 10:29:18PM +0100, Carlo Caione wrote: [...] > > > + > > > + error = devm_request_threaded_irq(&pdev->dev, axp20x_pek->irq_dbr, > > > + NULL, axp20x_pek_irq, 0, > > > + "axp20x-pek-dbr", idev); > > > > Why does it have to be threaded IRQ? > > Because this is already handled as a nested irq from a irq thread. The > parent threaded irq is installed by regmap_add_irq_chip() in the MFD > driver core. Then you probably want to use devm_request_any_context_irq() - the driver does not necessarily care if IRQ is threaded or not, t can work either way. > > > > + if (error) { > > > + dev_err(axp20x->dev, "Failed to request dbr IRQ#%d: %d\n", > > > + axp20x_pek->irq_dbr, error); > > > + > > > + return error; > > > + } > > > + > > > + error = devm_request_threaded_irq(&pdev->dev, axp20x_pek->irq_dbf, > > > + NULL, axp20x_pek_irq, 0, > > > + "axp20x-pek-dbf", idev); > > > + if (error) { > > > + dev_err(axp20x->dev, "Failed to request dbf IRQ#%d: %d\n", > > > + axp20x_pek->irq_dbf, error); > > > + return error; > > > + } > > > + > > > + idev->dev.groups = dev_attr_groups; > > > > These are not generic input attributes so they should belong to the platform > > device, not input device. > > Ok. Can I ask why they cannot be considered an input attributes? Input layer is an abstraction; I am trying to keep all attributes generic and applicable to all input devices. If you look at other input drivers you will see that attributes that control hardware behavior are attached to the devices representing the hardware itself. For example attributes to control report rate of PS/2 mouse belong to serio port that represents the physical mouse device; typematic rate of AT keyboards also tied to serio port, etc, etc. Thanks. -- Dmitry
next prev parent reply other threads:[~2014-03-29 19:05 UTC|newest] Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-03-27 21:29 [PATCH v3 00/10] mfd: AXP20x: Add support for AXP202 and AXP209 Carlo Caione 2014-03-27 21:29 ` Carlo Caione [not found] ` <1395955764-18103-1-git-send-email-carlo-KA+7E9HrN00dnm+yROfE0A@public.gmane.org> 2014-03-27 21:29 ` [PATCH v3 01/10] mfd: AXP20x: Add mfd driver for AXP20x PMIC Carlo Caione 2014-03-27 21:29 ` Carlo Caione [not found] ` <1395955764-18103-2-git-send-email-carlo-KA+7E9HrN00dnm+yROfE0A@public.gmane.org> 2014-03-28 9:21 ` Lee Jones 2014-03-28 9:21 ` Lee Jones 2014-03-29 15:53 ` Carlo Caione 2014-03-29 15:53 ` [linux-sunxi] " Carlo Caione 2014-04-11 9:26 ` Carlo Caione 2014-04-11 9:26 ` [linux-sunxi] " Carlo Caione 2014-03-27 21:29 ` [PATCH v3 02/10] dt-bindings: add vendor-prefix for X-Powers Carlo Caione 2014-03-27 21:29 ` Carlo Caione 2014-03-27 21:29 ` [PATCH v3 03/10] mfd: AXP20x: Add bindings documentation Carlo Caione 2014-03-27 21:29 ` Carlo Caione 2014-03-27 21:29 ` [PATCH v3 04/10] input: misc: Add driver for AXP20x Power Enable Key Carlo Caione 2014-03-27 21:29 ` Carlo Caione [not found] ` <1395955764-18103-5-git-send-email-carlo-KA+7E9HrN00dnm+yROfE0A@public.gmane.org> 2014-03-28 7:38 ` Dmitry Torokhov 2014-03-28 7:38 ` Dmitry Torokhov [not found] ` <20140328073803.GA22093-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org> 2014-03-29 15:36 ` Carlo Caione 2014-03-29 15:36 ` [linux-sunxi] " Carlo Caione [not found] ` <20140329153624.GA3952-bi+AKbBUZKZeIdyRz4JgOMwOAu8XWILU@public.gmane.org> 2014-03-29 19:05 ` Dmitry Torokhov [this message] 2014-03-29 19:05 ` Dmitry Torokhov 2014-03-27 21:29 ` [PATCH v3 09/10] ARM: sunxi: Add AXP20x support in defconfig Carlo Caione 2014-03-27 21:29 ` Carlo Caione 2014-03-27 21:29 ` [PATCH v3 05/10] input: misc: Add ABI docs for AXP20x PEK Carlo Caione 2014-03-27 21:29 ` Carlo Caione 2014-03-27 21:29 ` [PATCH v3 06/10] regulator: AXP20x: Add support for regulators subsystem Carlo Caione 2014-03-27 21:29 ` Carlo Caione [not found] ` <1395955764-18103-7-git-send-email-carlo-KA+7E9HrN00dnm+yROfE0A@public.gmane.org> 2014-03-28 13:39 ` Mark Brown 2014-03-28 13:39 ` Mark Brown 2014-03-29 17:52 ` [linux-sunxi] " Carlo Caione 2014-03-29 17:52 ` Carlo Caione [not found] ` <20140329175201.GD3952-bi+AKbBUZKZeIdyRz4JgOMwOAu8XWILU@public.gmane.org> 2014-03-30 0:47 ` Mark Brown 2014-03-30 0:47 ` [linux-sunxi] " Mark Brown 2014-03-27 21:29 ` [PATCH v3 07/10] ARM: sunxi: dt: Add x-powers-axp209.dtsi file Carlo Caione 2014-03-27 21:29 ` Carlo Caione [not found] ` <1395955764-18103-8-git-send-email-carlo-KA+7E9HrN00dnm+yROfE0A@public.gmane.org> 2014-03-28 13:34 ` Mark Brown 2014-03-28 13:34 ` Mark Brown [not found] ` <20140328133438.GA19846-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 2014-03-29 16:14 ` Carlo Caione 2014-03-29 16:14 ` Carlo Caione 2014-03-27 21:29 ` [PATCH v3 08/10] ARM: sun7i/sun4i: dt: Add AXP209 support to various boards Carlo Caione 2014-03-27 21:29 ` Carlo Caione 2014-03-28 3:12 ` Chen-Yu Tsai 2014-03-28 3:12 ` Chen-Yu Tsai 2014-03-28 7:37 ` [linux-sunxi] " Carlo Caione 2014-03-28 7:37 ` Carlo Caione [not found] ` <1395955764-18103-9-git-send-email-carlo-KA+7E9HrN00dnm+yROfE0A@public.gmane.org> 2014-03-28 10:11 ` Maxime Ripard 2014-03-28 10:11 ` Maxime Ripard 2014-03-28 11:38 ` Mark Brown 2014-03-28 11:38 ` Mark Brown [not found] ` <20140328113839.GB30768-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 2014-03-28 12:54 ` Maxime Ripard 2014-03-28 12:54 ` Maxime Ripard 2014-03-28 13:12 ` Mark Brown 2014-03-28 13:12 ` Mark Brown 2014-03-27 21:29 ` [PATCH v3 10/10] ARM: sunxi: Add AXP20x support multi_v7_defconfig Carlo Caione 2014-03-27 21:29 ` Carlo Caione 2014-03-28 8:01 ` [PATCH v3 00/10] mfd: AXP20x: Add support for AXP202 and AXP209 Lee Jones 2014-03-28 8:01 ` Lee Jones
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=20140329190511.GA10710@core.coreip.homeip.net \ --to=dmitry.torokhov-re5jqeeqqe8avxtiumwx3w@public.gmane.org \ --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \ --cc=carlo-KA+7E9HrN00dnm+yROfE0A@public.gmane.org \ --cc=emilio-0Z03zUJReD5OxF6Tv1QG9Q@public.gmane.org \ --cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \ --cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \ --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \ --cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \ --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \ --cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \ --cc=wens-jdAy2FN1RRM@public.gmane.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.