static int pmc_core_dev_state_get(void *data, u64 *val) { struct pmc_dev *pmcdev = data; u32 value; value = pmc_core_reg_read(pmcdev, SPT_PMC_SLP_S0_RES_COUNTER_OFFSET); *val = pmc_core_adjust_slp_s0_step(value); return 0; }
static int pmc_core_dev_state_get(void *data, u64 *val) { struct pmc_dev *pmcdev = data; const struct pmc_reg_map *map = pmcdev->map; u32 value; value = pmc_core_reg_read(pmcdev, map->slp_s0_offset); *val = pmc_core_adjust_slp_s0_step(value); return 0; }
/** * intel_pmc_slp_s0_counter_read() - Read SLP_S0 residency. * @data: Out param that contains current SLP_S0 count. * * This API currently supports Intel Skylake SoC and Sunrise * Point Platform Controller Hub. Future platform support * should be added for platforms that support low power modes * beyond Package C10 state. * * SLP_S0_RESIDENCY counter counts in 100 us granularity per * step hence function populates the multiplied value in out * parameter @data. * * Return: an error code or 0 on success. */ int intel_pmc_slp_s0_counter_read(u32 *data) { struct pmc_dev *pmcdev = &pmc; u32 value; if (!pmcdev->has_slp_s0_res) return -EACCES; value = pmc_core_reg_read(pmcdev, SPT_PMC_SLP_S0_RES_COUNTER_OFFSET); *data = pmc_core_adjust_slp_s0_step(value); return 0; }
/** * intel_pmc_slp_s0_counter_read() - Read SLP_S0 residency. * @data: Out param that contains current SLP_S0 count. * * This API currently supports Intel Skylake SoC and Sunrise * Point Platform Controller Hub. Future platform support * should be added for platforms that support low power modes * beyond Package C10 state. * * SLP_S0_RESIDENCY counter counts in 100 us granularity per * step hence function populates the multiplied value in out * parameter @data. * * Return: an error code or 0 on success. */ int intel_pmc_slp_s0_counter_read(u32 *data) { struct pmc_dev *pmcdev = &pmc; const struct pmc_reg_map *map = pmcdev->map; u32 value; if (!pmcdev->has_slp_s0_res) return -EACCES; value = pmc_core_reg_read(pmcdev, map->slp_s0_offset); *data = pmc_core_adjust_slp_s0_step(value); return 0; }