Skip to content

Commit f158bbe

Browse files
committed
Merge tag 'mfd-next-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones: "Core Frameworks: - Standardise MFD_CELL_* helpers New Drivers: - Add support for Acer Iconia Tab A500 Embedded Controller New Device Support: - Add support for ROHM BD9574MWF to BD9571MWV - Add support for Intel Alder Lake PCH-P PCI to LPSS - Add support for Intel Alder Lake PCH-S PCI to LPSS New Functionality: - Support ACPI enumeration; arizona Fix-ups: - Managed resources; bd9571mwv - DT additions/fix-ups; bd9571mwv, iqs62x, max8997, gateworks-gsc, ene-kb930 - Convert to SPDX; bd9571mw - Fix return values/error handling; sunxi - Provide SOFTDEP; arizona - Make use of DIV_ROUND_UP; mcp-sa11x0 - Use generic APIs; arizona - Add MAC address sysfs entries; intel-m10-bmc - Trivial: Coding-style fix-ups; iqs62x - Trivial: Remove superflouous code; iqs62x - Clear-up naming conventions; iqs62x Bug Fixes: - Fix 'pointer from integer' error; altera-sysmgr - Convert SGI_MFD_IOC3 from tristate to bool; Kconfig - Fix interrupt handling; gateworks-gsc - Extend required delay; iqs62x - Do not use I2C polling during calibration; iqs62x - Do no adjust clock frequency during calibration; iqs62x - Fix use-after-free; wm831x-auxad" * tag 'mfd-next-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (32 commits) mfd: wm831x-auxadc: Prevent use after free in wm831x_auxadc_read_irq() mfd: iqs62x: Do not change clock frequency during ATI mfd: iqs62x: Do not poll during ATI mfd: iqs62x: Increase interrupt handler return delay mfd: iqs62x: Rename regmap_config struct mfd: iqs62x: Remove unused bit mask mfd: iqs62x: Remove superfluous whitespace above fallthroughs mfd: intel-lpss: Add Intel Alder Lake PCH-S PCI IDs mfd: intel-m10-bmc: Expose MAC address and count mfd: Add driver for Embedded Controller found on Acer Iconia Tab A500 dt-bindings: mfd: Add ENE KB930 Embedded Controller binding dt-bindings: mfd: gateworks-gsc: Add fan-tach mode mfd: intel-lpss: Add Intel Alder Lake PCH-P PCI IDs mfd: gateworks-gsc: Fix interrupt type mfd: Standardise MFD_CELL_* helper names mfd: mcp-sa11x0: Use DIV_ROUND_UP to calculate rw_timeout mfd: max8997: Add of_compatible to Extcon and Charger mfd_cell dt-bindings: mfd: Correct the node name of the panel LED mfd: sgi-ioc3: Turn Kconfig option into a bool mfd: altera-sysmgr: Fix physical address storing more ...
2 parents 4512d92 + 26783d7 commit f158bbe

27 files changed

Lines changed: 695 additions & 251 deletions

Documentation/ABI/testing/sysfs-driver-intel-m10-bmc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,24 @@ Contact: Xu Yilun <yilun.xu@intel.com>
1313
Description: Read only. Returns the firmware version of Intel MAX10
1414
BMC chip.
1515
Format: "0x%x".
16+
17+
What: /sys/bus/spi/devices/.../mac_address
18+
Date: January 2021
19+
KernelVersion: 5.12
20+
Contact: Russ Weight <russell.h.weight@intel.com>
21+
Description: Read only. Returns the first MAC address in a block
22+
of sequential MAC addresses assigned to the board
23+
that is managed by the Intel MAX10 BMC. It is stored in
24+
FLASH storage and is mirrored in the MAX10 BMC register
25+
space.
26+
Format: "%02x:%02x:%02x:%02x:%02x:%02x".
27+
28+
What: /sys/bus/spi/devices/.../mac_count
29+
Date: January 2021
30+
KernelVersion: 5.12
31+
Contact: Russ Weight <russell.h.weight@intel.com>
32+
Description: Read only. Returns the number of sequential MAC
33+
addresses assigned to the board managed by the Intel
34+
MAX10 BMC. This value is stored in FLASH and is mirrored
35+
in the MAX10 BMC register space.
36+
Format: "%u".

Documentation/devicetree/bindings/mfd/bd9571mwv.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
* ROHM BD9571MWV Power Management Integrated Circuit (PMIC) bindings
1+
* ROHM BD9571MWV/BD9574MWF Power Management Integrated Circuit (PMIC) bindings
22

