@@ -29,17 +29,16 @@ static guid_t thc_platform_guid =
29
29
30
30
/**
31
31
* quicki2c_acpi_get_dsm_property - Query device ACPI DSM parameter
32
- *
33
- * @adev: point to ACPI device
32
+ * @adev: Point to ACPI device
34
33
* @guid: ACPI method's guid
35
34
* @rev: ACPI method's revision
36
35
* @func: ACPI method's function number
37
36
* @type: ACPI parameter's data type
38
- * @prop_buf: point to return buffer
37
+ * @prop_buf: Point to return buffer
39
38
*
40
39
* This is a helper function for device to query its ACPI DSM parameters.
41
40
*
42
- * Return: 0 if success or ENODEV on failed .
41
+ * Return: 0 if success or ENODEV on failure .
43
42
*/
44
43
static int quicki2c_acpi_get_dsm_property (struct acpi_device * adev , const guid_t * guid ,
45
44
u64 rev , u64 func , acpi_object_type type , void * prop_buf )
@@ -67,11 +66,10 @@ static int quicki2c_acpi_get_dsm_property(struct acpi_device *adev, const guid_t
67
66
68
67
/**
69
68
* quicki2c_acpi_get_dsd_property - Query device ACPI DSD parameter
70
- *
71
- * @adev: point to ACPI device
69
+ * @adev: Point to ACPI device
72
70
* @dsd_method_name: ACPI method's property name
73
71
* @type: ACPI parameter's data type
74
- * @prop_buf: point to return buffer
72
+ * @prop_buf: Point to return buffer
75
73
*
76
74
* This is a helper function for device to query its ACPI DSD parameters.
77
75
*
@@ -100,13 +98,12 @@ static int quicki2c_acpi_get_dsd_property(struct acpi_device *adev, acpi_string
100
98
}
101
99
102
100
/**
103
- * quicki2c_get_acpi_resources - Query all quicki2c devices' ACPI parameters
104
- *
105
- * @qcdev: point to quicki2c device
101
+ * quicki2c_get_acpi_resources - Query all QuickI2C devices' ACPI parameters
102
+ * @qcdev: Point to quicki2c_device structure
106
103
*
107
- * This function gets all quicki2c devices' ACPI resource.
104
+ * This function gets all QuickI2C devices' ACPI resource.
108
105
*
109
- * Return: 0 if success or error code on failed .
106
+ * Return: 0 if success or error code on failure .
110
107
*/
111
108
static int quicki2c_get_acpi_resources (struct quicki2c_device * qcdev )
112
109
{
@@ -192,10 +189,9 @@ static int quicki2c_get_acpi_resources(struct quicki2c_device *qcdev)
192
189
}
193
190
194
191
/**
195
- * quicki2c_irq_quick_handler - The ISR of the quicki2c driver
196
- *
192
+ * quicki2c_irq_quick_handler - The ISR of the QuickI2C driver
197
193
* @irq: The irq number
198
- * @dev_id: pointer to the device structure
194
+ * @dev_id: Pointer to the quicki2c_device structure
199
195
*
200
196
* Return: IRQ_WAKE_THREAD if further process needed.
201
197
*/
@@ -214,13 +210,13 @@ static irqreturn_t quicki2c_irq_quick_handler(int irq, void *dev_id)
214
210
215
211
/**
216
212
* try_recover - Try to recovery THC and Device
217
- * @qcdev: pointer to quicki2c device
213
+ * @qcdev: Pointer to quicki2c_device structure
218
214
*
219
- * This function is a error handler, called when fatal error happens.
220
- * It try to reset Touch Device and re-configure THC to recovery
221
- * transferring between Device and THC.
215
+ * This function is an error handler, called when fatal error happens.
216
+ * It try to reset touch device and re-configure THC to recovery
217
+ * communication between touch device and THC.
222
218
*
223
- * Return: 0 if successful or error code on failed
219
+ * Return: 0 if successful or error code on failure
224
220
*/
225
221
static int try_recover (struct quicki2c_device * qcdev )
226
222
{
@@ -264,7 +260,7 @@ static int handle_input_report(struct quicki2c_device *qcdev)
264
260
continue ;
265
261
}
266
262
267
- /* discard samples before driver probe complete */
263
+ /* Discard samples before driver probe complete */
268
264
if (qcdev -> state != QUICKI2C_ENABLED )
269
265
continue ;
270
266
@@ -276,10 +272,9 @@ static int handle_input_report(struct quicki2c_device *qcdev)
276
272
}
277
273
278
274
/**
279
- * quicki2c_irq_thread_handler - IRQ thread handler of quicki2c driver
280
- *
275
+ * quicki2c_irq_thread_handler - IRQ thread handler of QuickI2C driver
281
276
* @irq: The IRQ number
282
- * @dev_id: pointer to the quicki2c device structure
277
+ * @dev_id: Pointer to the quicki2c_device structure
283
278
*
284
279
* Return: IRQ_HANDLED to finish this handler.
285
280
*/
@@ -325,18 +320,17 @@ static irqreturn_t quicki2c_irq_thread_handler(int irq, void *dev_id)
325
320
}
326
321
327
322
/**
328
- * quicki2c_dev_init - Initialize quicki2c device
329
- *
330
- * @pdev: pointer to the thc pci device
331
- * @mem_addr: The pointer of MMIO memory address
323
+ * quicki2c_dev_init - Initialize QuickI2C device
324
+ * @pdev: Pointer to the THC PCI device
325
+ * @mem_addr: The Pointer of MMIO memory address
332
326
*
333
- * Alloc quicki2c device structure and initialized THC device,
327
+ * Alloc quicki2c_device structure and initialized THC device,
334
328
* then configure THC to HIDI2C mode.
335
329
*
336
330
* If success, enable THC hardware interrupt.
337
331
*
338
- * Return: pointer to the quicki2c device structure if success
339
- * or NULL on failed .
332
+ * Return: Pointer to the quicki2c_device structure if success
333
+ * or NULL on failure .
340
334
*/
341
335
static struct quicki2c_device * quicki2c_dev_init (struct pci_dev * pdev , void __iomem * mem_addr )
342
336
{
@@ -355,7 +349,7 @@ static struct quicki2c_device *quicki2c_dev_init(struct pci_dev *pdev, void __io
355
349
356
350
init_waitqueue_head (& qcdev -> reset_ack_wq );
357
351
358
- /* thc hw init */
352
+ /* THC hardware init */
359
353
qcdev -> thc_hw = thc_dev_init (qcdev -> dev , qcdev -> mem_addr );
360
354
if (IS_ERR (qcdev -> thc_hw )) {
361
355
ret = PTR_ERR (qcdev -> thc_hw );
@@ -398,9 +392,8 @@ static struct quicki2c_device *quicki2c_dev_init(struct pci_dev *pdev, void __io
398
392
}
399
393
400
394
/**
401
- * quicki2c_dev_deinit - De-initialize quicki2c device
402
- *
403
- * @qcdev: pointer to the quicki2c device structure
395
+ * quicki2c_dev_deinit - De-initialize QuickI2C device
396
+ * @qcdev: Pointer to the quicki2c_device structure
404
397
*
405
398
* Disable THC interrupt and deinitilize THC.
406
399
*/
@@ -413,13 +406,13 @@ static void quicki2c_dev_deinit(struct quicki2c_device *qcdev)
413
406
}
414
407
415
408
/**
416
- * quicki2c_dma_init - Configure THC DMA for quicki2c device
417
- * @qcdev: pointer to the quicki2c device structure
409
+ * quicki2c_dma_init - Configure THC DMA for QuickI2C device
410
+ * @qcdev: Pointer to the quicki2c_device structure
418
411
*
419
412
* This function uses TIC's parameters(such as max input length, max output
420
413
* length) to allocate THC DMA buffers and configure THC DMA engines.
421
414
*
422
- * Return: 0 if success or error code on failed .
415
+ * Return: 0 if success or error code on failure .
423
416
*/
424
417
static int quicki2c_dma_init (struct quicki2c_device * qcdev )
425
418
{
@@ -451,12 +444,12 @@ static int quicki2c_dma_init(struct quicki2c_device *qcdev)
451
444
return ret ;
452
445
}
453
446
454
- return ret ;
447
+ return 0 ;
455
448
}
456
449
457
450
/**
458
- * quicki2c_dma_deinit - Release THC DMA for quicki2c device
459
- * @qcdev: pointer to the quicki2c device structure
451
+ * quicki2c_dma_deinit - Release THC DMA for QuickI2C device
452
+ * @qcdev: Pointer to the quicki2c_device structure
460
453
*
461
454
* Stop THC DMA engines and release all DMA buffers.
462
455
*
@@ -469,7 +462,7 @@ static void quicki2c_dma_deinit(struct quicki2c_device *qcdev)
469
462
470
463
/**
471
464
* quicki2c_alloc_report_buf - Alloc report buffers
472
- * @qcdev: pointer to the quicki2c device structure
465
+ * @qcdev: Pointer to the quicki2c_device structure
473
466
*
474
467
* Allocate report descriptor buffer, it will be used for restore TIC HID
475
468
* report descriptor.
@@ -480,7 +473,7 @@ static void quicki2c_dma_deinit(struct quicki2c_device *qcdev)
480
473
* Allocate output report buffer, it will be used for store HID output report,
481
474
* such as set feature.
482
475
*
483
- * Return: 0 if success or error code on failed .
476
+ * Return: 0 if success or error code on failure .
484
477
*/
485
478
static int quicki2c_alloc_report_buf (struct quicki2c_device * qcdev )
486
479
{
@@ -518,24 +511,23 @@ static int quicki2c_alloc_report_buf(struct quicki2c_device *qcdev)
518
511
}
519
512
520
513
/*
521
- * quicki2c_probe: Quicki2c driver probe function
522
- *
523
- * @pdev: point to pci device
524
- * @id: point to pci_device_id structure
514
+ * quicki2c_probe: QuickI2C driver probe function
515
+ * @pdev: Point to PCI device
516
+ * @id: Point to pci_device_id structure
525
517
*
526
518
* This function initializes THC and HIDI2C device, the flow is:
527
- * - do THC pci device initialization
528
- * - query HIDI2C ACPI parameters
529
- * - configure THC to HIDI2C mode
530
- * - go through HIDI2C enumeration flow
531
- * |- read device descriptor
532
- * |- reset HIDI2C device
533
- * - enable THC interrupt and DMA
534
- * - read report descriptor
535
- * - register HID device
536
- * - enable runtime power management
537
- *
538
- * Return 0 if success or error code on failed .
519
+ * - Do THC pci device initialization
520
+ * - Query HIDI2C ACPI parameters
521
+ * - Configure THC to HIDI2C mode
522
+ * - Go through HIDI2C enumeration flow
523
+ * |- Read device descriptor
524
+ * |- Reset HIDI2C device
525
+ * - Enable THC interrupt and DMA
526
+ * - Read report descriptor
527
+ * - Register HID device
528
+ * - Enable runtime power management
529
+ *
530
+ * Return 0 if success or error code on failure .
539
531
*/
540
532
static int quicki2c_probe (struct pci_dev * pdev ,
541
533
const struct pci_device_id * id )
@@ -668,11 +660,10 @@ static int quicki2c_probe(struct pci_dev *pdev,
668
660
669
661
/**
670
662
* quicki2c_remove - Device Removal Routine
663
+ * @pdev: Point to PCI device structure
671
664
*
672
- * @pdev: PCI device structure
673
- *
674
- * This is called by the PCI subsystem to alert the driver
675
- * that it should release a PCI device.
665
+ * This is called by the PCI subsystem to alert the driver that it should
666
+ * release a PCI device.
676
667
*/
677
668
static void quicki2c_remove (struct pci_dev * pdev )
678
669
{
@@ -694,12 +685,10 @@ static void quicki2c_remove(struct pci_dev *pdev)
694
685
695
686
/**
696
687
* quicki2c_shutdown - Device Shutdown Routine
688
+ * @pdev: Point to PCI device structure
697
689
*
698
- * @pdev: PCI device structure
699
- *
700
- * This is called from the reboot notifier
701
- * it's a simplified version of remove so we go down
702
- * faster.
690
+ * This is called from the reboot notifier, it's a simplified version of remove
691
+ * so we go down faster.
703
692
*/
704
693
static void quicki2c_shutdown (struct pci_dev * pdev )
705
694
{
0 commit comments