diff options
author | Sven Van Asbroeck <thesven73@gmail.com> | 2019-04-16 18:56:13 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-17 13:07:31 +0300 |
commit | 308ee87a2f1ea7e83c5da49e4359cb133a93217f (patch) | |
tree | 3f4b4c16d7ea49a71d969799e07d9b0ebd6dd8e4 /drivers/staging/fieldbus/anybuss/anybuss-controller.h | |
parent | f9a82c4820ac30c80df9ea61577ad5f835968533 (diff) | |
download | linux-308ee87a2f1ea7e83c5da49e4359cb133a93217f.tar.xz |
staging: fieldbus: anybus-s: support HMS Anybus-S bus
The Anybus-S/Anybus-M is a series of interchangeable fieldbus communication
modules featuring on board memory and processing power. All software and
hardware functionality required to communicate on the fieldbus is
incorporated in the module itself, allowing the application to focus on
other tasks.
Typical applications are frequency inverters, HMI and visualization
devices, instruments, scales, robotics, PLC’s and intelligent measuring
devices.
Official documentation:
https://www.anybus.com/docs/librariesprovider7/default-document-library/
manuals-design-guides/hms-hmsi-27-275.pdf
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fieldbus/anybuss/anybuss-controller.h')
-rw-r--r-- | drivers/staging/fieldbus/anybuss/anybuss-controller.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/staging/fieldbus/anybuss/anybuss-controller.h b/drivers/staging/fieldbus/anybuss/anybuss-controller.h new file mode 100644 index 000000000000..02fa0749043b --- /dev/null +++ b/drivers/staging/fieldbus/anybuss/anybuss-controller.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Anybus-S controller definitions + * + * Copyright 2018 Arcx Inc + */ + +#ifndef __LINUX_ANYBUSS_CONTROLLER_H__ +#define __LINUX_ANYBUSS_CONTROLLER_H__ + +#include <linux/device.h> +#include <linux/regmap.h> + +/* + * To instantiate an Anybus-S host, a controller should provide the following: + * - a reset function which resets the attached card; + * - a regmap which provides access to the attached card's dpram; + * - the irq of the attached card + */ +/** + * struct anybuss_ops - Controller resources to instantiate an Anybus-S host + * + * @reset: asserts/deasserts the anybus card's reset line. + * @regmap: provides access to the card's dual-port RAM area. + * @irq: number of the interrupt connected to the card's interrupt line. + * @host_idx: for multi-host controllers, the host index: + * 0 for the first host on the controller, 1 for the second, etc. + */ +struct anybuss_ops { + void (*reset)(struct device *dev, bool assert); + struct regmap *regmap; + int irq; + int host_idx; +}; + +struct anybuss_host; + +struct anybuss_host * __must_check +anybuss_host_common_probe(struct device *dev, + const struct anybuss_ops *ops); +void anybuss_host_common_remove(struct anybuss_host *host); + +struct anybuss_host * __must_check +devm_anybuss_host_common_probe(struct device *dev, + const struct anybuss_ops *ops); + +#endif /* __LINUX_ANYBUSS_CONTROLLER_H__ */ |