33
Required properties:
4-
- compatible : Should be "rohm,bd9571mwv".
4+
- compatible : Should be "rohm,bd9571mwv" or "rohm,bd9574mwf".
55
- reg : I2C slave address.
66
- interrupts : The interrupt line the device is connected to.
77
- interrupt-controller : Marks the device node as an interrupt controller.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mfd/ene-kb930.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: ENE KB930 Embedded Controller bindings
8+
9+
description: |
10+
This binding describes the ENE KB930 Embedded Controller attached to an
11+
I2C bus.
12+
13+
maintainers:
14+
- Dmitry Osipenko <digetx@gmail.com>
15+
16+
properties:
17+
compatible:
18+
items:
19+
- enum:
20+
- acer,a500-iconia-ec # Acer A500 Iconia tablet device
21+
- const: ene,kb930
22+
reg:
23+
maxItems: 1
24+
25+
monitored-battery: true
26+
power-supplies: true
27+
system-power-controller: true
28+
29+
required:
30+
- compatible
31+
- reg
32+
33+
additionalProperties: false
34+
35+
examples:
36+
- |
37+
battery: battery-cell {
38+
compatible = "simple-battery";
39+
charge-full-design-microamp-hours = <3260000>;
40+
energy-full-design-microwatt-hours = <24000000>;
41+
operating-range-celsius = <0 40>;
42+
};
43+
44+
mains: ac-adapter {
45+
compatible = "gpio-charger";
46+
charger-type = "mains";
47+
gpios = <&gpio 125 0>;
48+
};
49+
50+
i2c {
51+
#address-cells = <1>;
52+
#size-cells = <0>;
53+
54+
embedded-controller@58 {
55+
compatible = "acer,a500-iconia-ec", "ene,kb930";
56+
reg = <0x58>;
57+
58+
system-power-controller;
59+
60+
monitored-battery = <&battery>;
61+
power-supplies = <&mains>;
62+
};
63+
};
64+
65+
...

Documentation/devicetree/bindings/mfd/gateworks-gsc.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ properties:
8383
2 - scaled voltage based on an optional resistor divider
8484
and optional offset
8585
3 - pre-scaled 16-bit voltage value
86+
4 - fan tach input to report RPM's
8687
$ref: /schemas/types.yaml#/definitions/uint32
87-
enum: [0, 1, 2, 3]
88+
enum: [0, 1, 2, 3, 4]
8889

8990
gw,voltage-divider-ohms:
9091
description: Values of resistors for divider on raw ADC input

Documentation/devicetree/bindings/mfd/iqs62x.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ examples:
9393
pwmleds {
9494
compatible = "pwm-leds";
9595
96-
panel {
96+
led-1 {
9797
pwms = <&iqs620a_pwm 0 1000000>;
9898
max-brightness = <255>;
9999
};

drivers/gpio/gpio-bd9571mwv.c

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
12
/*
2-
* ROHM BD9571MWV-M GPIO driver
3+
* ROHM BD9571MWV-M and BD9574MWF-M GPIO driver
34
*
45
* Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com>
56
*
6-
* This program is free software; you can redistribute it and/or
7-
* modify it under the terms of the GNU General Public License version 2 as
8-
* published by the Free Software Foundation.
9-
*
10-
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
11-
* kind, whether expressed or implied; without even the implied warranty
12-
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
* GNU General Public License version 2 for more details.
14-
*
157
* Based on the TPS65086 driver
168
*
179
* NOTE: Interrupts are not supported yet.
1810
*/
1911

2012
#include <linux/gpio/driver.h>
13+
#include <linux/mfd/rohm-generic.h>
2114
#include <linux/module.h>
2215
#include <linux/platform_device.h>
2316

2417
#include <linux/mfd/bd9571mwv.h>
2518

2619
struct bd9571mwv_gpio {
20+
struct regmap *regmap;
2721
struct gpio_chip chip;
28-
struct bd9571mwv *bd;
2922
};
3023

3124
static int bd9571mwv_gpio_get_direction(struct gpio_chip *chip,
@@ -34,7 +27,7 @@ static int bd9571mwv_gpio_get_direction(struct gpio_chip *chip,
3427
struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip);
3528
int ret, val;
3629

37-
ret = regmap_read(gpio->bd->regmap, BD9571MWV_GPIO_DIR, &val);
30+
ret = regmap_read(gpio->regmap, BD9571MWV_GPIO_DIR, &val);
3831
if (ret < 0)
3932
return ret;
4033
if (val & BIT(offset))
@@ -48,8 +41,7 @@ static int bd9571mwv_gpio_direction_input(struct gpio_chip *chip,
4841
{
4942
struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip);
5043

51-
regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_DIR,
52-
BIT(offset), 0);
44+
regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_DIR, BIT(offset), 0);
5345

5446
return 0;
5547
}
@@ -60,9 +52,9 @@ static int bd9571mwv_gpio_direction_output(struct gpio_chip *chip,
6052
struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip);
6153

6254
/* Set the initial value */
63-
regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_OUT,
55+
regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT,
6456
BIT(offset), value ? BIT(offset) : 0);
65-
regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_DIR,
57+
regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_DIR,
6658
BIT(offset), BIT(offset));
6759

