Merge tag 'mfd-next-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 21 Dec 2022 17:19:24 +0000 (09:19 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 21 Dec 2022 17:19:24 +0000 (09:19 -0800)
Pull MFD updates from Lee Jones:
 "New Drivers:
   - Add support for Ampere Computing SMpro
   - Add support for TI TPS65219 PMIC

  New Functionality:
   - Add support for multiple devices of the same type; rk808

  Fix-ups:
   - Convert a bunch of I2C class drivers over to .probe_new()
   - Remove superfluous includes; mc13xxx-*, palmas, timberdale
   - Use correct includes for GPIO handling; madera-core
   - Convert to GPIOD; twl6040
   - Remove unused platform data handling; twl6040
   - Device Tree changes; many
   - Remove unused drivers; dm355evm_msp, davinci_voicecodec, htc-i2cpld
   - Add support for modules; palmas
   - Enable COMPILE_TEST support; intel_soc_pmic*
   - Trivial: spelling / whitespace fixes; mc13xxx-spi
   - Replace old PM helpers with new ones; many
   - Convert deprecated mask_invert usage to unmask_base; many
   - Use devm_*() calls; qcom_rpm
   - MAINTAINER fix-ups
   - Make use of improved / replaced APIs; palmas, fsl-imx25-tsadc,
     stm32-lptimer, qcom_rpm, rohm-*

  Bug Fixes:
   - Add bounds / error checking; mt6360-core
   - No sleeping inside critical sections; axp20x
   - Fix missing dependencies; ROHM_BD957XMUF
   - Repair error paths; qcom-pm8008"

* tag 'mfd-next-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (161 commits)
  dt-bindings: mfd: da9062: Correct file name for watchdog
  mfd: pm8008: Fix return value check in pm8008_probe()
  mfd: rohm: Use dev_err_probe()
  mfd: Drop obsolete dependencies on COMPILE_TEST
  dt-bindings: mfd: da9062: Move IRQ to optional properties
  mfd: qcom_rpm: Use devm_of_platform_populate() to simplify code
  mfd: qcom_rpm: Fix an error handling path in qcom_rpm_probe()
  mfd: stm32-lptimer: Use devm_platform_get_and_ioremap_resource()
  mfd: rohm-bd9576: Convert to i2c's .probe_new()
  mfd: fsl-imx25-tsadc: Use devm_platform_get_and_ioremap_resource()
  dt-bindings: Fix maintainer email for a few ROHM ICs
  mfd: palmas: Use device_get_match_data() to simplify the code
  Input: Add tps65219 interrupt driven powerbutton
  mfd: tps65219: Add driver for TI TPS65219 PMIC
  mfd: bd957x: Fix Kconfig dependency on REGMAP_IRQ
  mfd: wcd934x: Convert irq chip to config regs
  mfd: tps65090: Replace irqchip mask_invert with unmask_base
  mfd: sun4i-gpadc: Replace irqchip mask_invert with unmask_base
  mfd: stpmic1: Fix swapped mask/unmask in irq chip
  mfd: sprd-sc27xx-spi: Replace irqchip mask_invert with unmask_base
  ...

152 files changed:
Documentation/devicetree/bindings/leds/rohm,bd71828-leds.yaml
Documentation/devicetree/bindings/mfd/ampere,smpro.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/mfd/brcm,twd.yaml
Documentation/devicetree/bindings/mfd/da9062.txt
Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml
Documentation/devicetree/bindings/mfd/mt6397.txt
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
Documentation/devicetree/bindings/mfd/rohm,bd71837-pmic.yaml
Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
Documentation/devicetree/bindings/mfd/rohm,bd9576-pmic.yaml
Documentation/devicetree/bindings/mfd/syscon.yaml
Documentation/devicetree/bindings/mfd/ti,am3359-tscadc.yaml
Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml
Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml
Documentation/devicetree/bindings/regulator/rohm,bd71815-regulator.yaml
Documentation/devicetree/bindings/regulator/rohm,bd71828-regulator.yaml
Documentation/devicetree/bindings/regulator/rohm,bd71837-regulator.yaml
Documentation/devicetree/bindings/regulator/rohm,bd71847-regulator.yaml
Documentation/devicetree/bindings/regulator/rohm,bd9576-regulator.yaml
Documentation/devicetree/bindings/timer/brcm,bcmbca-timer.yaml [new file with mode: 0644]
MAINTAINERS
drivers/input/misc/Kconfig
drivers/input/misc/Makefile
drivers/input/misc/dm355evm_keys.c [deleted file]
drivers/input/misc/tps65219-pwrbutton.c [new file with mode: 0644]
drivers/mfd/88pm800.c
drivers/mfd/88pm805.c
drivers/mfd/88pm80x.c
drivers/mfd/88pm860x-core.c
drivers/mfd/Kconfig
drivers/mfd/Makefile
drivers/mfd/aat2870-core.c
drivers/mfd/act8945a.c
drivers/mfd/adp5520.c
drivers/mfd/arizona-core.c
drivers/mfd/arizona-i2c.c
drivers/mfd/arizona-spi.c
drivers/mfd/as3711.c
drivers/mfd/as3722.c
drivers/mfd/atc260x-core.c
drivers/mfd/atc260x-i2c.c
drivers/mfd/axp20x-i2c.c
drivers/mfd/axp20x.c
drivers/mfd/bcm590xx.c
drivers/mfd/bd9571mwv.c
drivers/mfd/da903x.c
drivers/mfd/da9052-i2c.c
drivers/mfd/da9055-i2c.c
drivers/mfd/da9062-core.c
drivers/mfd/da9063-i2c.c
drivers/mfd/da9150-core.c
drivers/mfd/davinci_voicecodec.c [deleted file]
drivers/mfd/dm355evm_msp.c [deleted file]
drivers/mfd/fsl-imx25-tsadc.c
drivers/mfd/gateworks-gsc.c
drivers/mfd/htc-i2cpld.c [deleted file]
drivers/mfd/khadas-mcu.c
drivers/mfd/lm3533-core.c
drivers/mfd/lp3943.c
drivers/mfd/lp873x.c
drivers/mfd/lp87565.c
drivers/mfd/lp8788.c
drivers/mfd/madera-core.c
drivers/mfd/madera-i2c.c
drivers/mfd/max14577.c
drivers/mfd/max77620.c
drivers/mfd/max77650.c
drivers/mfd/max77686.c
drivers/mfd/max77693.c
drivers/mfd/max77843.c
drivers/mfd/max8907.c
drivers/mfd/max8925-i2c.c
drivers/mfd/max8997.c
drivers/mfd/max8998.c
drivers/mfd/mc13xxx-i2c.c
drivers/mfd/mc13xxx-spi.c
drivers/mfd/mcp-sa11x0.c
drivers/mfd/menelaus.c
drivers/mfd/menf21bmc.c
drivers/mfd/motorola-cpcap.c
drivers/mfd/mt6360-core.c
drivers/mfd/mt6397-irq.c
drivers/mfd/palmas.c
drivers/mfd/pcf50633-core.c
drivers/mfd/pcf50633-irq.c
drivers/mfd/qcom-pm8008.c
drivers/mfd/qcom-pm8xxx.c
drivers/mfd/qcom_rpm.c
drivers/mfd/rc5t583-irq.c
drivers/mfd/rc5t583.c
drivers/mfd/retu-mfd.c
drivers/mfd/rk808.c
drivers/mfd/rn5t618.c
drivers/mfd/rohm-bd71828.c
drivers/mfd/rohm-bd718x7.c
drivers/mfd/rohm-bd9576.c
drivers/mfd/rsmu_i2c.c
drivers/mfd/rt5033.c
drivers/mfd/rt5120.c
drivers/mfd/sec-core.c
drivers/mfd/si476x-i2c.c
drivers/mfd/sky81452.c
drivers/mfd/sm501.c
drivers/mfd/smpro-core.c [new file with mode: 0644]
drivers/mfd/sprd-sc27xx-spi.c
drivers/mfd/stm32-lptimer.c
drivers/mfd/stmfx.c
drivers/mfd/stmpe-i2c.c
drivers/mfd/stmpe-spi.c
drivers/mfd/stmpe.c
drivers/mfd/stpmic1.c
drivers/mfd/stw481x.c
drivers/mfd/sun4i-gpadc.c
drivers/mfd/t7l66xb.c
drivers/mfd/tc3589x.c
drivers/mfd/tc6387xb.c
drivers/mfd/tc6393xb.c
drivers/mfd/ti-lmu.c
drivers/mfd/timberdale.c
drivers/mfd/tps6105x.c
drivers/mfd/tps65010.c
drivers/mfd/tps6507x.c
drivers/mfd/tps65086.c
drivers/mfd/tps65090.c
drivers/mfd/tps65218.c
drivers/mfd/tps65219.c [new file with mode: 0644]
drivers/mfd/tps6586x.c
drivers/mfd/tps65910.c
drivers/mfd/tps65912-i2c.c
drivers/mfd/twl-core.c
drivers/mfd/twl6040.c
drivers/mfd/ucb1x00-core.c
drivers/mfd/wcd934x.c
drivers/mfd/wl1273-core.c
drivers/mfd/wm831x-i2c.c
drivers/mfd/wm8350-i2c.c
drivers/mfd/wm8400-core.c
drivers/mfd/wm8994-core.c
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/rtc-dm355evm.c [deleted file]
include/linux/htcpld.h [deleted file]
include/linux/mfd/dm355evm_msp.h [deleted file]
include/linux/mfd/palmas.h
include/linux/mfd/pcf50633/core.h
include/linux/mfd/stmfx.h
include/linux/mfd/tps65219.h [new file with mode: 0644]
include/linux/mfd/twl6040.h

index ca92cea56a6f8f497224654405ff4120fbc92bd0..64b0be9cf70bce3eb1a65e095a324c35f1f5e372 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD71828 Power Management Integrated Circuit LED driver
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   This module is part of the ROHM BD71828 MFD device. For more details
diff --git a/Documentation/devicetree/bindings/mfd/ampere,smpro.yaml b/Documentation/devicetree/bindings/mfd/ampere,smpro.yaml
new file mode 100644 (file)
index 0000000..c442c3c
--- /dev/null
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/ampere,smpro.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Ampere Altra SMPro firmware driver
+
+maintainers:
+  - Quan Nguyen <quan@os.amperecomputing.com>
+
+description: |
+  Ampere Altra SMPro firmware may contain different blocks like hardware
+  monitoring, error monitoring and other miscellaneous features.
+
+properties:
+  compatible:
+    enum:
+      - ampere,smpro
+
+  reg:
+    description:
+      I2C device address.
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        smpro@4f {
+            compatible = "ampere,smpro";
+            reg = <0x4f>;
+        };
+    };
index 634526f790b8772e4629cda2fdd0f7b3f510875f..e5136a37b0a389c8aaaedd06e1026582e40d96f5 100644 (file)
@@ -36,6 +36,9 @@ properties:
     const: 1
 
 patternProperties:
+  '^timer@[a-f0-9]+$':
+    $ref: /schemas/timer/brcm,bcmbca-timer.yaml
+
   '^watchdog@[a-f0-9]+$':
     $ref: /schemas/watchdog/brcm,bcm7038-wdt.yaml
 
@@ -54,6 +57,11 @@ examples:
         #address-cells = <1>;
         #size-cells = <1>;
 
