#ifndef __SOC_RASPBERRY_FIRMWARE_H__
#define __SOC_RASPBERRY_FIRMWARE_H__
#include <linux/types.h>
#include <linux/of_device.h>
struct rpi_firmware;
enum rpi_firmware_property_status { … };
struct rpi_firmware_property_tag_header { … };
enum rpi_firmware_property_tag { … };
enum rpi_firmware_clk_id { … };
struct rpi_firmware_clk_rate_request { … } __packed;
#define RPI_FIRMWARE_CLK_RATE_REQUEST(_id) …
#if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE)
int rpi_firmware_property(struct rpi_firmware *fw,
u32 tag, void *data, size_t len);
int rpi_firmware_property_list(struct rpi_firmware *fw,
void *data, size_t tag_size);
void rpi_firmware_put(struct rpi_firmware *fw);
unsigned int rpi_firmware_clk_get_max_rate(struct rpi_firmware *fw,
unsigned int id);
struct device_node *rpi_firmware_find_node(void);
struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node);
struct rpi_firmware *devm_rpi_firmware_get(struct device *dev,
struct device_node *firmware_node);
#else
static inline int rpi_firmware_property(struct rpi_firmware *fw, u32 tag,
void *data, size_t len)
{ … }
static inline int rpi_firmware_property_list(struct rpi_firmware *fw,
void *data, size_t tag_size)
{ … }
static inline void rpi_firmware_put(struct rpi_firmware *fw) { … }
static inline unsigned int rpi_firmware_clk_get_max_rate(struct rpi_firmware *fw,
unsigned int id)
{ … }
static inline struct device_node *rpi_firmware_find_node(void)
{ … }
static inline struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node)
{ … }
static inline struct rpi_firmware *devm_rpi_firmware_get(struct device *dev,
struct device_node *firmware_node)
{ … }
#endif
#endif