2021-06-08 18:47:47 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/* Copyright (c) 2021, IBM Corp. */
|
|
|
|
|
|
|
|
#ifndef __KCS_BMC_CONSUMER_H__
|
|
|
|
#define __KCS_BMC_CONSUMER_H__
|
|
|
|
|
|
|
|
#include <linux/irqreturn.h>
|
|
|
|
|
2021-06-08 18:47:48 +08:00
|
|
|
#include "kcs_bmc.h"
|
|
|
|
|
2021-06-08 18:47:49 +08:00
|
|
|
struct kcs_bmc_driver_ops {
|
|
|
|
int (*add_device)(struct kcs_bmc_device *kcs_bmc);
|
|
|
|
int (*remove_device)(struct kcs_bmc_device *kcs_bmc);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct kcs_bmc_driver {
|
|
|
|
struct list_head entry;
|
|
|
|
|
|
|
|
const struct kcs_bmc_driver_ops *ops;
|
|
|
|
};
|
|
|
|
|
2021-06-08 18:47:48 +08:00
|
|
|
struct kcs_bmc_client_ops {
|
|
|
|
irqreturn_t (*event)(struct kcs_bmc_client *client);
|
|
|
|
};
|
2021-06-08 18:47:47 +08:00
|
|
|
|
|
|
|
struct kcs_bmc_client {
|
|
|
|
const struct kcs_bmc_client_ops *ops;
|
|
|
|
|
2021-06-08 18:47:48 +08:00
|
|
|
struct kcs_bmc_device *dev;
|
2021-06-08 18:47:47 +08:00
|
|
|
};
|
|
|
|
|
2021-06-08 18:47:49 +08:00
|
|
|
void kcs_bmc_register_driver(struct kcs_bmc_driver *drv);
|
|
|
|
void kcs_bmc_unregister_driver(struct kcs_bmc_driver *drv);
|
|
|
|
|
2021-06-08 18:47:48 +08:00
|
|
|
int kcs_bmc_enable_device(struct kcs_bmc_device *kcs_bmc, struct kcs_bmc_client *client);
|
|
|
|
void kcs_bmc_disable_device(struct kcs_bmc_device *kcs_bmc, struct kcs_bmc_client *client);
|
2021-06-08 18:47:47 +08:00
|
|
|
|
2021-06-08 18:47:50 +08:00
|
|
|
void kcs_bmc_update_event_mask(struct kcs_bmc_device *kcs_bmc, u8 mask, u8 events);
|
|
|
|
|
2021-06-08 18:47:48 +08:00
|
|
|
u8 kcs_bmc_read_data(struct kcs_bmc_device *kcs_bmc);
|
|
|
|
void kcs_bmc_write_data(struct kcs_bmc_device *kcs_bmc, u8 data);
|
|
|
|
u8 kcs_bmc_read_status(struct kcs_bmc_device *kcs_bmc);
|
|
|
|
void kcs_bmc_write_status(struct kcs_bmc_device *kcs_bmc, u8 data);
|
|
|
|
void kcs_bmc_update_status(struct kcs_bmc_device *kcs_bmc, u8 mask, u8 val);
|
2021-06-08 18:47:47 +08:00
|
|
|
#endif
|