@@ -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
215215end_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 );
0 commit comments