Merge tag 'mfd-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "Maxim MAX77705:
   - Added core MFD driver.
   - Added charger driver.
   - Added devicetree bindings for the charger and MFD core.
   - Added Haptic controller support via the input subsystem.
   - Added LED support.
   - Added support to simple-mfd-i2c for fuel gauge and hwmon.

  Samsung S2MPU05 (Exynos7870 PMIC):
   - Added core MFD support.
   - Added Regulator support for 21 LDOs and 5 BUCKs.
   - Added devicetree bindings for regulators and the PMIC core.

  TI TPS65215 & TPS65214:
   - Added support to the existing TPS65219 driver.
   - Added devicetree bindings.

  STMicroelectronics STM32MP25:
   - Added support to the stm32-timers MFD driver.
   - Added devicetree bindings.

  Congatec Board Controller (CGBC):
   - Added HWMON support for internal sensors.
   - Added support for the conga-SA8 module.

  Microchip LAN969X:
   - Enabled the at91-usart MFD driver for this architecture.

  MediaTek MT6359:
   - Added mfd_cell for mt6359-accdet to allow its driver to probe.

  Other misc driver updates:
   - AXP20X (AXP717): Added AXP717_TS_PIN_CFG register to writeable regs
     for temperature sensor configuration.
   - SM501: Switched to using BIT() macro to mitigate potential integer
     overflows in GPIO functions.
   - ENE KB3930: Added a NULL pointer check for off_gpios during probe
     to prevent potential dereference.
   - SYSCON: Added a check for invalid resource size to prevent issues
     from DT misconfiguration.
   - CGBC: Corrected signedness issues in cgbc_session_request
   - intel_soc_pmic_chtdc_ti / intel_soc_pmic_crc: Removed unneeded
     explicit assignment to REGCACHE_NONE.
   - ipaq-micro / tps65010: Switched to using str_enable_disable()
     helpers for clarity and potential size reduction.
   - upboard-fpga: Removed unnecessary ACPI_PTR() annotation.
   - max8997: Removed unused max8997_irq_exit() function, using devm_*
     helpers instead.
   - lp3943: Dropped unused #include <linux/pwm.h> from the header file.
   - db8500-prcmu: Removed needless return statements in void APIs.
   - qnap-mcu: Replaced commas with semicolons between expressions for
     correctness.
   - STA2X11: Removed the core MFD driver as the underlying platform
     support was removed.
   - EZX-PCAP: Removed the unused pcap_adc_sync function.
   - PCF50633 (OpenMoko PMIC): Removed the entire driver (core, adc,
     gpio, irq) as the underlying s3c24xx platform support was removed.

  Devicetree updates:
   - Converted fsl,mcu-mpc8349emitx binding to YAML
   - Added qcom,msm8937-tcsr compatible
   - Added microchip,sama7d65-flexcom compatible
   - Added rockchip,rk3528-qos syscon compatible
   - Added airoha,en7581-pbus-csr syscon compatible
   - Added microchip,sama7d65-ddr3phy syscon compatible
   - Added microchip,sama7d65-sfrbu syscon compatible"

* tag 'mfd-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (49 commits)
  mfd: cgbc-core: Add support for conga-SA8
  dt-bindings: mfd: syscon: Add microchip,sama7d65-sfrbu
  dt-bindings: mfd: syscon: Add microchip,sama7d65-ddr3phy
  mfd: cgbc: Add support for HWMON
  dt-bindings: mfd: syscon: Add the pbus-csr node for Airoha EN7581 SoC
  mfd: cgbc-core: Cleanup signedness in cgbc_session_request()
  mfd: pcf50633: Remove remaining PCF50633 support
  mfd: pcf50633: Remove unused platform IRQ code
  mfd: pcF50633-gpio: Remove unused driver
  mfd: pcf50633-adc: Remove unused driver
  mfd: qnap-mcu: Convert commas to semicolons in qnap_mcu_exec()
  mfd: mt6397-core: Add mfd_cell for mt6359-accdet
  dt-bindings: mfd: syscon: Add rk3528 QoS register compatible
  dt-bindings: mfd: atmel,sama5d2-flexcom: Add microchip,sama7d65-flexcom
  mfd: ezx-pcap: Remove unused pcap_adc_sync
  mfd: db8500-prcmu: Remove needless return in three void APIs
  mfd: Remove STA2x11 core driver
  mfd: max77620: Allow building as a module
  mfd: ene-kb3930: Fix a potential NULL pointer dereference
  dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8937
  ...
