#include <linux/fs.h>
#include <linux/err.h>
#include <linux/switch.h>
+#include <linux/hrtimer.h>
struct class *switch_class;
static atomic_t device_count;
{
char name_buf[120];
char state_buf[120];
+ char timestamp_buf[120];
char *prop_buf;
- char *envp[3];
+ char *envp[4];
int env_offset = 0;
int length;
"SWITCH_STATE=%s", prop_buf);
envp[env_offset++] = state_buf;
}
+ snprintf(timestamp_buf, sizeof(timestamp_buf),
+ "SWITCH_TIME=%llu", ktime_to_ns(ktime_get()));
+ envp[env_offset++] = timestamp_buf;
envp[env_offset] = NULL;
kobject_uevent_env(&sdev->dev->kobj, KOBJ_CHANGE, envp);
free_page((unsigned long)prop_buf);