+        timer@0 {
+            compatible = "brcm,bcm63138-timer";
+            reg = <0x0 0x28>;
+        };
+
         watchdog@28 {
             compatible = "brcm,bcm7038-wdt";
             reg = <0x28 0x8>;
index bab0d0e66cb3ccfba911766635a27b23271d7319..e4eedd3bd2332a739914d42fc736972b667af657 100644 (file)
@@ -33,11 +33,6 @@ Required properties:
     "dlg,da9061" for DA9061
 - reg : Specifies the I2C slave address (this defaults to 0x58 but it can be
   modified to match the chip's OTP settings).
-- interrupts : IRQ line information.
-- interrupt-controller
-
-See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for
-further information on IRQ bindings.
 
 Optional properties:
 
@@ -48,6 +43,12 @@ Optional properties:
 See Documentation/devicetree/bindings/gpio/gpio.txt for further information on
 GPIO bindings.
 
+- interrupts : IRQ line information.
+- interrupt-controller
+
+See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for
+further information on IRQ bindings.
+
 Sub-nodes:
 
 - regulators : This node defines the settings for the LDOs and BUCKs.
@@ -85,7 +86,7 @@ Sub-nodes:
 
 - onkey : See ../input/da9062-onkey.txt
 
-- watchdog: See ../watchdog/da9062-watchdog.txt
+- watchdog: See ../watchdog/da9062-wdt.txt
 
 - thermal : See ../thermal/da9062-thermal.txt
 
index 8bf45a5673a4744cc21262e12ff13b940963167e..1d1fee1a16c1a35b9e65111a74f98949e68f5ac4 100644 (file)
@@ -12,7 +12,8 @@ maintainers:
 description: |
   The Ocelot ethernet switch family contains chips that have an internal CPU
   (VSC7513, VSC7514) and chips that don't (VSC7511, VSC7512). All switches have
-  the option to be controlled externally, which is the purpose of this driver.
+  the option to be controlled externally via external interfaces like SPI or
+  PCIe.
 
   The switch family is a multi-port networking switch that supports many
   interfaces. Additionally, the device can perform pin control, MDIO buses, and
@@ -61,7 +62,6 @@ required:
   - reg
   - '#address-cells'
   - '#size-cells'
-  - spi-max-frequency
 
 additionalProperties: false
 
index 0088442efca1afb58fb10a2cd26cba9aab3fd578..518986c44880f7656e36431d34cfe7580dc69586 100644 (file)
@@ -21,6 +21,7 @@ Required properties:
 compatible:
        "mediatek,mt6323" for PMIC MT6323
        "mediatek,mt6331" for PMIC MT6331 and MT6332
+       "mediatek,mt6357" for PMIC MT6357
        "mediatek,mt6358" for PMIC MT6358 and MT6366
        "mediatek,mt6359" for PMIC MT6359
        "mediatek,mt6397" for PMIC MT6397
index a5edab6f2e40c2babad8da9e2430ae17506385b6..37d16e16f4443d61644bb9dcafe0dd54e3782963 100644 (file)
@@ -99,10 +99,16 @@ properties:
     type: object
     $ref: /schemas/regulator/qcom,spmi-regulator.yaml#
 
+  pwm:
+    type: object
+    $ref: /schemas/leds/leds-qcom-lpg.yaml#
+
 patternProperties:
   "^adc@[0-9a-f]+$":
     type: object
-    $ref: /schemas/iio/adc/qcom,spmi-vadc.yaml#
+    oneOf:
+      - $ref: /schemas/iio/adc/qcom,spmi-iadc.yaml#
+      - $ref: /schemas/iio/adc/qcom,spmi-vadc.yaml#
 
   "^adc-tm@[0-9a-f]+$":
     type: object
@@ -112,11 +118,13 @@ patternProperties:
     type: object
     additionalProperties: true # FIXME qcom,pm8916-wcd-analog-codec binding not converted yet
 
-  "extcon@[0-9a-f]+$":
+  "^charger@[0-9a-f]+$":
     type: object
-    $ref: /schemas/extcon/qcom,pm8941-misc.yaml#
+    oneOf:
+      - $ref: /schemas/power/supply/qcom,pm8941-charger.yaml#
+      - $ref: /schemas/power/supply/qcom,pm8941-coincell.yaml#
 
-  "gpio(s)?@[0-9a-f]+$":
+  "gpio@[0-9a-f]+$":
     type: object
     $ref: /schemas/pinctrl/qcom,pmic-gpio.yaml#
 
@@ -124,10 +132,6 @@ patternProperties:
     type: object
     $ref: /schemas/power/reset/qcom,pon.yaml#
 
-  "pwm@[0-9a-f]+$":
-    type: object
-    $ref: /schemas/leds/leds-qcom-lpg.yaml#
-
   "^rtc@[0-9a-f]+$":
     type: object
     $ref: /schemas/rtc/qcom-pm8xxx-rtc.yaml#
@@ -136,9 +140,17 @@ patternProperties:
     type: object
     $ref: /schemas/thermal/qcom,spmi-temp-alarm.yaml#
 
+  "^usb-detect@[0-9a-f]+$":
+    type: object
+    $ref: /schemas/extcon/qcom,pm8941-misc.yaml#
+
+  "^usb-vbus-regulator@[0-9a-f]+$":
+    type: object
+    $ref: /schemas/regulator/qcom,usb-vbus-regulator.yaml#
+
   "^vibrator@[0-9a-f]+$":
     type: object
-    additionalProperties: true # FIXME qcom,pm8916-vib binding not converted yet
+    $ref: /schemas/input/qcom,pm8xxx-vib.yaml#
 
   "^mpps@[0-9a-f]+$":
     type: object
@@ -200,7 +212,7 @@ examples:
             #address-cells = <1>;
             #size-cells = <0>;
 
-            pmi8998_gpio: gpios@c000 {
+            pmi8998_gpio: gpio@c000 {
                 compatible = "qcom,pmi8998-gpio", "qcom,spmi-gpio";
                 reg = <0xc000>;
                 gpio-controller;
@@ -285,7 +297,7 @@ examples:
             };
         };
 
-        pm6150_gpio: gpios@c000 {
+        pm6150_gpio: gpio@c000 {
             compatible = "qcom,pm6150-gpio", "qcom,spmi-gpio";
             reg = <0xc000>;
             gpio-controller;
index b12809b5cc22efcf2757ed953b352ccb0854b897..adcae6c007d90e62e4661c2bdbb36b35656ac47c 100644 (file)
@@ -17,10 +17,12 @@ properties:
   compatible:
     items:
       - enum:
+          - qcom,msm8976-tcsr
           - qcom,msm8998-tcsr
           - qcom,qcs404-tcsr
           - qcom,sc7180-tcsr
           - qcom,sc7280-tcsr
+          - qcom,sc8280xp-tcsr
           - qcom,sdm630-tcsr
           - qcom,sdm845-tcsr
           - qcom,sm8150-tcsr
index bd6e4aecfe2b14d494335b53d6ce7ed75fc8652e..9acad9d326eb299d4c8ac9da0b41d23ee59c33a1 100644 (file)
@@ -15,11 +15,15 @@ description: |
 
 properties:
   compatible:
-    enum:
-      - qcom,pm8018
-      - qcom,pm8058
-      - qcom,pm8821
-      - qcom,pm8921
+    oneOf:
+      - enum:
+          - qcom,pm8058
+          - qcom,pm8821
+          - qcom,pm8921
+      - items:
+          - enum:
+              - qcom,pm8018
+          - const: qcom,pm8921
 
   reg:
     maxItems: 1
@@ -56,4 +60,23 @@ required:
   - interrupt-controller
 
 additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    ssbi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      pmic@0 {
+        compatible = "qcom,pm8921";
+        reg = <0>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+
+        interrupt-parent = <&tlmm>;
+        interrupts = <32 IRQ_TYPE_EDGE_RISING>;
+      };
+    };
 ...
index 5fbb94d2e4fae00fab14227f90402cc0ad1ebcc5..d6d120a78094293f918485518efac70f3ff0a476 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD71815 Power Management Integrated Circuit
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   BD71815AGW is a single-chip power management ICs for battery-powered
index d15ea8e9acad76f2ca793afc1f52d5e78ab95191..ec3adcd3483d4169702baa662dfc029a949e458a 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD71828 Power Management Integrated Circuit
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   BD71828GW is a single-chip power management IC for battery-powered portable
index 4aca765caee248f771595956fbb59a91df22de79..7aa343f58cb66f7f39fe54c20cb99b54b65552be 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD71837 Power Management Integrated Circuit
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   BD71837MWV is programmable Power Management ICs for powering single-core,
index e6491729715f90f83c060f1f8c5855b9f1bb23c5..7ab7b2c7f3e6ccec7ae144dc6f54751952594490 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD71847 and BD71850 Power Management Integrated Circuit
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   BD71847AMWV and BD71850MWV are programmable Power Management ICs for powering
index 34ff0a322f3a1239fdb35d0ca09f6a1ddbad8231..10f207a381782623e7ae58815b2abf38273240a4 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD9576MUF and BD9573MUF Power Management Integrated Circuit
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   BD9576MUF and BD9573MUF are power management ICs primarily intended for
index 4e4baf53796dea0b21981890667d65268a8da31f..1b01bd01043161821fd58f1db414d8a39d003fb2 100644 (file)
@@ -53,6 +53,7 @@ properties:
               - microchip,lan966x-cpu-syscon
               - microchip,sparx5-cpu-syscon
               - mstar,msc313-pmsleep
+              - nuvoton,wpcm450-shm
               - rockchip,px30-qos
               - rockchip,rk3036-qos
               - rockchip,rk3066-qos
index 34bf6a01436fad4d054d4a3244f6cf0137bc567d..23a63265be3c8cf09e7eb52bc17cc6823909c03f 100644 (file)
@@ -52,6 +52,9 @@ properties:
     type: object
     description: Magnetic reader
 
+  power-domains:
+    maxItems: 1
+
 required:
   - compatible
   - reg
index 873ee0c0973f1195691c99af6e8fc30ab5d44802..76ef4352e13ca890de242a7d32403e2dfded85b4 100644 (file)
@@ -26,7 +26,9 @@ properties:
   compatible:
     items:
       - enum:
+          - ti,j7200-system-controller
           - ti,j721e-system-controller
+          - ti,j721s2-system-controller
       - const: syscon
       - const: simple-mfd
 
index 14d9b42eda27da20c254ef88db4124915838f478..b2c229ed242370e146dce59f7d8dc78cb4130667 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD99954 Battery charger
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
   - Markus Laine <markus.laine@fi.rohmeurope.com>
   - Mikko Mutanen <mikko.mutanen@fi.rohmeurope.com>
 
index d61e8675f0672af651835b44ef378d5c93818a60..027fab3dc181b4873696ab8f8a9bdf782dd2b9d0 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD71815 Power Management Integrated Circuit regulators
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   This module is part of the ROHM BD718215 MFD device. For more details
index 5ce587fff9615904d7e1082de3572bd502043483..3cbe3b76ccee69311947d12e7073d04b1689ef19 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD71828 Power Management Integrated Circuit regulators
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   This module is part of the ROHM BD71828 MFD device. For more details
index 1941b36cf1efa6a9f9e00f5c87f66004472258a2..ab842817d847fb0514b52decec5196d92e4bb647 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD71837 Power Management Integrated Circuit regulators
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   List of regulators provided by this controller. BD71837 regulators node
index a1b8063738536bef5daaca6b3b647eb67d497867..65fc3d15f693f25cf93590b6e51203bfc205182b 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD71847 and BD71850 Power Management Integrated Circuit regulators
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   List of regulators provided by this controller. BD71847 regulators node
index 54be194bb2449a8bb5d4bc614852625642126040..89b8592db81d5cd1954c466b6228762dabae7daf 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: ROHM BD9576 and BD9573 Power Management Integrated Circuit regulators
 
 maintainers:
-  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+  - Matti Vaittinen <mazziesaccount@gmail.com>
 
 description: |
   This module is part of the ROHM BD9576 MFD device. For more details
diff --git a/Documentation/devicetree/bindings/timer/brcm,bcmbca-timer.yaml b/Documentation/devicetree/bindings/timer/brcm,bcmbca-timer.yaml
new file mode 100644 (file)
index 0000000..6707d97
--- /dev/null
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/brcm,bcmbca-timer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom Broadband SoC timer
+
+maintainers:
+  - RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+
+properties:
+  compatible:
+    oneOf:
+      - const: brcm,bcm6345-timer
+        description: >
+          An old block with 3 timers.
+
+          It can be found in BCM6345, BCM6838 and BCM63268.
+      - const: brcm,bcm63138-timer
+        description: >
+          Updated block with 4 timers and control regs at the beginning.
+
+          It can be found in newer SoCs, e.g. BCM63138, BCM63148, BCM63381,
+          BCM68360, BCM6848, BCM6858, BCM4908.
+
+  reg:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - reg
+
+examples:
+  - |
+    timer@fffe0200 {
+      compatible = "brcm,bcm6345-timer";
+      reg = <0xfffe0200 0x1c>;
+    };
index 7f0b7181e60a5dcccdb6d2acd3704563742ccea3..b701de08d60217535636b9b58a18243750199443 100644 (file)
@@ -15336,6 +15336,7 @@ F:      drivers/mfd/menelaus.c
 F:     drivers/mfd/palmas.c
 F:     drivers/mfd/tps65217.c
 F:     drivers/mfd/tps65218.c
+F:     drivers/mfd/tps65219.c
 F:     drivers/mfd/tps65910.c
 F:     drivers/mfd/twl-core.[ch]
 F:     drivers/mfd/twl4030*.c
index f3cf189c419b2d7f567f9a27de242d90b9f96583..5c2d0c06d2a53166b222743106d417dbb6010b74 100644 (file)
@@ -468,6 +468,16 @@ config INPUT_TPS65218_PWRBUTTON
          To compile this driver as a module, choose M here. The module will
          be called tps65218-pwrbutton.
 
+config INPUT_TPS65219_PWRBUTTON
+       tristate "TPS65219 Power button driver"
+       depends on MFD_TPS65219
+       help
+         Say Y here if you want to enable power button reporting for
+         TPS65219 Power Management IC devices.
+
+         To compile this driver as a module, choose M here. The module will
+         be called tps65219-pwrbutton.
+
 config INPUT_AXP20X_PEK
        tristate "X-Powers AXP20X power button driver"
        depends on MFD_AXP20X
@@ -662,17 +672,6 @@ config INPUT_DA9063_ONKEY
          To compile this driver as a module, choose M here: the module
          will be called da9063_onkey.
 
-config INPUT_DM355EVM
-       tristate "TI DaVinci DM355 EVM Keypad and IR Remote"
-       depends on MFD_DM355EVM_MSP
-       select INPUT_SPARSEKMAP
-       help
-         Supports the pushbuttons and IR remote used with
-         the DM355 EVM board.
-
-         To compile this driver as a module, choose M here: the
-         module will be called dm355evm_keys.
-
 config INPUT_WM831X_ON
        tristate "WM831X ON pin"
        depends on MFD_WM831X
index 6abefc41037b532faa35144d3c5c58c393ec5b17..61949263300d5a39d22770860c0d9159fc87dea8 100644 (file)
@@ -31,7 +31,6 @@ obj-$(CONFIG_INPUT_DA7280_HAPTICS)    += da7280.o
 obj-$(CONFIG_INPUT_DA9052_ONKEY)       += da9052_onkey.o
 obj-$(CONFIG_INPUT_DA9055_ONKEY)       += da9055_onkey.o
 obj-$(CONFIG_INPUT_DA9063_ONKEY)       += da9063_onkey.o
-obj-$(CONFIG_INPUT_DM355EVM)           += dm355evm_keys.o
 obj-$(CONFIG_INPUT_E3X0_BUTTON)                += e3x0-button.o
 obj-$(CONFIG_INPUT_DRV260X_HAPTICS)    += drv260x.o
 obj-$(CONFIG_INPUT_DRV2665_HAPTICS)    += drv2665.o
@@ -80,6 +79,7 @@ obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY)  += soc_button_array.o
 obj-$(CONFIG_INPUT_SPARCSPKR)          += sparcspkr.o
 obj-$(CONFIG_INPUT_STPMIC1_ONKEY)      += stpmic1_onkey.o
 obj-$(CONFIG_INPUT_TPS65218_PWRBUTTON) += tps65218-pwrbutton.o
+obj-$(CONFIG_INPUT_TPS65219_PWRBUTTON) += tps65219-pwrbutton.o
 obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON)  += twl4030-pwrbutton.o
 obj-$(CONFIG_INPUT_TWL4030_VIBRA)      += twl4030-vibra.o
 obj-$(CONFIG_INPUT_TWL6040_VIBRA)      += twl6040-vibra.o
diff --git a/drivers/input/misc/dm355evm_keys.c b/drivers/input/misc/dm355evm_keys.c
deleted file mode 100644 (file)
index 397ca7c..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * dm355evm_keys.c - support buttons and IR remote on DM355 EVM board
- *
- * Copyright (c) 2008 by David Brownell
- */
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/input.h>
-#include <linux/input/sparse-keymap.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-
-#include <linux/mfd/dm355evm_msp.h>
-#include <linux/module.h>
-
-
-/*
- * The MSP430 firmware on the DM355 EVM monitors on-board pushbuttons
- * and an IR receptor used for the remote control.  When any key is
- * pressed, or its autorepeat kicks in, an event is sent.  This driver
- * read those events from the small (32 event) queue and reports them.
- *
- * Note that physically there can only be one of these devices.
- *
- * This driver was tested with firmware revision A4.
- */
-struct dm355evm_keys {
-       struct input_dev        *input;
-       struct device           *dev;
-};
-
-/* These initial keycodes can be remapped */
-static const struct key_entry dm355evm_keys[] = {
-       /*
-        * Pushbuttons on the EVM board ... note that the labels for these
-        * are SW10/SW11/etc on the PC board.  The left/right orientation
-        * comes only from the firmware's documentation, and presumes the
-        * power connector is immediately in front of you and the IR sensor
-        * is to the right.  (That is, rotate the board counter-clockwise
-        * by 90 degrees from the SW10/etc and "DM355 EVM" labels.)
-        */
-       { KE_KEY, 0x00d8, { KEY_OK } },         /* SW12 */
-       { KE_KEY, 0x00b8, { KEY_UP } },         /* SW13 */
-       { KE_KEY, 0x00e8, { KEY_DOWN } },       /* SW11 */
-       { KE_KEY, 0x0078, { KEY_LEFT } },       /* SW14 */
-       { KE_KEY, 0x00f0, { KEY_RIGHT } },      /* SW10 */
-
-       /*
-        * IR buttons ... codes assigned to match the universal remote
-        * provided with the EVM (Philips PM4S) using DVD code 0020.
-        *
-        * These event codes match firmware documentation, but other
-        * remote controls could easily send more RC5-encoded events.
-        * The PM4S manual was used in several cases to help select
-        * a keycode reflecting the intended usage.
-        *
-        * RC5 codes are 14 bits, with two start bits (0x3 prefix)
-        * and a toggle bit (masked out below).
-        */
-       { KE_KEY, 0x300c, { KEY_POWER } },      /* NOTE: docs omit this */
-       { KE_KEY, 0x3000, { KEY_NUMERIC_0 } },
-       { KE_KEY, 0x3001, { KEY_NUMERIC_1 } },
-       { KE_KEY, 0x3002, { KEY_NUMERIC_2 } },
-       { KE_KEY, 0x3003, { KEY_NUMERIC_3 } },
-       { KE_KEY, 0x3004, { KEY_NUMERIC_4 } },
-       { KE_KEY, 0x3005, { KEY_NUMERIC_5 } },
-       { KE_KEY, 0x3006, { KEY_NUMERIC_6 } },
-       { KE_KEY, 0x3007, { KEY_NUMERIC_7 } },
-       { KE_KEY, 0x3008, { KEY_NUMERIC_8 } },
-       { KE_KEY, 0x3009, { KEY_NUMERIC_9 } },
-       { KE_KEY, 0x3022, { KEY_ENTER } },
-       { KE_KEY, 0x30ec, { KEY_MODE } },       /* "tv/vcr/..." */
-       { KE_KEY, 0x300f, { KEY_SELECT } },     /* "info" */
-       { KE_KEY, 0x3020, { KEY_CHANNELUP } },  /* "up" */
-       { KE_KEY, 0x302e, { KEY_MENU } },       /* "in/out" */
-       { KE_KEY, 0x3011, { KEY_VOLUMEDOWN } }, /* "left" */
-       { KE_KEY, 0x300d, { KEY_MUTE } },       /* "ok" */
-       { KE_KEY, 0x3010, { KEY_VOLUMEUP } },   /* "right" */
-       { KE_KEY, 0x301e, { KEY_SUBTITLE } },   /* "cc" */
-       { KE_KEY, 0x3021, { KEY_CHANNELDOWN } },/* "down" */
-       { KE_KEY, 0x3022, { KEY_PREVIOUS } },
-       { KE_KEY, 0x3026, { KEY_SLEEP } },
-       { KE_KEY, 0x3172, { KEY_REWIND } },     /* NOTE: docs wrongly say 0x30ca */
-       { KE_KEY, 0x3175, { KEY_PLAY } },
-       { KE_KEY, 0x3174, { KEY_FASTFORWARD } },
-       { KE_KEY, 0x3177, { KEY_RECORD } },
-       { KE_KEY, 0x3176, { KEY_STOP } },
-       { KE_KEY, 0x3169, { KEY_PAUSE } },
-};
-
-/*
- * Because we communicate with the MSP430 using I2C, and all I2C calls
- * in Linux sleep, we use a threaded IRQ handler.  The IRQ itself is
- * active low, but we go through the GPIO controller so we can trigger
- * on falling edges and not worry about enabling/disabling the IRQ in
- * the keypress handling path.
- */
-static irqreturn_t dm355evm_keys_irq(int irq, void *_keys)
-{
-       static u16 last_event;
-       struct dm355evm_keys *keys = _keys;
-       const struct key_entry *ke;
-       unsigned int keycode;
-       int status;
-       u16 event;
-
-       /* For simplicity we ignore INPUT_COUNT and just read
-        * events until we get the "queue empty" indicator.
-        * Reading INPUT_LOW decrements the count.
-        */
-       for (;;) {
-               status = dm355evm_msp_read(DM355EVM_MSP_INPUT_HIGH);
-               if (status < 0) {
-                       dev_dbg(keys->dev, "input high err %d\n",
-                                       status);
-                       break;
-               }
-               event = status << 8;
-
-               status = dm355evm_msp_read(DM355EVM_MSP_INPUT_LOW);
-               if (status < 0) {
-                       dev_dbg(keys->dev, "input low err %d\n",
-                                       status);
-                       break;
-               }
-               event |= status;
-               if (event == 0xdead)
-                       break;
-
-               /* Press and release a button:  two events, same code.
-                * Press and hold (autorepeat), then release: N events
-                * (N > 2), same code.  For RC5 buttons the toggle bits
-                * distinguish (for example) "1-autorepeat" from "1 1";
-                * but PCB buttons don't support that bit.
-                *
-                * So we must synthesize release events.  We do that by
-                * mapping events to a press/release event pair; then
-                * to avoid adding extra events, skip the second event
-                * of each pair.
-                */
-               if (event == last_event) {
-                       last_event = 0;
-                       continue;
-               }
-               last_event = event;
-
-               /* ignore the RC5 toggle bit */
-               event &= ~0x0800;
-
-               /* find the key, or report it as unknown */
-               ke = sparse_keymap_entry_from_scancode(keys->input, event);
-               keycode = ke ? ke->keycode : KEY_UNKNOWN;
-               dev_dbg(keys->dev,
-                       "input event 0x%04x--> keycode %d\n",
-                       event, keycode);
-
-               /* report press + release */
-               input_report_key(keys->input, keycode, 1);
-               input_sync(keys->input);
-               input_report_key(keys->input, keycode, 0);
-               input_sync(keys->input);
-       }
-
-       return IRQ_HANDLED;
-}
-
-/*----------------------------------------------------------------------*/
-
-static int dm355evm_keys_probe(struct platform_device *pdev)
-{
-       struct dm355evm_keys    *keys;
-       struct input_dev        *input;
-       int                     irq;
-       int                     error;
-
-       keys = devm_kzalloc(&pdev->dev, sizeof (*keys), GFP_KERNEL);
-       if (!keys)
-               return -ENOMEM;
-
-       input = devm_input_allocate_device(&pdev->dev);
-       if (!input)
-               return -ENOMEM;
-
-       keys->dev = &pdev->dev;
-       keys->input = input;
-
-       input->name = "DM355 EVM Controls";
-       input->phys = "dm355evm/input0";
-
-       input->id.bustype = BUS_I2C;
-       input->id.product = 0x0355;
-       input->id.version = dm355evm_msp_read(DM355EVM_MSP_FIRMREV);
-
-       error = sparse_keymap_setup(input, dm355evm_keys, NULL);
-       if (error)
-               return error;
-
-       /* REVISIT:  flush the event queue? */
-
-       /* set up "threaded IRQ handler" */
-       irq = platform_get_irq(pdev, 0);
-       if (irq < 0)
-               return irq;
-
-       error = devm_request_threaded_irq(&pdev->dev, irq,
-                                         NULL, dm355evm_keys_irq,
-                                         IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
-                                         dev_name(&pdev->dev), keys);
-       if (error)
-               return error;
-
-       /* register */
-       error = input_register_device(input);
-       if (error)
-               return error;
-
-       return 0;
-}
-
-/* REVISIT:  add suspend/resume when DaVinci supports it.  The IRQ should
- * be able to wake up the system.  When device_may_wakeup(&pdev->dev), call
- * enable_irq_wake() on suspend, and disable_irq_wake() on resume.
- */
-
-/*
- * I2C is used to talk to the MSP430, but this platform device is
- * exposed by an MFD driver that manages I2C communications.
- */
-static struct platform_driver dm355evm_keys_driver = {
-       .probe          = dm355evm_keys_probe,
-       .driver         = {
-               .name   = "dm355evm_keys",
-       },
-};
-module_platform_driver(dm355evm_keys_driver);
-
-MODULE_LICENSE("GPL");
diff --git a/drivers/input/misc/tps65219-pwrbutton.c b/drivers/input/misc/tps65219-pwrbutton.c
new file mode 100644 (file)
index 0000000..245134b
--- /dev/null
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Driver for TPS65219 Push Button
+//
+// Copyright (C) 2022 BayLibre Incorporated - https://www.baylibre.com/
+
+#include <linux/init.h>
+#include <linux/input.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/mfd/tps65219.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/slab.h>
+
+struct tps65219_pwrbutton {
+       struct device *dev;
+       struct input_dev *idev;
+       char phys[32];
+};
+
+static irqreturn_t tps65219_pb_push_irq(int irq, void *_pwr)
+{
+       struct tps65219_pwrbutton *pwr = _pwr;
+
+       input_report_key(pwr->idev, KEY_POWER, 1);
+       pm_wakeup_event(pwr->dev, 0);
+       input_sync(pwr->idev);
+
+       return IRQ_HANDLED;
+}
+
+static irqreturn_t tps65219_pb_release_irq(int irq, void *_pwr)
+{
+       struct tps65219_pwrbutton *pwr = _pwr;
+
+       input_report_key(pwr->idev, KEY_POWER, 0);
+       input_sync(pwr->idev);
+
+       return IRQ_HANDLED;
+}
+
+static int tps65219_pb_probe(struct platform_device *pdev)
+{
+       struct tps65219 *tps = dev_get_drvdata(pdev->dev.parent);
+       struct device *dev = &pdev->dev;
+       struct tps65219_pwrbutton *pwr;
+       struct input_dev *idev;
+       int error;
+       int push_irq;
+       int release_irq;
+
+       pwr = devm_kzalloc(dev, sizeof(*pwr), GFP_KERNEL);
+       if (!pwr)
+               return -ENOMEM;
+
+       idev = devm_input_allocate_device(dev);
+       if (!idev)
+               return -ENOMEM;
+
+       idev->name = pdev->name;
+       snprintf(pwr->phys, sizeof(pwr->phys), "%s/input0",
+                pdev->name);
+       idev->phys = pwr->phys;
+       idev->id.bustype = BUS_I2C;
+
+       input_set_capability(idev, EV_KEY, KEY_POWER);
+
+       pwr->dev = dev;
+       pwr->idev = idev;
+       device_init_wakeup(dev, true);
+
+       push_irq = platform_get_irq(pdev, 0);
+       if (push_irq < 0)
+               return -EINVAL;
+
+       release_irq = platform_get_irq(pdev, 1);
+       if (release_irq < 0)
+               return -EINVAL;
+
+       error = devm_request_threaded_irq(dev, push_irq, NULL,
+                                         tps65219_pb_push_irq,
+                                         IRQF_ONESHOT,
+                                         dev->init_name, pwr);
+       if (error) {
+               dev_err(dev, "failed to request push IRQ #%d: %d\n", push_irq,
+                       error);
+               return error;
+       }
+
+       error = devm_request_threaded_irq(dev, release_irq, NULL,
+                                         tps65219_pb_release_irq,
+                                         IRQF_ONESHOT,
+                                         dev->init_name, pwr);
+       if (error) {
+               dev_err(dev, "failed to request release IRQ #%d: %d\n",
+                       release_irq, error);
+               return error;
+       }
+
+       error = input_register_device(idev);
+       if (error) {
+               dev_err(dev, "Can't register power button: %d\n", error);
+               return error;
+       }
+
+       /* Enable interrupts for the pushbutton */
+       regmap_clear_bits(tps->regmap, TPS65219_REG_MASK_CONFIG,
+                         TPS65219_REG_MASK_INT_FOR_PB_MASK);
+
+       /* Set PB/EN/VSENSE pin to be a pushbutton */
+       regmap_update_bits(tps->regmap, TPS65219_REG_MFP_2_CONFIG,
+                          TPS65219_MFP_2_EN_PB_VSENSE_MASK, TPS65219_MFP_2_PB);
+
+       return 0;
+}
+
+static int tps65219_pb_remove(struct platform_device *pdev)
+{
+       struct tps65219 *tps = dev_get_drvdata(pdev->dev.parent);
+
+       /* Disable interrupt for the pushbutton */
+       return regmap_update_bits(tps->regmap, TPS65219_REG_MASK_CONFIG,
+                                 TPS65219_REG_MASK_INT_FOR_PB_MASK,
+                                 TPS65219_REG_MASK_INT_FOR_PB_MASK);
+}
+
+static const struct platform_device_id tps65219_pwrbtn_id_table[] = {
+       { "tps65219-pwrbutton", },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(platform, tps65219_pwrbtn_id_table);
+
+static struct platform_driver tps65219_pb_driver = {
+       .probe = tps65219_pb_probe,
+       .remove = tps65219_pb_remove,
+       .driver = {
+               .name = "tps65219_pwrbutton",
+       },
+       .id_table = tps65219_pwrbtn_id_table,
+};
+module_platform_driver(tps65219_pb_driver);
+
+MODULE_DESCRIPTION("TPS65219 Power Button");
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Markus Schneider-Pargmann <msp@baylibre.com");
index a30e47b7432705b842b98d0a6dc998b57ecf12de..4d9b61b927544f2850ac85ffe2e9975c8528b53f 100644 (file)
@@ -398,9 +398,8 @@ static struct regmap_irq_chip pm800_irq_chip = {
 
        .num_regs = 4,
        .status_base = PM800_INT_STATUS1,
-       .mask_base = PM800_INT_ENA_1,
+       .unmask_base = PM800_INT_ENA_1,
        .ack_base = PM800_INT_STATUS1,
-       .mask_invert = 1,
 };
 
 static int pm800_pages_init(struct pm80x_chip *chip)
@@ -528,8 +527,7 @@ out:
        return ret;
 }
 
-static int pm800_probe(struct i2c_client *client,
-                                const struct i2c_device_id *id)
+static int pm800_probe(struct i2c_client *client)
 {
        int ret = 0;
        struct pm80x_chip *chip;
@@ -597,9 +595,9 @@ static void pm800_remove(struct i2c_client *client)
 static struct i2c_driver pm800_driver = {
        .driver = {
                .name = "88PM800",
-               .pm = &pm80x_pm_ops,
+               .pm = pm_sleep_ptr(&pm80x_pm_ops),
                },
-       .probe = pm800_probe,
+       .probe_new = pm800_probe,
        .remove = pm800_remove,
        .id_table = pm80x_id_table,
 };
index 10d3637840c8cc152fba4411a0b5879459f89f7e..352f13cb14811b80ad1249e555eabf6225140cc8 100644 (file)
@@ -209,8 +209,7 @@ out_irq_init:
        return ret;
 }
 
-static int pm805_probe(struct i2c_client *client,
-                                const struct i2c_device_id *id)
+static int pm805_probe(struct i2c_client *client)
 {
        int ret = 0;
        struct pm80x_chip *chip;
@@ -252,9 +251,9 @@ static void pm805_remove(struct i2c_client *client)
 static struct i2c_driver pm805_driver = {
        .driver = {
                .name = "88PM805",
-               .pm = &pm80x_pm_ops,
+               .pm = pm_sleep_ptr(&pm80x_pm_ops),
                },
-       .probe = pm805_probe,
+       .probe_new = pm805_probe,
        .remove = pm805_remove,
        .id_table = pm80x_id_table,
 };
index be036e7e787b4096dc0533683981de26e2867f84..ac4f08565f29021ebd98f78bd4feae1de97565dc 100644 (file)
@@ -129,7 +129,6 @@ int pm80x_deinit(void)
 }
 EXPORT_SYMBOL_GPL(pm80x_deinit);
 
-#ifdef CONFIG_PM_SLEEP
 static int pm80x_suspend(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
@@ -153,10 +152,8 @@ static int pm80x_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
-SIMPLE_DEV_PM_OPS(pm80x_pm_ops, pm80x_suspend, pm80x_resume);
-EXPORT_SYMBOL_GPL(pm80x_pm_ops);
+EXPORT_GPL_SIMPLE_DEV_PM_OPS(pm80x_pm_ops, pm80x_suspend, pm80x_resume);
 
 MODULE_DESCRIPTION("I2C Driver for Marvell 88PM80x");
 MODULE_AUTHOR("Qiao Zhou <zhouqiao@marvell.com>");
index 5dc86dd66202f4becb82dac4c5af22a779cc53e6..6ba7169cb953aa0bf3782e8a62d3fa37ec178b50 100644 (file)
@@ -1212,7 +1212,6 @@ static void pm860x_remove(struct i2c_client *client)
        }
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int pm860x_suspend(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
@@ -1232,9 +1231,8 @@ static int pm860x_resume(struct device *dev)
                disable_irq_wake(chip->core_irq);
        return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(pm860x_pm_ops, pm860x_suspend, pm860x_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pm860x_pm_ops, pm860x_suspend, pm860x_resume);
 
 static const struct i2c_device_id pm860x_id_table[] = {
        { "88PM860x", 0 },
@@ -1251,7 +1249,7 @@ MODULE_DEVICE_TABLE(of, pm860x_dt_ids);
 static struct i2c_driver pm860x_driver = {
        .driver = {
                .name   = "88PM860x",
-               .pm     = &pm860x_pm_ops,
+               .pm     = pm_sleep_ptr(&pm860x_pm_ops),
                .of_match_table = pm860x_dt_ids,
        },
        .probe_new      = pm860x_probe,
index 8b93856de432aeede26b670ec190ea45260569b0..30db49f3186680ae02892295a30e3d857fae7dfe 100644 (file)
@@ -77,6 +77,18 @@ config MFD_AS3711
        help
          Support for the AS3711 PMIC from AMS
 
+config MFD_SMPRO
+       tristate "Ampere Computing SMpro core driver"
+       depends on I2C
+       select MFD_CORE
+       select REGMAP_I2C
+       help
+         Say yes here to enable SMpro driver support for Ampere's Altra
+         processor family.
+
+         Ampere's Altra SMpro exposes an I2C regmap interface that can
+         be accessed by child devices.
+
 config MFD_AS3722
        tristate "ams AS3722 Power Management IC"
        select MFD_CORE
@@ -547,15 +559,6 @@ config HTC_PASIC3
          HTC Magician devices, respectively. Actual functionality is
          handled by the leds-pasic3 and ds1wm drivers.
 
-config HTC_I2CPLD
-       bool "HTC I2C PLD chip support"
-       depends on I2C=y && GPIOLIB
-       help
-         If you say yes here you get support for the supposed CPLD
-         found on omap850 HTC devices like the HTC Wizard and HTC Herald.
-         This device provides input and output GPIOs through an I2C
-         interface to one or more sub-chips.
-
 config MFD_INTEL_QUARK_I2C_GPIO
        tristate "Intel Quark MFD I2C GPIO"
        depends on PCI
@@ -591,7 +594,7 @@ config INTEL_SOC_PMIC
        bool "Support for Crystal Cove PMIC"
        depends on HAS_IOMEM && I2C=y && GPIOLIB && COMMON_CLK
        depends on (X86 && ACPI) || COMPILE_TEST
-       depends on I2C_DESIGNWARE_PLATFORM=y
+       depends on I2C_DESIGNWARE_PLATFORM=y || COMPILE_TEST
        select MFD_CORE
        select REGMAP_I2C
        select REGMAP_IRQ
@@ -794,7 +797,7 @@ config MFD_MAX14577
 config MFD_MAX77620
        bool "Maxim Semiconductor MAX77620 and MAX20024 PMIC Support"
        depends on I2C=y
-       depends on OF || COMPILE_TEST
+       depends on OF
        select MFD_CORE
        select REGMAP_I2C
        select REGMAP_IRQ
@@ -809,7 +812,7 @@ config MFD_MAX77620
 config MFD_MAX77650
        tristate "Maxim MAX77650/77651 PMIC Support"
        depends on I2C
-       depends on OF || COMPILE_TEST
+       depends on OF
        select MFD_CORE
        select REGMAP_I2C
        select REGMAP_IRQ
@@ -824,7 +827,7 @@ config MFD_MAX77650
 config MFD_MAX77686
        tristate "Maxim Semiconductor MAX77686/802 PMIC Support"
        depends on I2C
-       depends on OF || COMPILE_TEST
+       depends on OF
        select MFD_CORE
        select REGMAP_I2C
        select REGMAP_IRQ
@@ -853,7 +856,7 @@ config MFD_MAX77693
 config MFD_MAX77714
        tristate "Maxim Semiconductor MAX77714 PMIC Support"
        depends on I2C
-       depends on OF || COMPILE_TEST
+       depends on OF
        select MFD_CORE
        select REGMAP_I2C
        help
@@ -1010,7 +1013,7 @@ config EZX_PCAP
 config MFD_CPCAP
        tristate "Support for Motorola CPCAP"
        depends on SPI
-       depends on OF || COMPILE_TEST
+       depends on OF
        select MFD_CORE
        select REGMAP_SPI
        select REGMAP_IRQ
@@ -1035,7 +1038,7 @@ config MFD_VIPERBOARD
 
 config MFD_NTXEC
        tristate "Netronix embedded controller (EC)"
-       depends on OF || COMPILE_TEST
+       depends on OF
        depends on I2C
        select REGMAP_I2C
        select MFD_CORE
@@ -1231,7 +1234,7 @@ config MFD_RN5T618
 config MFD_SEC_CORE
        tristate "Samsung Electronics PMIC Series Support"
        depends on I2C=y
-       depends on OF || COMPILE_TEST
+       depends on OF
        select MFD_CORE
        select REGMAP_I2C
        select REGMAP_IRQ
@@ -1432,11 +1435,6 @@ config MFD_SYSCON
          Select this option to enable accessing system control registers
          via regmap.
 
-config MFD_DAVINCI_VOICECODEC
-       tristate
-       select MFD_CORE
-       select REGMAP_MMIO
-
 config MFD_TI_AM335X_TSCADC
        tristate "TI ADC / Touch Screen chip support"
        select MFD_CORE
@@ -1448,14 +1446,6 @@ config MFD_TI_AM335X_TSCADC
          To compile this driver as a module, choose M here: the
          module will be called ti_am335x_tscadc.
 
-config MFD_DM355EVM_MSP
-       bool "TI DaVinci DM355 EVM microcontroller"
-       depends on I2C=y && MACH_DAVINCI_DM355_EVM
-       help
-         This driver supports the MSP430 microcontroller used on these
-         boards.  MSP430 firmware manages resets and power sequencing,
-         inputs from buttons and the IR remote, LEDs, an RTC, and more.
-
 config MFD_LP3943
        tristate "TI/National Semiconductor LP3943 MFD Driver"
        depends on I2C
@@ -1499,7 +1489,7 @@ config MFD_OMAP_USB_HOST
          OMAP USB Host drivers.
 
 config MFD_PALMAS
-       bool "TI Palmas series chips"
+       tristate "TI Palmas series chips"
        select MFD_CORE
        select REGMAP_I2C
        select REGMAP_IRQ
@@ -1635,6 +1625,20 @@ config MFD_TPS65218
          This driver can also be built as a module.  If so, the module
          will be called tps65218.
 
+config MFD_TPS65219
+       tristate "TI TPS65219 Power Management IC"
+       depends on I2C && OF
+       select MFD_CORE
+       select REGMAP_I2C
+       select REGMAP_IRQ
+       help
+         If you say yes here you get support for the TPS65219 series of Power
+         Management ICs. These include voltage regulators, GPIOs and
+         push/power button that is often used in portable devices.
+
+         This driver can also be built as a module. If so, the module
+         will be called tps65219.
+
 config MFD_TPS6586X
        bool "TI TPS6586x Power Management chips"
        depends on I2C=y
@@ -2027,6 +2031,7 @@ config MFD_ROHM_BD957XMUF
        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 BD9576MUF and
@@ -2077,7 +2082,7 @@ config MFD_STPMIC1
 config MFD_STMFX
        tristate "Support for STMicroelectronics Multi-Function eXpander (STMFX)"
        depends on I2C
-       depends on OF || COMPILE_TEST
+       depends on OF
        select MFD_CORE
        select REGMAP_I2C
        help
index 7ed3ef4a698cf2299404b58cee9c09e44c154b21..457471478a9379a6a9b06421d8041f3737f4b2f6 100644 (file)
@@ -19,13 +19,9 @@ obj-$(CONFIG_MFD_EXYNOS_LPASS)       += exynos-lpass.o
 obj-$(CONFIG_MFD_GATEWORKS_GSC)        += gateworks-gsc.o
 
 obj-$(CONFIG_HTC_PASIC3)       += htc-pasic3.o
-obj-$(CONFIG_HTC_I2CPLD)       += htc-i2cpld.o
 
 obj-$(CONFIG_MFD_TI_LP873X)    += lp873x.o
 obj-$(CONFIG_MFD_TI_LP87565)   += lp87565.o
-
-obj-$(CONFIG_MFD_DAVINCI_VOICECODEC)   += davinci_voicecodec.o
-obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o
 obj-$(CONFIG_MFD_TI_AM335X_TSCADC)     += ti_am335x_tscadc.o
 
 obj-$(CONFIG_MFD_STA2X11)      += sta2x11-mfd.o
@@ -101,6 +97,7 @@ obj-$(CONFIG_TPS6507X)               += tps6507x.o
 obj-$(CONFIG_MFD_TPS65086)     += tps65086.o
 obj-$(CONFIG_MFD_TPS65217)     += tps65217.o
 obj-$(CONFIG_MFD_TPS65218)     += tps65218.o
+obj-$(CONFIG_MFD_TPS65219)     += tps65219.o
 obj-$(CONFIG_MFD_TPS65910)     += tps65910.o
 obj-$(CONFIG_MFD_TPS65912)     += tps65912-core.o
 obj-$(CONFIG_MFD_TPS65912_I2C) += tps65912-i2c.o
@@ -271,6 +268,7 @@ obj-$(CONFIG_MFD_QCOM_PM8008)       += qcom-pm8008.o
 
 obj-$(CONFIG_SGI_MFD_IOC3)     += ioc3.o
 obj-$(CONFIG_MFD_SIMPLE_MFD_I2C)       += simple-mfd-i2c.o
+obj-$(CONFIG_MFD_SMPRO)                += smpro-core.o
 obj-$(CONFIG_MFD_INTEL_M10_BMC)   += intel-m10-bmc.o
 
 obj-$(CONFIG_MFD_ATC260X)      += atc260x-core.o
index a17cf759739d0f67911b0c7377b5404f2314f163..f253da5b246becccc2f7c89d061cab2a2f695687 100644 (file)
@@ -332,8 +332,7 @@ static inline void aat2870_init_debugfs(struct aat2870_data *aat2870)
 }
 #endif /* CONFIG_DEBUG_FS */
 
-static int aat2870_i2c_probe(struct i2c_client *client,
-                            const struct i2c_device_id *id)
+static int aat2870_i2c_probe(struct i2c_client *client)
 {
        struct aat2870_platform_data *pdata = dev_get_platdata(&client->dev);
        struct aat2870_data *aat2870;
@@ -409,7 +408,6 @@ out_disable:
        return ret;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int aat2870_i2c_suspend(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
@@ -438,10 +436,9 @@ static int aat2870_i2c_resume(struct device *dev)
 
        return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
-                        aat2870_i2c_resume);
+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 },
@@ -451,10 +448,10 @@ static const struct i2c_device_id aat2870_i2c_id_table[] = {
 static struct i2c_driver aat2870_i2c_driver = {
        .driver = {
                .name                   = "aat2870",
-               .pm                     = &aat2870_pm_ops,
+               .pm                     = pm_sleep_ptr(&aat2870_pm_ops),
                .suppress_bind_attrs    = true,
        },
-       .probe          = aat2870_i2c_probe,
+       .probe_new      = aat2870_i2c_probe,
        .id_table       = aat2870_i2c_id_table,
 };
 
index d3520430997c36ddc4295d4cc2c5bdda1ad5019c..bcf0fda15f0c32b005ee450338c638fc33342aec 100644 (file)
@@ -28,8 +28,7 @@ static const struct regmap_config act8945a_regmap_config = {
        .val_bits = 8,
 };
 
-static int act8945a_i2c_probe(struct i2c_client *i2c,
-                             const struct i2c_device_id *id)
+static int act8945a_i2c_probe(struct i2c_client *i2c)
 {
        int ret;
        struct regmap *regmap;
@@ -71,7 +70,7 @@ static struct i2c_driver act8945a_i2c_driver = {
                   .name = "act8945a",
                   .of_match_table = of_match_ptr(act8945a_of_match),
        },
-       .probe = act8945a_i2c_probe,
+       .probe_new = act8945a_i2c_probe,
        .id_table = act8945a_i2c_id,
 };
 
index 8db15f5a7179ff993650b1559789decc95e6eacb..cb168efdbafe8bd4c39839bcdd2f81545f243410 100644 (file)
@@ -204,9 +204,9 @@ static int adp5520_remove_subdevs(struct adp5520_chip *chip)
        return device_for_each_child(chip->dev, NULL, __remove_subdev);
 }
 
-static int adp5520_probe(struct i2c_client *client,
-                                       const struct i2c_device_id *id)
+static int adp5520_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(client);
        struct adp5520_platform_data *pdata = dev_get_platdata(&client->dev);
        struct platform_device *pdev;
        struct adp5520_chip *chip;
@@ -305,7 +305,6 @@ out_free_irq:
        return ret;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int adp5520_suspend(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
@@ -326,9 +325,8 @@ static int adp5520_resume(struct device *dev)
        adp5520_write(chip->dev, ADP5520_MODE_STATUS, chip->mode);
        return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(adp5520_pm, adp5520_suspend, adp5520_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(adp5520_pm, adp5520_suspend, adp5520_resume);
 
 static const struct i2c_device_id adp5520_id[] = {
        { "pmic-adp5520", ID_ADP5520 },
@@ -339,10 +337,10 @@ static const struct i2c_device_id adp5520_id[] = {
 static struct i2c_driver adp5520_driver = {
        .driver = {
                .name                   = "adp5520",
-               .pm                     = &adp5520_pm,
+               .pm                     = pm_sleep_ptr(&adp5520_pm),
                .suppress_bind_attrs    = true,
        },
-       .probe          = adp5520_probe,
+       .probe_new      = adp5520_probe,
        .id_table       = adp5520_id,
 };
 builtin_i2c_driver(adp5520_driver);
index cbf1dd90b70d54968b95ca8f94f5503a492d9348..bd7ee3260d53f697c63620679a0630c2633d16c6 100644 (file)
@@ -480,7 +480,6 @@ static int wm5102_clear_write_sequencer(struct arizona *arizona)
        return 0;
 }
 
-#ifdef CONFIG_PM
 static int arizona_isolate_dcvdd(struct arizona *arizona)
 {
        int ret;
@@ -742,9 +741,7 @@ static int arizona_runtime_suspend(struct device *dev)
 
        return 0;
 }
-#endif
 
-#ifdef CONFIG_PM_SLEEP
 static int arizona_suspend(struct device *dev)
 {
        struct arizona *arizona = dev_get_drvdata(dev);
@@ -784,17 +781,15 @@ static int arizona_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
-const struct dev_pm_ops arizona_pm_ops = {
-       SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
-                          arizona_runtime_resume,
-                          NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
-       SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
-                                     arizona_resume_noirq)
+EXPORT_GPL_DEV_PM_OPS(arizona_pm_ops) = {
+       RUNTIME_PM_OPS(arizona_runtime_suspend,
+                      arizona_runtime_resume,
+                      NULL)
+       SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
+       NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
+                                 arizona_resume_noirq)
 };
-EXPORT_SYMBOL_GPL(arizona_pm_ops);
 
 #ifdef CONFIG_OF
 static int arizona_of_get_core_pdata(struct arizona *arizona)
index bfc7cf56ff2c7401b1b4d6ebee50ac08fdfc0915..b2301586adbc564f800b0486ca57d285b037ab5f 100644 (file)
@@ -20,9 +20,9 @@
 
 #include "arizona.h"
 
-static int arizona_i2c_probe(struct i2c_client *i2c,
-                            const struct i2c_device_id *id)
+static int arizona_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        const void *match_data;
        struct arizona *arizona;
        const struct regmap_config *regmap_config = NULL;
@@ -117,10 +117,10 @@ static const struct of_device_id arizona_i2c_of_match[] = {
 static struct i2c_driver arizona_i2c_driver = {
        .driver = {
                .name   = "arizona",
-               .pm     = &arizona_pm_ops,
+               .pm     = pm_ptr(&arizona_pm_ops),
                .of_match_table = of_match_ptr(arizona_i2c_of_match),
        },
-       .probe          = arizona_i2c_probe,
+       .probe_new      = arizona_i2c_probe,
        .remove         = arizona_i2c_remove,
        .id_table       = arizona_i2c_id,
 };
index 941b0267d09d41a1143711a1f7ff7f7851b61d35..da05b966d48c63c8b76920fe7e59ca2d31ddd659 100644 (file)
@@ -282,7 +282,7 @@ static const struct of_device_id arizona_spi_of_match[] = {
 static struct spi_driver arizona_spi_driver = {
        .driver = {
                .name   = "arizona",
-               .pm     = &arizona_pm_ops,
+               .pm     = pm_ptr(&arizona_pm_ops),
                .of_match_table = of_match_ptr(arizona_spi_of_match),
                .acpi_match_table = ACPI_PTR(arizona_acpi_match),
        },
index 3adaec6c37dfd9b6b9271406eb9eaf8fdbd00db5..3facfdd28e81fd00c392c041bab3d3bf9b80e0ae 100644 (file)
@@ -116,8 +116,7 @@ static const struct of_device_id as3711_of_match[] = {
 };
 #endif
 
-static int as3711_i2c_probe(struct i2c_client *client,
-                           const struct i2c_device_id *id)
+static int as3711_i2c_probe(struct i2c_client *client)
 {
        struct as3711 *as3711;
        struct as3711_platform_data *pdata;
@@ -202,7 +201,7 @@ static struct i2c_driver as3711_i2c_driver = {
                   .name = "as3711",
                   .of_match_table = of_match_ptr(as3711_of_match),
        },
-       .probe = as3711_i2c_probe,
+       .probe_new = as3711_i2c_probe,
        .id_table = as3711_i2c_id,
 };
 
index 38665efae4f005f96f4a99dfd4a1640cda7c5476..b6dda0eb86456a104c5bdf9ddf5012421c415c4d 100644 (file)
@@ -333,8 +333,7 @@ static int as3722_i2c_of_probe(struct i2c_client *i2c,
        return 0;
 }
 
-static int as3722_i2c_probe(struct i2c_client *i2c,
-                       const struct i2c_device_id *id)
+static int as3722_i2c_probe(struct i2c_client *i2c)
 {
        struct as3722 *as3722;
        unsigned long irq_flags;
@@ -446,7 +445,7 @@ static struct i2c_driver as3722_i2c_driver = {
                .of_match_table = as3722_of_match,
                .pm = &as3722_pm_ops,
        },
-       .probe = as3722_i2c_probe,
+       .probe_new = as3722_i2c_probe,
        .id_table = as3722_i2c_id,
 };
 
index 7148ff5b05b178fd1ea49a522fb386970767a454..7c5de3ae776e5c8e79a4104b8110340d2cf2f0ec 100644 (file)
@@ -100,8 +100,7 @@ static const struct regmap_irq_chip atc2603c_regmap_irq_chip = {
        .num_irqs = ARRAY_SIZE(atc2603c_regmap_irqs),
        .num_regs = 1,
        .status_base = ATC2603C_INTS_PD,
-       .mask_base = ATC2603C_INTS_MSK,
-       .mask_invert = true,
+       .unmask_base = ATC2603C_INTS_MSK,
 };
 
 static const struct regmap_irq_chip atc2609a_regmap_irq_chip = {
@@ -110,8 +109,7 @@ static const struct regmap_irq_chip atc2609a_regmap_irq_chip = {
        .num_irqs = ARRAY_SIZE(atc2609a_regmap_irqs),
        .num_regs = 1,
        .status_base = ATC2609A_INTS_PD,
-       .mask_base = ATC2609A_INTS_MSK,
-       .mask_invert = true,
+       .unmask_base = ATC2609A_INTS_MSK,
 };
 
 static const struct resource atc2603c_onkey_resources[] = {
index 5855efd09efc4831c69fa8ac09e530fbd4533f83..19e248ed79665a277eaf7dfbe92715a2a33b5259 100644 (file)
@@ -12,8 +12,7 @@
 #include <linux/of.h>
 #include <linux/regmap.h>
 
-static int atc260x_i2c_probe(struct i2c_client *client,
-                            const struct i2c_device_id *id)
+static int atc260x_i2c_probe(struct i2c_client *client)
 {
        struct atc260x *atc260x;
        struct regmap_config regmap_cfg;
@@ -54,7 +53,7 @@ static struct i2c_driver atc260x_i2c_driver = {
                .name = "atc260x",
                .of_match_table = of_match_ptr(atc260x_i2c_of_match),
        },
-       .probe = atc260x_i2c_probe,
+       .probe_new = atc260x_i2c_probe,
 };
 module_i2c_driver(atc260x_i2c_driver);
 
index 8fd6727dc30a1ee5ca428d77b2a0f081a5044f77..f49fbd30795892b2e4204fc19ebf60d478ce09ef 100644 (file)
@@ -22,8 +22,7 @@
 #include <linux/regmap.h>
 #include <linux/slab.h>
 
-static int axp20x_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int axp20x_i2c_probe(struct i2c_client *i2c)
 {
        struct axp20x_dev *axp20x;
        int ret;
@@ -100,7 +99,7 @@ static struct i2c_driver axp20x_i2c_driver = {
                .of_match_table = of_match_ptr(axp20x_i2c_of_match),
                .acpi_match_table = ACPI_PTR(axp20x_i2c_acpi_match),
        },
-       .probe          = axp20x_i2c_probe,
+       .probe_new      = axp20x_i2c_probe,
        .remove         = axp20x_i2c_remove,
        .id_table       = axp20x_i2c_id,
 };
index 88a212a8168cf8b869e62f5f362c5c8f48d2eebe..47fd700f284f1e444505ee3bdcb60208e1d1c841 100644 (file)
@@ -506,8 +506,7 @@ static const struct regmap_irq_chip axp152_regmap_irq_chip = {
        .name                   = "axp152_irq_chip",
        .status_base            = AXP152_IRQ1_STATE,
        .ack_base               = AXP152_IRQ1_STATE,
-       .mask_base              = AXP152_IRQ1_EN,
-       .mask_invert            = true,
+       .unmask_base            = AXP152_IRQ1_EN,
        .init_ack_masked        = true,
        .irqs                   = axp152_regmap_irqs,
        .num_irqs               = ARRAY_SIZE(axp152_regmap_irqs),
@@ -518,8 +517,7 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
        .name                   = "axp20x_irq_chip",
        .status_base            = AXP20X_IRQ1_STATE,
        .ack_base               = AXP20X_IRQ1_STATE,
-       .mask_base              = AXP20X_IRQ1_EN,
-       .mask_invert            = true,
+       .unmask_base            = AXP20X_IRQ1_EN,
        .init_ack_masked        = true,
        .irqs                   = axp20x_regmap_irqs,
        .num_irqs               = ARRAY_SIZE(axp20x_regmap_irqs),
@@ -531,8 +529,7 @@ static const struct regmap_irq_chip axp22x_regmap_irq_chip = {
        .name                   = "axp22x_irq_chip",
        .status_base            = AXP20X_IRQ1_STATE,
        .ack_base               = AXP20X_IRQ1_STATE,
-       .mask_base              = AXP20X_IRQ1_EN,
-       .mask_invert            = true,
+       .unmask_base            = AXP20X_IRQ1_EN,
        .init_ack_masked        = true,
        .irqs                   = axp22x_regmap_irqs,
        .num_irqs               = ARRAY_SIZE(axp22x_regmap_irqs),
@@ -543,8 +540,7 @@ static const struct regmap_irq_chip axp288_regmap_irq_chip = {
        .name                   = "axp288_irq_chip",
        .status_base            = AXP20X_IRQ1_STATE,
        .ack_base               = AXP20X_IRQ1_STATE,
-       .mask_base              = AXP20X_IRQ1_EN,
-       .mask_invert            = true,
+       .unmask_base            = AXP20X_IRQ1_EN,
        .init_ack_masked        = true,
        .irqs                   = axp288_regmap_irqs,
        .num_irqs               = ARRAY_SIZE(axp288_regmap_irqs),
@@ -556,8 +552,7 @@ static const struct regmap_irq_chip axp803_regmap_irq_chip = {
        .name                   = "axp803",
        .status_base            = AXP20X_IRQ1_STATE,
        .ack_base               = AXP20X_IRQ1_STATE,
-       .mask_base              = AXP20X_IRQ1_EN,
-       .mask_invert            = true,
+       .unmask_base            = AXP20X_IRQ1_EN,
        .init_ack_masked        = true,
        .irqs                   = axp803_regmap_irqs,
        .num_irqs               = ARRAY_SIZE(axp803_regmap_irqs),
@@ -568,8 +563,7 @@ static const struct regmap_irq_chip axp806_regmap_irq_chip = {
        .name                   = "axp806",
        .status_base            = AXP20X_IRQ1_STATE,
        .ack_base               = AXP20X_IRQ1_STATE,
-       .mask_base              = AXP20X_IRQ1_EN,
-       .mask_invert            = true,
+       .unmask_base            = AXP20X_IRQ1_EN,
        .init_ack_masked        = true,
        .irqs                   = axp806_regmap_irqs,
        .num_irqs               = ARRAY_SIZE(axp806_regmap_irqs),
@@ -580,8 +574,7 @@ static const struct regmap_irq_chip axp809_regmap_irq_chip = {
        .name                   = "axp809",
        .status_base            = AXP20X_IRQ1_STATE,
        .ack_base               = AXP20X_IRQ1_STATE,
-       .mask_base              = AXP20X_IRQ1_EN,
-       .mask_invert            = true,
+       .unmask_base            = AXP20X_IRQ1_EN,
        .init_ack_masked        = true,
        .irqs                   = axp809_regmap_irqs,
        .num_irqs               = ARRAY_SIZE(axp809_regmap_irqs),
@@ -842,7 +835,7 @@ static void axp20x_power_off(void)
                     AXP20X_OFF);
 
        /* Give capacitors etc. time to drain to avoid kernel panic msg. */
-       msleep(500);
+       mdelay(500);
 }
 
 int axp20x_match_device(struct axp20x_dev *axp20x)
index 6ca337cde84c881fd99de411419822e398b4253a..251d515478d55fbb9854dc544443cf45024afda4 100644 (file)
@@ -38,8 +38,7 @@ static const struct regmap_config bcm590xx_regmap_config_sec = {
        .cache_type     = REGCACHE_RBTREE,
 };
 
-static int bcm590xx_i2c_probe(struct i2c_client *i2c_pri,
-                             const struct i2c_device_id *id)
+static int bcm590xx_i2c_probe(struct i2c_client *i2c_pri)
 {
        struct bcm590xx *bcm590xx;
        int ret;
@@ -109,7 +108,7 @@ static struct i2c_driver bcm590xx_i2c_driver = {
                   .name = "bcm590xx",
                   .of_match_table = bcm590xx_of_match,
        },
-       .probe = bcm590xx_i2c_probe,
+       .probe_new = bcm590xx_i2c_probe,
        .id_table = bcm590xx_i2c_id,
 };
 module_i2c_driver(bcm590xx_i2c_driver);
index e15b1acfb06301d62ad3b501e8203610bb79c5e5..60dc858c8117a8075955aaced93db782a6456390 100644 (file)
@@ -204,8 +204,7 @@ static int bd957x_identify(struct device *dev, struct regmap *regmap)
        return 0;
 }
 
-static int bd9571mwv_probe(struct i2c_client *client,
-                          const struct i2c_device_id *ids)
+static int bd9571mwv_probe(struct i2c_client *client)
 {
        const struct regmap_config *regmap_config;
        const struct regmap_irq_chip *irq_chip;
@@ -279,7 +278,7 @@ static struct i2c_driver bd9571mwv_driver = {
                .name   = "bd9571mwv",
                .of_match_table = bd9571mwv_of_match_table,
        },
-       .probe          = bd9571mwv_probe,
+       .probe_new      = bd9571mwv_probe,
        .id_table       = bd9571mwv_id_table,
 };
 module_i2c_driver(bd9571mwv_driver);
index 3f8f6ad3a98c41f3a643439cdbc57d5500348454..44a25d642ce94f4715ea3af3eee82b9d6b207159 100644 (file)
@@ -488,9 +488,9 @@ failed:
        return ret;
 }
 
-static int da903x_probe(struct i2c_client *client,
-                                 const struct i2c_device_id *id)
+static int da903x_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(client);
        struct da903x_platform_data *pdata = dev_get_platdata(&client->dev);
        struct da903x_chip *chip;
        unsigned int tmp;
@@ -543,7 +543,7 @@ static struct i2c_driver da903x_driver = {
        .driver = {
                .name   = "da903x",
        },
-       .probe          = da903x_probe,
+       .probe_new      = da903x_probe,
        .remove         = da903x_remove,
        .id_table       = da903x_id_table,
 };
index 5a74696c8704ff7ea0c3bcd974e8816c4215bf93..ecb8077cdaaf9bb85a541b5feff668b885ae77e1 100644 (file)
@@ -126,9 +126,9 @@ static const struct of_device_id dialog_dt_ids[] = {
 };
 #endif
 
-static int da9052_i2c_probe(struct i2c_client *client,
-                                      const struct i2c_device_id *id)
+static int da9052_i2c_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(client);
        struct da9052 *da9052;
        int ret;
 
@@ -176,7 +176,7 @@ static void da9052_i2c_remove(struct i2c_client *client)
 }
 
 static struct i2c_driver da9052_i2c_driver = {
-       .probe = da9052_i2c_probe,
+       .probe_new = da9052_i2c_probe,
        .remove = da9052_i2c_remove,
        .id_table = da9052_i2c_id,
        .driver = {
index 276c7d1c509e0e2439f86a8ceecb39855d3a63cb..702abff506a1a49eae25f99b5b2660569946492d 100644 (file)
@@ -15,8 +15,7 @@
 
 #include <linux/mfd/da9055/core.h>
 
-static int da9055_i2c_probe(struct i2c_client *i2c,
-                                     const struct i2c_device_id *id)
+static int da9055_i2c_probe(struct i2c_client *i2c)
 {
        struct da9055 *da9055;
        int ret;
@@ -67,7 +66,7 @@ static const struct of_device_id da9055_of_match[] = {
 };
 
 static struct i2c_driver da9055_i2c_driver = {
-       .probe = da9055_i2c_probe,
+       .probe_new = da9055_i2c_probe,
        .remove = da9055_i2c_remove,
        .id_table = da9055_i2c_id,
        .driver = {
index a26e473507c7110614af8ec1e459b5d73848bcc8..40cde51e57198f76e9b8cfa3483543e8a8e76214 100644 (file)
@@ -621,9 +621,9 @@ static const struct of_device_id da9062_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, da9062_dt_ids);
 
-static int da9062_i2c_probe(struct i2c_client *i2c,
-       const struct i2c_device_id *id)
+static int da9062_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct da9062 *chip;
        unsigned int irq_base;
        const struct mfd_cell *cell;
@@ -744,7 +744,7 @@ static struct i2c_driver da9062_i2c_driver = {
                .name = "da9062",
                .of_match_table = da9062_dt_ids,
        },
-       .probe    = da9062_i2c_probe,
+       .probe_new = da9062_i2c_probe,
        .remove   = da9062_i2c_remove,
        .id_table = da9062_i2c_id,
 };
index 343ed6e96d87e55102c1e8a0eb56b3ab1978a306..03f8f95a1d62c20450211f648a5b570ecee2c310 100644 (file)
@@ -351,9 +351,9 @@ static const struct of_device_id da9063_dt_ids[] = {
        { }
 };
 MODULE_DEVICE_TABLE(of, da9063_dt_ids);
-static int da9063_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int da9063_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct da9063 *da9063;
        int ret;
 
@@ -469,7 +469,7 @@ static struct i2c_driver da9063_i2c_driver = {
                .name = "da9063",
                .of_match_table = da9063_dt_ids,
        },
-       .probe    = da9063_i2c_probe,
+       .probe_new = da9063_i2c_probe,
        .id_table = da9063_i2c_id,
 };
 
index 6ae56e46d24e6658448fa9fdc60c67581c2d11c7..d2c954103b2f5432eb984df6c7dd0b1ed7f1b40c 100644 (file)
@@ -392,8 +392,7 @@ static struct mfd_cell da9150_devs[] = {
        },
 };
 
-static int da9150_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
+static int da9150_probe(struct i2c_client *client)
 {
        struct da9150 *da9150;
        struct da9150_pdata *pdata = dev_get_platdata(&client->dev);
@@ -511,7 +510,7 @@ static struct i2c_driver da9150_driver = {
                .name   = "da9150",
                .of_match_table = da9150_of_match,
        },
-       .probe          = da9150_probe,
+       .probe_new      = da9150_probe,
        .remove         = da9150_remove,
        .shutdown       = da9150_shutdown,
        .id_table       = da9150_i2c_id,
diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
deleted file mode 100644 (file)
index 9658204..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * DaVinci Voice Codec Core Interface for TI platforms
- *
- * Copyright (C) 2010 Texas Instruments, Inc
- *
- * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com>
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/device.h>
-#include <linux/slab.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/clk.h>
-#include <linux/regmap.h>
-
-#include <sound/pcm.h>
-
-#include <linux/mfd/davinci_voicecodec.h>
-
-static const struct regmap_config davinci_vc_regmap = {
-       .reg_bits = 32,
-       .val_bits = 32,
-};
-
-static int __init davinci_vc_probe(struct platform_device *pdev)
-{
-       struct davinci_vc *davinci_vc;
-       struct resource *res;
-       struct mfd_cell *cell = NULL;
-       dma_addr_t fifo_base;
-       int ret;
-
-       davinci_vc = devm_kzalloc(&pdev->dev,
-                                 sizeof(struct davinci_vc), GFP_KERNEL);
-       if (!davinci_vc)
-               return -ENOMEM;
-
-       davinci_vc->clk = devm_clk_get(&pdev->dev, NULL);
-       if (IS_ERR(davinci_vc->clk)) {
-               dev_dbg(&pdev->dev,
-                           "could not get the clock for voice codec\n");
-               return -ENODEV;
-       }
-       clk_enable(davinci_vc->clk);
-
-       davinci_vc->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
-       if (IS_ERR(davinci_vc->base)) {
-               ret = PTR_ERR(davinci_vc->base);
-               goto fail;
-       }
-       fifo_base = (dma_addr_t)res->start;
-
-       davinci_vc->regmap = devm_regmap_init_mmio(&pdev->dev,
-                                                  davinci_vc->base,
-                                                  &davinci_vc_regmap);
-       if (IS_ERR(davinci_vc->regmap)) {
-               ret = PTR_ERR(davinci_vc->regmap);
-               goto fail;
-       }
-
-       res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "no DMA resource\n");
-               ret = -ENXIO;
-               goto fail;
-       }
-
-       davinci_vc->davinci_vcif.dma_tx_channel = res->start;
-       davinci_vc->davinci_vcif.dma_tx_addr = fifo_base + DAVINCI_VC_WFIFO;
-
-       res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
-       if (!res) {
-               dev_err(&pdev->dev, "no DMA resource\n");
-               ret = -ENXIO;
-               goto fail;
-       }
-
-       davinci_vc->davinci_vcif.dma_rx_channel = res->start;
-       davinci_vc->davinci_vcif.dma_rx_addr = fifo_base + DAVINCI_VC_RFIFO;
-
-       davinci_vc->dev = &pdev->dev;
-       davinci_vc->pdev = pdev;
-
-       /* Voice codec interface client */
-       cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL];
-       cell->name = "davinci-vcif";
-       cell->platform_data = davinci_vc;
-       cell->pdata_size = sizeof(*davinci_vc);
-
-       /* Voice codec CQ93VC client */
-       cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL];
-       cell->name = "cq93vc-codec";
-       cell->platform_data = davinci_vc;
-       cell->pdata_size = sizeof(*davinci_vc);
-
-       ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells,
-                             DAVINCI_VC_CELLS, NULL, 0, NULL);
-       if (ret != 0) {
-               dev_err(&pdev->dev, "fail to register client devices\n");
-               goto fail;
-       }
-
-       return 0;
-
-fail:
-       clk_disable(davinci_vc->clk);
-
-       return ret;
-}
-
-static int davinci_vc_remove(struct platform_device *pdev)
-{
-       struct davinci_vc *davinci_vc = platform_get_drvdata(pdev);
-
-       mfd_remove_devices(&pdev->dev);
-
-       clk_disable(davinci_vc->clk);
-
-       return 0;
-}
-
-static struct platform_driver davinci_vc_driver = {
-       .driver = {
-               .name = "davinci_voicecodec",
-       },
-       .remove = davinci_vc_remove,
-};
-
-module_platform_driver_probe(davinci_vc_driver, davinci_vc_probe);
-
-MODULE_AUTHOR("Miguel Aguilar");
-MODULE_DESCRIPTION("Texas Instruments DaVinci Voice Codec Core Interface");
-MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/dm355evm_msp.c b/drivers/mfd/dm355evm_msp.c
deleted file mode 100644 (file)
index 759c596..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * dm355evm_msp.c - driver for MSP430 firmware on DM355EVM board
- *
- * Copyright (C) 2008 David Brownell
- */
-
-#include <linux/init.h>
-#include <linux/mutex.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#include <linux/module.h>
-#include <linux/err.h>
-#include <linux/gpio.h>
-#include <linux/gpio/machine.h>
-#include <linux/leds.h>
-#include <linux/i2c.h>
-#include <linux/mfd/dm355evm_msp.h>
-
-
-/*
- * The DM355 is a DaVinci chip with video support but no C64+ DSP.  Its
- * EVM board has an MSP430 programmed with firmware for various board
- * support functions.  This driver exposes some of them directly, and
- * supports other drivers (e.g. RTC, input) for more complex access.
- *
- * Because this firmware is entirely board-specific, this file embeds
- * knowledge that would be passed as platform_data in a generic driver.
- *
- * This driver was tested with firmware revision A4.
- */
-
-#if IS_ENABLED(CONFIG_INPUT_DM355EVM)
-#define msp_has_keyboard()     true
-#else
-#define msp_has_keyboard()     false
-#endif
-
-#if IS_ENABLED(CONFIG_LEDS_GPIO)
-#define msp_has_leds()         true
-#else
-#define msp_has_leds()         false
-#endif
-
-#if IS_ENABLED(CONFIG_RTC_DRV_DM355EVM)
-#define msp_has_rtc()          true
-#else
-#define msp_has_rtc()          false
-#endif
-
-#if IS_ENABLED(CONFIG_VIDEO_TVP514X)
-#define msp_has_tvp()          true
-#else
-#define msp_has_tvp()          false
-#endif
-
-
-/*----------------------------------------------------------------------*/
-
-/* REVISIT for paranoia's sake, retry reads/writes on error */
-
-static struct i2c_client *msp430;
-
-/**
- * dm355evm_msp_write - Writes a register in dm355evm_msp
- * @value: the value to be written
- * @reg: register address
- *
- * Returns result of operation - 0 is success, else negative errno
- */
-int dm355evm_msp_write(u8 value, u8 reg)
-{
-       return i2c_smbus_write_byte_data(msp430, reg, value);
-}
-EXPORT_SYMBOL(dm355evm_msp_write);
-
-/**
- * dm355evm_msp_read - Reads a register from dm355evm_msp
- * @reg: register address
- *
- * Returns result of operation - value, or negative errno
- */
-int dm355evm_msp_read(u8 reg)
-{
-       return i2c_smbus_read_byte_data(msp430, reg);
-}
-EXPORT_SYMBOL(dm355evm_msp_read);
-
-/*----------------------------------------------------------------------*/
-
-/*
- * Many of the msp430 pins are just used as fixed-direction GPIOs.
- * We could export a few more of them this way, if we wanted.
- */
-#define MSP_GPIO(bit, reg)     ((DM355EVM_MSP_ ## reg) << 3 | (bit))
-
-static const u8 msp_gpios[] = {
-       /* eight leds */
-       MSP_GPIO(0, LED), MSP_GPIO(1, LED),
-       MSP_GPIO(2, LED), MSP_GPIO(3, LED),
-       MSP_GPIO(4, LED), MSP_GPIO(5, LED),
-       MSP_GPIO(6, LED), MSP_GPIO(7, LED),
-       /* SW6 and the NTSC/nPAL jumper */
-       MSP_GPIO(0, SWITCH1), MSP_GPIO(1, SWITCH1),
-       MSP_GPIO(2, SWITCH1), MSP_GPIO(3, SWITCH1),
-       MSP_GPIO(4, SWITCH1),
-       /* switches on MMC/SD sockets */
-       /*
-        * Note: EVMDM355_ECP_VA4.pdf suggests that Bit 2 and 4 should be
-        * checked for card detection. However on the EVM bit 1 and 3 gives
-        * this status, for 0 and 1 instance respectively. The pdf also
-        * suggests that Bit 1 and 3 should be checked for write protection.
-        * However on the EVM bit 2 and 4 gives this status,for 0 and 1
-        * instance respectively.
-        */
-       MSP_GPIO(2, SDMMC), MSP_GPIO(1, SDMMC), /* mmc0 WP, nCD */
-       MSP_GPIO(4, SDMMC), MSP_GPIO(3, SDMMC), /* mmc1 WP, nCD */
-};
-
-static struct gpio_led evm_leds[] = {
-       { .name = "dm355evm::ds14",
-         .default_trigger = "heartbeat", },
-       { .name = "dm355evm::ds15",
-         .default_trigger = "mmc0", },
-       { .name = "dm355evm::ds16",
-         /* could also be a CE-ATA drive */
-         .default_trigger = "mmc1", },
-       { .name = "dm355evm::ds17",
-         .default_trigger = "nand-disk", },
-       { .name = "dm355evm::ds18", },
-       { .name = "dm355evm::ds19", },
-       { .name = "dm355evm::ds20", },
-       { .name = "dm355evm::ds21", },
-};
-
-static struct gpio_led_platform_data evm_led_data = {
-       .num_leds       = ARRAY_SIZE(evm_leds),
-       .leds           = evm_leds,
-};
-
-static struct gpiod_lookup_table evm_leds_gpio_table = {
-       .dev_id = "leds-gpio",
-       .table = {
-               /*
-                * These GPIOs are on the dm355evm_msp
-                * GPIO chip at index 0..7
-                */
-               GPIO_LOOKUP_IDX("dm355evm_msp", 0, NULL,
-                               0, GPIO_ACTIVE_LOW),
-               GPIO_LOOKUP_IDX("dm355evm_msp", 1, NULL,
-                               1, GPIO_ACTIVE_LOW),
-               GPIO_LOOKUP_IDX("dm355evm_msp", 2, NULL,
-                               2, GPIO_ACTIVE_LOW),
-               GPIO_LOOKUP_IDX("dm355evm_msp", 3, NULL,
-                               3, GPIO_ACTIVE_LOW),
-               GPIO_LOOKUP_IDX("dm355evm_msp", 4, NULL,
-                               4, GPIO_ACTIVE_LOW),
-               GPIO_LOOKUP_IDX("dm355evm_msp", 5, NULL,
-                               5, GPIO_ACTIVE_LOW),
-               GPIO_LOOKUP_IDX("dm355evm_msp", 6, NULL,
-                               6, GPIO_ACTIVE_LOW),
-               GPIO_LOOKUP_IDX("dm355evm_msp", 7, NULL,
-                               7, GPIO_ACTIVE_LOW),
-               { },
-       },
-};
-
-#define MSP_GPIO_REG(offset)   (msp_gpios[(offset)] >> 3)
-#define MSP_GPIO_MASK(offset)  BIT(msp_gpios[(offset)] & 0x07)
-
-static int msp_gpio_in(struct gpio_chip *chip, unsigned offset)
-{
-       switch (MSP_GPIO_REG(offset)) {
-       case DM355EVM_MSP_SWITCH1:
-       case DM355EVM_MSP_SWITCH2:
-       case DM355EVM_MSP_SDMMC:
-               return 0;
-       default:
-               return -EINVAL;
-       }
-}
-
-static u8 msp_led_cache;
-
-static int msp_gpio_get(struct gpio_chip *chip, unsigned offset)
-{
-       int reg, status;
-
-       reg = MSP_GPIO_REG(offset);
-       status = dm355evm_msp_read(reg);
-       if (status < 0)
-               return status;
-       if (reg == DM355EVM_MSP_LED)
-               msp_led_cache = status;
-       return !!(status & MSP_GPIO_MASK(offset));
-}
-
-static int msp_gpio_out(struct gpio_chip *chip, unsigned offset, int value)
-{
-       int mask, bits;
-
-       /* NOTE:  there are some other signals that could be
-        * packaged as output GPIOs, but they aren't as useful
-        * as the LEDs ... so for now we don't.
-        */
-       if (MSP_GPIO_REG(offset) != DM355EVM_MSP_LED)
-               return -EINVAL;
-
-       mask = MSP_GPIO_MASK(offset);
-       bits = msp_led_cache;
-
-       bits &= ~mask;
-       if (value)
-               bits |= mask;
-       msp_led_cache = bits;
-
-       return dm355evm_msp_write(bits, DM355EVM_MSP_LED);
-}
-
-static void msp_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
-{
-       msp_gpio_out(chip, offset, value);
-}
-
-static struct gpio_chip dm355evm_msp_gpio = {
-       .label                  = "dm355evm_msp",
-       .owner                  = THIS_MODULE,
-       .direction_input        = msp_gpio_in,
-       .get                    = msp_gpio_get,
-       .direction_output       = msp_gpio_out,
-       .set                    = msp_gpio_set,
-       .base                   = -EINVAL,              /* dynamic assignment */
-       .ngpio                  = ARRAY_SIZE(msp_gpios),
-       .can_sleep              = true,
-};
-
-/*----------------------------------------------------------------------*/
-
-static struct device *add_child(struct i2c_client *client, const char *name,
-               void *pdata, unsigned pdata_len,
-               bool can_wakeup, int irq)
-{
-       struct platform_device  *pdev;
-       int                     status;
-
-       pdev = platform_device_alloc(name, -1);
-       if (!pdev)
-               return ERR_PTR(-ENOMEM);
-
-       device_init_wakeup(&pdev->dev, can_wakeup);
-       pdev->dev.parent = &client->dev;
-
-       if (pdata) {
-               status = platform_device_add_data(pdev, pdata, pdata_len);
-               if (status < 0) {
-                       dev_dbg(&pdev->dev, "can't add platform_data\n");
-                       goto put_device;
-               }
-       }
-
-       if (irq) {
-               struct resource r = {
-                       .start = irq,
-                       .flags = IORESOURCE_IRQ,
-               };
-
-               status = platform_device_add_resources(pdev, &r, 1);
-               if (status < 0) {
-                       dev_dbg(&pdev->dev, "can't add irq\n");
-                       goto put_device;
-               }
-       }
-
-       status = platform_device_add(pdev);
-       if (status)
-               goto put_device;
-
-       return &pdev->dev;
-
-put_device:
-       platform_device_put(pdev);
-       dev_err(&client->dev, "failed to add device %s\n", name);
-       return ERR_PTR(status);
-}
-
-static int add_children(struct i2c_client *client)
-{
-       static const struct {
-               int offset;
-               char *label;
-       } config_inputs[] = {
-               /* 8 == right after the LEDs */
-               { 8 + 0, "sw6_1", },
-               { 8 + 1, "sw6_2", },
-               { 8 + 2, "sw6_3", },
-               { 8 + 3, "sw6_4", },
-               { 8 + 4, "NTSC/nPAL", },
-       };
-
-       struct device   *child;
-       int             status;
-       int             i;
-
-       /* GPIO-ish stuff */
-       dm355evm_msp_gpio.parent = &client->dev;
-       status = gpiochip_add_data(&dm355evm_msp_gpio, NULL);
-       if (status < 0)
-               return status;
-
-       /* LED output */
-       if (msp_has_leds()) {
-               gpiod_add_lookup_table(&evm_leds_gpio_table);
-               /* NOTE:  these are the only fully programmable LEDs
-                * on the board, since GPIO-61/ds22 (and many signals
-                * going to DC7) must be used for AEMIF address lines
-                * unless the top 1 GB of NAND is unused...
-                */
-               child = add_child(client, "leds-gpio",
-                               &evm_led_data, sizeof(evm_led_data),
-                               false, 0);
-               if (IS_ERR(child))
-                       return PTR_ERR(child);
-       }
-
-       /* configuration inputs */
-       for (i = 0; i < ARRAY_SIZE(config_inputs); i++) {
-               int gpio = dm355evm_msp_gpio.base + config_inputs[i].offset;
-
-               gpio_request_one(gpio, GPIOF_IN, config_inputs[i].label);
-
-               /* make it easy for userspace to see these */
-               gpio_export(gpio, false);
-       }
-
-       /* MMC/SD inputs -- right after the last config input */
-       if (dev_get_platdata(&client->dev)) {
-               void (*mmcsd_setup)(unsigned) = dev_get_platdata(&client->dev);
-
-               mmcsd_setup(dm355evm_msp_gpio.base + 8 + 5);
-       }
-
-       /* RTC is a 32 bit counter, no alarm */
-       if (msp_has_rtc()) {
-               child = add_child(client, "rtc-dm355evm",
-                               NULL, 0, false, 0);
-               if (IS_ERR(child))
-                       return PTR_ERR(child);
-       }
-
-       /* input from buttons and IR remote (uses the IRQ) */
-       if (msp_has_keyboard()) {
-               child = add_child(client, "dm355evm_keys",
-                               NULL, 0, true, client->irq);
-               if (IS_ERR(child))
-                       return PTR_ERR(child);
-       }
-
-       return 0;
-}
-
-/*----------------------------------------------------------------------*/
-
-static void dm355evm_command(unsigned command)
-{
-       int status;
-
-       status = dm355evm_msp_write(command, DM355EVM_MSP_COMMAND);
-       if (status < 0)
-               dev_err(&msp430->dev, "command %d failure %d\n",
-                               command, status);
-}
-
-static void dm355evm_power_off(void)
-{
-       dm355evm_command(MSP_COMMAND_POWEROFF);
-}
-
-static void dm355evm_msp_remove(struct i2c_client *client)
-{
-       pm_power_off = NULL;
-       msp430 = NULL;
-}
-
-static int
-dm355evm_msp_probe(struct i2c_client *client, const struct i2c_device_id *id)
-{
-       int             status;
-       const char      *video = msp_has_tvp() ? "TVP5146" : "imager";
-
-       if (msp430)
-               return -EBUSY;
-       msp430 = client;
-
-       /* display revision status; doubles as sanity check */
-       status = dm355evm_msp_read(DM355EVM_MSP_FIRMREV);
-       if (status < 0)
-               goto fail;
-       dev_info(&client->dev, "firmware v.%02X, %s as video-in\n",
-                       status, video);
-
-       /* mux video input:  either tvp5146 or some external imager */
-       status = dm355evm_msp_write(msp_has_tvp() ? 0 : MSP_VIDEO_IMAGER,
-                       DM355EVM_MSP_VIDEO_IN);
-       if (status < 0)
-               dev_warn(&client->dev, "error %d muxing %s as video-in\n",
-                       status, video);
-
-       /* init LED cache, and turn off the LEDs */
-       msp_led_cache = 0xff;
-       dm355evm_msp_write(msp_led_cache, DM355EVM_MSP_LED);
-
-       /* export capabilities we support */
-       status = add_children(client);
-       if (status < 0)
-               goto fail;
-
-       /* PM hookup */
-       pm_power_off = dm355evm_power_off;
-
-       return 0;
-
-fail:
-       /* FIXME remove children ... */
-       dm355evm_msp_remove(client);
-       return status;
-}
-
-static const struct i2c_device_id dm355evm_msp_ids[] = {
-       { "dm355evm_msp", 0 },
-       { /* end of list */ },
-};
-MODULE_DEVICE_TABLE(i2c, dm355evm_msp_ids);
-
-static struct i2c_driver dm355evm_msp_driver = {
-       .driver.name    = "dm355evm_msp",
-       .id_table       = dm355evm_msp_ids,
-       .probe          = dm355evm_msp_probe,
-       .remove         = dm355evm_msp_remove,
-};
-
-static int __init dm355evm_msp_init(void)
-{
-       return i2c_add_driver(&dm355evm_msp_driver);
-}
-subsys_initcall(dm355evm_msp_init);
-
-static void __exit dm355evm_msp_exit(void)
-{
-       i2c_del_driver(&dm355evm_msp_driver);
-}
-module_exit(dm355evm_msp_exit);
-
-MODULE_DESCRIPTION("Interface to MSP430 firmware on DM355EVM");
-MODULE_LICENSE("GPL");
index 823595bcc9b7c6de645068309ec28a618a4c6465..089c2ce615b6d30eed8c28f2a7feeb9aa45b21cc 100644 (file)
@@ -137,7 +137,6 @@ static int mx25_tsadc_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct mx25_tsadc *tsadc;
-       struct resource *res;
        int ret;
        void __iomem *iomem;
 
@@ -145,8 +144,7 @@ static int mx25_tsadc_probe(struct platform_device *pdev)
        if (!tsadc)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       iomem = devm_ioremap_resource(dev, res);
+       iomem = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
        if (IS_ERR(iomem))
                return PTR_ERR(iomem);
 
index 9d7d870c44a8cad8264133d391d2fcd7bd211f0a..c954ed265de81c925a1e58ec790dc851256cfe84 100644 (file)
@@ -189,8 +189,7 @@ static const struct regmap_irq_chip gsc_irq_chip = {
        .num_irqs = ARRAY_SIZE(gsc_irqs),
        .num_regs = 1,
        .status_base = GSC_IRQ_STATUS,
-       .mask_base = GSC_IRQ_ENABLE,
-       .mask_invert = true,
+       .unmask_base = GSC_IRQ_ENABLE,
        .ack_base = GSC_IRQ_STATUS,
        .ack_invert = true,
 };
diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c
deleted file mode 100644 (file)
index b45b134..0000000
+++ /dev/null
@@ -1,627 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- *  htc-i2cpld.c
- *  Chip driver for an unknown CPLD chip found on omap850 HTC devices like
- *  the HTC Wizard and HTC Herald.
- *  The cpld is located on the i2c bus and acts as an input/output GPIO
- *  extender.
- *
- *  Copyright (C) 2009 Cory Maccarrone <darkstar6262@gmail.com>
- *
- *  Based on work done in the linwizard project
- *  Copyright (C) 2008-2009 Angelo Arrifano <miknix@gmail.com>
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/i2c.h>
-#include <linux/irq.h>
-#include <linux/spinlock.h>
-#include <linux/htcpld.h>
-#include <linux/gpio/driver.h>
-#include <linux/gpio/machine.h>
-#include <linux/gpio/consumer.h>
-#include <linux/slab.h>
-
-struct htcpld_chip {
-       spinlock_t              lock;
-
-       /* chip info */
-       u8                      reset;
-       u8                      addr;
-       struct device           *dev;
-       struct i2c_client       *client;
-
-       /* Output details */
-       u8                      cache_out;
-       struct gpio_chip        chip_out;
-
-       /* Input details */
-       u8                      cache_in;
-       struct gpio_chip        chip_in;
-
-       u16                     irqs_enabled;
-       uint                    irq_start;
-       int                     nirqs;
-
-       unsigned int            flow_type;
-       /*
-        * Work structure to allow for setting values outside of any
-        * possible interrupt context
-        */
-       struct work_struct set_val_work;
-};
-
-struct htcpld_data {
-       /* irq info */
-       u16                irqs_enabled;
-       uint               irq_start;
-       int                nirqs;
-       uint               chained_irq;
-       struct gpio_desc   *int_reset_gpio_hi;
-       struct gpio_desc   *int_reset_gpio_lo;
-
-       /* htcpld info */
-       struct htcpld_chip *chip;
-       unsigned int       nchips;
-};
-
-/* There does not appear to be a way to proactively mask interrupts
- * on the htcpld chip itself.  So, we simply ignore interrupts that
- * aren't desired. */
-static void htcpld_mask(struct irq_data *data)
-{
-       struct htcpld_chip *chip = irq_data_get_irq_chip_data(data);
-       chip->irqs_enabled &= ~(1 << (data->irq - chip->irq_start));
-       pr_debug("HTCPLD mask %d %04x\n", data->irq, chip->irqs_enabled);
-}
-static void htcpld_unmask(struct irq_data *data)
-{
-       struct htcpld_chip *chip = irq_data_get_irq_chip_data(data);
-       chip->irqs_enabled |= 1 << (data->irq - chip->irq_start);
-       pr_debug("HTCPLD unmask %d %04x\n", data->irq, chip->irqs_enabled);
-}
-
-static int htcpld_set_type(struct irq_data *data, unsigned int flags)
-{
-       struct htcpld_chip *chip = irq_data_get_irq_chip_data(data);
-
-       if (flags & ~IRQ_TYPE_SENSE_MASK)
-               return -EINVAL;
-
-       /* We only allow edge triggering */
-       if (flags & (IRQ_TYPE_LEVEL_LOW|IRQ_TYPE_LEVEL_HIGH))
-               return -EINVAL;
-
-       chip->flow_type = flags;
-       return 0;
-}
-
-static struct irq_chip htcpld_muxed_chip = {
-       .name         = "htcpld",
-       .irq_mask     = htcpld_mask,
-       .irq_unmask   = htcpld_unmask,
-       .irq_set_type = htcpld_set_type,
-};
-
-/* To properly dispatch IRQ events, we need to read from the
- * chip.  This is an I2C action that could possibly sleep
- * (which is bad in interrupt context) -- so we use a threaded
- * interrupt handler to get around that.
- */
-static irqreturn_t htcpld_handler(int irq, void *dev)
-{
-       struct htcpld_data *htcpld = dev;
-       unsigned int i;
-       unsigned long flags;
-       int irqpin;
-
-       if (!htcpld) {
-               pr_debug("htcpld is null in ISR\n");
-               return IRQ_HANDLED;
-       }
-
-       /*
-        * For each chip, do a read of the chip and trigger any interrupts
-        * desired.  The interrupts will be triggered from LSB to MSB (i.e.
-        * bit 0 first, then bit 1, etc.)
-        *
-        * For chips that have no interrupt range specified, just skip 'em.
-        */
-       for (i = 0; i < htcpld->nchips; i++) {
-               struct htcpld_chip *chip = &htcpld->chip[i];
-               struct i2c_client *client;
-               int val;
-               unsigned long uval, old_val;
-
-               if (!chip) {
-                       pr_debug("chip %d is null in ISR\n", i);
-                       continue;
-               }
-
-               if (chip->nirqs == 0)
-                       continue;
-
-               client = chip->client;
-               if (!client) {
-                       pr_debug("client %d is null in ISR\n", i);
-                       continue;
-               }
-
-               /* Scan the chip */
-               val = i2c_smbus_read_byte_data(client, chip->cache_out);
-               if (val < 0) {
-                       /* Throw a warning and skip this chip */
-                       dev_warn(chip->dev, "Unable to read from chip: %d\n",
-                                val);
-                       continue;
-               }
-
-               uval = (unsigned long)val;
-
-               spin_lock_irqsave(&chip->lock, flags);
-
-               /* Save away the old value so we can compare it */
-               old_val = chip->cache_in;
-
-               /* Write the new value */
-               chip->cache_in = uval;
-
-               spin_unlock_irqrestore(&chip->lock, flags);
-
-               /*
-                * For each bit in the data (starting at bit 0), trigger
-                * associated interrupts.
-                */
-               for (irqpin = 0; irqpin < chip->nirqs; irqpin++) {
-                       unsigned oldb, newb, type = chip->flow_type;
-
-                       irq = chip->irq_start + irqpin;
-
-                       /* Run the IRQ handler, but only if the bit value
-                        * changed, and the proper flags are set */
-                       oldb = (old_val >> irqpin) & 1;
-                       newb = (uval >> irqpin) & 1;
-
-                       if ((!oldb && newb && (type & IRQ_TYPE_EDGE_RISING)) ||
-                           (oldb && !newb && (type & IRQ_TYPE_EDGE_FALLING))) {
-                               pr_debug("fire IRQ %d\n", irqpin);
-                               generic_handle_irq(irq);
-                       }
-               }
-       }
-
-       /*
-        * In order to continue receiving interrupts, the int_reset_gpio must
-        * be asserted.
-        */
-       if (htcpld->int_reset_gpio_hi)
-               gpiod_set_value(htcpld->int_reset_gpio_hi, 1);
-       if (htcpld->int_reset_gpio_lo)
-               gpiod_set_value(htcpld->int_reset_gpio_lo, 0);
-
-       return IRQ_HANDLED;
-}
-
-/*
- * The GPIO set routines can be called from interrupt context, especially if,
- * for example they're attached to the led-gpio framework and a trigger is
- * enabled.  As such, we declared work above in the htcpld_chip structure,
- * and that work is scheduled in the set routine.  The kernel can then run
- * the I2C functions, which will sleep, in process context.
- */
-static void htcpld_chip_set(struct gpio_chip *chip, unsigned offset, int val)
-{
-       struct i2c_client *client;
-       struct htcpld_chip *chip_data = gpiochip_get_data(chip);
-       unsigned long flags;
-
-       client = chip_data->client;
-       if (!client)
-               return;
-
-       spin_lock_irqsave(&chip_data->lock, flags);
-       if (val)
-               chip_data->cache_out |= (1 << offset);
-       else
-               chip_data->cache_out &= ~(1 << offset);
-       spin_unlock_irqrestore(&chip_data->lock, flags);
-
-       schedule_work(&(chip_data->set_val_work));
-}
-
-static void htcpld_chip_set_ni(struct work_struct *work)
-{
-       struct htcpld_chip *chip_data;
-       struct i2c_client *client;
-
-       chip_data = container_of(work, struct htcpld_chip, set_val_work);
-       client = chip_data->client;
-       i2c_smbus_read_byte_data(client, chip_data->cache_out);
-}
-
-static int htcpld_chip_get(struct gpio_chip *chip, unsigned offset)
-{
-       struct htcpld_chip *chip_data = gpiochip_get_data(chip);
-       u8 cache;
-
-       if (!strncmp(chip->label, "htcpld-out", 10)) {
-               cache = chip_data->cache_out;
-       } else if (!strncmp(chip->label, "htcpld-in", 9)) {
-               cache = chip_data->cache_in;
-       } else
-               return -EINVAL;
-
-       return (cache >> offset) & 1;
-}
-
-static int htcpld_direction_output(struct gpio_chip *chip,
-                                       unsigned offset, int value)
-{
-       htcpld_chip_set(chip, offset, value);
-       return 0;
-}
-
-static int htcpld_direction_input(struct gpio_chip *chip,
-                                       unsigned offset)
-{
-       /*
-        * No-op: this function can only be called on the input chip.
-        * We do however make sure the offset is within range.
-        */
-       return (offset < chip->ngpio) ? 0 : -EINVAL;
-}
-
-static int htcpld_chip_to_irq(struct gpio_chip *chip, unsigned offset)
-{
-       struct htcpld_chip *chip_data = gpiochip_get_data(chip);
-
-       if (offset < chip_data->nirqs)
-               return chip_data->irq_start + offset;
-       else
-               return -EINVAL;
-}
-
-static void htcpld_chip_reset(struct i2c_client *client)
-{
-       struct htcpld_chip *chip_data = i2c_get_clientdata(client);
-       if (!chip_data)
-               return;
-
-       i2c_smbus_read_byte_data(
-               client, (chip_data->cache_out = chip_data->reset));
-}
-
-static int htcpld_setup_chip_irq(
-               struct platform_device *pdev,
-               int chip_index)
-{
-       struct htcpld_data *htcpld;
-       struct htcpld_chip *chip;
-       unsigned int irq, irq_end;
-
-       /* Get the platform and driver data */
-       htcpld = platform_get_drvdata(pdev);
-       chip = &htcpld->chip[chip_index];
-
-       /* Setup irq handlers */
-       irq_end = chip->irq_start + chip->nirqs;
-       for (irq = chip->irq_start; irq < irq_end; irq++) {
-               irq_set_chip_and_handler(irq, &htcpld_muxed_chip,
-                                        handle_simple_irq);
-               irq_set_chip_data(irq, chip);
-               irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
-       }
-
-       return 0;
-}
-
-static int htcpld_register_chip_i2c(
-               struct platform_device *pdev,
-               int chip_index)
-{
-       struct htcpld_data *htcpld;
-       struct device *dev = &pdev->dev;
-       struct htcpld_core_platform_data *pdata;
-       struct htcpld_chip *chip;
-       struct htcpld_chip_platform_data *plat_chip_data;
-       struct i2c_adapter *adapter;
-       struct i2c_client *client;
-       struct i2c_board_info info;
-
-       /* Get the platform and driver data */
-       pdata = dev_get_platdata(dev);
-       htcpld = platform_get_drvdata(pdev);
-       chip = &htcpld->chip[chip_index];
-       plat_chip_data = &pdata->chip[chip_index];
-
-       adapter = i2c_get_adapter(pdata->i2c_adapter_id);
-       if (!adapter) {
-               /* Eek, no such I2C adapter!  Bail out. */
-               dev_warn(dev, "Chip at i2c address 0x%x: Invalid i2c adapter %d\n",
-                        plat_chip_data->addr, pdata->i2c_adapter_id);
-               return -ENODEV;
-       }
-
-       if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE_DATA)) {
-               dev_warn(dev, "i2c adapter %d non-functional\n",
-                        pdata->i2c_adapter_id);
-               i2c_put_adapter(adapter);
-               return -EINVAL;
-       }
-
-       memset(&info, 0, sizeof(struct i2c_board_info));
-       info.addr = plat_chip_data->addr;
-       strscpy(info.type, "htcpld-chip", I2C_NAME_SIZE);
-       info.platform_data = chip;
-
-       /* Add the I2C device.  This calls the probe() function. */
-       client = i2c_new_client_device(adapter, &info);
-       if (IS_ERR(client)) {
-               /* I2C device registration failed, contineu with the next */
-               dev_warn(dev, "Unable to add I2C device for 0x%x\n",
-                        plat_chip_data->addr);
-               i2c_put_adapter(adapter);
-               return PTR_ERR(client);
-       }
-
-       i2c_set_clientdata(client, chip);
-       snprintf(client->name, I2C_NAME_SIZE, "Chip_0x%x", client->addr);
-       chip->client = client;
-
-       /* Reset the chip */
-       htcpld_chip_reset(client);
-       chip->cache_in = i2c_smbus_read_byte_data(client, chip->cache_out);
-
-       return 0;
-}
-
-static void htcpld_unregister_chip_i2c(
-               struct platform_device *pdev,
-               int chip_index)
-{
-       struct htcpld_data *htcpld;
-       struct htcpld_chip *chip;
-
-       /* Get the platform and driver data */
-       htcpld = platform_get_drvdata(pdev);
-       chip = &htcpld->chip[chip_index];
-
-       i2c_unregister_device(chip->client);
-}
-
-static int htcpld_register_chip_gpio(
-               struct platform_device *pdev,
-               int chip_index)
-{
-       struct htcpld_data *htcpld;
-       struct device *dev = &pdev->dev;
-       struct htcpld_core_platform_data *pdata;
-       struct htcpld_chip *chip;
-       struct htcpld_chip_platform_data *plat_chip_data;
-       struct gpio_chip *gpio_chip;
-       int ret = 0;
-
-       /* Get the platform and driver data */
-       pdata = dev_get_platdata(dev);
-       htcpld = platform_get_drvdata(pdev);
-       chip = &htcpld->chip[chip_index];
-       plat_chip_data = &pdata->chip[chip_index];
-
-       /* Setup the GPIO chips */
-       gpio_chip = &(chip->chip_out);
-       gpio_chip->label           = "htcpld-out";
-       gpio_chip->parent             = dev;
-       gpio_chip->owner           = THIS_MODULE;
-       gpio_chip->get             = htcpld_chip_get;
-       gpio_chip->set             = htcpld_chip_set;
-       gpio_chip->direction_input = NULL;
-       gpio_chip->direction_output = htcpld_direction_output;
-       gpio_chip->base            = plat_chip_data->gpio_out_base;
-       gpio_chip->ngpio           = plat_chip_data->num_gpios;
-
-       gpio_chip = &(chip->chip_in);
-       gpio_chip->label           = "htcpld-in";
-       gpio_chip->parent             = dev;
-       gpio_chip->owner           = THIS_MODULE;
-       gpio_chip->get             = htcpld_chip_get;
-       gpio_chip->set             = NULL;
-       gpio_chip->direction_input = htcpld_direction_input;
-       gpio_chip->direction_output = NULL;
-       gpio_chip->to_irq          = htcpld_chip_to_irq;
-       gpio_chip->base            = plat_chip_data->gpio_in_base;
-       gpio_chip->ngpio           = plat_chip_data->num_gpios;
-
-       /* Add the GPIO chips */
-       ret = gpiochip_add_data(&(chip->chip_out), chip);
-       if (ret) {
-               dev_warn(dev, "Unable to register output GPIOs for 0x%x: %d\n",
-                        plat_chip_data->addr, ret);
-               return ret;
-       }
-
-       ret = gpiochip_add_data(&(chip->chip_in), chip);
-       if (ret) {
-               dev_warn(dev, "Unable to register input GPIOs for 0x%x: %d\n",
-                        plat_chip_data->addr, ret);
-               gpiochip_remove(&(chip->chip_out));
-               return ret;
-       }
-
-       return 0;
-}
-
-static int htcpld_setup_chips(struct platform_device *pdev)
-{
-       struct htcpld_data *htcpld;
-       struct device *dev = &pdev->dev;
-       struct htcpld_core_platform_data *pdata;
-       int i;
-
-       /* Get the platform and driver data */
-       pdata = dev_get_platdata(dev);
-       htcpld = platform_get_drvdata(pdev);
-
-       /* Setup each chip's output GPIOs */
-       htcpld->nchips = pdata->num_chip;
-       htcpld->chip = devm_kcalloc(dev,
-                                   htcpld->nchips,
-                                   sizeof(struct htcpld_chip),
-                                   GFP_KERNEL);
-       if (!htcpld->chip)
-               return -ENOMEM;
-
-       /* Add the chips as best we can */
-       for (i = 0; i < htcpld->nchips; i++) {
-               int ret;
-
-               /* Setup the HTCPLD chips */
-               htcpld->chip[i].reset = pdata->chip[i].reset;
-               htcpld->chip[i].cache_out = pdata->chip[i].reset;
-               htcpld->chip[i].cache_in = 0;
-               htcpld->chip[i].dev = dev;
-               htcpld->chip[i].irq_start = pdata->chip[i].irq_base;
-               htcpld->chip[i].nirqs = pdata->chip[i].num_irqs;
-
-               INIT_WORK(&(htcpld->chip[i].set_val_work), &htcpld_chip_set_ni);
-               spin_lock_init(&(htcpld->chip[i].lock));
-
-               /* Setup the interrupts for the chip */
-               if (htcpld->chained_irq) {
-                       ret = htcpld_setup_chip_irq(pdev, i);
-                       if (ret)
-                               continue;
-               }
-
-               /* Register the chip with I2C */
-               ret = htcpld_register_chip_i2c(pdev, i);
-               if (ret)
-                       continue;
-
-
-               /* Register the chips with the GPIO subsystem */
-               ret = htcpld_register_chip_gpio(pdev, i);
-               if (ret) {
-                       /* Unregister the chip from i2c and continue */
-                       htcpld_unregister_chip_i2c(pdev, i);
-                       continue;
-               }
-
-               dev_info(dev, "Registered chip at 0x%x\n", pdata->chip[i].addr);
-       }
-
-       return 0;
-}
-
-static int htcpld_core_probe(struct platform_device *pdev)
-{
-       struct htcpld_data *htcpld;
-       struct device *dev = &pdev->dev;
-       struct htcpld_core_platform_data *pdata;
-       struct resource *res;
-       int ret = 0;
-
-       if (!dev)
-               return -ENODEV;
-
-       pdata = dev_get_platdata(dev);
-       if (!pdata) {
-               dev_warn(dev, "Platform data not found for htcpld core!\n");
-               return -ENXIO;
-       }
-
-       htcpld = devm_kzalloc(dev, sizeof(struct htcpld_data), GFP_KERNEL);
-       if (!htcpld)
-               return -ENOMEM;
-
-       /* Find chained irq */
-       res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-       if (res) {
-               int flags;
-               htcpld->chained_irq = res->start;
-
-               /* Setup the chained interrupt handler */
-               flags = IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING |
-                       IRQF_ONESHOT;
-               ret = request_threaded_irq(htcpld->chained_irq,
-                                          NULL, htcpld_handler,
-                                          flags, pdev->name, htcpld);
-               if (ret) {
-                       dev_warn(dev, "Unable to setup chained irq handler: %d\n", ret);
-                       return ret;
-               } else
-                       device_init_wakeup(dev, 0);
-       }
-
-       /* Set the driver data */
-       platform_set_drvdata(pdev, htcpld);
-
-       /* Setup the htcpld chips */
-       ret = htcpld_setup_chips(pdev);
-       if (ret)
-               return ret;
-
-       /* Request the GPIO(s) for the int reset and set them up */
-       htcpld->int_reset_gpio_hi = gpiochip_request_own_desc(&htcpld->chip[2].chip_out,
-                                                             7, "htcpld-core", GPIO_ACTIVE_HIGH,
-                                                             GPIOD_OUT_HIGH);
-       if (IS_ERR(htcpld->int_reset_gpio_hi)) {
-               /*
-                * If it failed, that sucks, but we can probably
-                * continue on without it.
-                */
-               htcpld->int_reset_gpio_hi = NULL;
-               dev_warn(dev, "Unable to request int_reset_gpio_hi -- interrupts may not work\n");
-       }
-
-       htcpld->int_reset_gpio_lo = gpiochip_request_own_desc(&htcpld->chip[2].chip_out,
-                                                             0, "htcpld-core", GPIO_ACTIVE_HIGH,
-                                                             GPIOD_OUT_LOW);
-       if (IS_ERR(htcpld->int_reset_gpio_lo)) {
-               /*
-                * If it failed, that sucks, but we can probably
-                * continue on without it.
-                */
-               htcpld->int_reset_gpio_lo = NULL;
-               dev_warn(dev, "Unable to request int_reset_gpio_lo -- interrupts may not work\n");
-       }
-
-       dev_info(dev, "Initialized successfully\n");
-       return 0;
-}
-
-/* The I2C Driver -- used internally */
-static const struct i2c_device_id htcpld_chip_id[] = {
-       { "htcpld-chip", 0 },
-       { }
-};
-
-static struct i2c_driver htcpld_chip_driver = {
-       .driver = {
-               .name   = "htcpld-chip",
-       },
-       .id_table = htcpld_chip_id,
-};
-
-/* The Core Driver */
-static struct platform_driver htcpld_core_driver = {
-       .driver = {
-               .name = "i2c-htcpld",
-       },
-};
-
-static int __init htcpld_core_init(void)
-{
-       int ret;
-
-       /* Register the I2C Chip driver */
-       ret = i2c_add_driver(&htcpld_chip_driver);
-       if (ret)
-               return ret;
-
-       /* Probe for our chips */
-       return platform_driver_probe(&htcpld_core_driver, htcpld_core_probe);
-}
-device_initcall(htcpld_core_init);
index f3d418810693c671654adb25ac20ec4fd5b599c0..7338cc16f327134b765f79c0a0ef968f6d093b2d 100644 (file)
@@ -84,8 +84,7 @@ static struct mfd_cell khadas_mcu_cells[] = {
        { .name = "khadas-mcu-user-mem", },
 };
 
-static int khadas_mcu_probe(struct i2c_client *client,
-                      const struct i2c_device_id *id)
+static int khadas_mcu_probe(struct i2c_client *client)
 {
        struct device *dev = &client->dev;
        struct khadas_mcu *ddata;
@@ -135,7 +134,7 @@ static struct i2c_driver khadas_mcu_driver = {
                .name = "khadas-mcu-core",
                .of_match_table = of_match_ptr(khadas_mcu_of_match),
        },
-       .probe = khadas_mcu_probe,
+       .probe_new = khadas_mcu_probe,
 };
 module_i2c_driver(khadas_mcu_driver);
 
index be32ffc5af384fdeb6d9c7774c579e217d71418c..74a5533294160f2bc2fe3a2f4e381e052b2def7a 100644 (file)
@@ -584,8 +584,7 @@ static const struct regmap_config regmap_config = {
        .precious_reg   = lm3533_precious_register,
 };
 
-static int lm3533_i2c_probe(struct i2c_client *i2c,
-                                       const struct i2c_device_id *id)
+static int lm3533_i2c_probe(struct i2c_client *i2c)
 {
        struct lm3533 *lm3533;
 
@@ -627,7 +626,7 @@ static struct i2c_driver lm3533_i2c_driver = {
                   .name = "lm3533",
        },
        .id_table       = lm3533_i2c_ids,
-       .probe          = lm3533_i2c_probe,
+       .probe_new      = lm3533_i2c_probe,
        .remove         = lm3533_i2c_remove,
 };
 
index 13cb89be3d66193d6ae9cedf5829b9aac46ad772..f9f39b53d03008595f645d7285515863fced4b61 100644 (file)
@@ -102,7 +102,7 @@ static const struct regmap_config lp3943_regmap_config = {
        .max_register = LP3943_MAX_REGISTERS,
 };
 
-static int lp3943_probe(struct i2c_client *cl, const struct i2c_device_id *id)
+static int lp3943_probe(struct i2c_client *cl)
 {
        struct lp3943 *lp3943;
        struct device *dev = &cl->dev;
@@ -140,7 +140,7 @@ MODULE_DEVICE_TABLE(of, lp3943_of_match);
 #endif
 
 static struct i2c_driver lp3943_driver = {
-       .probe = lp3943_probe,
+       .probe_new = lp3943_probe,
        .driver = {
                .name = "lp3943",
                .of_match_table = of_match_ptr(lp3943_of_match),
index b6166dec492d44ebe72a802936618b8b5f2def87..c81c5c9ad7489a363d8e59216d09278883fc602a 100644 (file)
@@ -24,8 +24,7 @@ static const struct mfd_cell lp873x_cells[] = {
        { .name = "lp873x-gpio", },
 };
 
-static int lp873x_probe(struct i2c_client *client,
-                       const struct i2c_device_id *ids)
+static int lp873x_probe(struct i2c_client *client)
 {
        struct lp873x *lp873;
        int ret;
@@ -79,7 +78,7 @@ static struct i2c_driver lp873x_driver = {
                .name   = "lp873x",
                .of_match_table = of_lp873x_match_table,
        },
-       .probe          = lp873x_probe,
+       .probe_new      = lp873x_probe,
        .id_table       = lp873x_id_table,
 };
 module_i2c_driver(lp873x_driver);
index a52ab76febb3492cff5c2b6e7ea22c08c17c7cac..568f0f01ea0d2e0925fd840ecd64e8f56bed2bcc 100644 (file)
@@ -43,8 +43,7 @@ static const struct of_device_id of_lp87565_match_table[] = {
 };
 MODULE_DEVICE_TABLE(of, of_lp87565_match_table);
 
-static int lp87565_probe(struct i2c_client *client,
-                        const struct i2c_device_id *ids)
+static int lp87565_probe(struct i2c_client *client)
 {
        struct lp87565 *lp87565;
        const struct of_device_id *of_id;
@@ -120,7 +119,7 @@ static struct i2c_driver lp87565_driver = {
                .name   = "lp87565",
                .of_match_table = of_lp87565_match_table,
        },
-       .probe = lp87565_probe,
+       .probe_new = lp87565_probe,
        .shutdown = lp87565_shutdown,
        .id_table = lp87565_id_table,
 };
index 724a5712b36baa1ffda07a8e7a5d0e302f3f20df..fe809b64147e607d3334c279dcc528038f325d6b 100644 (file)
@@ -166,7 +166,7 @@ static const struct regmap_config lp8788_regmap_config = {
        .max_register = MAX_LP8788_REGISTERS,
 };
 
-static int lp8788_probe(struct i2c_client *cl, const struct i2c_device_id *id)
+static int lp8788_probe(struct i2c_client *cl)
 {
        struct lp8788 *lp;
        struct lp8788_platform_data *pdata = dev_get_platdata(&cl->dev);
@@ -225,7 +225,7 @@ static struct i2c_driver lp8788_driver = {
        .driver = {
                .name = "lp8788",
        },
-       .probe = lp8788_probe,
+       .probe_new = lp8788_probe,
        .remove = lp8788_remove,
        .id_table = lp8788_ids,
 };
index a2abc0094def75cc807e1aa99284b9141b011b1d..bdbd5bfc9714564a76186c33780937c7e9f34cdd 100644 (file)
@@ -8,13 +8,12 @@
 #include <linux/device.h>
 #include <linux/delay.h>
 #include <linux/err.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/mfd/core.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/notifier.h>
 #include <linux/of.h>
-#include <linux/of_gpio.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
index 915d2f95bad313f2d80c28b57cc81345d93c33d7..47e65d88feb0ebad6bc300bff826cfa554461833 100644 (file)
@@ -17,9 +17,9 @@
 
 #include "madera.h"
 
-static int madera_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int madera_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct madera *madera;
        const struct regmap_config *regmap_16bit_config = NULL;
        const struct regmap_config *regmap_32bit_config = NULL;
@@ -139,7 +139,7 @@ static struct i2c_driver madera_i2c_driver = {
                .pm     = &madera_pm_ops,
                .of_match_table = of_match_ptr(madera_of_match),
        },
-       .probe          = madera_i2c_probe,
+       .probe_new      = madera_i2c_probe,
        .remove         = madera_i2c_remove,
        .id_table       = madera_i2c_id,
 };
index d44ad6f337425a9223315465e73287a0d65a5f91..0e3731e9e9b59793e61c26bcd00f426932e735d7 100644 (file)
@@ -209,8 +209,7 @@ static const struct regmap_irq max14577_irqs[] = {
 static const struct regmap_irq_chip max14577_irq_chip = {
        .name                   = "max14577",
        .status_base            = MAX14577_REG_INT1,
-       .mask_base              = MAX14577_REG_INTMASK1,
-       .mask_invert            = true,
+       .unmask_base            = MAX14577_REG_INTMASK1,
        .num_regs               = 3,
        .irqs                   = max14577_irqs,
        .num_irqs               = ARRAY_SIZE(max14577_irqs),
@@ -239,8 +238,7 @@ static const struct regmap_irq max77836_muic_irqs[] = {
 static const struct regmap_irq_chip max77836_muic_irq_chip = {
        .name                   = "max77836-muic",
        .status_base            = MAX14577_REG_INT1,
-       .mask_base              = MAX14577_REG_INTMASK1,
-       .mask_invert            = true,
+       .unmask_base            = MAX14577_REG_INTMASK1,
        .num_regs               = 3,
        .irqs                   = max77836_muic_irqs,
        .num_irqs               = ARRAY_SIZE(max77836_muic_irqs),
@@ -255,7 +253,6 @@ static const struct regmap_irq_chip max77836_pmic_irq_chip = {
        .name                   = "max77836-pmic",
        .status_base            = MAX77836_PMIC_REG_TOPSYS_INT,
        .mask_base              = MAX77836_PMIC_REG_TOPSYS_INT_MASK,
-       .mask_invert            = false,
        .num_regs               = 1,
        .irqs                   = max77836_pmic_irqs,
        .num_irqs               = ARRAY_SIZE(max77836_pmic_irqs),
@@ -358,9 +355,9 @@ static void max77836_remove(struct max14577 *max14577)
        i2c_unregister_device(max14577->i2c_pmic);
 }
 
-static int max14577_i2c_probe(struct i2c_client *i2c,
-                             const struct i2c_device_id *id)
+static int max14577_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct max14577 *max14577;
        struct max14577_platform_data *pdata = dev_get_platdata(&i2c->dev);
        struct device_node *np = i2c->dev.of_node;
@@ -480,7 +477,6 @@ static const struct i2c_device_id max14577_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, max14577_i2c_id);
 
-#ifdef CONFIG_PM_SLEEP
 static int max14577_suspend(struct device *dev)
 {
        struct i2c_client *i2c = to_i2c_client(dev);
@@ -513,17 +509,16 @@ static int max14577_resume(struct device *dev)
 
        return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(max14577_pm, max14577_suspend, max14577_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max14577_pm, max14577_suspend, max14577_resume);
 
 static struct i2c_driver max14577_i2c_driver = {
        .driver = {
                .name = "max14577",
-               .pm = &max14577_pm,
+               .pm = pm_sleep_ptr(&max14577_pm),
                .of_match_table = max14577_dt_match,
        },
-       .probe = max14577_i2c_probe,
+       .probe_new = max14577_i2c_probe,
        .remove = max14577_i2c_remove,
        .id_table = max14577_i2c_id,
 };
index a6661e07035ba6e27f00feb0cab1f11a7d6c71c6..cbd2297126f041756b3e04235c6067fa13837b18 100644 (file)
@@ -494,9 +494,9 @@ static void max77620_pm_power_off(void)
                           MAX77620_ONOFFCNFG1_SFT_RST);
 }
 
-static int max77620_probe(struct i2c_client *client,
-                         const struct i2c_device_id *id)
+static int max77620_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(client);
        const struct regmap_config *rmap_config;
        struct max77620_chip *chip;
        const struct mfd_cell *mfd_cells;
@@ -576,7 +576,6 @@ static int max77620_probe(struct i2c_client *client,
        return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int max77620_set_fps_period(struct max77620_chip *chip,
                                   int fps_id, int time_period)
 {
@@ -683,7 +682,6 @@ out:
 
        return 0;
 }
-#endif
 
 static const struct i2c_device_id max77620_id[] = {
        {"max77620", MAX77620},
@@ -692,16 +690,15 @@ static const struct i2c_device_id max77620_id[] = {
        {},
 };
 
-static const struct dev_pm_ops max77620_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(max77620_i2c_suspend, max77620_i2c_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(max77620_pm_ops,
+                               max77620_i2c_suspend, max77620_i2c_resume);
 
 static struct i2c_driver max77620_driver = {
        .driver = {
                .name = "max77620",
-               .pm = &max77620_pm_ops,
+               .pm = pm_sleep_ptr(&max77620_pm_ops),
        },
-       .probe = max77620_probe,
+       .probe_new = max77620_probe,
        .id_table = max77620_id,
 };
 builtin_i2c_driver(max77620_driver);
index 777485a33bc0fc25c8a26b5786abf2fcf1c6ffb9..3c07fcdd9d076a29f94c39fe77c93459b25393e0 100644 (file)
@@ -138,7 +138,6 @@ static const struct regmap_irq_chip max77650_irq_chip = {
        .status_base            = MAX77650_REG_INT_GLBL,
        .mask_base              = MAX77650_REG_INTM_GLBL,
        .type_in_mask           = true,
-       .type_invert            = true,
        .init_ack_masked        = true,
        .clear_on_unmask        = true,
 };
index 2ac64277fb8469c2c1ccdfe470f5d9397123ff09..f8e863f3fc95812b330e1bf3a151a7e302f113aa 100644 (file)
@@ -226,7 +226,6 @@ static int max77686_i2c_probe(struct i2c_client *i2c)
        return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int max77686_suspend(struct device *dev)
 {
        struct i2c_client *i2c = to_i2c_client(dev);
@@ -261,14 +260,13 @@ static int max77686_resume(struct device *dev)
 
        return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(max77686_pm, max77686_suspend, max77686_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max77686_pm, max77686_suspend, max77686_resume);
 
 static struct i2c_driver max77686_i2c_driver = {
        .driver = {
                   .name = "max77686",
-                  .pm = &max77686_pm,
+                  .pm = pm_sleep_ptr(&max77686_pm),
                   .of_match_table = max77686_pmic_dt_match,
        },
        .probe_new = max77686_i2c_probe,
index 7088cb6f917457914c150c8186d5e7ecfbefb8f7..3995e8769f491340c499404b19de1d97f50e4f86 100644 (file)
@@ -66,7 +66,6 @@ static const struct regmap_irq_chip max77693_led_irq_chip = {
        .name                   = "max77693-led",
        .status_base            = MAX77693_LED_REG_FLASH_INT,
        .mask_base              = MAX77693_LED_REG_FLASH_INT_MASK,
-       .mask_invert            = false,
        .num_regs               = 1,
        .irqs                   = max77693_led_irqs,
        .num_irqs               = ARRAY_SIZE(max77693_led_irqs),
@@ -82,7 +81,6 @@ static const struct regmap_irq_chip max77693_topsys_irq_chip = {
        .name                   = "max77693-topsys",
        .status_base            = MAX77693_PMIC_REG_TOPSYS_INT,
        .mask_base              = MAX77693_PMIC_REG_TOPSYS_INT_MASK,
-       .mask_invert            = false,
        .num_regs               = 1,
        .irqs                   = max77693_topsys_irqs,
        .num_irqs               = ARRAY_SIZE(max77693_topsys_irqs),
@@ -100,7 +98,6 @@ static const struct regmap_irq_chip max77693_charger_irq_chip = {
        .name                   = "max77693-charger",
        .status_base            = MAX77693_CHG_REG_CHG_INT,
        .mask_base              = MAX77693_CHG_REG_CHG_INT_MASK,
-       .mask_invert            = false,
        .num_regs               = 1,
        .irqs                   = max77693_charger_irqs,
        .num_irqs               = ARRAY_SIZE(max77693_charger_irqs),
@@ -136,8 +133,7 @@ static const struct regmap_irq max77693_muic_irqs[] = {
 static const struct regmap_irq_chip max77693_muic_irq_chip = {
        .name                   = "max77693-muic",
        .status_base            = MAX77693_MUIC_REG_INT1,
-       .mask_base              = MAX77693_MUIC_REG_INTMASK1,
-       .mask_invert            = true,
+       .unmask_base            = MAX77693_MUIC_REG_INTMASK1,
        .num_regs               = 3,
        .irqs                   = max77693_muic_irqs,
        .num_irqs               = ARRAY_SIZE(max77693_muic_irqs),
@@ -149,9 +145,9 @@ static const struct regmap_config max77693_regmap_haptic_config = {
        .max_register = MAX77693_HAPTIC_REG_END,
 };
 
-static int max77693_i2c_probe(struct i2c_client *i2c,
-                             const struct i2c_device_id *id)
+static int max77693_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct max77693_dev *max77693;
        unsigned int reg_data;
        int ret = 0;
@@ -360,7 +356,7 @@ static struct i2c_driver max77693_i2c_driver = {
                   .pm = &max77693_pm,
                   .of_match_table = of_match_ptr(max77693_dt_match),
        },
-       .probe = max77693_i2c_probe,
+       .probe_new = max77693_i2c_probe,
        .remove = max77693_i2c_remove,
        .id_table = max77693_i2c_id,
 };
index 209ee24d9ce1c01d9116b40946b2d31ef02425e4..8ff0723808c8e66a76e0fa0a9a6c20daf9bfabbb 100644 (file)
@@ -59,7 +59,6 @@ static const struct regmap_irq_chip max77843_irq_chip = {
        .name           = "max77843",
        .status_base    = MAX77843_SYS_REG_SYSINTSRC,
        .mask_base      = MAX77843_SYS_REG_SYSINTMASK,
-       .mask_invert    = false,
        .num_regs       = 1,
        .irqs           = max77843_irqs,
        .num_irqs       = ARRAY_SIZE(max77843_irqs),
@@ -93,9 +92,9 @@ err_chg_i2c:
        return ret;
 }
 
-static int max77843_probe(struct i2c_client *i2c,
-                         const struct i2c_device_id *id)
+static int max77843_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct max77693_dev *max77843;
        unsigned int reg_data;
        int ret;
@@ -208,7 +207,7 @@ static struct i2c_driver max77843_i2c_driver = {
                .of_match_table = max77843_dt_match,
                .suppress_bind_attrs = true,
        },
-       .probe = max77843_probe,
+       .probe_new = max77843_probe,
        .id_table = max77843_id,
 };
 
index c340080971cef8fb4e34e4cfaa47ecc38741c805..a69b865c6eacf3b3a0355d284e61328ce77fda27 100644 (file)
@@ -181,8 +181,7 @@ static void max8907_power_off(void)
                        MAX8907_MASK_POWER_OFF, MAX8907_MASK_POWER_OFF);
 }
 
-static int max8907_i2c_probe(struct i2c_client *i2c,
-                                      const struct i2c_device_id *id)
+static int max8907_i2c_probe(struct i2c_client *i2c)
 {
        struct max8907 *max8907;
        int ret;
@@ -314,7 +313,7 @@ static struct i2c_driver max8907_i2c_driver = {
                .name = "max8907",
                .of_match_table = of_match_ptr(max8907_of_match),
        },
-       .probe = max8907_i2c_probe,
+       .probe_new = max8907_i2c_probe,
        .remove = max8907_i2c_remove,
        .id_table = max8907_i2c_id,
 };
index 04101da42bd314454756115481a1755ba1020f2c..4057fd15c29e74dcc39952d67a1d017bb959d657 100644 (file)
@@ -144,8 +144,7 @@ static int max8925_dt_init(struct device_node *np, struct device *dev,
        return 0;
 }
 
-static int max8925_probe(struct i2c_client *client,
-                                  const struct i2c_device_id *id)
+static int max8925_probe(struct i2c_client *client)
 {
        struct max8925_platform_data *pdata = dev_get_platdata(&client->dev);
        struct max8925_chip *chip;
@@ -207,7 +206,6 @@ static void max8925_remove(struct i2c_client *client)
        i2c_unregister_device(chip->rtc);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int max8925_suspend(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
@@ -227,9 +225,9 @@ static int max8925_resume(struct device *dev)
                disable_irq_wake(chip->core_irq);
        return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(max8925_pm_ops, max8925_suspend, max8925_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max8925_pm_ops,
+                               max8925_suspend, max8925_resume);
 
 static const struct of_device_id max8925_dt_ids[] = {
        { .compatible = "maxim,max8925", },
@@ -239,10 +237,10 @@ static const struct of_device_id max8925_dt_ids[] = {
 static struct i2c_driver max8925_driver = {
        .driver = {
                .name   = "max8925",
-               .pm     = &max8925_pm_ops,
+               .pm     = pm_sleep_ptr(&max8925_pm_ops),
                .of_match_table = max8925_dt_ids,
        },
-       .probe          = max8925_probe,
+       .probe_new      = max8925_probe,
        .remove         = max8925_remove,
        .id_table       = max8925_id_table,
 };
index 2141de78115d9441f3d18b5a34a8e44ce10773b1..79d551b86150f69af3f6f0faf781e3abea04f1e4 100644 (file)
@@ -152,9 +152,9 @@ static inline unsigned long max8997_i2c_get_driver_data(struct i2c_client *i2c,
        return id->driver_data;
 }
 
-static int max8997_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int max8997_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct max8997_dev *max8997;
        struct max8997_platform_data *pdata = dev_get_platdata(&i2c->dev);
        int ret = 0;
@@ -478,7 +478,7 @@ static struct i2c_driver max8997_i2c_driver = {
                   .suppress_bind_attrs = true,
                   .of_match_table = of_match_ptr(max8997_pmic_dt_match),
        },
-       .probe = max8997_i2c_probe,
+       .probe_new = max8997_i2c_probe,
        .id_table = max8997_i2c_id,
 };
 
index 0eb15e611b671f243265e9d74a9ccd3e5573c075..122f7b931f5a22ff00234846f9f9f764ea03ea81 100644 (file)
@@ -162,9 +162,9 @@ static inline unsigned long max8998_i2c_get_driver_data(struct i2c_client *i2c,
        return id->driver_data;
 }
 
-static int max8998_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int max8998_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct max8998_platform_data *pdata = dev_get_platdata(&i2c->dev);
        struct max8998_dev *max8998;
        int ret = 0;
@@ -348,7 +348,7 @@ static struct i2c_driver max8998_i2c_driver = {
                   .suppress_bind_attrs = true,
                   .of_match_table = of_match_ptr(max8998_dt_match),
        },
-       .probe = max8998_i2c_probe,
+       .probe_new = max8998_i2c_probe,
        .id_table = max8998_i2c_id,
 };
 
index eb94f3004cf336437dbc3842984d90193cba79d0..633b973a5ba77c0427b2a76f6204dab1caf5fb61 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/mfd/mc13xxx.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
-#include <linux/of_gpio.h>
 #include <linux/i2c.h>
 #include <linux/err.h>
 
@@ -52,9 +51,9 @@ static const struct regmap_config mc13xxx_regmap_i2c_config = {
        .cache_type = REGCACHE_NONE,
 };
 
-static int mc13xxx_i2c_probe(struct i2c_client *client,
-               const struct i2c_device_id *id)
+static int mc13xxx_i2c_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(client);
        struct mc13xxx *mc13xxx;
        int ret;
 
@@ -96,7 +95,7 @@ static struct i2c_driver mc13xxx_i2c_driver = {
                .name = "mc13xxx",
                .of_match_table = mc13xxx_dt_ids,
        },
-       .probe = mc13xxx_i2c_probe,
+       .probe_new = mc13xxx_i2c_probe,
        .remove = mc13xxx_i2c_remove,
 };
 
index f803527e5819407f8e2d47c9caf72abc05ceb9c0..f70d79aa5a83345d43bfafe03d55e893bf822140 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/mfd/mc13xxx.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
-#include <linux/of_gpio.h>
 #include <linux/err.h>
 #include <linux/spi/spi.h>
 
@@ -115,7 +114,7 @@ static int mc13xxx_spi_write(void *context, const void *data, size_t count)
  * result, the SS will negate before all of the data has been
  * transferred to/from the peripheral."
  * We workaround this by accessing the SPI controller with a
- * single transfert.
+ * single transfer.
  */
 
 static struct regmap_bus regmap_mc13xxx_bus = {
index 4629dff187cd5e0a1c9628f01a462a5e5203d03d..1c9831b78cf9cf1157a2ac5ef11f8e9a8ca22d8e 100644 (file)
@@ -255,7 +255,6 @@ static int mcp_sa11x0_remove(struct platform_device *dev)
        return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int mcp_sa11x0_suspend(struct device *dev)
 {
        struct mcp_sa11x0 *m = priv(dev_get_drvdata(dev));
@@ -277,17 +276,14 @@ static int mcp_sa11x0_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
 static const struct dev_pm_ops mcp_sa11x0_pm_ops = {
-#ifdef CONFIG_PM_SLEEP
        .suspend = mcp_sa11x0_suspend,
        .freeze = mcp_sa11x0_suspend,
        .poweroff = mcp_sa11x0_suspend,
        .resume_noirq = mcp_sa11x0_resume,
        .thaw_noirq = mcp_sa11x0_resume,
        .restore_noirq = mcp_sa11x0_resume,
-#endif
 };
 
 static struct platform_driver mcp_sa11x0_driver = {
@@ -295,7 +291,7 @@ static struct platform_driver mcp_sa11x0_driver = {
        .remove         = mcp_sa11x0_remove,
        .driver         = {
                .name   = DRIVER_NAME,
-               .pm     = &mcp_sa11x0_pm_ops,
+               .pm     = pm_sleep_ptr(&mcp_sa11x0_pm_ops),
        },
 };
 
index eb08f69001f91d2cb302676337698ee091cfef7c..c2866a11c1d22ac1de692a229906243fd51cf1e3 100644 (file)
@@ -1142,8 +1142,7 @@ static inline void menelaus_rtc_init(struct menelaus_chip *m)
 
 static struct i2c_driver menelaus_i2c_driver;
 
-static int menelaus_probe(struct i2c_client *client,
-                         const struct i2c_device_id *id)
+static int menelaus_probe(struct i2c_client *client)
 {
        struct menelaus_chip    *menelaus;
        int                     rev = 0;
@@ -1241,7 +1240,7 @@ static struct i2c_driver menelaus_i2c_driver = {
        .driver = {
                .name           = DRIVER_NAME,
        },
-       .probe          = menelaus_probe,
+       .probe_new      = menelaus_probe,
        .remove         = menelaus_remove,
        .id_table       = menelaus_id,
 };
index 8f72b1cccbe54d7aa922a26274caf6d6ac7d8f95..9092fac46e35980d79854320cad050f09319a38d 100644 (file)
@@ -49,7 +49,7 @@ static int menf21bmc_wdt_exit_prod_mode(struct i2c_client *client)
 }
 
 static int
-menf21bmc_probe(struct i2c_client *client, const struct i2c_device_id *ids)
+menf21bmc_probe(struct i2c_client *client)
 {
        int rev_major, rev_minor, rev_main;
        int ret;
@@ -111,7 +111,7 @@ MODULE_DEVICE_TABLE(i2c, menf21bmc_id_table);
 static struct i2c_driver menf21bmc_driver = {
        .driver.name    = "menf21bmc",
        .id_table       = menf21bmc_id_table,
-       .probe          = menf21bmc_probe,
+       .probe_new      = menf21bmc_probe,
 };
 
 module_i2c_driver(menf21bmc_driver);
index 265464b5d7cc56c27749650a46510c6b60a986b4..a19691ba8d8b08c1f47205a67449ebefdd9468c7 100644 (file)
@@ -221,7 +221,6 @@ static const struct regmap_config cpcap_regmap_config = {
        .val_format_endian = REGMAP_ENDIAN_LITTLE,
 };
 
-#ifdef CONFIG_PM_SLEEP
 static int cpcap_suspend(struct device *dev)
 {
        struct spi_device *spi = to_spi_device(dev);
@@ -239,9 +238,8 @@ static int cpcap_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume);
 
 static const struct mfd_cell cpcap_mfd_devices[] = {
        {
@@ -296,7 +294,7 @@ static int cpcap_probe(struct spi_device *spi)
        struct cpcap_ddata *cpcap;
        int ret;
 
-       match = of_match_device(of_match_ptr(cpcap_of_match), &spi->dev);
+       match = of_match_device(cpcap_of_match, &spi->dev);
        if (!match)
                return -ENODEV;
 
@@ -346,7 +344,7 @@ static struct spi_driver cpcap_driver = {
        .driver = {
                .name = "cpcap-core",
                .of_match_table = cpcap_of_match,
-               .pm = &cpcap_pm,
+               .pm = pm_sleep_ptr(&cpcap_pm),
        },
        .probe = cpcap_probe,
        .id_table = cpcap_spi_ids,
index 6eaa6775b888583ed3a97d1f290cae6de71028b1..d3b32eb79837755a7d31cfd73b3d813e44f40fd2 100644 (file)
@@ -402,7 +402,7 @@ static int mt6360_regmap_read(void *context, const void *reg, size_t reg_size,
        struct mt6360_ddata *ddata = context;
        u8 bank = *(u8 *)reg;
        u8 reg_addr = *(u8 *)(reg + 1);
-       struct i2c_client *i2c = ddata->i2c[bank];
+       struct i2c_client *i2c;
        bool crc_needed = false;
        u8 *buf;
        int buf_len = MT6360_ALLOC_READ_SIZE(val_size);
@@ -410,6 +410,11 @@ static int mt6360_regmap_read(void *context, const void *reg, size_t reg_size,
        u8 crc;
        int ret;
 
+       if (bank >= MT6360_SLAVE_MAX)
+               return -EINVAL;
+
+       i2c = ddata->i2c[bank];
+
        if (bank == MT6360_SLAVE_PMIC || bank == MT6360_SLAVE_LDO) {
                crc_needed = true;
                ret = mt6360_xlate_pmicldo_addr(&reg_addr, val_size);
@@ -453,13 +458,18 @@ static int mt6360_regmap_write(void *context, const void *val, size_t val_size)
        struct mt6360_ddata *ddata = context;
        u8 bank = *(u8 *)val;
        u8 reg_addr = *(u8 *)(val + 1);
-       struct i2c_client *i2c = ddata->i2c[bank];
+       struct i2c_client *i2c;
        bool crc_needed = false;
        u8 *buf;
        int buf_len = MT6360_ALLOC_WRITE_SIZE(val_size);
        int write_size = val_size - MT6360_REGMAP_REG_BYTE_SIZE;
        int ret;
 
+       if (bank >= MT6360_SLAVE_MAX)
+               return -EINVAL;
+
+       i2c = ddata->i2c[bank];
+
        if (bank == MT6360_SLAVE_PMIC || bank == MT6360_SLAVE_LDO) {
                crc_needed = true;
                ret = mt6360_xlate_pmicldo_addr(&reg_addr, val_size - MT6360_REGMAP_REG_BYTE_SIZE);
index eff53fed8fe73f7f79a32f17dc221141e0dcf3b8..72f923e47752daacb4d5ccb42617938de51cc9df 100644 (file)
@@ -54,7 +54,6 @@ static void mt6397_irq_enable(struct irq_data *data)
        mt6397->irq_masks_cur[reg] |= BIT(shift);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on)
 {
        struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(irq_data);
@@ -68,9 +67,6 @@ static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on)
 
        return 0;
 }
-#else
-#define mt6397_irq_set_wake NULL
-#endif
 
 static struct irq_chip mt6397_irq_chip = {
        .name = "mt6397-irq",
@@ -78,7 +74,7 @@ static struct irq_chip mt6397_irq_chip = {
        .irq_bus_sync_unlock = mt6397_irq_sync_unlock,
        .irq_enable = mt6397_irq_enable,
        .irq_disable = mt6397_irq_disable,
-       .irq_set_wake = mt6397_irq_set_wake,
+       .irq_set_wake = pm_sleep_ptr(mt6397_irq_set_wake),
 };
 
 static void mt6397_irq_handle_reg(struct mt6397_chip *mt6397, int reg,
index 8b7429bd2e3eb14f1994fe272256ee0b81646476..b8383c6cba3ff9842f4382c4755dc259a06e35e3 100644 (file)
@@ -502,8 +502,7 @@ static const struct of_device_id of_palmas_match_tbl[] = {
 };
 MODULE_DEVICE_TABLE(of, of_palmas_match_tbl);
 
-static int palmas_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int palmas_i2c_probe(struct i2c_client *i2c)
 {
        struct palmas *palmas;
        struct palmas_platform_data *pdata;
@@ -512,7 +511,6 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
        int ret = 0, i;
        unsigned int reg, addr;
        int slave;
-       const struct of_device_id *match;
 
        pdata = dev_get_platdata(&i2c->dev);
 
@@ -536,12 +534,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
        palmas->dev = &i2c->dev;
        palmas->irq = i2c->irq;
 
-       match = of_match_device(of_palmas_match_tbl, &i2c->dev);
-
-       if (!match)
-               return -ENODATA;
-
-       driver_data = (struct palmas_driver_data *)match->data;
+       driver_data = (struct palmas_driver_data *) device_get_match_data(&i2c->dev);
        palmas->features = *driver_data->features;
 
        for (i = 0; i < PALMAS_NUM_CLIENTS; i++) {
@@ -732,7 +725,7 @@ static struct i2c_driver palmas_i2c_driver = {
                   .name = "palmas",
                   .of_match_table = of_palmas_match_tbl,
        },
-       .probe = palmas_i2c_probe,
+       .probe_new = palmas_i2c_probe,
        .remove = palmas_i2c_remove,
        .id_table = palmas_i2c_id,
 };
index 4ccc2c3e7681d78bbb505c72e3ecdd85d9b6fb72..0e4fc99e9f492d7ec57a91701d044a06ce2ff18a 100644 (file)
@@ -158,33 +158,12 @@ pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name,
        }
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int pcf50633_suspend(struct device *dev)
-{
-       struct i2c_client *client = to_i2c_client(dev);
-       struct pcf50633 *pcf = i2c_get_clientdata(client);
-
-       return pcf50633_irq_suspend(pcf);
-}
-
-static int pcf50633_resume(struct device *dev)
-{
-       struct i2c_client *client = to_i2c_client(dev);
-       struct pcf50633 *pcf = i2c_get_clientdata(client);
-
-       return pcf50633_irq_resume(pcf);
-}
-#endif
-
-static SIMPLE_DEV_PM_OPS(pcf50633_pm, pcf50633_suspend, pcf50633_resume);
-
 static const struct regmap_config pcf50633_regmap_config = {
        .reg_bits = 8,
        .val_bits = 8,
 };
 
-static int pcf50633_probe(struct i2c_client *client,
-                               const struct i2c_device_id *ids)
+static int pcf50633_probe(struct i2c_client *client)
 {
        struct pcf50633 *pcf;
        struct platform_device *pdev;
@@ -300,10 +279,10 @@ MODULE_DEVICE_TABLE(i2c, pcf50633_id_table);
 static struct i2c_driver pcf50633_driver = {
        .driver = {
                .name   = "pcf50633",
-               .pm     = &pcf50633_pm,
+               .pm     = pm_sleep_ptr(&pcf50633_pm),
        },
        .id_table = pcf50633_id_table,
-       .probe = pcf50633_probe,
+       .probe_new = pcf50633_probe,
        .remove = pcf50633_remove,
 };
 
index 2096afb0ce9bb84c8373159dab00dbfb36236c8d..e85af7f1cb0b1bec22c8774fa7e1eba0bbf5bafa 100644 (file)
@@ -7,6 +7,7 @@
  * All rights reserved.
  */
 
+#include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/mutex.h>
@@ -218,10 +219,10 @@ out:
        return IRQ_HANDLED;
 }
 
-#ifdef CONFIG_PM
-
-int pcf50633_irq_suspend(struct pcf50633 *pcf)
+static int pcf50633_suspend(struct device *dev)
 {
+       struct i2c_client *client = to_i2c_client(dev);
+       struct pcf50633 *pcf = i2c_get_clientdata(client);
        int ret;
        int i;
        u8 res[5];
@@ -257,8 +258,10 @@ out:
        return ret;
 }
 
-int pcf50633_irq_resume(struct pcf50633 *pcf)
+static int pcf50633_resume(struct device *dev)
 {
+       struct i2c_client *client = to_i2c_client(dev);
+       struct pcf50633 *pcf = i2c_get_clientdata(client);
        int ret;
 
        /* Write the saved mask registers */
@@ -273,7 +276,7 @@ int pcf50633_irq_resume(struct pcf50633 *pcf)
        return ret;
 }
 
-#endif
+EXPORT_GPL_SIMPLE_DEV_PM_OPS(pcf50633_pm, pcf50633_suspend, pcf50633_resume);
 
 int pcf50633_irq_init(struct pcf50633 *pcf, int irq)
 {
index 4b8ff947762f24883dd0417e3d575e4e2f653c60..9f3c4a01b4c1c4111aded086a493debedba23b8e 100644 (file)
@@ -215,8 +215,8 @@ static int pm8008_probe(struct i2c_client *client)
 
        dev = &client->dev;
        regmap = devm_regmap_init_i2c(client, &qcom_mfd_regmap_cfg);
-       if (!regmap)
-               return -ENODEV;
+       if (IS_ERR(regmap))
+               return PTR_ERR(regmap);
 
        i2c_set_clientdata(client, regmap);
 
index 2f2734ba5273eef79a71f407f9a2bcae350e506f..601106580e2e56ee6507aceaf91f69fb58396a8d 100644 (file)
@@ -497,7 +497,6 @@ static const struct pm_irq_data pm8821_data = {
 };
 
 static const struct of_device_id pm8xxx_id_table[] = {
-       { .compatible = "qcom,pm8018", .data = &pm8xxx_data},
        { .compatible = "qcom,pm8058", .data = &pm8xxx_data},
        { .compatible = "qcom,pm8821", .data = &pm8821_data},
        { .compatible = "qcom,pm8921", .data = &pm8xxx_data},
index 71bc34b74bc9c07aa9a750017ecd28153ef5d445..8fea0e511550a199769d3c706cdacfd837f1985e 100644 (file)
@@ -547,7 +547,7 @@ static int qcom_rpm_probe(struct platform_device *pdev)
        init_completion(&rpm->ack);
 
        /* Enable message RAM clock */
-       rpm->ramclk = devm_clk_get(&pdev->dev, "ram");
+       rpm->ramclk = devm_clk_get_enabled(&pdev->dev, "ram");
        if (IS_ERR(rpm->ramclk)) {
                ret = PTR_ERR(rpm->ramclk);
                if (ret == -EPROBE_DEFER)
@@ -558,7 +558,6 @@ static int qcom_rpm_probe(struct platform_device *pdev)
                 */
                rpm->ramclk = NULL;
        }
-       clk_prepare_enable(rpm->ramclk); /* Accepts NULL */
 
        irq_ack = platform_get_irq_byname(pdev, "ack");
        if (irq_ack < 0)
@@ -673,22 +672,11 @@ static int qcom_rpm_probe(struct platform_device *pdev)
        if (ret)
                dev_warn(&pdev->dev, "failed to mark wakeup irq as wakeup\n");
 
-       return of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
-}
-
-static int qcom_rpm_remove(struct platform_device *pdev)
-{
-       struct qcom_rpm *rpm = dev_get_drvdata(&pdev->dev);
-
-       of_platform_depopulate(&pdev->dev);
-       clk_disable_unprepare(rpm->ramclk);
-
-       return 0;
+       return devm_of_platform_populate(&pdev->dev);
 }
 
 static struct platform_driver qcom_rpm_driver = {
        .probe = qcom_rpm_probe,
-       .remove = qcom_rpm_remove,
        .driver  = {
                .name  = "qcom_rpm",
                .of_match_table = qcom_rpm_of_match,
index b374a3d34688891e36eeea6c7f00508b9ab0a035..621ea61fa7c62983560c4ddca451f5ddbec3c5ad 100644 (file)
@@ -228,15 +228,12 @@ static void rc5t583_irq_sync_unlock(struct irq_data *irq_data)
 
        mutex_unlock(&rc5t583->irq_lock);
 }
-#ifdef CONFIG_PM_SLEEP
+
 static int rc5t583_irq_set_wake(struct irq_data *irq_data, unsigned int on)
 {
        struct rc5t583 *rc5t583 = irq_data_get_irq_chip_data(irq_data);
        return irq_set_irq_wake(rc5t583->chip_irq, on);
 }
-#else
-#define rc5t583_irq_set_wake NULL
-#endif
 
 static irqreturn_t rc5t583_irq(int irq, void *data)
 {
@@ -317,7 +314,7 @@ static struct irq_chip rc5t583_irq_chip = {
        .irq_bus_lock = rc5t583_irq_lock,
        .irq_bus_sync_unlock = rc5t583_irq_sync_unlock,
        .irq_set_type = rc5t583_irq_set_type,
-       .irq_set_wake = rc5t583_irq_set_wake,
+       .irq_set_wake = pm_sleep_ptr(rc5t583_irq_set_wake),
 };
 
 int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base)
index d0dc48f990967c56c35347c65c6b976d06aa2d7f..df83cc39931514a8f3f67f0f9763bef6752403fe 100644 (file)
@@ -233,8 +233,7 @@ static const struct regmap_config rc5t583_regmap_config = {
        .cache_type = REGCACHE_RBTREE,
 };
 
-static int rc5t583_i2c_probe(struct i2c_client *i2c,
-                             const struct i2c_device_id *id)
+static int rc5t583_i2c_probe(struct i2c_client *i2c)
 {
        struct rc5t583 *rc5t583;
        struct rc5t583_platform_data *pdata = dev_get_platdata(&i2c->dev);
@@ -289,7 +288,7 @@ static struct i2c_driver rc5t583_i2c_driver = {
        .driver = {
                   .name = "rc5t583",
                   },
-       .probe = rc5t583_i2c_probe,
+       .probe_new = rc5t583_i2c_probe,
        .id_table = rc5t583_i2c_id,
 };
 
index 3b5acf7ca39cbca4dd02ed7cbe5c4271958692e9..d71483859e2ef51225a269ba5159dff6a76777e8 100644 (file)
@@ -227,7 +227,7 @@ static const struct regmap_config retu_config = {
        .val_bits = 16,
 };
 
-static int retu_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
+static int retu_probe(struct i2c_client *i2c)
 {
        struct retu_data const *rdat;
        struct retu_dev *rdev;
@@ -318,7 +318,7 @@ static struct i2c_driver retu_driver = {
                .name = "retu-mfd",
                .of_match_table = retu_of_match,
        },
-       .probe          = retu_probe,
+       .probe_new      = retu_probe,
        .remove         = retu_remove,
        .id_table       = retu_id,
 };
index e00da7c7e3b11c83530c211f62271c4251a8d80b..f44fc3f080a8ed10525dd08e1660a91a4541d9a1 100644 (file)
@@ -137,58 +137,64 @@ static const struct resource rk817_charger_resources[] = {
 };
 
 static const struct mfd_cell rk805s[] = {
-       { .name = "rk808-clkout", },
-       { .name = "rk808-regulator", },
-       { .name = "rk805-pinctrl", },
+       { .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
+       { .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
+       { .name = "rk805-pinctrl", .id = PLATFORM_DEVID_NONE, },
        {
                .name = "rk808-rtc",
                .num_resources = ARRAY_SIZE(rtc_resources),
                .resources = &rtc_resources[0],
+               .id = PLATFORM_DEVID_NONE,
        },
        {       .name = "rk805-pwrkey",
                .num_resources = ARRAY_SIZE(rk805_key_resources),
                .resources = &rk805_key_resources[0],
+               .id = PLATFORM_DEVID_NONE,
        },
 };
 
 static const struct mfd_cell rk808s[] = {
-       { .name = "rk808-clkout", },
-       { .name = "rk808-regulator", },
+       { .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
+       { .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
        {
                .name = "rk808-rtc",
                .num_resources = ARRAY_SIZE(rtc_resources),
                .resources = rtc_resources,
+               .id = PLATFORM_DEVID_NONE,
        },
 };
 
 static const struct mfd_cell rk817s[] = {
-       { .name = "rk808-clkout",},
-       { .name = "rk808-regulator",},
+       { .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
+       { .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
        {
                .name = "rk805-pwrkey",
                .num_resources = ARRAY_SIZE(rk817_pwrkey_resources),
                .resources = &rk817_pwrkey_resources[0],
+               .id = PLATFORM_DEVID_NONE,
        },
        {
                .name = "rk808-rtc",
                .num_resources = ARRAY_SIZE(rk817_rtc_resources),
                .resources = &rk817_rtc_resources[0],
+               .id = PLATFORM_DEVID_NONE,
        },
-       { .name = "rk817-codec",},
+       { .name = "rk817-codec", .id = PLATFORM_DEVID_NONE, },
        {
                .name = "rk817-charger",
                .num_resources = ARRAY_SIZE(rk817_charger_resources),
                .resources = &rk817_charger_resources[0],
+               .id = PLATFORM_DEVID_NONE,
        },
 };
 
 static const struct mfd_cell rk818s[] = {
-       { .name = "rk808-clkout", },
-       { .name = "rk808-regulator", },
+       { .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
        {
                .name = "rk808-rtc",
                .num_resources = ARRAY_SIZE(rtc_resources),
                .resources = rtc_resources,
+               .id = PLATFORM_DEVID_NONE,
        },
 };
 
@@ -640,8 +646,7 @@ static const struct of_device_id rk808_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, rk808_of_match);
 
-static int rk808_probe(struct i2c_client *client,
-                      const struct i2c_device_id *id)
+static int rk808_probe(struct i2c_client *client)
 {
        struct device_node *np = client->dev.of_node;
        struct rk808 *rk808;
@@ -861,7 +866,7 @@ static struct i2c_driver rk808_i2c_driver = {
                .of_match_table = rk808_of_match,
                .pm = &rk8xx_pm_ops,
        },
-       .probe    = rk808_probe,
+       .probe_new = rk808_probe,
        .remove   = rk808_remove,
        .shutdown = rk8xx_shutdown,
 };
index eb8005b4e58d3aa0737fc3fd5a48b65ff5f979cf..2f59230749cd944534ef466c64cd5efd9ae72f7a 100644 (file)
@@ -80,8 +80,7 @@ static const struct regmap_irq_chip rc5t619_irq_chip = {
        .num_irqs = ARRAY_SIZE(rc5t619_irqs),
        .num_regs = 1,
        .status_base = RN5T618_INTMON,
-       .mask_base = RN5T618_INTEN,
-       .mask_invert = true,
+       .unmask_base = RN5T618_INTEN,
 };
 
 static struct i2c_client *rn5t618_pm_power_off;
index 714d9fcbf07b90866d349b4cacb1244dea63d8cf..7eb920633ee964991f163013748b0cb25eb84b7b 100644 (file)
@@ -413,9 +413,8 @@ static struct regmap_irq_chip bd71828_irq_chip = {
        .irqs = &bd71828_irqs[0],
        .num_irqs = ARRAY_SIZE(bd71828_irqs),
        .status_base = BD71828_REG_INT_BUCK,
-       .mask_base = BD71828_REG_INT_MASK_BUCK,
+       .unmask_base = BD71828_REG_INT_MASK_BUCK,
        .ack_base = BD71828_REG_INT_BUCK,
-       .mask_invert = true,
        .init_ack_masked = true,
        .num_regs = 12,
        .num_main_regs = 1,
@@ -430,9 +429,8 @@ static struct regmap_irq_chip bd71815_irq_chip = {
        .irqs = &bd71815_irqs[0],
        .num_irqs = ARRAY_SIZE(bd71815_irqs),
        .status_base = BD71815_REG_INT_STAT_01,
-       .mask_base = BD71815_REG_INT_EN_01,
+       .unmask_base = BD71815_REG_INT_EN_01,
        .ack_base = BD71815_REG_INT_STAT_01,
-       .mask_invert = true,
        .init_ack_masked = true,
        .num_regs = 12,
        .num_main_regs = 1,
@@ -515,27 +513,24 @@ static int bd71828_i2c_probe(struct i2c_client *i2c)
        }
 
        regmap = devm_regmap_init_i2c(i2c, regmap_config);
-       if (IS_ERR(regmap)) {
-               dev_err(&i2c->dev, "Failed to initialize Regmap\n");
-               return PTR_ERR(regmap);
-       }
+       if (IS_ERR(regmap))
+               return dev_err_probe(&i2c->dev, PTR_ERR(regmap),
+                                    "Failed to initialize Regmap\n");
 
        ret = devm_regmap_add_irq_chip(&i2c->dev, regmap, i2c->irq,
                                       IRQF_ONESHOT, 0, irqchip, &irq_data);
-       if (ret) {
-               dev_err(&i2c->dev, "Failed to add IRQ chip\n");
-               return ret;
-       }
+       if (ret)
+               return dev_err_probe(&i2c->dev, ret,
+                                    "Failed to add IRQ chip\n");
 
        dev_dbg(&i2c->dev, "Registered %d IRQs for chip\n",
                irqchip->num_irqs);
 
        if (button_irq) {
                ret = regmap_irq_get_virq(irq_data, button_irq);
-               if (ret < 0) {
-                       dev_err(&i2c->dev, "Failed to get the power-key IRQ\n");
-                       return ret;
-               }
+               if (ret < 0)
+                       return dev_err_probe(&i2c->dev, ret,
+                                            "Failed to get the power-key IRQ\n");
 
                button.irq = ret;
        }
@@ -547,7 +542,7 @@ static int bd71828_i2c_probe(struct i2c_client *i2c)
        ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, mfd, cells,
                                   NULL, 0, regmap_irq_get_domain(irq_data));
        if (ret)
-               dev_err(&i2c->dev, "Failed to create subdevices\n");
+               dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
 
        return ret;
 }
index bfd81f78beaee133de09301916f3dc7500b6f51e..378eb1a692e419e4ecbeb5ed3e5acf1f0a9933f4 100644 (file)
@@ -70,7 +70,6 @@ static struct regmap_irq_chip bd718xx_irq_chip = {
        .mask_base = BD718XX_REG_MIRQ,
        .ack_base = BD718XX_REG_IRQ,
        .init_ack_masked = true,
-       .mask_invert = false,
 };
 
 static const struct regmap_range pmic_status_range = {
@@ -127,8 +126,7 @@ static int bd718xx_init_press_duration(struct regmap *regmap,
        return 0;
 }
 
-static int bd718xx_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int bd718xx_i2c_probe(struct i2c_client *i2c)
 {
        struct regmap *regmap;
        struct regmap_irq_chip_data *irq_data;
@@ -158,18 +156,15 @@ static int bd718xx_i2c_probe(struct i2c_client *i2c,
        }
 
        regmap = devm_regmap_init_i2c(i2c, &bd718xx_regmap_config);
-       if (IS_ERR(regmap)) {
-               dev_err(&i2c->dev, "regmap initialization failed\n");
-               return PTR_ERR(regmap);
-       }
+       if (IS_ERR(regmap))
+               return dev_err_probe(&i2c->dev, PTR_ERR(regmap),
+                                    "regmap initialization failed\n");
 
        ret = devm_regmap_add_irq_chip(&i2c->dev, regmap, i2c->irq,
                                       IRQF_ONESHOT, 0, &bd718xx_irq_chip,
                                       &irq_data);
-       if (ret) {
-               dev_err(&i2c->dev, "Failed to add irq_chip\n");
-               return ret;
-       }
+       if (ret)
+               return dev_err_probe(&i2c->dev, ret, "Failed to add irq_chip\n");
 
        ret = bd718xx_init_press_duration(regmap, &i2c->dev);
        if (ret)
@@ -177,10 +172,8 @@ static int bd718xx_i2c_probe(struct i2c_client *i2c,
 
        ret = regmap_irq_get_virq(irq_data, BD718XX_INT_PWRBTN_S);
 
-       if (ret < 0) {
-               dev_err(&i2c->dev, "Failed to get the IRQ\n");
-               return ret;
-       }
+       if (ret < 0)
+               return dev_err_probe(&i2c->dev, ret, "Failed to get the IRQ\n");
 
        button.irq = ret;
 
@@ -188,7 +181,7 @@ static int bd718xx_i2c_probe(struct i2c_client *i2c,
                                   mfd, cells, NULL, 0,
                                   regmap_irq_get_domain(irq_data));
        if (ret)
-               dev_err(&i2c->dev, "Failed to create subdevices\n");
+               dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
 
        return ret;
 }
@@ -215,7 +208,7 @@ static struct i2c_driver bd718xx_i2c_driver = {
                .name = "rohm-bd718x7",
                .of_match_table = bd718xx_of_match,
        },
-       .probe = bd718xx_i2c_probe,
+       .probe_new = bd718xx_i2c_probe,
 };
 
 static int __init bd718xx_i2c_init(void)
index f37cd4f27aebfdfedcc2f2597bcef9904e0872f3..6491e385d980c4d5d6a56d46bfe6067216ff0772 100644 (file)
@@ -88,8 +88,7 @@ static struct regmap_irq_chip bd9576_irq_chip = {
        .irq_reg_stride = 1,
 };
 
-static int bd957x_i2c_probe(struct i2c_client *i2c,
-                            const struct i2c_device_id *id)
+static int bd957x_i2c_probe(struct i2c_client *i2c)
 {
        int ret;
        struct regmap *regmap;
@@ -122,10 +121,9 @@ static int bd957x_i2c_probe(struct i2c_client *i2c,
        }
 
        regmap = devm_regmap_init_i2c(i2c, &bd957x_regmap);
-       if (IS_ERR(regmap)) {
-               dev_err(&i2c->dev, "Failed to initialize Regmap\n");
-               return PTR_ERR(regmap);
-       }
+       if (IS_ERR(regmap))
+               return dev_err_probe(&i2c->dev, PTR_ERR(regmap),
+                                    "Failed to initialize Regmap\n");
 
        /*
         * BD9576 behaves badly. It kepts IRQ line asserted for the whole
@@ -146,10 +144,10 @@ static int bd957x_i2c_probe(struct i2c_client *i2c,
                ret = devm_regmap_add_irq_chip(&i2c->dev, regmap, i2c->irq,
                                               IRQF_ONESHOT, 0,
                                               &bd9576_irq_chip, &irq_data);
-               if (ret) {
-                       dev_err(&i2c->dev, "Failed to add IRQ chip\n");
-                       return ret;
-               }
+               if (ret)
+                       return dev_err_probe(&i2c->dev, ret,
+                                            "Failed to add IRQ chip\n");
+
                domain = regmap_irq_get_domain(irq_data);
        } else {
                ret = regmap_update_bits(regmap, BD957X_REG_INT_MAIN_MASK,
@@ -163,7 +161,7 @@ static int bd957x_i2c_probe(struct i2c_client *i2c,
        ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, cells,
                                   num_cells, NULL, 0, domain);
        if (ret)
-               dev_err(&i2c->dev, "Failed to create subdevices\n");
+               dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
 
        return ret;
 }
@@ -180,7 +178,7 @@ static struct i2c_driver bd957x_drv = {
                .name = "rohm-bd957x",
                .of_match_table = bd957x_of_match,
        },
-       .probe = &bd957x_i2c_probe,
+       .probe_new = &bd957x_i2c_probe,
 };
 module_i2c_driver(bd957x_drv);
 
index f716ab8039a06eeb6c1e9fd0009ebab2b72f7273..15d25b08143468c769a596ff9d0b9df38623c4a5 100644 (file)
@@ -106,9 +106,9 @@ static const struct regmap_config rsmu_sl_regmap_config = {
        .can_multi_write = true,
 };
 
-static int rsmu_i2c_probe(struct i2c_client *client,
-                         const struct i2c_device_id *id)
+static int rsmu_i2c_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(client);
        const struct regmap_config *cfg;
        struct rsmu_ddata *rsmu;
        int ret;
@@ -180,7 +180,7 @@ static struct i2c_driver rsmu_i2c_driver = {
                .name = "rsmu-i2c",
                .of_match_table = of_match_ptr(rsmu_i2c_of_match),
        },
-       .probe = rsmu_i2c_probe,
+       .probe_new = rsmu_i2c_probe,
        .remove = rsmu_i2c_remove,
        .id_table = rsmu_i2c_id,
 };
index f1236a9acf304586d103a6449b0a487b2a628642..a5e520fe50a143d0e55a1d8d4aa46af48922d199 100644 (file)
@@ -29,8 +29,7 @@ static const struct regmap_irq rt5033_irqs[] = {
 static const struct regmap_irq_chip rt5033_irq_chip = {
        .name           = "rt5033",
        .status_base    = RT5033_REG_PMIC_IRQ_STAT,
-       .mask_base      = RT5033_REG_PMIC_IRQ_CTRL,
-       .mask_invert    = true,
+       .unmask_base    = RT5033_REG_PMIC_IRQ_CTRL,
        .num_regs       = 1,
        .irqs           = rt5033_irqs,
        .num_irqs       = ARRAY_SIZE(rt5033_irqs),
@@ -56,8 +55,7 @@ static const struct regmap_config rt5033_regmap_config = {
        .max_register   = RT5033_REG_END,
 };
 
-static int rt5033_i2c_probe(struct i2c_client *i2c,
-                               const struct i2c_device_id *id)
+static int rt5033_i2c_probe(struct i2c_client *i2c)
 {
        struct rt5033_dev *rt5033;
        unsigned int dev_id;
@@ -124,7 +122,7 @@ static struct i2c_driver rt5033_driver = {
                .name = "rt5033",
                .of_match_table = rt5033_dt_match,
        },
-       .probe = rt5033_i2c_probe,
+       .probe_new = rt5033_i2c_probe,
        .id_table = rt5033_i2c_id,
 };
 module_i2c_driver(rt5033_driver);
index 8046e383bc92b521e00ab109822c105080a724fe..829b7a0a0781c3ef89df475abd97a13625a39f35 100644 (file)
@@ -59,9 +59,8 @@ static const struct regmap_irq rt5120_irqs[] = {
 static const struct regmap_irq_chip rt5120_irq_chip = {
        .name = "rt5120-pmic",
        .status_base = RT5120_REG_INTSTAT,
-       .mask_base = RT5120_REG_INTENABLE,
+       .unmask_base = RT5120_REG_INTENABLE,
        .ack_base = RT5120_REG_INTSTAT,
-       .mask_invert = true,
        .use_ack = true,
        .num_regs = 1,
        .irqs = rt5120_irqs,
index 1fb29c45f5cf46c1011ba162ceb30a2e52867536..b03edda56009ffe2f12ceca5f04afb4e0b2df1cf 100644 (file)
@@ -305,8 +305,7 @@ sec_pmic_i2c_parse_dt_pdata(struct device *dev)
        return pd;
 }
 
-static int sec_pmic_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int sec_pmic_probe(struct i2c_client *i2c)
 {
        const struct regmap_config *regmap;
        struct sec_platform_data *pdata;
@@ -455,7 +454,6 @@ static void sec_pmic_shutdown(struct i2c_client *i2c)
        regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sec_pmic_suspend(struct device *dev)
 {
        struct i2c_client *i2c = to_i2c_client(dev);
@@ -488,17 +486,17 @@ static int sec_pmic_resume(struct device *dev)
 
        return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops,
+                               sec_pmic_suspend, sec_pmic_resume);
 
 static struct i2c_driver sec_pmic_driver = {
        .driver = {
                   .name = "sec_pmic",
-                  .pm = &sec_pmic_pm_ops,
+                  .pm = pm_sleep_ptr(&sec_pmic_pm_ops),
                   .of_match_table = sec_dt_match,
        },
-       .probe = sec_pmic_probe,
+       .probe_new = sec_pmic_probe,
        .shutdown = sec_pmic_shutdown,
 };
 module_i2c_driver(sec_pmic_driver);
index 8166949b725cc6f6d789bbc713540974eb1ccd3a..22131cf85e3f9a5ad4744d47b524715bcd87eae4 100644 (file)
@@ -683,9 +683,9 @@ bool si476x_core_is_powered_up(struct si476x_core *core)
 }
 EXPORT_SYMBOL_GPL(si476x_core_is_powered_up);
 
-static int si476x_core_probe(struct i2c_client *client,
-                            const struct i2c_device_id *id)
+static int si476x_core_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(client);
        int rval;
        struct si476x_core          *core;
        struct si476x_platform_data *pdata;
@@ -866,7 +866,7 @@ static struct i2c_driver si476x_core_driver = {
        .driver         = {
                .name   = "si476x-core",
        },
-       .probe          = si476x_core_probe,
+       .probe_new      = si476x_core_probe,
        .remove         = si476x_core_remove,
        .id_table       = si476x_id,
 };
index 3ad35bf0c01557ae98fb19e5e48ba525bc1186b1..2515ecae1d3fe9620223c240a6a8ee64a95860ca 100644 (file)
@@ -21,8 +21,7 @@ static const struct regmap_config sky81452_config = {
        .val_bits = 8,
 };
 
-static int sky81452_probe(struct i2c_client *client,
-                               const struct i2c_device_id *id)
+static int sky81452_probe(struct i2c_client *client)
 {
        struct device *dev = &client->dev;
        const struct sky81452_platform_data *pdata = dev_get_platdata(dev);
@@ -78,7 +77,7 @@ static struct i2c_driver sky81452_driver = {
                .name = "sky81452",
                .of_match_table = of_match_ptr(sky81452_of_match),
        },
-       .probe = sky81452_probe,
+       .probe_new = sky81452_probe,
        .id_table = sky81452_ids,
 };
 
index 3ac4508a6742ac8e489e6c4502000834140d2e75..28027982cf6939a277c15ca3bbca0c8077cf9ed3 100644 (file)
@@ -1432,8 +1432,6 @@ static int sm501_plat_probe(struct platform_device *dev)
 
 }
 
-#ifdef CONFIG_PM
-
 /* power management support */
 
 static void sm501_set_power(struct sm501_devdata *sm, int on)
@@ -1509,10 +1507,6 @@ static int sm501_plat_resume(struct platform_device *pdev)
 
        return 0;
 }
-#else
-#define sm501_plat_suspend NULL
-#define sm501_plat_resume NULL
-#endif
 
 /* Initialisation data for PCI devices */
 
@@ -1714,8 +1708,8 @@ static struct platform_driver sm501_plat_driver = {
        },
        .probe          = sm501_plat_probe,
        .remove         = sm501_plat_remove,
-       .suspend        = sm501_plat_suspend,
-       .resume         = sm501_plat_resume,
+       .suspend        = pm_sleep_ptr(sm501_plat_suspend),
+       .resume         = pm_sleep_ptr(sm501_plat_resume),
 };
 
 static int __init sm501_base_init(void)
diff --git a/drivers/mfd/smpro-core.c b/drivers/mfd/smpro-core.c
new file mode 100644 (file)
index 0000000..d7729cf
--- /dev/null
@@ -0,0 +1,138 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Ampere Altra Family SMPro core driver
+ * Copyright (c) 2022, Ampere Computing LLC
+ */
+
+#include <linux/i2c.h>
+#include <linux/kernel.h>
+#include <linux/mfd/core.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/regmap.h>
+
+/* Identification Registers */
+#define MANUFACTURER_ID_REG     0x02
+#define AMPERE_MANUFACTURER_ID  0xCD3A
+
+#define CORE_CE_ERR_DATA        0x82
+#define CORE_UE_ERR_DATA        0x85
+#define MEM_CE_ERR_DATA         0x92
+#define MEM_UE_ERR_DATA         0x95
+#define PCIE_CE_ERR_DATA        0xC2
+#define PCIE_UE_ERR_DATA        0xC5
+#define OTHER_CE_ERR_DATA       0xD2
+#define OTHER_UE_ERR_DATA       0xDA
+
+static int smpro_core_write(void *context, const void *data, size_t count)
+{
+       struct device *dev = context;
+       struct i2c_client *i2c = to_i2c_client(dev);
+       int ret;
+
+       ret = i2c_master_send(i2c, data, count);
+       if (unlikely(ret != count))
+               return (ret < 0) ? ret : -EIO;
+
+       return 0;
+}
+
+static int smpro_core_read(void *context, const void *reg, size_t reg_size,
+                          void *val, size_t val_size)
+{
+       struct device *dev = context;
+       struct i2c_client *i2c = to_i2c_client(dev);
+       struct i2c_msg xfer[2];
+       unsigned char buf[2];
+       int ret;
+
+       xfer[0].addr = i2c->addr;
+       xfer[0].flags = 0;
+
+       buf[0] = *(u8 *)reg;
+       buf[1] = val_size;
+       xfer[0].len = 2;
+       xfer[0].buf = buf;
+
+       xfer[1].addr = i2c->addr;
+       xfer[1].flags = I2C_M_RD;
+       xfer[1].len = val_size;
+       xfer[1].buf = val;
+
+       ret = i2c_transfer(i2c->adapter, xfer, 2);
+       if (unlikely(ret != 2))
+               return (ret < 0) ? ret : -EIO;
+
+       return 0;
+}
+
+static const struct regmap_bus smpro_regmap_bus = {
+       .read = smpro_core_read,
+       .write = smpro_core_write,
+       .val_format_endian_default = REGMAP_ENDIAN_BIG,
+};
+
+static bool smpro_core_readable_noinc_reg(struct device *dev, unsigned int reg)
+{
+       return  (reg == CORE_CE_ERR_DATA || reg == CORE_UE_ERR_DATA ||
+                reg == MEM_CE_ERR_DATA || reg == MEM_UE_ERR_DATA ||
+                reg == PCIE_CE_ERR_DATA || reg == PCIE_UE_ERR_DATA ||
+                reg == OTHER_CE_ERR_DATA || reg == OTHER_UE_ERR_DATA);
+}
+
+static const struct regmap_config smpro_regmap_config = {
+       .reg_bits = 8,
+       .val_bits = 16,
+       .readable_noinc_reg = smpro_core_readable_noinc_reg,
+};
+
+static const struct mfd_cell smpro_devs[] = {
+       MFD_CELL_NAME("smpro-hwmon"),
+       MFD_CELL_NAME("smpro-errmon"),
+       MFD_CELL_NAME("smpro-misc"),
+};
+
+static int smpro_core_probe(struct i2c_client *i2c)
+{
+       const struct regmap_config *config;
+       struct regmap *regmap;
+       unsigned int val;
+       int ret;
+
+       config = device_get_match_data(&i2c->dev);
+       if (!config)
+               return -EINVAL;
+
+       regmap = devm_regmap_init(&i2c->dev, &smpro_regmap_bus, &i2c->dev, config);
+       if (IS_ERR(regmap))
+               return PTR_ERR(regmap);
+
+       ret = regmap_read(regmap, MANUFACTURER_ID_REG, &val);
+       if (ret)
+               return ret;
+
+       if (val != AMPERE_MANUFACTURER_ID)
+               return -ENODEV;
+
+       return devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO,
+                                   smpro_devs, ARRAY_SIZE(smpro_devs), NULL, 0, NULL);
+}
+
+static const struct of_device_id smpro_core_of_match[] = {
+       { .compatible = "ampere,smpro", .data = &smpro_regmap_config },
+       {}
+};
+MODULE_DEVICE_TABLE(of, smpro_core_of_match);
+
+static struct i2c_driver smpro_core_driver = {
+       .probe_new = smpro_core_probe,
+       .driver = {
+               .name = "smpro-core",
+               .of_match_table = smpro_core_of_match,
+       },
+};
+module_i2c_driver(smpro_core_driver);
+
+MODULE_AUTHOR("Quan Nguyen <quan@os.amperecomputing.com>");
+MODULE_DESCRIPTION("SMPRO CORE - I2C driver");
+MODULE_LICENSE("GPL");
index d05a47c5187f9298a2d9a35c6da9578f74e9f9d7..d21f32cc784da5b7c95597f45ed60f214d2e1b5e 100644 (file)
@@ -181,11 +181,10 @@ static int sprd_pmic_probe(struct spi_device *spi)
        ddata->irq_chip.name = dev_name(&spi->dev);
        ddata->irq_chip.status_base =
                pdata->irq_base + SPRD_PMIC_INT_MASK_STATUS;
-       ddata->irq_chip.mask_base = pdata->irq_base + SPRD_PMIC_INT_EN;
+       ddata->irq_chip.unmask_base = pdata->irq_base + SPRD_PMIC_INT_EN;
        ddata->irq_chip.ack_base = 0;
        ddata->irq_chip.num_regs = 1;
        ddata->irq_chip.num_irqs = pdata->num_irqs;
-       ddata->irq_chip.mask_invert = true;
 
        ddata->irqs = devm_kcalloc(&spi->dev,
                                   pdata->num_irqs, sizeof(struct regmap_irq),
@@ -215,7 +214,6 @@ static int sprd_pmic_probe(struct spi_device *spi)
        return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sprd_pmic_suspend(struct device *dev)
 {
        struct sprd_pmic *ddata = dev_get_drvdata(dev);
@@ -235,9 +233,9 @@ static int sprd_pmic_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops, sprd_pmic_suspend, sprd_pmic_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops,
+                               sprd_pmic_suspend, sprd_pmic_resume);
 
 static const struct of_device_id sprd_pmic_match[] = {
        { .compatible = "sprd,sc2730", .data = &sc2730_data },
@@ -257,7 +255,7 @@ static struct spi_driver sprd_pmic_driver = {
        .driver = {
                .name = "sc27xx-pmic",
                .of_match_table = sprd_pmic_match,
-               .pm = &sprd_pmic_pm_ops,
+               .pm = pm_sleep_ptr(&sprd_pmic_pm_ops),
        },
        .probe = sprd_pmic_probe,
        .id_table = sprd_pmic_spi_ids,
index 746e51a17cc8eafd212e64489e3400114477ba23..fa322f4412c8750524000077722016b911f7f472 100644 (file)
@@ -52,7 +52,6 @@ static int stm32_lptimer_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct stm32_lptimer *ddata;
-       struct resource *res;
        void __iomem *mmio;
        int ret;
 
@@ -60,8 +59,7 @@ static int stm32_lptimer_probe(struct platform_device *pdev)
        if (!ddata)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mmio = devm_ioremap_resource(dev, res);
+       mmio = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
        if (IS_ERR(mmio))
                return PTR_ERR(mmio);
 
index 5dd7d96884596f75e90877a1c4f768c8cf42ae30..e281971ba54ed6e9b0bbe5659467a9da19db3ca0 100644 (file)
@@ -410,8 +410,7 @@ static void stmfx_chip_exit(struct i2c_client *client)
        }
 }
 
-static int stmfx_probe(struct i2c_client *client,
-                      const struct i2c_device_id *id)
+static int stmfx_probe(struct i2c_client *client)
 {
        struct device *dev = &client->dev;
        struct stmfx *stmfx;
@@ -474,7 +473,6 @@ static void stmfx_remove(struct i2c_client *client)
        stmfx_chip_exit(client);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int stmfx_suspend(struct device *dev)
 {
        struct stmfx *stmfx = dev_get_drvdata(dev);
@@ -540,9 +538,8 @@ static int stmfx_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(stmfx_dev_pm_ops, stmfx_suspend, stmfx_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(stmfx_dev_pm_ops, stmfx_suspend, stmfx_resume);
 
 static const struct of_device_id stmfx_of_match[] = {
        { .compatible = "st,stmfx-0300", },
@@ -554,9 +551,9 @@ static struct i2c_driver stmfx_driver = {
        .driver = {
                .name = "stmfx-core",
                .of_match_table = stmfx_of_match,
-               .pm = &stmfx_dev_pm_ops,
+               .pm = pm_sleep_ptr(&stmfx_dev_pm_ops),
        },
-       .probe = stmfx_probe,
+       .probe_new = stmfx_probe,
        .remove = stmfx_remove,
 };
 module_i2c_driver(stmfx_driver);
index 4d55494a97c4b0bf68f535a657fafd5e47552332..d4944fc1feb18ed7b61a637fe8c268c9bda5c156 100644 (file)
@@ -67,8 +67,9 @@ static const struct of_device_id stmpe_of_match[] = {
 MODULE_DEVICE_TABLE(of, stmpe_of_match);
 
 static int
-stmpe_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
+stmpe_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        enum stmpe_partnum partnum;
        const struct of_device_id *of_id;
 
@@ -114,12 +115,10 @@ MODULE_DEVICE_TABLE(i2c, stmpe_i2c_id);
 static struct i2c_driver stmpe_i2c_driver = {
        .driver = {
                .name = "stmpe-i2c",
-#ifdef CONFIG_PM
-               .pm = &stmpe_dev_pm_ops,
-#endif
+               .pm = pm_sleep_ptr(&stmpe_dev_pm_ops),
                .of_match_table = stmpe_of_match,
        },
-       .probe          = stmpe_i2c_probe,
+       .probe_new      = stmpe_i2c_probe,
        .remove         = stmpe_i2c_remove,
        .id_table       = stmpe_i2c_id,
 };
index ad8055a0e28692b6de70c96211e55e46924a4c2c..e9cbf33502b3d4297158feed890f0a68bb0b5999 100644 (file)
@@ -135,9 +135,7 @@ static struct spi_driver stmpe_spi_driver = {
        .driver = {
                .name   = "stmpe-spi",
                .of_match_table = of_match_ptr(stmpe_spi_of_match),
-#ifdef CONFIG_PM
-               .pm     = &stmpe_dev_pm_ops,
-#endif
+               .pm     = pm_sleep_ptr(&stmpe_dev_pm_ops),
        },
        .probe          = stmpe_spi_probe,
        .remove         = stmpe_spi_remove,
index 0c4f74197d3e04c6befbef757b66d81db9ff72c9..c304d20bb988a2c72b16f71f90fece9aa6a85512 100644 (file)
@@ -1495,7 +1495,6 @@ void stmpe_remove(struct stmpe *stmpe)
        mfd_remove_devices(stmpe->dev);
 }
 
-#ifdef CONFIG_PM
 static int stmpe_suspend(struct device *dev)
 {
        struct stmpe *stmpe = dev_get_drvdata(dev);
@@ -1516,8 +1515,5 @@ static int stmpe_resume(struct device *dev)
        return 0;
 }
 
-const struct dev_pm_ops stmpe_dev_pm_ops = {
-       .suspend        = stmpe_suspend,
-       .resume         = stmpe_resume,
-};
-#endif
+EXPORT_GPL_SIMPLE_DEV_PM_OPS(stmpe_dev_pm_ops,
+                            stmpe_suspend, stmpe_resume);
index eb3da558c3fbdeeb52555ab31f5d016bb0222b93..8db1530d9bacb80d498022d6e015203fbd943a3d 100644 (file)
@@ -108,16 +108,16 @@ static const struct regmap_irq stpmic1_irqs[] = {
 static const struct regmap_irq_chip stpmic1_regmap_irq_chip = {
        .name = "pmic_irq",
        .status_base = INT_PENDING_R1,
-       .mask_base = INT_CLEAR_MASK_R1,
-       .unmask_base = INT_SET_MASK_R1,
+       .mask_base = INT_SET_MASK_R1,
+       .unmask_base = INT_CLEAR_MASK_R1,
+       .mask_unmask_non_inverted = true,
        .ack_base = INT_CLEAR_R1,
        .num_regs = STPMIC1_PMIC_NUM_IRQ_REGS,
        .irqs = stpmic1_irqs,
        .num_irqs = ARRAY_SIZE(stpmic1_irqs),
 };
 
-static int stpmic1_probe(struct i2c_client *i2c,
-                        const struct i2c_device_id *id)
+static int stpmic1_probe(struct i2c_client *i2c)
 {
        struct stpmic1 *ddata;
        struct device *dev = &i2c->dev;
@@ -162,7 +162,6 @@ static int stpmic1_probe(struct i2c_client *i2c,
        return devm_of_platform_populate(dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int stpmic1_suspend(struct device *dev)
 {
        struct i2c_client *i2c = to_i2c_client(dev);
@@ -187,9 +186,8 @@ static int stpmic1_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(stpmic1_pm, stpmic1_suspend, stpmic1_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(stpmic1_pm, stpmic1_suspend, stpmic1_resume);
 
 static const struct of_device_id stpmic1_of_match[] = {
        { .compatible = "st,stpmic1", },
@@ -201,9 +199,9 @@ static struct i2c_driver stpmic1_driver = {
        .driver = {
                .name = "stpmic1",
                .of_match_table = of_match_ptr(stpmic1_of_match),
-               .pm = &stpmic1_pm,
+               .pm = pm_sleep_ptr(&stpmic1_pm),
        },
-       .probe = stpmic1_probe,
+       .probe_new = stpmic1_probe,
 };
 
 module_i2c_driver(stpmic1_driver);
index 7478f03ccbae2dd582800c1a5b823271e5cfb842..2a8fc9d1c80635f695cb9f0153189af3c1876f37 100644 (file)
@@ -173,8 +173,7 @@ static const struct regmap_config stw481x_regmap_config = {
        .val_bits = 8,
 };
 
-static int stw481x_probe(struct i2c_client *client,
-                        const struct i2c_device_id *id)
+static int stw481x_probe(struct i2c_client *client)
 {
        struct stw481x                  *stw481x;
        int ret;
@@ -240,7 +239,7 @@ static struct i2c_driver stw481x_driver = {
                .name   = "stw481x",
                .of_match_table = stw481x_match,
        },
-       .probe          = stw481x_probe,
+       .probe_new      = stw481x_probe,
        .id_table       = stw481x_id,
 };
 
index cfe14d9bf6dcd43c8052c0420fb07abc6ee62778..edc180d83a4b0976aa394f1533f09eee6d0bf2b2 100644 (file)
@@ -34,9 +34,8 @@ static const struct regmap_irq_chip sun4i_gpadc_regmap_irq_chip = {
        .name = "sun4i_gpadc_irq_chip",
        .status_base = SUN4I_GPADC_INT_FIFOS,
        .ack_base = SUN4I_GPADC_INT_FIFOS,
-       .mask_base = SUN4I_GPADC_INT_FIFOC,
+       .unmask_base = SUN4I_GPADC_INT_FIFOC,
        .init_ack_masked = true,
-       .mask_invert = true,
        .irqs = sun4i_gpadc_regmap_irq,
        .num_irqs = ARRAY_SIZE(sun4i_gpadc_regmap_irq),
        .num_regs = 1,
index 663ffd4b85706dd81cf720322b77c87dc1f3b8f8..1d9d1d38d0689844e3d28ac2a392524bcd0dba7c 100644 (file)
@@ -257,7 +257,6 @@ static void t7l66xb_detach_irq(struct platform_device *dev)
 
 /*--------------------------------------------------------------------------*/
 
-#ifdef CONFIG_PM
 static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state)
 {
        struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
@@ -288,10 +287,6 @@ static int t7l66xb_resume(struct platform_device *dev)
 
        return 0;
 }
-#else
-#define t7l66xb_suspend NULL
-#define t7l66xb_resume NULL
-#endif
 
 /*--------------------------------------------------------------------------*/
 
@@ -416,8 +411,8 @@ static struct platform_driver t7l66xb_platform_driver = {
        .driver = {
                .name   = "t7l66xb",
        },
-       .suspend        = t7l66xb_suspend,
-       .resume         = t7l66xb_resume,
+       .suspend        = pm_sleep_ptr(t7l66xb_suspend),
+       .resume         = pm_sleep_ptr(t7l66xb_resume),
        .probe          = t7l66xb_probe,
        .remove         = t7l66xb_remove,
 };
index d5d0ec117acb270ebb9946d7223a1404ba1c6e65..1f6e0d682cd9f24a537060f18e6a1407279ba997 100644 (file)
@@ -352,9 +352,9 @@ tc3589x_of_probe(struct device *dev, enum tc3589x_version *version)
        return pdata;
 }
 
-static int tc3589x_probe(struct i2c_client *i2c,
-                                  const struct i2c_device_id *id)
+static int tc3589x_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct device_node *np = i2c->dev.of_node;
        struct tc3589x_platform_data *pdata = dev_get_platdata(&i2c->dev);
        struct tc3589x *tc3589x;
@@ -436,7 +436,6 @@ static void tc3589x_remove(struct i2c_client *client)
        mfd_remove_devices(tc3589x->dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tc3589x_suspend(struct device *dev)
 {
        struct tc3589x *tc3589x = dev_get_drvdata(dev);
@@ -464,9 +463,9 @@ static int tc3589x_resume(struct device *dev)
 
        return ret;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(tc3589x_dev_pm_ops, tc3589x_suspend, tc3589x_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(tc3589x_dev_pm_ops,
+                               tc3589x_suspend, tc3589x_resume);
 
 static const struct i2c_device_id tc3589x_id[] = {
        { "tc35890", TC3589X_TC35890 },
@@ -483,10 +482,10 @@ MODULE_DEVICE_TABLE(i2c, tc3589x_id);
 static struct i2c_driver tc3589x_driver = {
        .driver = {
                .name   = "tc3589x",
-               .pm     = &tc3589x_dev_pm_ops,
+               .pm     = pm_sleep_ptr(&tc3589x_dev_pm_ops),
                .of_match_table = of_match_ptr(tc3589x_match),
        },
-       .probe          = tc3589x_probe,
+       .probe_new      = tc3589x_probe,
        .remove         = tc3589x_remove,
        .id_table       = tc3589x_id,
 };
index e846e4d26b6eb2a9e4a0add8adb7cc5a641986d7..5392da6ba7b0c6fb5bc81761b2e101006a7cf2d4 100644 (file)
@@ -40,7 +40,6 @@ static const struct resource tc6387xb_mmc_resources[] = {
 
 /*--------------------------------------------------------------------------*/
 
-#ifdef CONFIG_PM
 static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state)
 {
        struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
@@ -67,10 +66,6 @@ static int tc6387xb_resume(struct platform_device *dev)
 
        return 0;
 }
-#else
-#define tc6387xb_suspend  NULL
-#define tc6387xb_resume   NULL
-#endif
 
 /*--------------------------------------------------------------------------*/
 
@@ -220,8 +215,8 @@ static struct platform_driver tc6387xb_platform_driver = {
        },
        .probe          = tc6387xb_probe,
        .remove         = tc6387xb_remove,
-       .suspend        = tc6387xb_suspend,
-       .resume         = tc6387xb_resume,
+       .suspend        = pm_sleep_ptr(tc6387xb_suspend),
+       .resume         = pm_sleep_ptr(tc6387xb_resume),
 };
 
 module_platform_driver(tc6387xb_platform_driver);
index aa903a31dd433e6abbc84f2de39cab022d29f7f6..997bb8b5881de08ca43baa772ed4098c80482e39 100644 (file)
@@ -813,7 +813,6 @@ static int tc6393xb_remove(struct platform_device *dev)
        return 0;
 }
 
-#ifdef CONFIG_PM
 static int tc6393xb_suspend(struct platform_device *dev, pm_message_t state)
 {
        struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
@@ -876,16 +875,12 @@ static int tc6393xb_resume(struct platform_device *dev)
 
        return 0;
 }
-#else
-#define tc6393xb_suspend NULL
-#define tc6393xb_resume NULL
-#endif
 
 static struct platform_driver tc6393xb_driver = {
        .probe = tc6393xb_probe,
        .remove = tc6393xb_remove,
-       .suspend = tc6393xb_suspend,
-       .resume = tc6393xb_resume,
+       .suspend = pm_sleep_ptr(tc6393xb_suspend),
+       .resume = pm_sleep_ptr(tc6393xb_resume),
 
        .driver = {
                .name = "tc6393xb",
index fd6e8c417baa33922756c95b561a9fb008562111..9921320be2557ad3beb877617cfeb881937d995b 100644 (file)
@@ -133,8 +133,9 @@ TI_LMU_DATA(lm3633, LM3633_MAX_REG);
 TI_LMU_DATA(lm3695, LM3695_MAX_REG);
 TI_LMU_DATA(lm36274, LM36274_MAX_REG);
 
-static int ti_lmu_probe(struct i2c_client *cl, const struct i2c_device_id *id)
+static int ti_lmu_probe(struct i2c_client *cl)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(cl);
        struct device *dev = &cl->dev;
        const struct ti_lmu_data *data;
        struct regmap_config regmap_cfg;
@@ -216,7 +217,7 @@ static const struct i2c_device_id ti_lmu_ids[] = {
 MODULE_DEVICE_TABLE(i2c, ti_lmu_ids);
 
 static struct i2c_driver ti_lmu_driver = {
-       .probe = ti_lmu_probe,
+       .probe_new = ti_lmu_probe,
        .driver = {
                .name = "ti-lmu",
                .of_match_table = ti_lmu_of_match,
index 9393ee60a656cd426c31bd195a49454075527a5c..07e5aa10a146f33ed95a8bd572d1a4304375f418 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
-#include <linux/msi.h>
 #include <linux/mfd/core.h>
 #include <linux/slab.h>
 
index b360568ea6750321fbed2dd550c28af89b8af266..a66cb911998d7bed4b6e4b137b22d05b61180d95 100644 (file)
@@ -117,8 +117,7 @@ static struct tps6105x_platform_data *tps6105x_parse_dt(struct device *dev)
        return pdata;
 }
 
-static int tps6105x_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
+static int tps6105x_probe(struct i2c_client *client)
 {
        struct tps6105x                 *tps6105x;
        struct tps6105x_platform_data   *pdata;
@@ -210,7 +209,7 @@ static struct i2c_driver tps6105x_driver = {
                .name   = "tps6105x",
                .of_match_table = tps6105x_of_match,
        },
-       .probe          = tps6105x_probe,
+       .probe_new      = tps6105x_probe,
        .remove         = tps6105x_remove,
        .id_table       = tps6105x_id,
 };
index c2afa2e69f42f8ab36ba3bd43245fd5feca91e92..fb733288cca3b2502ec59d825f5dfbb04132b77e 100644 (file)
@@ -519,9 +519,9 @@ static void tps65010_remove(struct i2c_client *client)
        the_tps = NULL;
 }
 
-static int tps65010_probe(struct i2c_client *client,
-                         const struct i2c_device_id *id)
+static int tps65010_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(client);
        struct tps65010         *tps;
        int                     status;
        struct tps65010_board   *board = dev_get_platdata(&client->dev);
@@ -668,7 +668,7 @@ static struct i2c_driver tps65010_driver = {
        .driver = {
                .name   = "tps65010",
        },
-       .probe  = tps65010_probe,
+       .probe_new = tps65010_probe,
        .remove = tps65010_remove,
        .id_table = tps65010_id,
 };
index 1f308c4e36941cf29897469006d8daeae035a4be..500b594de31656db8935b2e4b377b4bf18ee4256 100644 (file)
@@ -84,8 +84,7 @@ static int tps6507x_i2c_write_device(struct tps6507x_dev *tps6507x, char reg,
        return 0;
 }
 
-static int tps6507x_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int tps6507x_i2c_probe(struct i2c_client *i2c)
 {
        struct tps6507x_dev *tps6507x;
 
@@ -123,7 +122,7 @@ static struct i2c_driver tps6507x_i2c_driver = {
                   .name = "tps6507x",
                   .of_match_table = of_match_ptr(tps6507x_of_match),
        },
-       .probe = tps6507x_i2c_probe,
+       .probe_new = tps6507x_i2c_probe,
        .id_table = tps6507x_i2c_id,
 };
 
index 81a7360a87bbcc3f23baba370d287e07f777de82..9494c1d71b866c8316f4d4ffc6e6903ba22ead9a 100644 (file)
@@ -61,8 +61,7 @@ static const struct of_device_id tps65086_of_match_table[] = {
 };
 MODULE_DEVICE_TABLE(of, tps65086_of_match_table);
 
-static int tps65086_probe(struct i2c_client *client,
-                         const struct i2c_device_id *ids)
+static int tps65086_probe(struct i2c_client *client)
 {
        struct tps65086 *tps;
        unsigned int version;
@@ -130,7 +129,7 @@ static struct i2c_driver tps65086_driver = {
                .name   = "tps65086",
                .of_match_table = tps65086_of_match_table,
        },
-       .probe          = tps65086_probe,
+       .probe_new      = tps65086_probe,
        .remove         = tps65086_remove,
        .id_table       = tps65086_id_table,
 };
index bd6235308c6b9d625e6c6220b941e12378a40dcf..af718a9c58b333c7c4948086b989925871bc6ece 100644 (file)
@@ -127,8 +127,7 @@ static struct regmap_irq_chip tps65090_irq_chip = {
        .num_irqs = ARRAY_SIZE(tps65090_irqs),
        .num_regs = NUM_INT_REG,
        .status_base = TPS65090_REG_INTR_STS,
-       .mask_base = TPS65090_REG_INTR_MASK,
-       .mask_invert = true,
+       .unmask_base = TPS65090_REG_INTR_MASK,
 };
 
 static bool is_volatile_reg(struct device *dev, unsigned int reg)
@@ -164,8 +163,7 @@ static const struct of_device_id tps65090_of_match[] = {
 };
 #endif
 
-static int tps65090_i2c_probe(struct i2c_client *client,
-                             const struct i2c_device_id *id)
+static int tps65090_i2c_probe(struct i2c_client *client)
 {
        struct tps65090_platform_data *pdata = dev_get_platdata(&client->dev);
        int irq_base = 0;
@@ -238,7 +236,7 @@ static struct i2c_driver tps65090_driver = {
                .suppress_bind_attrs = true,
                .of_match_table = of_match_ptr(tps65090_of_match),
        },
-       .probe          = tps65090_i2c_probe,
+       .probe_new      = tps65090_i2c_probe,
        .id_table       = tps65090_id_table,
 };
 
index 49bb8fd168f8700c1900f9f66039bb87bce6b4c3..ea69dcef91ecc532e99f6cb31e56659a4d803731 100644 (file)
@@ -280,8 +280,7 @@ static int tps65218_voltage_set_uvlo(struct tps65218 *tps)
        return 0;
 }
 
-static int tps65218_probe(struct i2c_client *client,
-                               const struct i2c_device_id *ids)
+static int tps65218_probe(struct i2c_client *client)
 {
        struct tps65218 *tps;
        int ret;
@@ -348,7 +347,7 @@ static struct i2c_driver tps65218_driver = {
                .name   = "tps65218",
                .of_match_table = of_tps65218_match_table,
        },
-       .probe          = tps65218_probe,
+       .probe_new      = tps65218_probe,
        .id_table       = tps65218_id_table,
 };
 
diff --git a/drivers/mfd/tps65219.c b/drivers/mfd/tps65219.c
new file mode 100644 (file)
index 0000000..0e402fd
--- /dev/null
@@ -0,0 +1,299 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Driver for TPS65219 Integrated Power Management Integrated Chips (PMIC)
+//
+// Copyright (C) 2022 BayLibre Incorporated - https://www.baylibre.com/
+
+#include <linux/i2c.h>
+#include <linux/reboot.h>
+#include <linux/regmap.h>
+
+#include <linux/mfd/core.h>
+#include <linux/mfd/tps65219.h>
+
+static int tps65219_warm_reset(struct tps65219 *tps)
+{
+       return regmap_update_bits(tps->regmap, TPS65219_REG_MFP_CTRL,
+                                 TPS65219_MFP_WARM_RESET_I2C_CTRL_MASK,
+                                 TPS65219_MFP_WARM_RESET_I2C_CTRL_MASK);
+}
+
+static int tps65219_cold_reset(struct tps65219 *tps)
+{
+       return regmap_update_bits(tps->regmap, TPS65219_REG_MFP_CTRL,
+                                 TPS65219_MFP_COLD_RESET_I2C_CTRL_MASK,
+                                 TPS65219_MFP_COLD_RESET_I2C_CTRL_MASK);
+}
+
+static int tps65219_restart(struct notifier_block *this,
+                           unsigned long reboot_mode, void *cmd)
+{
+       struct tps65219 *tps;
+
+       tps = container_of(this, struct tps65219, nb);
+
+       if (reboot_mode == REBOOT_WARM)
+               tps65219_warm_reset(tps);
+       else
+               tps65219_cold_reset(tps);
+
+       return NOTIFY_DONE;
+}
+
+static struct notifier_block pmic_rst_restart_nb = {
+       .notifier_call = tps65219_restart,
+       .priority = 200,
+};
+
+static const struct resource tps65219_pwrbutton_resources[] = {
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_PB_FALLING_EDGE_DETECT, "falling"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_PB_RISING_EDGE_DETECT, "rising"),
+};
+
+static const struct resource tps65219_regulator_resources[] = {
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO3_SCG, "LDO3_SCG"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO3_OC, "LDO3_OC"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO3_UV, "LDO3_UV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO4_SCG, "LDO4_SCG"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO4_OC, "LDO4_OC"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO4_UV, "LDO4_UV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO1_SCG, "LDO1_SCG"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO1_OC, "LDO1_OC"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO1_UV, "LDO1_UV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO2_SCG, "LDO2_SCG"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO2_OC, "LDO2_OC"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO2_UV, "LDO2_UV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK3_SCG, "BUCK3_SCG"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK3_OC, "BUCK3_OC"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK3_NEG_OC, "BUCK3_NEG_OC"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK3_UV, "BUCK3_UV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK1_SCG, "BUCK1_SCG"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK1_OC, "BUCK1_OC"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK1_NEG_OC, "BUCK1_NEG_OC"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK1_UV, "BUCK1_UV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK2_SCG, "BUCK2_SCG"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK2_OC, "BUCK2_OC"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK2_NEG_OC, "BUCK2_NEG_OC"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK2_UV, "BUCK2_UV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK1_RV, "BUCK1_RV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK2_RV, "BUCK2_RV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK3_RV, "BUCK3_RV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO1_RV, "LDO1_RV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO2_RV, "LDO2_RV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO3_RV, "LDO3_RV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO4_RV, "LDO4_RV"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK1_RV_SD, "BUCK1_RV_SD"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK2_RV_SD, "BUCK2_RV_SD"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_BUCK3_RV_SD, "BUCK3_RV_SD"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO1_RV_SD, "LDO1_RV_SD"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO2_RV_SD, "LDO2_RV_SD"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO3_RV_SD, "LDO3_RV_SD"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_LDO4_RV_SD, "LDO4_RV_SD"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_TIMEOUT, "TIMEOUT"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_SENSOR_3_WARM, "SENSOR_3_WARM"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_SENSOR_2_WARM, "SENSOR_2_WARM"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_SENSOR_1_WARM, "SENSOR_1_WARM"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_SENSOR_0_WARM, "SENSOR_0_WARM"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_SENSOR_3_HOT, "SENSOR_3_HOT"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_SENSOR_2_HOT, "SENSOR_2_HOT"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_SENSOR_1_HOT, "SENSOR_1_HOT"),
+       DEFINE_RES_IRQ_NAMED(TPS65219_INT_SENSOR_0_HOT, "SENSOR_0_HOT"),
+};
+
+static const struct mfd_cell tps65219_cells[] = {
+       {
+               .name = "tps65219-regulator",
+               .resources = tps65219_regulator_resources,
+               .num_resources = ARRAY_SIZE(tps65219_regulator_resources),
+       },
+       { .name = "tps65219-gpios", },
+};
+
+static const struct mfd_cell tps65219_pwrbutton_cell = {
+       .name = "tps65219-pwrbutton",
+       .resources = tps65219_pwrbutton_resources,
+       .num_resources = ARRAY_SIZE(tps65219_pwrbutton_resources),
+};
+
+static const struct regmap_config tps65219_regmap_config = {
+       .reg_bits = 8,
+       .val_bits = 8,
+       .max_register = TPS65219_REG_FACTORY_CONFIG_2,
+};
+
+/*
+ * Mapping of main IRQ register bits to sub-IRQ register offsets so that we can
+ * access corect sub-IRQ registers based on bits that are set in main IRQ
+ * register.
+ */
+/* Timeout Residual Voltage Shutdown */
+static unsigned int bit0_offsets[] = { TPS65219_REG_INT_TO_RV_POS };
+static unsigned int bit1_offsets[] = { TPS65219_REG_INT_RV_POS };      /* Residual Voltage */
+static unsigned int bit2_offsets[] = { TPS65219_REG_INT_SYS_POS };     /* System */
+static unsigned int bit3_offsets[] = { TPS65219_REG_INT_BUCK_1_2_POS };        /* Buck 1-2 */
+static unsigned int bit4_offsets[] = { TPS65219_REG_INT_BUCK_3_POS };  /* Buck 3 */
+static unsigned int bit5_offsets[] = { TPS65219_REG_INT_LDO_1_2_POS }; /* LDO 1-2 */
+static unsigned int bit6_offsets[] = { TPS65219_REG_INT_LDO_3_4_POS }; /* LDO 3-4 */
+static unsigned int bit7_offsets[] = { TPS65219_REG_INT_PB_POS };      /* Power Button */
+
+static struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets[] = {
+       REGMAP_IRQ_MAIN_REG_OFFSET(bit0_offsets),
+       REGMAP_IRQ_MAIN_REG_OFFSET(bit1_offsets),
+       REGMAP_IRQ_MAIN_REG_OFFSET(bit2_offsets),
+       REGMAP_IRQ_MAIN_REG_OFFSET(bit3_offsets),
+       REGMAP_IRQ_MAIN_REG_OFFSET(bit4_offsets),
+       REGMAP_IRQ_MAIN_REG_OFFSET(bit5_offsets),
+       REGMAP_IRQ_MAIN_REG_OFFSET(bit6_offsets),
+       REGMAP_IRQ_MAIN_REG_OFFSET(bit7_offsets),
+};
+
+#define TPS65219_REGMAP_IRQ_REG(int_name, register_position) \
+       REGMAP_IRQ_REG(int_name, register_position, int_name##_MASK)
+
+static struct regmap_irq tps65219_irqs[] = {
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO3_SCG, TPS65219_REG_INT_LDO_3_4_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO3_OC, TPS65219_REG_INT_LDO_3_4_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO3_UV, TPS65219_REG_INT_LDO_3_4_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO4_SCG, TPS65219_REG_INT_LDO_3_4_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO4_OC, TPS65219_REG_INT_LDO_3_4_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO4_UV, TPS65219_REG_INT_LDO_3_4_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO1_SCG, TPS65219_REG_INT_LDO_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO1_OC, TPS65219_REG_INT_LDO_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO1_UV, TPS65219_REG_INT_LDO_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO2_SCG, TPS65219_REG_INT_LDO_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO2_OC, TPS65219_REG_INT_LDO_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO2_UV, TPS65219_REG_INT_LDO_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK3_SCG, TPS65219_REG_INT_BUCK_3_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK3_OC, TPS65219_REG_INT_BUCK_3_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK3_NEG_OC, TPS65219_REG_INT_BUCK_3_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK3_UV, TPS65219_REG_INT_BUCK_3_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK2_SCG, TPS65219_REG_INT_BUCK_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK2_OC, TPS65219_REG_INT_BUCK_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK2_NEG_OC, TPS65219_REG_INT_BUCK_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK2_UV, TPS65219_REG_INT_BUCK_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK1_SCG, TPS65219_REG_INT_BUCK_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK1_OC, TPS65219_REG_INT_BUCK_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK1_NEG_OC, TPS65219_REG_INT_BUCK_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK1_UV, TPS65219_REG_INT_BUCK_1_2_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_SENSOR_3_WARM, TPS65219_REG_INT_SYS_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_SENSOR_2_WARM, TPS65219_REG_INT_SYS_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_SENSOR_1_WARM, TPS65219_REG_INT_SYS_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_SENSOR_0_WARM, TPS65219_REG_INT_SYS_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_SENSOR_3_HOT, TPS65219_REG_INT_SYS_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_SENSOR_2_HOT, TPS65219_REG_INT_SYS_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_SENSOR_1_HOT, TPS65219_REG_INT_SYS_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_SENSOR_0_HOT, TPS65219_REG_INT_SYS_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK1_RV, TPS65219_REG_INT_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK2_RV, TPS65219_REG_INT_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK3_RV, TPS65219_REG_INT_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO1_RV, TPS65219_REG_INT_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO2_RV, TPS65219_REG_INT_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO3_RV, TPS65219_REG_INT_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO4_RV, TPS65219_REG_INT_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK1_RV_SD, TPS65219_REG_INT_TO_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK2_RV_SD, TPS65219_REG_INT_TO_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_BUCK3_RV_SD, TPS65219_REG_INT_TO_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO1_RV_SD, TPS65219_REG_INT_TO_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO2_RV_SD, TPS65219_REG_INT_TO_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO3_RV_SD, TPS65219_REG_INT_TO_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_LDO4_RV_SD, TPS65219_REG_INT_TO_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_TIMEOUT, TPS65219_REG_INT_TO_RV_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_PB_FALLING_EDGE_DETECT, TPS65219_REG_INT_PB_POS),
+       TPS65219_REGMAP_IRQ_REG(TPS65219_INT_PB_RISING_EDGE_DETECT, TPS65219_REG_INT_PB_POS),
+};
+
+static struct regmap_irq_chip tps65219_irq_chip = {
+       .name = "tps65219_irq",
+       .main_status = TPS65219_REG_INT_SOURCE,
+       .num_main_regs = 1,
+       .num_main_status_bits = 8,
+       .irqs = tps65219_irqs,
+       .num_irqs = ARRAY_SIZE(tps65219_irqs),
+       .status_base = TPS65219_REG_INT_LDO_3_4,
+       .ack_base = TPS65219_REG_INT_LDO_3_4,
+       .clear_ack = 1,
+       .num_regs = 8,
+       .sub_reg_offsets = tps65219_sub_irq_offsets,
+};
+
+static int tps65219_probe(struct i2c_client *client)
+{
+       struct tps65219 *tps;
+       unsigned int chipid;
+       bool pwr_button;
+       int ret;
+
+       tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
+       if (!tps)
+               return -ENOMEM;
+
+       i2c_set_clientdata(client, tps);
+
+       tps->dev = &client->dev;
+
+       tps->regmap = devm_regmap_init_i2c(client, &tps65219_regmap_config);
+       if (IS_ERR(tps->regmap)) {
+               ret = PTR_ERR(tps->regmap);
+               dev_err(tps->dev, "Failed to allocate register map: %d\n", ret);
+               return ret;
+       }
+
+       ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, client->irq,
+                                      IRQF_ONESHOT, 0, &tps65219_irq_chip,
+                                      &tps->irq_data);
+       if (ret)
+               return ret;
+
+       ret = regmap_read(tps->regmap, TPS65219_REG_TI_DEV_ID, &chipid);
+       if (ret) {
+               dev_err(tps->dev, "Failed to read device ID: %d\n", ret);
+               return ret;
+       }
+
+       ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO,
+                                  tps65219_cells, ARRAY_SIZE(tps65219_cells),
+                                  NULL, 0, regmap_irq_get_domain(tps->irq_data));
+       if (ret) {
+               dev_err(tps->dev, "Failed to add child devices: %d\n", ret);
+               return ret;
+       }
+
+       pwr_button = of_property_read_bool(tps->dev->of_node, "ti,power-button");
+       if (pwr_button) {
+               ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO,
+                                          &tps65219_pwrbutton_cell, 1, NULL, 0,
+                                          regmap_irq_get_domain(tps->irq_data));
+               if (ret) {
+                       dev_err(tps->dev, "Failed to add power-button: %d\n", ret);
+                       return ret;
+               }
+       }
+
+       tps->nb = pmic_rst_restart_nb;
+       ret = register_restart_handler(&tps->nb);
+       if (ret) {
+               dev_err(tps->dev, "cannot register restart handler, %d\n", ret);
+               return ret;
+       }
+
+       return 0;
+}
+
+static const struct of_device_id of_tps65219_match_table[] = {
+       { .compatible = "ti,tps65219", },
+       {}
+};
+MODULE_DEVICE_TABLE(of, of_tps65219_match_table);
+
+static struct i2c_driver tps65219_driver = {
+       .driver         = {
+               .name   = "tps65219",
+               .of_match_table = of_tps65219_match_table,
+       },
+       .probe_new      = tps65219_probe,
+};
+module_i2c_driver(tps65219_driver);
+
+MODULE_AUTHOR("Jerome Neanne <jneanne@baylibre.com>");
+MODULE_DESCRIPTION("TPS65219 power management IC driver");
+MODULE_LICENSE("GPL");
index fb340da64bbc42f331dc941a74b6adec88c43c5c..2d947f3f606a622450b84995b6df01f618ba3c86 100644 (file)
@@ -269,15 +269,11 @@ static void tps6586x_irq_sync_unlock(struct irq_data *data)
        mutex_unlock(&tps6586x->irq_lock);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tps6586x_irq_set_wake(struct irq_data *irq_data, unsigned int on)
 {
        struct tps6586x *tps6586x = irq_data_get_irq_chip_data(irq_data);
        return irq_set_irq_wake(tps6586x->irq, on);
 }
-#else
-#define tps6586x_irq_set_wake NULL
-#endif
 
 static struct irq_chip tps6586x_irq_chip = {
        .name = "tps6586x",
@@ -285,7 +281,7 @@ static struct irq_chip tps6586x_irq_chip = {
        .irq_bus_sync_unlock = tps6586x_irq_sync_unlock,
        .irq_disable = tps6586x_irq_disable,
        .irq_enable = tps6586x_irq_enable,
-       .irq_set_wake = tps6586x_irq_set_wake,
+       .irq_set_wake = pm_sleep_ptr(tps6586x_irq_set_wake),
 };
 
 static int tps6586x_irq_map(struct irq_domain *h, unsigned int virq,
@@ -499,8 +495,7 @@ static void tps6586x_print_version(struct i2c_client *client, int version)
        dev_info(&client->dev, "Found %s, VERSIONCRC is %02x\n", name, version);
 }
 
-static int tps6586x_i2c_probe(struct i2c_client *client,
-                                       const struct i2c_device_id *id)
+static int tps6586x_i2c_probe(struct i2c_client *client)
 {
        struct tps6586x_platform_data *pdata = dev_get_platdata(&client->dev);
        struct tps6586x *tps6586x;
@@ -624,7 +619,7 @@ static struct i2c_driver tps6586x_driver = {
                .of_match_table = of_match_ptr(tps6586x_of_match),
                .pm     = &tps6586x_pm_ops,
        },
-       .probe          = tps6586x_i2c_probe,
+       .probe_new      = tps6586x_i2c_probe,
        .remove         = tps6586x_i2c_remove,
        .id_table       = tps6586x_id_table,
 };
index 67e2707af4bce0228c1f570680b2c127b1c6c06e..821c0277a2edc22af15f01c2099324ce0a29f040 100644 (file)
@@ -441,9 +441,9 @@ static void tps65910_power_off(void)
                           DEVCTRL_DEV_OFF_MASK);
 }
 
-static int tps65910_i2c_probe(struct i2c_client *i2c,
-                             const struct i2c_device_id *id)
+static int tps65910_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct tps65910 *tps65910;
        struct tps65910_board *pmic_plat_data;
        struct tps65910_board *of_pmic_plat_data = NULL;
@@ -535,7 +535,7 @@ static struct i2c_driver tps65910_i2c_driver = {
                   .name = "tps65910",
                   .of_match_table = of_match_ptr(tps65910_of_match),
        },
-       .probe = tps65910_i2c_probe,
+       .probe_new = tps65910_i2c_probe,
        .id_table = tps65910_i2c_id,
 };
 
index 7e2b19efe8679de96d3fffd576ea11335040ffc2..1bf945966bf7abf4afe3d361d17da807c6ef4944 100644 (file)
@@ -21,8 +21,7 @@ static const struct of_device_id tps65912_i2c_of_match_table[] = {
 };
 MODULE_DEVICE_TABLE(of, tps65912_i2c_of_match_table);
 
-static int tps65912_i2c_probe(struct i2c_client *client,
-                             const struct i2c_device_id *ids)
+static int tps65912_i2c_probe(struct i2c_client *client)
 {
        struct tps65912 *tps;
 
@@ -61,7 +60,7 @@ static struct i2c_driver tps65912_i2c_driver = {
                .name   = "tps65912",
                .of_match_table = tps65912_i2c_of_match_table,
        },
-       .probe          = tps65912_i2c_probe,
+       .probe_new      = tps65912_i2c_probe,
        .remove         = tps65912_i2c_remove,
        .id_table       = tps65912_i2c_id_table,
 };
index f6b4b9d94bbd3c194e92fdd4719749dc3b771744..62be2326c9b204c673ff94d4441209d3934cc853 100644 (file)
@@ -754,8 +754,9 @@ static struct of_dev_auxdata twl_auxdata_lookup[] = {
 
 /* NOTE: This driver only handles a single twl4030/tps659x0 chip */
 static int
-twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
+twl_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(client);
        struct device_node              *node = client->dev.of_node;
        struct platform_device          *pdev;
        const struct regmap_config      *twl_regmap_config;
@@ -955,7 +956,7 @@ static struct i2c_driver twl_driver = {
        .driver.name    = DRIVER_NAME,
        .driver.pm      = &twl_dev_pm_ops,
        .id_table       = twl_ids,
-       .probe          = twl_probe,
+       .probe_new      = twl_probe,
        .remove         = twl_remove,
 };
 builtin_i2c_driver(twl_driver);
index f429b8f00db61c11ea9689138ddb61a2db7febbc..fc97fa5a2d0c3f50bd1f5698919ea262c306d966 100644 (file)
@@ -17,9 +17,8 @@
 #include <linux/platform_device.h>
 #include <linux/of.h>
 #include <linux/of_irq.h>
-#include <linux/of_gpio.h>
 #include <linux/of_platform.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/delay.h>
 #include <linux/i2c.h>
 #include <linux/regmap.h>
@@ -251,7 +250,7 @@ static int twl6040_power_up_automatic(struct twl6040 *twl6040)
 {
        int time_left;
 
-       gpio_set_value(twl6040->audpwron, 1);
+       gpiod_set_value_cansleep(twl6040->audpwron, 1);
 
        time_left = wait_for_completion_timeout(&twl6040->ready,
                                                msecs_to_jiffies(144));
@@ -262,7 +261,7 @@ static int twl6040_power_up_automatic(struct twl6040 *twl6040)
                intid = twl6040_reg_read(twl6040, TWL6040_REG_INTID);
                if (!(intid & TWL6040_READYINT)) {
                        dev_err(twl6040->dev, "automatic power-up failed\n");
-                       gpio_set_value(twl6040->audpwron, 0);
+                       gpiod_set_value_cansleep(twl6040->audpwron, 0);
                        return -ETIMEDOUT;
                }
        }
@@ -290,7 +289,7 @@ int twl6040_power(struct twl6040 *twl6040, int on)
                /* Allow writes to the chip */
                regcache_cache_only(twl6040->regmap, false);
 
-               if (gpio_is_valid(twl6040->audpwron)) {
+               if (twl6040->audpwron) {
                        /* use automatic power-up sequence */
                        ret = twl6040_power_up_automatic(twl6040);
                        if (ret) {
@@ -337,9 +336,9 @@ int twl6040_power(struct twl6040 *twl6040, int on)
                if (--twl6040->power_count)
                        goto out;
 
-               if (gpio_is_valid(twl6040->audpwron)) {
+               if (twl6040->audpwron) {
                        /* use AUDPWRON line */
-                       gpio_set_value(twl6040->audpwron, 0);
+                       gpiod_set_value_cansleep(twl6040->audpwron, 0);
 
                        /* power-down sequence latency */
                        usleep_range(500, 700);
@@ -633,8 +632,7 @@ static struct regmap_irq_chip twl6040_irq_chip = {
        .mask_base = TWL6040_REG_INTMR,
 };
 
-static int twl6040_probe(struct i2c_client *client,
-                        const struct i2c_device_id *id)
+static int twl6040_probe(struct i2c_client *client)
 {
        struct device_node *node = client->dev.of_node;
        struct twl6040 *twl6040;
@@ -712,18 +710,16 @@ static int twl6040_probe(struct i2c_client *client,
        }
 
        /* ERRATA: Automatic power-up is not possible in ES1.0 */
-       if (twl6040_get_revid(twl6040) > TWL6040_REV_ES1_0)
-               twl6040->audpwron = of_get_named_gpio(node,
-                                                     "ti,audpwron-gpio", 0);
-       else
-               twl6040->audpwron = -EINVAL;
-
-       if (gpio_is_valid(twl6040->audpwron)) {
-               ret = devm_gpio_request_one(&client->dev, twl6040->audpwron,
-                                           GPIOF_OUT_INIT_LOW, "audpwron");
+       if (twl6040_get_revid(twl6040) > TWL6040_REV_ES1_0) {
+               twl6040->audpwron = devm_gpiod_get_optional(&client->dev,
+                                                           "ti,audpwron",
+                                                           GPIOD_OUT_LOW);
+               ret = PTR_ERR_OR_ZERO(twl6040->audpwron);
                if (ret)
                        goto gpio_err;
 
+               gpiod_set_consumer_name(twl6040->audpwron, "audpwron");
+
                /* Clear any pending interrupt */
                twl6040_reg_read(twl6040, TWL6040_REG_INTID);
        }
@@ -833,7 +829,7 @@ static struct i2c_driver twl6040_driver = {
        .driver = {
                .name = "twl6040",
        },
-       .probe          = twl6040_probe,
+       .probe_new      = twl6040_probe,
        .remove         = twl6040_remove,
        .id_table       = twl6040_i2c_id,
 };
index b690796d24d4be7c1bcfb6c3cf59ae60420a3aba..fc4d4c844a81e85a01b3d1e449abf967e47d0750 100644 (file)
@@ -660,7 +660,6 @@ void ucb1x00_unregister_driver(struct ucb1x00_driver *drv)
        mutex_unlock(&ucb1x00_mutex);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int ucb1x00_suspend(struct device *dev)
 {
        struct ucb1x00_plat_data *pdata = dev_get_platdata(dev);
@@ -728,15 +727,15 @@ static int ucb1x00_resume(struct device *dev)
        mutex_unlock(&ucb1x00_mutex);
        return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(ucb1x00_pm_ops, ucb1x00_suspend, ucb1x00_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ucb1x00_pm_ops,
+                               ucb1x00_suspend, ucb1x00_resume);
 
 static struct mcp_driver ucb1x00_driver = {
        .drv            = {
                .name   = "ucb1x00",
                .owner  = THIS_MODULE,
-               .pm     = &ucb1x00_pm_ops,
+               .pm     = pm_sleep_ptr(&ucb1x00_pm_ops),
        },
        .probe          = ucb1x00_probe,
        .remove         = ucb1x00_remove,
index 68e2fa2fda99cbba925818a74259cbe56e9759eb..07e884087f2c7d37cd8e6f2bfa3409014b25546c 100644 (file)
@@ -55,17 +55,22 @@ static const struct regmap_irq wcd934x_irqs[] = {
        WCD934X_REGMAP_IRQ_REG(WCD934X_IRQ_SOUNDWIRE, 2, BIT(4)),
 };
 
+static const unsigned int wcd934x_config_regs[] = {
+       WCD934X_INTR_LEVEL0,
+};
+
 static const struct regmap_irq_chip wcd934x_regmap_irq_chip = {
        .name = "wcd934x_irq",
        .status_base = WCD934X_INTR_PIN1_STATUS0,
        .mask_base = WCD934X_INTR_PIN1_MASK0,
        .ack_base = WCD934X_INTR_PIN1_CLEAR0,
-       .type_base = WCD934X_INTR_LEVEL0,
-       .num_type_reg = 4,
-       .type_in_mask = false,
        .num_regs = 4,
        .irqs = wcd934x_irqs,
        .num_irqs = ARRAY_SIZE(wcd934x_irqs),
+       .config_base = wcd934x_config_regs,
+       .num_config_bases = ARRAY_SIZE(wcd934x_config_regs),
+       .num_config_regs = 4,
+       .set_type_config = regmap_irq_set_type_config_simple,
 };
 
 static bool wcd934x_is_volatile_register(struct device *dev, unsigned int reg)
index 1ab5e15a65ebc1fc3459d0159df9853b196dfb5e..a5d6128fc67d43533947c0a8c20a0ea3bda45d09 100644 (file)
@@ -156,8 +156,7 @@ static int wl1273_fm_set_volume(struct wl1273_core *core, unsigned int volume)
        return 0;
 }
 
-static int wl1273_core_probe(struct i2c_client *client,
-                                      const struct i2c_device_id *id)
+static int wl1273_core_probe(struct i2c_client *client)
 {
        struct wl1273_fm_platform_data *pdata = dev_get_platdata(&client->dev);
        struct wl1273_core *core;
@@ -233,7 +232,7 @@ static struct i2c_driver wl1273_core_driver = {
        .driver = {
                .name = WL1273_FM_DRIVER_NAME,
        },
-       .probe = wl1273_core_probe,
+       .probe_new = wl1273_core_probe,
        .id_table = wl1273_driver_id_table,
 };
 
index daa1ad036595496c427a1ab3bcef47c04336d6df..9dbe96e2d46a02c91053e12c4aa3172f810137d4 100644 (file)
@@ -21,9 +21,9 @@
 #include <linux/mfd/wm831x/core.h>
 #include <linux/mfd/wm831x/pdata.h>
 
-static int wm831x_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int wm831x_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        struct wm831x_pdata *pdata = dev_get_platdata(&i2c->dev);
        const struct of_device_id *of_id;
        struct wm831x *wm831x;
@@ -102,7 +102,7 @@ static struct i2c_driver wm831x_i2c_driver = {
                .of_match_table = of_match_ptr(wm831x_of_match),
                .suppress_bind_attrs = true,
        },
-       .probe = wm831x_i2c_probe,
+       .probe_new = wm831x_i2c_probe,
        .id_table = wm831x_i2c_id,
 };
 
index 48fd46800c2814f8f757e68f55c307ce83fae55b..1fa1dfbc9e315c87c7abaffccaadedb47d4ec0c8 100644 (file)
@@ -16,8 +16,7 @@
 #include <linux/regmap.h>
 #include <linux/slab.h>
 
-static int wm8350_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int wm8350_i2c_probe(struct i2c_client *i2c)
 {
        struct wm8350 *wm8350;
        struct wm8350_platform_data *pdata = dev_get_platdata(&i2c->dev);
@@ -53,7 +52,7 @@ static struct i2c_driver wm8350_i2c_driver = {
                   .name = "wm8350",
                   .suppress_bind_attrs = true,
        },
-       .probe = wm8350_i2c_probe,
+       .probe_new = wm8350_i2c_probe,
        .id_table = wm8350_i2c_id,
 };
 
index 0fe32a05421be544548d67a38050e99c8499caeb..5e1599ac9abc3b7575bb776aad43c2bbaa302675 100644 (file)
@@ -118,8 +118,7 @@ void wm8400_reset_codec_reg_cache(struct wm8400 *wm8400)
 EXPORT_SYMBOL_GPL(wm8400_reset_codec_reg_cache);
 
 #if IS_ENABLED(CONFIG_I2C)
-static int wm8400_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int wm8400_i2c_probe(struct i2c_client *i2c)
 {
        struct wm8400 *wm8400;
 
@@ -146,7 +145,7 @@ static struct i2c_driver wm8400_i2c_driver = {
        .driver = {
                .name = "WM8400",
        },
-       .probe    = wm8400_i2c_probe,
+       .probe_new = wm8400_i2c_probe,
        .id_table = wm8400_i2c_id,
 };
 #endif
index 7e88f5b0abe6a064365bc677877349482409f32f..a89221bffde5a877275c6a0418d9bebfe218a16f 100644 (file)
@@ -110,7 +110,6 @@ static const char *wm8958_main_supplies[] = {
        "SPKVDD2",
 };
 
-#ifdef CONFIG_PM
 static int wm8994_suspend(struct device *dev)
 {
        struct wm8994 *wm8994 = dev_get_drvdata(dev);
@@ -213,7 +212,6 @@ err_enable:
 
        return ret;
 }
-#endif
 
 #ifdef CONFIG_REGULATOR
 static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo)
@@ -623,9 +621,9 @@ static const struct of_device_id wm8994_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, wm8994_of_match);
 
-static int wm8994_i2c_probe(struct i2c_client *i2c,
-                                     const struct i2c_device_id *id)
+static int wm8994_i2c_probe(struct i2c_client *i2c)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
        const struct of_device_id *of_id;
        struct wm8994 *wm8994;
        int ret;
@@ -674,16 +672,16 @@ static const struct i2c_device_id wm8994_i2c_id[] = {
 MODULE_DEVICE_TABLE(i2c, wm8994_i2c_id);
 
 static const struct dev_pm_ops wm8994_pm_ops = {
-       SET_RUNTIME_PM_OPS(wm8994_suspend, wm8994_resume, NULL)
+       RUNTIME_PM_OPS(wm8994_suspend, wm8994_resume, NULL)
 };
 
 static struct i2c_driver wm8994_i2c_driver = {
        .driver = {
                .name = "wm8994",
-               .pm = &wm8994_pm_ops,
+               .pm = pm_ptr(&wm8994_pm_ops),
                .of_match_table = wm8994_of_match,
        },
-       .probe = wm8994_i2c_probe,
+       .probe_new = wm8994_i2c_probe,
        .remove = wm8994_i2c_remove,
        .id_table = wm8994_i2c_id,
 };
index 2bb640d1521d8f4c1cb4b715d66e0b75692ca099..677d2601d3057135d9fb3d76390c372da14252fb 100644 (file)
@@ -540,12 +540,6 @@ config RTC_DRV_BQ32K
          This driver can also be built as a module. If so, the module
          will be called rtc-bq32k.
 
-config RTC_DRV_DM355EVM
-       tristate "TI DaVinci DM355 EVM RTC"
-       depends on MFD_DM355EVM_MSP
-       help
-         Supports the RTC firmware in the MSP430 on the DM355 EVM.
-
 config RTC_DRV_TWL92330
        bool "TI TWL92330/Menelaus"
        depends on MENELAUS
index 791994eb913d99eb88901fd9c24555785b5e799b..d3c042dcbc7331370b0976d0829890b8fadcf8ba 100644 (file)
@@ -45,7 +45,6 @@ obj-$(CONFIG_RTC_DRV_DA9052)  += rtc-da9052.o
 obj-$(CONFIG_RTC_DRV_DA9055)   += rtc-da9055.o
 obj-$(CONFIG_RTC_DRV_DA9063)   += rtc-da9063.o
 obj-$(CONFIG_RTC_DRV_DIGICOLOR)        += rtc-digicolor.o
-obj-$(CONFIG_RTC_DRV_DM355EVM) += rtc-dm355evm.o
 obj-$(CONFIG_RTC_DRV_DS1216)   += rtc-ds1216.o
 obj-$(CONFIG_RTC_DRV_DS1286)   += rtc-ds1286.o
 obj-$(CONFIG_RTC_DRV_DS1302)   += rtc-ds1302.o
diff --git a/drivers/rtc/rtc-dm355evm.c b/drivers/rtc/rtc-dm355evm.c
deleted file mode 100644 (file)
index 94fb16a..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * rtc-dm355evm.c - access battery-backed counter in MSP430 firmware
- *
- * Copyright (c) 2008 by David Brownell
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/rtc.h>
-#include <linux/platform_device.h>
-
-#include <linux/mfd/dm355evm_msp.h>
-#include <linux/module.h>
-
-
-/*
- * The MSP430 firmware on the DM355 EVM uses a watch crystal to feed
- * a 1 Hz counter.  When a backup battery is supplied, that makes a
- * reasonable RTC for applications where alarms and non-NTP drift
- * compensation aren't important.
- *
- * The only real glitch is the inability to read or write all four
- * counter bytes atomically:  the count may increment in the middle
- * of an operation, causing trouble when the LSB rolls over.
- *
- * This driver was tested with firmware revision A4.
- */
-union evm_time {
-       u8      bytes[4];
-       u32     value;
-};
-
-static int dm355evm_rtc_read_time(struct device *dev, struct rtc_time *tm)
-{
-       union evm_time  time;
-       int             status;
-       int             tries = 0;
-
-       do {
-               /*
-                * Read LSB(0) to MSB(3) bytes.  Defend against the counter
-                * rolling over by re-reading until the value is stable,
-                * and assuming the four reads take at most a few seconds.
-                */
-               status = dm355evm_msp_read(DM355EVM_MSP_RTC_0);
-               if (status < 0)
-                       return status;
-               if (tries && time.bytes[0] == status)
-                       break;
-               time.bytes[0] = status;
-
-               status = dm355evm_msp_read(DM355EVM_MSP_RTC_1);
-               if (status < 0)
-                       return status;
-               if (tries && time.bytes[1] == status)
-                       break;
-               time.bytes[1] = status;
-
-               status = dm355evm_msp_read(DM355EVM_MSP_RTC_2);
-               if (status < 0)
-                       return status;
-               if (tries && time.bytes[2] == status)
-                       break;
-               time.bytes[2] = status;
-
-               status = dm355evm_msp_read(DM355EVM_MSP_RTC_3);
-               if (status < 0)
-                       return status;
-               if (tries && time.bytes[3] == status)
-                       break;
-               time.bytes[3] = status;
-
-       } while (++tries < 5);
-
-       dev_dbg(dev, "read timestamp %08x\n", time.value);
-
-       rtc_time64_to_tm(le32_to_cpu(time.value), tm);
-       return 0;
-}
-
-static int dm355evm_rtc_set_time(struct device *dev, struct rtc_time *tm)
-{
-       union evm_time  time;
-       unsigned long   value;
-       int             status;
-
-       value = rtc_tm_to_time64(tm);
-       time.value = cpu_to_le32(value);
-
-       dev_dbg(dev, "write timestamp %08x\n", time.value);
-
-       /*
-        * REVISIT handle non-atomic writes ... maybe just retry until
-        * byte[1] sticks (no rollover)?
-        */
-       status = dm355evm_msp_write(time.bytes[0], DM355EVM_MSP_RTC_0);
-       if (status < 0)
-               return status;
-
-       status = dm355evm_msp_write(time.bytes[1], DM355EVM_MSP_RTC_1);
-       if (status < 0)
-               return status;
-
-       status = dm355evm_msp_write(time.bytes[2], DM355EVM_MSP_RTC_2);
-       if (status < 0)
-               return status;
-
-       status = dm355evm_msp_write(time.bytes[3], DM355EVM_MSP_RTC_3);
-       if (status < 0)
-               return status;
-
-       return 0;
-}
-
-static const struct rtc_class_ops dm355evm_rtc_ops = {
-       .read_time      = dm355evm_rtc_read_time,
-       .set_time       = dm355evm_rtc_set_time,
-};
-
-/*----------------------------------------------------------------------*/
-
-static int dm355evm_rtc_probe(struct platform_device *pdev)
-{
-       struct rtc_device *rtc;
-
-       rtc = devm_rtc_allocate_device(&pdev->dev);
-       if (IS_ERR(rtc))
-               return PTR_ERR(rtc);
-
-       platform_set_drvdata(pdev, rtc);
-
-       rtc->ops = &dm355evm_rtc_ops;
-       rtc->range_max = U32_MAX;
-
-       return devm_rtc_register_device(rtc);
-}
-
-/*
- * I2C is used to talk to the MSP430, but this platform device is
- * exposed by an MFD driver that manages I2C communications.
- */
-static struct platform_driver rtc_dm355evm_driver = {
-       .probe          = dm355evm_rtc_probe,
-       .driver         = {
-               .name   = "rtc-dm355evm",
-       },
-};
-
-module_platform_driver(rtc_dm355evm_driver);
-
-MODULE_LICENSE("GPL");
diff --git a/include/linux/htcpld.h b/include/linux/htcpld.h
deleted file mode 100644 (file)
index 5f8ac9b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __LINUX_HTCPLD_H
-#define __LINUX_HTCPLD_H
-
-struct htcpld_chip_platform_data {
-       unsigned int addr;
-       unsigned int reset;
-       unsigned int num_gpios;
-       unsigned int gpio_out_base;
-       unsigned int gpio_in_base;
-       unsigned int irq_base;
-       unsigned int num_irqs;
-};
-
-struct htcpld_core_platform_data {
-       unsigned int                      i2c_adapter_id;
-
-       struct htcpld_chip_platform_data  *chip;
-       unsigned int                      num_chip;
-};
-
-#endif /* __LINUX_HTCPLD_H */
-
diff --git a/include/linux/mfd/dm355evm_msp.h b/include/linux/mfd/dm355evm_msp.h
deleted file mode 100644 (file)
index 3724703..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * dm355evm_msp.h - support MSP430 microcontroller on DM355EVM board
- */
-#ifndef __LINUX_I2C_DM355EVM_MSP
-#define __LINUX_I2C_DM355EVM_MSP
-
-/*
- * Written against Spectrum's writeup for the A4 firmware revision,
- * and tweaked to match source and rev D2 schematics by removing CPLD
- * and NOR flash hooks (which were last appropriate in rev B boards).
- *
- * Note that the firmware supports a flavor of write posting ... to be
- * sure a write completes, issue another read or write.
- */
-
-/* utilities to access "registers" emulated by msp430 firmware */
-extern int dm355evm_msp_write(u8 value, u8 reg);
-extern int dm355evm_msp_read(u8 reg);
-
-
-/* command/control registers */
-#define DM355EVM_MSP_COMMAND           0x00
-#      define MSP_COMMAND_NULL         0
-#      define MSP_COMMAND_RESET_COLD   1
-#      define MSP_COMMAND_RESET_WARM   2
-#      define MSP_COMMAND_RESET_WARM_I 3
-#      define MSP_COMMAND_POWEROFF     4
-#      define MSP_COMMAND_IR_REINIT    5
-#define DM355EVM_MSP_STATUS            0x01
-#      define MSP_STATUS_BAD_OFFSET    BIT(0)
-#      define MSP_STATUS_BAD_COMMAND   BIT(1)
-#      define MSP_STATUS_POWER_ERROR   BIT(2)
-#      define MSP_STATUS_RXBUF_OVERRUN BIT(3)
-#define DM355EVM_MSP_RESET             0x02    /* 0 bits == in reset */
-#      define MSP_RESET_DC5            BIT(0)
-#      define MSP_RESET_TVP5154        BIT(2)
-#      define MSP_RESET_IMAGER         BIT(3)
-#      define MSP_RESET_ETHERNET       BIT(4)
-#      define MSP_RESET_SYS            BIT(5)
-#      define MSP_RESET_AIC33          BIT(7)
-
-/* GPIO registers ... bit patterns mostly match the source MSP ports */
-#define DM355EVM_MSP_LED               0x03    /* active low (MSP P4) */
-#define DM355EVM_MSP_SWITCH1           0x04    /* (MSP P5, masked) */
-#      define MSP_SWITCH1_SW6_1        BIT(0)
-#      define MSP_SWITCH1_SW6_2        BIT(1)
-#      define MSP_SWITCH1_SW6_3        BIT(2)
-#      define MSP_SWITCH1_SW6_4        BIT(3)
-#      define MSP_SWITCH1_J1           BIT(4)  /* NTSC/PAL */
-#      define MSP_SWITCH1_MSP_INT      BIT(5)  /* active low */
-#define DM355EVM_MSP_SWITCH2           0x05    /* (MSP P6, masked) */
-#      define MSP_SWITCH2_SW10         BIT(3)
-#      define MSP_SWITCH2_SW11         BIT(4)
-#      define MSP_SWITCH2_SW12         BIT(5)
-#      define MSP_SWITCH2_SW13         BIT(6)
-#      define MSP_SWITCH2_SW14         BIT(7)
-#define DM355EVM_MSP_SDMMC             0x06    /* (MSP P2, masked) */
-#      define MSP_SDMMC_0_WP           BIT(1)
-#      define MSP_SDMMC_0_CD           BIT(2)  /* active low */
-#      define MSP_SDMMC_1_WP           BIT(3)
-#      define MSP_SDMMC_1_CD           BIT(4)  /* active low */
-#define DM355EVM_MSP_FIRMREV           0x07    /* not a GPIO (out of order) */
-#define DM355EVM_MSP_VIDEO_IN          0x08    /* (MSP P3, masked) */
-#      define MSP_VIDEO_IMAGER         BIT(7)  /* low == tvp5146 */
-
-/* power supply registers are currently omitted */
-
-/* RTC registers */
-#define DM355EVM_MSP_RTC_0             0x12    /* LSB */
-#define DM355EVM_MSP_RTC_1             0x13
-#define DM355EVM_MSP_RTC_2             0x14
-#define DM355EVM_MSP_RTC_3             0x15    /* MSB */
-
-/* input event queue registers; code == ((HIGH << 8) | LOW) */
-#define DM355EVM_MSP_INPUT_COUNT       0x16    /* decrement by reading LOW */
-#define DM355EVM_MSP_INPUT_HIGH                0x17
-#define DM355EVM_MSP_INPUT_LOW         0x18
-
-#endif /* __LINUX_I2C_DM355EVM_MSP */
index 1e61c7e9f50dfdc3ae7cb11470b5b6b2c5012500..117d027084395af932eaf0f9f6a0ec972eee4e0b 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/regmap.h>
 #include <linux/regulator/driver.h>
 #include <linux/extcon-provider.h>
-#include <linux/of_gpio.h>
 #include <linux/usb/phy_companion.h>
 
 #define PALMAS_NUM_CLIENTS             3
index 3f752dc62a6c4adf4ad5ef4b7616958594d5850e..539f27f8bd89b0dd222c48bd28881201294a8b51 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/workqueue.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
+#include <linux/pm.h>
 #include <linux/power_supply.h>
 #include <linux/mfd/pcf50633/backlight.h>
 
@@ -226,9 +227,6 @@ static inline struct pcf50633 *dev_to_pcf50633(struct device *dev)
 
 int pcf50633_irq_init(struct pcf50633 *pcf, int irq);
 void pcf50633_irq_free(struct pcf50633 *pcf);
-#ifdef CONFIG_PM
-int pcf50633_irq_suspend(struct pcf50633 *pcf);
-int pcf50633_irq_resume(struct pcf50633 *pcf);
-#endif
+extern const struct dev_pm_ops pcf50633_pm;
 
 #endif
index 744dce63946e069f90f8efb2c8f190ba0c36a58e..967a2e486800d17556db8660ba4abb884317e937 100644 (file)
@@ -113,10 +113,8 @@ struct stmfx {
        struct irq_domain *irq_domain;
        struct mutex lock; /* IRQ bus lock */
        u8 irq_src;
-#ifdef CONFIG_PM
        u8 bkp_sysctrl;
        u8 bkp_irqoutpin;
-#endif
 };
 
 int stmfx_function_enable(struct stmfx *stmfx, u32 func);
diff --git a/include/linux/mfd/tps65219.h b/include/linux/mfd/tps65219.h
new file mode 100644 (file)
index 0000000..e6826e3
--- /dev/null
@@ -0,0 +1,345 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Functions to access TPS65219 Power Management IC.
+ *
+ * Copyright (C) 2022 BayLibre Incorporated - https://www.baylibre.com/
+ */
+
+#ifndef MFD_TPS65219_H
+#define MFD_TPS65219_H
+
+#include <linux/bitops.h>
+#include <linux/notifier.h>
+#include <linux/regulator/driver.h>
+
+struct regmap;
+struct regmap_irq_chip_data;
+
+#define TPS65219_1V35                                  1350000
+#define TPS65219_1V8                                   1800000
+
+/* TPS chip id list */
+#define TPS65219                                       0xF0
+
+/* I2C ID for TPS65219 part */
+#define TPS65219_I2C_ID                                        0x24
+
+/* All register addresses */
+#define TPS65219_REG_TI_DEV_ID                         0x00
+#define TPS65219_REG_NVM_ID                            0x01
+#define TPS65219_REG_ENABLE_CTRL                       0x02
+#define TPS65219_REG_BUCKS_CONFIG                      0x03
+#define TPS65219_REG_LDO4_VOUT                         0x04
+#define TPS65219_REG_LDO3_VOUT                         0x05
+#define TPS65219_REG_LDO2_VOUT                         0x06
+#define TPS65219_REG_LDO1_VOUT                         0x07
+#define TPS65219_REG_BUCK3_VOUT                                0x8
+#define TPS65219_REG_BUCK2_VOUT                                0x9
+#define TPS65219_REG_BUCK1_VOUT                                0xA
+#define TPS65219_REG_LDO4_SEQUENCE_SLOT                        0xB
+#define TPS65219_REG_LDO3_SEQUENCE_SLOT                        0xC
+#define TPS65219_REG_LDO2_SEQUENCE_SLOT                        0xD
+#define TPS65219_REG_LDO1_SEQUENCE_SLOT                        0xE
+#define TPS65219_REG_BUCK3_SEQUENCE_SLOT               0xF
+#define TPS65219_REG_BUCK2_SEQUENCE_SLOT               0x10
+#define TPS65219_REG_BUCK1_SEQUENCE_SLOT               0x11
+#define TPS65219_REG_nRST_SEQUENCE_SLOT                        0x12
+#define TPS65219_REG_GPIO_SEQUENCE_SLOT                        0x13
+#define TPS65219_REG_GPO2_SEQUENCE_SLOT                        0x14
+#define TPS65219_REG_GPO1_SEQUENCE_SLOT                        0x15
+#define TPS65219_REG_POWER_UP_SLOT_DURATION_1          0x16
+#define TPS65219_REG_POWER_UP_SLOT_DURATION_2          0x17
+#define TPS65219_REG_POWER_UP_SLOT_DURATION_3          0x18
+#define TPS65219_REG_POWER_UP_SLOT_DURATION_4          0x19
+#define TPS65219_REG_POWER_DOWN_SLOT_DURATION_1                0x1A
+#define TPS65219_REG_POWER_DOWN_SLOT_DURATION_2                0x1B
+#define TPS65219_REG_POWER_DOWN_SLOT_DURATION_3                0x1C
+#define TPS65219_REG_POWER_DOWN_SLOT_DURATION_4                0x1D
+#define TPS65219_REG_GENERAL_CONFIG                    0x1E
+#define TPS65219_REG_MFP_1_CONFIG                      0x1F
+#define TPS65219_REG_MFP_2_CONFIG                      0x20
+#define TPS65219_REG_STBY_1_CONFIG                     0x21
+#define TPS65219_REG_STBY_2_CONFIG                     0x22
+#define TPS65219_REG_OC_DEGL_CONFIG                    0x23
+/* 'sub irq' MASK registers */
+#define TPS65219_REG_INT_MASK_UV                       0x24
+#define TPS65219_REG_MASK_CONFIG                       0x25
+
+#define TPS65219_REG_I2C_ADDRESS_REG                   0x26
+#define TPS65219_REG_USER_GENERAL_NVM_STORAGE          0x27
+#define TPS65219_REG_MANUFACTURING_VER                 0x28
+#define TPS65219_REG_MFP_CTRL                          0x29
+#define TPS65219_REG_DISCHARGE_CONFIG                  0x2A
+/* main irq registers */
+#define TPS65219_REG_INT_SOURCE                                0x2B
+/* 'sub irq' registers */
+#define TPS65219_REG_INT_LDO_3_4                       0x2C
+#define TPS65219_REG_INT_LDO_1_2                       0x2D
+#define TPS65219_REG_INT_BUCK_3                                0x2E
+#define TPS65219_REG_INT_BUCK_1_2                      0x2F
+#define TPS65219_REG_INT_SYSTEM                                0x30
+#define TPS65219_REG_INT_RV                            0x31
+#define TPS65219_REG_INT_TIMEOUT_RV_SD                 0x32
+#define TPS65219_REG_INT_PB                            0x33
+
+#define TPS65219_REG_INT_LDO_3_4_POS                   0
+#define TPS65219_REG_INT_LDO_1_2_POS                   1
+#define TPS65219_REG_INT_BUCK_3_POS                    2
+#define TPS65219_REG_INT_BUCK_1_2_POS                  3
+#define TPS65219_REG_INT_SYS_POS                       4
+#define TPS65219_REG_INT_RV_POS                                5
+#define TPS65219_REG_INT_TO_RV_POS                     6
+#define TPS65219_REG_INT_PB_POS                                7
+
+#define TPS65219_REG_USER_NVM_CMD                      0x34
+#define TPS65219_REG_POWER_UP_STATUS                   0x35
+#define TPS65219_REG_SPARE_2                           0x36
+#define TPS65219_REG_SPARE_3                           0x37
+#define TPS65219_REG_FACTORY_CONFIG_2                  0x41
+
+/* Register field definitions */
+#define TPS65219_DEVID_REV_MASK                                GENMASK(7, 0)
+#define TPS65219_BUCKS_LDOS_VOUT_VSET_MASK             GENMASK(5, 0)
+#define TPS65219_BUCKS_UV_THR_SEL_MASK                 BIT(6)
+#define TPS65219_BUCKS_BW_SEL_MASK                     BIT(7)
+#define LDO_BYP_SHIFT                                  6
+#define TPS65219_LDOS_BYP_CONFIG_MASK                  BIT(LDO_BYP_SHIFT)
+#define TPS65219_LDOS_LSW_CONFIG_MASK                  BIT(7)
+/* Regulators enable control */
+#define TPS65219_ENABLE_BUCK1_EN_MASK                  BIT(0)
+#define TPS65219_ENABLE_BUCK2_EN_MASK                  BIT(1)
+#define TPS65219_ENABLE_BUCK3_EN_MASK                  BIT(2)
+#define TPS65219_ENABLE_LDO1_EN_MASK                   BIT(3)
+#define TPS65219_ENABLE_LDO2_EN_MASK                   BIT(4)
+#define TPS65219_ENABLE_LDO3_EN_MASK                   BIT(5)
+#define TPS65219_ENABLE_LDO4_EN_MASK                   BIT(6)
+/* power ON-OFF sequence slot */
+#define TPS65219_BUCKS_LDOS_SEQUENCE_OFF_SLOT_MASK     GENMASK(3, 0)
+#define TPS65219_BUCKS_LDOS_SEQUENCE_ON_SLOT_MASK      GENMASK(7, 4)
+/* TODO: Not needed, same mapping as TPS65219_ENABLE_REGNAME_EN, factorize */
+#define TPS65219_STBY1_BUCK1_STBY_EN_MASK              BIT(0)
+#define TPS65219_STBY1_BUCK2_STBY_EN_MASK              BIT(1)
+#define TPS65219_STBY1_BUCK3_STBY_EN_MASK              BIT(2)
+#define TPS65219_STBY1_LDO1_STBY_EN_MASK               BIT(3)
+#define TPS65219_STBY1_LDO2_STBY_EN_MASK               BIT(4)
+#define TPS65219_STBY1_LDO3_STBY_EN_MASK               BIT(5)
+#define TPS65219_STBY1_LDO4_STBY_EN_MASK               BIT(6)
+/* STBY_2 config */
+#define TPS65219_STBY2_GPO1_STBY_EN_MASK               BIT(0)
+#define TPS65219_STBY2_GPO2_STBY_EN_MASK               BIT(1)
+#define TPS65219_STBY2_GPIO_STBY_EN_MASK               BIT(2)
+/* MFP Control */
+#define TPS65219_MFP_I2C_OFF_REQ_MASK                  BIT(0)
+#define TPS65219_MFP_STBY_I2C_CTRL_MASK                        BIT(1)
+#define TPS65219_MFP_COLD_RESET_I2C_CTRL_MASK          BIT(2)
+#define TPS65219_MFP_WARM_RESET_I2C_CTRL_MASK          BIT(3)
+#define TPS65219_MFP_GPIO_STATUS_MASK                  BIT(4)
+/* MFP_1 Config */
+#define TPS65219_MFP_1_VSEL_DDR_SEL_MASK               BIT(0)
+#define TPS65219_MFP_1_VSEL_SD_POL_MASK                        BIT(1)
+#define TPS65219_MFP_1_VSEL_RAIL_MASK                  BIT(2)
+/* MFP_2 Config */
+#define TPS65219_MFP_2_MODE_STBY_MASK                  GENMASK(1, 0)
+#define TPS65219_MFP_2_MODE_RESET_MASK                 BIT(2)
+#define TPS65219_MFP_2_EN_PB_VSENSE_DEGL_MASK          BIT(3)
+#define TPS65219_MFP_2_EN_PB_VSENSE_MASK               GENMASK(5, 4)
+#define TPS65219_MFP_2_WARM_COLD_RESET_MASK            BIT(6)
+#define TPS65219_MFP_2_PU_ON_FSD_MASK                  BIT(7)
+#define TPS65219_MFP_2_EN                              0
+#define TPS65219_MFP_2_PB                              BIT(4)
+#define TPS65219_MFP_2_VSENSE                          BIT(5)
+/* MASK_UV Config */
+#define TPS65219_REG_MASK_UV_LDO1_UV_MASK              BIT(0)
+#define TPS65219_REG_MASK_UV_LDO2_UV_MASK              BIT(1)
+#define TPS65219_REG_MASK_UV_LDO3_UV_MASK              BIT(2)
+#define TPS65219_REG_MASK_UV_LDO4_UV_MASK              BIT(3)
+#define TPS65219_REG_MASK_UV_BUCK1_UV_MASK             BIT(4)
+#define TPS65219_REG_MASK_UV_BUCK2_UV_MASK             BIT(5)
+#define TPS65219_REG_MASK_UV_BUCK3_UV_MASK             BIT(6)
+#define TPS65219_REG_MASK_UV_RETRY_MASK                        BIT(7)
+/* MASK Config */
+// SENSOR_N_WARM_MASK already defined in Thermal
+#define TPS65219_REG_MASK_INT_FOR_RV_MASK              BIT(4)
+#define TPS65219_REG_MASK_EFFECT_MASK                  GENMASK(2, 1)
+#define TPS65219_REG_MASK_INT_FOR_PB_MASK              BIT(7)
+/* UnderVoltage - Short to GND - OverCurrent*/
+/* LDO3-4 */
+#define TPS65219_INT_LDO3_SCG_MASK                     BIT(0)
+#define TPS65219_INT_LDO3_OC_MASK                      BIT(1)
+#define TPS65219_INT_LDO3_UV_MASK                      BIT(2)
+#define TPS65219_INT_LDO4_SCG_MASK                     BIT(3)
+#define TPS65219_INT_LDO4_OC_MASK                      BIT(4)
+#define TPS65219_INT_LDO4_UV_MASK                      BIT(5)
+/* LDO1-2 */
+#define TPS65219_INT_LDO1_SCG_MASK                     BIT(0)
+#define TPS65219_INT_LDO1_OC_MASK                      BIT(1)
+#define TPS65219_INT_LDO1_UV_MASK                      BIT(2)
+#define TPS65219_INT_LDO2_SCG_MASK                     BIT(3)
+#define TPS65219_INT_LDO2_OC_MASK                      BIT(4)
+#define TPS65219_INT_LDO2_UV_MASK                      BIT(5)
+/* BUCK3 */
+#define TPS65219_INT_BUCK3_SCG_MASK                    BIT(0)
+#define TPS65219_INT_BUCK3_OC_MASK                     BIT(1)
+#define TPS65219_INT_BUCK3_NEG_OC_MASK                 BIT(2)
+#define TPS65219_INT_BUCK3_UV_MASK                     BIT(3)
+/* BUCK1-2 */
+#define TPS65219_INT_BUCK1_SCG_MASK                    BIT(0)
+#define TPS65219_INT_BUCK1_OC_MASK                     BIT(1)
+#define TPS65219_INT_BUCK1_NEG_OC_MASK                 BIT(2)
+#define TPS65219_INT_BUCK1_UV_MASK                     BIT(3)
+#define TPS65219_INT_BUCK2_SCG_MASK                    BIT(4)
+#define TPS65219_INT_BUCK2_OC_MASK                     BIT(5)
+#define TPS65219_INT_BUCK2_NEG_OC_MASK                 BIT(6)
+#define TPS65219_INT_BUCK2_UV_MASK                     BIT(7)
+/* Thermal Sensor  */
+#define TPS65219_INT_SENSOR_3_WARM_MASK                        BIT(0)
+#define TPS65219_INT_SENSOR_2_WARM_MASK                        BIT(1)
+#define TPS65219_INT_SENSOR_1_WARM_MASK                        BIT(2)
+#define TPS65219_INT_SENSOR_0_WARM_MASK                        BIT(3)
+#define TPS65219_INT_SENSOR_3_HOT_MASK                 BIT(4)
+#define TPS65219_INT_SENSOR_2_HOT_MASK                 BIT(5)
+#define TPS65219_INT_SENSOR_1_HOT_MASK                 BIT(6)
+#define TPS65219_INT_SENSOR_0_HOT_MASK                 BIT(7)
+/* Residual Voltage */
+#define TPS65219_INT_BUCK1_RV_MASK                     BIT(0)
+#define TPS65219_INT_BUCK2_RV_MASK                     BIT(1)
+#define TPS65219_INT_BUCK3_RV_MASK                     BIT(2)
+#define TPS65219_INT_LDO1_RV_MASK                      BIT(3)
+#define TPS65219_INT_LDO2_RV_MASK                      BIT(4)
+#define TPS65219_INT_LDO3_RV_MASK                      BIT(5)
+#define TPS65219_INT_LDO4_RV_MASK                      BIT(6)
+/* Residual Voltage ShutDown */
+#define TPS65219_INT_BUCK1_RV_SD_MASK                  BIT(0)
+#define TPS65219_INT_BUCK2_RV_SD_MASK                  BIT(1)
+#define TPS65219_INT_BUCK3_RV_SD_MASK                  BIT(2)
+#define TPS65219_INT_LDO1_RV_SD_MASK                   BIT(3)
+#define TPS65219_INT_LDO2_RV_SD_MASK                   BIT(4)
+#define TPS65219_INT_LDO3_RV_SD_MASK                   BIT(5)
+#define TPS65219_INT_LDO4_RV_SD_MASK                   BIT(6)
+#define TPS65219_INT_TIMEOUT_MASK                      BIT(7)
+/* Power Button */
+#define TPS65219_INT_PB_FALLING_EDGE_DETECT_MASK       BIT(0)
+#define TPS65219_INT_PB_RISING_EDGE_DETECT_MASK                BIT(1)
+#define TPS65219_INT_PB_REAL_TIME_STATUS_MASK          BIT(2)
+
+#define TPS65219_PB_POS                                        7
+#define TPS65219_TO_RV_POS                             6
+#define TPS65219_RV_POS                                        5
+#define TPS65219_SYS_POS                               4
+#define TPS65219_BUCK_1_2_POS                          3
+#define TPS65219_BUCK_3_POS                            2
+#define TPS65219_LDO_1_2_POS                           1
+#define TPS65219_LDO_3_4_POS                           0
+
+/* IRQs */
+enum {
+       /* LDO3-4 register IRQs */
+       TPS65219_INT_LDO3_SCG,
+       TPS65219_INT_LDO3_OC,
+       TPS65219_INT_LDO3_UV,
+       TPS65219_INT_LDO4_SCG,
+       TPS65219_INT_LDO4_OC,
+       TPS65219_INT_LDO4_UV,
+       /* LDO1-2 */
+       TPS65219_INT_LDO1_SCG,
+       TPS65219_INT_LDO1_OC,
+       TPS65219_INT_LDO1_UV,
+       TPS65219_INT_LDO2_SCG,
+       TPS65219_INT_LDO2_OC,
+       TPS65219_INT_LDO2_UV,
+       /* BUCK3 */
+       TPS65219_INT_BUCK3_SCG,
+       TPS65219_INT_BUCK3_OC,
+       TPS65219_INT_BUCK3_NEG_OC,
+       TPS65219_INT_BUCK3_UV,
+       /* BUCK1-2 */
+       TPS65219_INT_BUCK1_SCG,
+       TPS65219_INT_BUCK1_OC,
+       TPS65219_INT_BUCK1_NEG_OC,
+       TPS65219_INT_BUCK1_UV,
+       TPS65219_INT_BUCK2_SCG,
+       TPS65219_INT_BUCK2_OC,
+       TPS65219_INT_BUCK2_NEG_OC,
+       TPS65219_INT_BUCK2_UV,
+       /* Thermal Sensor  */
+       TPS65219_INT_SENSOR_3_WARM,
+       TPS65219_INT_SENSOR_2_WARM,
+       TPS65219_INT_SENSOR_1_WARM,
+       TPS65219_INT_SENSOR_0_WARM,
+       TPS65219_INT_SENSOR_3_HOT,
+       TPS65219_INT_SENSOR_2_HOT,
+       TPS65219_INT_SENSOR_1_HOT,
+       TPS65219_INT_SENSOR_0_HOT,
+       /* Residual Voltage */
+       TPS65219_INT_BUCK1_RV,
+       TPS65219_INT_BUCK2_RV,
+       TPS65219_INT_BUCK3_RV,
+       TPS65219_INT_LDO1_RV,
+       TPS65219_INT_LDO2_RV,
+       TPS65219_INT_LDO3_RV,
+       TPS65219_INT_LDO4_RV,
+       /* Residual Voltage ShutDown */
+       TPS65219_INT_BUCK1_RV_SD,
+       TPS65219_INT_BUCK2_RV_SD,
+       TPS65219_INT_BUCK3_RV_SD,
+       TPS65219_INT_LDO1_RV_SD,
+       TPS65219_INT_LDO2_RV_SD,
+       TPS65219_INT_LDO3_RV_SD,
+       TPS65219_INT_LDO4_RV_SD,
+       TPS65219_INT_TIMEOUT,
+       /* Power Button */
+       TPS65219_INT_PB_FALLING_EDGE_DETECT,
+       TPS65219_INT_PB_RISING_EDGE_DETECT,
+};
+
+enum tps65219_regulator_id {
+       /* DCDC's */
+       TPS65219_BUCK_1,
+       TPS65219_BUCK_2,
+       TPS65219_BUCK_3,
+       /* LDOs */
+       TPS65219_LDO_1,
+       TPS65219_LDO_2,
+       TPS65219_LDO_3,
+       TPS65219_LDO_4,
+};
+
+/* Number of step-down converters available */
+#define TPS65219_NUM_DCDC              3
+/* Number of LDO voltage regulators available */
+#define TPS65219_NUM_LDO               4
+/* Number of total regulators available */
+#define TPS65219_NUM_REGULATOR         (TPS65219_NUM_DCDC + TPS65219_NUM_LDO)
+
+/* Define the TPS65219 IRQ numbers */
+enum tps65219_irqs {
+       /* INT source registers */
+       TPS65219_TO_RV_SD_SET_IRQ,
+       TPS65219_RV_SET_IRQ,
+       TPS65219_SYS_SET_IRQ,
+       TPS65219_BUCK_1_2_SET_IRQ,
+       TPS65219_BUCK_3_SET_IRQ,
+       TPS65219_LDO_1_2_SET_IRQ,
+       TPS65219_LDO_3_4_SET_IRQ,
+       TPS65219_PB_SET_IRQ,
+};
+
+/**
+ * struct tps65219 - tps65219 sub-driver chip access routines
+ *
+ * Device data may be used to access the TPS65219 chip
+ *
+ * @dev: MFD device
+ * @regmap: Regmap for accessing the device registers
+ * @irq_data: Regmap irq data used for the irq chip
+ * @nb: notifier block for the restart handler
+ */
+struct tps65219 {
+       struct device *dev;
+       struct regmap *regmap;
+
+       struct regmap_irq_chip_data *irq_data;
+       struct notifier_block nb;
+};
+
+#endif /* MFD_TPS65219_H */
index 1fc7450bd8ab1216c05e5033459eec918b5e8d69..286a724e379a7d5d50d69798c773e9d5865a39da 100644 (file)
 
 #define TWL6040_GPO_MAX        3
 
-/* TODO: All platform data struct can be removed */
-struct twl6040_codec_data {
-       u16 hs_left_step;
-       u16 hs_right_step;
-       u16 hf_left_step;
-       u16 hf_right_step;
-};
-
-struct twl6040_vibra_data {
-       unsigned int vibldrv_res;       /* left driver resistance */
-       unsigned int vibrdrv_res;       /* right driver resistance */
-       unsigned int viblmotor_res;     /* left motor resistance */
-       unsigned int vibrmotor_res;     /* right motor resistance */
-       int vddvibl_uV;                 /* VDDVIBL volt, set 0 for fixed reg */
-       int vddvibr_uV;                 /* VDDVIBR volt, set 0 for fixed reg */
-};
-
-struct twl6040_gpo_data {
-       int gpio_base;
-};
-
-struct twl6040_platform_data {
-       int audpwron_gpio;      /* audio power-on gpio */
-
-       struct twl6040_codec_data *codec;
-       struct twl6040_vibra_data *vibra;
-       struct twl6040_gpo_data *gpo;
-};
-
+struct gpio_desc;
 struct regmap;
 struct regmap_irq_chips_data;
 
@@ -218,7 +190,7 @@ struct twl6040 {
        struct mfd_cell cells[TWL6040_CELLS];
        struct completion ready;
 
-       int audpwron;
+       struct gpio_desc *audpwron;
        int power_count;
        int rev;