#include <linux/array_size.h>
#include <linux/bits.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/hex.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/sysfs.h>
#include <linux/types.h>
#include <linux/turris-omnia-mcu-interface.h>
#include "turris-omnia-mcu.h"
#define OMNIA_FW_VERSION_LEN …
#define OMNIA_FW_VERSION_HEX_LEN …
#define OMNIA_BOARD_INFO_LEN …
int omnia_cmd_write_read(const struct i2c_client *client,
void *cmd, unsigned int cmd_len,
void *reply, unsigned int reply_len)
{ … }
static int omnia_get_version_hash(struct omnia_mcu *mcu, bool bootloader,
char version[static OMNIA_FW_VERSION_HEX_LEN])
{ … }
static ssize_t fw_version_hash_show(struct device *dev, char *buf,
bool bootloader)
{ … }
static ssize_t fw_version_hash_application_show(struct device *dev,
struct device_attribute *a,
char *buf)
{ … }
static DEVICE_ATTR_RO(fw_version_hash_application);
static ssize_t fw_version_hash_bootloader_show(struct device *dev,
struct device_attribute *a,
char *buf)
{ … }
static DEVICE_ATTR_RO(fw_version_hash_bootloader);
static ssize_t fw_features_show(struct device *dev, struct device_attribute *a,
char *buf)
{ … }
static DEVICE_ATTR_RO(fw_features);
static ssize_t mcu_type_show(struct device *dev, struct device_attribute *a,
char *buf)
{ … }
static DEVICE_ATTR_RO(mcu_type);
static ssize_t reset_selector_show(struct device *dev,
struct device_attribute *a, char *buf)
{ … }
static DEVICE_ATTR_RO(reset_selector);
static ssize_t serial_number_show(struct device *dev,
struct device_attribute *a, char *buf)
{ … }
static DEVICE_ATTR_RO(serial_number);
static ssize_t first_mac_address_show(struct device *dev,
struct device_attribute *a, char *buf)
{ … }
static DEVICE_ATTR_RO(first_mac_address);
static ssize_t board_revision_show(struct device *dev,
struct device_attribute *a, char *buf)
{ … }
static DEVICE_ATTR_RO(board_revision);
static struct attribute *omnia_mcu_base_attrs[] = …;
static umode_t omnia_mcu_base_attrs_visible(struct kobject *kobj,
struct attribute *a, int n)
{ … }
static const struct attribute_group omnia_mcu_base_group = …;
static const struct attribute_group *omnia_mcu_groups[] = …;
static void omnia_mcu_print_version_hash(struct omnia_mcu *mcu, bool bootloader)
{ … }
static const char *omnia_status_to_mcu_type(u16 status)
{ … }
static void omnia_info_missing_feature(struct device *dev, const char *feature)
{ … }
static int omnia_mcu_read_features(struct omnia_mcu *mcu)
{ … }
static int omnia_mcu_read_board_info(struct omnia_mcu *mcu)
{ … }
static int omnia_mcu_probe(struct i2c_client *client)
{ … }
static const struct of_device_id of_omnia_mcu_match[] = …;
static struct i2c_driver omnia_mcu_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;