6860
return 0;
@@ -73,7 +65,7 @@ static int bd9571mwv_gpio_get(struct gpio_chip *chip, unsigned int offset)
7365
struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip);
7466
int ret, val;
7567

76-
ret = regmap_read(gpio->bd->regmap, BD9571MWV_GPIO_IN, &val);
68+
ret = regmap_read(gpio->regmap, BD9571MWV_GPIO_IN, &val);
7769
if (ret < 0)
7870
return ret;
7971

@@ -85,7 +77,7 @@ static void bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset,
8577
{
8678
struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip);
8779

88-
regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_OUT,
80+
regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT,
8981
BIT(offset), value ? BIT(offset) : 0);
9082
}
9183

@@ -113,9 +105,9 @@ static int bd9571mwv_gpio_probe(struct platform_device *pdev)
113105

114106
platform_set_drvdata(pdev, gpio);
115107

116-
gpio->bd = dev_get_drvdata(pdev->dev.parent);
108+
gpio->regmap = dev_get_regmap(pdev->dev.parent, NULL);
117109
gpio->chip = template_chip;
118-
gpio->chip.parent = gpio->bd->dev;
110+
gpio->chip.parent = pdev->dev.parent;
119111

120112
ret = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
121113
if (ret < 0) {
@@ -127,7 +119,8 @@ static int bd9571mwv_gpio_probe(struct platform_device *pdev)
127119
}
128120

129121
static const struct platform_device_id bd9571mwv_gpio_id_table[] = {
130-
{ "bd9571mwv-gpio", },
122+
{ "bd9571mwv-gpio", ROHM_CHIP_TYPE_BD9571 },
123+
{ "bd9574mwf-gpio", ROHM_CHIP_TYPE_BD9574 },
131124
{ /* sentinel */ }
132125
};
133126
MODULE_DEVICE_TABLE(platform, bd9571mwv_gpio_id_table);

drivers/mfd/Kconfig

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2085,6 +2085,17 @@ config MFD_KHADAS_MCU
20852085
additional drivers must be enabled in order to use the functionality
20862086
of the device.
20872087

2088+
config MFD_ACER_A500_EC
2089+
tristate "Support for Acer Iconia Tab A500 Embedded Controller"
2090+
depends on I2C
2091+
depends on (ARCH_TEGRA_2x_SOC && OF) || COMPILE_TEST
2092+
select MFD_CORE
2093+
select REGMAP
2094+
help
2095+
Support for Embedded Controller found on Acer Iconia Tab A500.
2096+
The controller itself is ENE KB930, it is running firmware
2097+
customized for the specific needs of the Acer A500 hardware.
2098+
20882099
menu "Multimedia Capabilities Port drivers"
20892100
depends on ARCH_SA1100
20902101

@@ -2129,7 +2140,7 @@ config RAVE_SP_CORE
21292140
device found on several devices in RAVE line of hardware.
21302141

21312142
config SGI_MFD_IOC3
2132-
tristate "SGI IOC3 core driver"
2143+
bool "SGI IOC3 core driver"
21332144
depends on PCI && MIPS && 64BIT
21342145
select MFD_CORE
21352146
help

drivers/mfd/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ obj-$(CONFIG_MFD_ROHM_BD71828) += rohm-bd71828.o
264264
obj-$(CONFIG_MFD_ROHM_BD718XX) += rohm-bd718x7.o
265265
obj-$(CONFIG_MFD_STMFX) += stmfx.o
266266
obj-$(CONFIG_MFD_KHADAS_MCU) += khadas-mcu.o
267+
obj-$(CONFIG_MFD_ACER_A500_EC) += acer-ec-a500.o
267268

268269
obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o
269270
obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o

drivers/mfd/ab8500-core.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -609,52 +609,52 @@ int ab8500_suspend(struct ab8500 *ab8500)
609609
}
610610

