In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
As early as when Nokia phones were still popular, touch screens were not used much at that time. However, with the popularity of touch screen mobile phones, that is, smart phones, touch screen has basically become the standard of mobile phones. So today we can see how the touchscreen driver works on the linux.
1. Driver directory
Drivers/input
2. See how the Makefile of this directory is designed.
Obj-$ (CONFIG_INPUT) + = input-core.o input-core-y: = input.o input-compat.o input-mt.o ff-core.o obj-$ (CONFIG_INPUT_TOUCHSCREEN) + = touchscreen/
3. Except for the file input-core.o, you only need to look at the touchscreen directory
Config TOUCHSCREEN_S3C2410 tristate "Samsung S3C2410/generic touchscreen input driver" depends on ARCH_S3C24XX | | SAMSUNG_DEV_TS depends on S3C_ADC help Say Y here if you have the s3c2410 touchscreen. If unsure, say N. To compile this driver as a module, choose M here: the module will be called s3c2410_ts.
4. After you understand Kconfig, read Makefile. Note that S3C_ADC macros can refer to arch/arm/plat-samsung/adc.c.
Obj-$ (CONFIG_TOUCHSCREEN_S3C2410) + = s3c2410_ts.o
5. Continue to read the s3c2410_ts.c file
Static const struct platform_device_id s3cts_driver_ids [] = {{"s3c2410-ts", 0}, {"s3c2440-ts", 0}, {"s3c64xx-ts", FEAT_PEN_IRQ}, {}}; MODULE_DEVICE_TABLE (platform, s3cts_driver_ids) Static struct platform_driver s3c_ts_driver = {.driver = {.name = "samsung-ts", # ifdef CONFIG_PM. Pm = & s3c_ts_pmops, # endif}, .id _ table = s3cts_driver_ids, .probe = s3c2410ts_probe, .remove = s3c2410ts_remove,}; module_platform_driver (s3c_ts_driver)
6. According to the probe function, see what you need to pay attention to
Ts.client = s3c_adc_register (pdev, s3c24xx_ts_select, s3c24xx_ts_conversion, 1); if (IS_ERR (ts.client)) {dev_err (dev, "failed to register adc client\ n"); ret = PTR_ERR (ts.client); goto err_iomap;}
7. Next, check to see if any interrupt functions are registered
Ret = request_irq (ts.irq_tc, stylus_irq, 0, "s3c2410_ts_pen", ts.input)
8. Finally
Obviously, the touchscreen driver is essentially done by two macro, TOUCHSCREEN_S3C2410 and S3C_ADC.
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.