@@ -23,9 +23,7 @@ The input driver model consists of the following:
...
@@ -23,9 +23,7 @@ The input driver model consists of the following:
- Common input drivers: provide common APIs that are applicable to different input devices (such as the common driver APIs for touchscreens). The APIs can be used to initialize board-specific hardware, handle hardware interrupts, and register input devices with the Input Device Manager.
- Common input drivers: provide common APIs that are applicable to different input devices (such as the common driver APIs for touchscreens). The APIs can be used to initialize board-specific hardware, handle hardware interrupts, and register input devices with the Input Device Manager.
- Input chip drivers: provide differentiated APIs for the drivers form different vendors. You can use these APIs to develop your drivers with minimum modification.
- Input chip drivers: provide differentiated APIs for the drivers form different vendors. You can use these APIs to develop your drivers with minimum modification.
- Event Hub: provides a unified channel for different input devices to report input events.
- Event Hub: provides a unified channel for different input devices to report input events.
- HDF input config: parses and manages the board-specific and private configuration of input devices.
- HDF input config: parses and manages the board-specific and private configuration of input devices.<br>The input driver model provides configuration files to help you quickly develop your drivers.
The input driver model provides configuration files to help you quickly develop your drivers.
## How to Develop
## How to Develop
...
@@ -138,7 +136,7 @@ The following example describes how to develop the touchscreen driver for an RK3
...
@@ -138,7 +136,7 @@ The following example describes how to develop the touchscreen driver for an RK3
1. Configure device information.
1. Configure device information.
Configure the modules of the input driver model in **drivers/adapter/khdf/linux/hcs/device_info/device_info.hcs**. For details, see [Driver Development](../driver/driver-hdf-development.md). Then, the HDF loads the modules of the input model in sequence based on the configuration information.
Configure the modules of the input driver model in **vendor/hihope/rk3568/hdf_config/khdf/device_info/device_info.hcs**. For details, see [Driver Development](../driver/driver-hdf-development.md). Then, the HDF loads the modules of the input model in sequence based on the configuration information.
```c
```c
input::host{
input::host{
...
@@ -183,7 +181,7 @@ The following example describes how to develop the touchscreen driver for an RK3
...
@@ -183,7 +181,7 @@ The following example describes how to develop the touchscreen driver for an RK3
2. Configure board-specific and private data for the touchscreen.
2. Configure board-specific and private data for the touchscreen.
Configure the data in **drivers/adapter/khdf/linux/hcs/input/input_config.hcs**. The following is an example. You can modify the configuration as required.
Configure the data in **vendor/hihope/rk3568/hdf_config/khdf/input/input_config.hcs**. The following is an example. You can modify the configuration as required.
```c
```c
root{
root{
...
@@ -196,7 +194,7 @@ The following example describes how to develop the touchscreen driver for an RK3
...
@@ -196,7 +194,7 @@ The following example describes how to develop the touchscreen driver for an RK3
inputType=0;// 0 indicates touchscreen.
inputType=0;// 0 indicates touchscreen.
solutionX=480;
solutionX=480;
solutionY=960;
solutionY=960;
devName="main_touch";// Device name.
devName="main_touch";// Device name.
}
}
busConfig{
busConfig{
busType=0;// 0 indicates I2C.
busType=0;// 0 indicates I2C.
...
@@ -272,7 +270,9 @@ The following example describes how to develop the touchscreen driver for an RK3
...
@@ -272,7 +270,9 @@ The following example describes how to develop the touchscreen driver for an RK3
3. Add the touchscreen driver.
3. Add the touchscreen driver.
Implement the touchscreen-specific APIs in **divers/framework/model/input/driver/touchscreen/touch_gt911.c**. The following uses the APIs for obtaining and parsing device data as an example. You can implement the related APIs to match your development.
Implement the touchscreen-specific APIs in **drivers/hdf_core/framework/model/input/driver/touchscreen/touch_gt911.c**.
The following uses the APIs for obtaining and parsing device data as an example. You can implement the related APIs to match your development.
```c
```c
/* Parse the touch reporting data read from the touchscreen into coordinates. */
/* Parse the touch reporting data read from the touchscreen into coordinates. */
...
@@ -280,7 +280,7 @@ The following example describes how to develop the touchscreen driver for an RK3
...
@@ -280,7 +280,7 @@ The following example describes how to develop the touchscreen driver for an RK3