Path: blob/main/sys/compat/linuxkpi/common/include/linux/acpi_amd_wbrf.h
39604 views
/*-1* Copyright (c) 2025 The FreeBSD Foundation2* Copyright (c) 2025 Jean-Sébastien Pédron3*4* This software was developed by Jean-Sébastien Pédron under sponsorship5* from the FreeBSD Foundation.6*7* Redistribution and use in source and binary forms, with or without8* modification, are permitted provided that the following conditions9* are met:10* 1. Redistributions of source code must retain the above copyright11* notice, this list of conditions and the following disclaimer.12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND17* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE18* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE19* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE20* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL21* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS22* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)23* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT24* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY25* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF26* SUCH DAMAGE.27*/2829#ifndef _LINUXKPI_LINUX_ACPI_AMD_WBRF_H_30#define _LINUXKPI_LINUX_ACPI_AMD_WBRF_H_3132#include <linux/device.h>33#include <linux/notifier.h>3435#define MAX_NUM_OF_WBRF_RANGES 113637#define WBRF_RECORD_ADD 0x038#define WBRF_RECORD_REMOVE 0x13940struct freq_band_range {41uint64_t start;42uint64_t end;43};4445struct wbrf_ranges_in_out {46uint64_t num_of_ranges;47struct freq_band_range band_list[MAX_NUM_OF_WBRF_RANGES];48};4950enum wbrf_notifier_actions {51WBRF_CHANGED,52};5354/*55* The following functions currently have dummy implementations that, on Linux,56* are used when CONFIG_AMD_WBRF is not set at compile time.57*/5859static inline bool60acpi_amd_wbrf_supported_consumer(struct device *dev)61{62return (false);63}6465static inline int66acpi_amd_wbrf_add_remove(struct device *dev, uint8_t action,67struct wbrf_ranges_in_out *in)68{69return (-ENODEV);70}7172static inline bool73acpi_amd_wbrf_supported_producer(struct device *dev)74{75return (false);76}7778static inline int79amd_wbrf_retrieve_freq_band(struct device *dev, struct wbrf_ranges_in_out *out)80{81return (-ENODEV);82}8384static inline int85amd_wbrf_register_notifier(struct notifier_block *nb)86{87return (-ENODEV);88}8990static inline int91amd_wbrf_unregister_notifier(struct notifier_block *nb)92{93return (-ENODEV);94}9596#endif /* _LINUXKPI_LINUX_ACPI_AMD_WBRF_H_ */979899