#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/device.h>
#include <linux/atomic.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/nmi.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/clk.h>
#include <linux/reset.h>
#include <linux/time64.h>
#include <linux/sysfs.h>
#define APB_EHB_ISR …
#define APB_EHB_ISR_PENDING …
#define APB_EHB_ISR_MASK …
#define APB_EHB_ADDR …
#define APB_EHB_TIMEOUT …
#define APB_EHB_TIMEOUT_MIN …
#define APB_EHB_TIMEOUT_MAX …
struct bt1_apb { … };
static const struct regmap_config bt1_apb_regmap_cfg = …;
static inline unsigned long bt1_apb_n_to_timeout_us(struct bt1_apb *apb, u32 n)
{ … }
static inline unsigned long bt1_apb_timeout_to_n_us(struct bt1_apb *apb,
unsigned long timeout)
{ … }
static irqreturn_t bt1_apb_isr(int irq, void *data)
{ … }
static void bt1_apb_clear_data(void *data)
{ … }
static struct bt1_apb *bt1_apb_create_data(struct platform_device *pdev)
{ … }
static int bt1_apb_request_regs(struct bt1_apb *apb)
{ … }
static int bt1_apb_request_rst(struct bt1_apb *apb)
{ … }
static void bt1_apb_disable_clk(void *data)
{ … }
static int bt1_apb_request_clk(struct bt1_apb *apb)
{ … }
static void bt1_apb_clear_irq(void *data)
{ … }
static int bt1_apb_request_irq(struct bt1_apb *apb)
{ … }
static ssize_t count_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(count);
static ssize_t timeout_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t timeout_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(timeout);
static ssize_t inject_error_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t inject_error_store(struct device *dev,
struct device_attribute *attr,
const char *data, size_t count)
{ … }
static DEVICE_ATTR_RW(inject_error);
static struct attribute *bt1_apb_sysfs_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void bt1_apb_remove_sysfs(void *data)
{ … }
static int bt1_apb_init_sysfs(struct bt1_apb *apb)
{ … }
static int bt1_apb_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id bt1_apb_of_match[] = …;
MODULE_DEVICE_TABLE(of, bt1_apb_of_match);
static struct platform_driver bt1_apb_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;