Browse Source

add Makefile, .gitignore and module skeleton

Helmut Pozimski 5 years ago
parent
commit
9bbc6fed77
3 changed files with 45 additions and 0 deletions
  1. 7 0
      .gitignore
  2. 14 0
      Makefile
  3. 24 0
      rtc-ds13307.c

+ 7 - 0
.gitignore

@@ -0,0 +1,7 @@
+Module.symvers
+*.cmd
+*.o
+*.ko
+*.mod.*
+modules.order
+.tmp_versions

+ 14 - 0
Makefile

@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Makefile for the rtc-ds13307 driver
+#
+
+ifneq ($(KERNELRELEASE),)
+	obj-m := rtc-ds13307.o
+else
+	KDIR := /lib/modules/$(shell uname -r)/build
+	PWD := $(shell pwd)
+
+default:
+	$(MAKE) -C $(KDIR) M=$(PWD) modules
+endif

+ 24 - 0
rtc-ds13307.c

@@ -0,0 +1,24 @@
+/*
+ * rtc-ds13307.c - RTC driver for the DS1307 and DS13307 I2C chips.
+ *
+ * Copyright (C) 2018 Helmut Pozimski
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+
+#define RTCDS13307 "rtc-ds13307" /* Module name */
+
+static int __init ds13307_init(void) {
+	return 0;
+}
+
+static void __exit ds13307_exit(void) {
+}
+
+module_init(ds13307_init);
+module_exit(ds13307_exit);
+MODULE_LICENSE("GPL");