提交 d26f552e 编写于 作者: L Linus Torvalds

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

Pull MFD updates from Lee Jones:
 "New Drivers:
   - Freescale MXS Low Resolution ADC
   - Freescale i.MX23/i.MX28 LRADC touchscreen
   - Motorola CPCAP Power Button
   - TI LMU (Lighting Management Unit)
   - Atmel SMC (Static Memory Controller)

  New Device Support:
   - Add support for X-Powers AXP803 to axp20x
   - Add support for Dialog Semi DA9061 to da9062-core
   - Add support for Intel Cougar Mountain to lpc_ich
   - Add support for Intel Gemini Lake to lpc_ich

  New Functionality:
   - Add Device Tree support; wm831x-*, axp20x, ti-lmu, da9062, sun4i-gpadc
   - Add IRQ sense support; motorola-cpcap
   - Add ACPI support; cros_ec
   - Add Reset support; altera-a10sr
   - Add ADC support; axp20x
   - Add AC Power support; axp20x
   - Add Runtime PM support; atmel-ebi, exynos-lpass
   - Add Battery Power Supply support; axp20x
   - Add Clock support; exynos-lpass, hi655x-pmic

  Fix-ups:
   - Implicitly specify required headers; motorola-cpcap, intel_soc_pmic_bxtwc
   - Add .remove() method; stm32-timers, exynos-lpass
   - Remove unused code; intel_soc_pmic_core, intel-lpss-acpi, ipaq-micro, atmel-smc, menelaus
   - Rename variables for clarity; axp20x
   - Convert pr_warning() to pr_warn(); db8500-prcmu, sta2x11-mfd, twl4030-power
   - Improve formatting; arizona-core, axp20x
   - Use raw_spinlock_*() variants; asic3, t7l66xb, tc6393xb
   - Simplify/refactor code; arizona-core, atmel-ebi
   - Improve error checking; intel_soc_pmic_core

  Bug Fixes:
   - Ensure OMAP3630/3730 boards can successfully reboot; twl4030-power
   - Correct max-register value; stm32-timers
   - Extend timeout to account for clock stretching; cros_ec_spi
   - Use correct IRQ trigger type; motorola-cpcap
   - Fix bad use of IRQ sense register; motorola-cpcap
   - Logic error "||" should be "&&"; mxs-lradc-ts"

* tag 'mfd-next-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (79 commits)
  input: touchscreen: mxs-lradc: || vs && typos
  dt-bindings: Add AXP803's regulator info
  mfd: axp20x: Support AXP803 variant
  dt-bindings: Add device tree binding for X-Powers AXP803 PMIC
  dt-bindings: Make AXP20X compatible strings one per line
  mfd: intel_soc_pmic_core: Fix unchecked return value
  mfd: menelaus: Remove obsolete local_irq_disable() and local_irq_enable()
  mfd: omap-usb-tll: Configure ULPIAUTOIDLE
  mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode
  mfd: palmas: Fixed spelling mistake in error message
  mfd: lpc_ich: Add support for Intel Gemini Lake SoC
  mfd: hi655x: Add the clock cell to provide WiFi and Bluetooth
  mfd: intel_soc_pmic: Fix a mess with compilation units
  mfd: exynos-lpass: Add runtime PM support
  mfd: exynos-lpass: Add missing remove() function
  mfd: exynos-lpass: Add support for clocks
  mfd: exynos-lpass: Remove pad retention control
  iio: adc: add support for X-Powers AXP20X and AXP22X PMICs ADCs
  mfd: cpcap: Fix bad use of IRQ sense register
  mfd: cpcap: Use ack_invert interrupts
  ...
