Lines Matching refs:pmf_dev
184 struct amd_pmf_dev *pmf_dev = data; in apmf_event_handler() local
188 mutex_lock(&pmf_dev->update_mutex); in apmf_event_handler()
189 ret = apmf_get_sbios_requests(pmf_dev, &req); in apmf_event_handler()
191 dev_err(pmf_dev->dev, "Failed to get SBIOS requests:%d\n", ret); in apmf_event_handler()
196 dev_dbg(pmf_dev->dev, "AMT is supported and notifications %s\n", in apmf_event_handler()
198 pmf_dev->amt_enabled = !!req.amt_event; in apmf_event_handler()
200 if (pmf_dev->amt_enabled) in apmf_event_handler()
201 amd_pmf_handle_amt(pmf_dev); in apmf_event_handler()
203 amd_pmf_reset_amt(pmf_dev); in apmf_event_handler()
207 dev_dbg(pmf_dev->dev, "CQL is supported and notifications %s\n", in apmf_event_handler()
211 if (pmf_dev->amt_enabled) in apmf_event_handler()
212 amd_pmf_update_2_cql(pmf_dev, req.cql_event); in apmf_event_handler()
215 mutex_unlock(&pmf_dev->update_mutex); in apmf_event_handler()
267 int apmf_install_handler(struct amd_pmf_dev *pmf_dev) in apmf_install_handler() argument
269 acpi_handle ahandle = ACPI_HANDLE(pmf_dev->dev); in apmf_install_handler()
273 if (is_apmf_func_supported(pmf_dev, APMF_FUNC_AUTO_MODE) && in apmf_install_handler()
274 is_apmf_func_supported(pmf_dev, APMF_FUNC_SBIOS_REQUESTS)) { in apmf_install_handler()
276 apmf_event_handler, pmf_dev); in apmf_install_handler()
278 dev_err(pmf_dev->dev, "failed to install notify handler\n"); in apmf_install_handler()
283 apmf_event_handler(ahandle, 0, pmf_dev); in apmf_install_handler()
289 void apmf_acpi_deinit(struct amd_pmf_dev *pmf_dev) in apmf_acpi_deinit() argument
291 acpi_handle ahandle = ACPI_HANDLE(pmf_dev->dev); in apmf_acpi_deinit()
293 if (pmf_dev->hb_interval) in apmf_acpi_deinit()
294 cancel_delayed_work_sync(&pmf_dev->heart_beat); in apmf_acpi_deinit()
296 if (is_apmf_func_supported(pmf_dev, APMF_FUNC_AUTO_MODE) && in apmf_acpi_deinit()
297 is_apmf_func_supported(pmf_dev, APMF_FUNC_SBIOS_REQUESTS)) in apmf_acpi_deinit()
301 int apmf_acpi_init(struct amd_pmf_dev *pmf_dev) in apmf_acpi_init() argument
305 ret = apmf_if_verify_interface(pmf_dev); in apmf_acpi_init()
307 dev_err(pmf_dev->dev, "APMF verify interface failed :%d\n", ret); in apmf_acpi_init()
311 ret = apmf_get_system_params(pmf_dev); in apmf_acpi_init()
313 dev_dbg(pmf_dev->dev, "APMF apmf_get_system_params failed :%d\n", ret); in apmf_acpi_init()
317 if (pmf_dev->hb_interval) { in apmf_acpi_init()
319 INIT_DELAYED_WORK(&pmf_dev->heart_beat, apmf_sbios_heartbeat_notify); in apmf_acpi_init()
320 schedule_delayed_work(&pmf_dev->heart_beat, 0); in apmf_acpi_init()