Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6163045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:45:34+00:00 2026-05-23T21:45:34+00:00

I’m making my first USB device driver for Linux, and I’m trying to connect

  • 0

I’m making my first USB device driver for Linux, and I’m trying to connect a touch panel device.

I have tried this device in Win7, using Win7’s default touch panel driver.
Using a line monitor/reader, I was able to get the raw data with multi-touch ENABLED.
Let’s just say for sample’s sake a multi-touch data header is [0x8301] and [0x8701]
for the first and second touch respectively.

Now with multi-touch DISABLED the raw data header would be [0x8101]

Now with the driver I made for Linux, I can only get it to output [0x8101], which is a one touch data header.

So I’m guessing somewhere in this part of the initialization code, I have to say to the device it is a multi-touch device. Or I’m probably initializing it wrongly.

    struct input_dev *input_dev;
input_dev = input_allocate_device();
input_dev->name = usb_mtouch->name;
input_dev->phys = usb_mtouch->phys;
usb_to_input_id(usb_mtouch->udev, &input_dev->id);
input_dev->dev.parent = &interface->dev;

input_set_drvdata(input_dev, usb_mtouch);

input_dev->open = mtouchdrv_open;
input_dev->close = mtouchdrv_close;

input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) |
    BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS);
input_set_abs_params(input_dev, ABS_X, usb_mtouch->x_min, usb_mtouch->x_max, 0, 0);
input_set_abs_params(input_dev, ABS_Y, usb_mtouch->y_min, usb_mtouch->y_max, 0, 0);
input_set_abs_params(input_dev, ABS_PRESSURE, 0, usb_mtouch->press_max, 0, 0);
input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC);

Also, I am using Linux 2.6.24.

Thanks!

Naze

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:45:35+00:00Added an answer on May 23, 2026 at 9:45 pm

    I got it. You would have to send a control message to the device.

    int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request,
                         __u8 requesttype, __u16 value, __u16 index, void *data,
                         __u16 size, int timeout)
    

    Most devices are one-touched enabled by default. So sending a message to the device will do the trick.

    The tricky part is what message to send. Since Win7 can make it one-touch or multi-touch. What I did was just compare the the Initialization Sequence on both. And apply the “missing” messages on Linux.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.