linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Ping Cheng <pinglinux@gmail.com>
Cc: chris@cnpbagwell.com, linux-input@vger.kernel.org
Subject: Re: [PATCH 1/2] input: wacom - retrieve maximum number of touch points
Date: Tue, 24 Apr 2012 22:05:47 -0700	[thread overview]
Message-ID: <20120425050547.GA27843@core.coreip.homeip.net> (raw)
In-Reply-To: <CAF8JNh+t4fnsigjta1xoRQ565NU6+rf8zDDCte=4d68MwdVK6A@mail.gmail.com>

On Tue, Apr 24, 2012 at 01:46:15PM -0700, Ping Cheng wrote:
> On Fri, Apr 20, 2012 at 10:56 PM, Dmitry Torokhov <dmitry.torokhov@gmail.com
> > wrote:
> 
> > Hi Chris, Ping,
> >
> > On Sun, Apr 15, 2012 at 05:50:23PM -0500, chris@cnpbagwell.com wrote:
> > > From: Ping Cheng <pinglinux@gmail.com>
> > >
> > > From the HID usage table when it is supported.
> > >
> > > Tested-by: Jason Gerecke <killertofu@gmail.com>
> > > Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
> > > Signed-off-by: Ping Cheng <pingc@wacom.com>
> > > ---
> > >  drivers/input/tablet/wacom_sys.c |   22 +++++++++++++-
> > >  drivers/input/tablet/wacom_wac.c |   59
> > +++++++++++++++++++++++---------------
> > >  drivers/input/tablet/wacom_wac.h |    1 +
> > >  3 files changed, 58 insertions(+), 24 deletions(-)
> > >
> > > diff --git a/drivers/input/tablet/wacom_sys.c
> > b/drivers/input/tablet/wacom_sys.c
> > > index 1c874ad..469f6ce 100644
> > > --- a/drivers/input/tablet/wacom_sys.c
> > > +++ b/drivers/input/tablet/wacom_sys.c
> > > @@ -28,6 +28,7 @@
> > >  #define HID_USAGE_Y_TILT             0x3e
> > >  #define HID_USAGE_FINGER             0x22
> > >  #define HID_USAGE_STYLUS             0x20
> > > +#define HID_USAGE_CONTACTMAX         0x55
> > >  #define HID_COLLECTION                       0xa1
> > >  #define HID_COLLECTION_LOGICAL               0x02
> > >  #define HID_COLLECTION_END           0xc0
> > > @@ -201,6 +202,20 @@ static int wacom_parse_logical_collection(unsigned
> > char *report,
> > >       return length;
> > >  }
> > >
> > > +static void wacom_retrieve_report_data(struct usb_interface *intf,
> > > +                                    struct wacom_features *features)
> > > +{
> > > +     int result = 0;
> > > +     unsigned char rep_data[2];
> >
> > You can't use on-stack buffers with USB. I see we allocating memory
> > elsewhere but I wonder if we should simply piggyback on wacom_wac->data
> > in all these interrogation methods.
> >
> 
> When you say piggyback on wacom_wac->data, I guess you meant using the same
> wacom_wac->data instead of creating a new entry for the others. However,
> wacom_wac->data has a sizeof(struct wacom_usbdev_data). The existing
> kzalloc requests in wacom_sys.c range from 2 to 259, assuming we do not
> consider those kzallocs that handle variable sizes, such as
> hid_desc->wDescriptorLength.
> 
> What size would be reasonable for the new data? I feel we need to introduce
> a new entry in wacom_wac if we want to unify the kzalloc request a bit.

Hmm, maybe piggybacking was not such a good idea. We want to keep
buffers used by leds separate since these operations can appen
simultaneously and since we also have to deal with variable length of
hid descriptors I think we should just kmalloc memory in
wacom_retrieve_report_data() and be done with it.

-- 
Dmitry

  parent reply	other threads:[~2012-04-25  5:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-15 22:50 [PATCH 0/2] Add E5 support chris
2012-04-15 22:50 ` [PATCH 1/2] input: wacom - retrieve maximum number of touch points chris
2012-04-21  5:56   ` Dmitry Torokhov
     [not found]     ` <CAF8JNh+t4fnsigjta1xoRQ565NU6+rf8zDDCte=4d68MwdVK6A@mail.gmail.com>
2012-04-25  5:05       ` Dmitry Torokhov [this message]
2012-04-15 22:50 ` [PATCH 2/2] input: wacom - add 0xE5 (MT device) support chris
  -- strict thread matches above, loose matches on Subject: below --
2012-04-26  1:13 [PATCH 1/2] input: wacom - retrieve maximum number of touch points Ping Cheng
2012-04-30  4:09 ` Dmitry Torokhov
2012-02-01  4:03 [PATCH 1/2] input : " chris
2012-02-01 11:53 ` Maurus Cuelenaere
2012-02-01 16:16   ` Chris Bagwell

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=20120425050547.GA27843@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=chris@cnpbagwell.com \
    --cc=linux-input@vger.kernel.org \
    --cc=pinglinux@gmail.com \
    /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).