Motorola CPCAP on key
This module is part of the CPCAP. For more details about the whole
chip see Documentation/devicetree/bindings/mfd/motorola-cpcap.txt.
This module provides a simple power button event via an Interrupt.
Required properties:
- compatible: should be one of the following
- "motorola,cpcap-pwrbutton"
- interrupts: irq specifier for CPCAP's ON IRQ
Example:
&cpcap {
cpcap_pwrbutton: pwrbutton {
compatible = "motorola,cpcap-pwrbutton";
interrupts = <23 IRQ_TYPE_NONE>;
};
};
...@@ -18,6 +18,7 @@ The A10SR consists of these sub-devices: ...@@ -18,6 +18,7 @@ The A10SR consists of these sub-devices:
Device Description Device Description
------ ---------- ------ ----------
a10sr_gpio GPIO Controller a10sr_gpio GPIO Controller
a10sr_rst Reset Controller
Arria10 GPIO Arria10 GPIO
Required Properties: Required Properties:
...@@ -27,6 +28,11 @@ Required Properties: ...@@ -27,6 +28,11 @@ Required Properties:
the second cell is used to specify flags. the second cell is used to specify flags.
See ../gpio/gpio.txt for more information. See ../gpio/gpio.txt for more information.
Arria10 Peripheral PHY Reset
Required Properties:
- compatible : Should be "altr,a10sr-reset"
- #reset-cells : Should be one.
Example: Example:
resource-manager@0 { resource-manager@0 {
...@@ -43,4 +49,9 @@ Example: ...@@ -43,4 +49,9 @@ Example:
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
}; };
a10sr_rst: reset-controller {
compatible = "altr,a10sr-reset";
#reset-cells = <1>;
};
}; };
...@@ -6,12 +6,19 @@ axp202 (X-Powers) ...@@ -6,12 +6,19 @@ axp202 (X-Powers)
axp209 (X-Powers) axp209 (X-Powers)
axp221 (X-Powers) axp221 (X-Powers)
axp223 (X-Powers) axp223 (X-Powers)
axp803 (X-Powers)
axp809 (X-Powers) axp809 (X-Powers)
Required properties: Required properties:
- compatible: "x-powers,axp152", "x-powers,axp202", "x-powers,axp209", - compatible: should be one of:
"x-powers,axp221", "x-powers,axp223", "x-powers,axp806", * "x-powers,axp152"
"x-powers,axp809" * "x-powers,axp202"
* "x-powers,axp209"
* "x-powers,axp221"
* "x-powers,axp223"
* "x-powers,axp803"
* "x-powers,axp806"
* "x-powers,axp809"
- reg: The I2C slave address or RSB hardware address for the AXP chip - reg: The I2C slave address or RSB hardware address for the AXP chip
- interrupt-parent: The parent interrupt controller - interrupt-parent: The parent interrupt controller
- interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
...@@ -28,6 +35,9 @@ Optional properties: ...@@ -28,6 +35,9 @@ Optional properties:
regulator to drive the OTG VBus, rather then as an input pin regulator to drive the OTG VBus, rather then as an input pin
which signals whether the board is driving OTG VBus or not. which signals whether the board is driving OTG VBus or not.
- x-powers,master-mode: Boolean (axp806 only). Set this when the PMIC is
wired for master mode. The default is slave mode.
- <input>-supply: a phandle to the regulator supply node. May be omitted if - <input>-supply: a phandle to the regulator supply node. May be omitted if
inputs are unregulated, such as using the IPSOUT output inputs are unregulated, such as using the IPSOUT output
from the PMIC. from the PMIC.
...@@ -86,6 +96,33 @@ LDO_IO1 : LDO : ips-supply : GPIO 1 ...@@ -86,6 +96,33 @@ LDO_IO1 : LDO : ips-supply : GPIO 1
RTC_LDO : LDO : ips-supply : always on RTC_LDO : LDO : ips-supply : always on
DRIVEVBUS : Enable output : drivevbus-supply : external regulator DRIVEVBUS : Enable output : drivevbus-supply : external regulator
AXP803 regulators, type, and corresponding input supply names:
Regulator Type Supply Name Notes
--------- ---- ----------- -----
DCDC1 : DC-DC buck : vin1-supply
DCDC2 : DC-DC buck : vin2-supply : poly-phase capable
DCDC3 : DC-DC buck : vin3-supply : poly-phase capable
DCDC4 : DC-DC buck : vin4-supply
DCDC5 : DC-DC buck : vin5-supply : poly-phase capable
DCDC6 : DC-DC buck : vin6-supply : poly-phase capable
DC1SW : On/Off Switch : : DCDC1 secondary output
ALDO1 : LDO : aldoin-supply : shared supply
ALDO2 : LDO : aldoin-supply : shared supply
ALDO3 : LDO : aldoin-supply : shared supply
DLDO1 : LDO : dldoin-supply : shared supply
DLDO2 : LDO : dldoin-supply : shared supply
DLDO3 : LDO : dldoin-supply : shared supply
DLDO4 : LDO : dldoin-supply : shared supply
ELDO1 : LDO : eldoin-supply : shared supply
ELDO2 : LDO : eldoin-supply : shared supply
ELDO3 : LDO : eldoin-supply : shared supply
FLDO1 : LDO : fldoin-supply : shared supply
FLDO2 : LDO : fldoin-supply : shared supply
LDO_IO0 : LDO : ips-supply : GPIO 0
LDO_IO1 : LDO : ips-supply : GPIO 1
RTC_LDO : LDO : ips-supply : always on
AXP806 regulators, type, and corresponding input supply names: AXP806 regulators, type, and corresponding input supply names:
Regulator Type Supply Name Notes Regulator Type Supply Name Notes
......
* Dialog DA9062 Power Management Integrated Circuit (PMIC) * Dialog DA9062 Power Management Integrated Circuit (PMIC)
DA9062 consists of a large and varied group of sub-devices: Product information for the DA9062 and DA9061 devices can be found here:
- http://www.dialog-semiconductor.com/products/da9062
- http://www.dialog-semiconductor.com/products/da9061
The DA9062 PMIC consists of:
Device Supply Names Description Device Supply Names Description
------ ------------ ----------- ------ ------------ -----------
da9062-regulator : : LDOs & BUCKs da9062-regulator : : LDOs & BUCKs
da9062-rtc : : Real-Time Clock da9062-rtc : : Real-Time Clock
da9062-onkey : : On Key
da9062-watchdog : : Watchdog Timer
da9062-thermal : : Thermal
The DA9061 PMIC consists of:
Device Supply Names Description
------ ------------ -----------
da9062-regulator : : LDOs & BUCKs
da9062-onkey : : On Key
da9062-watchdog : : Watchdog Timer da9062-watchdog : : Watchdog Timer
da9062-thermal : : Thermal
====== ======
Required properties: Required properties:
- compatible : Should be "dlg,da9062". - compatible : Should be
"dlg,da9062" for DA9062
"dlg,da9061" for DA9061
- reg : Specifies the I2C slave address (this defaults to 0x58 but it can be - reg : Specifies the I2C slave address (this defaults to 0x58 but it can be
modified to match the chip's OTP settings). modified to match the chip's OTP settings).
- interrupt-parent : Specifies the reference to the interrupt controller for - interrupt-parent : Specifies the reference to the interrupt controller for
the DA9062. the DA9062 or DA9061.
- interrupts : IRQ line information. - interrupts : IRQ line information.
- interrupt-controller - interrupt-controller
...@@ -25,8 +42,8 @@ further information on IRQ bindings. ...@@ -25,8 +42,8 @@ further information on IRQ bindings.
Sub-nodes: Sub-nodes:
- regulators : This node defines the settings for the LDOs and BUCKs. The - regulators : This node defines the settings for the LDOs and BUCKs.
DA9062 regulators are bound using their names listed below: The DA9062 regulators are bound using their names listed below:
buck1 : BUCK_1 buck1 : BUCK_1
buck2 : BUCK_2 buck2 : BUCK_2
...@@ -37,19 +54,29 @@ Sub-nodes: ...@@ -37,19 +54,29 @@ Sub-nodes:
ldo3 : LDO_3 ldo3 : LDO_3
ldo4 : LDO_4 ldo4 : LDO_4
The DA9061 regulators are bound using their names listed below:
buck1 : BUCK_1
buck2 : BUCK_2
buck3 : BUCK_3
ldo1 : LDO_1
ldo2 : LDO_2
ldo3 : LDO_3
ldo4 : LDO_4
The component follows the standard regulator framework and the bindings The component follows the standard regulator framework and the bindings
details of individual regulator device can be found in: details of individual regulator device can be found in:
Documentation/devicetree/bindings/regulator/regulator.txt Documentation/devicetree/bindings/regulator/regulator.txt
- rtc : This node defines settings required for the Real-Time Clock associated - rtc : This node defines settings required for the Real-Time Clock associated
with the DA9062. There are currently no entries in this binding, however with the DA9062. There are currently no entries in this binding, however
compatible = "dlg,da9062-rtc" should be added if a node is created. compatible = "dlg,da9062-rtc" should be added if a node is created.
- watchdog: This node defines the settings for the watchdog driver associated - onkey : See ../input/da9062-onkey.txt
with the DA9062 PMIC. The compatible = "dlg,da9062-watchdog" should be added
if a node is created. - watchdog: See ../watchdog/da9062-watchdog.txt
- thermal : See ../thermal/da9062-thermal.txt
Example: Example:
...@@ -64,10 +91,6 @@ Example: ...@@ -64,10 +91,6 @@ Example:
compatible = "dlg,da9062-rtc"; compatible = "dlg,da9062-rtc";
}; };
watchdog {
compatible = "dlg,da9062-watchdog";
};
regulators { regulators {
DA9062_BUCK1: buck1 { DA9062_BUCK1: buck1 {
regulator-name = "BUCK1"; regulator-name = "BUCK1";
......
...@@ -6,6 +6,7 @@ MT6397/MT6323 is a multifunction device with the following sub modules: ...@@ -6,6 +6,7 @@ MT6397/MT6323 is a multifunction device with the following sub modules:
- Audio codec - Audio codec
- GPIO - GPIO
- Clock - Clock
- LED
It is interfaced to host controller using SPI interface by a proprietary hardware It is interfaced to host controller using SPI interface by a proprietary hardware
called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap. called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap.
......
...@@ -5,7 +5,10 @@ Required properties: ...@@ -5,7 +5,10 @@ Required properties:
- compatible : "samsung,exynos5433-lpass" - compatible : "samsung,exynos5433-lpass"
- reg : should contain the LPASS top SFR region location - reg : should contain the LPASS top SFR region location
and size and size
- samsung,pmu-syscon : the phandle to the Power Management Unit node - clock-names : should contain following required clocks: "sfr0_ctrl"
- clocks : should contain clock specifiers of all clocks, which
input names have been specified in clock-names
property, in same order.
- #address-cells : should be 1 - #address-cells : should be 1
- #size-cells : should be 1 - #size-cells : should be 1
- ranges : must be present - ranges : must be present
...@@ -25,7 +28,8 @@ Example: ...@@ -25,7 +28,8 @@ Example:
audio-subsystem { audio-subsystem {
compatible = "samsung,exynos5433-lpass"; compatible = "samsung,exynos5433-lpass";
reg = <0x11400000 0x100>, <0x11500000 0x08>; reg = <0x11400000 0x100>, <0x11500000 0x08>;
samsung,pmu-syscon = <&pmu_system_controller>; clocks = <&cmu_aud CLK_PCLK_SFR0_CTRL>;
clock-names = "sfr0_ctrl";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
ranges; ranges;
......
Allwinner SoCs' GPADC Device Tree bindings
------------------------------------------
The Allwinner SoCs all have an ADC that can also act as a thermal sensor
and sometimes as a touchscreen controller.
Required properties:
- compatible: "allwinner,sun8i-a33-ths",
- reg: mmio address range of the chip,
- #thermal-sensor-cells: shall be 0,
- #io-channel-cells: shall be 0,
Example:
ths: ths@01c25000 {
compatible = "allwinner,sun8i-a33-ths";
reg = <0x01c25000 0x100>;
#thermal-sensor-cells = <0>;
#io-channel-cells = <0>;
};
sun4i, sun5i and sun6i SoCs are also supported via the older binding:
sun4i resistive touchscreen controller sun4i resistive touchscreen controller
-------------------------------------- --------------------------------------
......
TI LMU (Lighting Management Unit) device tree bindings
TI LMU driver supports lighting devices below.
Name Child nodes
------ ---------------------------------
LM3532 Backlight
LM3631 Backlight and regulator
LM3632 Backlight and regulator
LM3633 Backlight, LED and fault monitor
LM3695 Backlight
LM3697 Backlight and fault monitor
Required properties:
- compatible: Should be one of:
"ti,lm3532"
"ti,lm3631"
"ti,lm3632"
"ti,lm3633"
"ti,lm3695"
"ti,lm3697"
- reg: I2C slave address.
0x11 for LM3632
0x29 for LM3631
0x36 for LM3633, LM3697
0x38 for LM3532
0x63 for LM3695
Optional property:
- enable-gpios: A GPIO specifier for hardware enable pin.
Required node:
- backlight: All LMU devices have backlight child nodes.
For the properties, please refer to [1].
Optional nodes:
- fault-monitor: Hardware fault monitoring driver for LM3633 and LM3697.
Required properties:
- compatible: Should be one of:
"ti,lm3633-fault-monitor"
"ti,lm3697-fault-monitor"
- leds: LED properties for LM3633. Please refer to [2].
- regulators: Regulator properties for LM3631 and LM3632.
Please refer to [3].
[1] ../leds/backlight/ti-lmu-backlight.txt
[2] ../leds/leds-lm3633.txt
[3] ../regulator/lm363x-regulator.txt
lm3532@38 {
compatible = "ti,lm3532";
reg = <0x38>;
enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>;
backlight {
compatible = "ti,lm3532-backlight";
lcd {
led-sources = <0 1 2>;
ramp-up-msec = <30>;
ramp-down-msec = <0>;
};
};
};
lm3631@29 {
compatible = "ti,lm3631";
reg = <0x29>;
regulators {
compatible = "ti,lm363x-regulator";
vboost {
regulator-name = "lcd_boost";
regulator-min-microvolt = <4500000>;
regulator-max-microvolt = <6350000>;
regulator-always-on;
};
vcont {
regulator-name = "lcd_vcont";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
};
voref {
regulator-name = "lcd_voref";
regulator-min-microvolt = <4000000>;
regulator-max-microvolt = <6000000>;
};
vpos {
regulator-name = "lcd_vpos";
regulator-min-microvolt = <4000000>;
regulator-max-microvolt = <6000000>;
regulator-boot-on;
};
vneg {
regulator-name = "lcd_vneg";
regulator-min-microvolt = <4000000>;
regulator-max-microvolt = <6000000>;
regulator-boot-on;
};
};
backlight {
compatible = "ti,lm3631-backlight";
lcd_bl {
led-sources = <0 1>;
ramp-up-msec = <300>;
};
};
};
lm3632@11 {
compatible = "ti,lm3632";
reg = <0x11>;
enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>; /* PC2 */
regulators {
compatible = "ti,lm363x-regulator";
ti,lcm-en1-gpio = <&pioC 0 GPIO_ACTIVE_HIGH>; /* PC0 */
ti,lcm-en2-gpio = <&pioC 1 GPIO_ACTIVE_HIGH>; /* PC1 */
vboost {
regulator-name = "lcd_boost";
regulator-min-microvolt = <4500000>;
regulator-max-microvolt = <6400000>;
regulator-always-on;
};
vpos {
regulator-name = "lcd_vpos";
regulator-min-microvolt = <4000000>;
regulator-max-microvolt = <6000000>;
};
vneg {
regulator-name = "lcd_vneg";
regulator-min-microvolt = <4000000>;
regulator-max-microvolt = <6000000>;
};
};
backlight {
compatible = "ti,lm3632-backlight";
pwms = <&pwm0 0 10000 0>; /* pwm number, period, polarity */
pwm-names = "lmu-backlight";
lcd {
led-sources = <0 1>;
pwm-period = <10000>;
};
};
};
lm3633@36 {
compatible = "ti,lm3633";
reg = <0x36>;
enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>;
backlight {
compatible = "ti,lm3633-backlight";
main {
label = "main_lcd";
led-sources = <1 2>;
ramp-up-msec = <500>;
ramp-down-msec = <500>;
};
front {
label = "front_lcd";
led-sources = <0>;
ramp-up-msec = <1000>;
ramp-down-msec = <0>;
};
};
leds {
compatible = "ti,lm3633-leds";
chan1 {
label = "status";
led-sources = <1>;
led-max-microamp = <6000>;
};
chan345 {
label = "rgb";
led-sources = <3 4 5>;
led-max-microamp = <10000>;
};
};
fault-monitor {
compatible = "ti,lm3633-fault-monitor";
};
};
lm3695@63 {
compatible = "ti,lm3695";
reg = <0x63>;
enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>;
backlight {
compatible = "ti,lm3695-backlight";
lcd {
label = "bl";
led-sources = <0 1>;
};
};
};
lm3697@36 {
compatible = "ti,lm3697";
reg = <0x36>;
enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>;
backlight {
compatible = "ti,lm3697-backlight";
lcd {
led-sources = <0 1 2>;
ramp-up-msec = <200>;
ramp-down-msec = <200>;
};
};
fault-monitor {
compatible = "ti,lm3697-fault-monitor";
};
};
Cirrus Logic/Wolfson Microelectronics wm831x PMICs
System PMICs with a wide range of additional features.
Required properties:
- compatible : One of the following chip-specific strings:
"wlf,wm8310"
"wlf,wm8311"
"wlf,wm8312"
"wlf,wm8320"
"wlf,wm8321"
"wlf,wm8325"
"wlf,wm8326"
- reg : I2C slave address when connected using I2C, chip select number
when using SPI.
- gpio-controller : Indicates this device is a GPIO controller.
- #gpio-cells : Must be 2. The first cell is the pin number and the
second cell is used to specify optional parameters (currently unused).
- interrupts : The interrupt line the IRQ signal for the device is
connected to.
- interrupt-parent : The parent interrupt controller.
- interrupt-controller : wm831x devices contain interrupt controllers and
may provide interrupt services to other devices.
- #interrupt-cells: Must be 2. The first cell is the IRQ number, and the
second cell is the flags, encoded as the trigger masks from
../interrupt-controller/interrupts.txt
Optional sub-nodes:
- regulators : Contains sub-nodes for each of the regulators supplied by
the device. The regulators are bound using their names listed below:
dcdc1 : DCDC1
dcdc2 : DCDC2
dcdc3 : DCDC3
dcdc4 : DCDC3
isink1 : ISINK1
isink2 : ISINK2
ldo1 : LDO1
ldo2 : LDO2
ldo3 : LDO3
ldo4 : LDO4
ldo5 : LDO5
ldo7 : LDO7
ldo11 : LDO11
The bindings details of each regulator can be found in:
../regulator/regulator.txt
Example:
wm8310: pmic@36 {
compatible = "wlf,wm8310";
reg = <0x36>;
gpio-controller;
#gpio-cells = <2>;
interrupts = <347>;
interrupt-parent = <&gic>;
interrupt-controller;
#interrupt-cells = <2>;
regulators {
dcdc1: dcdc1 {
regulator-name = "DCDC1";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <600000>;
};
ldo1: ldo1 {
regulator-name = "LDO1";
regulator-min-microvolt = <1700000>;
regulator-max-microvolt = <1700000>;
};
};
};
...@@ -13731,6 +13731,7 @@ F: Documentation/hwmon/wm83?? ...@@ -13731,6 +13731,7 @@ F: Documentation/hwmon/wm83??
F: Documentation/devicetree/bindings/extcon/extcon-arizona.txt F: Documentation/devicetree/bindings/extcon/extcon-arizona.txt
F: Documentation/devicetree/bindings/regulator/arizona-regulator.txt F: Documentation/devicetree/bindings/regulator/arizona-regulator.txt
F: Documentation/devicetree/bindings/mfd/arizona.txt F: Documentation/devicetree/bindings/mfd/arizona.txt
F: Documentation/devicetree/bindings/mfd/wm831x.txt
F: arch/arm/mach-s3c64xx/mach-crag6410* F: arch/arm/mach-s3c64xx/mach-crag6410*
F: drivers/clk/clk-wm83*.c F: drivers/clk/clk-wm83*.c
F: drivers/extcon/extcon-arizona.c F: drivers/extcon/extcon-arizona.c
......
...@@ -511,7 +511,7 @@ config XPOWER_PMIC_OPREGION ...@@ -511,7 +511,7 @@ config XPOWER_PMIC_OPREGION
config BXT_WC_PMIC_OPREGION config BXT_WC_PMIC_OPREGION
bool "ACPI operation region support for BXT WhiskeyCove PMIC" bool "ACPI operation region support for BXT WhiskeyCove PMIC"
depends on INTEL_SOC_PMIC depends on INTEL_SOC_PMIC_BXTWC
help help
This config adds ACPI operation region support for BXT WhiskeyCove PMIC. This config adds ACPI operation region support for BXT WhiskeyCove PMIC.
......
...@@ -1054,7 +1054,7 @@ config GPIO_UCB1400 ...@@ -1054,7 +1054,7 @@ config GPIO_UCB1400
config GPIO_WHISKEY_COVE config GPIO_WHISKEY_COVE
tristate "GPIO support for Whiskey Cove PMIC" tristate "GPIO support for Whiskey Cove PMIC"
depends on (X86 || COMPILE_TEST) && INTEL_SOC_PMIC depends on (X86 || COMPILE_TEST) && INTEL_SOC_PMIC_BXTWC
select GPIOLIB_IRQCHIP select GPIOLIB_IRQCHIP
help help
Support for GPIO pins on Whiskey Cove PMIC. Support for GPIO pins on Whiskey Cove PMIC.
......
...@@ -263,7 +263,7 @@ static const struct gpio_chip template_chip = { ...@@ -263,7 +263,7 @@ static const struct gpio_chip template_chip = {
static int wm831x_gpio_probe(struct platform_device *pdev) static int wm831x_gpio_probe(struct platform_device *pdev)
{ {
struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); struct wm831x_pdata *pdata = &wm831x->pdata;
struct wm831x_gpio *wm831x_gpio; struct wm831x_gpio *wm831x_gpio;
int ret; int ret;
...@@ -280,6 +280,9 @@ static int wm831x_gpio_probe(struct platform_device *pdev) ...@@ -280,6 +280,9 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
wm831x_gpio->gpio_chip.base = pdata->gpio_base; wm831x_gpio->gpio_chip.base = pdata->gpio_base;
else else
wm831x_gpio->gpio_chip.base = -1; wm831x_gpio->gpio_chip.base = -1;
#ifdef CONFIG_OF_GPIO
wm831x_gpio->gpio_chip.of_node = wm831x->dev->of_node;
#endif
ret = devm_gpiochip_add_data(&pdev->dev, &wm831x_gpio->gpio_chip, ret = devm_gpiochip_add_data(&pdev->dev, &wm831x_gpio->gpio_chip,
wm831x_gpio); wm831x_gpio);
......
...@@ -154,6 +154,16 @@ config AT91_SAMA5D2_ADC ...@@ -154,6 +154,16 @@ config AT91_SAMA5D2_ADC
To compile this driver as a module, choose M here: the module will be To compile this driver as a module, choose M here: the module will be
called at91-sama5d2_adc. called at91-sama5d2_adc.
config AXP20X_ADC
tristate "X-Powers AXP20X and AXP22X ADC driver"
depends on MFD_AXP20X
help
Say yes here to have support for X-Powers power management IC (PMIC)
AXP20X and AXP22X ADC devices.
To compile this driver as a module, choose M here: the module will be
called axp20x_adc.
config AXP288_ADC config AXP288_ADC
tristate "X-Powers AXP288 ADC driver" tristate "X-Powers AXP288 ADC driver"
depends on MFD_AXP20X depends on MFD_AXP20X
...@@ -229,6 +239,19 @@ config EXYNOS_ADC ...@@ -229,6 +239,19 @@ config EXYNOS_ADC
To compile this driver as a module, choose M here: the module will be To compile this driver as a module, choose M here: the module will be
called exynos_adc. called exynos_adc.
config MXS_LRADC_ADC
tristate "Freescale i.MX23/i.MX28 LRADC ADC"
depends on MFD_MXS_LRADC
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for the ADC functions of the
i.MX23/i.MX28 LRADC. This includes general-purpose ADC readings,
battery voltage measurement, and die temperature measurement.
This driver can also be built as a module. If so, the module will be
called mxs-lradc-adc.
config FSL_MX25_ADC config FSL_MX25_ADC
tristate "Freescale MX25 ADC driver" tristate "Freescale MX25 ADC driver"
depends on MFD_MX25_TSADC depends on MFD_MX25_TSADC
...@@ -411,20 +434,6 @@ config MESON_SARADC ...@@ -411,20 +434,6 @@ config MESON_SARADC
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called meson_saradc. module will be called meson_saradc.
config MXS_LRADC
tristate "Freescale i.MX23/i.MX28 LRADC"
depends on (ARCH_MXS || COMPILE_TEST) && HAS_IOMEM
depends on INPUT
select STMP_DEVICE
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for i.MX23/i.MX28 LRADC convertor
built into these chips.
To compile this driver as a module, choose M here: the
module will be called mxs-lradc.
config NAU7802 config NAU7802
tristate "Nuvoton NAU7802 ADC driver" tristate "Nuvoton NAU7802 ADC driver"
depends on I2C depends on I2C
......
...@@ -16,6 +16,7 @@ obj-$(CONFIG_AD7887) += ad7887.o ...@@ -16,6 +16,7 @@ obj-$(CONFIG_AD7887) += ad7887.o
obj-$(CONFIG_AD799X) += ad799x.o obj-$(CONFIG_AD799X) += ad799x.o
obj-$(CONFIG_AT91_ADC) += at91_adc.o obj-$(CONFIG_AT91_ADC) += at91_adc.o
obj-$(CONFIG_AT91_SAMA5D2_ADC) += at91-sama5d2_adc.o obj-$(CONFIG_AT91_SAMA5D2_ADC) += at91-sama5d2_adc.o
obj-$(CONFIG_AXP20X_ADC) += axp20x_adc.o
obj-$(CONFIG_AXP288_ADC) += axp288_adc.o obj-$(CONFIG_AXP288_ADC) += axp288_adc.o
obj-$(CONFIG_BCM_IPROC_ADC) += bcm_iproc_adc.o obj-$(CONFIG_BCM_IPROC_ADC) += bcm_iproc_adc.o
obj-$(CONFIG_BERLIN2_ADC) += berlin2-adc.o obj-$(CONFIG_BERLIN2_ADC) += berlin2-adc.o
...@@ -39,7 +40,7 @@ obj-$(CONFIG_MCP3422) += mcp3422.o ...@@ -39,7 +40,7 @@ obj-$(CONFIG_MCP3422) += mcp3422.o
obj-$(CONFIG_MEDIATEK_MT6577_AUXADC) += mt6577_auxadc.o obj-$(CONFIG_MEDIATEK_MT6577_AUXADC) += mt6577_auxadc.o
obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o
obj-$(CONFIG_MESON_SARADC) += meson_saradc.o obj-$(CONFIG_MESON_SARADC) += meson_saradc.o
obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o obj-$(CONFIG_MXS_LRADC_ADC) += mxs-lradc-adc.o
obj-$(CONFIG_NAU7802) += nau7802.o obj-$(CONFIG_NAU7802) += nau7802.o
obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o
obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o
......
/* ADC driver for AXP20X and AXP22X PMICs
*
* Copyright (c) 2016 Free Electrons NextThing Co.
* Quentin Schulz <quentin.schulz@free-electrons.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/thermal.h>
#include <linux/iio/iio.h>
#include <linux/iio/driver.h>
#include <linux/iio/machine.h>
#include <linux/mfd/axp20x.h>
#define AXP20X_ADC_EN1_MASK GENMASK(7, 0)
#define AXP20X_ADC_EN2_MASK (GENMASK(3, 2) | BIT(7))
#define AXP22X_ADC_EN1_MASK (GENMASK(7, 5) | BIT(0))
#define AXP20X_GPIO10_IN_RANGE_GPIO0 BIT(0)
#define AXP20X_GPIO10_IN_RANGE_GPIO1 BIT(1)
#define AXP20X_GPIO10_IN_RANGE_GPIO0_VAL(x) ((x) & BIT(0))
#define AXP20X_GPIO10_IN_RANGE_GPIO1_VAL(x) (((x) & BIT(0)) << 1)
#define AXP20X_ADC_RATE_MASK GENMASK(7, 6)
#define AXP20X_ADC_RATE_HZ(x) ((ilog2((x) / 25) << 6) & AXP20X_ADC_RATE_MASK)
#define AXP22X_ADC_RATE_HZ(x) ((ilog2((x) / 100) << 6) & AXP20X_ADC_RATE_MASK)
#define AXP20X_ADC_CHANNEL(_channel, _name, _type, _reg) \
{ \
.type = _type, \
.indexed = 1, \
.channel = _channel, \
.address = _reg, \
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
BIT(IIO_CHAN_INFO_SCALE), \
.datasheet_name = _name, \
}
#define AXP20X_ADC_CHANNEL_OFFSET(_channel, _name, _type, _reg) \
{ \
.type = _type, \
.indexed = 1, \
.channel = _channel, \
.address = _reg, \
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
BIT(IIO_CHAN_INFO_SCALE) |\
BIT(IIO_CHAN_INFO_OFFSET),\
.datasheet_name = _name, \
}
struct axp_data;
struct axp20x_adc_iio {
struct regmap *regmap;
struct axp_data *data;
};
enum axp20x_adc_channel_v {
AXP20X_ACIN_V = 0,
AXP20X_VBUS_V,
AXP20X_TS_IN,
AXP20X_GPIO0_V,
AXP20X_GPIO1_V,
AXP20X_IPSOUT_V,
AXP20X_BATT_V,
};
enum axp20x_adc_channel_i {
AXP20X_ACIN_I = 0,
AXP20X_VBUS_I,
AXP20X_BATT_CHRG_I,
AXP20X_BATT_DISCHRG_I,
};
enum axp22x_adc_channel_v {
AXP22X_TS_IN = 0,
AXP22X_BATT_V,
};
enum axp22x_adc_channel_i {
AXP22X_BATT_CHRG_I = 1,
AXP22X_BATT_DISCHRG_I,
};
static struct iio_map axp20x_maps[] = {
{
.consumer_dev_name = "axp20x-usb-power-supply",
.consumer_channel = "vbus_v",
.adc_channel_label = "vbus_v",
}, {
.consumer_dev_name = "axp20x-usb-power-supply",
.consumer_channel = "vbus_i",
.adc_channel_label = "vbus_i",
}, {
.consumer_dev_name = "axp20x-ac-power-supply",
.consumer_channel = "acin_v",
.adc_channel_label = "acin_v",
}, {
.consumer_dev_name = "axp20x-ac-power-supply",
.consumer_channel = "acin_i",
.adc_channel_label = "acin_i",
}, {
.consumer_dev_name = "axp20x-battery-power-supply",
.consumer_channel = "batt_v",
.adc_channel_label = "batt_v",
}, {
.consumer_dev_name = "axp20x-battery-power-supply",
.consumer_channel = "batt_chrg_i",
.adc_channel_label = "batt_chrg_i",
}, {
.consumer_dev_name = "axp20x-battery-power-supply",
.consumer_channel = "batt_dischrg_i",
.adc_channel_label = "batt_dischrg_i",
}, { /* sentinel */ }
};
static struct iio_map axp22x_maps[] = {
{
.consumer_dev_name = "axp20x-battery-power-supply",
.consumer_channel = "batt_v",
.adc_channel_label = "batt_v",
}, {
.consumer_dev_name = "axp20x-battery-power-supply",
.consumer_channel = "batt_chrg_i",
.adc_channel_label = "batt_chrg_i",
}, {
.consumer_dev_name = "axp20x-battery-power-supply",
.consumer_channel = "batt_dischrg_i",
.adc_channel_label = "batt_dischrg_i",
}, { /* sentinel */ }
};
/*
* Channels are mapped by physical system. Their channels share the same index.
* i.e. acin_i is in_current0_raw and acin_v is in_voltage0_raw.
* The only exception is for the battery. batt_v will be in_voltage6_raw and
* charge current in_current6_raw and discharge current will be in_current7_raw.
*/
static const struct iio_chan_spec axp20x_adc_channels[] = {
AXP20X_ADC_CHANNEL(AXP20X_ACIN_V, "acin_v", IIO_VOLTAGE,
AXP20X_ACIN_V_ADC_H),
AXP20X_ADC_CHANNEL(AXP20X_ACIN_I, "acin_i", IIO_CURRENT,
AXP20X_ACIN_I_ADC_H),
AXP20X_ADC_CHANNEL(AXP20X_VBUS_V, "vbus_v", IIO_VOLTAGE,
AXP20X_VBUS_V_ADC_H),
AXP20X_ADC_CHANNEL(AXP20X_VBUS_I, "vbus_i", IIO_CURRENT,
AXP20X_VBUS_I_ADC_H),
{
.type = IIO_TEMP,
.address = AXP20X_TEMP_ADC_H,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
BIT(IIO_CHAN_INFO_SCALE) |
BIT(IIO_CHAN_INFO_OFFSET),
.datasheet_name = "pmic_temp",
},
AXP20X_ADC_CHANNEL_OFFSET(AXP20X_GPIO0_V, "gpio0_v", IIO_VOLTAGE,
AXP20X_GPIO0_V_ADC_H),
AXP20X_ADC_CHANNEL_OFFSET(AXP20X_GPIO1_V, "gpio1_v", IIO_VOLTAGE,
AXP20X_GPIO1_V_ADC_H),
AXP20X_ADC_CHANNEL(AXP20X_IPSOUT_V, "ipsout_v", IIO_VOLTAGE,
AXP20X_IPSOUT_V_HIGH_H),
AXP20X_ADC_CHANNEL(AXP20X_BATT_V, "batt_v", IIO_VOLTAGE,
AXP20X_BATT_V_H),
AXP20X_ADC_CHANNEL(AXP20X_BATT_CHRG_I, "batt_chrg_i", IIO_CURRENT,
AXP20X_BATT_CHRG_I_H),
AXP20X_ADC_CHANNEL(AXP20X_BATT_DISCHRG_I, "batt_dischrg_i", IIO_CURRENT,
AXP20X_BATT_DISCHRG_I_H),
};
static const struct iio_chan_spec axp22x_adc_channels[] = {
{
.type = IIO_TEMP,
.address = AXP22X_PMIC_TEMP_H,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
BIT(IIO_CHAN_INFO_SCALE) |
BIT(IIO_CHAN_INFO_OFFSET),
.datasheet_name = "pmic_temp",
},
AXP20X_ADC_CHANNEL(AXP22X_BATT_V, "batt_v", IIO_VOLTAGE,
AXP20X_BATT_V_H),
AXP20X_ADC_CHANNEL(AXP22X_BATT_CHRG_I, "batt_chrg_i", IIO_CURRENT,
AXP20X_BATT_CHRG_I_H),
AXP20X_ADC_CHANNEL(AXP22X_BATT_DISCHRG_I, "batt_dischrg_i", IIO_CURRENT,
AXP20X_BATT_DISCHRG_I_H),
};
static int axp20x_adc_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val)
{
struct axp20x_adc_iio *info = iio_priv(indio_dev);
int size = 12;
/*
* N.B.: Unlike the Chinese datasheets tell, the charging current is
* stored on 12 bits, not 13 bits. Only discharging current is on 13
* bits.
*/
if (chan->type == IIO_CURRENT && chan->channel == AXP20X_BATT_DISCHRG_I)
size = 13;
else
size = 12;
*val = axp20x_read_variable_width(info->regmap, chan->address, size);
if (*val < 0)
return *val;
return IIO_VAL_INT;
}
static int axp22x_adc_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val)
{
struct axp20x_adc_iio *info = iio_priv(indio_dev);
int size;
/*
* N.B.: Unlike the Chinese datasheets tell, the charging current is
* stored on 12 bits, not 13 bits. Only discharging current is on 13
* bits.
*/
if (chan->type == IIO_CURRENT && chan->channel == AXP22X_BATT_DISCHRG_I)
size = 13;
else
size = 12;
*val = axp20x_read_variable_width(info->regmap, chan->address, size);
if (*val < 0)
return *val;
return IIO_VAL_INT;
}
static int axp20x_adc_scale_voltage(int channel, int *val, int *val2)
{
switch (channel) {
case AXP20X_ACIN_V:
case AXP20X_VBUS_V:
*val = 1;
*val2 = 700000;
return IIO_VAL_INT_PLUS_MICRO;
case AXP20X_GPIO0_V:
case AXP20X_GPIO1_V:
*val = 0;
*val2 = 500000;
return IIO_VAL_INT_PLUS_MICRO;
case AXP20X_BATT_V:
*val = 1;
*val2 = 100000;
return IIO_VAL_INT_PLUS_MICRO;
case AXP20X_IPSOUT_V:
*val = 1;
*val2 = 400000;
return IIO_VAL_INT_PLUS_MICRO;
default:
return -EINVAL;
}
}
static int axp20x_adc_scale_current(int channel, int *val, int *val2)
{
switch (channel) {
case AXP20X_ACIN_I:
*val = 0;
*val2 = 625000;
return IIO_VAL_INT_PLUS_MICRO;
case AXP20X_VBUS_I:
*val = 0;
*val2 = 375000;
return IIO_VAL_INT_PLUS_MICRO;
case AXP20X_BATT_DISCHRG_I:
case AXP20X_BATT_CHRG_I:
*val = 0;
*val2 = 500000;
return IIO_VAL_INT_PLUS_MICRO;
default:
return -EINVAL;
}
}
static int axp20x_adc_scale(struct iio_chan_spec const *chan, int *val,
int *val2)
{
switch (chan->type) {
case IIO_VOLTAGE:
return axp20x_adc_scale_voltage(chan->channel, val, val2);
case IIO_CURRENT:
return axp20x_adc_scale_current(chan->channel, val, val2);
case IIO_TEMP:
*val = 100;
return IIO_VAL_INT;
default:
return -EINVAL;
}
}
static int axp22x_adc_scale(struct iio_chan_spec const *chan, int *val,
int *val2)
{
switch (chan->type) {
case IIO_VOLTAGE:
if (chan->channel != AXP22X_BATT_V)
return -EINVAL;
*val = 1;
*val2 = 100000;
return IIO_VAL_INT_PLUS_MICRO;
case IIO_CURRENT:
*val = 0;
*val2 = 500000;
return IIO_VAL_INT_PLUS_MICRO;
case IIO_TEMP:
*val = 100;
return IIO_VAL_INT;
default:
return -EINVAL;
}
}
static int axp20x_adc_offset_voltage(struct iio_dev *indio_dev, int channel,
int *val)
{
struct axp20x_adc_iio *info = iio_priv(indio_dev);
int ret;
ret = regmap_read(info->regmap, AXP20X_GPIO10_IN_RANGE, val);
if (ret < 0)
return ret;
switch (channel) {
case AXP20X_GPIO0_V:
*val &= AXP20X_GPIO10_IN_RANGE_GPIO0;
break;
case AXP20X_GPIO1_V:
*val &= AXP20X_GPIO10_IN_RANGE_GPIO1;
break;
default:
return -EINVAL;
}
*val = !!(*val) * 700000;
return IIO_VAL_INT;
}
static int axp20x_adc_offset(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val)
{
switch (chan->type) {
case IIO_VOLTAGE:
return axp20x_adc_offset_voltage(indio_dev, chan->channel, val);
case IIO_TEMP:
*val = -1447;
return IIO_VAL_INT;
default:
return -EINVAL;
}
}
static int axp20x_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val,
int *val2, long mask)
{
switch (mask) {
case IIO_CHAN_INFO_OFFSET:
return axp20x_adc_offset(indio_dev, chan, val);
case IIO_CHAN_INFO_SCALE:
return axp20x_adc_scale(chan, val, val2);
case IIO_CHAN_INFO_RAW:
return axp20x_adc_raw(indio_dev, chan, val);
default:
return -EINVAL;
}
}
static int axp22x_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val,
int *val2, long mask)
{
switch (mask) {
case IIO_CHAN_INFO_OFFSET:
*val = -2677;
return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE:
return axp22x_adc_scale(chan, val, val2);
case IIO_CHAN_INFO_RAW:
return axp22x_adc_raw(indio_dev, chan, val);
default:
return -EINVAL;
}
}
static int axp20x_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int val, int val2,
long mask)
{
struct axp20x_adc_iio *info = iio_priv(indio_dev);
unsigned int reg, regval;
/*
* The AXP20X PMIC allows the user to choose between 0V and 0.7V offsets
* for (independently) GPIO0 and GPIO1 when in ADC mode.
*/
if (mask != IIO_CHAN_INFO_OFFSET)
return -EINVAL;
if (val != 0 && val != 700000)
return -EINVAL;
switch (chan->channel) {
case AXP20X_GPIO0_V:
reg = AXP20X_GPIO10_IN_RANGE_GPIO0;
regval = AXP20X_GPIO10_IN_RANGE_GPIO0_VAL(!!val);
break;
case AXP20X_GPIO1_V:
reg = AXP20X_GPIO10_IN_RANGE_GPIO1;
regval = AXP20X_GPIO10_IN_RANGE_GPIO1_VAL(!!val);
break;
default:
return -EINVAL;
}
return regmap_update_bits(info->regmap, AXP20X_GPIO10_IN_RANGE, reg,
regval);
}
static const struct iio_info axp20x_adc_iio_info = {
.read_raw = axp20x_read_raw,
.write_raw = axp20x_write_raw,
.driver_module = THIS_MODULE,
};
static const struct iio_info axp22x_adc_iio_info = {
.read_raw = axp22x_read_raw,
.driver_module = THIS_MODULE,
};
static int axp20x_adc_rate(int rate)
{
return AXP20X_ADC_RATE_HZ(rate);
}
static int axp22x_adc_rate(int rate)
{
return AXP22X_ADC_RATE_HZ(rate);
}
struct axp_data {
const struct iio_info *iio_info;
int num_channels;
struct iio_chan_spec const *channels;
unsigned long adc_en1_mask;
int (*adc_rate)(int rate);
bool adc_en2;
struct iio_map *maps;
};
static const struct axp_data axp20x_data = {
.iio_info = &axp20x_adc_iio_info,
.num_channels = ARRAY_SIZE(axp20x_adc_channels),
.channels = axp20x_adc_channels,
.adc_en1_mask = AXP20X_ADC_EN1_MASK,
.adc_rate = axp20x_adc_rate,
.adc_en2 = true,
.maps = axp20x_maps,
};
static const struct axp_data axp22x_data = {
.iio_info = &axp22x_adc_iio_info,
.num_channels = ARRAY_SIZE(axp22x_adc_channels),
.channels = axp22x_adc_channels,
.adc_en1_mask = AXP22X_ADC_EN1_MASK,
.adc_rate = axp22x_adc_rate,
.adc_en2 = false,
.maps = axp22x_maps,
};
static const struct platform_device_id axp20x_adc_id_match[] = {
{ .name = "axp20x-adc", .driver_data = (kernel_ulong_t)&axp20x_data, },
{ .name = "axp22x-adc", .driver_data = (kernel_ulong_t)&axp22x_data, },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(platform, axp20x_adc_id_match);
static int axp20x_probe(struct platform_device *pdev)
{
struct axp20x_adc_iio *info;
struct iio_dev *indio_dev;
struct axp20x_dev *axp20x_dev;
int ret;
axp20x_dev = dev_get_drvdata(pdev->dev.parent);
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*info));
if (!indio_dev)
return -ENOMEM;
info = iio_priv(indio_dev);
platform_set_drvdata(pdev, indio_dev);
info->regmap = axp20x_dev->regmap;
indio_dev->dev.parent = &pdev->dev;
indio_dev->dev.of_node = pdev->dev.of_node;
indio_dev->modes = INDIO_DIRECT_MODE;
info->data = (struct axp_data *)platform_get_device_id(pdev)->driver_data;
indio_dev->name = platform_get_device_id(pdev)->name;
indio_dev->info = info->data->iio_info;
indio_dev->num_channels = info->data->num_channels;
indio_dev->channels = info->data->channels;
/* Enable the ADCs on IP */
regmap_write(info->regmap, AXP20X_ADC_EN1, info->data->adc_en1_mask);
if (info->data->adc_en2)
/* Enable GPIO0/1 and internal temperature ADCs */
regmap_update_bits(info->regmap, AXP20X_ADC_EN2,
AXP20X_ADC_EN2_MASK, AXP20X_ADC_EN2_MASK);
/* Configure ADCs rate */
regmap_update_bits(info->regmap, AXP20X_ADC_RATE, AXP20X_ADC_RATE_MASK,
info->data->adc_rate(100));
ret = iio_map_array_register(indio_dev, info->data->maps);
if (ret < 0) {
dev_err(&pdev->dev, "failed to register IIO maps: %d\n", ret);
goto fail_map;
}
ret = iio_device_register(indio_dev);
if (ret < 0) {
dev_err(&pdev->dev, "could not register the device\n");
goto fail_register;
}
return 0;
fail_register:
iio_map_array_unregister(indio_dev);
fail_map:
regmap_write(info->regmap, AXP20X_ADC_EN1, 0);
if (info->data->adc_en2)
regmap_write(info->regmap, AXP20X_ADC_EN2, 0);
return ret;
}
static int axp20x_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct axp20x_adc_iio *info = iio_priv(indio_dev);
iio_device_unregister(indio_dev);
iio_map_array_unregister(indio_dev);
regmap_write(info->regmap, AXP20X_ADC_EN1, 0);
if (info->data->adc_en2)
regmap_write(info->regmap, AXP20X_ADC_EN2, 0);
return 0;
}
static struct platform_driver axp20x_adc_driver = {
.driver = {
.name = "axp20x-adc",
},
.id_table = axp20x_adc_id_match,
.probe = axp20x_probe,
.remove = axp20x_remove,
};
module_platform_driver(axp20x_adc_driver);
MODULE_DESCRIPTION("ADC driver for AXP20X and AXP22X PMICs");
MODULE_AUTHOR("Quentin Schulz <quentin.schulz@free-electrons.com>");
MODULE_LICENSE("GPL");
此差异已折叠。
此差异已折叠。
...@@ -316,6 +316,16 @@ config INPUT_COBALT_BTNS ...@@ -316,6 +316,16 @@ config INPUT_COBALT_BTNS
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called cobalt_btns. module will be called cobalt_btns.
config INPUT_CPCAP_PWRBUTTON
tristate "CPCAP OnKey"
depends on MFD_CPCAP
help
Say Y here if you want to enable power key reporting via the
Motorola CPCAP chip.
To compile this driver as a module, choose M here. The module will
be called cpcap-pwrbutton.
config INPUT_WISTRON_BTNS config INPUT_WISTRON_BTNS
tristate "x86 Wistron laptop button interface" tristate "x86 Wistron laptop button interface"
depends on X86_32 depends on X86_32
......
...@@ -24,6 +24,7 @@ obj-$(CONFIG_INPUT_CM109) += cm109.o ...@@ -24,6 +24,7 @@ obj-$(CONFIG_INPUT_CM109) += cm109.o
obj-$(CONFIG_INPUT_CMA3000) += cma3000_d0x.o obj-$(CONFIG_INPUT_CMA3000) += cma3000_d0x.o
obj-$(CONFIG_INPUT_CMA3000_I2C) += cma3000_d0x_i2c.o obj-$(CONFIG_INPUT_CMA3000_I2C) += cma3000_d0x_i2c.o
obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o
obj-$(CONFIG_INPUT_CPCAP_PWRBUTTON) += cpcap-pwrbutton.o
obj-$(CONFIG_INPUT_DA9052_ONKEY) += da9052_onkey.o obj-$(CONFIG_INPUT_DA9052_ONKEY) += da9052_onkey.o
obj-$(CONFIG_INPUT_DA9055_ONKEY) += da9055_onkey.o obj-$(CONFIG_INPUT_DA9055_ONKEY) += da9055_onkey.o
obj-$(CONFIG_INPUT_DA9063_ONKEY) += da9063_onkey.o obj-$(CONFIG_INPUT_DA9063_ONKEY) += da9063_onkey.o
......
/**
* CPCAP Power Button Input Driver
*
* Copyright (C) 2017 Sebastian Reichel <sre@kernel.org>
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file "COPYING" in the main directory of this
* archive for more details.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/regmap.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/mfd/motorola-cpcap.h>
#define CPCAP_IRQ_ON 23
#define CPCAP_IRQ_ON_BITMASK (1 << (CPCAP_IRQ_ON % 16))
struct cpcap_power_button {
struct regmap *regmap;
struct input_dev *idev;
struct device *dev;
};
static irqreturn_t powerbutton_irq(int irq, void *_button)
{
struct cpcap_power_button *button = _button;
int val;
val = cpcap_sense_virq(button->regmap, irq);
if (val < 0) {
dev_err(button->dev, "irq read failed: %d", val);
return IRQ_HANDLED;
}
pm_wakeup_event(button->dev, 0);
input_report_key(button->idev, KEY_POWER, val);
input_sync(button->idev);
return IRQ_HANDLED;
}
static int cpcap_power_button_probe(struct platform_device *pdev)
{
struct cpcap_power_button *button;
int irq = platform_get_irq(pdev, 0);
int err;
button = devm_kmalloc(&pdev->dev, sizeof(*button), GFP_KERNEL);
if (!button)
return -ENOMEM;
button->idev = devm_input_allocate_device(&pdev->dev);
if (!button->idev)
return -ENOMEM;
button->regmap = dev_get_regmap(pdev->dev.parent, NULL);
if (!button->regmap)
return -ENODEV;
button->dev = &pdev->dev;
button->idev->name = "cpcap-pwrbutton";
button->idev->phys = "cpcap-pwrbutton/input0";
button->idev->dev.parent = button->dev;
input_set_capability(button->idev, EV_KEY, KEY_POWER);
err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
powerbutton_irq, IRQF_ONESHOT, "cpcap_pwrbutton", button);
if (err < 0) {
dev_err(&pdev->dev, "IRQ request failed: %d\n", err);
return err;
}
err = input_register_device(button->idev);
if (err) {
dev_err(&pdev->dev, "Input register failed: %d\n", err);
return err;
}
device_init_wakeup(&pdev->dev, true);
return 0;
}
#ifdef CONFIG_OF
static const struct of_device_id cpcap_pwrbutton_dt_match_table[] = {
{ .compatible = "motorola,cpcap-pwrbutton" },
{},
};
MODULE_DEVICE_TABLE(of, cpcap_pwrbutton_dt_match_table);
#endif
static struct platform_driver cpcap_power_button_driver = {
.probe = cpcap_power_button_probe,
.driver = {
.name = "cpcap-pwrbutton",
.of_match_table = of_match_ptr(cpcap_pwrbutton_dt_match_table),
},
};
module_platform_driver(cpcap_power_button_driver);
MODULE_ALIAS("platform:cpcap-pwrbutton");
MODULE_DESCRIPTION("CPCAP Power Button");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Sebastian Reichel <sre@kernel.org>");
...@@ -829,6 +829,16 @@ config TOUCHSCREEN_USB_COMPOSITE ...@@ -829,6 +829,16 @@ config TOUCHSCREEN_USB_COMPOSITE
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called usbtouchscreen. module will be called usbtouchscreen.
config TOUCHSCREEN_MXS_LRADC
tristate "Freescale i.MX23/i.MX28 LRADC touchscreen"
depends on MFD_MXS_LRADC
help
Say Y here if you have a touchscreen connected to the low-resolution
analog-to-digital converter (LRADC) on an i.MX23 or i.MX28 processor.
To compile this driver as a module, choose M here: the module will be
called mxs-lradc-ts.
config TOUCHSCREEN_MX25 config TOUCHSCREEN_MX25
tristate "Freescale i.MX25 touchscreen input driver" tristate "Freescale i.MX25 touchscreen input driver"
depends on MFD_MX25_TSADC depends on MFD_MX25_TSADC
......
...@@ -45,6 +45,7 @@ obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o ...@@ -45,6 +45,7 @@ obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o
obj-$(CONFIG_TOUCHSCREEN_IPROC) += bcm_iproc_tsc.o obj-$(CONFIG_TOUCHSCREEN_IPROC) += bcm_iproc_tsc.o
obj-$(CONFIG_TOUCHSCREEN_LPC32XX) += lpc32xx_ts.o obj-$(CONFIG_TOUCHSCREEN_LPC32XX) += lpc32xx_ts.o
obj-$(CONFIG_TOUCHSCREEN_MAX11801) += max11801_ts.o obj-$(CONFIG_TOUCHSCREEN_MAX11801) += max11801_ts.o
obj-$(CONFIG_TOUCHSCREEN_MXS_LRADC) += mxs-lradc-ts.o
obj-$(CONFIG_TOUCHSCREEN_MX25) += fsl-imx25-tcq.o obj-$(CONFIG_TOUCHSCREEN_MX25) += fsl-imx25-tcq.o
obj-$(CONFIG_TOUCHSCREEN_MC13783) += mc13783_ts.o obj-$(CONFIG_TOUCHSCREEN_MC13783) += mc13783_ts.o
obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o
......
此差异已折叠。
...@@ -30,6 +30,7 @@ config ATMEL_EBI ...@@ -30,6 +30,7 @@ config ATMEL_EBI
default y default y
depends on ARCH_AT91 && OF depends on ARCH_AT91 && OF
select MFD_SYSCON select MFD_SYSCON
select MFD_ATMEL_SMC
help help
Driver for Atmel EBI controller. Driver for Atmel EBI controller.
Used to configure the EBI (external bus interface) when the device- Used to configure the EBI (external bus interface) when the device-
......
此差异已折叠。
...@@ -121,6 +121,10 @@ config MFD_ATMEL_HLCDC ...@@ -121,6 +121,10 @@ config MFD_ATMEL_HLCDC
additional drivers must be enabled in order to use the additional drivers must be enabled in order to use the
functionality of the device. functionality of the device.
config MFD_ATMEL_SMC
bool
select MFD_SYSCON
config MFD_BCM590XX config MFD_BCM590XX
tristate "Broadcom BCM590xx PMUs" tristate "Broadcom BCM590xx PMUs"
select MFD_CORE select MFD_CORE
...@@ -263,13 +267,14 @@ config MFD_DA9055 ...@@ -263,13 +267,14 @@ config MFD_DA9055
called "da9055" called "da9055"
config MFD_DA9062 config MFD_DA9062
tristate "Dialog Semiconductor DA9062 PMIC Support" tristate "Dialog Semiconductor DA9062/61 PMIC Support"
select MFD_CORE select MFD_CORE
select REGMAP_I2C select REGMAP_I2C
select REGMAP_IRQ select REGMAP_IRQ
depends on I2C depends on I2C
help help
Say yes here for support for the Dialog Semiconductor DA9062 PMIC. Say yes here for support for the Dialog Semiconductor DA9061 and
DA9062 PMICs.
This includes the I2C driver and core APIs. This includes the I2C driver and core APIs.
Additional drivers must be enabled in order to use the functionality Additional drivers must be enabled in order to use the functionality
of the device. of the device.
...@@ -344,6 +349,23 @@ config MFD_MC13XXX_I2C ...@@ -344,6 +349,23 @@ config MFD_MC13XXX_I2C
help help
Select this if your MC13xxx is connected via an I2C bus. Select this if your MC13xxx is connected via an I2C bus.
config MFD_MXS_LRADC
tristate "Freescale i.MX23/i.MX28 LRADC"
depends on ARCH_MXS || COMPILE_TEST
select MFD_CORE
select STMP_DEVICE
help
Say yes here to build support for the Low Resolution
Analog-to-Digital Converter (LRADC) found on the i.MX23 and i.MX28
processors. This driver provides common support for accessing the
device, additional drivers must be enabled in order to use the
functionality of the device:
mxs-lradc-adc for ADC readings
mxs-lradc-ts for touchscreen support
This driver can also be built as a module. If so, the module will be
called mxs-lradc.
config MFD_MX25_TSADC config MFD_MX25_TSADC
tristate "Freescale i.MX25 integrated Touchscreen and ADC unit" tristate "Freescale i.MX25 integrated Touchscreen and ADC unit"
select REGMAP_MMIO select REGMAP_MMIO
...@@ -425,18 +447,29 @@ config LPC_SCH ...@@ -425,18 +447,29 @@ config LPC_SCH
System Management Bus and General Purpose I/O. System Management Bus and General Purpose I/O.
config INTEL_SOC_PMIC config INTEL_SOC_PMIC
bool "Support for Intel Atom SoC PMIC" bool "Support for Crystal Cove PMIC"
depends on GPIOLIB depends on GPIOLIB
depends on I2C=y depends on I2C=y
select MFD_CORE select MFD_CORE
select REGMAP_I2C select REGMAP_I2C
select REGMAP_IRQ select REGMAP_IRQ
help help
Select this option to enable support for the PMIC device Select this option to enable support for Crystal Cove PMIC
on some Intel SoC systems. The PMIC provides ADC, GPIO, on some Intel SoC systems. The PMIC provides ADC, GPIO,
thermal, charger and related power management functions thermal, charger and related power management functions
on these systems. on these systems.
config INTEL_SOC_PMIC_BXTWC
tristate "Support for Intel Broxton Whiskey Cove PMIC"
depends on INTEL_PMC_IPC
select MFD_CORE
select REGMAP_IRQ
help
Select this option to enable support for Whiskey Cove PMIC
on Intel Broxton systems. The PMIC provides ADC, GPIO,
thermal, charger and related power management functions
on these systems.
config MFD_INTEL_LPSS config MFD_INTEL_LPSS
tristate tristate
select COMMON_CLK select COMMON_CLK
...@@ -1164,6 +1197,18 @@ config MFD_LP8788 ...@@ -1164,6 +1197,18 @@ config MFD_LP8788
TI LP8788 PMU supports regulators, battery charger, RTC, TI LP8788 PMU supports regulators, battery charger, RTC,
ADC, backlight driver and current sinks. ADC, backlight driver and current sinks.
config MFD_TI_LMU
tristate "TI Lighting Management Unit driver"
depends on I2C
select MFD_CORE
select REGMAP_I2C
help
Say yes here to enable support for TI LMU chips.
TI LMU MFD supports LM3532, LM3631, LM3632, LM3633, LM3695 and LM3697.
It consists of backlight, LED and regulator driver.
It provides consistent device controls for lighting functions.
config MFD_OMAP_USB_HOST config MFD_OMAP_USB_HOST
bool "TI OMAP USBHS core and TLL driver" bool "TI OMAP USBHS core and TLL driver"
depends on USB_EHCI_HCD_OMAP || USB_OHCI_HCD_OMAP3 depends on USB_EHCI_HCD_OMAP || USB_OHCI_HCD_OMAP3
......
...@@ -10,7 +10,9 @@ obj-$(CONFIG_MFD_ACT8945A) += act8945a.o ...@@ -10,7 +10,9 @@ obj-$(CONFIG_MFD_ACT8945A) += act8945a.o
obj-$(CONFIG_MFD_SM501) += sm501.o obj-$(CONFIG_MFD_SM501) += sm501.o
obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o
obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o
obj-$(CONFIG_MFD_CROS_EC) += cros_ec.o cros_ec_core-objs := cros_ec.o
cros_ec_core-$(CONFIG_ACPI) += cros_ec_acpi_gpe.o
obj-$(CONFIG_MFD_CROS_EC) += cros_ec_core.o
obj-$(CONFIG_MFD_CROS_EC_I2C) += cros_ec_i2c.o obj-$(CONFIG_MFD_CROS_EC_I2C) += cros_ec_i2c.o
obj-$(CONFIG_MFD_CROS_EC_SPI) += cros_ec_spi.o obj-$(CONFIG_MFD_CROS_EC_SPI) += cros_ec_spi.o
obj-$(CONFIG_MFD_EXYNOS_LPASS) += exynos-lpass.o obj-$(CONFIG_MFD_EXYNOS_LPASS) += exynos-lpass.o
...@@ -125,6 +127,8 @@ obj-$(CONFIG_MFD_AXP20X_RSB) += axp20x-rsb.o ...@@ -125,6 +127,8 @@ obj-$(CONFIG_MFD_AXP20X_RSB) += axp20x-rsb.o
obj-$(CONFIG_MFD_LP3943) += lp3943.o obj-$(CONFIG_MFD_LP3943) += lp3943.o
obj-$(CONFIG_MFD_LP8788) += lp8788.o lp8788-irq.o obj-$(CONFIG_MFD_LP8788) += lp8788.o lp8788-irq.o
obj-$(CONFIG_MFD_TI_LMU) += ti-lmu.o
da9055-objs := da9055-core.o da9055-i2c.o da9055-objs := da9055-core.o da9055-i2c.o
obj-$(CONFIG_MFD_DA9055) += da9055.o obj-$(CONFIG_MFD_DA9055) += da9055.o
obj-$(CONFIG_MFD_DA9062) += da9062-core.o obj-$(CONFIG_MFD_DA9062) += da9062-core.o
...@@ -181,6 +185,7 @@ obj-$(CONFIG_MFD_TPS65090) += tps65090.o ...@@ -181,6 +185,7 @@ obj-$(CONFIG_MFD_TPS65090) += tps65090.o
obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o
obj-$(CONFIG_MFD_ATMEL_FLEXCOM) += atmel-flexcom.o obj-$(CONFIG_MFD_ATMEL_FLEXCOM) += atmel-flexcom.o
obj-$(CONFIG_MFD_ATMEL_HLCDC) += atmel-hlcdc.o obj-$(CONFIG_MFD_ATMEL_HLCDC) += atmel-hlcdc.o
obj-$(CONFIG_MFD_ATMEL_SMC) += atmel-smc.o
obj-$(CONFIG_MFD_INTEL_LPSS) += intel-lpss.o obj-$(CONFIG_MFD_INTEL_LPSS) += intel-lpss.o
obj-$(CONFIG_MFD_INTEL_LPSS_PCI) += intel-lpss-pci.o obj-$(CONFIG_MFD_INTEL_LPSS_PCI) += intel-lpss-pci.o
obj-$(CONFIG_MFD_INTEL_LPSS_ACPI) += intel-lpss-acpi.o obj-$(CONFIG_MFD_INTEL_LPSS_ACPI) += intel-lpss-acpi.o
...@@ -207,11 +212,12 @@ obj-$(CONFIG_MFD_RT5033) += rt5033.o ...@@ -207,11 +212,12 @@ obj-$(CONFIG_MFD_RT5033) += rt5033.o
obj-$(CONFIG_MFD_SKY81452) += sky81452.o obj-$(CONFIG_MFD_SKY81452) += sky81452.o
intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o
intel-soc-pmic-$(CONFIG_INTEL_PMC_IPC) += intel_soc_pmic_bxtwc.o
obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o
obj-$(CONFIG_INTEL_SOC_PMIC_BXTWC) += intel_soc_pmic_bxtwc.o
obj-$(CONFIG_MFD_MT6397) += mt6397-core.o obj-$(CONFIG_MFD_MT6397) += mt6397-core.o
obj-$(CONFIG_MFD_ALTERA_A10SR) += altera-a10sr.o obj-$(CONFIG_MFD_ALTERA_A10SR) += altera-a10sr.o
obj-$(CONFIG_MFD_SUN4I_GPADC) += sun4i-gpadc.o obj-$(CONFIG_MFD_SUN4I_GPADC) += sun4i-gpadc.o
obj-$(CONFIG_MFD_STM32_TIMERS) += stm32-timers.o obj-$(CONFIG_MFD_STM32_TIMERS) += stm32-timers.o
obj-$(CONFIG_MFD_MXS_LRADC) += mxs-lradc.o
...@@ -33,6 +33,10 @@ static const struct mfd_cell altr_a10sr_subdev_info[] = { ...@@ -33,6 +33,10 @@ static const struct mfd_cell altr_a10sr_subdev_info[] = {
.name = "altr_a10sr_gpio", .name = "altr_a10sr_gpio",
.of_compatible = "altr,a10sr-gpio", .of_compatible = "altr,a10sr-gpio",
}, },
{
.name = "altr_a10sr_reset",
.of_compatible = "altr,a10sr-reset",
},
}; };
static bool altr_a10sr_reg_readable(struct device *dev, unsigned int reg) static bool altr_a10sr_reg_readable(struct device *dev, unsigned int reg)
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -61,6 +61,7 @@ static int axp20x_rsb_remove(struct sunxi_rsb_device *rdev) ...@@ -61,6 +61,7 @@ static int axp20x_rsb_remove(struct sunxi_rsb_device *rdev)
static const struct of_device_id axp20x_rsb_of_match[] = { static const struct of_device_id axp20x_rsb_of_match[] = {
{ .compatible = "x-powers,axp223", .data = (void *)AXP223_ID }, { .compatible = "x-powers,axp223", .data = (void *)AXP223_ID },
{ .compatible = "x-powers,axp803", .data = (void *)AXP803_ID },
{ .compatible = "x-powers,axp806", .data = (void *)AXP806_ID }, { .compatible = "x-powers,axp806", .data = (void *)AXP806_ID },
{ .compatible = "x-powers,axp809", .data = (void *)AXP809_ID }, { .compatible = "x-powers,axp809", .data = (void *)AXP809_ID },
{ }, { },
......
此差异已折叠。
...@@ -166,6 +166,8 @@ int cros_ec_register(struct cros_ec_device *ec_dev) ...@@ -166,6 +166,8 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
dev_info(dev, "Chrome EC device registered\n"); dev_info(dev, "Chrome EC device registered\n");
cros_ec_acpi_install_gpe_handler(dev);
return 0; return 0;
fail_mfd: fail_mfd:
...@@ -179,6 +181,8 @@ int cros_ec_remove(struct cros_ec_device *ec_dev) ...@@ -179,6 +181,8 @@ int cros_ec_remove(struct cros_ec_device *ec_dev)
{ {
mfd_remove_devices(ec_dev->dev); mfd_remove_devices(ec_dev->dev);
cros_ec_acpi_remove_gpe_handler();
return 0; return 0;
} }
EXPORT_SYMBOL(cros_ec_remove); EXPORT_SYMBOL(cros_ec_remove);
...@@ -190,9 +194,14 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev) ...@@ -190,9 +194,14 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev)
int ret; int ret;
u8 sleep_event; u8 sleep_event;
sleep_event = (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) ? if (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) {
HOST_SLEEP_EVENT_S3_RESUME : sleep_event = HOST_SLEEP_EVENT_S3_SUSPEND;
HOST_SLEEP_EVENT_S0IX_RESUME; } else {
sleep_event = HOST_SLEEP_EVENT_S0IX_SUSPEND;
/* Clearing the GPE status for any pending event */
cros_ec_acpi_clear_gpe();
}
ret = cros_ec_sleep_event(ec_dev, sleep_event); ret = cros_ec_sleep_event(ec_dev, sleep_event);
if (ret < 0) if (ret < 0)
......
此差异已折叠。
...@@ -45,8 +45,11 @@ ...@@ -45,8 +45,11 @@
* on the other end and need to transfer ~256 bytes, then we need: * on the other end and need to transfer ~256 bytes, then we need:
* 10 us/bit * ~10 bits/byte * ~256 bytes = ~25ms * 10 us/bit * ~10 bits/byte * ~256 bytes = ~25ms
* *
* We'll wait 4 times that to handle clock stretching and other * We'll wait 8 times that to handle clock stretching and other
* paranoia. * paranoia. Note that some battery gas gauge ICs claim to have a
* clock stretch of 144ms in rare situations. That's incentive for
* not directly passing i2c through, but it's too late for that for
* existing hardware.
* *
* It's pretty unlikely that we'll really see a 249 byte tunnel in * It's pretty unlikely that we'll really see a 249 byte tunnel in
* anything other than testing. If this was more common we might * anything other than testing. If this was more common we might
...@@ -54,7 +57,7 @@ ...@@ -54,7 +57,7 @@
* wait loop. The 'flash write' command would be another candidate * wait loop. The 'flash write' command would be another candidate
* for this, clocking in at 2-3ms. * for this, clocking in at 2-3ms.
*/ */
#define EC_MSG_DEADLINE_MS 100 #define EC_MSG_DEADLINE_MS 200
/* /*
* Time between raising the SPI chip select (for the end of a * Time between raising the SPI chip select (for the end of a
......
此差异已折叠。
...@@ -2377,7 +2377,7 @@ static void ack_dbb_wakeup(void) ...@@ -2377,7 +2377,7 @@ static void ack_dbb_wakeup(void)
static inline void print_unknown_header_warning(u8 n, u8 header) static inline void print_unknown_header_warning(u8 n, u8 header)
{ {
pr_warning("prcmu: Unknown message header (%d) in mailbox %d.\n", pr_warn("prcmu: Unknown message header (%d) in mailbox %d\n",
header, n); header, n);
} }
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部