Skip to content

Commit 446f0cf

Browse files
henning-schildlag-linaro
authored andcommitted
platform/x86: simatic-ipc: drop custom P2SB bar code
The two drivers that used to use this have been switched over to the common P2SB accessor, so this code is not needed any longer. Signed-off-by: Henning Schild <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent 759273c commit 446f0cf

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

drivers/platform/x86/simatic-ipc.c

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -101,44 +101,6 @@ static int register_platform_devices(u32 station_id)
101101
return 0;
102102
}
103103

104-
/* FIXME: this should eventually be done with generic P2SB discovery code
105-
* the individual drivers for watchdogs and LEDs access memory that implements
106-
* GPIO, but pinctrl will not come up because of missing ACPI entries
107-
*
108-
* While there is no conflict a cleaner solution would be to somehow bring up
109-
* pinctrl even with these ACPI entries missing, and base the drivers on pinctrl.
110-
* After which the following function could be dropped, together with the code
111-
* poking the memory.
112-
*/
113-
/*
114-
* Get membase address from PCI, used in leds and wdt module. Here we read
115-
* the bar0. The final address calculation is done in the appropriate modules
116-
*/
117-
u32 simatic_ipc_get_membase0(unsigned int p2sb)
118-
{
119-
struct pci_bus *bus;
120-
u32 bar0 = 0;
121-
/*
122-
* The GPIO memory is in bar0 of the hidden P2SB device.
123-
* Unhide the device to have a quick look at it, before we hide it
124-
* again.
125-
* Also grab the pci rescan lock so that device does not get discovered
126-
* and remapped while it is visible.
127-
* This code is inspired by drivers/mfd/lpc_ich.c
128-
*/
129-
bus = pci_find_bus(0, 0);
130-
pci_lock_rescan_remove();
131-
pci_bus_write_config_byte(bus, p2sb, 0xE1, 0x0);
132-
pci_bus_read_config_dword(bus, p2sb, PCI_BASE_ADDRESS_0, &bar0);
133-
134-
bar0 &= ~0xf;
135-
pci_bus_write_config_byte(bus, p2sb, 0xE1, 0x1);
136-
pci_unlock_rescan_remove();
137-
138-
return bar0;
139-
}
140-
EXPORT_SYMBOL(simatic_ipc_get_membase0);
141-
142104
static int __init simatic_ipc_init_module(void)
143105
{
144106
const struct dmi_system_id *match;

include/linux/platform_data/x86/simatic-ipc-base.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,4 @@ struct simatic_ipc_platform {
2424
u8 devmode;
2525
};
2626

27-
u32 simatic_ipc_get_membase0(unsigned int p2sb);
28-
2927
#endif /* __PLATFORM_DATA_X86_SIMATIC_IPC_BASE_H */

0 commit comments

Comments
 (0)