1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2021, IBM Corp. */
4 #ifndef __KCS_BMC_CONSUMER_H__
5 #define __KCS_BMC_CONSUMER_H__
7 #include <linux/irqreturn.h>
11 struct kcs_bmc_driver_ops
{
12 int (*add_device
)(struct kcs_bmc_device
*kcs_bmc
);
13 int (*remove_device
)(struct kcs_bmc_device
*kcs_bmc
);
16 struct kcs_bmc_driver
{
17 struct list_head entry
;
19 const struct kcs_bmc_driver_ops
*ops
;
22 struct kcs_bmc_client_ops
{
23 irqreturn_t (*event
)(struct kcs_bmc_client
*client
);
26 struct kcs_bmc_client
{
27 const struct kcs_bmc_client_ops
*ops
;
29 struct kcs_bmc_device
*dev
;
32 void kcs_bmc_register_driver(struct kcs_bmc_driver
*drv
);
33 void kcs_bmc_unregister_driver(struct kcs_bmc_driver
*drv
);
35 int kcs_bmc_enable_device(struct kcs_bmc_device
*kcs_bmc
, struct kcs_bmc_client
*client
);
36 void kcs_bmc_disable_device(struct kcs_bmc_device
*kcs_bmc
, struct kcs_bmc_client
*client
);
38 void kcs_bmc_update_event_mask(struct kcs_bmc_device
*kcs_bmc
, u8 mask
, u8 events
);
40 u8
kcs_bmc_read_data(struct kcs_bmc_device
*kcs_bmc
);
41 void kcs_bmc_write_data(struct kcs_bmc_device
*kcs_bmc
, u8 data
);
42 u8
kcs_bmc_read_status(struct kcs_bmc_device
*kcs_bmc
);
43 void kcs_bmc_write_status(struct kcs_bmc_device
*kcs_bmc
, u8 data
);
44 void kcs_bmc_update_status(struct kcs_bmc_device
*kcs_bmc
, u8 mask
, u8 val
);