Reprint: linux2.6.37.4 Core on XC2440 Development Board porting (vi) touch screen drive porting

Source: Internet
Author: User

from: http://blog.chinaunix.net/uid-22030783-id-3023527.htmlThe kernel comes with s3c2440 touch-screen controller driver, which is the driver of input subsystem, the touch screen driver needs the support of ADC driver, the touch screen driver file is: DRIVERS/INPUT/TOUCHSCREEN/S3C2410_TS.C add support for touch-screen drivers in the mach-xc2440.c file to create S3c2410_ts_mach_info platform data add the necessary header files:#include <plat/ts.h> xc2440_devices[] structure, add:&s3c_device_ts, building platform data for touch-screen devices:
    1. /* Touchpanel */
    2. static struct s3c2410_ts_mach_info Xc2440_ts_cfg __initdata = {
    3.     .delay = 10000,
    4.     .presc = 49
    5.     .oversampling_shift = 2
    6. }
 in the Xc2440_machine_init function, add:S3c24xx_ts_set_platdata (&xc2440_ts_cfg); To Modify the s3c2410_ts.c file:In the s3c2410ts_probe function, 318 lines start
  1. TS. Input = Input_dev;
  2. ts.input-> Evbit[0= Bit (Ev_key) | Bit (Ev_abs| BIT (Ev_syn)
  3. TS. Input->keybit[bits_to_longs(Btn_touch)] = BIT(Btn_touch) ;
  4. Input_set_abs_params(ts. Input, abs_x, 0, 0x3ff, 0, 0);
  5. Input_set_abs_params(ts. Input, abs_y, 0, 0x3ff, 0, 0);
  6. Input_set_abs_params (ts.input, abs_pressure, 0, 1, 0, 0);
in the Touch_timer_fire function:
  1. Input_report_abs(ts. Input, abs_x, TS. XP);
  2. Input_report_abs(ts. Input, abs_y, ts. YP);
  3. Input_report_key(ts. Input, Btn_touch, 1);
  4. Input_report_abs (Ts.input, abs_pressure, 1);
  5. Input_sync(ts. Input);
  6. Input_report_key(ts. Input, Btn_touch, 0);
  7. Input_report_abs (ts.input, abs_pressure, 0);
  8. Input_sync(ts. Input);
  9. Writel(Wait4int | Int_down, ts. io + s3c2410_adctsc);
Configure the kernel to support touch screen:
    1. Device Drivers--->
    2. Input Devices Support--->
    3. <*> Event Interface
    4. [*] touchscreens--->
    5. <*> Samsung s3c2410/generic Touchscreen input Driver
output at startup:samsung-ts s3c2440-ts:driver attached, registering input deviceinput:s3c24xx touchscreen as/devices/virtual/input/input0 To View the device:/dev/event0 Description: 1. The kernel comes with the touch screen driver has the bug, needs to modify in order to use normally, the concrete modification content please refer to XC2440 's Linux source code package the s3c2410_ts.c file. 2. The device name of the input subsystem device may change depending on the input device in the kernel, such as a key driver in the kernel, then the device name of the touchscreen may be changed from event0 to Event1. The same principle applies to the drive of the input subsystem behind the migration, please note.

Reprint: linux2.6.37.4 Core on XC2440 Development Board porting (vi) touch screen drive porting

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.