Skip to content

Commit 97fb97b

Browse files
committed
Convert comment format.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
1 parent a7f0446 commit 97fb97b

2 files changed

Lines changed: 22 additions & 46 deletions

File tree

app/module/drivers/input/iqs5xx.c

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void iqs5xx_work_handler(struct k_work *work) {
8484
uint8_t sys_info_0, sys_info_1, gesture_events_0, gesture_events_1, num_fingers;
8585
int ret;
8686

87-
/* Read system info registers */
87+
// Read system info registers.
8888
ret = iqs5xx_read_reg8(dev, IQS5XX_SYSTEM_INFO_0, &sys_info_0);
8989
if (ret < 0) {
9090
LOG_ERR("Failed to read system info 0: %d", ret);
@@ -109,10 +109,10 @@ static void iqs5xx_work_handler(struct k_work *work) {
109109
goto end_comm;
110110
}
111111

112-
/* Handle reset indication */
112+
// Handle reset indication.
113113
if (sys_info_0 & IQS5XX_SHOW_RESET) {
114114
LOG_INF("Device reset detected");
115-
/* Acknowledge reset */
115+
// Acknowledge reset.
116116
iqs5xx_write_reg8(dev, IQS5XX_SYSTEM_CONTROL_0, IQS5XX_ACK_RESET);
117117
goto end_comm;
118118
}
@@ -202,18 +202,18 @@ static void iqs5xx_work_handler(struct k_work *work) {
202202
goto end_comm;
203203
}
204204

205-
/* Report movement if there's actually movement */
205+
// Report movement if there's actually movement.
206206
if (rel_x != 0 || rel_y != 0) {
207207
LOG_DBG("Movement: fingers=%d, rel_x=%d, rel_y=%d", num_fingers, rel_x, rel_y);
208208

209-
/* Send pointer movement event */
209+
// Send pointer movement event.
210210
input_report_rel(dev, INPUT_REL_X, rel_x, false, K_FOREVER);
211211
input_report_rel(dev, INPUT_REL_Y, rel_y, true, K_FOREVER);
212212
}
213213
}
214214

215215
end_comm:
216-
/* End communication window */
216+
// End communication window.
217217
iqs5xx_end_comm_window(dev);
218218
}
219219

