Commit 1200af3a authored by Linus Torvalds's avatar Linus Torvalds

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

Pull MFD updates from Lee Jones:
 "New Drivers:
   - ROHM BD96801 Power Management IC
   - Cirrus Logic CS40L50 Haptic Driver with Waveform Memory
   - Marvell 88PM886 Power Management IC

  New Device Support:
   - Keyboard Backlight to ChromeOS Embedded Controller
   - LEDs to ChromeOS Embedded Controller
   - Charge Control to ChromeOS Embedded Controller
   - HW Monitoring Service to ChromeOS Embedded Controller
   - AUXADCs to MediaTek MT635{7,8,9} Power Management ICs

  New Functionality:
   - Allow Syscon consumers to supply their own Regmaps on registration

  Fix-ups:
   - Constify/staticise applicable data structures
   - Remove superfluous/duplicated/unused sections
   - Device Tree binding adaptions/conversions/creation
   - Trivial; spelling, whitespace, coding-style adaptions
   - Utilise centrally provided helpers and macros to aid
     simplicity/duplication
   - Drop i2c_device_id::driver_data where the value is unused
   - Replace ACPI/DT firmware helpers with agnostic variants
   - Move over to GPIOD (descriptor-based) APIs
   - Annotate a bunch of __counted_by() cases
   - Straighten out some includes

  Bug Fixes:
   - Ensure potentially asserted recent lines are deasserted during
     initialisation
   - Avoid "<module>.ko is added to multiple modules" warnings
   - Supply a bunch of MODULE_DESCRIPTIONs to silence modpost warnings
   - Fix Wvoid-pointer-to-enum-cast warnings"

* tag 'mfd-next-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (87 commits)
  mfd: timberdale: Attach device properties to TSC2007 board info
  mfd: tmio: Move header to platform_data
  mfd: tmio: Sanitize comments
  mfd: tmio: Update include files
  mmc: tmio/sdhi: Fix includes
  mfd: tmio: Remove obsolete io accessors
  mfd: tmio: Remove obsolete platform_data
  watchdog: bd96801_wdt: Add missing include for FIELD_*()
  dt-bindings: mfd: syscon: Add APM poweroff mailbox
  dt-bindings: mfd: syscon: Split and enforce documenting MFD children
  dt-bindings: mfd: rk817: Merge support for RK809
  dt-bindings: mfd: rk817: Fixup clocks and reference dai-common
  dt-bindings: mfd: syscon: Add TI's opp table compatible
  mfd: omap-usb-tll: Use struct_size to allocate tll
  dt-bindings: mfd: Explain lack of child dependency in simple-mfd
  dt-bindings: mfd: Dual licensing for st,stpmic1 bindings
  mfd: omap-usb-tll: Annotate struct usbtll_omap with __counted_by
  mfd: tps6594-core: Remove unneeded semicolon in tps6594_check_crc_mode()
  mfd: lm3533: Move to new GPIO descriptor-based APIs
  mfd: tps65912: Use devm helper functions to simplify probe
  ...
