1 From 6a08616a30213fd40a17c38c63de4b9c9503a537 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 19 Jan 2022 17:22:57 +0000
4 Subject: [PATCH] mfd: simple-mfd-i2c: Add configuration for RPi POE
7 The Raspbery Pi PoE+ HAT exposes a fan controller and power
8 supply status reporting via a single I2C address.
10 Create an MFD device that allows loading of the relevant
11 sub-drivers, with a shared I2C regmap.
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 drivers/mfd/Kconfig | 10 ++++++++++
16 drivers/mfd/simple-mfd-i2c.c | 10 ++++++++++
17 2 files changed, 20 insertions(+)
19 --- a/drivers/mfd/Kconfig
20 +++ b/drivers/mfd/Kconfig
21 @@ -1094,6 +1094,16 @@ config MFD_SPMI_PMIC
22 Say M here if you want to include support for the SPMI PMIC
23 series as a module. The module will be called "qcom-spmi-pmic".
25 +config MFD_RASPBERRYPI_POE_HAT
26 + tristate "Raspberry Pi PoE HAT MFD"
28 + select MFD_SIMPLE_MFD_I2C
30 + This module supports the PWM fan controller found on the Raspberry Pi
31 + POE and POE+ HAT boards, and the power supply driver on the POE+ HAT.
32 + (Functionally it relies on MFD_SIMPLE_MFD_I2C to provide the framework
33 + that loads the child drivers).
36 tristate "RDC R-321x southbridge"
38 --- a/drivers/mfd/simple-mfd-i2c.c
39 +++ b/drivers/mfd/simple-mfd-i2c.c
40 @@ -29,6 +29,15 @@ static const struct regmap_config regmap
44 +static const struct regmap_config regmap_config_16r_8v = {
49 +static const struct simple_mfd_data rpi_poe_core = {
50 + .regmap_config = ®map_config_16r_8v,
53 static int simple_mfd_i2c_probe(struct i2c_client *i2c)
55 const struct simple_mfd_data *simple_mfd_data;
56 @@ -64,6 +73,7 @@ static int simple_mfd_i2c_probe(struct i
58 static const struct of_device_id simple_mfd_i2c_of_match[] = {
59 { .compatible = "kontron,sl28cpld" },
60 + { .compatible = "raspberrypi,poe-core", &rpi_poe_core },
63 MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match);