Lines Matching full:pmc

3  * Driver for the Intel Broxton PMC
10 * The PMC (Power Management Controller) running on the ARC processor
13 * turn sends messages between the IA and the PMC.
52 * BIOS does not create an ACPI device for each PMC function, but
74 * intel_pmc_gcr_read64() - Read a 64-bit PMC GCR register
75 * @pmc: PMC device pointer
79 * Reads the 64-bit PMC GCR register at given offset.
83 int intel_pmc_gcr_read64(struct intel_pmc_dev *pmc, u32 offset, u64 *data) in intel_pmc_gcr_read64() argument
88 spin_lock(&pmc->gcr_lock); in intel_pmc_gcr_read64()
89 *data = readq(pmc->gcr_mem_base + offset); in intel_pmc_gcr_read64()
90 spin_unlock(&pmc->gcr_lock); in intel_pmc_gcr_read64()
97 * intel_pmc_gcr_update() - Update PMC GCR register bits
98 * @pmc: PMC device pointer
108 int intel_pmc_gcr_update(struct intel_pmc_dev *pmc, u32 offset, u32 mask, u32 val) in intel_pmc_gcr_update() argument
115 spin_lock(&pmc->gcr_lock); in intel_pmc_gcr_update()
116 new_val = readl(pmc->gcr_mem_base + offset); in intel_pmc_gcr_update()
119 writel(new_val, pmc->gcr_mem_base + offset); in intel_pmc_gcr_update()
121 new_val = readl(pmc->gcr_mem_base + offset); in intel_pmc_gcr_update()
122 spin_unlock(&pmc->gcr_lock); in intel_pmc_gcr_update()
131 * @pmc: PMC device pointer
139 int intel_pmc_s0ix_counter_read(struct intel_pmc_dev *pmc, u64 *data) in intel_pmc_s0ix_counter_read() argument
143 spin_lock(&pmc->gcr_lock); in intel_pmc_s0ix_counter_read()
144 deep = readq(pmc->gcr_mem_base + PMC_GCR_TELEM_DEEP_S0IX_REG); in intel_pmc_s0ix_counter_read()
145 shlw = readq(pmc->gcr_mem_base + PMC_GCR_TELEM_SHLW_S0IX_REG); in intel_pmc_s0ix_counter_read()
146 spin_unlock(&pmc->gcr_lock); in intel_pmc_s0ix_counter_read()
161 * values hold command and subcommand that is send to PMC.
169 struct intel_pmc_dev *pmc = dev_get_drvdata(dev); in simplecmd_store() local
170 struct intel_scu_ipc_dev *scu = pmc->scu; in simplecmd_store()
205 struct intel_pmc_dev *pmc = dev_get_drvdata(dev); in northpeak_store() local
206 struct intel_scu_ipc_dev *scu = pmc->scu; in northpeak_store()
304 struct intel_pmc_dev *pmc, in intel_pmc_get_resources() argument
331 pmc->gcr_mem_base = devm_ioremap_resource(&pdev->dev, &gcr_res); in intel_pmc_get_resources()
332 if (IS_ERR(pmc->gcr_mem_base)) in intel_pmc_get_resources()
333 return PTR_ERR(pmc->gcr_mem_base); in intel_pmc_get_resources()
388 pmc->telem_base = res; in intel_pmc_get_resources()
393 static int intel_pmc_create_devices(struct intel_pmc_dev *pmc) in intel_pmc_create_devices() argument
398 ret = devm_mfd_add_devices(pmc->dev, PLATFORM_DEVID_AUTO, &tco, in intel_pmc_create_devices()
404 ret = devm_mfd_add_devices(pmc->dev, PLATFORM_DEVID_AUTO, &punit, 1, in intel_pmc_create_devices()
409 if (pmc->telem_base) { in intel_pmc_create_devices()
410 ret = devm_mfd_add_devices(pmc->dev, PLATFORM_DEVID_AUTO, in intel_pmc_create_devices()
411 &telem, 1, pmc->telem_base, 0, NULL); in intel_pmc_create_devices()
426 struct intel_pmc_dev *pmc; in intel_pmc_probe() local
429 pmc = devm_kzalloc(&pdev->dev, sizeof(*pmc), GFP_KERNEL); in intel_pmc_probe()
430 if (!pmc) in intel_pmc_probe()
433 pmc->dev = &pdev->dev; in intel_pmc_probe()
434 spin_lock_init(&pmc->gcr_lock); in intel_pmc_probe()
436 ret = intel_pmc_get_resources(pdev, pmc, &scu_data); in intel_pmc_probe()
442 pmc->scu = devm_intel_scu_ipc_register(&pdev->dev, &scu_data); in intel_pmc_probe()
443 if (IS_ERR(pmc->scu)) in intel_pmc_probe()
444 return PTR_ERR(pmc->scu); in intel_pmc_probe()
446 platform_set_drvdata(pdev, pmc); in intel_pmc_probe()
448 ret = intel_pmc_create_devices(pmc); in intel_pmc_probe()
450 dev_err(&pdev->dev, "Failed to create PMC devices\n"); in intel_pmc_probe()
467 MODULE_DESCRIPTION("Intel Broxton PMC driver");