devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: mathieu.poirier@linaro.org
Cc: grant.likely@linaro.org, devicetree-discuss@lists.ozlabs.org,
	john.stultz@linaro.org, kernel-team@android.com,
	linux-input@vger.kernel.org
Subject: Re: [PATCH 2/2] Input: Adding DT support for keyreset tuneables
Date: Thu, 27 Jun 2013 09:28:58 -0700	[thread overview]
Message-ID: <20130627162858.GB12070@core.coreip.homeip.net> (raw)
In-Reply-To: <20130627162820.GA12070@core.coreip.homeip.net>

On Thu, Jun 27, 2013 at 09:28:20AM -0700, Dmitry Torokhov wrote:
> Hi Mathieu,
> 
> On Thu, Jun 27, 2013 at 10:13:25AM -0600, mathieu.poirier@linaro.org wrote:
> > From: "Mathieu J. Poirier" <mathieu.poirier@linaro.org>
> > 
> > This patch adds the possibility to get the keyreset and timeout
> > values from the device tree.
> > 
> > Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> > ---
> >  drivers/tty/sysrq.c |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 54 insertions(+)
> > 
> > diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
> > index b51c154..91d081c 100644
> > --- a/drivers/tty/sysrq.c
> > +++ b/drivers/tty/sysrq.c
> > @@ -44,6 +44,7 @@
> >  #include <linux/uaccess.h>
> >  #include <linux/moduleparam.h>
> >  #include <linux/jiffies.h>
> > +#include <linux/of.h>
> >  
> >  #include <asm/ptrace.h>
> >  #include <asm/irq_regs.h>
> > @@ -671,6 +672,50 @@ static void sysrq_detect_reset_sequence(struct sysrq_state *state,
> >  	}
> >  }
> >  
> > +static void sysrq_of_get_keyreset_config(void)
> > +{
> > +	unsigned short key;
> > +	struct device_node *np;
> > +	const struct property *prop;
> > +	const __be32 *val;
> > +	int count, i;
> > +
> > +	np = of_find_node_by_path("/sysrq");
> > +	if (!np) {
> > +		pr_info("No sysrq node found");
> 
> I do not think this should be an info as majority would not have it
> defined I think.
> 
> > +		goto out;
> > +	}
> > +
> > +	prop = of_find_property(np, "linux,input-keyset", NULL);
> 
> Maybe "linux,input-key*re*set"?
> 
> > +	if (!prop || !prop->value) {
> > +		pr_err("Invalid input-keyset");
> > +		goto out;
> > +	}
> > +
> > +	count = prop->length / sizeof(u32);
> > +	val = prop->value;
> > +
> > +	if (count > SYSRQ_KEY_RESET_MAX)
> > +		count = SYSRQ_KEY_RESET_MAX;
> > +
> > +	/* reset in case a __weak definition was present */
> > +	sysrq_reset_seq_len = 0;
> 
> Hmm, my preference for ordering would be software over firmware, so that
> user could override firmware data, if needed.
> 
> Please also add the documenation describing the binding.

Ah, I see the other patch now. I'd just combine the two.

-- 
Dmitry

  reply	other threads:[~2013-06-27 16:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 16:13 [PATCH 1/2] Input: Add device tree bindings for input keys mathieu.poirier
2013-06-27 16:13 ` [PATCH 2/2] Input: Adding DT support for keyreset tuneables mathieu.poirier
2013-06-27 16:28   ` Dmitry Torokhov
2013-06-27 16:28     ` Dmitry Torokhov [this message]
2013-06-27 17:56     ` Mathieu Poirier
2013-06-27 18:25       ` Dmitry Torokhov
2013-06-27 18:42         ` Mathieu Poirier
2013-06-28  6:09           ` Dmitry Torokhov
2013-06-28 13:19             ` Mathieu Poirier
2013-07-10 15:14               ` Grant Likely
2013-07-10 16:52                 ` Dmitry Torokhov
     [not found]                   ` <20130710165247.GA22992-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2013-07-10 21:35                     ` Mathieu Poirier
2013-07-10 21:50                   ` Grant Likely
2013-07-10 22:20                     ` Dmitry Torokhov
     [not found]                       ` <3572203.AkEVm8LFzu-wUGeVx6es1+Q2O5dskk9LyLysJ1jNyTM@public.gmane.org>
2013-07-10 22:29                         ` Mathieu Poirier
2013-07-10 22:55                           ` Dmitry Torokhov

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=20130627162858.GB12070@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=linux-input@vger.kernel.org \
    --cc=mathieu.poirier@linaro.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).