611611
static const struct mfd_cell ab8500_bm_devs[] = {
612-
OF_MFD_CELL("ab8500-charger", NULL, &ab8500_bm_data,
612+
MFD_CELL_OF("ab8500-charger", NULL, &ab8500_bm_data,
613613
sizeof(ab8500_bm_data), 0, "stericsson,ab8500-charger"),
614-
OF_MFD_CELL("ab8500-btemp", NULL, &ab8500_bm_data,
614+
MFD_CELL_OF("ab8500-btemp", NULL, &ab8500_bm_data,
615615
sizeof(ab8500_bm_data), 0, "stericsson,ab8500-btemp"),
616-
OF_MFD_CELL("ab8500-fg", NULL, &ab8500_bm_data,
616+
MFD_CELL_OF("ab8500-fg", NULL, &ab8500_bm_data,
617617
sizeof(ab8500_bm_data), 0, "stericsson,ab8500-fg"),
618-
OF_MFD_CELL("ab8500-chargalg", NULL, &ab8500_bm_data,
618+
MFD_CELL_OF("ab8500-chargalg", NULL, &ab8500_bm_data,
619619
sizeof(ab8500_bm_data), 0, "stericsson,ab8500-chargalg"),
620620
};
621621

622622
static const struct mfd_cell ab8500_devs[] = {
623623
#ifdef CONFIG_DEBUG_FS
624-
OF_MFD_CELL("ab8500-debug",
624+
MFD_CELL_OF("ab8500-debug",
625625
NULL, NULL, 0, 0, "stericsson,ab8500-debug"),
626626
#endif
627-
OF_MFD_CELL("ab8500-sysctrl",
627+
MFD_CELL_OF("ab8500-sysctrl",
628628
NULL, NULL, 0, 0, "stericsson,ab8500-sysctrl"),
629-
OF_MFD_CELL("ab8500-ext-regulator",
629+
MFD_CELL_OF("ab8500-ext-regulator",
630630
NULL, NULL, 0, 0, "stericsson,ab8500-ext-regulator"),
631-
OF_MFD_CELL("ab8500-regulator",
631+
MFD_CELL_OF("ab8500-regulator",
632632
NULL, NULL, 0, 0, "stericsson,ab8500-regulator"),
633-
OF_MFD_CELL("ab8500-clk",
633+
MFD_CELL_OF("ab8500-clk",
634634
NULL, NULL, 0, 0, "stericsson,ab8500-clk"),
635-
OF_MFD_CELL("ab8500-gpadc",
635+
MFD_CELL_OF("ab8500-gpadc",
636636
NULL, NULL, 0, 0, "stericsson,ab8500-gpadc"),
637-
OF_MFD_CELL("ab8500-rtc",
637+
MFD_CELL_OF("ab8500-rtc",
638638
NULL, NULL, 0, 0, "stericsson,ab8500-rtc"),
639-
OF_MFD_CELL("ab8500-acc-det",
639+
MFD_CELL_OF("ab8500-acc-det",
640640
NULL, NULL, 0, 0, "stericsson,ab8500-acc-det"),
641-
OF_MFD_CELL("ab8500-poweron-key",
641+
MFD_CELL_OF("ab8500-poweron-key",
642642
NULL, NULL, 0, 0, "stericsson,ab8500-poweron-key"),
643-
OF_MFD_CELL("ab8500-pwm",
643+
MFD_CELL_OF("ab8500-pwm",
644644
NULL, NULL, 0, 1, "stericsson,ab8500-pwm"),
645-
OF_MFD_CELL("ab8500-pwm",
645+
MFD_CELL_OF("ab8500-pwm",
646646
NULL, NULL, 0, 2, "stericsson,ab8500-pwm"),
647-
OF_MFD_CELL("ab8500-pwm",
647+
MFD_CELL_OF("ab8500-pwm",
648648
NULL, NULL, 0, 3, "stericsson,ab8500-pwm"),
649-
OF_MFD_CELL("ab8500-denc",
649+
MFD_CELL_OF("ab8500-denc",
650650
NULL, NULL, 0, 0, "stericsson,ab8500-denc"),
651-
OF_MFD_CELL("pinctrl-ab8500",
651+
MFD_CELL_OF("pinctrl-ab8500",
652652
NULL, NULL, 0, 0, "stericsson,ab8500-gpio"),
653-
OF_MFD_CELL("abx500-temp",
653+
MFD_CELL_OF("abx500-temp",
654654
NULL, NULL, 0, 0, "stericsson,abx500-temp"),
655-
OF_MFD_CELL("ab8500-usb",
655+
MFD_CELL_OF("ab8500-usb",
656656
NULL, NULL, 0, 0, "stericsson,ab8500-usb"),
657-
OF_MFD_CELL("ab8500-codec",
657+
MFD_CELL_OF("ab8500-codec",
658658
NULL, NULL, 0, 0, "stericsson,ab8500-codec"),
659659
};
660660

0 commit comments

Comments
 (0)