diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-06-05 09:25:12 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-06-05 09:25:12 -0700 |
commit | b2c9a83d262a8feb022e24e9f9aadb66cb10a7a8 (patch) | |
tree | 6f3ded2dbdfd308e04bd781bc33bdb8af3a45558 /drivers/scsi/ufs/tc-dwc-g210-pci.c | |
parent | 2981436374177f78539b026ce5bcbab8c251818e (diff) | |
parent | aa2a4ded05058f134a4dee1424f829d662e00cda (diff) | |
download | lwn-b2c9a83d262a8feb022e24e9f9aadb66cb10a7a8.tar.gz lwn-b2c9a83d262a8feb022e24e9f9aadb66cb10a7a8.zip |
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley:
"Mostly small bug fixes plus other trivial updates.
The major change of note is moving ufs out of scsi and a minor update
to lpfc vmid handling"
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (24 commits)
scsi: qla2xxx: Remove unused 'ql_dm_tgt_ex_pct' parameter
scsi: qla2xxx: Remove setting of 'req' and 'rsp' parameters
scsi: mpi3mr: Fix kernel-doc
scsi: lpfc: Add support for ATTO Fibre Channel devices
scsi: core: Return BLK_STS_TRANSPORT for ALUA transitioning
scsi: sd_zbc: Prevent zone information memory leak
scsi: sd: Fix potential NULL pointer dereference
scsi: mpi3mr: Rework mrioc->bsg_device model to fix warnings
scsi: myrb: Fix up null pointer access on myrb_cleanup()
scsi: core: Unexport scsi_bus_type
scsi: sd: Don't call blk_cleanup_disk() in sd_probe()
scsi: ufs: ufshcd: Delete unnecessary NULL check
scsi: isci: Fix typo in comment
scsi: pmcraid: Fix typo in comment
scsi: smartpqi: Fix typo in comment
scsi: qedf: Fix typo in comment
scsi: esas2r: Fix typo in comment
scsi: storvsc: Fix typo in comment
scsi: ufs: Split the drivers/scsi/ufs directory
scsi: qla1280: Remove redundant variable
...
Diffstat (limited to 'drivers/scsi/ufs/tc-dwc-g210-pci.c')
-rw-r--r-- | drivers/scsi/ufs/tc-dwc-g210-pci.c | 150 |
1 files changed, 0 insertions, 150 deletions
diff --git a/drivers/scsi/ufs/tc-dwc-g210-pci.c b/drivers/scsi/ufs/tc-dwc-g210-pci.c deleted file mode 100644 index e635c211c783..000000000000 --- a/drivers/scsi/ufs/tc-dwc-g210-pci.c +++ /dev/null @@ -1,150 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Synopsys G210 Test Chip driver - * - * Copyright (C) 2015-2016 Synopsys, Inc. (www.synopsys.com) - * - * Authors: Joao Pinto <jpinto@synopsys.com> - */ - -#include "ufshcd.h" -#include "ufshcd-dwc.h" -#include "tc-dwc-g210.h" - -#include <linux/module.h> -#include <linux/pci.h> -#include <linux/pm_runtime.h> - -/* Test Chip type expected values */ -#define TC_G210_20BIT 20 -#define TC_G210_40BIT 40 -#define TC_G210_INV 0 - -static int tc_type = TC_G210_INV; -module_param(tc_type, int, 0); -MODULE_PARM_DESC(tc_type, "Test Chip Type (20 = 20-bit, 40 = 40-bit)"); - -/* - * struct ufs_hba_dwc_vops - UFS DWC specific variant operations - */ -static struct ufs_hba_variant_ops tc_dwc_g210_pci_hba_vops = { - .name = "tc-dwc-g210-pci", - .link_startup_notify = ufshcd_dwc_link_startup_notify, -}; - -/** - * tc_dwc_g210_pci_shutdown - main function to put the controller in reset state - * @pdev: pointer to PCI device handle - */ -static void tc_dwc_g210_pci_shutdown(struct pci_dev *pdev) -{ - ufshcd_shutdown((struct ufs_hba *)pci_get_drvdata(pdev)); -} - -/** - * tc_dwc_g210_pci_remove - de-allocate PCI/SCSI host and host memory space - * data structure memory - * @pdev: pointer to PCI handle - */ -static void tc_dwc_g210_pci_remove(struct pci_dev *pdev) -{ - struct ufs_hba *hba = pci_get_drvdata(pdev); - - pm_runtime_forbid(&pdev->dev); - pm_runtime_get_noresume(&pdev->dev); - ufshcd_remove(hba); -} - -/** - * tc_dwc_g210_pci_probe - probe routine of the driver - * @pdev: pointer to PCI device handle - * @id: PCI device id - * - * Returns 0 on success, non-zero value on failure - */ -static int -tc_dwc_g210_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) -{ - struct ufs_hba *hba; - void __iomem *mmio_base; - int err; - - /* Check Test Chip type and set the specific setup routine */ - if (tc_type == TC_G210_20BIT) { - tc_dwc_g210_pci_hba_vops.phy_initialization = - tc_dwc_g210_config_20_bit; - } else if (tc_type == TC_G210_40BIT) { - tc_dwc_g210_pci_hba_vops.phy_initialization = - tc_dwc_g210_config_40_bit; - } else { - dev_err(&pdev->dev, "test chip version not specified\n"); - return -EPERM; - } - - err = pcim_enable_device(pdev); - if (err) { - dev_err(&pdev->dev, "pcim_enable_device failed\n"); - return err; - } - - pci_set_master(pdev); - - err = pcim_iomap_regions(pdev, 1 << 0, UFSHCD); - if (err < 0) { - dev_err(&pdev->dev, "request and iomap failed\n"); - return err; - } - - mmio_base = pcim_iomap_table(pdev)[0]; - - err = ufshcd_alloc_host(&pdev->dev, &hba); - if (err) { - dev_err(&pdev->dev, "Allocation failed\n"); - return err; - } - - hba->vops = &tc_dwc_g210_pci_hba_vops; - - err = ufshcd_init(hba, mmio_base, pdev->irq); - if (err) { - dev_err(&pdev->dev, "Initialization failed\n"); - return err; - } - - pm_runtime_put_noidle(&pdev->dev); - pm_runtime_allow(&pdev->dev); - - return 0; -} - -static const struct dev_pm_ops tc_dwc_g210_pci_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(ufshcd_system_suspend, ufshcd_system_resume) - SET_RUNTIME_PM_OPS(ufshcd_runtime_suspend, ufshcd_runtime_resume, NULL) - .prepare = ufshcd_suspend_prepare, - .complete = ufshcd_resume_complete, -}; - -static const struct pci_device_id tc_dwc_g210_pci_tbl[] = { - { PCI_VENDOR_ID_SYNOPSYS, 0xB101, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_SYNOPSYS, 0xB102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { } /* terminate list */ -}; - -MODULE_DEVICE_TABLE(pci, tc_dwc_g210_pci_tbl); - -static struct pci_driver tc_dwc_g210_pci_driver = { - .name = "tc-dwc-g210-pci", - .id_table = tc_dwc_g210_pci_tbl, - .probe = tc_dwc_g210_pci_probe, - .remove = tc_dwc_g210_pci_remove, - .shutdown = tc_dwc_g210_pci_shutdown, - .driver = { - .pm = &tc_dwc_g210_pci_pm_ops - }, -}; - -module_pci_driver(tc_dwc_g210_pci_driver); - -MODULE_AUTHOR("Joao Pinto <Joao.Pinto@synopsys.com>"); -MODULE_DESCRIPTION("Synopsys Test Chip G210 PCI glue driver"); -MODULE_LICENSE("Dual BSD/GPL"); |