@@ -228,7 +228,7 @@ static int iqs5xx_setup_device(const struct device *dev) {
228228
const struct iqs5xx_config *config = dev->config;
229229
int ret;
230230

231-
/* Enable event mode and trackpad events */
231+
// Enable event mode and trackpad events.
232232
ret = iqs5xx_write_reg8(dev, IQS5XX_SYSTEM_CONFIG_1,
233233
IQS5XX_EVENT_MODE | IQS5XX_TP_EVENT | IQS5XX_GESTURE_EVENT);
234234
if (ret < 0) {
@@ -242,29 +242,12 @@ static int iqs5xx_setup_device(const struct device *dev) {
242242
return ret;
243243
}
244244

245-
/* Read the current value of bottom beta and log it */
246-
uint8_t bottom_beta;
247-
ret = iqs5xx_read_reg8(dev, IQS5XX_BOTTOM_BETA, &bottom_beta);
248-
if (ret < 0) {
249-
LOG_ERR("Failed to read bottom beta: %d", ret);
250-
return ret;
251-
}
252-
LOG_INF("Current bottom beta: %d", bottom_beta);
253-
254245
ret = iqs5xx_write_reg8(dev, IQS5XX_STATIONARY_THRESH, config->stationary_threshold);
255246
if (ret < 0) {
256247
LOG_ERR("Failed to set bottom stationary threshold: %d", ret);
257248
return ret;
258249
}
259250

260-
uint8_t stat_threshold;
261-
ret = iqs5xx_read_reg8(dev, IQS5XX_STATIONARY_THRESH, &stat_threshold);
262-
if (ret < 0) {
263-
LOG_ERR("Failed to read bottom stat_threshold: %d", ret);
264-
return ret;
265-
}
266-
LOG_INF("Current stat thresh: %d", stat_threshold);
267-
268251
// TODO: Expose these through dts bindings.
269252
// Set filter settings with:
270253
// - IIR filter enabled
@@ -294,13 +277,6 @@ static int iqs5xx_setup_device(const struct device *dev) {
294277
LOG_ERR("Failed to configure the hold time: %d", ret);
295278
return ret;
296279
}
297-
uint16_t hold_time;
298-
ret = iqs5xx_read_reg16(dev, IQS5XX_HOLD_TIME, &hold_time);
299-
if (ret < 0) {
300-
LOG_ERR("Failed to read back the hold time: %d", ret);
301-
return ret;
302-
}
303-
LOG_INF("Configured hold time: %d", hold_time);
304280

305281
uint8_t two_finger_gestures = 0;
306282
two_finger_gestures |= config->two_finger_tap ? IQS5XX_TWO_FINGER_TAP : 0;
@@ -354,7 +330,7 @@ static int iqs5xx_init(const struct device *dev) {
354330
k_work_init(&data->work, iqs5xx_work_handler);
355331
k_work_init_delayable(&data->button_release_work, iqs5xx_button_release_work_handler);
356332

357-
/* Configure reset GPIO if available */
333+
// Configure reset GPIO if available.
358334
if (config->reset_gpio.port) {
359335
if (!gpio_is_ready_dt(&config->reset_gpio)) {
360336
LOG_ERR("Reset GPIO not ready");
@@ -367,14 +343,14 @@ static int iqs5xx_init(const struct device *dev) {
367343
return ret;
368344
}
369345

370-
/* Reset the device */
346+
// Reset the device.
371347
gpio_pin_set_dt(&config->reset_gpio, 1);
372348
k_msleep(1);
373349
gpio_pin_set_dt(&config->reset_gpio, 0);
374350
k_msleep(10);
375351
}
376352

377-
/* Configure RDY GPIO */
353+
// Configure RDY GPIO.
378354
if (!gpio_is_ready_dt(&config->rdy_gpio)) {
379355
LOG_ERR("RDY GPIO not ready");
380356
return -ENODEV;
@@ -399,10 +375,10 @@ static int iqs5xx_init(const struct device *dev) {
399375
return ret;
400376
}
401377

402-
/* Wait for device to be ready */
378+
// Wait for device to be ready.
403379
k_msleep(100);
404380

405-
/* Setup device configuration */
381+
// Setup device configuration.
406382
ret = iqs5xx_setup_device(dev);
407383
if (ret < 0) {
408384
LOG_ERR("Failed to setup device: %d", ret);

app/module/drivers/input/iqs5xx.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <zephyr/device.h>
22

33
#define IQS5XX_NUM_FINGERS 0x0011
4-
#define IQS5XX_REL_X 0x0012 /* 2 bytes */
5-
#define IQS5XX_REL_Y 0x0014 /* 2 bytes */
6-
#define IQS5XX_ABS_X 0x0016 /* 2 bytes */
7-
#define IQS5XX_ABS_Y 0x0018 /* 2 bytes */
8-
#define IQS5XX_TOUCH_STRENGTH 0x001A /* 2 bytes */
4+
#define IQS5XX_REL_X 0x0012 // 2 bytes.
5+
#define IQS5XX_REL_Y 0x0014 // 2 bytes.
6+
#define IQS5XX_ABS_X 0x0016 // 2 bytes.
7+
#define IQS5XX_ABS_Y 0x0018 // 2 bytes.
8+
#define IQS5XX_TOUCH_STRENGTH 0x001A // 2 bytes.
99
#define IQS5XX_TOUCH_AREA 0x001C
1010

1111
#define IQS5XX_BOTTOM_BETA 0x0637
@@ -14,14 +14,14 @@
1414
#define IQS5XX_END_COMM_WINDOW 0xEEEE
1515

1616
#define IQS5XX_SYSTEM_CONTROL_0 0x0431
17-
/* System Control 0 bits */
17+
// System Control 0 bits.
1818
#define IQS5XX_ACK_RESET BIT(7)
1919
#define IQS5XX_AUTO_ATI BIT(5)
2020
#define IQS5XX_ALP_RESEED BIT(4)
2121
#define IQS5XX_RESEED BIT(3)
2222

2323
#define IQS5XX_SYSTEM_CONFIG_0 0x058E
24-
/* System Config 0 bits */
24+
// System Config 0 bits.
2525
#define IQS5XX_MANUAL_CONTROL BIT(7)
2626
#define IQS5XX_SETUP_COMPLETE BIT(6)
2727
#define IQS5XX_WDT BIT(5)
@@ -32,7 +32,7 @@
3232
#define IQS5XX_SW_INPUT BIT(0)
3333

3434
#define IQS5XX_SYSTEM_CONFIG_1 0x058F
35-
/* System Config 1 bits */
35+
// System Config 1 bits.
3636
#define IQS5XX_EVENT_MODE BIT(0)
3737
#define IQS5XX_GESTURE_EVENT BIT(1)
3838
#define IQS5XX_TP_EVENT BIT(2)
@@ -51,15 +51,15 @@
5151
#define IQS5XX_ALP_COUNT_FILTER BIT(3)
5252

5353
#define IQS5XX_SYSTEM_INFO_0 0x000F
54-
/* System Info 0 bits */
54+
// System Info 0 bits.
5555
#define IQS5XX_SHOW_RESET BIT(7)
5656
#define IQS5XX_ALP_REATI_OCCURRED BIT(6)
5757
#define IQS5XX_ALP_ATI_ERROR BIT(5)
5858
#define IQS5XX_REATI_OCCURRED BIT(4)
5959
#define IQS5XX_ATI_ERROR BIT(3)
6060

6161
#define IQS5XX_SYSTEM_INFO_1 0x0010
62-
/* System Info 1 bits */
62+
// System Info 1 bits.
6363
#define IQS5XX_SWITCH_STATE BIT(5)
6464
#define IQS5XX_SNAP_TOGGLE BIT(4)
6565
#define IQS5XX_RR_MISSED BIT(3)

0 commit comments

Comments
 (0)