lede/target/linux/bcm27xx/patches-6.12/950-0262-mfd-simple-mfd-i2c-Add-configuration-for-RPi-POE-HAT.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

63 lines
2.0 KiB
Diff

From 65a525d752863c08855e3250178dcc889c8904a8 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Wed, 19 Jan 2022 17:22:57 +0000
Subject: [PATCH] mfd: simple-mfd-i2c: Add configuration for RPi POE HAT
The Raspbery Pi PoE+ HAT exposes a fan controller and power
supply status reporting via a single I2C address.
Create an MFD device that allows loading of the relevant
sub-drivers, with a shared I2C regmap.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/mfd/Kconfig | 10 ++++++++++
drivers/mfd/simple-mfd-i2c.c | 10 ++++++++++
2 files changed, 20 insertions(+)
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1186,6 +1186,16 @@ config MFD_SY7636A
To enable support for building sub-devices as modules,
choose M here.
+config MFD_RASPBERRYPI_POE_HAT
+ tristate "Raspberry Pi PoE HAT MFD"
+ depends on I2C
+ select MFD_SIMPLE_MFD_I2C
+ help
+ This module supports the PWM fan controller found on the Raspberry Pi
+ POE and POE+ HAT boards, and the power supply driver on the POE+ HAT.
+ (Functionally it relies on MFD_SIMPLE_MFD_I2C to provide the framework
+ that loads the child drivers).
+
config MFD_RDC321X
tristate "RDC R-321x southbridge"
select MFD_CORE
--- a/drivers/mfd/simple-mfd-i2c.c
+++ b/drivers/mfd/simple-mfd-i2c.c
@@ -29,6 +29,15 @@ static const struct regmap_config regmap
.val_bits = 8,
};
+static const struct regmap_config regmap_config_16r_8v = {
+ .reg_bits = 16,
+ .val_bits = 8,
+};
+
+static const struct simple_mfd_data rpi_poe_core = {
+ .regmap_config = &regmap_config_16r_8v,
+};
+
static int simple_mfd_i2c_probe(struct i2c_client *i2c)
{
const struct simple_mfd_data *simple_mfd_data;
@@ -88,6 +97,7 @@ static const struct of_device_id simple_
{ .compatible = "silergy,sy7636a", .data = &silergy_sy7636a},
{ .compatible = "maxim,max5970", .data = &maxim_max5970},
{ .compatible = "maxim,max5978", .data = &maxim_max5970},
+ { .compatible = "raspberrypi,poe-core", &rpi_poe_core },
{ .compatible = "raspberrypi,sensehat" },
{}
};