+static int diag_model_show(struct seq_file *m, void *v)
+{
+ return seq_printf(m, "%s\n", platform.name);
+}
+
+static int diag_model_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, diag_model_show, PDE_DATA(inode));
+}
+
+static const struct file_operations diag_model_fops = {
+ .open = diag_model_open,
+ .read = seq_read,
+ .llseek = seq_lseek
+};
+
+static int diag_gpiomask_show(struct seq_file *m, void *v)
+{
+ return seq_printf(m, "0x%04x\n", gpiomask);
+}
+
+static int diag_gpiomask_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, diag_gpiomask_show, PDE_DATA(inode));
+}
+
+static ssize_t diag_gpiomask_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+{
+ int err = kstrtouint_from_user(buf, count, 0, &gpiomask);
+ if (err)
+ return err;
+
+ if (platform.buttons) {
+ unregister_buttons(platform.buttons);
+ register_buttons(platform.buttons);
+ }
+
+ if (platform.leds) {
+ unregister_leds(platform.leds);
+ register_leds(platform.leds);
+ }
+
+ return count;
+}
+
+static const struct file_operations diag_gpiomask_fops = {
+ .open = diag_gpiomask_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .write = diag_gpiomask_write
+};
+