Skip to contentSkip to conversation

drivers/fsi: Initial stubs for FSI device driver.

PATCH Superseded [email protected] 2 participants 2 messages Jul 7, 2016 – Jul 8, 2016 FSI

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/fsi: Initial stubs for FSI device driver.

From: Christopher Bostic <[email protected]>

---

Changes to this patch based on reviewer feedback

V2:
- Removed enums in fsiinit.h and replaced with #defines
- Added proper file copyright and license headers
- Added certificate of origin
- Removed version string
- Replace kobject with struct device in struct fsidd
- Suggestions to implement standard bus_type will be implemented in later patches

V3:
- Removed white space
- Suggestions to add Kconfig will be added in follow on patches

V4:
- Removed blank line at end of fsiinit.c

---
 drivers/Makefile      |  1 +
 drivers/fsi/Makefile  |  5 +++++
 drivers/fsi/fsiinit.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/fsi/fsiinit.h | 41 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 101 insertions(+)
 create mode 100644 drivers/fsi/Makefile
 create mode 100644 drivers/fsi/fsiinit.c
 create mode 100644 drivers/fsi/fsiinit.h
drivers/Makefile +1 -0
index 795d0ca..63019ff 100644
@@ -172,3 +172,4 @@ obj-$(CONFIG_STM)		+= hwtracing/stm/
 obj-$(CONFIG_ANDROID)		+= android/
 obj-$(CONFIG_NVMEM)		+= nvmem/
 obj-$(CONFIG_FPGA)		+= fpga/
+obj-$(CONFIG_FSI)		+= fsi/
drivers/fsi/Makefile new file +5 -0
new file mode 100644
index 0000000..f547c08
@@ -0,0 +1,5 @@
+#
+# Makefile for the FSI bus specific drivers.
+#
+
+obj-y		+= fsiinit.o
drivers/fsi/fsiinit.c new file +54 -0

54 lines not on this page · raw message

drivers/fsi/fsiinit.h new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
1.8.2.2
#1 lore raw
Quoted 16 lines · On Fri, Jul 8, 2016 at 6:40 AM, <[email protected]> wrote:

From: Christopher Bostic <[email protected]>

---

Changes to this patch based on reviewer feedback

V2:
- Removed enums in fsiinit.h and replaced with #defines
- Added proper file copyright and license headers
- Added certificate of origin
- Removed version string
- Replace kobject with struct device in struct fsidd
- Suggestions to implement standard bus_type will be implemented in later patches

Quoted 6 lines

V3:
- Removed white space
- Suggestions to add Kconfig will be added in follow on patches

V4:
- Removed blank line at end of fsiinit.c

Nice, the patch now applies:

$ git am ~/Downloads/chris.patch
Applying: drivers/fsi: Initial stubs for FSI device driver.
$ echo $?
0

You indicate that this is patch version four, but you haven't put that in the subject. git format-patch can do this for you with the -v option:

-v <n>, --reroll-count=<n>
Mark the series as the <n>-th iteration of the topic. The output filenames have v<n> prepended to them, and the subject prefix ("PATCH" by default, but configurable via the --subject-prefix option) has v<n> appended to it. E.g. --reroll-count=4 may produce v4-0001-add-makefile.patch file that has "Subject: [PATCH v4 1/20] Add makefile" in it

I think you also need to set your username in your git configuration so we see the emails as coming from you.

$ git config --global user.name "Chris Bostic"

I don't think you need to send another revision for that though.

The next step should be to include this patch as the first in a series that adds the implementation of the bus.

Cheers,

Joel

Quoted 140 lines
---
 drivers/Makefile      |  1 +
 drivers/fsi/Makefile  |  5 +++++
 drivers/fsi/fsiinit.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/fsi/fsiinit.h | 41 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 101 insertions(+)
 create mode 100644 drivers/fsi/Makefile
 create mode 100644 drivers/fsi/fsiinit.c
 create mode 100644 drivers/fsi/fsiinit.h
drivers/Makefile +1 -0
index 795d0ca..63019ff 100644
@@ -172,3 +172,4 @@ obj-$(CONFIG_STM)           += hwtracing/stm/
 obj-$(CONFIG_ANDROID)          += android/
 obj-$(CONFIG_NVMEM)            += nvmem/
 obj-$(CONFIG_FPGA)             += fpga/
+obj-$(CONFIG_FSI)              += fsi/
drivers/fsi/Makefile new file +5 -0
new file mode 100644
index 0000000..f547c08
@@ -0,0 +1,5 @@
+#
+# Makefile for the FSI bus specific drivers.
+#
+
+obj-y          += fsiinit.o
drivers/fsi/fsiinit.c new file +54 -0
new file mode 100644
index 0000000..042e680
@@ -0,0 +1,54 @@
+/*
+ * FSI Master device driver
+ *
+ * Copyright 2016 IBM Corp.
+ *
+ * Christopher Bostic <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include "fsiinit.h"
+
+MODULE_AUTHOR("Christopher Bostic [email protected]");
+MODULE_DESCRIPTION("FSI master device driver");
+
+#define FSIDD_MAJOR    0               /* FSI device driver major */
+#define        FSIDD_TOSTR(x)  #x
+#define        FSIDD_VERNO     4000
+#define        FSIDD_VER(x)    FSIDD_TOSTR(x)
+
+struct fsidd fsidd = {         /* FSI device driver structure definition */
+       .magic = FSI_DD_MAGIC,
+       .strno = FSI_DD_STRNO,
+};
+
+static int fsi_start(void)
+{
+       int rc = 0;
+
+       printk("FSI DD v:%d installation ok\n", FSIDD_VERNO);
+       return rc;
+}
+
+static void fsi_exit(void)
+{
+
+}
+
+static int __init fsi_init(void)
+{
+       int rc = 0;
+
+       /* Set up the host controller */
+       fsi_start();
+       return rc;
+}
+
+module_init(fsi_init);
+module_exit(fsi_exit);
drivers/fsi/fsiinit.h new file +41 -1
new file mode 100644
index 0000000..70c3e13
@@ -0,0 +1,41 @@
+/*
+ * FSI Master device driver structure definitions and defines
+ *
+ * Copyright 2016 IBM Corp.
+ *
+ * Christopher Bostic <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef DRIVERS_FSIINIT_H
+#define DRIVERS_FSIINIT_H
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/device.h>
+#include <linux/workqueue.h>
+#include <linux/hrtimer.h>
+
+#define FSI_DD_MAGIC   0x64644632      /* ddF2 */
+#define FSI_DD_STRNO   0x1             /* Structure version number */
+
+struct fsidd {                         /* FSI Main structure */
+       unsigned long magic;            /* Magic number */
+       unsigned long strno;            /* Structure version number */
+       dev_t major;                    /* Major number of device */
+       struct workqueue_struct *hotp_wq;       /* Hot plug work queue */
+       wait_queue_head_t error_wq;     /* Wait queue for port errors */
+       wait_queue_head_t lbus_wq;      /* Wait queue for lbus events */
+       wait_queue_head_t irq_wq;       /* Wait queue for IRQ loops */
+       wait_queue_head_t link_wq;      /* Wait queue for link changes */
+       unsigned long state;            /* State driver is in */
+       struct device dev;              /* Anchor point in /sys/kernel */
+};
+
+#define        to_fsidd(a)             container_of(a, struct fsidd, kobj)
+
+#endif /* DRIVERS_FSIINIT_H */
--

1.8.2.2