parents 6e504d2c c298391a
Amlogic Meson8 and Meson8b "analog top" registers:
--------------------------------------------------
The analog top registers contain information about the so-called
"metal revision" (which encodes the "minor version") of the SoC.
Required properties:
- reg: the register range of the analog top registers
- compatible: depending on the SoC this should be one of:
- "amlogic,meson8-analog-top"
- "amlogic,meson8b-analog-top"
along with "syscon"
Example:
analog_top: analog-top@81a8 {
compatible = "amlogic,meson8-analog-top", "syscon";
reg = <0x81a8 0x14>;
};
Amlogic Meson6/Meson8/Meson8b assist registers:
-----------------------------------------------
The assist registers contain basic information about the SoC,
for example the encoded SoC part number.
Required properties:
- reg: the register range of the assist registers
- compatible: should be "amlogic,meson-mx-assist" along with "syscon"
Example:
assist: assist@7c00 {
compatible = "amlogic,meson-mx-assist", "syscon";
reg = <0x7c00 0x200>;
};
Amlogic Meson6/Meson8/Meson8b bootrom:
--------------------------------------
The bootrom register area can be used to access SoC specific
information, such as the "misc version".
Required properties:
- reg: the register range of the bootrom registers
- compatible: should be "amlogic,meson-mx-bootrom" along with "syscon"
Example:
bootrom: bootrom@d9040000 {
compatible = "amlogic,meson-mx-bootrom", "syscon";
reg = <0xd9040000 0x10000>;
};
Amlogic Meson8 and Meson8b power-management-unit:
-------------------------------------------------
The pmu is used to turn off and on different power domains of the SoCs
This includes the power to the CPU cores.
Required node properties:
- compatible value : depending on the SoC this should be one of:
"amlogic,meson8-pmu"
"amlogic,meson8b-pmu"
- reg : physical base address and the size of the registers window
Example:
pmu@c81000e4 {
compatible = "amlogic,meson8b-pmu", "syscon";
reg = <0xc81000e0 0x18>;
};
......@@ -41,35 +41,6 @@ Examples:
reg = <0xffffe800 0x200>;
};
RAMC PHY Controller required properties:
- compatible: Should be "microchip,sama7g5-ddr3phy", "syscon"
- reg: Should contain registers location and length
Example:
ddr3phy: ddr3phy@e3804000 {
compatible = "microchip,sama7g5-ddr3phy", "syscon";
reg = <0xe3804000 0x1000>;
};
Special Function Registers (SFR)
Special Function Registers (SFR) manage specific aspects of the integrated
memory, bridge implementations, processor and other functionality not controlled
elsewhere.
required properties:
- compatible: Should be "atmel,<chip>-sfr", "syscon" or
"atmel,<chip>-sfrbu", "syscon"
<chip> can be "sama5d3", "sama5d4" or "sama5d2".
It also can be "microchip,sam9x60-sfr", "syscon".
- reg: Should contain registers location and length
sfr@f0038000 {
compatible = "atmel,sama5d3-sfr", "syscon";
reg = <0xf0038000 0x60>;
};
Security Module (SECUMOD)
The Security Module macrocell provides all necessary secure functions to avoid
......
......@@ -7,22 +7,6 @@ ARTPEC-6 ARM SoC
Required root node properties:
- compatible = "axis,artpec6";
ARTPEC-6 System Controller
--------------------------
The ARTPEC-6 has a system controller with mixed functions controlling DMA, PCIe
and resets.
Required properties:
- compatible: "axis,artpec6-syscon", "syscon"
- reg: Address and length of the register bank.
Example:
syscon {
compatible = "axis,artpec6-syscon", "syscon";
reg = <0xf8000000 0x48>;
};
ARTPEC-6 Development board:
---------------------------
Required root node properties:
......
......@@ -27,16 +27,6 @@ Properties:
- reg : Offset and length of the register set for the device
* Alpine System-Fabric Service Registers
The System-Fabric Service Registers allow various operation on CPU and
system fabric, like powering CPUs off.
Properties:
- compatible : Should contain "al,alpine-sysfabric-service" and "syscon".
- reg : Offset and length of the register set for the device
Example:
cpus {
......
Freescale Vybrid Miscellaneous System Control - CPU Configuration
The MSCM IP contains multiple sub modules, this binding describes the first
block of registers which contains CPU configuration information.
Required properties:
- compatible: "fsl,vf610-mscm-cpucfg", "syscon"
- reg: the register range of the MSCM CPU configuration registers
Example:
mscm_cpucfg: cpucfg@40001000 {
compatible = "fsl,vf610-mscm-cpucfg", "syscon";
reg = <0x40001000 0x800>;
}
......@@ -5,18 +5,3 @@ Boards with a Marvell Dove SoC shall have the following properties:
Required root node property:
- compatible: must contain "marvell,dove";
* Global Configuration registers
Global Configuration registers of Dove SoC are shared by a syscon node.
Required properties:
- compatible: must contain "marvell,dove-global-config" and "syscon".
- reg: base address and size of the Global Configuration registers.
Example:
gconf: global-config@e802c {
compatible = "marvell,dove-global-config", "syscon";
reg = <0xe802c 0x14>;
};
SPEAr Misc configuration
===========================
SPEAr SOCs have some miscellaneous registers which are used to configure
few properties of different peripheral controllers.
misc node required properties:
- compatible Should be "st,spear1340-misc", "syscon".
- reg: Address range of misc space up to 8K
* Device tree bindings for Texas Instruments keystone pll controller
The main pll controller used to drive theC66x CorePacs, the switch fabric,
and a majority of the peripheral clocks (all but the ARM CorePacs, DDR3 and
the NETCP modules) requires a PLL Controller to manage the various clock
divisions, gating, and synchronization.
Required properties:
- compatible: "ti,keystone-pllctrl", "syscon"
- reg: contains offset/length value for pll controller
registers space.
Example:
pllctrl: pll-controller@02310000 {
compatible = "ti,keystone-pllctrl", "syscon";
reg = <0x02310000 0x200>;
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/cirrus,cs40l50.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Cirrus Logic CS40L50 Advanced Haptic Driver
maintainers:
- James Ogletree <jogletre@opensource.cirrus.com>
description:
CS40L50 is a haptic driver with waveform memory,
integrated DSP, and closed-loop algorithms.
properties:
compatible:
enum:
- cirrus,cs40l50
reg:
maxItems: 1
interrupts:
maxItems: 1
reset-gpios:
maxItems: 1
vdd-a-supply:
description: Power supply for internal analog circuits.
vdd-p-supply:
description: Power supply for always-on circuits.
vdd-io-supply:
description: Power supply for digital input/output.
vdd-b-supply:
description: Power supply for the boost converter.
required:
- compatible
- reg
- interrupts
- reset-gpios
- vdd-io-supply
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
haptic-driver@34 {
compatible = "cirrus,cs40l50";
reg = <0x34>;
interrupt-parent = <&gpio>;
interrupts = <113 IRQ_TYPE_LEVEL_LOW>;
reset-gpios = <&gpio 112 GPIO_ACTIVE_LOW>;
vdd-io-supply = <&vreg>;
};
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/marvell,88pm886-a1.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Marvell 88PM886 PMIC core
maintainers:
- Karel Balej <balejk@matfyz.cz>
description:
Marvell 88PM886 is a PMIC providing several functions such as onkey,
regulators or battery and charger.
properties:
compatible:
const: marvell,88pm886-a1
reg:
maxItems: 1
interrupts:
maxItems: 1
wakeup-source: true
regulators:
type: object
additionalProperties: false
patternProperties:
"^(ldo(1[0-6]|[1-9])|buck[1-5])$":
type: object
$ref: /schemas/regulator/regulator.yaml#
description: LDO or buck regulator.
unevaluatedProperties: false
required:
- compatible
- reg
- interrupts
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
pmic@30 {
compatible = "marvell,88pm886-a1";
reg = <0x30>;
interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&gic>;
wakeup-source;
regulators {
ldo2: ldo2 {
regulator-min-microvolt = <3100000>;
regulator-max-microvolt = <3300000>;
};
ldo15: ldo15 {
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
buck2: buck2 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
};
};
};
};
...
......@@ -22,8 +22,10 @@ properties:
- mediatek,mt8173-scpsys
- mediatek,mt8183-scpsys
- mediatek,mt8186-scpsys
- mediatek,mt8188-scpsys
- mediatek,mt8192-scpsys
- mediatek,mt8195-scpsys
- mediatek,mt8365-scpsys
- const: syscon
- const: simple-mfd
......
......@@ -17,13 +17,14 @@ A typical MFD can be:
Optional properties:
- compatible : "simple-mfd" - this signifies that the operating system should
consider all subnodes of the MFD device as separate devices akin to how
"simple-bus" indicates when to see subnodes as children for a simple
memory-mapped bus. For more complex devices, when the nexus driver has to
probe registers to figure out what child devices exist etc, this should not
be used. In the latter case the child devices will be determined by the
operating system.
- compatible : "simple-mfd" - this signifies that the operating system
should consider all subnodes of the MFD device as separate and independent
devices, so not needing any resources to be provided by the parent device.
Similarly to how "simple-bus" indicates when to see subnodes as children for
a simple memory-mapped bus.
For more complex devices, when the nexus driver has to probe registers to
figure out what child devices exist etc, this should not be used. In the
latter case the child devices will be determined by the operating system.
- ranges: Describes the address mapping relationship to the parent. Should set
the child's base address to 0, the physical address within parent's address
......
......@@ -19,110 +19,136 @@ properties:
const: qcom,pm8008
reg:
description:
I2C slave address.
maxItems: 1
interrupts:
maxItems: 1
description: Parent interrupt.
reset-gpios:
maxItems: 1
vdd-l1-l2-supply: true
vdd-l3-l4-supply: true
vdd-l5-supply: true
vdd-l6-supply: true
vdd-l7-supply: true
"#interrupt-cells":
gpio-controller: true
"#gpio-cells":
const: 2
description: |
The first cell is the IRQ number, the second cell is the IRQ trigger
flag. All interrupts are listed in include/dt-bindings/mfd/qcom-pm8008.h.
gpio-ranges:
maxItems: 1
interrupt-controller: true
"#address-cells":
const: 1
"#interrupt-cells":
const: 2
"#size-cells":
"#thermal-sensor-cells":
const: 0
patternProperties:
"^gpio@[0-9a-f]+$":
pinctrl:
type: object
additionalProperties: false
patternProperties:
"-state$":
type: object
description: |
The GPIO peripheral. This node may be specified twice, one for each GPIO.
properties:
compatible:
items:
- const: qcom,pm8008-gpio
- const: qcom,spmi-gpio
reg:
description: Peripheral address of one of the two GPIO peripherals.
maxItems: 1
gpio-controller: true
gpio-ranges:
maxItems: 1
allOf:
- $ref: /schemas/pinctrl/pinmux-node.yaml
- $ref: /schemas/pinctrl/pincfg-node.yaml
interrupt-controller: true
properties:
pins:
items:
pattern: "^gpio[12]$"
"#interrupt-cells":
const: 2
function:
items:
- enum:
- normal
"#gpio-cells":
const: 2
required:
- pins
- function
required:
- compatible
- reg
- gpio-controller
- interrupt-controller
- "#gpio-cells"
- gpio-ranges
- "#interrupt-cells"
additionalProperties: false
regulators:
type: object
additionalProperties: false
patternProperties:
"^ldo[1-7]$":
type: object
$ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
required:
- compatible
- reg
- interrupts
- "#address-cells"
- "#size-cells"
- vdd-l1-l2-supply
- vdd-l3-l4-supply
- vdd-l5-supply
- vdd-l6-supply
- vdd-l7-supply
- gpio-controller
- "#gpio-cells"
- gpio-ranges
- interrupt-controller
- "#interrupt-cells"
- "#thermal-sensor-cells"
additionalProperties: false
examples:
- |
#include <dt-bindings/mfd/qcom-pm8008.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
pmic@8 {
pm8008: pmic@8 {
compatible = "qcom,pm8008";
reg = <0x8>;
#address-cells = <1>;
#size-cells = <0>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&tlmm>;
interrupts = <32 IRQ_TYPE_EDGE_RISING>;
pm8008_gpios: gpio@c000 {
compatible = "qcom,pm8008-gpio", "qcom,spmi-gpio";
reg = <0xc000>;
gpio-controller;
gpio-ranges = <&pm8008_gpios 0 0 2>;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
reset-gpios = <&tlmm 42 GPIO_ACTIVE_LOW>;
vdd-l1-l2-supply = <&vreg_s8b_1p2>;
vdd-l3-l4-supply = <&vreg_s1b_1p8>;
vdd-l5-supply = <&vreg_bob>;
vdd-l6-supply = <&vreg_bob>;
vdd-l7-supply = <&vreg_bob>;
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&pm8008 0 0 2>;
interrupt-controller;
#interrupt-cells = <2>;
#thermal-sensor-cells = <0>;
pinctrl {
gpio-keys-state {
pins = "gpio1";
function = "normal";
};
};
regulators {
ldo1 {
regulator-name = "vreg_l1";
regulator-min-microvolt = <950000>;
regulator-max-microvolt = <1300000>;
};
};
};
};
......
......@@ -75,6 +75,7 @@ properties:
- qcom,pma8084
- qcom,pmc8180
- qcom,pmc8180c
- qcom,pmc8380
- qcom,pmd9635
- qcom,pmi632
- qcom,pmi8950
......@@ -95,6 +96,7 @@ properties:
- qcom,pmx65
- qcom,pmx75
- qcom,smb2351
- qcom,smb2360
- const: qcom,spmi-pmic
reg:
......
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/rockchip,rk809.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: RK809 Power Management Integrated Circuit
maintainers:
- Chris Zhong <zyw@rock-chips.com>
- Zhang Qing <zhangqing@rock-chips.com>
description: |
Rockchip RK809 series PMIC. This device consists of an i2c controlled MFD
that includes regulators, an RTC, and power button.
properties:
compatible:
enum:
- rockchip,rk809
reg:
maxItems: 1
interrupts:
maxItems: 1
'#clock-cells':
description: |
See <dt-bindings/clock/rockchip,rk808.h> for clock IDs.
minimum: 0
maximum: 1
clock-output-names:
description:
From common clock binding to override the default output clock name.
rockchip,system-power-controller:
type: boolean
deprecated: true
description:
Telling whether or not this PMIC is controlling the system power.
system-power-controller: true
wakeup-source:
type: boolean
description:
Device can be used as a wakeup source.
vcc1-supply:
description:
The input supply for DCDC_REG1.
vcc2-supply:
description:
The input supply for DCDC_REG2.
vcc3-supply:
description:
The input supply for DCDC_REG3.
vcc4-supply:
description:
The input supply for DCDC_REG4.
vcc5-supply:
description:
The input supply for LDO_REG1, LDO_REG2, and LDO_REG3.
vcc6-supply:
description:
The input supply for LDO_REG4, LDO_REG5, and LDO_REG6.
vcc7-supply:
description:
The input supply for LDO_REG7, LDO_REG8, and LDO_REG9.
vcc8-supply:
description:
The input supply for SWITCH_REG1.
vcc9-supply:
description:
The input supply for DCDC_REG5 and SWITCH_REG2.
regulators:
type: object
patternProperties:
"^(LDO_REG[1-9]|DCDC_REG[1-5]|SWITCH_REG[1-2])$":
type: object
$ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
unevaluatedProperties: false
allOf:
- if:
properties:
'#clock-cells':
const: 0
then:
properties:
clock-output-names:
maxItems: 1
else:
properties:
clock-output-names:
maxItems: 2
required:
- compatible
- reg
- interrupts
- "#clock-cells"
additionalProperties: false
examples:
- |
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
rk808: pmic@1b {
compatible = "rockchip,rk808";
reg = <0x1b>;
#clock-cells = <1>;
clock-output-names = "xin32k", "rk808-clkout2";
interrupt-parent = <&gpio3>;
interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pmic_int_l_pin>;
rockchip,system-power-controller;
wakeup-source;
vcc1-supply = <&vcc_sysin>;
vcc2-supply = <&vcc_sysin>;
vcc3-supply = <&vcc_sysin>;
vcc4-supply = <&vcc_sysin>;
vcc6-supply = <&vcc_sysin>;
vcc7-supply = <&vcc_sysin>;
vcc8-supply = <&vcc3v3_sys>;
vcc9-supply = <&vcc_sysin>;
vcc10-supply = <&vcc_sysin>;
vcc11-supply = <&vcc_sysin>;
vcc12-supply = <&vcc3v3_sys>;
regulators {
vdd_center: DCDC_REG1 {
regulator-name = "vdd_center";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <750000>;
regulator-max-microvolt = <1350000>;
regulator-ramp-delay = <6001>;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vdd_cpu_l: DCDC_REG2 {
regulator-name = "vdd_cpu_l";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <750000>;
regulator-max-microvolt = <1350000>;
regulator-ramp-delay = <6001>;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vcc_ddr: DCDC_REG3 {
regulator-name = "vcc_ddr";
regulator-always-on;
regulator-boot-on;
regulator-state-mem {
regulator-on-in-suspend;
};
};
vcc_1v8: vcc_wl: DCDC_REG4 {
regulator-name = "vcc_1v8";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1800000>;
};
};
vcc1v8_pmupll: LDO_REG3 {
regulator-name = "vcc1v8_pmupll";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1800000>;
};
};
vcc_sdio: LDO_REG4 {
regulator-name = "vcc_sdio";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3000000>;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3000000>;
};
};
vcca3v0_codec: LDO_REG5 {
regulator-name = "vcca3v0_codec";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vcc_1v5: LDO_REG6 {
regulator-name = "vcc_1v5";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <1500000>;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1500000>;
};
};
vcca1v8_codec: LDO_REG7 {
regulator-name = "vcca1v8_codec";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vcc_3v0: LDO_REG8 {
regulator-name = "vcc_3v0";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3000000>;
};
};
vcc3v3_s3: SWITCH_REG1 {
regulator-name = "vcc3v3_s3";
regulator-always-on;
regulator-boot-on;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vcc3v3_s0: SWITCH_REG2 {
regulator-name = "vcc3v3_s0";
regulator-always-on;
regulator-boot-on;
regulator-state-mem {
regulator-off-in-suspend;
};
};
};
};
};
......@@ -4,20 +4,21 @@
$id: http://devicetree.org/schemas/mfd/rockchip,rk817.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: RK817 Power Management Integrated Circuit
title: RK809/RK817 Power Management Integrated Circuit
maintainers:
- Chris Zhong <zyw@rock-chips.com>
- Zhang Qing <zhangqing@rock-chips.com>
description: |
Rockchip RK817 series PMIC. This device consists of an i2c controlled MFD
that includes regulators, an RTC, a power button, an audio codec, and a
battery charger manager.
Rockchip RK809/RK817 series PMIC. This device consists of an i2c controlled
MFD that includes regulators, an RTC, a power button and an audio codec.
The RK817 variant also provides a battery charger manager.
properties:
compatible:
enum:
- rockchip,rk809
- rockchip,rk817
reg:
......@@ -32,6 +33,13 @@ properties:
minimum: 0
maximum: 1
clocks:
maxItems: 1
clock-names:
items:
- const: mclk
clock-output-names:
description:
From common clock binding to override the default output clock name.
......@@ -42,6 +50,9 @@ properties:
description:
Telling whether or not this PMIC is controlling the system power.
'#sound-dai-cells':
const: 0
system-power-controller: true
wakeup-source:
......@@ -79,41 +90,22 @@ properties:
vcc8-supply:
description:
The input supply for BOOST.
The input supply for BOOST on RK817, or for SWITCH_REG2 on RK809.
vcc9-supply:
description:
The input supply for OTG_SWITCH.
The input supply for OTG_SWITCH on RK817,
or for DCDC_REG5 and SWITCH_REG1 on RK809.
regulators:
type: object
patternProperties:
"^(LDO_REG[1-9]|DCDC_REG[1-4]|BOOST|OTG_SWITCH)$":
type: object
"^(LDO_REG[1-9]|DCDC_REG[1-5]|BOOST|OTG_SWITCH|SWITCH_REG[1-2])$":
$ref: /schemas/regulator/regulator.yaml
unevaluatedProperties: false
$ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
clocks:
description:
The input clock for the audio codec.
clock-names:
description:
The clock name for the codec clock.
items:
- const: mclk
'#sound-dai-cells':
description:
Needed for the interpretation of sound dais.
const: 0
additionalProperties: false
codec:
description: |
The child node for the codec to hold additional properties. If no
additional properties are required for the codec, this node can be
omitted.
type: object
additionalProperties: false
properties:
......@@ -123,9 +115,6 @@ properties:
Describes if the microphone uses differential mode.
charger:
description: |
The child node for the charger to hold additional properties. If a
battery is not in use, this node can be omitted.
type: object
$ref: /schemas/power/supply/power-supply.yaml
......@@ -168,6 +157,7 @@ properties:
additionalProperties: false
allOf:
- $ref: /schemas/sound/dai-common.yaml#
- if:
properties:
'#clock-cells':
......@@ -183,6 +173,22 @@ allOf:
clock-output-names:
maxItems: 2
- if:
properties:
compatible:
contains:
const: rockchip,rk817
then:
properties:
regulators:
patternProperties:
"^(DCDC_REG5|SWITCH_REG[1-2])$": false
else:
properties:
regulators:
patternProperties:
"^(BOOST|OTG_SWITCH)$": false
required:
- compatible
- reg
......
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/rohm,bd96801-pmic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ROHM BD96801 Scalable Power Management Integrated Circuit
maintainers:
- Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
description:
BD96801 is an automotive grade single-chip power management IC.
It integrates 4 buck converters and 3 LDOs with safety features like
over-/under voltage and over current detection and a watchdog.
properties:
compatible:
const: rohm,bd96801
reg:
maxItems: 1
interrupts:
description:
The PMIC provides intb and errb IRQ lines. The errb IRQ line is used
for fatal IRQs which will cause the PMIC to shut down power outputs.
In many systems this will shut down the SoC contolling the PMIC and
connecting/handling the errb can be omitted. However, there are cases
where the SoC is not powered by the PMIC or has a short time backup
energy to handle shutdown of critical hardware. In that case it may be
useful to connect the errb and handle errb events.
minItems: 1
maxItems: 2
interrupt-names:
minItems: 1
items:
- enum: [intb, errb]
- const: errb
rohm,hw-timeout-ms:
description:
Watchdog timeout value(s). First walue is timeout limit. Second value is
optional value for 'too early' watchdog ping if window timeout mode is
to be used.
minItems: 1
maxItems: 2
rohm,wdg-action:
description:
Whether the watchdog failure must turn off the regulator power outputs or
just toggle the INTB line.
enum:
- prstb
- intb-only
timeout-sec:
maxItems: 2
regulators:
$ref: /schemas/regulator/rohm,bd96801-regulator.yaml
description:
List of child nodes that specify the regulators.
required:
- compatible
- reg
- interrupts
- interrupt-names
- regulators
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
pmic: pmic@60 {
reg = <0x60>;
compatible = "rohm,bd96801";
interrupt-parent = <&gpio1>;
interrupts = <29 IRQ_TYPE_LEVEL_LOW>, <6 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "intb", "errb";
regulators {
buck1 {
regulator-name = "buck1";
regulator-ramp-delay = <1250>;
/* 0.5V min INITIAL - 150 mV tune */
regulator-min-microvolt = <350000>;
/* 3.3V + 150mV tune */
regulator-max-microvolt = <3450000>;
/* These can be set only when PMIC is in STBY */
rohm,initial-voltage-microvolt = <500000>;
regulator-ov-error-microvolt = <230000>;
regulator-uv-error-microvolt = <230000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-warn-kelvin = <0>;
};
buck2 {
regulator-name = "buck2";
regulator-min-microvolt = <350000>;
regulator-max-microvolt = <3450000>;
rohm,initial-voltage-microvolt = <3000000>;
regulator-ov-error-microvolt = <18000>;
regulator-uv-error-microvolt = <18000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-warn-kelvin = <1>;
};
buck3 {
regulator-name = "buck3";
regulator-min-microvolt = <350000>;
regulator-max-microvolt = <3450000>;
rohm,initial-voltage-microvolt = <600000>;
regulator-ov-warn-microvolt = <18000>;
regulator-uv-warn-microvolt = <18000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-error-kelvin = <0>;
};
buck4 {
regulator-name = "buck4";
regulator-min-microvolt = <350000>;
regulator-max-microvolt = <3450000>;
rohm,initial-voltage-microvolt = <600000>;
regulator-ov-warn-microvolt = <18000>;
regulator-uv-warn-microvolt = <18000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-error-kelvin = <0>;
};
ldo5 {
regulator-name = "ldo5";
regulator-min-microvolt = <300000>;
regulator-max-microvolt = <3300000>;
rohm,initial-voltage-microvolt = <500000>;
regulator-ov-error-microvolt = <36000>;
regulator-uv-error-microvolt = <34000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-warn-kelvin = <0>;
};
ldo6 {
regulator-name = "ldo6";
regulator-min-microvolt = <300000>;
regulator-max-microvolt = <3300000>;
rohm,initial-voltage-microvolt = <300000>;
regulator-ov-error-microvolt = <36000>;
regulator-uv-error-microvolt = <34000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-warn-kelvin = <0>;
};
ldo7 {
regulator-name = "ldo7";
regulator-min-microvolt = <300000>;
regulator-max-microvolt = <3300000>;
rohm,initial-voltage-microvolt = <500000>;
regulator-ov-error-microvolt = <36000>;
regulator-uv-error-microvolt = <34000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-warn-kelvin = <0>;
};
};
};
};
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/syscon-common.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: System Controller Registers R/W Common Properties
description:
System controller node represents a register region containing a set
of miscellaneous registers. The registers are not cohesive enough to
represent as any specific type of device. The typical use-case is
for some other node's driver, or platform-specific code, to acquire
a reference to the syscon node (e.g. by phandle, node path, or
search using a specific compatible value), interrogate the node (or
associated OS driver) to determine the location of the registers,
and access the registers directly.
maintainers:
- Lee Jones <lee@kernel.org>
select:
properties:
compatible:
contains:
const: syscon
required:
- compatible
properties:
compatible:
contains:
const: syscon
minItems: 2
maxItems: 5 # Should be enough
reg:
maxItems: 1
reg-io-width:
description:
The size (in bytes) of the IO accesses that should be performed
on the device.
enum: [1, 2, 4, 8]
required:
- compatible
- reg
allOf:
- if:
properties:
compatible:
contains:
const: simple-mfd
then:
properties:
compatible:
minItems: 3
maxItems: 5
additionalProperties: true
examples:
- |
syscon: syscon@1c00000 {
compatible = "allwinner,sun8i-h3-system-controller", "syscon";
reg = <0x01c00000 0x1000>;
};
...
......@@ -25,23 +25,6 @@ Example:
reg = <0x71070000 0x1c>;
};
o CPU system control:
The SoC has a few registers (ICPU_CFG:CPU_SYSTEM_CTRL) handling configuration of
the CPU: 8 general purpose registers, reset control, CPU en/disabling, CPU
endianness, CPU bus control, CPU status.
Required properties:
- compatible: Should be "mscc,ocelot-cpu-syscon", "syscon"
- reg : Should contain registers location and length
Example:
syscon@70000000 {
compatible = "mscc,ocelot-cpu-syscon", "syscon";
reg = <0x70000000 0x2c>;
};
o HSIO regs:
The SoC has a few registers (HSIO) handling miscellaneous functionalities:
......
......@@ -60,15 +60,6 @@ Required properties:
- reg: should contain 2 register ranges. The first one is pointing to the PMECC
block, and the second one to the PMECC_ERRLOC block.
* SAMA5 NFC I/O bindings:
SAMA5 SoCs embed an advanced NAND controller logic to automate READ/WRITE page
operations. This interface to this logic is placed in a separate I/O range and
should thus have its own DT node.
- compatible: should be "atmel,sama5d3-nfc-io", "syscon".
- reg: should contain the I/O range used to interact with the NFC logic.
Example:
nfc_io: nfc-io@70000000 {
......
......@@ -19,16 +19,6 @@ Optional properties:
[1] Documentation/devicetree/bindings/net/ethernet.txt
* Ethernet ppe node:
Control rx & tx fifos of all ethernet controllers.
Have 2048 recv channels shared by all ethernet controllers, only if no overlap.
Each controller's recv channel start from channel * number (RX_DESC_NUM).
Required properties:
- compatible: "hisilicon,hip04-ppe", "syscon".
- reg: address and length of the register set for the device.
* MDIO bus node:
Required properties:
......
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/rohm,bd96801-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ROHM BD96801 Power Management Integrated Circuit regulators
maintainers:
- Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
description:
This module is part of the ROHM BD96801 MFD device. For more details
see Documentation/devicetree/bindings/mfd/rohm,bd96801-pmic.yaml.
The regulator controller is represented as a sub-node of the PMIC node
on the device tree.
Regulator nodes should be named to buck_<number> and ldo_<number>.
The valid names for BD96801 regulator nodes are
buck1, buck2, buck3, buck4, ldo5, ldo6, ldo7
patternProperties:
"^ldo[5-7]$":
type: object
description:
Properties for single LDO regulator.
$ref: regulator.yaml#
properties:
rohm,initial-voltage-microvolt:
description:
Initial voltage for regulator. Voltage can be tuned +/-150 mV from
this value. NOTE, This can be modified via I2C only when PMIC is in
STBY state.
minimum: 300000
maximum: 3300000
unevaluatedProperties: false
"^buck[1-4]$":
type: object
description:
Properties for single BUCK regulator.
$ref: regulator.yaml#
properties:
rohm,initial-voltage-microvolt:
description:
Initial voltage for regulator. Voltage can be tuned +/-150 mV from
this value. NOTE, This can be modified via I2C only when PMIC is in
STBY state.
minimum: 500000
maximum: 3300000
rohm,keep-on-stby:
description:
Keep the regulator powered when PMIC transitions to STBY state.
type: boolean
unevaluatedProperties: false
additionalProperties: false
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/soc/intel/intel,lgm-syscon.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Intel Lightning Mountain(LGM) Syscon
maintainers:
- Chuanhua Lei <lchuanhua@maxlinear.com>
- Rahul Tanwar <rtanwar@maxlinear.com>
properties:
compatible:
items:
- const: intel,lgm-syscon
- const: syscon
reg:
maxItems: 1
ranges: true
"#address-cells":
const: 1
"#size-cells":
const: 1
patternProperties:
"^emmc-phy@[0-9a-f]+$":
$ref: /schemas/phy/intel,lgm-emmc-phy.yaml#
required:
- compatible
- reg
- "#address-cells"
- "#size-cells"
additionalProperties: false
examples:
- |
chiptop@e0200000 {
compatible = "intel,lgm-syscon", "syscon";
reg = <0xe0200000 0x100>;
ranges = <0x0 0xe0200000 0x100>;
#address-cells = <1>;
#size-cells = <1>;
emmc-phy@a8 {
compatible = "intel,lgm-emmc-phy";
reg = <0x00a8 0x10>;
clocks = <&emmc>;
#phy-cells = <0>;
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/soc/microchip/microchip,sparx5-cpu-syscon.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microchip Sparx5 CPU Syscon
maintainers:
- Lars Povlsen <lars.povlsen@microchip.com>
properties:
compatible:
items:
- const: microchip,sparx5-cpu-syscon
- const: syscon
- const: simple-mfd
reg:
maxItems: 1
mux-controller:
$ref: /schemas/mux/reg-mux.yaml#
required:
- compatible
- reg
- mux-controller
additionalProperties: false
examples:
- |
soc {
#address-cells = <2>;
#size-cells = <1>;
syscon@600000000 {
compatible = "microchip,sparx5-cpu-syscon", "syscon",
"simple-mfd";
reg = <0x6 0x00000000 0xd0>;
mux: mux-controller {
compatible = "mmio-mux";
#mux-control-cells = <1>;
mux-reg-masks = <0x88 0xf0>;
};
};
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/soc/sprd/sprd,sc9863a-glbregs.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: SC9863A Syscon
maintainers:
- Orson Zhai <orsonzhai@gmail.com>
- Baolin Wang <baolin.wang7@gmail.com>
- Chunyan Zhang <zhang.lyra@gmail.com>
properties:
compatible:
items:
- const: sprd,sc9863a-glbregs
- const: syscon
- const: simple-mfd
reg:
maxItems: 1
ranges: true
"#address-cells":
const: 1
"#size-cells":
const: 1
patternProperties:
"@[0-9a-f]+$":
$ref: /schemas/clock/sprd,sc9863a-clk.yaml
description: Clock controllers
additionalProperties: false
examples:
- |
syscon@20e00000 {
compatible = "sprd,sc9863a-glbregs", "syscon", "simple-mfd";
reg = <0x20e00000 0x4000>;
ranges = <0 0x20e00000 0x4000>;
#address-cells = <1>;
#size-cells = <1>;
apahb_gate: apahb-gate@0 {
compatible = "sprd,sc9863a-apahb-gate";
reg = <0x0 0x1020>;
#clock-cells = <1>;
};
};
...
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/soc/ti/ti,am654-serdes-ctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Texas Instruments AM654 Serdes Control Syscon
maintainers:
- Nishanth Menon <nm@ti.com>
properties:
compatible:
items:
- const: ti,am654-serdes-ctrl
- const: syscon
reg:
maxItems: 1
mux-controller:
$ref: /schemas/mux/reg-mux.yaml#
required:
- compatible
- reg
- mux-controller
additionalProperties: false
examples:
- |
clock@4080 {
compatible = "ti,am654-serdes-ctrl", "syscon";
reg = <0x4080 0x4>;
mux-controller {
compatible = "mmio-mux";
#mux-control-cells = <1>;
mux-reg-masks = <0x0 0x3>; /* lane select */
};
};
......@@ -5213,6 +5213,11 @@ S: Maintained
F: Documentation/hwmon/cros_ec_hwmon.rst
F: drivers/hwmon/cros_ec_hwmon.c
CHROMEOS EC LED DRIVER
M: Thomas Weißschuh <thomas@weissschuh.net>
S: Maintained
F: drivers/leds/leds-cros_ec.c
CHROMEOS EC SUBDRIVERS
M: Benson Leung <bleung@chromium.org>
R: Guenter Roeck <groeck@chromium.org>
......@@ -5284,6 +5289,18 @@ F: sound/pci/hda/hda_component*
F: sound/pci/hda/hda_cs_dsp_ctl.*
F: sound/soc/codecs/cs*
CIRRUS LOGIC HAPTIC DRIVERS
M: James Ogletree <jogletre@opensource.cirrus.com>
M: Fred Treven <fred.treven@cirrus.com>
M: Ben Bright <ben.bright@cirrus.com>
L: patches@opensource.cirrus.com
S: Supported
F: Documentation/devicetree/bindings/input/cirrus,cs40l50.yaml
F: drivers/input/misc/cs40l*
F: drivers/mfd/cs40l*
F: include/linux/mfd/cs40l*
F: sound/soc/codecs/cs40l*
CIRRUS LOGIC DSP FIRMWARE DRIVER
M: Simon Trimmer <simont@opensource.cirrus.com>
M: Charles Keepax <ckeepax@opensource.cirrus.com>
......@@ -13387,6 +13404,15 @@ F: drivers/net/dsa/mv88e6xxx/
F: include/linux/dsa/mv88e6xxx.h
F: include/linux/platform_data/mv88e6xxx.h
MARVELL 88PM886 PMIC DRIVER
M: Karel Balej <balejk@matfyz.cz>
S: Maintained
F: Documentation/devicetree/bindings/mfd/marvell,88pm886-a1.yaml
F: drivers/input/misc/88pm886-onkey.c
F: drivers/mfd/88pm886.c
F: drivers/regulators/88pm886-regulator.c
F: include/linux/mfd/88pm886.h
MARVELL ARMADA 3700 PHY DRIVERS
M: Miquel Raynal <miquel.raynal@bootlin.com>
S: Maintained
......@@ -19607,17 +19633,21 @@ F: drivers/gpio/gpio-bd71828.c
F: drivers/mfd/rohm-bd71828.c
F: drivers/mfd/rohm-bd718x7.c
F: drivers/mfd/rohm-bd9576.c
F: drivers/mfd/rohm-bd96801.c
F: drivers/regulator/bd71815-regulator.c
F: drivers/regulator/bd71828-regulator.c
F: drivers/regulator/bd718x7-regulator.c
F: drivers/regulator/bd9576-regulator.c
F: drivers/regulator/bd96801-regulator.c
F: drivers/regulator/rohm-regulator.c
F: drivers/rtc/rtc-bd70528.c
F: drivers/watchdog/bd9576_wdt.c
F: drivers/watchdog/bd96801_wdt.c
F: include/linux/mfd/rohm-bd71815.h
F: include/linux/mfd/rohm-bd71828.h
F: include/linux/mfd/rohm-bd718x7.h
F: include/linux/mfd/rohm-bd957x.h
F: include/linux/mfd/rohm-bd96801.h
F: include/linux/mfd/rohm-generic.h
F: include/linux/mfd/rohm-shared.h
......@@ -22822,7 +22852,7 @@ L: linux-renesas-soc@vger.kernel.org
S: Supported
F: drivers/mmc/host/renesas_sdhi*
F: drivers/mmc/host/tmio_mmc*
F: include/linux/mfd/tmio.h
F: include/linux/platform_data/tmio.h
TMP513 HARDWARE MONITOR DRIVER
M: Eric Tremblay <etremblay@distech-controls.com>
......
......@@ -14,9 +14,9 @@
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
#include <linux/io.h>
#include <linux/mfd/tmio.h>
#include <linux/mmc/host.h>
#include <linux/platform_data/sh_mmcif.h>
#include <linux/platform_data/tmio.h>
#include <linux/sh_eth.h>
#include <linux/sh_intc.h>
#include <linux/usb/renesas_usbhs.h>
......
......@@ -24,10 +24,10 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/memblock.h>
#include <linux/mfd/tmio.h>
#include <linux/mmc/host.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/sh_flctl.h>
#include <linux/platform_data/tmio.h>
#include <linux/platform_device.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
......
......@@ -17,13 +17,13 @@
#include <linux/input/sh_keysc.h>
#include <linux/interrupt.h>
#include <linux/memblock.h>
#include <linux/mfd/tmio.h>
#include <linux/mmc/host.h>
#include <linux/platform_data/sh_mmcif.h>
#include <linux/mtd/physmap.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/platform_data/gpio_backlight.h>
#include <linux/platform_data/tmio.h>
#include <linux/platform_data/tsc2007.h>
#include <linux/platform_device.h>
#include <linux/regulator/fixed.h>
......
......@@ -22,10 +22,10 @@
#include <linux/input/sh_keysc.h>
#include <linux/interrupt.h>
#include <linux/memblock.h>
#include <linux/mfd/tmio.h>
#include <linux/mmc/host.h>
#include <linux/mtd/physmap.h>
#include <linux/platform_data/lv5207lp.h>
#include <linux/platform_data/tmio.h>
#include <linux/platform_device.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
......
......@@ -7,6 +7,7 @@
#include <linux/clkdev.h>
#include <linux/dma-map-ops.h>
#include <linux/init.h>
#include <linux/platform_data/tmio.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/input.h>
......@@ -14,7 +15,6 @@
#include <linux/memblock.h>
#include <linux/mmc/host.h>
#include <linux/mtd/physmap.h>
#include <linux/mfd/tmio.h>
#include <linux/mtd/platnand.h>
#include <linux/i2c.h>
#include <linux/regulator/fixed.h>
......
......@@ -21,9 +21,9 @@
#include <linux/input/sh_keysc.h>
#include <linux/interrupt.h>
#include <linux/memblock.h>
#include <linux/mfd/tmio.h>
#include <linux/mmc/host.h>
#include <linux/mtd/physmap.h>
#include <linux/platform_data/tmio.h>
#include <linux/platform_device.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
......
......@@ -275,6 +275,12 @@
#define HALO_MPU_VIO_ERR_SRC_MASK 0x00007fff
#define HALO_MPU_VIO_ERR_SRC_SHIFT 0
/*
* Write Sequence
*/
#define WSEQ_OP_MAX_WORDS 3
#define WSEQ_END_OF_SCRIPT 0xFFFFFF
struct cs_dsp_ops {
bool (*validate_version)(struct cs_dsp *dsp, unsigned int version);
unsigned int (*parse_sizes)(struct cs_dsp *dsp,
......@@ -3495,6 +3501,278 @@ int cs_dsp_chunk_read(struct cs_dsp_chunk *ch, int nbits)
}
EXPORT_SYMBOL_NS_GPL(cs_dsp_chunk_read, FW_CS_DSP);
struct cs_dsp_wseq_op {
struct list_head list;
u32 address;
u32 data;
u16 offset;
u8 operation;
};
static void cs_dsp_wseq_clear(struct cs_dsp *dsp, struct cs_dsp_wseq *wseq)
{
struct cs_dsp_wseq_op *op, *op_tmp;
list_for_each_entry_safe(op, op_tmp, &wseq->ops, list) {
list_del(&op->list);
devm_kfree(dsp->dev, op);
}
}
static int cs_dsp_populate_wseq(struct cs_dsp *dsp, struct cs_dsp_wseq *wseq)
{
struct cs_dsp_wseq_op *op = NULL;
struct cs_dsp_chunk chunk;
u8 *words;
int ret;
if (!wseq->ctl) {
cs_dsp_err(dsp, "No control for write sequence\n");
return -EINVAL;
}
words = kzalloc(wseq->ctl->len, GFP_KERNEL);
if (!words)
return -ENOMEM;
ret = cs_dsp_coeff_read_ctrl(wseq->ctl, 0, words, wseq->ctl->len);
if (ret) {
cs_dsp_err(dsp, "Failed to read %s: %d\n", wseq->ctl->subname, ret);
goto err_free;
}
INIT_LIST_HEAD(&wseq->ops);
chunk = cs_dsp_chunk(words, wseq->ctl->len);
while (!cs_dsp_chunk_end(&chunk)) {
op = devm_kzalloc(dsp->dev, sizeof(*op), GFP_KERNEL);
if (!op) {
ret = -ENOMEM;
goto err_free;
}
op->offset = cs_dsp_chunk_bytes(&chunk);
op->operation = cs_dsp_chunk_read(&chunk, 8);
switch (op->operation) {
case CS_DSP_WSEQ_END:
op->data = WSEQ_END_OF_SCRIPT;
break;
case CS_DSP_WSEQ_UNLOCK:
op->data = cs_dsp_chunk_read(&chunk, 16);
break;
case CS_DSP_WSEQ_ADDR8:
op->address = cs_dsp_chunk_read(&chunk, 8);
op->data = cs_dsp_chunk_read(&chunk, 32);
break;
case CS_DSP_WSEQ_H16:
case CS_DSP_WSEQ_L16:
op->address = cs_dsp_chunk_read(&chunk, 24);
op->data = cs_dsp_chunk_read(&chunk, 16);
break;
case CS_DSP_WSEQ_FULL:
op->address = cs_dsp_chunk_read(&chunk, 32);
op->data = cs_dsp_chunk_read(&chunk, 32);
break;
default:
ret = -EINVAL;
cs_dsp_err(dsp, "Unsupported op: %X\n", op->operation);
devm_kfree(dsp->dev, op);
goto err_free;
}
list_add_tail(&op->list, &wseq->ops);
if (op->operation == CS_DSP_WSEQ_END)
break;
}
if (op && op->operation != CS_DSP_WSEQ_END) {
cs_dsp_err(dsp, "%s missing end terminator\n", wseq->ctl->subname);
ret = -ENOENT;
}
err_free:
kfree(words);
return ret;
}
/**
* cs_dsp_wseq_init() - Initialize write sequences contained within the loaded DSP firmware
* @dsp: Pointer to DSP structure
* @wseqs: List of write sequences to initialize
* @num_wseqs: Number of write sequences to initialize
*
* Return: Zero for success, a negative number on error.
*/
int cs_dsp_wseq_init(struct cs_dsp *dsp, struct cs_dsp_wseq *wseqs, unsigned int num_wseqs)
{
int i, ret;
lockdep_assert_held(&dsp->pwr_lock);
for (i = 0; i < num_wseqs; i++) {
ret = cs_dsp_populate_wseq(dsp, &wseqs[i]);
if (ret) {
cs_dsp_wseq_clear(dsp, &wseqs[i]);
return ret;
}
}
return 0;
}
EXPORT_SYMBOL_NS_GPL(cs_dsp_wseq_init, FW_CS_DSP);
static struct cs_dsp_wseq_op *cs_dsp_wseq_find_op(u32 addr, u8 op_code,
struct list_head *wseq_ops)
{
struct cs_dsp_wseq_op *op;
list_for_each_entry(op, wseq_ops, list) {
if (op->operation == op_code && op->address == addr)
return op;
}
return NULL;
}
/**
* cs_dsp_wseq_write() - Add or update an entry in a write sequence
* @dsp: Pointer to a DSP structure
* @wseq: Write sequence to write to
* @addr: Address of the register to be written to
* @data: Data to be written
* @op_code: The type of operation of the new entry
* @update: If true, searches for the first entry in the write sequence with
* the same address and op_code, and replaces it. If false, creates a new entry
* at the tail
*
* This function formats register address and value pairs into the format
* required for write sequence entries, and either updates or adds the
* new entry into the write sequence.
*
* If update is set to true and no matching entry is found, it will add a new entry.
*
* Return: Zero for success, a negative number on error.
*/
int cs_dsp_wseq_write(struct cs_dsp *dsp, struct cs_dsp_wseq *wseq,
u32 addr, u32 data, u8 op_code, bool update)
{
struct cs_dsp_wseq_op *op_end, *op_new = NULL;
u32 words[WSEQ_OP_MAX_WORDS];
struct cs_dsp_chunk chunk;
int new_op_size, ret;
if (update)
op_new = cs_dsp_wseq_find_op(addr, op_code, &wseq->ops);
/* If entry to update is not found, treat it as a new operation */
if (!op_new) {
op_end = cs_dsp_wseq_find_op(0, CS_DSP_WSEQ_END, &wseq->ops);
if (!op_end) {
cs_dsp_err(dsp, "Missing terminator for %s\n", wseq->ctl->subname);
return -EINVAL;
}
op_new = devm_kzalloc(dsp->dev, sizeof(*op_new), GFP_KERNEL);
if (!op_new)
return -ENOMEM;
op_new->operation = op_code;
op_new->address = addr;
op_new->offset = op_end->offset;
update = false;
}
op_new->data = data;
chunk = cs_dsp_chunk(words, sizeof(words));
cs_dsp_chunk_write(&chunk, 8, op_new->operation);
switch (op_code) {
case CS_DSP_WSEQ_FULL:
cs_dsp_chunk_write(&chunk, 32, op_new->address);
cs_dsp_chunk_write(&chunk, 32, op_new->data);
break;
case CS_DSP_WSEQ_L16:
case CS_DSP_WSEQ_H16:
cs_dsp_chunk_write(&chunk, 24, op_new->address);
cs_dsp_chunk_write(&chunk, 16, op_new->data);
break;
default:
ret = -EINVAL;
cs_dsp_err(dsp, "Operation %X not supported\n", op_code);
goto op_new_free;
}
new_op_size = cs_dsp_chunk_bytes(&chunk);
if (!update) {
if (wseq->ctl->len - op_end->offset < new_op_size) {
cs_dsp_err(dsp, "Not enough memory in %s for entry\n", wseq->ctl->subname);
ret = -E2BIG;
goto op_new_free;
}
op_end->offset += new_op_size;
ret = cs_dsp_coeff_write_ctrl(wseq->ctl, op_end->offset / sizeof(u32),
&op_end->data, sizeof(u32));
if (ret)
goto op_new_free;
list_add_tail(&op_new->list, &op_end->list);
}
ret = cs_dsp_coeff_write_ctrl(wseq->ctl, op_new->offset / sizeof(u32),
words, new_op_size);
if (ret)
goto op_new_free;
return 0;
op_new_free:
devm_kfree(dsp->dev, op_new);
return ret;
}
EXPORT_SYMBOL_NS_GPL(cs_dsp_wseq_write, FW_CS_DSP);
/**
* cs_dsp_wseq_multi_write() - Add or update multiple entries in a write sequence
* @dsp: Pointer to a DSP structure
* @wseq: Write sequence to write to
* @reg_seq: List of address-data pairs
* @num_regs: Number of address-data pairs
* @op_code: The types of operations of the new entries
* @update: If true, searches for the first entry in the write sequence with
* the same address and op_code, and replaces it. If false, creates a new entry
* at the tail
*
* This function calls cs_dsp_wseq_write() for multiple address-data pairs.
*
* Return: Zero for success, a negative number on error.
*/
int cs_dsp_wseq_multi_write(struct cs_dsp *dsp, struct cs_dsp_wseq *wseq,
const struct reg_sequence *reg_seq, int num_regs,
u8 op_code, bool update)
{
int i, ret;
for (i = 0; i < num_regs; i++) {
ret = cs_dsp_wseq_write(dsp, wseq, reg_seq[i].reg,
reg_seq[i].def, op_code, update);
if (ret)
return ret;
}
return 0;
}
EXPORT_SYMBOL_NS_GPL(cs_dsp_wseq_multi_write, FW_CS_DSP);
MODULE_DESCRIPTION("Cirrus Logic DSP Support");
MODULE_AUTHOR("Simon Trimmer <simont@opensource.cirrus.com>");
MODULE_LICENSE("GPL v2");
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/mfd/88pm886.h>
struct pm886_onkey {
struct input_dev *idev;
struct pm886_chip *chip;
};
static irqreturn_t pm886_onkey_irq_handler(int irq, void *data)
{
struct pm886_onkey *onkey = data;
struct regmap *regmap = onkey->chip->regmap;
struct input_dev *idev = onkey->idev;
struct device *parent = idev->dev.parent;
unsigned int val;
int err;
err = regmap_read(regmap, PM886_REG_STATUS1, &val);
if (err) {
dev_err(parent, "Failed to read status: %d\n", err);
return IRQ_NONE;
}
val &= PM886_ONKEY_STS1;
input_report_key(idev, KEY_POWER, val);
input_sync(idev);
return IRQ_HANDLED;
}
static int pm886_onkey_probe(struct platform_device *pdev)
{
struct pm886_chip *chip = dev_get_drvdata(pdev->dev.parent);
struct device *dev = &pdev->dev;
struct pm886_onkey *onkey;
struct input_dev *idev;
int irq, err;
onkey = devm_kzalloc(dev, sizeof(*onkey), GFP_KERNEL);
if (!onkey)
return -ENOMEM;
onkey->chip = chip;
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return dev_err_probe(dev, irq, "Failed to get IRQ\n");
idev = devm_input_allocate_device(dev);
if (!idev) {
dev_err(dev, "Failed to allocate input device\n");
return -ENOMEM;
}
onkey->idev = idev;
idev->name = "88pm886-onkey";
idev->phys = "88pm886-onkey/input0";
idev->id.bustype = BUS_I2C;
input_set_capability(idev, EV_KEY, KEY_POWER);
err = devm_request_threaded_irq(dev, irq, NULL, pm886_onkey_irq_handler,
IRQF_ONESHOT | IRQF_NO_SUSPEND, "onkey",
onkey);
if (err)
return dev_err_probe(dev, err, "Failed to request IRQ\n");
err = input_register_device(idev);
if (err)
return dev_err_probe(dev, err, "Failed to register input device\n");
return 0;
}
static const struct platform_device_id pm886_onkey_id_table[] = {
{ "88pm886-onkey", },
{ }
};
MODULE_DEVICE_TABLE(platform, pm886_onkey_id_table);
static struct platform_driver pm886_onkey_driver = {
.driver = {
.name = "88pm886-onkey",
},
.probe = pm886_onkey_probe,
.id_table = pm886_onkey_id_table,
};
module_platform_driver(pm886_onkey_driver);
MODULE_DESCRIPTION("Marvell 88PM886 onkey driver");
MODULE_AUTHOR("Karel Balej <balejk@matfyz.cz>");
MODULE_LICENSE("GPL");
......@@ -33,6 +33,13 @@ config INPUT_88PM80X_ONKEY
To compile this driver as a module, choose M here: the module
will be called 88pm80x_onkey.
config INPUT_88PM886_ONKEY
tristate "Marvell 88PM886 onkey support"
depends on MFD_88PM886_PMIC
help
Support the onkey of Marvell 88PM886 PMIC as an input device
reporting power button status.
config INPUT_AB8500_PONKEY
tristate "AB8500 Pon (PowerOn) Key"
depends on AB8500_CORE
......@@ -140,6 +147,16 @@ config INPUT_BMA150
To compile this driver as a module, choose M here: the
module will be called bma150.
config INPUT_CS40L50_VIBRA
tristate "CS40L50 Haptic Driver support"
depends on MFD_CS40L50_CORE
help
Say Y here to enable support for Cirrus Logic's CS40L50
haptic driver.
To compile this driver as a module, choose M here: the
module will be called cs40l50-vibra.
config INPUT_E3X0_BUTTON
tristate "NI Ettus Research USRP E3xx Button support."
default n
......
......@@ -7,6 +7,7 @@
obj-$(CONFIG_INPUT_88PM860X_ONKEY) += 88pm860x_onkey.o
obj-$(CONFIG_INPUT_88PM80X_ONKEY) += 88pm80x_onkey.o
obj-$(CONFIG_INPUT_88PM886_ONKEY) += 88pm886-onkey.o
obj-$(CONFIG_INPUT_AB8500_PONKEY) += ab8500-ponkey.o
obj-$(CONFIG_INPUT_AD714X) += ad714x.o
obj-$(CONFIG_INPUT_AD714X_I2C) += ad714x-i2c.o
......@@ -28,6 +29,7 @@ obj-$(CONFIG_INPUT_CMA3000) += cma3000_d0x.o
obj-$(CONFIG_INPUT_CMA3000_I2C) += cma3000_d0x_i2c.o
obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o
obj-$(CONFIG_INPUT_CPCAP_PWRBUTTON) += cpcap-pwrbutton.o
obj-$(CONFIG_INPUT_CS40L50_VIBRA) += cs40l50-vibra.o
obj-$(CONFIG_INPUT_DA7280_HAPTICS) += da7280.o
obj-$(CONFIG_INPUT_DA9052_ONKEY) += da9052_onkey.o
obj-$(CONFIG_INPUT_DA9055_ONKEY) += da9055_onkey.o
......
This diff is collapsed.
......@@ -179,6 +179,21 @@ config LEDS_CR0014114
To compile this driver as a module, choose M here: the module
will be called leds-cr0014114.
config LEDS_CROS_EC
tristate "LED Support for ChromeOS EC"
depends on MFD_CROS_EC_DEV
depends on LEDS_CLASS_MULTICOLOR
select LEDS_TRIGGERS
default MFD_CROS_EC_DEV
help
This option enables support for LEDs managed by ChromeOS ECs.
All LEDs exposed by the EC are supported in multicolor mode.
A hardware trigger to switch back to the automatic behaviour is
provided.
To compile this driver as a module, choose M here: the module
will be called leds-cros_ec.
config LEDS_EL15203000
tristate "LED Support for Crane EL15203000"
depends on LEDS_CLASS
......
......@@ -26,6 +26,7 @@ obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o
obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
obj-$(CONFIG_LEDS_CPCAP) += leds-cpcap.o
obj-$(CONFIG_LEDS_CROS_EC) += leds-cros_ec.o
obj-$(CONFIG_LEDS_DA903X) += leds-da903x.o
obj-$(CONFIG_LEDS_DA9052) += leds-da9052.o
obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
......
......@@ -101,7 +101,7 @@ static ssize_t multi_index_show(struct device *dev,
for (i = 0; i < mcled_cdev->num_colors; i++) {
index = mcled_cdev->subled_info[i].color_index;
len += sprintf(buf + len, "%s", led_colors[index]);
len += sprintf(buf + len, "%s", led_get_color_name(index));
if (i < mcled_cdev->num_colors - 1)
len += sprintf(buf + len, " ");
}
......
......@@ -503,6 +503,11 @@ int led_classdev_register_ext(struct device *parent,
ret = led_classdev_next_name(proposed_name, final_name, sizeof(final_name));
if (ret < 0)
return ret;
else if (ret && led_cdev->flags & LED_REJECT_NAME_CONFLICT)
return -EEXIST;
else if (ret)
dev_warn(parent, "Led %s renamed to %s due to name collision\n",
proposed_name, final_name);
if (led_cdev->color >= LED_COLOR_ID_MAX)
dev_warn(parent, "LED %s color identifier out of range\n", final_name);
......@@ -518,10 +523,6 @@ int led_classdev_register_ext(struct device *parent,
if (init_data && init_data->fwnode)
device_set_node(led_cdev->dev, init_data->fwnode);
if (ret)
dev_warn(parent, "Led %s renamed to %s due to name collision",
proposed_name, dev_name(led_cdev->dev));
if (led_cdev->flags & LED_BRIGHT_HW_CHANGED) {
ret = led_add_brightness_hw_changed(led_cdev);
if (ret) {
......
......@@ -25,7 +25,7 @@ EXPORT_SYMBOL_GPL(leds_list_lock);
LIST_HEAD(leds_list);
EXPORT_SYMBOL_GPL(leds_list);
const char * const led_colors[LED_COLOR_ID_MAX] = {
static const char * const led_colors[LED_COLOR_ID_MAX] = {
[LED_COLOR_ID_WHITE] = "white",
[LED_COLOR_ID_RED] = "red",
[LED_COLOR_ID_GREEN] = "green",
......@@ -42,7 +42,6 @@ const char * const led_colors[LED_COLOR_ID_MAX] = {
[LED_COLOR_ID_CYAN] = "cyan",
[LED_COLOR_ID_LIME] = "lime",
};
EXPORT_SYMBOL_GPL(led_colors);
static int __led_set_brightness(struct led_classdev *led_cdev, unsigned int value)
{
......@@ -534,6 +533,15 @@ int led_compose_name(struct device *dev, struct led_init_data *init_data,
}
EXPORT_SYMBOL_GPL(led_compose_name);
const char *led_get_color_name(u8 color_id)
{
if (color_id >= ARRAY_SIZE(led_colors))
return NULL;
return led_colors[color_id];
}
EXPORT_SYMBOL_GPL(led_get_color_name);
enum led_default_state led_init_default_state_get(struct fwnode_handle *fwnode)
{
const char *state = NULL;
......
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* ChromeOS EC LED Driver
*
* Copyright (C) 2024 Thomas Weißschuh <linux@weissschuh.net>
*/
#include <linux/device.h>
#include <linux/leds.h>
#include <linux/led-class-multicolor.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
static const char * const cros_ec_led_functions[] = {
[EC_LED_ID_BATTERY_LED] = LED_FUNCTION_CHARGING,
[EC_LED_ID_POWER_LED] = LED_FUNCTION_POWER,
[EC_LED_ID_ADAPTER_LED] = "adapter",
[EC_LED_ID_LEFT_LED] = "left",
[EC_LED_ID_RIGHT_LED] = "right",
[EC_LED_ID_RECOVERY_HW_REINIT_LED] = "recovery-hw-reinit",
[EC_LED_ID_SYSRQ_DEBUG_LED] = "sysrq-debug",
};
static_assert(ARRAY_SIZE(cros_ec_led_functions) == EC_LED_ID_COUNT);
static const int cros_ec_led_to_linux_id[] = {
[EC_LED_COLOR_RED] = LED_COLOR_ID_RED,
[EC_LED_COLOR_GREEN] = LED_COLOR_ID_GREEN,
[EC_LED_COLOR_BLUE] = LED_COLOR_ID_BLUE,
[EC_LED_COLOR_YELLOW] = LED_COLOR_ID_YELLOW,
[EC_LED_COLOR_WHITE] = LED_COLOR_ID_WHITE,
[EC_LED_COLOR_AMBER] = LED_COLOR_ID_AMBER,
};
static_assert(ARRAY_SIZE(cros_ec_led_to_linux_id) == EC_LED_COLOR_COUNT);
static const int cros_ec_linux_to_ec_id[] = {
[LED_COLOR_ID_RED] = EC_LED_COLOR_RED,
[LED_COLOR_ID_GREEN] = EC_LED_COLOR_GREEN,
[LED_COLOR_ID_BLUE] = EC_LED_COLOR_BLUE,
[LED_COLOR_ID_YELLOW] = EC_LED_COLOR_YELLOW,
[LED_COLOR_ID_WHITE] = EC_LED_COLOR_WHITE,
[LED_COLOR_ID_AMBER] = EC_LED_COLOR_AMBER,
};
struct cros_ec_led_priv {
struct led_classdev_mc led_mc_cdev;
struct cros_ec_device *cros_ec;
enum ec_led_id led_id;
};
static inline struct cros_ec_led_priv *cros_ec_led_cdev_to_priv(struct led_classdev *led_cdev)
{
return container_of(lcdev_to_mccdev(led_cdev), struct cros_ec_led_priv, led_mc_cdev);
}
union cros_ec_led_cmd_data {
struct ec_params_led_control req;
struct ec_response_led_control resp;
} __packed;
static int cros_ec_led_send_cmd(struct cros_ec_device *cros_ec,
union cros_ec_led_cmd_data *arg)
{
int ret;
struct {
struct cros_ec_command msg;
union cros_ec_led_cmd_data data;
} __packed buf = {
.msg = {
.version = 1,
.command = EC_CMD_LED_CONTROL,
.insize = sizeof(arg->resp),
.outsize = sizeof(arg->req),
},
.data.req = arg->req
};
ret = cros_ec_cmd_xfer_status(cros_ec, &buf.msg);
if (ret < 0)
return ret;
arg->resp = buf.data.resp;
return 0;
}
static int cros_ec_led_trigger_activate(struct led_classdev *led_cdev)
{
struct cros_ec_led_priv *priv = cros_ec_led_cdev_to_priv(led_cdev);
union cros_ec_led_cmd_data arg = {};
arg.req.led_id = priv->led_id;
arg.req.flags = EC_LED_FLAGS_AUTO;
return cros_ec_led_send_cmd(priv->cros_ec, &arg);
}
static struct led_hw_trigger_type cros_ec_led_trigger_type;
static struct led_trigger cros_ec_led_trigger = {
.name = "chromeos-auto",
.trigger_type = &cros_ec_led_trigger_type,
.activate = cros_ec_led_trigger_activate,
};
static int cros_ec_led_brightness_set_blocking(struct led_classdev *led_cdev,
enum led_brightness brightness)
{
struct cros_ec_led_priv *priv = cros_ec_led_cdev_to_priv(led_cdev);
union cros_ec_led_cmd_data arg = {};
enum ec_led_colors led_color;
struct mc_subled *subled;
size_t i;
led_mc_calc_color_components(&priv->led_mc_cdev, brightness);
arg.req.led_id = priv->led_id;
for (i = 0; i < priv->led_mc_cdev.num_colors; i++) {
subled = &priv->led_mc_cdev.subled_info[i];
led_color = cros_ec_linux_to_ec_id[subled->color_index];
arg.req.brightness[led_color] = subled->brightness;
}
return cros_ec_led_send_cmd(priv->cros_ec, &arg);
}
static int cros_ec_led_count_subleds(struct device *dev,
struct ec_response_led_control *resp,
unsigned int *max_brightness)
{
unsigned int range, common_range = 0;
int num_subleds = 0;
size_t i;
for (i = 0; i < EC_LED_COLOR_COUNT; i++) {
range = resp->brightness_range[i];
if (!range)
continue;
num_subleds++;
if (!common_range)
common_range = range;
if (common_range != range) {
/* The multicolor LED API expects a uniform max_brightness */
dev_err(dev, "Inconsistent LED brightness values\n");
return -EINVAL;
}
}
if (!num_subleds)
return -EINVAL;
*max_brightness = common_range;
return num_subleds;
}
static const char *cros_ec_led_get_color_name(struct led_classdev_mc *led_mc_cdev)
{
int color;
if (led_mc_cdev->num_colors == 1)
color = led_mc_cdev->subled_info[0].color_index;
else
color = LED_COLOR_ID_MULTI;
return led_get_color_name(color);
}
static int cros_ec_led_probe_one(struct device *dev, struct cros_ec_device *cros_ec,
enum ec_led_id id)
{
union cros_ec_led_cmd_data arg = {};
struct cros_ec_led_priv *priv;
struct led_classdev *led_cdev;
struct mc_subled *subleds;
int i, ret, num_subleds;
size_t subled;
arg.req.led_id = id;
arg.req.flags = EC_LED_FLAGS_QUERY;
ret = cros_ec_led_send_cmd(cros_ec, &arg);
if (ret == -EINVAL)
return 0; /* Unknown LED, skip */
if (ret == -EOPNOTSUPP)
return -ENODEV;
if (ret < 0)
return ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
num_subleds = cros_ec_led_count_subleds(dev, &arg.resp,
&priv->led_mc_cdev.led_cdev.max_brightness);
if (num_subleds < 0)
return num_subleds;
priv->cros_ec = cros_ec;
priv->led_id = id;
subleds = devm_kcalloc(dev, num_subleds, sizeof(*subleds), GFP_KERNEL);
if (!subleds)
return -ENOMEM;
subled = 0;
for (i = 0; i < EC_LED_COLOR_COUNT; i++) {
if (!arg.resp.brightness_range[i])
continue;
subleds[subled].color_index = cros_ec_led_to_linux_id[i];
if (subled == 0)
subleds[subled].intensity = 100;
subled++;
}
priv->led_mc_cdev.subled_info = subleds;
priv->led_mc_cdev.num_colors = num_subleds;
led_cdev = &priv->led_mc_cdev.led_cdev;
led_cdev->brightness_set_blocking = cros_ec_led_brightness_set_blocking;
led_cdev->trigger_type = &cros_ec_led_trigger_type;
led_cdev->default_trigger = cros_ec_led_trigger.name;
led_cdev->hw_control_trigger = cros_ec_led_trigger.name;
led_cdev->name = devm_kasprintf(dev, GFP_KERNEL, "chromeos:%s:%s",
cros_ec_led_get_color_name(&priv->led_mc_cdev),
cros_ec_led_functions[id]);
if (!led_cdev->name)
return -ENOMEM;
return devm_led_classdev_multicolor_register(dev, &priv->led_mc_cdev);
}
static int cros_ec_led_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent);
struct cros_ec_device *cros_ec = ec_dev->ec_dev;
int i, ret = 0;
ret = devm_led_trigger_register(dev, &cros_ec_led_trigger);
if (ret)
return ret;
for (i = 0; i < EC_LED_ID_COUNT; i++) {
ret = cros_ec_led_probe_one(dev, cros_ec, i);
if (ret)
break;
}
return ret;
}
static const struct platform_device_id cros_ec_led_id[] = {
{ "cros-ec-led", 0 },
{}
};
static struct platform_driver cros_ec_led_driver = {
.driver.name = "cros-ec-led",
.probe = cros_ec_led_probe,
.id_table = cros_ec_led_id,
};
module_platform_driver(cros_ec_led_driver);
MODULE_DEVICE_TABLE(platform, cros_ec_led_id);
MODULE_DESCRIPTION("ChromeOS EC LED Driver");
MODULE_AUTHOR("Thomas Weißschuh <linux@weissschuh.net");
MODULE_LICENSE("GPL");
......@@ -30,6 +30,5 @@ ssize_t led_trigger_write(struct file *filp, struct kobject *kobj,
extern struct rw_semaphore leds_list_lock;
extern struct list_head leds_list;
extern const char * const led_colors[LED_COLOR_ID_MAX];
#endif /* __LEDS_H_INCLUDED */
......@@ -116,7 +116,7 @@ enum {
#define PM800_CHIP_GEN_ID_NUM 0x3
static const struct i2c_device_id pm80x_id_table[] = {
{"88PM800", 0},
{ "88PM800" },
{} /* NULL terminated */
};
MODULE_DEVICE_TABLE(i2c, pm80x_id_table);
......
......@@ -30,7 +30,7 @@
#include <linux/delay.h>
static const struct i2c_device_id pm80x_id_table[] = {
{"88PM805", 0},
{ "88PM805" },
{} /* NULL terminated */
};
MODULE_DEVICE_TABLE(i2c, pm80x_id_table);
......
......@@ -1233,7 +1233,7 @@ static int pm860x_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(pm860x_pm_ops, pm860x_suspend, pm860x_resume);
static const struct i2c_device_id pm860x_id_table[] = {
{ "88PM860x", 0 },
{ "88PM860x" },
{}
};
MODULE_DEVICE_TABLE(i2c, pm860x_id_table);
......
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/i2c.h>
#include <linux/mfd/core.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/regmap.h>
#include <linux/mfd/88pm886.h>
static const struct regmap_config pm886_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = PM886_REG_RTC_SPARE6,
};
static struct regmap_irq pm886_regmap_irqs[] = {
REGMAP_IRQ_REG(PM886_IRQ_ONKEY, 0, PM886_INT_ENA1_ONKEY),
};
static struct regmap_irq_chip pm886_regmap_irq_chip = {
.name = "88pm886",
.irqs = pm886_regmap_irqs,
.num_irqs = ARRAY_SIZE(pm886_regmap_irqs),
.num_regs = 4,
.status_base = PM886_REG_INT_STATUS1,
.ack_base = PM886_REG_INT_STATUS1,
.unmask_base = PM886_REG_INT_ENA_1,
};
static struct resource pm886_onkey_resources[] = {
DEFINE_RES_IRQ_NAMED(PM886_IRQ_ONKEY, "88pm886-onkey"),
};
static struct mfd_cell pm886_devs[] = {
MFD_CELL_RES("88pm886-onkey", pm886_onkey_resources),
MFD_CELL_NAME("88pm886-regulator"),
};
static int pm886_power_off_handler(struct sys_off_data *sys_off_data)
{
struct pm886_chip *chip = sys_off_data->cb_data;
struct regmap *regmap = chip->regmap;
struct device *dev = &chip->client->dev;
int err;
err = regmap_update_bits(regmap, PM886_REG_MISC_CONFIG1, PM886_SW_PDOWN, PM886_SW_PDOWN);
if (err) {
dev_err(dev, "Failed to power off the device: %d\n", err);
return NOTIFY_BAD;
}
return NOTIFY_DONE;
}
static int pm886_setup_irq(struct pm886_chip *chip,
struct regmap_irq_chip_data **irq_data)
{
struct regmap *regmap = chip->regmap;
struct device *dev = &chip->client->dev;
int err;
/* Set interrupt clearing mode to clear on write. */
err = regmap_update_bits(regmap, PM886_REG_MISC_CONFIG2,
PM886_INT_INV | PM886_INT_CLEAR | PM886_INT_MASK_MODE,
PM886_INT_WC);
if (err) {
dev_err(dev, "Failed to set interrupt clearing mode: %d\n", err);
return err;
}
err = devm_regmap_add_irq_chip(dev, regmap, chip->client->irq,
IRQF_ONESHOT, 0, &pm886_regmap_irq_chip,
irq_data);
if (err) {
dev_err(dev, "Failed to request IRQ: %d\n", err);
return err;
}
return 0;
}
static int pm886_probe(struct i2c_client *client)
{
struct regmap_irq_chip_data *irq_data;
struct device *dev = &client->dev;
struct pm886_chip *chip;
struct regmap *regmap;
unsigned int chip_id;
int err;
chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
chip->client = client;
chip->chip_id = (uintptr_t)device_get_match_data(dev);
i2c_set_clientdata(client, chip);
regmap = devm_regmap_init_i2c(client, &pm886_regmap_config);
if (IS_ERR(regmap))
return dev_err_probe(dev, PTR_ERR(regmap), "Failed to initialize regmap\n");
chip->regmap = regmap;
err = regmap_read(regmap, PM886_REG_ID, &chip_id);
if (err)
return dev_err_probe(dev, err, "Failed to read chip ID\n");
if (chip->chip_id != chip_id)
return dev_err_probe(dev, -EINVAL, "Unsupported chip: 0x%x\n", chip_id);
err = pm886_setup_irq(chip, &irq_data);
if (err)
return err;
err = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, pm886_devs, ARRAY_SIZE(pm886_devs),
NULL, 0, regmap_irq_get_domain(irq_data));
if (err)
return dev_err_probe(dev, err, "Failed to add devices\n");
err = devm_register_power_off_handler(dev, pm886_power_off_handler, chip);
if (err)
return dev_err_probe(dev, err, "Failed to register power off handler\n");
device_init_wakeup(dev, device_property_read_bool(dev, "wakeup-source"));
return 0;
}
static const struct of_device_id pm886_of_match[] = {
{ .compatible = "marvell,88pm886-a1", .data = (void *)PM886_A1_CHIP_ID },
{ }
};
MODULE_DEVICE_TABLE(of, pm886_of_match);
static struct i2c_driver pm886_i2c_driver = {
.driver = {
.name = "88pm886",
.of_match_table = pm886_of_match,
},
.probe = pm886_probe,
};
module_i2c_driver(pm886_i2c_driver);
MODULE_DESCRIPTION("Marvell 88PM886 PMIC driver");
MODULE_AUTHOR("Karel Balej <balejk@matfyz.cz>");
MODULE_LICENSE("GPL");
......@@ -794,6 +794,18 @@ config MFD_88PM860X
select individual components like voltage regulators, RTC and
battery-charger under the corresponding menus.
config MFD_88PM886_PMIC
bool "Marvell 88PM886 PMIC"
depends on I2C=y
depends on OF
select REGMAP_I2C
select REGMAP_IRQ
select MFD_CORE
help
This enables support for Marvell 88PM886 Power Management IC.
This includes the I2C driver and the core APIs _only_, you have to
select individual components like onkey under the corresponding menus.
config MFD_MAX14577
tristate "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
depends on I2C
......@@ -2089,6 +2101,19 @@ config MFD_ROHM_BD957XMUF
BD9573MUF Power Management ICs. BD9576 and BD9573 are primarily
designed to be used to power R-Car series processors.
config MFD_ROHM_BD96801
tristate "ROHM BD96801 Power Management IC"
depends on I2C=y
depends on OF
select REGMAP_I2C
select REGMAP_IRQ
select MFD_CORE
help
Select this option to get support for the ROHM BD96801 Power
Management IC. The ROHM BD96801 is a highly scalable Power Management
IC for industrial and automotive use. The BD96801 can be used as a
master PMIC in a chained PMIC solution with suitable companion PMICs.
config MFD_STM32_LPTIMER
tristate "Support for STM32 Low-Power Timer"
depends on (ARCH_STM32 && OF) || COMPILE_TEST
......@@ -2208,6 +2233,7 @@ config MFD_ACER_A500_EC
config MFD_QCOM_PM8008
tristate "QCOM PM8008 Power Management IC"
depends on I2C && OF
select MFD_CORE
select REGMAP_I2C
select REGMAP_IRQ
help
......@@ -2243,6 +2269,36 @@ config MCP_UCB1200_TS
endmenu
config MFD_CS40L50_CORE
tristate
select MFD_CORE
select FW_CS_DSP
select REGMAP_IRQ
config MFD_CS40L50_I2C
tristate "Cirrus Logic CS40L50 (I2C)"
select REGMAP_I2C
select MFD_CS40L50_CORE
depends on I2C
help
Select this to support the Cirrus Logic CS40L50 Haptic
Driver over I2C.
This driver can be built as a module. If built as a module it will be
called "cs40l50-i2c".
config MFD_CS40L50_SPI
tristate "Cirrus Logic CS40L50 (SPI)"
select REGMAP_SPI
select MFD_CS40L50_CORE
depends on SPI
help
Select this to support the Cirrus Logic CS40L50 Haptic
Driver over SPI.
This driver can be built as a module. If built as a module it will be
called "cs40l50-spi".
config MFD_VEXPRESS_SYSREG
tristate "Versatile Express System Registers"
depends on VEXPRESS_CONFIG && GPIOLIB
......
......@@ -7,6 +7,7 @@
obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o
obj-$(CONFIG_MFD_88PM800) += 88pm800.o 88pm80x.o
obj-$(CONFIG_MFD_88PM805) += 88pm805.o 88pm80x.o
obj-$(CONFIG_MFD_88PM886_PMIC) += 88pm886.o
obj-$(CONFIG_MFD_ACT8945A) += act8945a.o
obj-$(CONFIG_MFD_SM501) += sm501.o
obj-$(CONFIG_ARCH_BCM2835) += bcm2835-pm.o
......@@ -88,6 +89,10 @@ obj-$(CONFIG_MFD_MADERA) += madera.o
obj-$(CONFIG_MFD_MADERA_I2C) += madera-i2c.o
obj-$(CONFIG_MFD_MADERA_SPI) += madera-spi.o
obj-$(CONFIG_MFD_CS40L50_CORE) += cs40l50-core.o
obj-$(CONFIG_MFD_CS40L50_I2C) += cs40l50-i2c.o
obj-$(CONFIG_MFD_CS40L50_SPI) += cs40l50-spi.o
obj-$(CONFIG_TPS6105X) += tps6105x.o
obj-$(CONFIG_TPS65010) += tps65010.o
obj-$(CONFIG_TPS6507X) += tps6507x.o
......@@ -264,6 +269,7 @@ obj-$(CONFIG_RAVE_SP_CORE) += rave-sp.o
obj-$(CONFIG_MFD_ROHM_BD71828) += rohm-bd71828.o
obj-$(CONFIG_MFD_ROHM_BD718XX) += rohm-bd718x7.o
obj-$(CONFIG_MFD_ROHM_BD957XMUF) += rohm-bd9576.o
obj-$(CONFIG_MFD_ROHM_BD96801) += rohm-bd96801.o
obj-$(CONFIG_MFD_STMFX) += stmfx.o
obj-$(CONFIG_MFD_KHADAS_MCU) += khadas-mcu.o
obj-$(CONFIG_MFD_ACER_A500_EC) += acer-ec-a500.o
......@@ -280,7 +286,5 @@ obj-$(CONFIG_MFD_INTEL_M10_BMC_PMCI) += intel-m10-bmc-pmci.o
obj-$(CONFIG_MFD_ATC260X) += atc260x-core.o
obj-$(CONFIG_MFD_ATC260X_I2C) += atc260x-i2c.o
rsmu-i2c-objs := rsmu_core.o rsmu_i2c.o
rsmu-spi-objs := rsmu_core.o rsmu_spi.o
obj-$(CONFIG_MFD_RSMU_I2C) += rsmu-i2c.o
obj-$(CONFIG_MFD_RSMU_SPI) += rsmu-spi.o
obj-$(CONFIG_MFD_RSMU_I2C) += rsmu_i2c.o rsmu_core.o
obj-$(CONFIG_MFD_RSMU_SPI) += rsmu_spi.o rsmu_core.o
......@@ -439,7 +439,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
aat2870_i2c_resume);
static const struct i2c_device_id aat2870_i2c_id_table[] = {
{ "aat2870", 0 },
{ "aat2870" },
{ }
};
......
......@@ -54,7 +54,7 @@ static int act8945a_i2c_probe(struct i2c_client *i2c)
}
static const struct i2c_device_id act8945a_i2c_id[] = {
{ "act8945a", 0 },
{ "act8945a" },
{}
};
MODULE_DEVICE_TABLE(i2c, act8945a_i2c_id);
......
......@@ -1429,4 +1429,5 @@ int arizona_dev_exit(struct arizona *arizona)
}
EXPORT_SYMBOL_GPL(arizona_dev_exit);
MODULE_DESCRIPTION("Wolfson Arizona core driver");
MODULE_LICENSE("GPL v2");
......@@ -190,19 +190,12 @@ static int arizona_spi_acpi_probe(struct arizona *arizona)
static int arizona_spi_probe(struct spi_device *spi)
{
const struct spi_device_id *id = spi_get_device_id(spi);
const void *match_data;
struct arizona *arizona;
const struct regmap_config *regmap_config = NULL;
unsigned long type = 0;
int ret;
match_data = device_get_match_data(&spi->dev);
if (match_data)
type = (unsigned long)match_data;
else if (id)
type = id->driver_data;
type = (unsigned long)spi_get_device_match_data(spi);
switch (type) {
case WM5102:
if (IS_ENABLED(CONFIG_MFD_WM5102))
......
......@@ -430,8 +430,8 @@ static const struct of_device_id as3722_of_match[] = {
MODULE_DEVICE_TABLE(of, as3722_of_match);
static const struct i2c_device_id as3722_i2c_id[] = {
{ "as3722", 0 },
{},
{ "as3722" },
{}
};
MODULE_DEVICE_TABLE(i2c, as3722_i2c_id);
......
......@@ -75,18 +75,18 @@ MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match);
#endif
static const struct i2c_device_id axp20x_i2c_id[] = {
{ "axp152", 0 },
{ "axp192", 0 },
{ "axp202", 0 },
{ "axp209", 0 },
{ "axp221", 0 },
{ "axp223", 0 },
{ "axp313a", 0 },
{ "axp717", 0 },
{ "axp803", 0 },
{ "axp806", 0 },
{ "axp15060", 0 },
{ },
{ "axp152" },
{ "axp192" },
{ "axp202" },
{ "axp209" },
{ "axp221" },
{ "axp223" },
{ "axp313a" },
{ "axp717" },
{ "axp803" },
{ "axp806" },
{ "axp15060" },
{ }
};
MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);
......
......@@ -268,7 +268,7 @@ static const struct of_device_id bd9571mwv_of_match_table[] = {
MODULE_DEVICE_TABLE(of, bd9571mwv_of_match_table);
static const struct i2c_device_id bd9571mwv_id_table[] = {
{ "bd9571mwv", 0 },
{ "bd9571mwv" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(i2c, bd9571mwv_id_table);
......
......@@ -87,6 +87,7 @@ static const struct mfd_cell cros_ec_sensorhub_cells[] = {
};
static const struct mfd_cell cros_usbpd_charger_cells[] = {
{ .name = "cros-charge-control", },
{ .name = "cros-usbpd-charger", },
{ .name = "cros-usbpd-logger", },
};
......@@ -99,6 +100,14 @@ static const struct mfd_cell cros_ec_wdt_cells[] = {
{ .name = "cros-ec-wdt", }
};
static const struct mfd_cell cros_ec_led_cells[] = {
{ .name = "cros-ec-led", },
};
static const struct mfd_cell cros_ec_keyboard_leds_cells[] = {
{ .name = "cros-keyboard-leds", },
};
static const struct cros_feature_to_cells cros_subdevices[] = {
{
.id = EC_FEATURE_CEC,
......@@ -125,11 +134,22 @@ static const struct cros_feature_to_cells cros_subdevices[] = {
.mfd_cells = cros_ec_wdt_cells,
.num_cells = ARRAY_SIZE(cros_ec_wdt_cells),
},
{
.id = EC_FEATURE_LED,
.mfd_cells = cros_ec_led_cells,
.num_cells = ARRAY_SIZE(cros_ec_led_cells),
},
{
.id = EC_FEATURE_PWM_KEYB,
.mfd_cells = cros_ec_keyboard_leds_cells,
.num_cells = ARRAY_SIZE(cros_ec_keyboard_leds_cells),
},
};
static const struct mfd_cell cros_ec_platform_cells[] = {
{ .name = "cros-ec-chardev", },
{ .name = "cros-ec-debugfs", },
{ .name = "cros-ec-hwmon", },
{ .name = "cros-ec-sysfs", },
};
......
This diff is collapsed.
// SPDX-License-Identifier: GPL-2.0
/*
* CS40L50 Advanced Haptic Driver with waveform memory,
* integrated DSP, and closed-loop algorithms
*
* Copyright 2024 Cirrus Logic, Inc.
*
* Author: James Ogletree <james.ogletree@cirrus.com>
*/
#include <linux/i2c.h>
#include <linux/mfd/cs40l50.h>
static int cs40l50_i2c_probe(struct i2c_client *i2c)
{
struct cs40l50 *cs40l50;
cs40l50 = devm_kzalloc(&i2c->dev, sizeof(*cs40l50), GFP_KERNEL);
if (!cs40l50)
return -ENOMEM;
i2c_set_clientdata(i2c, cs40l50);
cs40l50->dev = &i2c->dev;
cs40l50->irq = i2c->irq;
cs40l50->regmap = devm_regmap_init_i2c(i2c, &cs40l50_regmap);
if (IS_ERR(cs40l50->regmap))
return dev_err_probe(cs40l50->dev, PTR_ERR(cs40l50->regmap),
"Failed to initialize register map\n");
return cs40l50_probe(cs40l50);
}
static void cs40l50_i2c_remove(struct i2c_client *i2c)
{
struct cs40l50 *cs40l50 = i2c_get_clientdata(i2c);
cs40l50_remove(cs40l50);
}
static const struct i2c_device_id cs40l50_id_i2c[] = {
{ "cs40l50" },
{}
};
MODULE_DEVICE_TABLE(i2c, cs40l50_id_i2c);
static const struct of_device_id cs40l50_of_match[] = {
{ .compatible = "cirrus,cs40l50" },
{}
};
MODULE_DEVICE_TABLE(of, cs40l50_of_match);
static struct i2c_driver cs40l50_i2c_driver = {
.driver = {
.name = "cs40l50",
.of_match_table = cs40l50_of_match,
.pm = pm_ptr(&cs40l50_pm_ops),
},
.id_table = cs40l50_id_i2c,
.probe = cs40l50_i2c_probe,
.remove = cs40l50_i2c_remove,
};
module_i2c_driver(cs40l50_i2c_driver);
MODULE_DESCRIPTION("CS40L50 I2C Driver");
MODULE_AUTHOR("James Ogletree, Cirrus Logic Inc. <james.ogletree@cirrus.com>");
MODULE_LICENSE("GPL");
// SPDX-License-Identifier: GPL-2.0
/*
* CS40L50 Advanced Haptic Driver with waveform memory,
* integrated DSP, and closed-loop algorithms
*
* Copyright 2024 Cirrus Logic, Inc.
*
* Author: James Ogletree <james.ogletree@cirrus.com>
*/
#include <linux/mfd/cs40l50.h>
#include <linux/spi/spi.h>
static int cs40l50_spi_probe(struct spi_device *spi)
{
struct cs40l50 *cs40l50;
cs40l50 = devm_kzalloc(&spi->dev, sizeof(*cs40l50), GFP_KERNEL);
if (!cs40l50)
return -ENOMEM;
spi_set_drvdata(spi, cs40l50);
cs40l50->dev = &spi->dev;
cs40l50->irq = spi->irq;
cs40l50->regmap = devm_regmap_init_spi(spi, &cs40l50_regmap);
if (IS_ERR(cs40l50->regmap))
return dev_err_probe(cs40l50->dev, PTR_ERR(cs40l50->regmap),
"Failed to initialize register map\n");
return cs40l50_probe(cs40l50);
}
static void cs40l50_spi_remove(struct spi_device *spi)
{
struct cs40l50 *cs40l50 = spi_get_drvdata(spi);
cs40l50_remove(cs40l50);
}
static const struct spi_device_id cs40l50_id_spi[] = {
{ "cs40l50" },
{}
};
MODULE_DEVICE_TABLE(spi, cs40l50_id_spi);
static const struct of_device_id cs40l50_of_match[] = {
{ .compatible = "cirrus,cs40l50" },
{}
};
MODULE_DEVICE_TABLE(of, cs40l50_of_match);
static struct spi_driver cs40l50_spi_driver = {
.driver = {
.name = "cs40l50",
.of_match_table = cs40l50_of_match,
.pm = pm_ptr(&cs40l50_pm_ops),
},
.id_table = cs40l50_id_spi,
.probe = cs40l50_spi_probe,
.remove = cs40l50_spi_remove,
};
module_spi_driver(cs40l50_spi_driver);
MODULE_DESCRIPTION("CS40L50 SPI Driver");
MODULE_AUTHOR("James Ogletree, Cirrus Logic Inc. <james.ogletree@cirrus.com>");
MODULE_LICENSE("GPL");
......@@ -54,7 +54,7 @@ static void da9055_i2c_remove(struct i2c_client *i2c)
* and CODEC, which must be different to operate together.
*/
static const struct i2c_device_id da9055_i2c_id[] = {
{"da9055-pmic", 0},
{ "da9055-pmic" },
{ }
};
MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);
......
This diff is collapsed.
......@@ -581,5 +581,6 @@ static struct platform_driver bxtwc_driver = {
module_platform_driver(bxtwc_driver);
MODULE_DESCRIPTION("Intel Broxton Whiskey Cove PMIC MFD core driver");
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Qipeng Zha <qipeng.zha@intel.com>");
......@@ -137,7 +137,9 @@ static const struct regmap_irq_chip crystal_cove_irq_chip = {
/* PWM consumed by the Intel GFX */
static struct pwm_lookup crc_pwm_lookup[] = {
PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL),
PWM_LOOKUP_WITH_MODULE("crystal_cove_pwm", 0, "0000:00:02.0",
"pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL,
"pwm-crc"),
};
struct crystal_cove_config {
......
......@@ -11,7 +11,7 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/mfd/core.h>
#include <linux/regmap.h>
......@@ -225,14 +225,12 @@ static int lm3533_set_lvled_config(struct lm3533 *lm3533, u8 lvled, u8 led)
static void lm3533_enable(struct lm3533 *lm3533)
{
if (gpio_is_valid(lm3533->gpio_hwen))
gpio_set_value(lm3533->gpio_hwen, 1);
gpiod_set_value(lm3533->hwen, 1);
}
static void lm3533_disable(struct lm3533 *lm3533)
{
if (gpio_is_valid(lm3533->gpio_hwen))
gpio_set_value(lm3533->gpio_hwen, 0);
gpiod_set_value(lm3533->hwen, 0);
}
enum lm3533_attribute_type {
......@@ -483,18 +481,10 @@ static int lm3533_device_init(struct lm3533 *lm3533)
return -EINVAL;
}
lm3533->gpio_hwen = pdata->gpio_hwen;
if (gpio_is_valid(lm3533->gpio_hwen)) {
ret = devm_gpio_request_one(lm3533->dev, lm3533->gpio_hwen,
GPIOF_OUT_INIT_LOW, "lm3533-hwen");
if (ret < 0) {
dev_err(lm3533->dev,
"failed to request HWEN GPIO %d\n",
lm3533->gpio_hwen);
return ret;
}
}
lm3533->hwen = devm_gpiod_get(lm3533->dev, NULL, GPIOD_OUT_LOW);
if (IS_ERR(lm3533->hwen))
return dev_err_probe(lm3533->dev, PTR_ERR(lm3533->hwen), "failed to request HWEN GPIO\n");
gpiod_set_consumer_name(lm3533->hwen, "lm3533-hwen");
lm3533_enable(lm3533);
......@@ -614,8 +604,8 @@ static void lm3533_i2c_remove(struct i2c_client *i2c)
}
static const struct i2c_device_id lm3533_i2c_ids[] = {
{ "lm3533", 0 },
{ },
{ "lm3533" },
{ }
};
MODULE_DEVICE_TABLE(i2c, lm3533_i2c_ids);
......
......@@ -126,7 +126,7 @@ static int lp3943_probe(struct i2c_client *cl)
}
static const struct i2c_device_id lp3943_ids[] = {
{ "lp3943", 0 },
{ "lp3943" },
{ }
};
MODULE_DEVICE_TABLE(i2c, lp3943_ids);
......
......@@ -68,8 +68,8 @@ static const struct of_device_id of_lp873x_match_table[] = {
MODULE_DEVICE_TABLE(of, of_lp873x_match_table);
static const struct i2c_device_id lp873x_id_table[] = {
{ "lp873x", 0 },
{ },
{ "lp873x" },
{ }
};
MODULE_DEVICE_TABLE(i2c, lp873x_id_table);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -88,4 +88,5 @@ int pcf50633_gpio_power_supply_set(struct pcf50633 *pcf,
}
EXPORT_SYMBOL_GPL(pcf50633_gpio_power_supply_set);
MODULE_DESCRIPTION("NXP PCF50633 GPIO Driver");
MODULE_LICENSE("GPL");
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment