Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fpga: dfl: add dfl bus support to MODULE_DEVICE_TABLE()

Device Feature List (DFL) is a linked list of feature headers within the
device MMIO space. It is used by FPGA to enumerate multiple sub features
within it. Each feature can be uniquely identified by DFL type and
feature id, which can be read out from feature headers.

A dfl bus helps DFL framework modularize DFL device drivers for
different sub features. The dfl bus matches its devices and drivers by
DFL type and feature id.

This patch adds dfl bus support to MODULE_DEVICE_TABLE() by adding info
about struct dfl_device_id in devicetable-offsets.c and add a dfl entry
point in file2alias.c.

Acked-by: Wu Hao <hao.wu@intel.com>
Signed-off-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Wu Hao <hao.wu@intel.com>
Signed-off-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
Link: https://lore.kernel.org/r/20210107043714.991646-6-mdf@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Xu Yilun and committed by
Greg Kroah-Hartman
4a224ace 9326eecd

+17
+4
scripts/mod/devicetable-offsets.c
··· 246 246 DEVID(auxiliary_device_id); 247 247 DEVID_FIELD(auxiliary_device_id, name); 248 248 249 + DEVID(dfl_device_id); 250 + DEVID_FIELD(dfl_device_id, type); 251 + DEVID_FIELD(dfl_device_id, feature_id); 252 + 249 253 return 0; 250 254 }
+13
scripts/mod/file2alias.c
··· 1375 1375 return 1; 1376 1376 } 1377 1377 1378 + /* Looks like: dfl:tNfN */ 1379 + static int do_dfl_entry(const char *filename, void *symval, char *alias) 1380 + { 1381 + DEF_FIELD(symval, dfl_device_id, type); 1382 + DEF_FIELD(symval, dfl_device_id, feature_id); 1383 + 1384 + sprintf(alias, "dfl:t%04Xf%04X", type, feature_id); 1385 + 1386 + add_wildcard(alias); 1387 + return 1; 1388 + } 1389 + 1378 1390 /* Does namelen bytes of name exactly match the symbol? */ 1379 1391 static bool sym_is(const char *name, unsigned namelen, const char *symbol) 1380 1392 { ··· 1462 1450 {"wmi", SIZE_wmi_device_id, do_wmi_entry}, 1463 1451 {"mhi", SIZE_mhi_device_id, do_mhi_entry}, 1464 1452 {"auxiliary", SIZE_auxiliary_device_id, do_auxiliary_entry}, 1453 + {"dfl", SIZE_dfl_device_id, do_dfl_entry}, 1465 1454 }; 1466 1455 1467 1456 /* Create MODULE_ALIAS() statements.