linux/drivers/platform/cznic/turris-omnia-mcu-sys-off-wakeup.c

// SPDX-License-Identifier: GPL-2.0
/*
 * CZ.NIC's Turris Omnia MCU system off and RTC wakeup driver
 *
 * This is not a true RTC driver (in the sense that it does not provide a
 * real-time clock), rather the MCU implements a wakeup from powered off state
 * at a specified time relative to MCU boot, and we expose this feature via RTC
 * alarm, so that it can be used via the rtcwake command, which is the standard
 * Linux command for this.
 *
 * 2024 by Marek Behún <[email protected]>
 */

#include <linux/crc32.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/kstrtox.h>
#include <linux/reboot.h>
#include <linux/rtc.h>
#include <linux/sysfs.h>
#include <linux/types.h>

#include <linux/turris-omnia-mcu-interface.h>
#include "turris-omnia-mcu.h"

static int omnia_get_uptime_wakeup(const struct i2c_client *client, u32 *uptime,
				   u32 *wakeup)
{}

static int omnia_read_time(struct device *dev, struct rtc_time *tm)
{}

static int omnia_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{}

static int omnia_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{}

static int omnia_alarm_irq_enable(struct device *dev, unsigned int enabled)
{}

static const struct rtc_class_ops omnia_rtc_ops =;

static int omnia_power_off(struct sys_off_data *data)
{}

static int omnia_restart(struct sys_off_data *data)
{}

static ssize_t front_button_poweron_show(struct device *dev,
					 struct device_attribute *a, char *buf)
{}

static ssize_t front_button_poweron_store(struct device *dev,
					  struct device_attribute *a,
					  const char *buf, size_t count)
{}
static DEVICE_ATTR_RW(front_button_poweron);

static struct attribute *omnia_mcu_poweroff_attrs[] =;

static umode_t poweroff_attrs_visible(struct kobject *kobj, struct attribute *a,
				      int n)
{}

const struct attribute_group omnia_mcu_poweroff_group =;

int omnia_mcu_register_sys_off_and_wakeup(struct omnia_mcu *mcu)
{}