This commit is contained in:
Linus Torvalds
2025-03-29 14:33:13 -07:00
69 changed files with 2722 additions and 2599 deletions
@@ -19,12 +19,11 @@ properties:
oneOf:
- const: atmel,sama5d2-flexcom
- items:
- const: microchip,sam9x7-flexcom
- enum:
- microchip,sam9x7-flexcom
- microchip,sama7d65-flexcom
- microchip,sama7g5-flexcom
- const: atmel,sama5d2-flexcom
- items:
- const: microchip,sama7g5-flexcom
- const: atmel,sama5d2-flexcom
reg:
maxItems: 1
@@ -0,0 +1,53 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/fsl,mcu-mpc8349emitx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Freescale MPC8349E-mITX-compatible Power Management Micro Controller Unit (MCU)
maintainers:
- J. Neuschäfer <j.ne@posteo.net>
properties:
compatible:
oneOf:
- items:
- enum:
- fsl,mc9s08qg8-mpc8315erdb
- fsl,mc9s08qg8-mpc8349emitx
- fsl,mc9s08qg8-mpc8377erdb
- fsl,mc9s08qg8-mpc8378erdb
- fsl,mc9s08qg8-mpc8379erdb
- const: fsl,mcu-mpc8349emitx
reg:
maxItems: 1
"#gpio-cells":
const: 2
gpio-controller: true
required:
- compatible
- reg
- "#gpio-cells"
- gpio-controller
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
mcu@a {
#gpio-cells = <2>;
compatible = "fsl,mc9s08qg8-mpc8349emitx",
"fsl,mcu-mpc8349emitx";
reg = <0x0a>;
gpio-controller;
};
};
@@ -0,0 +1,158 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/maxim,max77705.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Maxim MAX77705 Companion Power Management and USB Type-C interface
maintainers:
- Dzmitry Sankouski <dsankouski@gmail.com>
description: |
This is a part of device tree bindings for Maxim MAX77705.
Maxim MAX77705 is a Companion Power Management and Type-C
interface IC which includes charger, fuelgauge, LED, haptic motor driver and
Type-C management.
properties:
compatible:
const: maxim,max77705
reg:
maxItems: 1
interrupts:
maxItems: 1
haptic:
type: object
additionalProperties: false
properties:
compatible:
const: maxim,max77705-haptic
haptic-supply: true
pwms:
maxItems: 1
required:
- compatible
- haptic-supply
- pwms
leds:
type: object
additionalProperties: false
description:
Up to 4 LED channels supported.
properties:
compatible:
const: maxim,max77705-rgb
"#address-cells":
const: 1
"#size-cells":
const: 0
multi-led:
type: object
$ref: /schemas/leds/leds-class-multicolor.yaml#
unevaluatedProperties: false
properties:
"#address-cells":
const: 1
"#size-cells":
const: 0
patternProperties:
"^led@[0-3]$":
type: object
$ref: /schemas/leds/common.yaml#
unevaluatedProperties: false
properties:
reg:
maxItems: 1
required:
- reg
patternProperties:
"^led@[0-3]$":
type: object
$ref: /schemas/leds/common.yaml#
unevaluatedProperties: false
properties:
reg:
maxItems: 1
required:
- reg
required:
- compatible
required:
- compatible
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
pmic@66 {
compatible = "maxim,max77705";
reg = <0x66>;
interrupt-parent = <&pm8998_gpios>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
pinctrl-0 = <&chg_int_default>;
pinctrl-names = "default";
leds {
compatible = "maxim,max77705-rgb";
multi-led {
color = <LED_COLOR_ID_RGB>;
function = LED_FUNCTION_STATUS;
#address-cells = <1>;
#size-cells = <0>;
led@1 {
reg = <1>;
color = <LED_COLOR_ID_RED>;
};
led@2 {
reg = <2>;
color = <LED_COLOR_ID_GREEN>;
};
led@3 {
reg = <3>;
color = <LED_COLOR_ID_BLUE>;
};
};
};
haptic {
compatible = "maxim,max77705-haptic";
haptic-supply = <&vib_regulator>;
pwms = <&vib_pwm 0 50000>;
};
};
};
@@ -52,6 +52,7 @@ properties:
- qcom,tcsr-msm8660
- qcom,tcsr-msm8916
- qcom,tcsr-msm8917
- qcom,tcsr-msm8937
- qcom,tcsr-msm8953
- qcom,tcsr-msm8960
- qcom,tcsr-msm8974
@@ -25,6 +25,7 @@ properties:
- samsung,s2mps14-pmic
- samsung,s2mps15-pmic
- samsung,s2mpu02-pmic
- samsung,s2mpu05-pmic
clocks:
$ref: /schemas/clock/samsung,s2mps11.yaml
@@ -125,6 +126,18 @@ allOf:
samsung,s2mps11-acokb-ground: false
samsung,s2mps11-wrstbi-ground: false
- if:
properties:
compatible:
contains:
const: samsung,s2mpu05-pmic
then:
properties:
regulators:
$ref: /schemas/regulator/samsung,s2mpu05.yaml
samsung,s2mps11-acokb-ground: false
samsung,s2mps11-wrstbi-ground: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
@@ -21,7 +21,9 @@ maintainers:
properties:
compatible:
const: st,stm32-timers
enum:
- st,stm32-timers
- st,stm32mp25-timers
reg:
maxItems: 1
@@ -36,6 +38,9 @@ properties:
resets:
maxItems: 1
power-domains:
maxItems: 1
dmas:
minItems: 1
maxItems: 7
@@ -77,7 +82,9 @@ properties:
properties:
compatible:
const: st,stm32-pwm
enum:
- st,stm32-pwm
- st,stm32mp25-pwm
"#pwm-cells":
const: 3
@@ -113,7 +120,9 @@ properties:
properties:
compatible:
const: st,stm32-timer-counter
enum:
- st,stm32-timer-counter
- st,stm32mp25-timer-counter
required:
- compatible
@@ -128,12 +137,13 @@ patternProperties:
enum:
- st,stm32-timer-trigger
- st,stm32h7-timer-trigger
- st,stm32mp25-timer-trigger
reg:
description: Identify trigger hardware block.
items:
minimum: 0
maximum: 16
maximum: 19
required:
- compatible
@@ -27,6 +27,7 @@ select:
compatible:
contains:
enum:
- airoha,en7581-pbus-csr
- al,alpine-sysfabric-service
- allwinner,sun8i-a83t-system-controller
- allwinner,sun8i-h3-system-controller
@@ -90,6 +91,8 @@ select:
- microchip,lan966x-cpu-syscon
- microchip,mpfs-sysreg-scb
- microchip,sam9x60-sfr
- microchip,sama7d65-ddr3phy
- microchip,sama7d65-sfrbu
- microchip,sama7g5-ddr3phy
- mscc,ocelot-cpu-syscon
- mstar,msc313-pmsleep
@@ -127,6 +130,7 @@ properties:
compatible:
items:
- enum:
- airoha,en7581-pbus-csr
- al,alpine-sysfabric-service
- allwinner,sun8i-a83t-system-controller
- allwinner,sun8i-h3-system-controller
@@ -190,6 +194,8 @@ properties:
- microchip,lan966x-cpu-syscon
- microchip,mpfs-sysreg-scb
- microchip,sam9x60-sfr
- microchip,sama7d65-ddr3phy
- microchip,sama7d65-sfrbu
- microchip,sama7g5-ddr3phy
- mscc,ocelot-cpu-syscon
- mstar,msc313-pmsleep
@@ -0,0 +1,50 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max77705.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Maxim MAX777705 charger
maintainers:
- Dzmitry Sankouski <dsankouski@gmail.com>
description: |
This is a device tree bindings for charger found in Maxim MAX77705 chip.
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: maxim,max77705-charger
interrupts:
maxItems: 1
reg:
maxItems: 1
required:
- compatible
- reg
- monitored-battery
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@69 {
compatible = "maxim,max77705-charger";
reg = <0x69>;
monitored-battery = <&battery>;
interrupt-parent = <&pm8998_gpios>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
};
};
@@ -1,17 +0,0 @@
Freescale MPC8349E-mITX-compatible Power Management Micro Controller Unit (MCU)
Required properties:
- compatible : "fsl,<mcu-chip>-<board>", "fsl,mcu-mpc8349emitx".
- reg : should specify I2C address (0x0a).
- #gpio-cells : should be 2.
- gpio-controller : should be present.
Example:
mcu@a {
#gpio-cells = <2>;
compatible = "fsl,mc9s08qg8-mpc8349emitx",
"fsl,mcu-mpc8349emitx";
reg = <0x0a>;
gpio-controller;
};
@@ -0,0 +1,47 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/samsung,s2mpu05.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Samsung S2MPU05 Power Management IC regulators
maintainers:
- Kaustabh Chakraborty <kauschluss@disroot.org>
description: |
This is a part of device tree bindings for S2M and S5M family of Power
Management IC (PMIC).
The S2MPU05 provides buck and LDO regulators.
See also Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml for
additional information and example.
patternProperties:
# 21 LDOs
"^ldo([1-9]|10|2[5-9]|3[0-5])$":
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for single LDO regulator.
LDOs 11-24 are used for CP, and they're left unimplemented due to lack
of documentation on these regulators.
required:
- regulator-name
# 5 bucks
"^buck[1-5]$":
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for single buck regulator.
required:
- regulator-name
additionalProperties: false
@@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/regulator/ti,tps65219.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI tps65219 Power Management Integrated Circuit regulators
title: TI TPS65214/TPS65215/TPS65219 Power Management Integrated Circuit
maintainers:
- Jerome Neanne <jerome.neanne@baylibre.com>
@@ -12,9 +12,20 @@ maintainers:
description: |
Regulator nodes should be named to buck<number> and ldo<number>.
TI TPS65219 is a Power Management IC with 3 Buck regulators, 4 Low
Drop-out Regulators (LDOs), 1 GPIO, 2 GPOs, and power-button.
TI TPS65215 is a derivative of TPS65219 with 3 Buck regulators, 2 Low
Drop-out Regulators (LDOs), 1 GPIO, 1 GPO, and power-button.
TI TPS65214 is a derivative of TPS65219 with 3 Buck regulators, 2 Low
Drop-out Regulators (LDOs), 1 GPIO, 1 GPO, and power-button.
properties:
compatible:
enum:
- ti,tps65214
- ti,tps65215
- ti,tps65219
reg:
@@ -90,6 +101,20 @@ required:
additionalProperties: false
allOf:
- if:
properties:
compatible:
contains:
enum:
- ti,tps65214
- ti,tps65215
then:
properties:
regulators:
patternProperties:
"^ldo[3-4]$": false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
+4
View File
@@ -14524,12 +14524,15 @@ B: mailto:linux-samsung-soc@vger.kernel.org
F: Documentation/devicetree/bindings/*/maxim,max14577.yaml
F: Documentation/devicetree/bindings/*/maxim,max77686.yaml
F: Documentation/devicetree/bindings/*/maxim,max77693.yaml
F: Documentation/devicetree/bindings/*/maxim,max77705*.yaml
F: Documentation/devicetree/bindings/*/maxim,max77843.yaml
F: Documentation/devicetree/bindings/clock/maxim,max77686.txt
F: drivers/leds/leds-max77705.c
F: drivers/*/*max77843.c
F: drivers/*/max14577*.c
F: drivers/*/max77686*.c
F: drivers/*/max77693*.c
F: drivers/*/max77705*.c
F: drivers/clk/clk-max77686.c
F: drivers/extcon/extcon-max14577.c
F: drivers/extcon/extcon-max77693.c
@@ -14537,6 +14540,7 @@ F: drivers/rtc/rtc-max77686.c
F: include/linux/mfd/max14577*.h
F: include/linux/mfd/max77686*.h
F: include/linux/mfd/max77693*.h
F: include/linux/mfd/max77705*.h
MAXIRADIO FM RADIO RECEIVER DRIVER
M: Hans Verkuil <hverkuil@xs4all.nl>
-3
View File
@@ -254,9 +254,6 @@ CONFIG_I2C_TAOS_EVM=m
CONFIG_I2C_STUB=m
# CONFIG_HWMON is not set
CONFIG_THERMAL=y
CONFIG_MFD_PCF50633=m
CONFIG_PCF50633_ADC=m
CONFIG_PCF50633_GPIO=m
# CONFIG_VGA_ARB is not set
CONFIG_LEDS_LP3944=m
CONFIG_LEDS_PCA955X=m
+3 -3
View File
@@ -240,12 +240,12 @@ config INPUT_MAX77650_ONKEY
will be called max77650-onkey.
config INPUT_MAX77693_HAPTIC
tristate "MAXIM MAX77693/MAX77843 haptic controller support"
depends on (MFD_MAX77693 || MFD_MAX77843) && PWM
tristate "MAXIM MAX77693/MAX77705/MAX77843 haptic controller support"
depends on (MFD_MAX77693 || MFD_MAX77705 || MFD_MAX77843) && PWM
select INPUT_FF_MEMLESS
help
This option enables support for the haptic controller on
MAXIM MAX77693 and MAX77843 chips.
MAXIM MAX77693, MAX77705 and MAX77843 chips.
To compile this driver as module, choose M here: the
module will be called max77693-haptic.
+12 -1
View File
@@ -24,6 +24,7 @@
#include <linux/mfd/max77693.h>
#include <linux/mfd/max77693-common.h>
#include <linux/mfd/max77693-private.h>
#include <linux/mfd/max77705-private.h>
#include <linux/mfd/max77843-private.h>
#define MAX_MAGNITUDE_SHIFT 16
@@ -116,6 +117,13 @@ static int max77693_haptic_configure(struct max77693_haptic *haptic,
MAX77693_HAPTIC_PWM_DIVISOR_128);
config_reg = MAX77693_HAPTIC_REG_CONFIG2;
break;
case TYPE_MAX77705:
value = ((haptic->type << MAX77693_CONFIG2_MODE) |
(enable << MAX77693_CONFIG2_MEN) |
(haptic->mode << MAX77693_CONFIG2_HTYP) |
MAX77693_HAPTIC_PWM_DIVISOR_128);
config_reg = MAX77705_PMIC_REG_MCONFIG;
break;
case TYPE_MAX77843:
value = (haptic->type << MCONFIG_MODE_SHIFT) |
(enable << MCONFIG_MEN_SHIFT) |
@@ -313,6 +321,7 @@ static int max77693_haptic_probe(struct platform_device *pdev)
case TYPE_MAX77693:
haptic->regmap_haptic = max77693->regmap_haptic;
break;
case TYPE_MAX77705:
case TYPE_MAX77843:
haptic->regmap_haptic = max77693->regmap;
break;
@@ -408,6 +417,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops,
static const struct platform_device_id max77693_haptic_id[] = {
{ "max77693-haptic", },
{ "max77705-haptic", },
{ "max77843-haptic", },
{},
};
@@ -415,6 +425,7 @@ MODULE_DEVICE_TABLE(platform, max77693_haptic_id);
static const struct of_device_id of_max77693_haptic_dt_match[] = {
{ .compatible = "maxim,max77693-haptic", },
{ .compatible = "maxim,max77705-haptic", },
{ .compatible = "maxim,max77843-haptic", },
{ /* sentinel */ },
};
@@ -433,5 +444,5 @@ module_platform_driver(max77693_haptic_driver);
MODULE_AUTHOR("Jaewon Kim <jaewon02.kim@samsung.com>");
MODULE_AUTHOR("Krzysztof Kozlowski <krzk@kernel.org>");
MODULE_DESCRIPTION("MAXIM 77693/77843 Haptic driver");
MODULE_DESCRIPTION("MAXIM 77693/77705/77843 Haptic driver");
MODULE_LICENSE("GPL");
+8
View File
@@ -778,6 +778,14 @@ config LEDS_MAX77650
help
LEDs driver for MAX77650 family of PMICs from Maxim Integrated.
config LEDS_MAX77705
tristate "LED support for Maxim MAX77705 PMIC"
depends on MFD_MAX77705
depends on LEDS_CLASS
depends on LEDS_CLASS_MULTICOLOR
help
LED driver for MAX77705 PMIC from Maxim Integrated.
config LEDS_MAX8997
tristate "LED support for MAX8997 PMIC"
depends on LEDS_CLASS && MFD_MAX8997
+1
View File
@@ -61,6 +61,7 @@ obj-$(CONFIG_LEDS_LP8864) += leds-lp8864.o
obj-$(CONFIG_LEDS_LT3593) += leds-lt3593.o
obj-$(CONFIG_LEDS_MAX5970) += leds-max5970.o
obj-$(CONFIG_LEDS_MAX77650) += leds-max77650.o
obj-$(CONFIG_LEDS_MAX77705) += leds-max77705.o
obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o
obj-$(CONFIG_LEDS_MC13783) += leds-mc13783.o
obj-$(CONFIG_LEDS_MENF21BMC) += leds-menf21bmc.o
+275
View File
@@ -0,0 +1,275 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Based on leds-max77650 driver
*
* LED driver for MAXIM 77705 PMIC.
* Copyright (C) 2025 Dzmitry Sankouski <dsankouski@gmail.org>
*/
#include <linux/i2c.h>
#include <linux/led-class-multicolor.h>
#include <linux/leds.h>
#include <linux/mfd/max77705-private.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#define MAX77705_LED_NUM_LEDS 4
#define MAX77705_LED_EN_MASK GENMASK(1, 0)
#define MAX77705_LED_MAX_BRIGHTNESS 0xff
#define MAX77705_LED_EN_SHIFT(reg) (reg * MAX77705_RGBLED_EN_WIDTH)
#define MAX77705_LED_REG_BRIGHTNESS(reg) (reg + MAX77705_RGBLED_REG_LED0BRT)
struct max77705_led {
struct led_classdev cdev;
struct led_classdev_mc mcdev;
struct regmap *regmap;
struct mc_subled *subled_info;
};
static const struct regmap_config max77705_leds_regmap_config = {
.reg_base = MAX77705_RGBLED_REG_BASE,
.reg_bits = 8,
.val_bits = 8,
.max_register = MAX77705_LED_REG_END,
};
static int max77705_rgb_blink(struct led_classdev *cdev,
unsigned long *delay_on,
unsigned long *delay_off)
{
struct max77705_led *led = container_of(cdev, struct max77705_led, cdev);
int value, on_value, off_value;
if (*delay_on < MAX77705_RGB_DELAY_100_STEP)
on_value = 0;
else if (*delay_on < MAX77705_RGB_DELAY_100_STEP_LIM)
on_value = *delay_on / MAX77705_RGB_DELAY_100_STEP - 1;
else if (*delay_on < MAX77705_RGB_DELAY_250_STEP_LIM)
on_value = (*delay_on - MAX77705_RGB_DELAY_100_STEP_LIM) /
MAX77705_RGB_DELAY_250_STEP +
MAX77705_RGB_DELAY_100_STEP_COUNT;
else
on_value = 15;
on_value <<= 4;
if (*delay_off < 1)
off_value = 0;
else if (*delay_off < MAX77705_RGB_DELAY_500_STEP)
off_value = 1;
else if (*delay_off < MAX77705_RGB_DELAY_500_STEP_LIM)
off_value = *delay_off / MAX77705_RGB_DELAY_500_STEP;
else if (*delay_off < MAX77705_RGB_DELAY_1000_STEP_LIM)
off_value = (*delay_off - MAX77705_RGB_DELAY_1000_STEP_LIM) /
MAX77705_RGB_DELAY_1000_STEP +
MAX77705_RGB_DELAY_500_STEP_COUNT;
else if (*delay_off < MAX77705_RGB_DELAY_2000_STEP_LIM)
off_value = (*delay_off - MAX77705_RGB_DELAY_2000_STEP_LIM) /
MAX77705_RGB_DELAY_2000_STEP +
MAX77705_RGB_DELAY_1000_STEP_COUNT;
else
off_value = 15;
value = on_value | off_value;
return regmap_write(led->regmap, MAX77705_RGBLED_REG_LEDBLNK, value);
}
static int max77705_led_brightness_set(struct regmap *regmap, struct mc_subled *subled,
int num_colors)
{
int ret;
for (int i = 0; i < num_colors; i++) {
unsigned int channel, brightness;
channel = subled[i].channel;
brightness = subled[i].brightness;
if (brightness == LED_OFF) {
/* Flash OFF */
ret = regmap_update_bits(regmap,
MAX77705_RGBLED_REG_LEDEN,
MAX77705_LED_EN_MASK << MAX77705_LED_EN_SHIFT(channel), 0);
} else {
/* Set current */
ret = regmap_write(regmap, MAX77705_LED_REG_BRIGHTNESS(channel),
brightness);
if (ret < 0)
return ret;
ret = regmap_update_bits(regmap,
MAX77705_RGBLED_REG_LEDEN,
LED_ON << MAX77705_LED_EN_SHIFT(channel),
MAX77705_LED_EN_MASK << MAX77705_LED_EN_SHIFT(channel));
}
}
return ret;
}
static int max77705_led_brightness_set_single(struct led_classdev *cdev,
enum led_brightness brightness)
{
struct max77705_led *led = container_of(cdev, struct max77705_led, cdev);
led->subled_info->brightness = brightness;
return max77705_led_brightness_set(led->regmap, led->subled_info, 1);
}
static int max77705_led_brightness_set_multi(struct led_classdev *cdev,
enum led_brightness brightness)
{
struct led_classdev_mc *mcdev = lcdev_to_mccdev(cdev);
struct max77705_led *led = container_of(mcdev, struct max77705_led, mcdev);
led_mc_calc_color_components(mcdev, brightness);
return max77705_led_brightness_set(led->regmap, led->mcdev.subled_info, mcdev->num_colors);
}
static int max77705_parse_subled(struct device *dev, struct fwnode_handle *np,
struct mc_subled *info)
{
u32 color = LED_COLOR_ID_GREEN;
u32 reg;
int ret;
ret = fwnode_property_read_u32(np, "reg", &reg);
if (ret || !reg || reg >= MAX77705_LED_NUM_LEDS)
return dev_err_probe(dev, -EINVAL, "invalid \"reg\" of %pOFn\n", np);
info->channel = reg;
ret = fwnode_property_read_u32(np, "color", &color);
if (ret < 0 && ret != -EINVAL)
return dev_err_probe(dev, ret,
"failed to parse \"color\" of %pOF\n", np);
info->color_index = color;
return 0;
}
static int max77705_add_led(struct device *dev, struct regmap *regmap, struct fwnode_handle *np)
{
int ret, i = 0;
unsigned int color, reg;
struct max77705_led *led;
struct led_classdev *cdev;
struct mc_subled *info;
struct fwnode_handle *child;
struct led_init_data init_data = {};
led = devm_kzalloc(dev, sizeof(*led), GFP_KERNEL);
if (!led)
return -ENOMEM;
ret = fwnode_property_read_u32(np, "color", &color);
if (ret < 0 && ret != -EINVAL)
return dev_err_probe(dev, ret,
"failed to parse \"color\" of %pOF\n", np);
led->regmap = regmap;
init_data.fwnode = np;
if (color == LED_COLOR_ID_RGB) {
int num_channels = of_get_available_child_count(to_of_node(np));
ret = fwnode_property_read_u32(np, "reg", &reg);
if (ret || reg >= MAX77705_LED_NUM_LEDS)
ret = -EINVAL;
info = devm_kcalloc(dev, num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
cdev = &led->mcdev.led_cdev;
cdev->max_brightness = MAX77705_LED_MAX_BRIGHTNESS;
cdev->brightness_set_blocking = max77705_led_brightness_set_multi;
cdev->blink_set = max77705_rgb_blink;
fwnode_for_each_available_child_node(np, child) {
ret = max77705_parse_subled(dev, child, &info[i]);
if (ret < 0)
return ret;
info[i].intensity = 0;
i++;
}
led->mcdev.subled_info = info;
led->mcdev.num_colors = num_channels;
led->cdev = *cdev;
ret = devm_led_classdev_multicolor_register_ext(dev, &led->mcdev, &init_data);
if (ret)
return ret;
ret = max77705_led_brightness_set_multi(&led->cdev, LED_OFF);
if (ret)
return ret;
} else {
info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
max77705_parse_subled(dev, np, info);
led->subled_info = info;
led->cdev.brightness_set_blocking = max77705_led_brightness_set_single;
led->cdev.blink_set = max77705_rgb_blink;
led->cdev.max_brightness = MAX77705_LED_MAX_BRIGHTNESS;
ret = devm_led_classdev_register_ext(dev, &led->cdev, &init_data);
if (ret)
return ret;
ret = max77705_led_brightness_set_single(&led->cdev, LED_OFF);
if (ret)
return ret;
}
return 0;
}
static int max77705_led_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct i2c_client *i2c = to_i2c_client(pdev->dev.parent);
struct regmap *regmap;
int ret;
regmap = devm_regmap_init_i2c(i2c, &max77705_leds_regmap_config);
if (IS_ERR(regmap))
return dev_err_probe(dev, PTR_ERR(regmap), "Failed to register LEDs regmap\n");
device_for_each_child_node_scoped(dev, child) {
ret = max77705_add_led(dev, regmap, child);
if (ret)
return ret;
}
return 0;
}
static const struct of_device_id max77705_led_of_match[] = {
{ .compatible = "maxim,max77705-rgb" },
{ }
};
MODULE_DEVICE_TABLE(of, max77705_led_of_match);
static struct platform_driver max77705_led_driver = {
.driver = {
.name = "max77705-led",
.of_match_table = max77705_led_of_match,
},
.probe = max77705_led_probe,
};
module_platform_driver(max77705_led_driver);
MODULE_DESCRIPTION("Maxim MAX77705 LED driver");
MODULE_AUTHOR("Dzmitry Sankouski <dsankouski@gmail.com>");
MODULE_LICENSE("GPL");
+15 -32
View File
@@ -138,7 +138,7 @@ config MFD_AAT2870_CORE
config MFD_AT91_USART
tristate "AT91 USART Driver"
select MFD_CORE
depends on ARCH_AT91 || COMPILE_TEST
depends on ARCH_AT91 || ARCH_LAN969X || COMPILE_TEST
help
Select this to get support for AT91 USART IP. This is a wrapper
over at91-usart-serial driver and usart-spi-driver. Only one function
@@ -858,7 +858,7 @@ config MFD_MAX77541
There are regulators and adc.
config MFD_MAX77620
bool "Maxim Semiconductor MAX77620 and MAX20024 PMIC Support"
tristate "Maxim Semiconductor MAX77620 and MAX20024 PMIC Support"
depends on I2C=y
depends on OF
select MFD_CORE
@@ -916,6 +916,19 @@ config MFD_MAX77693
additional drivers must be enabled in order to use the functionality
of the device.
config MFD_MAX77705
tristate "Maxim MAX77705 PMIC Support"
depends on I2C
select MFD_CORE
select MFD_SIMPLE_MFD_I2C
help
Say yes here to add support for Maxim Integrated MAX77705 PMIC.
This is a Power Management IC with Charger, safe LDOs, Flash, Haptic
and MUIC controls on chip.
This driver provides common support for accessing the device;
additional drivers must be enabled in order to use the functionality
of the device.
config MFD_MAX77714
tristate "Maxim Semiconductor MAX77714 PMIC Support"
depends on I2C
@@ -1119,30 +1132,6 @@ config MFD_RETU
Retu and Tahvo are a multi-function devices found on Nokia
Internet Tablets (770, N800 and N810).
config MFD_PCF50633
tristate "NXP PCF50633"
depends on I2C
select REGMAP_I2C
help
Say yes here if you have NXP PCF50633 chip on your board.
This core driver provides register access and IRQ handling
facilities, and registers devices for the various functions
so that function-specific drivers can bind to them.
config PCF50633_ADC
tristate "NXP PCF50633 ADC"
depends on MFD_PCF50633
help
Say yes here if you want to include support for ADC in the
NXP PCF50633 chip.
config PCF50633_GPIO
tristate "NXP PCF50633 GPIO"
depends on MFD_PCF50633
help
Say yes here if you want to include support GPIO for pins on
the PCF50633 chip.
config MFD_PM8XXX
tristate "Qualcomm PM8xxx PMIC chips driver"
depends on ARM || HEXAGON || COMPILE_TEST
@@ -1495,12 +1484,6 @@ config STMPE_SPI
This is used to enable SPI interface of STMPE
endmenu
config MFD_STA2X11
bool "STMicroelectronics STA2X11"
depends on STA2X11
select MFD_CORE
select REGMAP_MMIO
config MFD_SUN6I_PRCM
bool "Allwinner A31/A23/A33 PRCM controller"
depends on ARCH_SUNXI || COMPILE_TEST
+1 -5
View File
@@ -26,7 +26,6 @@ obj-$(CONFIG_MFD_TI_LP873X) += lp873x.o
obj-$(CONFIG_MFD_TI_LP87565) += lp87565.o
obj-$(CONFIG_MFD_TI_AM335X_TSCADC) += ti_am335x_tscadc.o
obj-$(CONFIG_MFD_STA2X11) += sta2x11-mfd.o
obj-$(CONFIG_MFD_STMPE) += stmpe.o
obj-$(CONFIG_STMPE_I2C) += stmpe-i2c.o
obj-$(CONFIG_STMPE_SPI) += stmpe-spi.o
@@ -168,6 +167,7 @@ obj-$(CONFIG_MFD_MAX77620) += max77620.o
obj-$(CONFIG_MFD_MAX77650) += max77650.o
obj-$(CONFIG_MFD_MAX77686) += max77686.o
obj-$(CONFIG_MFD_MAX77693) += max77693.o
obj-$(CONFIG_MFD_MAX77705) += max77705.o
obj-$(CONFIG_MFD_MAX77714) += max77714.o
obj-$(CONFIG_MFD_MAX77843) += max77843.o
obj-$(CONFIG_MFD_MAX8907) += max8907.o
@@ -183,10 +183,6 @@ obj-$(CONFIG_MFD_MT6370) += mt6370.o
mt6397-objs := mt6397-core.o mt6397-irq.o mt6358-irq.o
obj-$(CONFIG_MFD_MT6397) += mt6397.o
pcf50633-objs := pcf50633-core.o pcf50633-irq.o
obj-$(CONFIG_MFD_PCF50633) += pcf50633.o
obj-$(CONFIG_PCF50633_ADC) += pcf50633-adc.o
obj-$(CONFIG_PCF50633_GPIO) += pcf50633-gpio.o
obj-$(CONFIG_RZ_MTU3) += rz-mtu3.o
obj-$(CONFIG_ABX500_CORE) += abx500-core.o
obj-$(CONFIG_MFD_DB8500_PRCMU) += db8500-prcmu.o

Some files were not shown because too many files have changed in this diff Show More