diff options
author | Corey Minyard <cminyard@mvista.com> | 2019-02-21 14:21:17 -0600 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2019-02-22 07:12:41 -0600 |
commit | 3cd83bac481dc4fde8bedf09c8aecb3652e7e547 (patch) | |
tree | c9fe554281414cf03aa8ce0d6cfee870dbd4578c /drivers/char/ipmi/ipmi_plat_data.h | |
parent | f6296bdc49c4d3794b5a3ef0012fc0889e2f3f94 (diff) | |
download | linux-stable-3cd83bac481dc4fde8bedf09c8aecb3652e7e547.tar.gz linux-stable-3cd83bac481dc4fde8bedf09c8aecb3652e7e547.tar.bz2 linux-stable-3cd83bac481dc4fde8bedf09c8aecb3652e7e547.zip |
ipmi: Consolidate the adding of platform devices
It was being done in two different places now that hard-coded devices
use platform devices, and it's about to be three with hotmod switching
to platform devices. So put the code in one place.
This required some rework on some interfaces to make the type space
clean.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi/ipmi_plat_data.h')
-rw-r--r-- | drivers/char/ipmi/ipmi_plat_data.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/char/ipmi/ipmi_plat_data.h b/drivers/char/ipmi/ipmi_plat_data.h new file mode 100644 index 000000000000..567cfcec8ada --- /dev/null +++ b/drivers/char/ipmi/ipmi_plat_data.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +/* + * Generic code to add IPMI platform devices. + */ + +#include <linux/ipmi.h> + +struct ipmi_plat_data { + unsigned int type; /* si_type for si, SI_INVALID for others */ + unsigned int space; /* addr_space for si, intf# for ssif. */ + unsigned long addr; + unsigned int regspacing; + unsigned int regsize; + unsigned int regshift; + unsigned int irq; + unsigned int slave_addr; + enum ipmi_addr_src addr_source; +}; + +struct platform_device *ipmi_platform_add(const char *name, unsigned int inst, + struct ipmi_plat_data *p); |