Lines Matching +full:resume +full:- +full:offset

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (C) 2011-2013 Samsung India Software Operations
50 return fn < 32 && fn >= 0 && (host->dsm_fns & (1u << fn)); in __intel_dsm_supported()
66 return -EOPNOTSUPP; in __intel_dsm()
68 if (obj->buffer.length < 1) { in __intel_dsm()
69 err = -EINVAL; in __intel_dsm()
73 len = min_t(size_t, obj->buffer.length, 4); in __intel_dsm()
76 memcpy(result, obj->buffer.pointer, len); in __intel_dsm()
87 return -EOPNOTSUPP; in intel_dsm()
96 err = __intel_dsm(intel_host, dev, INTEL_DSM_FNS, &intel_host->dsm_fns); in intel_dsm_init()
97 dev_dbg(dev, "DSM fns %#x, error %d\n", intel_host->dsm_fns, err); in intel_dsm_init()
104 if (status == POST_CHANGE && hba->caps & UFSHCD_CAP_CRYPTO) { in ufs_intel_hce_enable_notify()
146 struct ufs_pa_layer_attr pwr_info = hba->pwr_info; in ufs_intel_set_lanes()
153 dev_err(hba->dev, "%s: Setting %u lanes, err = %d\n", in ufs_intel_set_lanes()
168 (hba->pwr_info.lane_rx != 2 || hba->pwr_info.lane_tx != 2)) in ufs_intel_lkf_pwr_change_notify()
232 host->active_ltr = readl(hba->mmio_base + INTEL_ACTIVELTR); in intel_cache_ltr()
233 host->idle_ltr = readl(hba->mmio_base + INTEL_IDLELTR); in intel_cache_ltr()
249 ltr = readl(hba->mmio_base + INTEL_ACTIVELTR); in intel_ltr_set()
268 if (ltr == host->active_ltr) in intel_ltr_set()
271 writel(ltr, hba->mmio_base + INTEL_ACTIVELTR); in intel_ltr_set()
272 writel(ltr, hba->mmio_base + INTEL_IDLELTR); in intel_ltr_set()
282 dev->power.set_latency_tolerance = intel_ltr_set; in intel_ltr_expose()
289 dev->power.set_latency_tolerance = NULL; in intel_ltr_hide()
294 struct dentry *dir = debugfs_create_dir(dev_name(hba->dev), NULL); in intel_add_debugfs()
299 host->debugfs_root = dir; in intel_add_debugfs()
300 debugfs_create_x32("active_ltr", 0444, dir, &host->active_ltr); in intel_add_debugfs()
301 debugfs_create_x32("idle_ltr", 0444, dir, &host->idle_ltr); in intel_add_debugfs()
308 debugfs_remove_recursive(host->debugfs_root); in intel_remove_debugfs()
319 err = intel_dsm(host, hba->dev, INTEL_DSM_RESET, &result); in ufs_intel_device_reset()
321 err = -EIO; in ufs_intel_device_reset()
323 dev_err(hba->dev, "%s: DSM error %d result %u\n", in ufs_intel_device_reset()
328 if (!host->reset_gpio) in ufs_intel_device_reset()
329 return -EOPNOTSUPP; in ufs_intel_device_reset()
331 gpiod_set_value_cansleep(host->reset_gpio, 1); in ufs_intel_device_reset()
334 gpiod_set_value_cansleep(host->reset_gpio, 0); in ufs_intel_device_reset()
350 hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND; in ufs_intel_common_init()
352 host = devm_kzalloc(hba->dev, sizeof(*host), GFP_KERNEL); in ufs_intel_common_init()
354 return -ENOMEM; in ufs_intel_common_init()
356 intel_dsm_init(host, hba->dev); in ufs_intel_common_init()
358 if (hba->vops->device_reset) in ufs_intel_common_init()
359 hba->caps |= UFSHCD_CAP_DEEPSLEEP; in ufs_intel_common_init()
361 if (hba->vops->device_reset) in ufs_intel_common_init()
362 host->reset_gpio = ufs_intel_get_reset_gpio(hba->dev); in ufs_intel_common_init()
363 if (IS_ERR(host->reset_gpio)) { in ufs_intel_common_init()
364 dev_err(hba->dev, "%s: failed to get reset GPIO, error %ld\n", in ufs_intel_common_init()
365 __func__, PTR_ERR(host->reset_gpio)); in ufs_intel_common_init()
366 host->reset_gpio = NULL; in ufs_intel_common_init()
368 if (host->reset_gpio) { in ufs_intel_common_init()
369 gpiod_set_value_cansleep(host->reset_gpio, 0); in ufs_intel_common_init()
370 hba->caps |= UFSHCD_CAP_DEEPSLEEP; in ufs_intel_common_init()
373 intel_ltr_expose(hba->dev); in ufs_intel_common_init()
381 intel_ltr_hide(hba->dev); in ufs_intel_common_exit()
392 dev_err(hba->dev, "%s: hibern8 exit failed %d\n", in ufs_intel_resume()
407 hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8; in ufs_intel_ehl_init()
414 if (hba->caps & UFSHCD_CAP_DEEPSLEEP) { in ufs_intel_lkf_late_init()
415 hba->spm_lvl = UFS_PM_LVL_6; in ufs_intel_lkf_late_init()
416 hba->rpm_lvl = UFS_PM_LVL_6; in ufs_intel_lkf_late_init()
418 hba->spm_lvl = UFS_PM_LVL_5; in ufs_intel_lkf_late_init()
419 hba->rpm_lvl = UFS_PM_LVL_5; in ufs_intel_lkf_late_init()
428 hba->nop_out_timeout = 200; in ufs_intel_lkf_init()
429 hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8; in ufs_intel_lkf_init()
430 hba->caps |= UFSHCD_CAP_CRYPTO; in ufs_intel_lkf_init()
433 ufs_host->late_init = ufs_intel_lkf_late_init; in ufs_intel_lkf_init()
439 hba->nop_out_timeout = 200; in ufs_intel_adl_init()
440 hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8; in ufs_intel_adl_init()
441 hba->caps |= UFSHCD_CAP_WB_EN; in ufs_intel_adl_init()
447 hba->caps |= UFSHCD_CAP_CRYPTO | UFSHCD_CAP_WB_EN; in ufs_intel_mtl_init()
458 hba->mcq_base = hba->mmio_base + ufshcd_mcq_queue_cfg_addr(hba); in ufs_qemu_mcq_config_resource()
473 hba->mcq_opr[OPR_SQD].offset = sqdao; in ufs_qemu_op_runtime_config()
474 hba->mcq_opr[OPR_SQIS].offset = sqisao; in ufs_qemu_op_runtime_config()
475 hba->mcq_opr[OPR_CQD].offset = cqdao; in ufs_qemu_op_runtime_config()
476 hba->mcq_opr[OPR_CQIS].offset = cqisao; in ufs_qemu_op_runtime_config()
479 opr = &hba->mcq_opr[i]; in ufs_qemu_op_runtime_config()
480 opr->stride = 48; in ufs_qemu_op_runtime_config()
481 opr->base = hba->mmio_base + opr->offset; in ufs_qemu_op_runtime_config()
488 .name = "qemu-pci",
495 .name = "intel-pci",
499 .resume = ufs_intel_resume,
503 .name = "intel-pci",
507 .resume = ufs_intel_resume,
511 .name = "intel-pci",
518 .resume = ufs_intel_resume,
523 .name = "intel-pci",
527 .resume = ufs_intel_resume,
532 .name = "intel-pci",
537 .resume = ufs_intel_resume,
554 * ufshcd_pci_remove - de-allocate PCI/SCSI host and host memory space
562 pm_runtime_forbid(&pdev->dev); in ufshcd_pci_remove()
563 pm_runtime_get_noresume(&pdev->dev); in ufshcd_pci_remove()
569 * ufshcd_pci_probe - probe routine of the driver
573 * Return: 0 on success, non-zero value on failure.
585 dev_err(&pdev->dev, "pcim_enable_device failed\n"); in ufshcd_pci_probe()
593 dev_err(&pdev->dev, "request and iomap failed\n"); in ufshcd_pci_probe()
599 err = ufshcd_alloc_host(&pdev->dev, &hba); in ufshcd_pci_probe()
601 dev_err(&pdev->dev, "Allocation failed\n"); in ufshcd_pci_probe()
605 hba->vops = (struct ufs_hba_variant_ops *)id->driver_data; in ufshcd_pci_probe()
607 err = ufshcd_init(hba, mmio_base, pdev->irq); in ufshcd_pci_probe()
609 dev_err(&pdev->dev, "Initialization failed\n"); in ufshcd_pci_probe()
615 if (ufs_host && ufs_host->late_init) in ufshcd_pci_probe()
616 ufs_host->late_init(hba); in ufshcd_pci_probe()
618 pm_runtime_put_noidle(&pdev->dev); in ufshcd_pci_probe()
619 pm_runtime_allow(&pdev->dev); in ufshcd_pci_probe()
628 .resume = ufshcd_system_resume,