alistair23-linux/drivers/staging/fieldbus/anybuss/anybuss-controller.h
Sven Van Asbroeck 308ee87a2f 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>
2019-04-17 12:07:31 +02:00

48 lines
1.4 KiB
C

/* 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__ */