@@ -323,6 +323,7 @@ static irqreturn_t quicki2c_irq_thread_handler(int irq, void *dev_id)
323323 * quicki2c_dev_init - Initialize QuickI2C device
324324 * @pdev: Pointer to the THC PCI device
325325 * @mem_addr: The Pointer of MMIO memory address
326+ * @ddata: Point to quicki2c_ddata structure
326327 *
327328 * Alloc quicki2c_device structure and initialized THC device,
328329 * then configure THC to HIDI2C mode.
@@ -332,7 +333,8 @@ static irqreturn_t quicki2c_irq_thread_handler(int irq, void *dev_id)
332333 * Return: Pointer to the quicki2c_device structure if success
333334 * or NULL on failure.
334335 */
335- static struct quicki2c_device * quicki2c_dev_init (struct pci_dev * pdev , void __iomem * mem_addr )
336+ static struct quicki2c_device * quicki2c_dev_init (struct pci_dev * pdev , void __iomem * mem_addr ,
337+ const struct quicki2c_ddata * ddata )
336338{
337339 struct device * dev = & pdev -> dev ;
338340 struct quicki2c_device * qcdev ;
@@ -346,6 +348,7 @@ static struct quicki2c_device *quicki2c_dev_init(struct pci_dev *pdev, void __io
346348 qcdev -> dev = dev ;
347349 qcdev -> mem_addr = mem_addr ;
348350 qcdev -> state = QUICKI2C_DISABLED ;
351+ qcdev -> ddata = ddata ;
349352
350353 init_waitqueue_head (& qcdev -> reset_ack_wq );
351354
@@ -529,9 +532,9 @@ static int quicki2c_alloc_report_buf(struct quicki2c_device *qcdev)
529532 *
530533 * Return 0 if success or error code on failure.
531534 */
532- static int quicki2c_probe (struct pci_dev * pdev ,
533- const struct pci_device_id * id )
535+ static int quicki2c_probe (struct pci_dev * pdev , const struct pci_device_id * id )
534536{
537+ const struct quicki2c_ddata * ddata = (const struct quicki2c_ddata * )id -> driver_data ;
535538 struct quicki2c_device * qcdev ;
536539 void __iomem * mem_addr ;
537540 int ret ;
@@ -569,7 +572,7 @@ static int quicki2c_probe(struct pci_dev *pdev,
569572
570573 pdev -> irq = pci_irq_vector (pdev , 0 );
571574
572- qcdev = quicki2c_dev_init (pdev , mem_addr );
575+ qcdev = quicki2c_dev_init (pdev , mem_addr , ddata );
573576 if (IS_ERR (qcdev )) {
574577 dev_err_once (& pdev -> dev , "QuickI2C device init failed\n" );
575578 ret = PTR_ERR (qcdev );
@@ -919,13 +922,13 @@ static const struct dev_pm_ops quicki2c_pm_ops = {
919922};
920923
921924static const struct pci_device_id quicki2c_pci_tbl [] = {
922- {PCI_VDEVICE (INTEL , THC_LNL_DEVICE_ID_I2C_PORT1 ), },
923- {PCI_VDEVICE (INTEL , THC_LNL_DEVICE_ID_I2C_PORT2 ), },
924- {PCI_VDEVICE (INTEL , THC_PTL_H_DEVICE_ID_I2C_PORT1 ), },
925- {PCI_VDEVICE (INTEL , THC_PTL_H_DEVICE_ID_I2C_PORT2 ), },
926- {PCI_VDEVICE (INTEL , THC_PTL_U_DEVICE_ID_I2C_PORT1 ), },
927- {PCI_VDEVICE (INTEL , THC_PTL_U_DEVICE_ID_I2C_PORT2 ), },
928- {}
925+ { PCI_DEVICE_DATA (INTEL , THC_LNL_DEVICE_ID_I2C_PORT1 , NULL ) },
926+ { PCI_DEVICE_DATA (INTEL , THC_LNL_DEVICE_ID_I2C_PORT2 , NULL ) },
927+ { PCI_DEVICE_DATA (INTEL , THC_PTL_H_DEVICE_ID_I2C_PORT1 , NULL ) },
928+ { PCI_DEVICE_DATA (INTEL , THC_PTL_H_DEVICE_ID_I2C_PORT2 , NULL ) },
929+ { PCI_DEVICE_DATA (INTEL , THC_PTL_U_DEVICE_ID_I2C_PORT1 , NULL ) },
930+ { PCI_DEVICE_DATA (INTEL , THC_PTL_U_DEVICE_ID_I2C_PORT2 , NULL ) },
931+ { }
929932};
930933MODULE_DEVICE_TABLE (pci , quicki2c_pci_tbl );
931934
0 commit comments