linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: Yann Cantin <yann.cantin@laposte.net>
Cc: linux-input@vger.kernel.org, linux-usb@vger.kernel.org,
	gregkh@linuxfoundation.org, dmitry.torokhov@gmail.com,
	linux-kernel@vger.kernel.org, jikos@suse.cz
Subject: Re: [eBeam PATCH 2/2] input: misc: New USB eBeam input driver.
Date: Wed, 05 Sep 2012 09:29:49 +0200	[thread overview]
Message-ID: <3991181.oZKWSZGdK8@linux-lqwf.site> (raw)
In-Reply-To: <1346539923-9704-3-git-send-email-yann.cantin@laposte.net>

On Sunday 02 September 2012 00:52:03 Yann Cantin wrote:

Hi,

before we add yet another sysfs interface, we should ask whether calibration
isn't a problem that should be solved with a common API.

	Regards
		Oliver

> +static ssize_t ebeam_calibrated_set(struct device *dev,
> +                                   struct device_attribute *attr,
> +                                   const char *buf,
> +                                   size_t count)
> +{
> +       struct ebeam_device *ebeam = dev_get_drvdata(dev);
> +       int err, c;
> +
> +       err = kstrtoint(buf, 10, &c);
> +       if (err)
> +               return err;
> +
> +       if (c == 1) {
> +               memcpy(&ebeam->cursetting, &ebeam->newsetting,
> +                      sizeof(struct ebeam_settings));
> +               ebeam->calibrated = true;
> +               ebeam_setup_input(ebeam, ebeam->input);
> +       } else {
> +               memcpy(&ebeam->newsetting, &ebeam->cursetting,
> +                      sizeof(struct ebeam_settings));
> +               ebeam->calibrated = false;
> +               ebeam_setup_input(ebeam, ebeam->input);
> +       }
> +
> +       return count;
> +}
> +
> +static DEVICE_ATTR(calibrated, S_IRUGO | S_IWUGO,
> +                  ebeam_calibrated_get, ebeam_calibrated_set);
> +
> +static struct attribute *ebeam_attrs[] = {
> +       &dev_attr_min_x.attr,
> +       &dev_attr_min_y.attr,
> +       &dev_attr_max_x.attr,
> +       &dev_attr_max_y.attr,
> +       &dev_attr_h1.attr,
> +       &dev_attr_h2.attr,
> +       &dev_attr_h3.attr,
> +       &dev_attr_h4.attr,
> +       &dev_attr_h5.attr,
> +       &dev_attr_h6.attr,
> +       &dev_attr_h7.attr,
> +       &dev_attr_h8.attr,
> +       &dev_attr_h9.attr,
> +       &dev_attr_calibrated.attr,
> +       NULL
> +};
> +
-- 
- - - 
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) 
Maxfeldstraße 5                         
90409 Nürnberg 
Germany 
- - - 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-09-05  7:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-01 22:52 [eBeam PATCH 0/2] new USB eBeam input driver Yann Cantin
2012-09-01 22:52 ` [eBeam PATCH 1/2] hid: Blacklist eBeam devices Yann Cantin
2012-09-01 22:52 ` [eBeam PATCH 2/2] input: misc: New USB eBeam input driver Yann Cantin
2012-09-05  7:29   ` Oliver Neukum [this message]
2012-09-05 19:58     ` Yann Cantin
2012-09-05 20:10       ` Oliver Neukum

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=3991181.oZKWSZGdK8@linux-lqwf.site \
    --to=oneukum@suse.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jikos@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=yann.cantin@laposte.net \
    /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).