summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/superio.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: switch regmap.h include to linux/regmap.hAhmad Fatoum2023-10-261-1/+1
| | | | | | | | | | | | | | | Now that there are no longer any users of regmap.h in headers, let's switch all users in the source files to linux/regmap.h. That way, the only users of regmap.h whether directly or indirectly will be out-of-tree code, which will fail with an error if they are dependent on the old semantics of regmap_bulk_read and regmap_bulk_write. After a transitory period, we can then drop regmap.h. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231020071853.2826528-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-101-2/+2
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: migrate "GPL-2.0" license identifiers to SPDX 2.0Roland Hieber2021-11-221-1/+1
| | | | | | | | | | "GPL-2.0-only" was introduced in SPDX 2.0, and the old identifier "GPL-2.0" is now considered deprecated; see <https://spdx.org/licenses>. Fixes: 28f4a6a4df76f0f1581d (2021-10-30, "drivers: add missing SPDX-License-Identifier") Signed-off-by: Roland Hieber <rhi@pengutronix.de> Link: https://lore.barebox.org/20211117113851.2022669-2-rhi@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* vsprintf: retire strerrorp in favor of %peAhmad Fatoum2020-09-291-2/+1
| | | | | | | | | strerrorp() is only used along with printf. We now have a format specifier for printing error pointers directly, so use that and remove strerrorp. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mfd: superio: add missing semicolon after EXPORT_SYMBOLLucas Stach2019-12-021-2/+2
| | | | | | Fixes: efd517c35f12 (mfd: add basic Super I/O chip helpers) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mfd: superio: use strerrorp helper instead of open-codingAhmad Fatoum2019-10-281-1/+1
| | | | | | | Apparently, we have a helper for strerror(-PTR_ERR(regmap)). Use it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mfd: add basic Super I/O chip helpersAhmad Fatoum2019-10-141-0/+98
Super I/O chips are ICs common to x86 that are used for interfacing to low-bandwidth peripherals. They often contain serial ports, watchdog timers and hardware monitoring units. They are usually addressable via one of two I/O port pairs, either 0x2e-0x2f or 0x4e-0x4f, but they don't typically respond to reads from their range unless a device-specific 'password' has been poked in. After this is done, they are read and written in the same manner however. On Linux, these devices aren't subject to any device/driver model. Each driver for some function (e.g. watchdog or GPIO) duplicates the device probe in the module_init and board-specific configuration is handled via module parameters. Lets do it a bit fancier in barebox and add a helper to register chips and a regmap for the control and configuration registers as well as a helper to register child devices for each function contained within the Super I/O chip. Board-specific configuration, e.g. which pin to use as a watchdog reset, can then be realized using barebox device-specific parameters. The regmap will be more of a debugging aid, however. For ease of porting from Linux, it's expected that access to the I/O ports won't happen via the regmap. For this reason, the new <superio.h> header offers functions to read/write these chips' registers as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>