1 From aa4a0729c4e6f94fde5281d6454342bbd4fc69e1 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 @@ -1152,6 +1152,16 @@ config MFD_SY7636A
22 To enable support for building sub-devices as modules,
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 @@ -75,6 +84,7 @@ static const struct simple_mfd_data sile
57 static const struct of_device_id simple_mfd_i2c_of_match[] = {
58 { .compatible = "kontron,sl28cpld" },
59 { .compatible = "silergy,sy7636a", .data = &silergy_sy7636a},
60 + { .compatible = "raspberrypi,poe-core", &rpi_poe_core },
63 MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match);