kcs_bmc.c (d7096970075ef47c9906fd241cc4939cc11ddd01) | kcs_bmc.c (faae6e391eda73a5b9870c78349064282a625bfa) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2015-2018, Intel Corporation. | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2015-2018, Intel Corporation. |
4 * Copyright (c) 2021, IBM Corp. |
|
4 */ 5 6#include <linux/module.h> 7 8#include "kcs_bmc.h" 9 | 5 */ 6 7#include <linux/module.h> 8 9#include "kcs_bmc.h" 10 |
11/* Implement both the device and client interfaces here */ 12#include "kcs_bmc_device.h" 13#include "kcs_bmc_client.h" 14 15/* Consumer data access */ 16 |
|
10u8 kcs_bmc_read_data(struct kcs_bmc *kcs_bmc) 11{ | 17u8 kcs_bmc_read_data(struct kcs_bmc *kcs_bmc) 18{ |
12 return kcs_bmc->io_inputb(kcs_bmc, kcs_bmc->ioreg.idr); | 19 return kcs_bmc->ops->io_inputb(kcs_bmc, kcs_bmc->ioreg.idr); |
13} 14EXPORT_SYMBOL(kcs_bmc_read_data); 15 16void kcs_bmc_write_data(struct kcs_bmc *kcs_bmc, u8 data) 17{ | 20} 21EXPORT_SYMBOL(kcs_bmc_read_data); 22 23void kcs_bmc_write_data(struct kcs_bmc *kcs_bmc, u8 data) 24{ |
18 kcs_bmc->io_outputb(kcs_bmc, kcs_bmc->ioreg.odr, data); | 25 kcs_bmc->ops->io_outputb(kcs_bmc, kcs_bmc->ioreg.odr, data); |
19} 20EXPORT_SYMBOL(kcs_bmc_write_data); 21 22u8 kcs_bmc_read_status(struct kcs_bmc *kcs_bmc) 23{ | 26} 27EXPORT_SYMBOL(kcs_bmc_write_data); 28 29u8 kcs_bmc_read_status(struct kcs_bmc *kcs_bmc) 30{ |
24 return kcs_bmc->io_inputb(kcs_bmc, kcs_bmc->ioreg.str); | 31 return kcs_bmc->ops->io_inputb(kcs_bmc, kcs_bmc->ioreg.str); |
25} 26EXPORT_SYMBOL(kcs_bmc_read_status); 27 28void kcs_bmc_write_status(struct kcs_bmc *kcs_bmc, u8 data) 29{ | 32} 33EXPORT_SYMBOL(kcs_bmc_read_status); 34 35void kcs_bmc_write_status(struct kcs_bmc *kcs_bmc, u8 data) 36{ |
30 kcs_bmc->io_outputb(kcs_bmc, kcs_bmc->ioreg.str, data); | 37 kcs_bmc->ops->io_outputb(kcs_bmc, kcs_bmc->ioreg.str, data); |
31} 32EXPORT_SYMBOL(kcs_bmc_write_status); 33 34void kcs_bmc_update_status(struct kcs_bmc *kcs_bmc, u8 mask, u8 val) 35{ | 38} 39EXPORT_SYMBOL(kcs_bmc_write_status); 40 41void kcs_bmc_update_status(struct kcs_bmc *kcs_bmc, u8 mask, u8 val) 42{ |
36 kcs_bmc->io_updateb(kcs_bmc, kcs_bmc->ioreg.str, mask, val); | 43 kcs_bmc->ops->io_updateb(kcs_bmc, kcs_bmc->ioreg.str, mask, val); |
37} 38EXPORT_SYMBOL(kcs_bmc_update_status); 39 | 44} 45EXPORT_SYMBOL(kcs_bmc_update_status); 46 |
40int kcs_bmc_ipmi_event(struct kcs_bmc *kcs_bmc); 41int kcs_bmc_handle_event(struct kcs_bmc *kcs_bmc) | 47irqreturn_t kcs_bmc_handle_event(struct kcs_bmc *kcs_bmc) |
42{ | 48{ |
43 return kcs_bmc_ipmi_event(kcs_bmc); | 49 return kcs_bmc->client.ops->event(&kcs_bmc->client); |
44} 45EXPORT_SYMBOL(kcs_bmc_handle_event); 46 47int kcs_bmc_ipmi_add_device(struct kcs_bmc *kcs_bmc); 48int kcs_bmc_add_device(struct kcs_bmc *kcs_bmc) 49{ 50 return kcs_bmc_ipmi_add_device(kcs_bmc); 51} --- 5 unchanged lines hidden (view full) --- 57 if (kcs_bmc_ipmi_remove_device(kcs_bmc)) 58 pr_warn("Failed to remove device for KCS channel %d\n", 59 kcs_bmc->channel); 60} 61EXPORT_SYMBOL(kcs_bmc_remove_device); 62 63MODULE_LICENSE("GPL v2"); 64MODULE_AUTHOR("Haiyue Wang <haiyue.wang@linux.intel.com>"); | 50} 51EXPORT_SYMBOL(kcs_bmc_handle_event); 52 53int kcs_bmc_ipmi_add_device(struct kcs_bmc *kcs_bmc); 54int kcs_bmc_add_device(struct kcs_bmc *kcs_bmc) 55{ 56 return kcs_bmc_ipmi_add_device(kcs_bmc); 57} --- 5 unchanged lines hidden (view full) --- 63 if (kcs_bmc_ipmi_remove_device(kcs_bmc)) 64 pr_warn("Failed to remove device for KCS channel %d\n", 65 kcs_bmc->channel); 66} 67EXPORT_SYMBOL(kcs_bmc_remove_device); 68 69MODULE_LICENSE("GPL v2"); 70MODULE_AUTHOR("Haiyue Wang <haiyue.wang@linux.intel.com>"); |
71MODULE_AUTHOR("Andrew Jeffery <andrew@aj.id.au>"); |
|
65MODULE_DESCRIPTION("KCS BMC to handle the IPMI request from system software"); | 72MODULE_DESCRIPTION("KCS BMC to handle the IPMI request from system software"); |