staging: fsl-mc: add support for device table matching
authorStuart Yoder <stuart.yoder@nxp.com>
Wed, 22 Jun 2016 21:40:45 +0000 (16:40 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2016 00:14:03 +0000 (17:14 -0700)
Move the definition of fsl_mc_device_id to its proper location in
mod_devicetable.h, and add fsl-mc bus support to devicetable-offsets.c
and file2alias.c to enable device table matching.  With this patch udev
based module loading of fsl-mc drivers is supported.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-mc/include/mc.h
include/linux/mod_devicetable.h
scripts/mod/devicetable-offsets.c
scripts/mod/file2alias.c

index bc0d45cb9b653b17e667ded37431892c918b9922..a9a9d23f78d5fb775b730aa8057c031d88bc363d 100644 (file)
@@ -50,19 +50,6 @@ struct fsl_mc_driver {
 #define to_fsl_mc_driver(_drv) \
        container_of(_drv, struct fsl_mc_driver, driver)
 
-/**
- * struct fsl_mc_device_id - MC object device Id entry for driver matching
- * @vendor: vendor ID
- * @obj_type: MC object type
- *
- * Type of entries in the "device Id" table for MC object devices supported by
- * a MC object device driver. The last entry of the table has vendor set to 0x0
- */
-struct fsl_mc_device_id {
-       u16 vendor;
-       const char obj_type[16];
-};
-
 /**
  * enum fsl_mc_pool_type - Types of allocatable MC bus resources
  *
index 6e4c645e1c0d473821551e8ca4252b52c894578f..ed84c07f6a510f48e24d53e0d54afaeb50a182f3 100644 (file)
@@ -657,4 +657,20 @@ struct ulpi_device_id {
        kernel_ulong_t driver_data;
 };
 
+/**
+ * struct fsl_mc_device_id - MC object device identifier
+ * @vendor: vendor ID
+ * @obj_type: MC object type
+ * @ver_major: MC object version major number
+ * @ver_minor: MC object version minor number
+ *
+ * Type of entries in the "device Id" table for MC object devices supported by
+ * a MC object device driver. The last entry of the table has vendor set to 0x0
+ */
+struct fsl_mc_device_id {
+       __u16 vendor;
+       const char obj_type[16];
+};
+
+
 #endif /* LINUX_MOD_DEVICETABLE_H */
index 840b97328b399188edce45dc3a456917f2bf99d7..e4d90e50f6fece5db963af40a395d8ff4a4e8ecc 100644 (file)
@@ -202,5 +202,9 @@ int main(void)
        DEVID_FIELD(hda_device_id, rev_id);
        DEVID_FIELD(hda_device_id, api_version);
 
+       DEVID(fsl_mc_device_id);
+       DEVID_FIELD(fsl_mc_device_id, vendor);
+       DEVID_FIELD(fsl_mc_device_id, obj_type);
+
        return 0;
 }
index fec75786f75bbb348d03143af7d2280015394643..29d6699d5a06c1eddb52e9aa4175766297754e4c 100644 (file)
@@ -1289,6 +1289,18 @@ static int do_hda_entry(const char *filename, void *symval, char *alias)
 }
 ADD_TO_DEVTABLE("hdaudio", hda_device_id, do_hda_entry);
 
+/* Looks like: fsl-mc:vNdN */
+static int do_fsl_mc_entry(const char *filename, void *symval,
+                          char *alias)
+{
+       DEF_FIELD(symval, fsl_mc_device_id, vendor);
+       DEF_FIELD_ADDR(symval, fsl_mc_device_id, obj_type);
+
+       sprintf(alias, "fsl-mc:v%08Xd%s", vendor, *obj_type);
+       return 1;
+}
+ADD_TO_DEVTABLE("fslmc", fsl_mc_device_id, do_fsl_mc_entry);
+
 /* Does namelen bytes of name exactly match the symbol? */
 static bool sym_is(const char *name, unsigned namelen, const char *symbol)
 {
This page took 0.02839 seconds and 5 git commands to generate.