提交 8bd8fd0a 编写于 作者: L Linus Torvalds

Merge tag 'mfd-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Device Support:
   - New Clocksource driver from ST
   - New MFD/ACPI/DMA drivers for Intel's Sunrisepoint PCH based platforms
   - Add support for Arizona WM8998 and WM1814
   - Add support for Dialog Semi DA9062 and DA9063
   - Add support for Kontron COMe-bBL6 and COMe-cBW6
   - Add support for X-Powers AXP152
   - Add support for Atmel, many
   - Add support for STMPE, many
   - Add support for USB in X-Powers AXP22X

  Core Frameworks:
   - New Base API to traverse devices and their children in reverse order

  Bug Fixes:
   - Fix race between runtime-suspend and IRQs
   - Obtain platform data form more reliable source

  Fix-ups:
   - Constifying things
   - Variable signage changes
   - Kconfig depends|selects changes
   - Make use of BIT() macro
   - Do not supply .owner attribute in *_driver structures
   - MAINTAINERS entries
   - Stop using set_irq_flags()
   - Start using irq_set_chained_handler_and_data()
   - Export DT device ID structures"

* tag 'mfd-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (69 commits)
  mfd: jz4740-adc: Init mask cache in generic IRQ chip
  mfd: cros_ec: spi: Add OF match table
  mfd: stmpe: Add OF match table
  mfd: max77686: Split out regulator part from the DT binding
  mfd: Add DT binding for Maxim MAX77802 IC
  mfd: max77686: Use a generic name for the PMIC node in the example
  mfd: max77686: Don't suggest in binding to use a deprecated property
  mfd: Add MFD_CROS_EC dependencies
  mfd: cros_ec: Remove CROS_EC_PROTO dependency for SPI and I2C drivers
  mfd: axp20x: Add a cell for the usb power_supply part of the axp20x PMICs
  mfd: axp20x: Add missing registers, and mark more registers volatile
  mfd: arizona: Fixup some formatting/white space errors
  mfd: wm8994: Fix NULL pointer exception on missing pdata
  of: Add vendor prefix for Nuvoton
  mfd: mt6397: Implement wake handler and suspend/resume to handle wake up event
  mfd: atmel-hlcdc: Add support for new SoCs
  mfd: Export OF module alias information in missing drivers
  mfd: stw481x: Export I2C module alias information
  mfd: da9062: Support for the DA9063 OnKey in the DA9062 core
  mfd: max899x: Avoid redundant irq_data lookup
  ...
...@@ -2,7 +2,11 @@ Device-Tree bindings for Atmel's HLCDC (High LCD Controller) MFD driver ...@@ -2,7 +2,11 @@ Device-Tree bindings for Atmel's HLCDC (High LCD Controller) MFD driver
Required properties: Required properties:
- compatible: value should be one of the following: - compatible: value should be one of the following:
"atmel,at91sam9n12-hlcdc"
"atmel,at91sam9x5-hlcdc"
"atmel,sama5d2-hlcdc"
"atmel,sama5d3-hlcdc" "atmel,sama5d3-hlcdc"
"atmel,sama5d4-hlcdc"
- reg: base address and size of the HLCDC device registers. - reg: base address and size of the HLCDC device registers.
- clock-names: the name of the 3 clocks requested by the HLCDC device. - clock-names: the name of the 3 clocks requested by the HLCDC device.
Should contain "periph_clk", "sys_clk" and "slow_clk". Should contain "periph_clk", "sys_clk" and "slow_clk".
......
AXP family PMIC device tree bindings AXP family PMIC device tree bindings
The axp20x family current members : The axp20x family current members :
axp152 (X-Powers)
axp202 (X-Powers) axp202 (X-Powers)
axp209 (X-Powers) axp209 (X-Powers)
axp221 (X-Powers) axp221 (X-Powers)
Required properties: Required properties:
- compatible: "x-powers,axp202", "x-powers,axp209", "x-powers,axp221" - compatible: "x-powers,axp152", "x-powers,axp202", "x-powers,axp209",
"x-powers,axp221"
- reg: The I2C slave address for the AXP chip - reg: The I2C slave 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
......
* Dialog DA9062 Power Management Integrated Circuit (PMIC)
DA9062 consists of a large and varied group of sub-devices:
Device Supply Names Description
------ ------------ -----------
da9062-regulator : : LDOs & BUCKs
da9062-rtc : : Real-Time Clock
da9062-watchdog : : Watchdog Timer
======
Required properties:
- compatible : Should be "dlg,da9062".
- reg : Specifies the I2C slave address (this defaults to 0x58 but it can be
modified to match the chip's OTP settings).
- interrupt-parent : Specifies the reference to the interrupt controller for
the DA9062.
- 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. The
DA9062 regulators are bound using their names listed below:
buck1 : BUCK_1
buck2 : BUCK_2
buck3 : BUCK_3
buck4 : BUCK_4
ldo1 : LDO_1
ldo2 : LDO_2
ldo3 : LDO_3
ldo4 : LDO_4
The component follows the standard regulator framework and the bindings
details of individual regulator device can be found in:
Documentation/devicetree/bindings/regulator/regulator.txt
- rtc : This node defines settings required for the Real-Time Clock associated
with the DA9062. There are currently no entries in this binding, however
compatible = "dlg,da9062-rtc" should be added if a node is created.
- watchdog: This node defines the settings for the watchdog driver associated
with the DA9062 PMIC. The compatible = "dlg,da9062-watchdog" should be added
if a node is created.
Example:
pmic0: da9062@58 {
compatible = "dlg,da9062";
reg = <0x58>;
interrupt-parent = <&gpio6>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
rtc {
compatible = "dlg,da9062-rtc";
};
watchdog {
compatible = "dlg,da9062-watchdog";
};
regulators {
DA9062_BUCK1: buck1 {
regulator-name = "BUCK1";
regulator-min-microvolt = <300000>;
regulator-max-microvolt = <1570000>;
regulator-min-microamp = <500000>;
regulator-max-microamp = <2000000>;
regulator-boot-on;
};
DA9062_LDO1: ldo1 {
regulator-name = "LDO_1";
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <3600000>;
regulator-boot-on;
};
};
};
...@@ -7,8 +7,9 @@ different i2c slave address,presently for which we are statically creating i2c ...@@ -7,8 +7,9 @@ different i2c slave address,presently for which we are statically creating i2c
client while probing.This document describes the binding for mfd device and client while probing.This document describes the binding for mfd device and
PMIC submodule. PMIC submodule.
Binding for the built-in 32k clock generator block is defined separately Bindings for the built-in 32k clock generator block and
in bindings/clk/maxim,max77686.txt file. regulators are defined in ../clk/maxim,max77686.txt and
../regulator/max77686.txt respectively.
Required properties: Required properties:
- compatible : Must be "maxim,max77686"; - compatible : Must be "maxim,max77686";
...@@ -16,67 +17,11 @@ Required properties: ...@@ -16,67 +17,11 @@ Required properties:
- interrupts : This i2c device has an IRQ line connected to the main SoC. - interrupts : This i2c device has an IRQ line connected to the main SoC.
- interrupt-parent : The parent interrupt controller. - interrupt-parent : The parent interrupt controller.
Optional node:
- voltage-regulators : The regulators of max77686 have to be instantiated
under subnode named "voltage-regulators" using the following format.
regulator_name {
regulator-compatible = LDOn/BUCKn
standard regulator constraints....
};
refer Documentation/devicetree/bindings/regulator/regulator.txt
The regulator-compatible property of regulator should initialized with string
to get matched with their hardware counterparts as follow:
-LDOn : for LDOs, where n can lie in range 1 to 26.
example: LDO1, LDO2, LDO26.
-BUCKn : for BUCKs, where n can lie in range 1 to 9.
example: BUCK1, BUCK5, BUCK9.
Regulators which can be turned off during system suspend:
-LDOn : 2, 6-8, 10-12, 14-16,
-BUCKn : 1-4.
Use standard regulator bindings for it ('regulator-off-in-suspend').
LDO20, LDO21, LDO22, BUCK8 and BUCK9 can be configured to GPIO enable
control. To turn this feature on this property must be added to the regulator
sub-node:
- maxim,ena-gpios : one GPIO specifier enable control (the gpio
flags are actually ignored and always
ACTIVE_HIGH is used)
Example: Example:
max77686@09 { max77686: pmic@09 {
compatible = "maxim,max77686"; compatible = "maxim,max77686";
interrupt-parent = <&wakeup_eint>; interrupt-parent = <&wakeup_eint>;
interrupts = <26 0>; interrupts = <26 0>;
reg = <0x09>; reg = <0x09>;
};
voltage-regulators {
ldo11_reg {
regulator-compatible = "LDO11";
regulator-name = "vdd_ldo11";
regulator-min-microvolt = <1900000>;
regulator-max-microvolt = <1900000>;
regulator-always-on;
};
buck1_reg {
regulator-compatible = "BUCK1";
regulator-name = "vdd_mif";
regulator-min-microvolt = <950000>;
regulator-max-microvolt = <1300000>;
regulator-always-on;
regulator-boot-on;
};
buck9_reg {
regulator-compatible = "BUCK9";
regulator-name = "CAM_ISP_CORE_1.2V";
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1200000>;
maxim,ena-gpios = <&gpm0 3 GPIO_ACTIVE_HIGH>;
};
}
Maxim MAX77802 multi-function device
The Maxim MAX77802 is a Power Management IC (PMIC) that contains 10 high
efficiency Buck regulators, 32 Low-DropOut (LDO) regulators used to power
up application processors and peripherals, a 2-channel 32kHz clock outputs,
a Real-Time-Clock (RTC) and a I2C interface to program the individual
regulators, clocks outputs and the RTC.
Bindings for the built-in 32k clock generator block and
regulators are defined in ../clk/maxim,max77802.txt and
../regulator/max77802.txt respectively.
Required properties:
- compatible : Must be "maxim,max77802"
- reg : Specifies the I2C slave address of PMIC block.
- interrupts : I2C device IRQ line connected to the main SoC.
- interrupt-parent : The parent interrupt controller.
Example:
max77802: pmic@09 {
compatible = "maxim,max77802";
interrupt-parent = <&intc>;
interrupts = <26 IRQ_TYPE_NONE>;
reg = <0x09>;
};
Binding for Maxim MAX77686 regulators
This is a part of the device tree bindings of MAX77686 multi-function device.
More information can be found in ../mfd/max77686.txt file.
The MAX77686 PMIC has 9 high-efficiency Buck and 26 Low-DropOut (LDO)
regulators that can be controlled over I2C.
Following properties should be present in main device node of the MFD chip.
Optional node:
- voltage-regulators : The regulators of max77686 have to be instantiated
under subnode named "voltage-regulators" using the following format.
regulator_name {
regulator-compatible = LDOn/BUCKn
standard regulator constraints....
};
refer Documentation/devicetree/bindings/regulator/regulator.txt
The regulator node's name should be initialized with a string
to get matched with their hardware counterparts as follow:
-LDOn : for LDOs, where n can lie in range 1 to 26.
example: LDO1, LDO2, LDO26.
-BUCKn : for BUCKs, where n can lie in range 1 to 9.
example: BUCK1, BUCK5, BUCK9.
Regulators which can be turned off during system suspend:
-LDOn : 2, 6-8, 10-12, 14-16,
-BUCKn : 1-4.
Use standard regulator bindings for it ('regulator-off-in-suspend').
LDO20, LDO21, LDO22, BUCK8 and BUCK9 can be configured to GPIO enable
control. To turn this feature on this property must be added to the regulator
sub-node:
- maxim,ena-gpios : one GPIO specifier enable control (the gpio
flags are actually ignored and always
ACTIVE_HIGH is used)
Example:
max77686: pmic@09 {
compatible = "maxim,max77686";
interrupt-parent = <&wakeup_eint>;
interrupts = <26 IRQ_TYPE_NONE>;
reg = <0x09>;
voltage-regulators {
ldo11_reg: LDO11 {
regulator-name = "vdd_ldo11";
regulator-min-microvolt = <1900000>;
regulator-max-microvolt = <1900000>;
regulator-always-on;
};
buck1_reg: BUCK1 {
regulator-name = "vdd_mif";
regulator-min-microvolt = <950000>;
regulator-max-microvolt = <1300000>;
regulator-always-on;
regulator-boot-on;
};
buck9_reg: BUCK9 {
regulator-name = "CAM_ISP_CORE_1.2V";
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1200000>;
maxim,ena-gpios = <&gpm0 3 GPIO_ACTIVE_HIGH>;
};
};
STMicroelectronics Low Power Controller (LPC) - RTC STMicroelectronics Low Power Controller (LPC) - RTC
=================================================== ===================================================
LPC currently supports Watchdog OR Real Time Clock functionality. LPC currently supports Watchdog OR Real Time Clock OR Clocksource
functionality.
[See: ../watchdog/st_lpc_wdt.txt for Watchdog options] [See: ../watchdog/st_lpc_wdt.txt for Watchdog options]
[See: ../timer/st,stih407-lpc for Clocksource options]
Required properties Required properties
- compatible : Must be one of: "st,stih407-lpc" "st,stih416-lpc" - compatible : Must be: "st,stih407-lpc"
"st,stih415-lpc" "st,stid127-lpc"
- reg : LPC registers base address + size - reg : LPC registers base address + size
- interrupts : LPC interrupt line number and associated flags - interrupts : LPC interrupt line number and associated flags
- clocks : Clock used by LPC device (See: ../clock/clock-bindings.txt) - clocks : Clock used by LPC device (See: ../clock/clock-bindings.txt)
- st,lpc-mode : The LPC can run either one of two modes ST_LPC_MODE_RTC [0] or - st,lpc-mode : The LPC can run either one of three modes:
ST_LPC_MODE_WDT [1]. One (and only one) mode must be ST_LPC_MODE_RTC [0]
selected. ST_LPC_MODE_WDT [1]
ST_LPC_MODE_CLKSRC [2]
One (and only one) mode must be selected.
Example: Example:
lpc@fde05000 { lpc@fde05000 {
......
STMicroelectronics Low Power Controller (LPC) - Clocksource
===========================================================
LPC currently supports Watchdog OR Real Time Clock OR Clocksource
functionality.
[See: ../watchdog/st_lpc_wdt.txt for Watchdog options]
[See: ../rtc/rtc-st-lpc.txt for RTC options]
Required properties
- compatible : Must be: "st,stih407-lpc"
- reg : LPC registers base address + size
- interrupts : LPC interrupt line number and associated flags
- clocks : Clock used by LPC device (See: ../clock/clock-bindings.txt)
- st,lpc-mode : The LPC can run either one of three modes:
ST_LPC_MODE_RTC [0]
ST_LPC_MODE_WDT [1]
ST_LPC_MODE_CLKSRC [2]
One (and only one) mode must be selected.
Example:
lpc@fde05000 {
compatible = "st,stih407-lpc";
reg = <0xfde05000 0x1000>;
clocks = <&clk_s_d3_flexgen CLK_LPC_0>;
st,lpc-mode = <ST_LPC_MODE_CLKSRC>;
};
...@@ -150,6 +150,7 @@ netxeon Shenzhen Netxeon Technology CO., LTD ...@@ -150,6 +150,7 @@ netxeon Shenzhen Netxeon Technology CO., LTD
newhaven Newhaven Display International newhaven Newhaven Display International
nintendo Nintendo nintendo Nintendo
nokia Nokia nokia Nokia
nuvoton Nuvoton Technology Corporation
nvidia NVIDIA nvidia NVIDIA
nxp NXP Semiconductors nxp NXP Semiconductors
onnn ON Semiconductor Corp. onnn ON Semiconductor Corp.
......
STMicroelectronics Low Power Controller (LPC) - Watchdog STMicroelectronics Low Power Controller (LPC) - Watchdog
======================================================== ========================================================
LPC currently supports Watchdog OR Real Time Clock functionality. LPC currently supports Watchdog OR Real Time Clock OR Clocksource
functionality.
[See: ../rtc/rtc-st-lpc.txt for RTC options] [See: ../rtc/rtc-st-lpc.txt for RTC options]
[See: ../timer/st,stih407-lpc for Clocksource options]
Required properties Required properties
...@@ -12,9 +14,11 @@ Required properties ...@@ -12,9 +14,11 @@ Required properties
- reg : LPC registers base address + size - reg : LPC registers base address + size
- interrupts : LPC interrupt line number and associated flags - interrupts : LPC interrupt line number and associated flags
- clocks : Clock used by LPC device (See: ../clock/clock-bindings.txt) - clocks : Clock used by LPC device (See: ../clock/clock-bindings.txt)
- st,lpc-mode : The LPC can run either one of two modes ST_LPC_MODE_RTC [0] or - st,lpc-mode : The LPC can run either one of three modes:
ST_LPC_MODE_WDT [1]. One (and only one) mode must be ST_LPC_MODE_RTC [0]
selected. ST_LPC_MODE_WDT [1]
ST_LPC_MODE_CLKSRC [2]
One (and only one) mode must be selected.
Required properties [watchdog mode] Required properties [watchdog mode]
......
...@@ -1517,6 +1517,7 @@ S: Maintained ...@@ -1517,6 +1517,7 @@ S: Maintained
F: arch/arm/mach-sti/ F: arch/arm/mach-sti/
F: arch/arm/boot/dts/sti* F: arch/arm/boot/dts/sti*
F: drivers/clocksource/arm_global_timer.c F: drivers/clocksource/arm_global_timer.c
F: drivers/clocksource/clksrc_st_lpc.c
F: drivers/i2c/busses/i2c-st.c F: drivers/i2c/busses/i2c-st.c
F: drivers/media/rc/st_rc.c F: drivers/media/rc/st_rc.c
F: drivers/mmc/host/sdhci-st.c F: drivers/mmc/host/sdhci-st.c
...@@ -6594,6 +6595,14 @@ S: Supported ...@@ -6594,6 +6595,14 @@ S: Supported
F: drivers/power/max14577_charger.c F: drivers/power/max14577_charger.c
F: drivers/power/max77693_charger.c F: drivers/power/max77693_charger.c
MAXIM MAX77802 MULTIFUNCTION PMIC DEVICE DRIVERS
M: Javier Martinez Canillas <javier@osg.samsung.com>
L: linux-kernel@vger.kernel.org
S: Supported
F: drivers/*/*max77802.c
F: Documentation/devicetree/bindings/*/*max77802.txt
F: include/dt-bindings/*/*max77802.h
MAXIM PMIC AND MUIC DRIVERS FOR EXYNOS BASED BOARDS MAXIM PMIC AND MUIC DRIVERS FOR EXYNOS BASED BOARDS
M: Chanwoo Choi <cw00.choi@samsung.com> M: Chanwoo Choi <cw00.choi@samsung.com>
M: Krzysztof Kozlowski <k.kozlowski@samsung.com> M: Krzysztof Kozlowski <k.kozlowski@samsung.com>
...@@ -6607,7 +6616,7 @@ F: drivers/extcon/extcon-max77693.c ...@@ -6607,7 +6616,7 @@ F: drivers/extcon/extcon-max77693.c
F: drivers/rtc/rtc-max77686.c F: drivers/rtc/rtc-max77686.c
F: drivers/clk/clk-max77686.c F: drivers/clk/clk-max77686.c
F: Documentation/devicetree/bindings/mfd/max14577.txt F: Documentation/devicetree/bindings/mfd/max14577.txt
F: Documentation/devicetree/bindings/mfd/max77686.txt F: Documentation/devicetree/bindings/*/max77686.txt
F: Documentation/devicetree/bindings/mfd/max77693.txt F: Documentation/devicetree/bindings/mfd/max77693.txt
F: Documentation/devicetree/bindings/clock/maxim,max77686.txt F: Documentation/devicetree/bindings/clock/maxim,max77686.txt
F: include/linux/mfd/max14577*.h F: include/linux/mfd/max14577*.h
......
...@@ -297,4 +297,12 @@ config CLKSRC_IMX_GPT ...@@ -297,4 +297,12 @@ config CLKSRC_IMX_GPT
depends on ARM && CLKDEV_LOOKUP depends on ARM && CLKDEV_LOOKUP
select CLKSRC_MMIO select CLKSRC_MMIO
config CLKSRC_ST_LPC
bool
depends on ARCH_STI
select CLKSRC_OF if OF
help
Enable this option to use the Low Power controller timer
as clocksource.
endmenu endmenu
...@@ -61,3 +61,4 @@ obj-$(CONFIG_ASM9260_TIMER) += asm9260_timer.o ...@@ -61,3 +61,4 @@ obj-$(CONFIG_ASM9260_TIMER) += asm9260_timer.o
obj-$(CONFIG_H8300) += h8300_timer8.o obj-$(CONFIG_H8300) += h8300_timer8.o
obj-$(CONFIG_H8300_TMR16) += h8300_timer16.o obj-$(CONFIG_H8300_TMR16) += h8300_timer16.o
obj-$(CONFIG_H8300_TPU) += h8300_tpu.o obj-$(CONFIG_H8300_TPU) += h8300_tpu.o
obj-$(CONFIG_CLKSRC_ST_LPC) += clksrc_st_lpc.o
/*
* Clocksource using the Low Power Timer found in the Low Power Controller (LPC)
*
* Copyright (C) 2015 STMicroelectronics – All Rights Reserved
*
* Author(s): Francesco Virlinzi <francesco.virlinzi@st.com>
* Ajit Pal Singh <ajitpal.singh@st.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include <linux/clk.h>
#include <linux/clocksource.h>
#include <linux/init.h>
#include <linux/of_address.h>
#include <linux/sched_clock.h>
#include <linux/slab.h>
#include <dt-bindings/mfd/st-lpc.h>
/* Low Power Timer */
#define LPC_LPT_LSB_OFF 0x400
#define LPC_LPT_MSB_OFF 0x404
#define LPC_LPT_START_OFF 0x408
static struct st_clksrc_ddata {
struct clk *clk;
void __iomem *base;
} ddata;
static void __init st_clksrc_reset(void)
{
writel_relaxed(0, ddata.base + LPC_LPT_START_OFF);
writel_relaxed(0, ddata.base + LPC_LPT_MSB_OFF);
writel_relaxed(0, ddata.base + LPC_LPT_LSB_OFF);
writel_relaxed(1, ddata.base + LPC_LPT_START_OFF);
}
static u64 notrace st_clksrc_sched_clock_read(void)
{
return (u64)readl_relaxed(ddata.base + LPC_LPT_LSB_OFF);
}
static int __init st_clksrc_init(void)
{
unsigned long rate;
int ret;
st_clksrc_reset();
rate = clk_get_rate(ddata.clk);
sched_clock_register(st_clksrc_sched_clock_read, 32, rate);
ret = clocksource_mmio_init(ddata.base + LPC_LPT_LSB_OFF,
"clksrc-st-lpc", rate, 300, 32,
clocksource_mmio_readl_up);
if (ret) {
pr_err("clksrc-st-lpc: Failed to register clocksource\n");
return ret;
}
return 0;
}
static int __init st_clksrc_setup_clk(struct device_node *np)
{
struct clk *clk;
clk = of_clk_get(np, 0);
if (IS_ERR(clk)) {
pr_err("clksrc-st-lpc: Failed to get LPC clock\n");
return PTR_ERR(clk);
}
if (clk_prepare_enable(clk)) {
pr_err("clksrc-st-lpc: Failed to enable LPC clock\n");
return -EINVAL;
}
if (!clk_get_rate(clk)) {
pr_err("clksrc-st-lpc: Failed to get LPC clock rate\n");
clk_disable_unprepare(clk);
return -EINVAL;
}
ddata.clk = clk;
return 0;
}
static void __init st_clksrc_of_register(struct device_node *np)
{
int ret;
uint32_t mode;
ret = of_property_read_u32(np, "st,lpc-mode", &mode);
if (ret) {
pr_err("clksrc-st-lpc: An LPC mode must be provided\n");
return;
}
/* LPC can either run as a Clocksource or in RTC or WDT mode */
if (mode != ST_LPC_MODE_CLKSRC)
return;
ddata.base = of_iomap(np, 0);
if (!ddata.base) {
pr_err("clksrc-st-lpc: Unable to map iomem\n");
return;
}
if (st_clksrc_setup_clk(np)) {
iounmap(ddata.base);
return;
}
if (st_clksrc_init()) {
clk_disable_unprepare(ddata.clk);
clk_put(ddata.clk);
iounmap(ddata.base);
return;
}
pr_info("clksrc-st-lpc: clocksource initialised - running @ %luHz\n",
clk_get_rate(ddata.clk));
}
CLOCKSOURCE_OF_DECLARE(ddata, "st,stih407-lpc", st_clksrc_of_register);
...@@ -88,12 +88,13 @@ ...@@ -88,12 +88,13 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/platform_data/itco_wdt.h>
#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \ #if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
defined CONFIG_DMI defined CONFIG_DMI
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/i2c-mux-gpio.h> #include <linux/i2c-mux-gpio.h>
#include <linux/platform_device.h>
#endif #endif
/* I801 SMBus address offsets */ /* I801 SMBus address offsets */
...@@ -113,6 +114,16 @@ ...@@ -113,6 +114,16 @@
#define SMBPCICTL 0x004 #define SMBPCICTL 0x004
#define SMBPCISTS 0x006 #define SMBPCISTS 0x006
#define SMBHSTCFG 0x040 #define SMBHSTCFG 0x040
#define TCOBASE 0x050
#define TCOCTL 0x054
#define ACPIBASE 0x040
#define ACPIBASE_SMI_OFF 0x030
#define ACPICTRL 0x044
#define ACPICTRL_EN 0x080
#define SBREG_BAR 0x10
#define SBREG_SMBCTRL 0xc6000c
/* Host status bits for SMBPCISTS */ /* Host status bits for SMBPCISTS */
#define SMBPCISTS_INTS 0x08 #define SMBPCISTS_INTS 0x08
...@@ -125,6 +136,9 @@ ...@@ -125,6 +136,9 @@
#define SMBHSTCFG_SMB_SMI_EN 2 #define SMBHSTCFG_SMB_SMI_EN 2
#define SMBHSTCFG_I2C_EN 4 #define SMBHSTCFG_I2C_EN 4
/* TCO configuration bits for TCOCTL */
#define TCOCTL_EN 0x0100
/* Auxiliary control register bits, ICH4+ only */ /* Auxiliary control register bits, ICH4+ only */
#define SMBAUXCTL_CRC 1 #define SMBAUXCTL_CRC 1
#define SMBAUXCTL_E32B 2 #define SMBAUXCTL_E32B 2
...@@ -221,6 +235,7 @@ struct i801_priv { ...@@ -221,6 +235,7 @@ struct i801_priv {
const struct i801_mux_config *mux_drvdata; const struct i801_mux_config *mux_drvdata;
struct platform_device *mux_pdev; struct platform_device *mux_pdev;
#endif #endif
struct platform_device *tco_pdev;
}; };
#define FEATURE_SMBUS_PEC (1 << 0) #define FEATURE_SMBUS_PEC (1 << 0)
...@@ -230,6 +245,7 @@ struct i801_priv { ...@@ -230,6 +245,7 @@ struct i801_priv {
#define FEATURE_IRQ (1 << 4) #define FEATURE_IRQ (1 << 4)
/* Not really a feature, but it's convenient to handle it as such */ /* Not really a feature, but it's convenient to handle it as such */
#define FEATURE_IDF (1 << 15) #define FEATURE_IDF (1 << 15)
#define FEATURE_TCO (1 << 16)
static const char *i801_feature_names[] = { static const char *i801_feature_names[] = {
"SMBus PEC", "SMBus PEC",
...@@ -1132,6 +1148,95 @@ static inline unsigned int i801_get_adapter_class(struct i801_priv *priv) ...@@ -1132,6 +1148,95 @@ static inline unsigned int i801_get_adapter_class(struct i801_priv *priv)
} }
#endif #endif
static const struct itco_wdt_platform_data tco_platform_data = {
.name = "Intel PCH",
.version = 4,
};
static DEFINE_SPINLOCK(p2sb_spinlock);
static void i801_add_tco(struct i801_priv *priv)
{
struct pci_dev *pci_dev = priv->pci_dev;
struct resource tco_res[3], *res;
struct platform_device *pdev;
unsigned int devfn;
u32 tco_base, tco_ctl;
u32 base_addr, ctrl_val;
u64 base64_addr;
if (!(priv->features & FEATURE_TCO))
return;
pci_read_config_dword(pci_dev, TCOBASE, &tco_base);
pci_read_config_dword(pci_dev, TCOCTL, &tco_ctl);
if (!(tco_ctl & TCOCTL_EN))
return;
memset(tco_res, 0, sizeof(tco_res));
res = &tco_res[ICH_RES_IO_TCO];
res->start = tco_base & ~1;
res->end = res->start + 32 - 1;
res->flags = IORESOURCE_IO;
/*
* Power Management registers.
*/
devfn = PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 2);
pci_bus_read_config_dword(pci_dev->bus, devfn, ACPIBASE, &base_addr);
res = &tco_res[ICH_RES_IO_SMI];
res->start = (base_addr & ~1) + ACPIBASE_SMI_OFF;
res->end = res->start + 3;
res->flags = IORESOURCE_IO;
/*
* Enable the ACPI I/O space.
*/
pci_bus_read_config_dword(pci_dev->bus, devfn, ACPICTRL, &ctrl_val);
ctrl_val |= ACPICTRL_EN;
pci_bus_write_config_dword(pci_dev->bus, devfn, ACPICTRL, ctrl_val);
/*
* We must access the NO_REBOOT bit over the Primary to Sideband
* bridge (P2SB). The BIOS prevents the P2SB device from being
* enumerated by the PCI subsystem, so we need to unhide/hide it
* to lookup the P2SB BAR.
*/
spin_lock(&p2sb_spinlock);
devfn = PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 1);
/* Unhide the P2SB device */
pci_bus_write_config_byte(pci_dev->bus, devfn, 0xe1, 0x0);
pci_bus_read_config_dword(pci_dev->bus, devfn, SBREG_BAR, &base_addr);
base64_addr = base_addr & 0xfffffff0;
pci_bus_read_config_dword(pci_dev->bus, devfn, SBREG_BAR + 0x4, &base_addr);
base64_addr |= (u64)base_addr << 32;
/* Hide the P2SB device */
pci_bus_write_config_byte(pci_dev->bus, devfn, 0xe1, 0x1);
spin_unlock(&p2sb_spinlock);
res = &tco_res[ICH_RES_MEM_OFF];
res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL;
res->end = res->start + 3;
res->flags = IORESOURCE_MEM;
pdev = platform_device_register_resndata(&pci_dev->dev, "iTCO_wdt", -1,
tco_res, 3, &tco_platform_data,
sizeof(tco_platform_data));
if (IS_ERR(pdev)) {
dev_warn(&pci_dev->dev, "failed to create iTCO device\n");
return;
}
priv->tco_pdev = pdev;
}
static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
{ {
unsigned char temp; unsigned char temp;
...@@ -1149,6 +1254,15 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -1149,6 +1254,15 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
priv->pci_dev = dev; priv->pci_dev = dev;
switch (dev->device) { switch (dev->device) {
case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS:
case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SMBUS:
priv->features |= FEATURE_I2C_BLOCK_READ;
priv->features |= FEATURE_IRQ;
priv->features |= FEATURE_SMBUS_PEC;
priv->features |= FEATURE_BLOCK_BUFFER;
priv->features |= FEATURE_TCO;
break;
case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0: case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0:
case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1: case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1:
case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2: case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2:
...@@ -1265,6 +1379,8 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -1265,6 +1379,8 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
dev_info(&dev->dev, "SMBus using %s\n", dev_info(&dev->dev, "SMBus using %s\n",
priv->features & FEATURE_IRQ ? "PCI interrupt" : "polling"); priv->features & FEATURE_IRQ ? "PCI interrupt" : "polling");
i801_add_tco(priv);
/* set up the sysfs linkage to our parent device */ /* set up the sysfs linkage to our parent device */
priv->adapter.dev.parent = &dev->dev; priv->adapter.dev.parent = &dev->dev;
...@@ -1296,6 +1412,8 @@ static void i801_remove(struct pci_dev *dev) ...@@ -1296,6 +1412,8 @@ static void i801_remove(struct pci_dev *dev)
i2c_del_adapter(&priv->adapter); i2c_del_adapter(&priv->adapter);
pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg); pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg);
platform_device_unregister(priv->tco_pdev);
/* /*
* do not call pci_disable_device(dev) since it can cause hard hangs on * do not call pci_disable_device(dev) since it can cause hard hangs on
* some systems during power-off (eg. Fujitsu-Siemens Lifebook E8010) * some systems during power-off (eg. Fujitsu-Siemens Lifebook E8010)
......
...@@ -609,7 +609,6 @@ static int pm800_remove(struct i2c_client *client) ...@@ -609,7 +609,6 @@ static int pm800_remove(struct i2c_client *client)
static struct i2c_driver pm800_driver = { static struct i2c_driver pm800_driver = {
.driver = { .driver = {
.name = "88PM800", .name = "88PM800",
.owner = THIS_MODULE,
.pm = &pm80x_pm_ops, .pm = &pm80x_pm_ops,
}, },
.probe = pm800_probe, .probe = pm800_probe,
......
...@@ -267,7 +267,6 @@ static int pm805_remove(struct i2c_client *client) ...@@ -267,7 +267,6 @@ static int pm805_remove(struct i2c_client *client)
static struct i2c_driver pm805_driver = { static struct i2c_driver pm805_driver = {
.driver = { .driver = {
.name = "88PM805", .name = "88PM805",
.owner = THIS_MODULE,
.pm = &pm80x_pm_ops, .pm = &pm80x_pm_ops,
}, },
.probe = pm805_probe, .probe = pm805_probe,
......
...@@ -558,11 +558,7 @@ static int pm860x_irq_domain_map(struct irq_domain *d, unsigned int virq, ...@@ -558,11 +558,7 @@ static int pm860x_irq_domain_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_data(virq, d->host_data); irq_set_chip_data(virq, d->host_data);
irq_set_chip_and_handler(virq, &pm860x_irq_chip, handle_edge_irq); irq_set_chip_and_handler(virq, &pm860x_irq_chip, handle_edge_irq);
irq_set_nested_thread(virq, 1); irq_set_nested_thread(virq, 1);
#ifdef CONFIG_ARM
set_irq_flags(virq, IRQF_VALID);
#else
irq_set_noprobe(virq); irq_set_noprobe(virq);
#endif
return 0; return 0;
} }
...@@ -1258,7 +1254,6 @@ MODULE_DEVICE_TABLE(of, pm860x_dt_ids); ...@@ -1258,7 +1254,6 @@ MODULE_DEVICE_TABLE(of, pm860x_dt_ids);
static struct i2c_driver pm860x_driver = { static struct i2c_driver pm860x_driver = {
.driver = { .driver = {
.name = "88PM860x", .name = "88PM860x",
.owner = THIS_MODULE,
.pm = &pm860x_pm_ops, .pm = &pm860x_pm_ops,
.of_match_table = pm860x_dt_ids, .of_match_table = pm860x_dt_ids,
}, },
......
...@@ -97,6 +97,7 @@ config MFD_CROS_EC ...@@ -97,6 +97,7 @@ config MFD_CROS_EC
select MFD_CORE select MFD_CORE
select CHROME_PLATFORMS select CHROME_PLATFORMS
select CROS_EC_PROTO select CROS_EC_PROTO
depends on X86 || ARM || COMPILE_TEST
help help
If you say Y here you get support for the ChromeOS Embedded If you say Y here you get support for the ChromeOS Embedded
Controller (EC) providing keyboard, battery and power services. Controller (EC) providing keyboard, battery and power services.
...@@ -105,7 +106,7 @@ config MFD_CROS_EC ...@@ -105,7 +106,7 @@ config MFD_CROS_EC
config MFD_CROS_EC_I2C config MFD_CROS_EC_I2C
tristate "ChromeOS Embedded Controller (I2C)" tristate "ChromeOS Embedded Controller (I2C)"
depends on MFD_CROS_EC && CROS_EC_PROTO && I2C depends on MFD_CROS_EC && I2C
help help
If you say Y here, you get support for talking to the ChromeOS If you say Y here, you get support for talking to the ChromeOS
...@@ -115,7 +116,7 @@ config MFD_CROS_EC_I2C ...@@ -115,7 +116,7 @@ config MFD_CROS_EC_I2C
config MFD_CROS_EC_SPI config MFD_CROS_EC_SPI
tristate "ChromeOS Embedded Controller (SPI)" tristate "ChromeOS Embedded Controller (SPI)"
depends on MFD_CROS_EC && CROS_EC_PROTO && SPI depends on MFD_CROS_EC && SPI
---help--- ---help---
If you say Y here, you get support for talking to the ChromeOS EC If you say Y here, you get support for talking to the ChromeOS EC
...@@ -186,6 +187,18 @@ config MFD_DA9055 ...@@ -186,6 +187,18 @@ config MFD_DA9055
This driver can be built as a module. If built as a module it will be This driver can be built as a module. If built as a module it will be
called "da9055" called "da9055"
config MFD_DA9062
tristate "Dialog Semiconductor DA9062 PMIC Support"
select MFD_CORE
select REGMAP_I2C
select REGMAP_IRQ
depends on I2C=y
help
Say yes here for support for the Dialog Semiconductor DA9062 PMIC.
This includes the I2C driver and core APIs.
Additional drivers must be enabled in order to use the functionality
of the device.
config MFD_DA9063 config MFD_DA9063
bool "Dialog Semiconductor DA9063 PMIC Support" bool "Dialog Semiconductor DA9063 PMIC Support"
select MFD_CORE select MFD_CORE
...@@ -398,12 +411,14 @@ config MFD_KEMPLD ...@@ -398,12 +411,14 @@ config MFD_KEMPLD
device may provide functions like watchdog, GPIO, UART and I2C bus. device may provide functions like watchdog, GPIO, UART and I2C bus.
The following modules are supported: The following modules are supported:
* COMe-bBL6
* COMe-bHL6 * COMe-bHL6
* COMe-bIP# * COMe-bIP#
* COMe-bPC2 (ETXexpress-PC) * COMe-bPC2 (ETXexpress-PC)
* COMe-bSC# (ETXexpress-SC T#) * COMe-bSC# (ETXexpress-SC T#)
* COMe-cBL6 * COMe-cBL6
* COMe-cBT6 * COMe-cBT6
* COMe-cBW6
* COMe-cCT6 * COMe-cCT6
* COMe-cDC2 (microETXexpress-DC) * COMe-cDC2 (microETXexpress-DC)
* COMe-cHL6 * COMe-cHL6
...@@ -1379,6 +1394,12 @@ config MFD_WM8997 ...@@ -1379,6 +1394,12 @@ config MFD_WM8997
help help
Support for Wolfson Microelectronics WM8997 low power audio SoC Support for Wolfson Microelectronics WM8997 low power audio SoC
config MFD_WM8998
bool "Wolfson Microelectronics WM8998"
depends on MFD_ARIZONA
help
Support for Wolfson Microelectronics WM8998 low power audio SoC
config MFD_WM8400 config MFD_WM8400
bool "Wolfson Microelectronics WM8400" bool "Wolfson Microelectronics WM8400"
select MFD_CORE select MFD_CORE
......
...@@ -48,6 +48,9 @@ endif ...@@ -48,6 +48,9 @@ endif
ifeq ($(CONFIG_MFD_WM8997),y) ifeq ($(CONFIG_MFD_WM8997),y)
obj-$(CONFIG_MFD_ARIZONA) += wm8997-tables.o obj-$(CONFIG_MFD_ARIZONA) += wm8997-tables.o
endif endif
ifeq ($(CONFIG_MFD_WM8998),y)
obj-$(CONFIG_MFD_ARIZONA) += wm8998-tables.o
endif
obj-$(CONFIG_MFD_WM8400) += wm8400-core.o obj-$(CONFIG_MFD_WM8400) += wm8400-core.o
wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o
wm831x-objs += wm831x-auxadc.o wm831x-objs += wm831x-auxadc.o
...@@ -110,10 +113,11 @@ obj-$(CONFIG_MFD_LP8788) += lp8788.o lp8788-irq.o ...@@ -110,10 +113,11 @@ obj-$(CONFIG_MFD_LP8788) += lp8788.o lp8788-irq.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
da9063-objs := da9063-core.o da9063-irq.o da9063-i2c.o da9063-objs := da9063-core.o da9063-irq.o da9063-i2c.o
obj-$(CONFIG_MFD_DA9063) += da9063.o obj-$(CONFIG_MFD_DA9063) += da9063.o
obj-$(CONFIG_MFD_DA9150) += da9150-core.o obj-$(CONFIG_MFD_DA9150) += da9150-core.o
obj-$(CONFIG_MFD_MAX14577) += max14577.o obj-$(CONFIG_MFD_MAX14577) += max14577.o
obj-$(CONFIG_MFD_MAX77686) += max77686.o obj-$(CONFIG_MFD_MAX77686) += max77686.o
obj-$(CONFIG_MFD_MAX77693) += max77693.o obj-$(CONFIG_MFD_MAX77693) += max77693.o
......
...@@ -500,7 +500,6 @@ MODULE_DEVICE_TABLE(i2c, aat2870_i2c_id_table); ...@@ -500,7 +500,6 @@ MODULE_DEVICE_TABLE(i2c, aat2870_i2c_id_table);
static struct i2c_driver aat2870_i2c_driver = { static struct i2c_driver aat2870_i2c_driver = {
.driver = { .driver = {
.name = "aat2870", .name = "aat2870",
.owner = THIS_MODULE,
.pm = &aat2870_pm_ops, .pm = &aat2870_pm_ops,
}, },
.probe = aat2870_i2c_probe, .probe = aat2870_i2c_probe,
......
...@@ -972,7 +972,6 @@ MODULE_DEVICE_TABLE(i2c, ab3100_id); ...@@ -972,7 +972,6 @@ MODULE_DEVICE_TABLE(i2c, ab3100_id);
static struct i2c_driver ab3100_driver = { static struct i2c_driver ab3100_driver = {
.driver = { .driver = {
.name = "ab3100", .name = "ab3100",
.owner = THIS_MODULE,
}, },
.id_table = ab3100_id, .id_table = ab3100_id,
.probe = ab3100_probe, .probe = ab3100_probe,
......
...@@ -565,11 +565,7 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned int virq, ...@@ -565,11 +565,7 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_and_handler(virq, &ab8500_irq_chip, irq_set_chip_and_handler(virq, &ab8500_irq_chip,
handle_simple_irq); handle_simple_irq);
irq_set_nested_thread(virq, 1); irq_set_nested_thread(virq, 1);
#ifdef CONFIG_ARM
set_irq_flags(virq, IRQF_VALID);
#else
irq_set_noprobe(virq); irq_set_noprobe(virq);
#endif
return 0; return 0;
} }
......
...@@ -351,7 +351,6 @@ MODULE_DEVICE_TABLE(i2c, adp5520_id); ...@@ -351,7 +351,6 @@ MODULE_DEVICE_TABLE(i2c, adp5520_id);
static struct i2c_driver adp5520_driver = { static struct i2c_driver adp5520_driver = {
.driver = { .driver = {
.name = "adp5520", .name = "adp5520",
.owner = THIS_MODULE,
.pm = &adp5520_pm, .pm = &adp5520_pm,
}, },
.probe = adp5520_probe, .probe = adp5520_probe,
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "arizona.h" #include "arizona.h"
static const char *wm5102_core_supplies[] = { static const char * const wm5102_core_supplies[] = {
"AVDD", "AVDD",
"DBVDD1", "DBVDD1",
}; };
...@@ -146,17 +146,31 @@ static irqreturn_t arizona_underclocked(int irq, void *data) ...@@ -146,17 +146,31 @@ static irqreturn_t arizona_underclocked(int irq, void *data)
static irqreturn_t arizona_overclocked(int irq, void *data) static irqreturn_t arizona_overclocked(int irq, void *data)
{ {
struct arizona *arizona = data; struct arizona *arizona = data;
unsigned int val[2]; unsigned int val[3];
int ret; int ret;
ret = regmap_bulk_read(arizona->regmap, ARIZONA_INTERRUPT_RAW_STATUS_6, ret = regmap_bulk_read(arizona->regmap, ARIZONA_INTERRUPT_RAW_STATUS_6,
&val[0], 2); &val[0], 3);
if (ret != 0) { if (ret != 0) {
dev_err(arizona->dev, "Failed to read overclock status: %d\n", dev_err(arizona->dev, "Failed to read overclock status: %d\n",
ret); ret);
return IRQ_NONE; return IRQ_NONE;
} }
switch (arizona->type) {
case WM8998:
case WM1814:
/* Some bits are shifted on WM8998,
* rearrange to match the standard bit layout
*/
val[0] = ((val[0] & 0x60e0) >> 1) |
((val[0] & 0x1e00) >> 2) |
(val[0] & 0x000f);
break;
default:
break;
}
if (val[0] & ARIZONA_PWM_OVERCLOCKED_STS) if (val[0] & ARIZONA_PWM_OVERCLOCKED_STS)
dev_err(arizona->dev, "PWM overclocked\n"); dev_err(arizona->dev, "PWM overclocked\n");
if (val[0] & ARIZONA_FX_CORE_OVERCLOCKED_STS) if (val[0] & ARIZONA_FX_CORE_OVERCLOCKED_STS)
...@@ -201,6 +215,9 @@ static irqreturn_t arizona_overclocked(int irq, void *data) ...@@ -201,6 +215,9 @@ static irqreturn_t arizona_overclocked(int irq, void *data)
if (val[1] & ARIZONA_ISRC1_OVERCLOCKED_STS) if (val[1] & ARIZONA_ISRC1_OVERCLOCKED_STS)
dev_err(arizona->dev, "ISRC1 overclocked\n"); dev_err(arizona->dev, "ISRC1 overclocked\n");
if (val[2] & ARIZONA_SPDIF_OVERCLOCKED_STS)
dev_err(arizona->dev, "SPDIF overclocked\n");
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -550,9 +567,8 @@ static int arizona_runtime_resume(struct device *dev) ...@@ -550,9 +567,8 @@ static int arizona_runtime_resume(struct device *dev)
break; break;
default: default:
ret = arizona_wait_for_boot(arizona); ret = arizona_wait_for_boot(arizona);
if (ret != 0) { if (ret != 0)
goto err; goto err;
}
if (arizona->external_dcvdd) { if (arizona->external_dcvdd) {
ret = regmap_update_bits(arizona->regmap, ret = regmap_update_bits(arizona->regmap,
...@@ -759,8 +775,8 @@ static int arizona_of_get_core_pdata(struct arizona *arizona) ...@@ -759,8 +775,8 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
ret = of_property_read_u32_array(arizona->dev->of_node, ret = of_property_read_u32_array(arizona->dev->of_node,
"wlf,gpio-defaults", "wlf,gpio-defaults",
arizona->pdata.gpio_defaults, pdata->gpio_defaults,
ARRAY_SIZE(arizona->pdata.gpio_defaults)); ARRAY_SIZE(pdata->gpio_defaults));
if (ret >= 0) { if (ret >= 0) {
/* /*
* All values are literal except out of range values * All values are literal except out of range values
...@@ -768,11 +784,11 @@ static int arizona_of_get_core_pdata(struct arizona *arizona) ...@@ -768,11 +784,11 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
* data which uses 0 as chip default and out of range * data which uses 0 as chip default and out of range
* as zero. * as zero.
*/ */
for (i = 0; i < ARRAY_SIZE(arizona->pdata.gpio_defaults); i++) { for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) {
if (arizona->pdata.gpio_defaults[i] > 0xffff) if (pdata->gpio_defaults[i] > 0xffff)
arizona->pdata.gpio_defaults[i] = 0; pdata->gpio_defaults[i] = 0;
else if (arizona->pdata.gpio_defaults[i] == 0) else if (pdata->gpio_defaults[i] == 0)
arizona->pdata.gpio_defaults[i] = 0x10000; pdata->gpio_defaults[i] = 0x10000;
} }
} else { } else {
dev_err(arizona->dev, "Failed to parse GPIO defaults: %d\n", dev_err(arizona->dev, "Failed to parse GPIO defaults: %d\n",
...@@ -781,20 +797,20 @@ static int arizona_of_get_core_pdata(struct arizona *arizona) ...@@ -781,20 +797,20 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
of_property_for_each_u32(arizona->dev->of_node, "wlf,inmode", prop, of_property_for_each_u32(arizona->dev->of_node, "wlf,inmode", prop,
cur, val) { cur, val) {
if (count == ARRAY_SIZE(arizona->pdata.inmode)) if (count == ARRAY_SIZE(pdata->inmode))
break; break;
arizona->pdata.inmode[count] = val; pdata->inmode[count] = val;
count++; count++;
} }
count = 0; count = 0;
of_property_for_each_u32(arizona->dev->of_node, "wlf,dmic-ref", prop, of_property_for_each_u32(arizona->dev->of_node, "wlf,dmic-ref", prop,
cur, val) { cur, val) {
if (count == ARRAY_SIZE(arizona->pdata.dmic_ref)) if (count == ARRAY_SIZE(pdata->dmic_ref))
break; break;
arizona->pdata.dmic_ref[count] = val; pdata->dmic_ref[count] = val;
count++; count++;
} }
...@@ -806,6 +822,8 @@ const struct of_device_id arizona_of_match[] = { ...@@ -806,6 +822,8 @@ const struct of_device_id arizona_of_match[] = {
{ .compatible = "wlf,wm5110", .data = (void *)WM5110 }, { .compatible = "wlf,wm5110", .data = (void *)WM5110 },
{ .compatible = "wlf,wm8280", .data = (void *)WM8280 }, { .compatible = "wlf,wm8280", .data = (void *)WM8280 },
{ .compatible = "wlf,wm8997", .data = (void *)WM8997 }, { .compatible = "wlf,wm8997", .data = (void *)WM8997 },
{ .compatible = "wlf,wm8998", .data = (void *)WM8998 },
{ .compatible = "wlf,wm1814", .data = (void *)WM1814 },
{}, {},
}; };
EXPORT_SYMBOL_GPL(arizona_of_match); EXPORT_SYMBOL_GPL(arizona_of_match);
...@@ -820,7 +838,7 @@ static const struct mfd_cell early_devs[] = { ...@@ -820,7 +838,7 @@ static const struct mfd_cell early_devs[] = {
{ .name = "arizona-ldo1" }, { .name = "arizona-ldo1" },
}; };
static const char *wm5102_supplies[] = { static const char * const wm5102_supplies[] = {
"MICVDD", "MICVDD",
"DBVDD2", "DBVDD2",
"DBVDD3", "DBVDD3",
...@@ -863,7 +881,7 @@ static const struct mfd_cell wm5110_devs[] = { ...@@ -863,7 +881,7 @@ static const struct mfd_cell wm5110_devs[] = {
}, },
}; };
static const char *wm8997_supplies[] = { static const char * const wm8997_supplies[] = {
"MICVDD", "MICVDD",
"DBVDD2", "DBVDD2",
"CPVDD", "CPVDD",
...@@ -887,11 +905,28 @@ static const struct mfd_cell wm8997_devs[] = { ...@@ -887,11 +905,28 @@ static const struct mfd_cell wm8997_devs[] = {
}, },
}; };
static const struct mfd_cell wm8998_devs[] = {
{
.name = "arizona-extcon",
.parent_supplies = wm5102_supplies,
.num_parent_supplies = 1, /* We only need MICVDD */
},
{ .name = "arizona-gpio" },
{ .name = "arizona-haptics" },
{ .name = "arizona-pwm" },
{
.name = "wm8998-codec",
.parent_supplies = wm5102_supplies,
.num_parent_supplies = ARRAY_SIZE(wm5102_supplies),
},
{ .name = "arizona-micsupp" },
};
int arizona_dev_init(struct arizona *arizona) int arizona_dev_init(struct arizona *arizona)
{ {
struct device *dev = arizona->dev; struct device *dev = arizona->dev;
const char *type_name; const char *type_name;
unsigned int reg, val; unsigned int reg, val, mask;
int (*apply_patch)(struct arizona *) = NULL; int (*apply_patch)(struct arizona *) = NULL;
int ret, i; int ret, i;
...@@ -911,6 +946,8 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -911,6 +946,8 @@ int arizona_dev_init(struct arizona *arizona)
case WM5110: case WM5110:
case WM8280: case WM8280:
case WM8997: case WM8997:
case WM8998:
case WM1814:
for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++) for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++)
arizona->core_supplies[i].supply arizona->core_supplies[i].supply
= wm5102_core_supplies[i]; = wm5102_core_supplies[i];
...@@ -992,6 +1029,7 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -992,6 +1029,7 @@ int arizona_dev_init(struct arizona *arizona)
switch (reg) { switch (reg) {
case 0x5102: case 0x5102:
case 0x5110: case 0x5110:
case 0x6349:
case 0x8997: case 0x8997:
break; break;
default: default:
...@@ -1092,6 +1130,27 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -1092,6 +1130,27 @@ int arizona_dev_init(struct arizona *arizona)
} }
apply_patch = wm8997_patch; apply_patch = wm8997_patch;
break; break;
#endif
#ifdef CONFIG_MFD_WM8998
case 0x6349:
switch (arizona->type) {
case WM8998:
type_name = "WM8998";
break;
case WM1814:
type_name = "WM1814";
break;
default:
type_name = "WM8998";
dev_err(arizona->dev, "WM8998 registered as %d\n",
arizona->type);
arizona->type = WM8998;
}
apply_patch = wm8998_patch;
break;
#endif #endif
default: default:
dev_err(arizona->dev, "Unknown device ID %x\n", reg); dev_err(arizona->dev, "Unknown device ID %x\n", reg);
...@@ -1204,14 +1263,38 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -1204,14 +1263,38 @@ int arizona_dev_init(struct arizona *arizona)
<< ARIZONA_IN1_DMIC_SUP_SHIFT; << ARIZONA_IN1_DMIC_SUP_SHIFT;
if (arizona->pdata.inmode[i] & ARIZONA_INMODE_DMIC) if (arizona->pdata.inmode[i] & ARIZONA_INMODE_DMIC)
val |= 1 << ARIZONA_IN1_MODE_SHIFT; val |= 1 << ARIZONA_IN1_MODE_SHIFT;
if (arizona->pdata.inmode[i] & ARIZONA_INMODE_SE)
val |= 1 << ARIZONA_IN1_SINGLE_ENDED_SHIFT; switch (arizona->type) {
case WM8998:
case WM1814:
regmap_update_bits(arizona->regmap,
ARIZONA_ADC_DIGITAL_VOLUME_1L + (i * 8),
ARIZONA_IN1L_SRC_SE_MASK,
(arizona->pdata.inmode[i] & ARIZONA_INMODE_SE)
<< ARIZONA_IN1L_SRC_SE_SHIFT);
regmap_update_bits(arizona->regmap,
ARIZONA_ADC_DIGITAL_VOLUME_1R + (i * 8),
ARIZONA_IN1R_SRC_SE_MASK,
(arizona->pdata.inmode[i] & ARIZONA_INMODE_SE)
<< ARIZONA_IN1R_SRC_SE_SHIFT);
mask = ARIZONA_IN1_DMIC_SUP_MASK |
ARIZONA_IN1_MODE_MASK;
break;
default:
if (arizona->pdata.inmode[i] & ARIZONA_INMODE_SE)
val |= 1 << ARIZONA_IN1_SINGLE_ENDED_SHIFT;
mask = ARIZONA_IN1_DMIC_SUP_MASK |
ARIZONA_IN1_MODE_MASK |
ARIZONA_IN1_SINGLE_ENDED_MASK;
break;
}
regmap_update_bits(arizona->regmap, regmap_update_bits(arizona->regmap,
ARIZONA_IN1L_CONTROL + (i * 8), ARIZONA_IN1L_CONTROL + (i * 8),
ARIZONA_IN1_DMIC_SUP_MASK | mask, val);
ARIZONA_IN1_MODE_MASK |
ARIZONA_IN1_SINGLE_ENDED_MASK, val);
} }
for (i = 0; i < ARIZONA_MAX_OUTPUT; i++) { for (i = 0; i < ARIZONA_MAX_OUTPUT; i++) {
...@@ -1273,6 +1356,11 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -1273,6 +1356,11 @@ int arizona_dev_init(struct arizona *arizona)
ret = mfd_add_devices(arizona->dev, -1, wm8997_devs, ret = mfd_add_devices(arizona->dev, -1, wm8997_devs,
ARRAY_SIZE(wm8997_devs), NULL, 0, NULL); ARRAY_SIZE(wm8997_devs), NULL, 0, NULL);
break; break;
case WM8998:
case WM1814:
ret = mfd_add_devices(arizona->dev, -1, wm8998_devs,
ARRAY_SIZE(wm8998_devs), NULL, 0, NULL);
break;
} }
if (ret != 0) { if (ret != 0) {
......
...@@ -52,6 +52,12 @@ static int arizona_i2c_probe(struct i2c_client *i2c, ...@@ -52,6 +52,12 @@ static int arizona_i2c_probe(struct i2c_client *i2c,
case WM8997: case WM8997:
regmap_config = &wm8997_i2c_regmap; regmap_config = &wm8997_i2c_regmap;
break; break;
#endif
#ifdef CONFIG_MFD_WM8998
case WM8998:
case WM1814:
regmap_config = &wm8998_i2c_regmap;
break;
#endif #endif
default: default:
dev_err(&i2c->dev, "Unknown device type %ld\n", dev_err(&i2c->dev, "Unknown device type %ld\n",
...@@ -90,6 +96,8 @@ static const struct i2c_device_id arizona_i2c_id[] = { ...@@ -90,6 +96,8 @@ static const struct i2c_device_id arizona_i2c_id[] = {
{ "wm5110", WM5110 }, { "wm5110", WM5110 },
{ "wm8280", WM8280 }, { "wm8280", WM8280 },
{ "wm8997", WM8997 }, { "wm8997", WM8997 },
{ "wm8998", WM8998 },
{ "wm1814", WM1814 },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, arizona_i2c_id); MODULE_DEVICE_TABLE(i2c, arizona_i2c_id);
...@@ -97,7 +105,6 @@ MODULE_DEVICE_TABLE(i2c, arizona_i2c_id); ...@@ -97,7 +105,6 @@ MODULE_DEVICE_TABLE(i2c, arizona_i2c_id);
static struct i2c_driver arizona_i2c_driver = { static struct i2c_driver arizona_i2c_driver = {
.driver = { .driver = {
.name = "arizona", .name = "arizona",
.owner = THIS_MODULE,
.pm = &arizona_pm_ops, .pm = &arizona_pm_ops,
.of_match_table = of_match_ptr(arizona_of_match), .of_match_table = of_match_ptr(arizona_of_match),
}, },
......
...@@ -174,14 +174,7 @@ static int arizona_irq_map(struct irq_domain *h, unsigned int virq, ...@@ -174,14 +174,7 @@ static int arizona_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_data(virq, data); irq_set_chip_data(virq, data);
irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq); irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq);
irq_set_nested_thread(virq, 1); irq_set_nested_thread(virq, 1);
/* ARM needs us to explicitly flag the IRQ as valid
* and will set them noprobe when we do so. */
#ifdef CONFIG_ARM
set_irq_flags(virq, IRQF_VALID);
#else
irq_set_noprobe(virq); irq_set_noprobe(virq);
#endif
return 0; return 0;
} }
...@@ -234,6 +227,15 @@ int arizona_irq_init(struct arizona *arizona) ...@@ -234,6 +227,15 @@ int arizona_irq_init(struct arizona *arizona)
arizona->ctrlif_error = false; arizona->ctrlif_error = false;
break; break;
#endif #endif
#ifdef CONFIG_MFD_WM8998
case WM8998:
case WM1814:
aod = &wm8998_aod;
irq = &wm8998_irq;
arizona->ctrlif_error = false;
break;
#endif
default: default:
BUG_ON("Unknown Arizona class device" == NULL); BUG_ON("Unknown Arizona class device" == NULL);
return -EINVAL; return -EINVAL;
......
...@@ -27,6 +27,8 @@ extern const struct regmap_config wm5110_spi_regmap; ...@@ -27,6 +27,8 @@ extern const struct regmap_config wm5110_spi_regmap;
extern const struct regmap_config wm8997_i2c_regmap; extern const struct regmap_config wm8997_i2c_regmap;
extern const struct regmap_config wm8998_i2c_regmap;
extern const struct dev_pm_ops arizona_pm_ops; extern const struct dev_pm_ops arizona_pm_ops;
extern const struct of_device_id arizona_of_match[]; extern const struct of_device_id arizona_of_match[];
...@@ -41,6 +43,9 @@ extern const struct regmap_irq_chip wm5110_revd_irq; ...@@ -41,6 +43,9 @@ extern const struct regmap_irq_chip wm5110_revd_irq;
extern const struct regmap_irq_chip wm8997_aod; extern const struct regmap_irq_chip wm8997_aod;
extern const struct regmap_irq_chip wm8997_irq; extern const struct regmap_irq_chip wm8997_irq;
extern struct regmap_irq_chip wm8998_aod;
extern struct regmap_irq_chip wm8998_irq;
int arizona_dev_init(struct arizona *arizona); int arizona_dev_init(struct arizona *arizona);
int arizona_dev_exit(struct arizona *arizona); int arizona_dev_exit(struct arizona *arizona);
int arizona_irq_init(struct arizona *arizona); int arizona_irq_init(struct arizona *arizona);
......
...@@ -211,7 +211,6 @@ MODULE_DEVICE_TABLE(i2c, as3711_i2c_id); ...@@ -211,7 +211,6 @@ MODULE_DEVICE_TABLE(i2c, as3711_i2c_id);
static struct i2c_driver as3711_i2c_driver = { static struct i2c_driver as3711_i2c_driver = {
.driver = { .driver = {
.name = "as3711", .name = "as3711",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(as3711_of_match), .of_match_table = of_match_ptr(as3711_of_match),
}, },
.probe = as3711_i2c_probe, .probe = as3711_i2c_probe,
......
...@@ -437,7 +437,6 @@ MODULE_DEVICE_TABLE(i2c, as3722_i2c_id); ...@@ -437,7 +437,6 @@ MODULE_DEVICE_TABLE(i2c, as3722_i2c_id);
static struct i2c_driver as3722_i2c_driver = { static struct i2c_driver as3722_i2c_driver = {
.driver = { .driver = {
.name = "as3722", .name = "as3722",
.owner = THIS_MODULE,
.of_match_table = as3722_of_match, .of_match_table = as3722_of_match,
}, },
.probe = as3722_i2c_probe, .probe = as3722_i2c_probe,
......
...@@ -411,7 +411,7 @@ static int __init asic3_irq_probe(struct platform_device *pdev) ...@@ -411,7 +411,7 @@ static int __init asic3_irq_probe(struct platform_device *pdev)
irq_set_chip_data(irq, asic); irq_set_chip_data(irq, asic);
irq_set_handler(irq, handle_level_irq); irq_set_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
} }
asic3_write_register(asic, ASIC3_OFFSET(INTR, INT_MASK), asic3_write_register(asic, ASIC3_OFFSET(INTR, INT_MASK),
...@@ -431,7 +431,7 @@ static void asic3_irq_remove(struct platform_device *pdev) ...@@ -431,7 +431,7 @@ static void asic3_irq_remove(struct platform_device *pdev)
irq_base = asic->irq_base; irq_base = asic->irq_base;
for (irq = irq_base; irq < irq_base + ASIC3_NR_IRQS; irq++) { for (irq = irq_base; irq < irq_base + ASIC3_NR_IRQS; irq++) {
set_irq_flags(irq, 0); irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
irq_set_chip_and_handler(irq, NULL, NULL); irq_set_chip_and_handler(irq, NULL, NULL);
irq_set_chip_data(irq, NULL); irq_set_chip_data(irq, NULL);
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/iopoll.h>
#include <linux/mfd/atmel-hlcdc.h> #include <linux/mfd/atmel-hlcdc.h>
#include <linux/mfd/core.h> #include <linux/mfd/core.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -26,6 +27,10 @@ ...@@ -26,6 +27,10 @@
#define ATMEL_HLCDC_REG_MAX (0x4000 - 0x4) #define ATMEL_HLCDC_REG_MAX (0x4000 - 0x4)
struct atmel_hlcdc_regmap {
void __iomem *regs;
};
static const struct mfd_cell atmel_hlcdc_cells[] = { static const struct mfd_cell atmel_hlcdc_cells[] = {
{ {
.name = "atmel-hlcdc-pwm", .name = "atmel-hlcdc-pwm",
...@@ -37,28 +42,62 @@ static const struct mfd_cell atmel_hlcdc_cells[] = { ...@@ -37,28 +42,62 @@ static const struct mfd_cell atmel_hlcdc_cells[] = {
}, },
}; };
static int regmap_atmel_hlcdc_reg_write(void *context, unsigned int reg,
unsigned int val)
{
struct atmel_hlcdc_regmap *hregmap = context;
if (reg <= ATMEL_HLCDC_DIS) {
u32 status;
readl_poll_timeout(hregmap->regs + ATMEL_HLCDC_SR, status,
!(status & ATMEL_HLCDC_SIP), 1, 100);
}
writel(val, hregmap->regs + reg);
return 0;
}
static int regmap_atmel_hlcdc_reg_read(void *context, unsigned int reg,
unsigned int *val)
{
struct atmel_hlcdc_regmap *hregmap = context;
*val = readl(hregmap->regs + reg);
return 0;
}
static const struct regmap_config atmel_hlcdc_regmap_config = { static const struct regmap_config atmel_hlcdc_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 32, .val_bits = 32,
.reg_stride = 4, .reg_stride = 4,
.max_register = ATMEL_HLCDC_REG_MAX, .max_register = ATMEL_HLCDC_REG_MAX,
.reg_write = regmap_atmel_hlcdc_reg_write,
.reg_read = regmap_atmel_hlcdc_reg_read,
.fast_io = true,
}; };
static int atmel_hlcdc_probe(struct platform_device *pdev) static int atmel_hlcdc_probe(struct platform_device *pdev)
{ {
struct atmel_hlcdc_regmap *hregmap;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct atmel_hlcdc *hlcdc; struct atmel_hlcdc *hlcdc;
struct resource *res; struct resource *res;
void __iomem *regs;
hregmap = devm_kzalloc(dev, sizeof(*hregmap), GFP_KERNEL);
if (!hregmap)
return -ENOMEM;
hlcdc = devm_kzalloc(dev, sizeof(*hlcdc), GFP_KERNEL); hlcdc = devm_kzalloc(dev, sizeof(*hlcdc), GFP_KERNEL);
if (!hlcdc) if (!hlcdc)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
regs = devm_ioremap_resource(dev, res); hregmap->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(regs)) if (IS_ERR(hregmap->regs))
return PTR_ERR(regs); return PTR_ERR(hregmap->regs);
hlcdc->irq = platform_get_irq(pdev, 0); hlcdc->irq = platform_get_irq(pdev, 0);
if (hlcdc->irq < 0) if (hlcdc->irq < 0)
...@@ -82,8 +121,8 @@ static int atmel_hlcdc_probe(struct platform_device *pdev) ...@@ -82,8 +121,8 @@ static int atmel_hlcdc_probe(struct platform_device *pdev)
return PTR_ERR(hlcdc->slow_clk); return PTR_ERR(hlcdc->slow_clk);
} }
hlcdc->regmap = devm_regmap_init_mmio(dev, regs, hlcdc->regmap = devm_regmap_init(dev, NULL, hregmap,
&atmel_hlcdc_regmap_config); &atmel_hlcdc_regmap_config);
if (IS_ERR(hlcdc->regmap)) if (IS_ERR(hlcdc->regmap))
return PTR_ERR(hlcdc->regmap); return PTR_ERR(hlcdc->regmap);
...@@ -102,7 +141,11 @@ static int atmel_hlcdc_remove(struct platform_device *pdev) ...@@ -102,7 +141,11 @@ static int atmel_hlcdc_remove(struct platform_device *pdev)
} }
static const struct of_device_id atmel_hlcdc_match[] = { static const struct of_device_id atmel_hlcdc_match[] = {
{ .compatible = "atmel,at91sam9n12-hlcdc" },
{ .compatible = "atmel,at91sam9x5-hlcdc" },
{ .compatible = "atmel,sama5d2-hlcdc" },
{ .compatible = "atmel,sama5d3-hlcdc" }, { .compatible = "atmel,sama5d3-hlcdc" },
{ .compatible = "atmel,sama5d4-hlcdc" },
{ /* sentinel */ }, { /* sentinel */ },
}; };
......
...@@ -30,19 +30,47 @@ ...@@ -30,19 +30,47 @@
#define AXP20X_OFF 0x80 #define AXP20X_OFF 0x80
static const char * const axp20x_model_names[] = { static const char * const axp20x_model_names[] = {
"AXP152",
"AXP202", "AXP202",
"AXP209", "AXP209",
"AXP221", "AXP221",
"AXP288", "AXP288",
}; };
static const struct regmap_range axp152_writeable_ranges[] = {
regmap_reg_range(AXP152_LDO3456_DC1234_CTRL, AXP152_IRQ3_STATE),
regmap_reg_range(AXP152_DCDC_MODE, AXP152_PWM1_DUTY_CYCLE),
};
static const struct regmap_range axp152_volatile_ranges[] = {
regmap_reg_range(AXP152_PWR_OP_MODE, AXP152_PWR_OP_MODE),
regmap_reg_range(AXP152_IRQ1_EN, AXP152_IRQ3_STATE),
regmap_reg_range(AXP152_GPIO_INPUT, AXP152_GPIO_INPUT),
};
static const struct regmap_access_table axp152_writeable_table = {
.yes_ranges = axp152_writeable_ranges,
.n_yes_ranges = ARRAY_SIZE(axp152_writeable_ranges),
};
static const struct regmap_access_table axp152_volatile_table = {
.yes_ranges = axp152_volatile_ranges,
.n_yes_ranges = ARRAY_SIZE(axp152_volatile_ranges),
};
static const struct regmap_range axp20x_writeable_ranges[] = { static const struct regmap_range axp20x_writeable_ranges[] = {
regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ5_STATE), regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ5_STATE),
regmap_reg_range(AXP20X_DCDC_MODE, AXP20X_FG_RES), regmap_reg_range(AXP20X_DCDC_MODE, AXP20X_FG_RES),
regmap_reg_range(AXP20X_RDC_H, AXP20X_OCV(AXP20X_OCV_MAX)),
}; };
static const struct regmap_range axp20x_volatile_ranges[] = { static const struct regmap_range axp20x_volatile_ranges[] = {
regmap_reg_range(AXP20X_PWR_INPUT_STATUS, AXP20X_USB_OTG_STATUS),
regmap_reg_range(AXP20X_CHRG_CTRL1, AXP20X_CHRG_CTRL2),
regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IRQ5_STATE), regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IRQ5_STATE),
regmap_reg_range(AXP20X_ACIN_V_ADC_H, AXP20X_IPSOUT_V_HIGH_L),
regmap_reg_range(AXP20X_GPIO20_SS, AXP20X_GPIO3_CTRL),
regmap_reg_range(AXP20X_FG_RES, AXP20X_RDC_L),
}; };
static const struct regmap_access_table axp20x_writeable_table = { static const struct regmap_access_table axp20x_writeable_table = {
...@@ -93,6 +121,11 @@ static const struct regmap_access_table axp288_volatile_table = { ...@@ -93,6 +121,11 @@ static const struct regmap_access_table axp288_volatile_table = {
.n_yes_ranges = ARRAY_SIZE(axp288_volatile_ranges), .n_yes_ranges = ARRAY_SIZE(axp288_volatile_ranges),
}; };
static struct resource axp152_pek_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP152_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
DEFINE_RES_IRQ_NAMED(AXP152_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
};
static struct resource axp20x_pek_resources[] = { static struct resource axp20x_pek_resources[] = {
{ {
.name = "PEK_DBR", .name = "PEK_DBR",
...@@ -107,6 +140,13 @@ static struct resource axp20x_pek_resources[] = { ...@@ -107,6 +140,13 @@ static struct resource axp20x_pek_resources[] = {
}, },
}; };
static struct resource axp20x_usb_power_supply_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_PLUGIN, "VBUS_PLUGIN"),
DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"),
DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_VALID, "VBUS_VALID"),
DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_NOT_VALID, "VBUS_NOT_VALID"),
};
static struct resource axp22x_pek_resources[] = { static struct resource axp22x_pek_resources[] = {
{ {
.name = "PEK_DBR", .name = "PEK_DBR",
...@@ -154,12 +194,21 @@ static struct resource axp288_fuel_gauge_resources[] = { ...@@ -154,12 +194,21 @@ static struct resource axp288_fuel_gauge_resources[] = {
}, },
}; };
static const struct regmap_config axp152_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.wr_table = &axp152_writeable_table,
.volatile_table = &axp152_volatile_table,
.max_register = AXP152_PWM1_DUTY_CYCLE,
.cache_type = REGCACHE_RBTREE,
};
static const struct regmap_config axp20x_regmap_config = { static const struct regmap_config axp20x_regmap_config = {
.reg_bits = 8, .reg_bits = 8,
.val_bits = 8, .val_bits = 8,
.wr_table = &axp20x_writeable_table, .wr_table = &axp20x_writeable_table,
.volatile_table = &axp20x_volatile_table, .volatile_table = &axp20x_volatile_table,
.max_register = AXP20X_FG_RES, .max_register = AXP20X_OCV(AXP20X_OCV_MAX),
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_RBTREE,
}; };
...@@ -184,6 +233,26 @@ static const struct regmap_config axp288_regmap_config = { ...@@ -184,6 +233,26 @@ static const struct regmap_config axp288_regmap_config = {
#define INIT_REGMAP_IRQ(_variant, _irq, _off, _mask) \ #define INIT_REGMAP_IRQ(_variant, _irq, _off, _mask) \
[_variant##_IRQ_##_irq] = { .reg_offset = (_off), .mask = BIT(_mask) } [_variant##_IRQ_##_irq] = { .reg_offset = (_off), .mask = BIT(_mask) }
static const struct regmap_irq axp152_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP152, LDO0IN_CONNECT, 0, 6),
INIT_REGMAP_IRQ(AXP152, LDO0IN_REMOVAL, 0, 5),
INIT_REGMAP_IRQ(AXP152, ALDO0IN_CONNECT, 0, 3),
INIT_REGMAP_IRQ(AXP152, ALDO0IN_REMOVAL, 0, 2),
INIT_REGMAP_IRQ(AXP152, DCDC1_V_LOW, 1, 5),
INIT_REGMAP_IRQ(AXP152, DCDC2_V_LOW, 1, 4),
INIT_REGMAP_IRQ(AXP152, DCDC3_V_LOW, 1, 3),
INIT_REGMAP_IRQ(AXP152, DCDC4_V_LOW, 1, 2),
INIT_REGMAP_IRQ(AXP152, PEK_SHORT, 1, 1),
INIT_REGMAP_IRQ(AXP152, PEK_LONG, 1, 0),
INIT_REGMAP_IRQ(AXP152, TIMER, 2, 7),
INIT_REGMAP_IRQ(AXP152, PEK_RIS_EDGE, 2, 6),
INIT_REGMAP_IRQ(AXP152, PEK_FAL_EDGE, 2, 5),
INIT_REGMAP_IRQ(AXP152, GPIO3_INPUT, 2, 3),
INIT_REGMAP_IRQ(AXP152, GPIO2_INPUT, 2, 2),
INIT_REGMAP_IRQ(AXP152, GPIO1_INPUT, 2, 1),
INIT_REGMAP_IRQ(AXP152, GPIO0_INPUT, 2, 0),
};
static const struct regmap_irq axp20x_regmap_irqs[] = { static const struct regmap_irq axp20x_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP20X, ACIN_OVER_V, 0, 7), INIT_REGMAP_IRQ(AXP20X, ACIN_OVER_V, 0, 7),
INIT_REGMAP_IRQ(AXP20X, ACIN_PLUGIN, 0, 6), INIT_REGMAP_IRQ(AXP20X, ACIN_PLUGIN, 0, 6),
...@@ -293,6 +362,7 @@ static const struct regmap_irq axp288_regmap_irqs[] = { ...@@ -293,6 +362,7 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
}; };
static const struct of_device_id axp20x_of_match[] = { static const struct of_device_id axp20x_of_match[] = {
{ .compatible = "x-powers,axp152", .data = (void *) AXP152_ID },
{ .compatible = "x-powers,axp202", .data = (void *) AXP202_ID }, { .compatible = "x-powers,axp202", .data = (void *) AXP202_ID },
{ .compatible = "x-powers,axp209", .data = (void *) AXP209_ID }, { .compatible = "x-powers,axp209", .data = (void *) AXP209_ID },
{ .compatible = "x-powers,axp221", .data = (void *) AXP221_ID }, { .compatible = "x-powers,axp221", .data = (void *) AXP221_ID },
...@@ -317,6 +387,18 @@ static const struct acpi_device_id axp20x_acpi_match[] = { ...@@ -317,6 +387,18 @@ static const struct acpi_device_id axp20x_acpi_match[] = {
}; };
MODULE_DEVICE_TABLE(acpi, axp20x_acpi_match); MODULE_DEVICE_TABLE(acpi, axp20x_acpi_match);
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,
.init_ack_masked = true,
.irqs = axp152_regmap_irqs,
.num_irqs = ARRAY_SIZE(axp152_regmap_irqs),
.num_regs = 3,
};
static const struct regmap_irq_chip axp20x_regmap_irq_chip = { static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
.name = "axp20x_irq_chip", .name = "axp20x_irq_chip",
.status_base = AXP20X_IRQ1_STATE, .status_base = AXP20X_IRQ1_STATE,
...@@ -357,11 +439,16 @@ static const struct regmap_irq_chip axp288_regmap_irq_chip = { ...@@ -357,11 +439,16 @@ static const struct regmap_irq_chip axp288_regmap_irq_chip = {
static struct mfd_cell axp20x_cells[] = { static struct mfd_cell axp20x_cells[] = {
{ {
.name = "axp20x-pek", .name = "axp20x-pek",
.num_resources = ARRAY_SIZE(axp20x_pek_resources), .num_resources = ARRAY_SIZE(axp20x_pek_resources),
.resources = axp20x_pek_resources, .resources = axp20x_pek_resources,
}, { }, {
.name = "axp20x-regulator", .name = "axp20x-regulator",
}, {
.name = "axp20x-usb-power-supply",
.of_compatible = "x-powers,axp202-usb-power-supply",
.num_resources = ARRAY_SIZE(axp20x_usb_power_supply_resources),
.resources = axp20x_usb_power_supply_resources,
}, },
}; };
...@@ -375,6 +462,14 @@ static struct mfd_cell axp22x_cells[] = { ...@@ -375,6 +462,14 @@ static struct mfd_cell axp22x_cells[] = {
}, },
}; };
static struct mfd_cell axp152_cells[] = {
{
.name = "axp20x-pek",
.num_resources = ARRAY_SIZE(axp152_pek_resources),
.resources = axp152_pek_resources,
},
};
static struct resource axp288_adc_resources[] = { static struct resource axp288_adc_resources[] = {
{ {
.name = "GPADC", .name = "GPADC",
...@@ -513,6 +608,12 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev) ...@@ -513,6 +608,12 @@ static int axp20x_match_device(struct axp20x_dev *axp20x, struct device *dev)
} }
switch (axp20x->variant) { switch (axp20x->variant) {
case AXP152_ID:
axp20x->nr_cells = ARRAY_SIZE(axp152_cells);
axp20x->cells = axp152_cells;
axp20x->regmap_cfg = &axp152_regmap_config;
axp20x->regmap_irq_chip = &axp152_regmap_irq_chip;
break;
case AXP202_ID: case AXP202_ID:
case AXP209_ID: case AXP209_ID:
axp20x->nr_cells = ARRAY_SIZE(axp20x_cells); axp20x->nr_cells = ARRAY_SIZE(axp20x_cells);
...@@ -613,7 +714,6 @@ static int axp20x_i2c_remove(struct i2c_client *i2c) ...@@ -613,7 +714,6 @@ static int axp20x_i2c_remove(struct i2c_client *i2c)
static struct i2c_driver axp20x_i2c_driver = { static struct i2c_driver axp20x_i2c_driver = {
.driver = { .driver = {
.name = "axp20x", .name = "axp20x",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(axp20x_of_match), .of_match_table = of_match_ptr(axp20x_of_match),
.acpi_match_table = ACPI_PTR(axp20x_acpi_match), .acpi_match_table = ACPI_PTR(axp20x_acpi_match),
}, },
......
...@@ -117,7 +117,6 @@ MODULE_DEVICE_TABLE(i2c, bcm590xx_i2c_id); ...@@ -117,7 +117,6 @@ MODULE_DEVICE_TABLE(i2c, bcm590xx_i2c_id);
static struct i2c_driver bcm590xx_i2c_driver = { static struct i2c_driver bcm590xx_i2c_driver = {
.driver = { .driver = {
.name = "bcm590xx", .name = "bcm590xx",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(bcm590xx_of_match), .of_match_table = of_match_ptr(bcm590xx_of_match),
}, },
.probe = bcm590xx_i2c_probe, .probe = bcm590xx_i2c_probe,
......
...@@ -353,7 +353,6 @@ MODULE_DEVICE_TABLE(i2c, cros_ec_i2c_id); ...@@ -353,7 +353,6 @@ MODULE_DEVICE_TABLE(i2c, cros_ec_i2c_id);
static struct i2c_driver cros_ec_driver = { static struct i2c_driver cros_ec_driver = {
.driver = { .driver = {
.name = "cros-ec-i2c", .name = "cros-ec-i2c",
.owner = THIS_MODULE,
.pm = &cros_ec_i2c_pm_ops, .pm = &cros_ec_i2c_pm_ops,
}, },
.probe = cros_ec_i2c_probe, .probe = cros_ec_i2c_probe,
......
...@@ -701,6 +701,12 @@ static int cros_ec_spi_resume(struct device *dev) ...@@ -701,6 +701,12 @@ static int cros_ec_spi_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(cros_ec_spi_pm_ops, cros_ec_spi_suspend, static SIMPLE_DEV_PM_OPS(cros_ec_spi_pm_ops, cros_ec_spi_suspend,
cros_ec_spi_resume); cros_ec_spi_resume);
static const struct of_device_id cros_ec_spi_of_match[] = {
{ .compatible = "google,cros-ec-spi", },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, cros_ec_spi_of_match);
static const struct spi_device_id cros_ec_spi_id[] = { static const struct spi_device_id cros_ec_spi_id[] = {
{ "cros-ec-spi", 0 }, { "cros-ec-spi", 0 },
{ } { }
...@@ -710,6 +716,7 @@ MODULE_DEVICE_TABLE(spi, cros_ec_spi_id); ...@@ -710,6 +716,7 @@ MODULE_DEVICE_TABLE(spi, cros_ec_spi_id);
static struct spi_driver cros_ec_driver_spi = { static struct spi_driver cros_ec_driver_spi = {
.driver = { .driver = {
.name = "cros-ec-spi", .name = "cros-ec-spi",
.of_match_table = of_match_ptr(cros_ec_spi_of_match),
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &cros_ec_spi_pm_ops, .pm = &cros_ec_spi_pm_ops,
}, },
......
...@@ -550,7 +550,6 @@ static int da903x_remove(struct i2c_client *client) ...@@ -550,7 +550,6 @@ static int da903x_remove(struct i2c_client *client)
static struct i2c_driver da903x_driver = { static struct i2c_driver da903x_driver = {
.driver = { .driver = {
.name = "da903x", .name = "da903x",
.owner = THIS_MODULE,
}, },
.probe = da903x_probe, .probe = da903x_probe,
.remove = da903x_remove, .remove = da903x_remove,
......
...@@ -195,7 +195,6 @@ static struct i2c_driver da9052_i2c_driver = { ...@@ -195,7 +195,6 @@ static struct i2c_driver da9052_i2c_driver = {
.id_table = da9052_i2c_id, .id_table = da9052_i2c_id,
.driver = { .driver = {
.name = "da9052", .name = "da9052",
.owner = THIS_MODULE,
#ifdef CONFIG_OF #ifdef CONFIG_OF
.of_match_table = dialog_dt_ids, .of_match_table = dialog_dt_ids,
#endif #endif
......
...@@ -79,7 +79,6 @@ static struct i2c_driver da9055_i2c_driver = { ...@@ -79,7 +79,6 @@ static struct i2c_driver da9055_i2c_driver = {
.id_table = da9055_i2c_id, .id_table = da9055_i2c_id,
.driver = { .driver = {
.name = "da9055-pmic", .name = "da9055-pmic",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(da9055_of_match), .of_match_table = of_match_ptr(da9055_of_match),
}, },
}; };
......
/*
* Core, IRQ and I2C device driver for DA9062 PMIC
* Copyright (C) 2015 Dialog Semiconductor Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/regmap.h>
#include <linux/irq.h>
#include <linux/mfd/core.h>
#include <linux/i2c.h>
#include <linux/mfd/da9062/core.h>
#include <linux/mfd/da9062/registers.h>
#include <linux/regulator/of_regulator.h>
#define DA9062_REG_EVENT_A_OFFSET 0
#define DA9062_REG_EVENT_B_OFFSET 1
#define DA9062_REG_EVENT_C_OFFSET 2
static struct regmap_irq da9062_irqs[] = {
/* EVENT A */
[DA9062_IRQ_ONKEY] = {
.reg_offset = DA9062_REG_EVENT_A_OFFSET,
.mask = DA9062AA_M_NONKEY_MASK,
},
[DA9062_IRQ_ALARM] = {
.reg_offset = DA9062_REG_EVENT_A_OFFSET,
.mask = DA9062AA_M_ALARM_MASK,
},
[DA9062_IRQ_TICK] = {
.reg_offset = DA9062_REG_EVENT_A_OFFSET,
.mask = DA9062AA_M_TICK_MASK,
},
[DA9062_IRQ_WDG_WARN] = {
.reg_offset = DA9062_REG_EVENT_A_OFFSET,
.mask = DA9062AA_M_WDG_WARN_MASK,
},
[DA9062_IRQ_SEQ_RDY] = {
.reg_offset = DA9062_REG_EVENT_A_OFFSET,
.mask = DA9062AA_M_SEQ_RDY_MASK,
},
/* EVENT B */
[DA9062_IRQ_TEMP] = {
.reg_offset = DA9062_REG_EVENT_B_OFFSET,
.mask = DA9062AA_M_TEMP_MASK,
},
[DA9062_IRQ_LDO_LIM] = {
.reg_offset = DA9062_REG_EVENT_B_OFFSET,
.mask = DA9062AA_M_LDO_LIM_MASK,
},
[DA9062_IRQ_DVC_RDY] = {
.reg_offset = DA9062_REG_EVENT_B_OFFSET,
.mask = DA9062AA_M_DVC_RDY_MASK,
},
[DA9062_IRQ_VDD_WARN] = {
.reg_offset = DA9062_REG_EVENT_B_OFFSET,
.mask = DA9062AA_M_VDD_WARN_MASK,
},
/* EVENT C */
[DA9062_IRQ_GPI0] = {
.reg_offset = DA9062_REG_EVENT_C_OFFSET,
.mask = DA9062AA_M_GPI0_MASK,
},
[DA9062_IRQ_GPI1] = {
.reg_offset = DA9062_REG_EVENT_C_OFFSET,
.mask = DA9062AA_M_GPI1_MASK,
},
[DA9062_IRQ_GPI2] = {
.reg_offset = DA9062_REG_EVENT_C_OFFSET,
.mask = DA9062AA_M_GPI2_MASK,
},
[DA9062_IRQ_GPI3] = {
.reg_offset = DA9062_REG_EVENT_C_OFFSET,
.mask = DA9062AA_M_GPI3_MASK,
},
[DA9062_IRQ_GPI4] = {
.reg_offset = DA9062_REG_EVENT_C_OFFSET,
.mask = DA9062AA_M_GPI4_MASK,
},
};
static struct regmap_irq_chip da9062_irq_chip = {
.name = "da9062-irq",
.irqs = da9062_irqs,
.num_irqs = DA9062_NUM_IRQ,
.num_regs = 3,
.status_base = DA9062AA_EVENT_A,
.mask_base = DA9062AA_IRQ_MASK_A,
.ack_base = DA9062AA_EVENT_A,
};
static struct resource da9062_core_resources[] = {
DEFINE_RES_NAMED(DA9062_IRQ_VDD_WARN, 1, "VDD_WARN", IORESOURCE_IRQ),
};
static struct resource da9062_regulators_resources[] = {
DEFINE_RES_NAMED(DA9062_IRQ_LDO_LIM, 1, "LDO_LIM", IORESOURCE_IRQ),
};
static struct resource da9062_thermal_resources[] = {
DEFINE_RES_NAMED(DA9062_IRQ_TEMP, 1, "THERMAL", IORESOURCE_IRQ),
};
static struct resource da9062_wdt_resources[] = {
DEFINE_RES_NAMED(DA9062_IRQ_WDG_WARN, 1, "WD_WARN", IORESOURCE_IRQ),
};
static struct resource da9062_rtc_resources[] = {
DEFINE_RES_NAMED(DA9062_IRQ_ALARM, 1, "ALARM", IORESOURCE_IRQ),
DEFINE_RES_NAMED(DA9062_IRQ_TICK, 1, "TICK", IORESOURCE_IRQ),
};
static struct resource da9062_onkey_resources[] = {
DEFINE_RES_NAMED(DA9062_IRQ_ONKEY, 1, "ONKEY", IORESOURCE_IRQ),
};
static const struct mfd_cell da9062_devs[] = {
{
.name = "da9062-core",
.num_resources = ARRAY_SIZE(da9062_core_resources),
.resources = da9062_core_resources,
},
{
.name = "da9062-regulators",
.num_resources = ARRAY_SIZE(da9062_regulators_resources),
.resources = da9062_regulators_resources,
},
{
.name = "da9062-watchdog",
.num_resources = ARRAY_SIZE(da9062_wdt_resources),
.resources = da9062_wdt_resources,
.of_compatible = "dlg,da9062-wdt",
},
{
.name = "da9062-thermal",
.num_resources = ARRAY_SIZE(da9062_thermal_resources),
.resources = da9062_thermal_resources,
.of_compatible = "dlg,da9062-thermal",
},
{
.name = "da9062-rtc",
.num_resources = ARRAY_SIZE(da9062_rtc_resources),
.resources = da9062_rtc_resources,
.of_compatible = "dlg,da9062-rtc",
},
{
.name = "da9062-onkey",
.num_resources = ARRAY_SIZE(da9062_onkey_resources),
.resources = da9062_onkey_resources,
.of_compatible = "dlg,da9062-onkey",
},
};
static int da9062_clear_fault_log(struct da9062 *chip)
{
int ret;
int fault_log;
ret = regmap_read(chip->regmap, DA9062AA_FAULT_LOG, &fault_log);
if (ret < 0)
return ret;
if (fault_log) {
if (fault_log & DA9062AA_TWD_ERROR_MASK)
dev_dbg(chip->dev, "Fault log entry detected: TWD_ERROR\n");
if (fault_log & DA9062AA_POR_MASK)
dev_dbg(chip->dev, "Fault log entry detected: POR\n");
if (fault_log & DA9062AA_VDD_FAULT_MASK)
dev_dbg(chip->dev, "Fault log entry detected: VDD_FAULT\n");
if (fault_log & DA9062AA_VDD_START_MASK)
dev_dbg(chip->dev, "Fault log entry detected: VDD_START\n");
if (fault_log & DA9062AA_TEMP_CRIT_MASK)
dev_dbg(chip->dev, "Fault log entry detected: TEMP_CRIT\n");
if (fault_log & DA9062AA_KEY_RESET_MASK)
dev_dbg(chip->dev, "Fault log entry detected: KEY_RESET\n");
if (fault_log & DA9062AA_NSHUTDOWN_MASK)
dev_dbg(chip->dev, "Fault log entry detected: NSHUTDOWN\n");
if (fault_log & DA9062AA_WAIT_SHUT_MASK)
dev_dbg(chip->dev, "Fault log entry detected: WAIT_SHUT\n");
ret = regmap_write(chip->regmap, DA9062AA_FAULT_LOG,
fault_log);
}
return ret;
}
int get_device_type(struct da9062 *chip)
{
int device_id, variant_id, variant_mrc;
int ret;
ret = regmap_read(chip->regmap, DA9062AA_DEVICE_ID, &device_id);
if (ret < 0) {
dev_err(chip->dev, "Cannot read chip ID.\n");
return -EIO;
}
if (device_id != DA9062_PMIC_DEVICE_ID) {
dev_err(chip->dev, "Invalid device ID: 0x%02x\n", device_id);
return -ENODEV;
}
ret = regmap_read(chip->regmap, DA9062AA_VARIANT_ID, &variant_id);
if (ret < 0) {
dev_err(chip->dev, "Cannot read chip variant id.\n");
return -EIO;
}
dev_info(chip->dev,
"Device detected (device-ID: 0x%02X, var-ID: 0x%02X)\n",
device_id, variant_id);
variant_mrc = (variant_id & DA9062AA_MRC_MASK) >> DA9062AA_MRC_SHIFT;
if (variant_mrc < DA9062_PMIC_VARIANT_MRC_AA) {
dev_err(chip->dev,
"Cannot support variant MRC: 0x%02X\n", variant_mrc);
return -ENODEV;
}
return ret;
}
static const struct regmap_range da9062_aa_readable_ranges[] = {
{
.range_min = DA9062AA_PAGE_CON,
.range_max = DA9062AA_STATUS_B,
}, {
.range_min = DA9062AA_STATUS_D,
.range_max = DA9062AA_EVENT_C,
}, {
.range_min = DA9062AA_IRQ_MASK_A,
.range_max = DA9062AA_IRQ_MASK_C,
}, {
.range_min = DA9062AA_CONTROL_A,
.range_max = DA9062AA_GPIO_4,
}, {
.range_min = DA9062AA_GPIO_WKUP_MODE,
.range_max = DA9062AA_BUCK4_CONT,
}, {
.range_min = DA9062AA_BUCK3_CONT,
.range_max = DA9062AA_BUCK3_CONT,
}, {
.range_min = DA9062AA_LDO1_CONT,
.range_max = DA9062AA_LDO4_CONT,
}, {
.range_min = DA9062AA_DVC_1,
.range_max = DA9062AA_DVC_1,
}, {
.range_min = DA9062AA_COUNT_S,
.range_max = DA9062AA_SECOND_D,
}, {
.range_min = DA9062AA_SEQ,
.range_max = DA9062AA_ID_4_3,
}, {
.range_min = DA9062AA_ID_12_11,
.range_max = DA9062AA_ID_16_15,
}, {
.range_min = DA9062AA_ID_22_21,
.range_max = DA9062AA_ID_32_31,
}, {
.range_min = DA9062AA_SEQ_A,
.range_max = DA9062AA_BUCK3_CFG,
}, {
.range_min = DA9062AA_VBUCK2_A,
.range_max = DA9062AA_VBUCK4_A,
}, {
.range_min = DA9062AA_VBUCK3_A,
.range_max = DA9062AA_VBUCK3_A,
}, {
.range_min = DA9062AA_VLDO1_A,
.range_max = DA9062AA_VLDO4_A,
}, {
.range_min = DA9062AA_VBUCK2_B,
.range_max = DA9062AA_VBUCK4_B,
}, {
.range_min = DA9062AA_VBUCK3_B,
.range_max = DA9062AA_VBUCK3_B,
}, {
.range_min = DA9062AA_VLDO1_B,
.range_max = DA9062AA_VLDO4_B,
}, {
.range_min = DA9062AA_BBAT_CONT,
.range_max = DA9062AA_BBAT_CONT,
}, {
.range_min = DA9062AA_INTERFACE,
.range_max = DA9062AA_CONFIG_E,
}, {
.range_min = DA9062AA_CONFIG_G,
.range_max = DA9062AA_CONFIG_K,
}, {
.range_min = DA9062AA_CONFIG_M,
.range_max = DA9062AA_CONFIG_M,
}, {
.range_min = DA9062AA_TRIM_CLDR,
.range_max = DA9062AA_GP_ID_19,
}, {
.range_min = DA9062AA_DEVICE_ID,
.range_max = DA9062AA_CONFIG_ID,
},
};
static const struct regmap_range da9062_aa_writeable_ranges[] = {
{
.range_min = DA9062AA_PAGE_CON,
.range_max = DA9062AA_PAGE_CON,
}, {
.range_min = DA9062AA_FAULT_LOG,
.range_max = DA9062AA_EVENT_C,
}, {
.range_min = DA9062AA_IRQ_MASK_A,
.range_max = DA9062AA_IRQ_MASK_C,
}, {
.range_min = DA9062AA_CONTROL_A,
.range_max = DA9062AA_GPIO_4,
}, {
.range_min = DA9062AA_GPIO_WKUP_MODE,
.range_max = DA9062AA_BUCK4_CONT,
}, {
.range_min = DA9062AA_BUCK3_CONT,
.range_max = DA9062AA_BUCK3_CONT,
}, {
.range_min = DA9062AA_LDO1_CONT,
.range_max = DA9062AA_LDO4_CONT,
}, {
.range_min = DA9062AA_DVC_1,
.range_max = DA9062AA_DVC_1,
}, {
.range_min = DA9062AA_COUNT_S,
.range_max = DA9062AA_ALARM_Y,
}, {
.range_min = DA9062AA_SEQ,
.range_max = DA9062AA_ID_4_3,
}, {
.range_min = DA9062AA_ID_12_11,
.range_max = DA9062AA_ID_16_15,
}, {
.range_min = DA9062AA_ID_22_21,
.range_max = DA9062AA_ID_32_31,
}, {
.range_min = DA9062AA_SEQ_A,
.range_max = DA9062AA_BUCK3_CFG,
}, {
.range_min = DA9062AA_VBUCK2_A,
.range_max = DA9062AA_VBUCK4_A,
}, {
.range_min = DA9062AA_VBUCK3_A,
.range_max = DA9062AA_VBUCK3_A,
}, {
.range_min = DA9062AA_VLDO1_A,
.range_max = DA9062AA_VLDO4_A,
}, {
.range_min = DA9062AA_VBUCK2_B,
.range_max = DA9062AA_VBUCK4_B,
}, {
.range_min = DA9062AA_VBUCK3_B,
.range_max = DA9062AA_VBUCK3_B,
}, {
.range_min = DA9062AA_VLDO1_B,
.range_max = DA9062AA_VLDO4_B,
}, {
.range_min = DA9062AA_BBAT_CONT,
.range_max = DA9062AA_BBAT_CONT,
}, {
.range_min = DA9062AA_GP_ID_0,
.range_max = DA9062AA_GP_ID_19,
},
};
static const struct regmap_range da9062_aa_volatile_ranges[] = {
{
.range_min = DA9062AA_PAGE_CON,
.range_max = DA9062AA_STATUS_B,
}, {
.range_min = DA9062AA_STATUS_D,
.range_max = DA9062AA_EVENT_C,
}, {
.range_min = DA9062AA_CONTROL_F,
.range_max = DA9062AA_CONTROL_F,
}, {
.range_min = DA9062AA_COUNT_S,
.range_max = DA9062AA_SECOND_D,
},
};
static const struct regmap_access_table da9062_aa_readable_table = {
.yes_ranges = da9062_aa_readable_ranges,
.n_yes_ranges = ARRAY_SIZE(da9062_aa_readable_ranges),
};
static const struct regmap_access_table da9062_aa_writeable_table = {
.yes_ranges = da9062_aa_writeable_ranges,
.n_yes_ranges = ARRAY_SIZE(da9062_aa_writeable_ranges),
};
static const struct regmap_access_table da9062_aa_volatile_table = {
.yes_ranges = da9062_aa_volatile_ranges,
.n_yes_ranges = ARRAY_SIZE(da9062_aa_volatile_ranges),
};
static const struct regmap_range_cfg da9062_range_cfg[] = {
{
.range_min = DA9062AA_PAGE_CON,
.range_max = DA9062AA_CONFIG_ID,
.selector_reg = DA9062AA_PAGE_CON,
.selector_mask = 1 << DA9062_I2C_PAGE_SEL_SHIFT,
.selector_shift = DA9062_I2C_PAGE_SEL_SHIFT,
.window_start = 0,
.window_len = 256,
}
};
static struct regmap_config da9062_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.ranges = da9062_range_cfg,
.num_ranges = ARRAY_SIZE(da9062_range_cfg),
.max_register = DA9062AA_CONFIG_ID,
.cache_type = REGCACHE_RBTREE,
.rd_table = &da9062_aa_readable_table,
.wr_table = &da9062_aa_writeable_table,
.volatile_table = &da9062_aa_volatile_table,
};
static int da9062_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
struct da9062 *chip;
unsigned int irq_base;
int ret;
chip = devm_kzalloc(&i2c->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
i2c_set_clientdata(i2c, chip);
chip->dev = &i2c->dev;
if (!i2c->irq) {
dev_err(chip->dev, "No IRQ configured\n");
return -EINVAL;
}
chip->regmap = devm_regmap_init_i2c(i2c, &da9062_regmap_config);
if (IS_ERR(chip->regmap)) {
ret = PTR_ERR(chip->regmap);
dev_err(chip->dev, "Failed to allocate register map: %d\n",
ret);
return ret;
}
ret = da9062_clear_fault_log(chip);
if (ret < 0)
dev_warn(chip->dev, "Cannot clear fault log\n");
ret = get_device_type(chip);
if (ret)
return ret;
ret = regmap_add_irq_chip(chip->regmap, i2c->irq,
IRQF_TRIGGER_LOW | IRQF_ONESHOT | IRQF_SHARED,
-1, &da9062_irq_chip,
&chip->regmap_irq);
if (ret) {
dev_err(chip->dev, "Failed to request IRQ %d: %d\n",
i2c->irq, ret);
return ret;
}
irq_base = regmap_irq_chip_get_base(chip->regmap_irq);
ret = mfd_add_devices(chip->dev, PLATFORM_DEVID_NONE, da9062_devs,
ARRAY_SIZE(da9062_devs), NULL, irq_base,
NULL);
if (ret) {
dev_err(chip->dev, "Cannot register child devices\n");
regmap_del_irq_chip(i2c->irq, chip->regmap_irq);
return ret;
}
return ret;
}
static int da9062_i2c_remove(struct i2c_client *i2c)
{
struct da9062 *chip = i2c_get_clientdata(i2c);
mfd_remove_devices(chip->dev);
regmap_del_irq_chip(i2c->irq, chip->regmap_irq);
return 0;
}
static const struct i2c_device_id da9062_i2c_id[] = {
{ "da9062", 0 },
{ },
};
MODULE_DEVICE_TABLE(i2c, da9062_i2c_id);
static const struct of_device_id da9062_dt_ids[] = {
{ .compatible = "dlg,da9062", },
{ }
};
MODULE_DEVICE_TABLE(of, da9062_dt_ids);
static struct i2c_driver da9062_i2c_driver = {
.driver = {
.name = "da9062",
.of_match_table = of_match_ptr(da9062_dt_ids),
},
.probe = da9062_i2c_probe,
.remove = da9062_i2c_remove,
.id_table = da9062_i2c_id,
};
module_i2c_driver(da9062_i2c_driver);
MODULE_DESCRIPTION("Core device driver for Dialog DA9062");
MODULE_AUTHOR("Steve Twiss <stwiss.opensource@diasemi.com>");
MODULE_LICENSE("GPL");
...@@ -264,7 +264,6 @@ MODULE_DEVICE_TABLE(i2c, da9063_i2c_id); ...@@ -264,7 +264,6 @@ MODULE_DEVICE_TABLE(i2c, da9063_i2c_id);
static struct i2c_driver da9063_i2c_driver = { static struct i2c_driver da9063_i2c_driver = {
.driver = { .driver = {
.name = "da9063", .name = "da9063",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(da9063_dt_ids), .of_match_table = of_match_ptr(da9063_dt_ids),
}, },
.probe = da9063_i2c_probe, .probe = da9063_i2c_probe,
......
...@@ -77,6 +77,10 @@ static const struct regmap_irq da9063_irqs[] = { ...@@ -77,6 +77,10 @@ static const struct regmap_irq da9063_irqs[] = {
.reg_offset = DA9063_REG_EVENT_B_OFFSET, .reg_offset = DA9063_REG_EVENT_B_OFFSET,
.mask = DA9063_M_UVOV, .mask = DA9063_M_UVOV,
}, },
[DA9063_IRQ_DVC_RDY] = {
.reg_offset = DA9063_REG_EVENT_B_OFFSET,
.mask = DA9063_M_DVC_RDY,
},
[DA9063_IRQ_VDD_MON] = { [DA9063_IRQ_VDD_MON] = {
.reg_offset = DA9063_REG_EVENT_B_OFFSET, .reg_offset = DA9063_REG_EVENT_B_OFFSET,
.mask = DA9063_M_VDD_MON, .mask = DA9063_M_VDD_MON,
......
...@@ -2654,7 +2654,6 @@ static int db8500_irq_map(struct irq_domain *d, unsigned int virq, ...@@ -2654,7 +2654,6 @@ static int db8500_irq_map(struct irq_domain *d, unsigned int virq,
{ {
irq_set_chip_and_handler(virq, &prcmu_irq_chip, irq_set_chip_and_handler(virq, &prcmu_irq_chip,
handle_simple_irq); handle_simple_irq);
set_irq_flags(virq, IRQF_VALID);
return 0; return 0;
} }
......
...@@ -207,7 +207,7 @@ static void pcap_isr_work(struct work_struct *work) ...@@ -207,7 +207,7 @@ static void pcap_isr_work(struct work_struct *work)
static void pcap_irq_handler(unsigned int irq, struct irq_desc *desc) static void pcap_irq_handler(unsigned int irq, struct irq_desc *desc)
{ {
struct pcap_chip *pcap = irq_get_handler_data(irq); struct pcap_chip *pcap = irq_desc_get_handler_data(desc);
desc->irq_data.chip->irq_ack(&desc->irq_data); desc->irq_data.chip->irq_ack(&desc->irq_data);
queue_work(pcap->workqueue, &pcap->isr_work); queue_work(pcap->workqueue, &pcap->isr_work);
...@@ -463,11 +463,7 @@ static int ezx_pcap_probe(struct spi_device *spi) ...@@ -463,11 +463,7 @@ static int ezx_pcap_probe(struct spi_device *spi)
for (i = pcap->irq_base; i < (pcap->irq_base + PCAP_NIRQS); i++) { for (i = pcap->irq_base; i < (pcap->irq_base + PCAP_NIRQS); i++) {
irq_set_chip_and_handler(i, &pcap_irq_chip, handle_simple_irq); irq_set_chip_and_handler(i, &pcap_irq_chip, handle_simple_irq);
irq_set_chip_data(i, pcap); irq_set_chip_data(i, pcap);
#ifdef CONFIG_ARM irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
set_irq_flags(i, IRQF_VALID);
#else
irq_set_noprobe(i);
#endif
} }
/* mask/ack all PCAP interrupts */ /* mask/ack all PCAP interrupts */
...@@ -476,8 +472,7 @@ static int ezx_pcap_probe(struct spi_device *spi) ...@@ -476,8 +472,7 @@ static int ezx_pcap_probe(struct spi_device *spi)
pcap->msr = PCAP_MASK_ALL_INTERRUPT; pcap->msr = PCAP_MASK_ALL_INTERRUPT;
irq_set_irq_type(spi->irq, IRQ_TYPE_EDGE_RISING); irq_set_irq_type(spi->irq, IRQ_TYPE_EDGE_RISING);
irq_set_handler_data(spi->irq, pcap); irq_set_chained_handler_and_data(spi->irq, pcap_irq_handler, pcap);
irq_set_chained_handler(spi->irq, pcap_irq_handler);
irq_set_irq_wake(spi->irq, 1); irq_set_irq_wake(spi->irq, 1);
/* ADC */ /* ADC */
......
...@@ -350,11 +350,11 @@ static int __init egpio_probe(struct platform_device *pdev) ...@@ -350,11 +350,11 @@ static int __init egpio_probe(struct platform_device *pdev)
irq_set_chip_and_handler(irq, &egpio_muxed_chip, irq_set_chip_and_handler(irq, &egpio_muxed_chip,
handle_simple_irq); handle_simple_irq);
irq_set_chip_data(irq, ei); irq_set_chip_data(irq, ei);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
} }
irq_set_irq_type(ei->chained_irq, IRQ_TYPE_EDGE_RISING); irq_set_irq_type(ei->chained_irq, IRQ_TYPE_EDGE_RISING);
irq_set_handler_data(ei->chained_irq, ei); irq_set_chained_handler_and_data(ei->chained_irq,
irq_set_chained_handler(ei->chained_irq, egpio_handler); egpio_handler, ei);
ack_irqs(ei); ack_irqs(ei);
device_init_wakeup(&pdev->dev, 1); device_init_wakeup(&pdev->dev, 1);
...@@ -376,7 +376,7 @@ static int __exit egpio_remove(struct platform_device *pdev) ...@@ -376,7 +376,7 @@ static int __exit egpio_remove(struct platform_device *pdev)
irq_end = ei->irq_start + ei->nirqs; irq_end = ei->irq_start + ei->nirqs;
for (irq = ei->irq_start; irq < irq_end; irq++) { for (irq = ei->irq_start; irq < irq_end; irq++) {
irq_set_chip_and_handler(irq, NULL, NULL); irq_set_chip_and_handler(irq, NULL, NULL);
set_irq_flags(irq, 0); irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
} }
irq_set_chained_handler(ei->chained_irq, NULL); irq_set_chained_handler(ei->chained_irq, NULL);
device_init_wakeup(&pdev->dev, 0); device_init_wakeup(&pdev->dev, 0);
......
...@@ -330,11 +330,7 @@ static int htcpld_setup_chip_irq( ...@@ -330,11 +330,7 @@ static int htcpld_setup_chip_irq(
irq_set_chip_and_handler(irq, &htcpld_muxed_chip, irq_set_chip_and_handler(irq, &htcpld_muxed_chip,
handle_simple_irq); handle_simple_irq);
irq_set_chip_data(irq, chip); irq_set_chip_data(irq, chip);
#ifdef CONFIG_ARM irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
#else
irq_set_probe(irq);
#endif
} }
return ret; return ret;
......
...@@ -147,7 +147,7 @@ static const struct i2c_device_id intel_soc_pmic_i2c_id[] = { ...@@ -147,7 +147,7 @@ static const struct i2c_device_id intel_soc_pmic_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, intel_soc_pmic_i2c_id); MODULE_DEVICE_TABLE(i2c, intel_soc_pmic_i2c_id);
#if defined(CONFIG_ACPI) #if defined(CONFIG_ACPI)
static struct acpi_device_id intel_soc_pmic_acpi_match[] = { static const struct acpi_device_id intel_soc_pmic_acpi_match[] = {
{"INT33FD", (kernel_ulong_t)&intel_soc_pmic_config_crc}, {"INT33FD", (kernel_ulong_t)&intel_soc_pmic_config_crc},
{ }, { },
}; };
...@@ -157,7 +157,6 @@ MODULE_DEVICE_TABLE(acpi, intel_soc_pmic_acpi_match); ...@@ -157,7 +157,6 @@ MODULE_DEVICE_TABLE(acpi, intel_soc_pmic_acpi_match);
static struct i2c_driver intel_soc_pmic_i2c_driver = { static struct i2c_driver intel_soc_pmic_i2c_driver = {
.driver = { .driver = {
.name = "intel_soc_pmic_i2c", .name = "intel_soc_pmic_i2c",
.owner = THIS_MODULE,
.pm = &intel_soc_pmic_pm_ops, .pm = &intel_soc_pmic_pm_ops,
.acpi_match_table = ACPI_PTR(intel_soc_pmic_acpi_match), .acpi_match_table = ACPI_PTR(intel_soc_pmic_acpi_match),
}, },
......
...@@ -53,8 +53,8 @@ static void ipaq_micro_trigger_tx(struct ipaq_micro *micro) ...@@ -53,8 +53,8 @@ static void ipaq_micro_trigger_tx(struct ipaq_micro *micro)
tx->buf[bp++] = checksum; tx->buf[bp++] = checksum;
tx->len = bp; tx->len = bp;
tx->index = 0; tx->index = 0;
print_hex_dump(KERN_DEBUG, "data: ", DUMP_PREFIX_OFFSET, 16, 1, print_hex_dump_debug("data: ", DUMP_PREFIX_OFFSET, 16, 1,
tx->buf, tx->len, true); tx->buf, tx->len, true);
/* Enable interrupt */ /* Enable interrupt */
val = readl(micro->base + UTCR3); val = readl(micro->base + UTCR3);
...@@ -242,7 +242,7 @@ static u16 ipaq_micro_to_u16(u8 *data) ...@@ -242,7 +242,7 @@ static u16 ipaq_micro_to_u16(u8 *data)
return data[1] << 8 | data[0]; return data[1] << 8 | data[0];
} }
static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro) static void __init ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
{ {
u8 dump[256]; u8 dump[256];
char *str; char *str;
...@@ -250,7 +250,7 @@ static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro) ...@@ -250,7 +250,7 @@ static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
ipaq_micro_eeprom_read(micro, 0, 128, dump); ipaq_micro_eeprom_read(micro, 0, 128, dump);
str = ipaq_micro_str(dump, 10); str = ipaq_micro_str(dump, 10);
if (str) { if (str) {
dev_info(micro->dev, "HM version %s\n", str); dev_info(micro->dev, "HW version %s\n", str);
kfree(str); kfree(str);
} }
str = ipaq_micro_str(dump+10, 40); str = ipaq_micro_str(dump+10, 40);
...@@ -281,8 +281,8 @@ static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro) ...@@ -281,8 +281,8 @@ static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
dev_info(micro->dev, "RAM size: %u KiB\n", ipaq_micro_to_u16(dump+92)); dev_info(micro->dev, "RAM size: %u KiB\n", ipaq_micro_to_u16(dump+92));
dev_info(micro->dev, "screen: %u x %u\n", dev_info(micro->dev, "screen: %u x %u\n",
ipaq_micro_to_u16(dump+94), ipaq_micro_to_u16(dump+96)); ipaq_micro_to_u16(dump+94), ipaq_micro_to_u16(dump+96));
print_hex_dump(KERN_DEBUG, "eeprom: ", DUMP_PREFIX_OFFSET, 16, 1, print_hex_dump_debug("eeprom: ", DUMP_PREFIX_OFFSET, 16, 1,
dump, 256, true); dump, 256, true);
} }
...@@ -386,7 +386,7 @@ static int micro_resume(struct device *dev) ...@@ -386,7 +386,7 @@ static int micro_resume(struct device *dev)
return 0; return 0;
} }
static int micro_probe(struct platform_device *pdev) static int __init micro_probe(struct platform_device *pdev)
{ {
struct ipaq_micro *micro; struct ipaq_micro *micro;
struct resource *res; struct resource *res;
...@@ -448,21 +448,6 @@ static int micro_probe(struct platform_device *pdev) ...@@ -448,21 +448,6 @@ static int micro_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int micro_remove(struct platform_device *pdev)
{
struct ipaq_micro *micro = platform_get_drvdata(pdev);
u32 val;
mfd_remove_devices(&pdev->dev);
val = readl(micro->base + UTCR3);
val &= ~(UTCR3_RXE | UTCR3_RIE); /* disable receive interrupt */
val &= ~(UTCR3_TXE | UTCR3_TIE); /* disable transmit interrupt */
writel(val, micro->base + UTCR3);
return 0;
}
static const struct dev_pm_ops micro_dev_pm_ops = { static const struct dev_pm_ops micro_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(NULL, micro_resume) SET_SYSTEM_SLEEP_PM_OPS(NULL, micro_resume)
}; };
...@@ -471,12 +456,7 @@ static struct platform_driver micro_device_driver = { ...@@ -471,12 +456,7 @@ static struct platform_driver micro_device_driver = {
.driver = { .driver = {
.name = "ipaq-h3xxx-micro", .name = "ipaq-h3xxx-micro",
.pm = &micro_dev_pm_ops, .pm = &micro_dev_pm_ops,
.suppress_bind_attrs = true,
}, },
.probe = micro_probe,
.remove = micro_remove,
/* .shutdown = micro_suspend, // FIXME */
}; };
module_platform_driver(micro_device_driver); builtin_platform_driver_probe(micro_device_driver, micro_probe);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("driver for iPAQ Atmel micro core and backlight");
...@@ -273,12 +273,12 @@ static int jz4740_adc_probe(struct platform_device *pdev) ...@@ -273,12 +273,12 @@ static int jz4740_adc_probe(struct platform_device *pdev)
ct->chip.irq_unmask = irq_gc_mask_clr_bit; ct->chip.irq_unmask = irq_gc_mask_clr_bit;
ct->chip.irq_ack = irq_gc_ack_set_bit; ct->chip.irq_ack = irq_gc_ack_set_bit;
irq_setup_generic_chip(gc, IRQ_MSK(5), 0, 0, IRQ_NOPROBE | IRQ_LEVEL); irq_setup_generic_chip(gc, IRQ_MSK(5), IRQ_GC_INIT_MASK_CACHE, 0,
IRQ_NOPROBE | IRQ_LEVEL);
adc->gc = gc; adc->gc = gc;
irq_set_handler_data(adc->irq, gc); irq_set_chained_handler_and_data(adc->irq, jz4740_adc_irq_demux, gc);
irq_set_chained_handler(adc->irq, jz4740_adc_irq_demux);
writeb(0x00, adc->base + JZ_REG_ADC_ENABLE); writeb(0x00, adc->base + JZ_REG_ADC_ENABLE);
writeb(0xff, adc->base + JZ_REG_ADC_CTRL); writeb(0xff, adc->base + JZ_REG_ADC_CTRL);
...@@ -308,8 +308,7 @@ static int jz4740_adc_remove(struct platform_device *pdev) ...@@ -308,8 +308,7 @@ static int jz4740_adc_remove(struct platform_device *pdev)
irq_remove_generic_chip(adc->gc, IRQ_MSK(5), IRQ_NOPROBE | IRQ_LEVEL, 0); irq_remove_generic_chip(adc->gc, IRQ_MSK(5), IRQ_NOPROBE | IRQ_LEVEL, 0);
kfree(adc->gc); kfree(adc->gc);
irq_set_handler_data(adc->irq, NULL); irq_set_chained_handler_and_data(adc->irq, NULL, NULL);
irq_set_chained_handler(adc->irq, NULL);
iounmap(adc->base); iounmap(adc->base);
release_mem_region(adc->mem->start, resource_size(adc->mem)); release_mem_region(adc->mem->start, resource_size(adc->mem));
......
...@@ -501,6 +501,14 @@ static struct platform_driver kempld_driver = { ...@@ -501,6 +501,14 @@ static struct platform_driver kempld_driver = {
static struct dmi_system_id kempld_dmi_table[] __initdata = { static struct dmi_system_id kempld_dmi_table[] __initdata = {
{ {
.ident = "BBL6",
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"),
DMI_MATCH(DMI_BOARD_NAME, "COMe-bBL6"),
},
.driver_data = (void *)&kempld_platform_data_generic,
.callback = kempld_create_platform_device,
}, {
.ident = "BHL6", .ident = "BHL6",
.matches = { .matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"),
...@@ -516,6 +524,14 @@ static struct dmi_system_id kempld_dmi_table[] __initdata = { ...@@ -516,6 +524,14 @@ static struct dmi_system_id kempld_dmi_table[] __initdata = {
}, },
.driver_data = (void *)&kempld_platform_data_generic, .driver_data = (void *)&kempld_platform_data_generic,
.callback = kempld_create_platform_device, .callback = kempld_create_platform_device,
}, {
.ident = "CBW6",
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"),
DMI_MATCH(DMI_BOARD_NAME, "COMe-cBW6"),
},
.driver_data = (void *)&kempld_platform_data_generic,
.callback = kempld_create_platform_device,
}, { }, {
.ident = "CCR2", .ident = "CCR2",
.matches = { .matches = {
......
...@@ -640,7 +640,6 @@ MODULE_DEVICE_TABLE(i2c, lm3533_i2c_ids); ...@@ -640,7 +640,6 @@ MODULE_DEVICE_TABLE(i2c, lm3533_i2c_ids);
static struct i2c_driver lm3533_i2c_driver = { static struct i2c_driver lm3533_i2c_driver = {
.driver = { .driver = {
.name = "lm3533", .name = "lm3533",
.owner = THIS_MODULE,
}, },
.id_table = lm3533_i2c_ids, .id_table = lm3533_i2c_ids,
.probe = lm3533_i2c_probe, .probe = lm3533_i2c_probe,
......
...@@ -154,7 +154,6 @@ static struct i2c_driver lp3943_driver = { ...@@ -154,7 +154,6 @@ static struct i2c_driver lp3943_driver = {
.remove = lp3943_remove, .remove = lp3943_remove,
.driver = { .driver = {
.name = "lp3943", .name = "lp3943",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(lp3943_of_match), .of_match_table = of_match_ptr(lp3943_of_match),
}, },
.id_table = lp3943_ids, .id_table = lp3943_ids,
......
...@@ -141,12 +141,7 @@ static int lp8788_irq_map(struct irq_domain *d, unsigned int virq, ...@@ -141,12 +141,7 @@ static int lp8788_irq_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_data(virq, irqd); irq_set_chip_data(virq, irqd);
irq_set_chip_and_handler(virq, chip, handle_edge_irq); irq_set_chip_and_handler(virq, chip, handle_edge_irq);
irq_set_nested_thread(virq, 1); irq_set_nested_thread(virq, 1);
#ifdef CONFIG_ARM
set_irq_flags(virq, IRQF_VALID);
#else
irq_set_noprobe(virq); irq_set_noprobe(virq);
#endif
return 0; return 0;
} }
......
...@@ -221,7 +221,6 @@ MODULE_DEVICE_TABLE(i2c, lp8788_ids); ...@@ -221,7 +221,6 @@ MODULE_DEVICE_TABLE(i2c, lp8788_ids);
static struct i2c_driver lp8788_driver = { static struct i2c_driver lp8788_driver = {
.driver = { .driver = {
.name = "lp8788", .name = "lp8788",
.owner = THIS_MODULE,
}, },
.probe = lp8788_probe, .probe = lp8788_probe,
.remove = lp8788_remove, .remove = lp8788_remove,
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/mfd/core.h> #include <linux/mfd/core.h>
#include <linux/mfd/lpc_ich.h> #include <linux/mfd/lpc_ich.h>
#include <linux/platform_data/itco_wdt.h>
#define ACPIBASE 0x40 #define ACPIBASE 0x40
#define ACPIBASE_GPE_OFF 0x28 #define ACPIBASE_GPE_OFF 0x28
...@@ -835,9 +836,31 @@ static void lpc_ich_enable_pmc_space(struct pci_dev *dev) ...@@ -835,9 +836,31 @@ static void lpc_ich_enable_pmc_space(struct pci_dev *dev)
priv->actrl_pbase_save = reg_save; priv->actrl_pbase_save = reg_save;
} }
static void lpc_ich_finalize_cell(struct pci_dev *dev, struct mfd_cell *cell) static int lpc_ich_finalize_wdt_cell(struct pci_dev *dev)
{ {
struct itco_wdt_platform_data *pdata;
struct lpc_ich_priv *priv = pci_get_drvdata(dev); struct lpc_ich_priv *priv = pci_get_drvdata(dev);
struct lpc_ich_info *info;
struct mfd_cell *cell = &lpc_ich_cells[LPC_WDT];
pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
info = &lpc_chipset_info[priv->chipset];
pdata->version = info->iTCO_version;
strlcpy(pdata->name, info->name, sizeof(pdata->name));
cell->platform_data = pdata;
cell->pdata_size = sizeof(*pdata);
return 0;
}
static void lpc_ich_finalize_gpio_cell(struct pci_dev *dev)
{
struct lpc_ich_priv *priv = pci_get_drvdata(dev);
struct mfd_cell *cell = &lpc_ich_cells[LPC_GPIO];
cell->platform_data = &lpc_chipset_info[priv->chipset]; cell->platform_data = &lpc_chipset_info[priv->chipset];
cell->pdata_size = sizeof(struct lpc_ich_info); cell->pdata_size = sizeof(struct lpc_ich_info);
...@@ -933,7 +956,7 @@ static int lpc_ich_init_gpio(struct pci_dev *dev) ...@@ -933,7 +956,7 @@ static int lpc_ich_init_gpio(struct pci_dev *dev)
lpc_chipset_info[priv->chipset].use_gpio = ret; lpc_chipset_info[priv->chipset].use_gpio = ret;
lpc_ich_enable_gpio_space(dev); lpc_ich_enable_gpio_space(dev);
lpc_ich_finalize_cell(dev, &lpc_ich_cells[LPC_GPIO]); lpc_ich_finalize_gpio_cell(dev);
ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO,
&lpc_ich_cells[LPC_GPIO], 1, NULL, 0, NULL); &lpc_ich_cells[LPC_GPIO], 1, NULL, 0, NULL);
...@@ -1007,7 +1030,10 @@ static int lpc_ich_init_wdt(struct pci_dev *dev) ...@@ -1007,7 +1030,10 @@ static int lpc_ich_init_wdt(struct pci_dev *dev)
res->end = base_addr + ACPIBASE_PMC_END; res->end = base_addr + ACPIBASE_PMC_END;
} }
lpc_ich_finalize_cell(dev, &lpc_ich_cells[LPC_WDT]); ret = lpc_ich_finalize_wdt_cell(dev);
if (ret)
goto wdt_done;
ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO,
&lpc_ich_cells[LPC_WDT], 1, NULL, 0, NULL); &lpc_ich_cells[LPC_WDT], 1, NULL, 0, NULL);
......
...@@ -532,7 +532,6 @@ static SIMPLE_DEV_PM_OPS(max14577_pm, max14577_suspend, max14577_resume); ...@@ -532,7 +532,6 @@ static SIMPLE_DEV_PM_OPS(max14577_pm, max14577_suspend, max14577_resume);
static struct i2c_driver max14577_i2c_driver = { static struct i2c_driver max14577_i2c_driver = {
.driver = { .driver = {
.name = "max14577", .name = "max14577",
.owner = THIS_MODULE,
.pm = &max14577_pm, .pm = &max14577_pm,
.of_match_table = max14577_dt_match, .of_match_table = max14577_dt_match,
}, },
......
...@@ -391,7 +391,6 @@ static SIMPLE_DEV_PM_OPS(max77686_pm, max77686_suspend, max77686_resume); ...@@ -391,7 +391,6 @@ static SIMPLE_DEV_PM_OPS(max77686_pm, max77686_suspend, max77686_resume);
static struct i2c_driver max77686_i2c_driver = { static struct i2c_driver max77686_i2c_driver = {
.driver = { .driver = {
.name = "max77686", .name = "max77686",
.owner = THIS_MODULE,
.pm = &max77686_pm, .pm = &max77686_pm,
.of_match_table = of_match_ptr(max77686_pmic_dt_match), .of_match_table = of_match_ptr(max77686_pmic_dt_match),
}, },
......
...@@ -373,7 +373,6 @@ static const struct of_device_id max77693_dt_match[] = { ...@@ -373,7 +373,6 @@ static const struct of_device_id max77693_dt_match[] = {
static struct i2c_driver max77693_i2c_driver = { static struct i2c_driver max77693_i2c_driver = {
.driver = { .driver = {
.name = "max77693", .name = "max77693",
.owner = THIS_MODULE,
.pm = &max77693_pm, .pm = &max77693_pm,
.of_match_table = of_match_ptr(max77693_dt_match), .of_match_table = of_match_ptr(max77693_dt_match),
}, },
......
...@@ -321,7 +321,6 @@ MODULE_DEVICE_TABLE(i2c, max8907_i2c_id); ...@@ -321,7 +321,6 @@ MODULE_DEVICE_TABLE(i2c, max8907_i2c_id);
static struct i2c_driver max8907_i2c_driver = { static struct i2c_driver max8907_i2c_driver = {
.driver = { .driver = {
.name = "max8907", .name = "max8907",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(max8907_of_match), .of_match_table = of_match_ptr(max8907_of_match),
}, },
.probe = max8907_i2c_probe, .probe = max8907_i2c_probe,
......
...@@ -650,11 +650,8 @@ static int max8925_irq_domain_map(struct irq_domain *d, unsigned int virq, ...@@ -650,11 +650,8 @@ static int max8925_irq_domain_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_data(virq, d->host_data); irq_set_chip_data(virq, d->host_data);
irq_set_chip_and_handler(virq, &max8925_irq_chip, handle_edge_irq); irq_set_chip_and_handler(virq, &max8925_irq_chip, handle_edge_irq);
irq_set_nested_thread(virq, 1); irq_set_nested_thread(virq, 1);
#ifdef CONFIG_ARM
set_irq_flags(virq, IRQF_VALID);
#else
irq_set_noprobe(virq); irq_set_noprobe(virq);
#endif
return 0; return 0;
} }
......
...@@ -245,7 +245,6 @@ MODULE_DEVICE_TABLE(of, max8925_dt_ids); ...@@ -245,7 +245,6 @@ MODULE_DEVICE_TABLE(of, max8925_dt_ids);
static struct i2c_driver max8925_driver = { static struct i2c_driver max8925_driver = {
.driver = { .driver = {
.name = "max8925", .name = "max8925",
.owner = THIS_MODULE,
.pm = &max8925_pm_ops, .pm = &max8925_pm_ops,
.of_match_table = max8925_dt_ids, .of_match_table = max8925_dt_ids,
}, },
......
...@@ -113,14 +113,14 @@ static const struct max8997_irq_data max8997_irqs[] = { ...@@ -113,14 +113,14 @@ static const struct max8997_irq_data max8997_irqs[] = {
static void max8997_irq_lock(struct irq_data *data) static void max8997_irq_lock(struct irq_data *data)
{ {
struct max8997_dev *max8997 = irq_get_chip_data(data->irq); struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data);
mutex_lock(&max8997->irqlock); mutex_lock(&max8997->irqlock);
} }
static void max8997_irq_sync_unlock(struct irq_data *data) static void max8997_irq_sync_unlock(struct irq_data *data)
{ {
struct max8997_dev *max8997 = irq_get_chip_data(data->irq); struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data);
int i; int i;
for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) { for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
...@@ -140,26 +140,25 @@ static void max8997_irq_sync_unlock(struct irq_data *data) ...@@ -140,26 +140,25 @@ static void max8997_irq_sync_unlock(struct irq_data *data)
} }
static const inline struct max8997_irq_data * static const inline struct max8997_irq_data *
irq_to_max8997_irq(struct max8997_dev *max8997, int irq) irq_to_max8997_irq(struct max8997_dev *max8997, struct irq_data *data)
{ {
struct irq_data *data = irq_get_irq_data(irq);
return &max8997_irqs[data->hwirq]; return &max8997_irqs[data->hwirq];
} }
static void max8997_irq_mask(struct irq_data *data) static void max8997_irq_mask(struct irq_data *data)
{ {
struct max8997_dev *max8997 = irq_get_chip_data(data->irq); struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data);
const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997, const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997,
data->irq); data);
max8997->irq_masks_cur[irq_data->group] |= irq_data->mask; max8997->irq_masks_cur[irq_data->group] |= irq_data->mask;
} }
static void max8997_irq_unmask(struct irq_data *data) static void max8997_irq_unmask(struct irq_data *data)
{ {
struct max8997_dev *max8997 = irq_get_chip_data(data->irq); struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data);
const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997, const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997,
data->irq); data);
max8997->irq_masks_cur[irq_data->group] &= ~irq_data->mask; max8997->irq_masks_cur[irq_data->group] &= ~irq_data->mask;
} }
...@@ -295,11 +294,8 @@ static int max8997_irq_domain_map(struct irq_domain *d, unsigned int irq, ...@@ -295,11 +294,8 @@ static int max8997_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_chip_data(irq, max8997); irq_set_chip_data(irq, max8997);
irq_set_chip_and_handler(irq, &max8997_irq_chip, handle_edge_irq); irq_set_chip_and_handler(irq, &max8997_irq_chip, handle_edge_irq);
irq_set_nested_thread(irq, 1); irq_set_nested_thread(irq, 1);
#ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID);
#else
irq_set_noprobe(irq); irq_set_noprobe(irq);
#endif
return 0; return 0;
} }
......
...@@ -508,7 +508,6 @@ static const struct dev_pm_ops max8997_pm = { ...@@ -508,7 +508,6 @@ static const struct dev_pm_ops max8997_pm = {
static struct i2c_driver max8997_i2c_driver = { static struct i2c_driver max8997_i2c_driver = {
.driver = { .driver = {
.name = "max8997", .name = "max8997",
.owner = THIS_MODULE,
.pm = &max8997_pm, .pm = &max8997_pm,
.of_match_table = of_match_ptr(max8997_pmic_dt_match), .of_match_table = of_match_ptr(max8997_pmic_dt_match),
}, },
......
...@@ -98,9 +98,8 @@ static struct max8998_irq_data max8998_irqs[] = { ...@@ -98,9 +98,8 @@ static struct max8998_irq_data max8998_irqs[] = {
}; };
static inline struct max8998_irq_data * static inline struct max8998_irq_data *
irq_to_max8998_irq(struct max8998_dev *max8998, int irq) irq_to_max8998_irq(struct max8998_dev *max8998, struct irq_data *data)
{ {
struct irq_data *data = irq_get_irq_data(irq);
return &max8998_irqs[data->hwirq]; return &max8998_irqs[data->hwirq];
} }
...@@ -134,8 +133,7 @@ static void max8998_irq_sync_unlock(struct irq_data *data) ...@@ -134,8 +133,7 @@ static void max8998_irq_sync_unlock(struct irq_data *data)
static void max8998_irq_unmask(struct irq_data *data) static void max8998_irq_unmask(struct irq_data *data)
{ {
struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data); struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data);
struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, data);
data->irq);
max8998->irq_masks_cur[irq_data->reg - 1] &= ~irq_data->mask; max8998->irq_masks_cur[irq_data->reg - 1] &= ~irq_data->mask;
} }
...@@ -143,8 +141,7 @@ static void max8998_irq_unmask(struct irq_data *data) ...@@ -143,8 +141,7 @@ static void max8998_irq_unmask(struct irq_data *data)
static void max8998_irq_mask(struct irq_data *data) static void max8998_irq_mask(struct irq_data *data)
{ {
struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data); struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data);
struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, data);
data->irq);
max8998->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask; max8998->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask;
} }
...@@ -206,11 +203,8 @@ static int max8998_irq_domain_map(struct irq_domain *d, unsigned int irq, ...@@ -206,11 +203,8 @@ static int max8998_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_chip_data(irq, max8998); irq_set_chip_data(irq, max8998);
irq_set_chip_and_handler(irq, &max8998_irq_chip, handle_edge_irq); irq_set_chip_and_handler(irq, &max8998_irq_chip, handle_edge_irq);
irq_set_nested_thread(irq, 1); irq_set_nested_thread(irq, 1);
#ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID);
#else
irq_set_noprobe(irq); irq_set_noprobe(irq);
#endif
return 0; return 0;
} }
......
...@@ -377,7 +377,6 @@ static const struct dev_pm_ops max8998_pm = { ...@@ -377,7 +377,6 @@ static const struct dev_pm_ops max8998_pm = {
static struct i2c_driver max8998_i2c_driver = { static struct i2c_driver max8998_i2c_driver = {
.driver = { .driver = {
.name = "max8998", .name = "max8998",
.owner = THIS_MODULE,
.pm = &max8998_pm, .pm = &max8998_pm,
.of_match_table = of_match_ptr(max8998_dt_match), .of_match_table = of_match_ptr(max8998_dt_match),
}, },
......
...@@ -96,7 +96,6 @@ static int mc13xxx_i2c_remove(struct i2c_client *client) ...@@ -96,7 +96,6 @@ static int mc13xxx_i2c_remove(struct i2c_client *client)
static struct i2c_driver mc13xxx_i2c_driver = { static struct i2c_driver mc13xxx_i2c_driver = {
.id_table = mc13xxx_i2c_device_id, .id_table = mc13xxx_i2c_device_id,
.driver = { .driver = {
.owner = THIS_MODULE,
.name = "mc13xxx", .name = "mc13xxx",
.of_match_table = mc13xxx_dt_ids, .of_match_table = mc13xxx_dt_ids,
}, },
......
...@@ -60,14 +60,14 @@ static const struct mfd_cell mt6397_devs[] = { ...@@ -60,14 +60,14 @@ static const struct mfd_cell mt6397_devs[] = {
static void mt6397_irq_lock(struct irq_data *data) static void mt6397_irq_lock(struct irq_data *data)
{ {
struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq); struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data);
mutex_lock(&mt6397->irqlock); mutex_lock(&mt6397->irqlock);
} }
static void mt6397_irq_sync_unlock(struct irq_data *data) static void mt6397_irq_sync_unlock(struct irq_data *data)
{ {
struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq); struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data);
regmap_write(mt6397->regmap, MT6397_INT_CON0, mt6397->irq_masks_cur[0]); regmap_write(mt6397->regmap, MT6397_INT_CON0, mt6397->irq_masks_cur[0]);
regmap_write(mt6397->regmap, MT6397_INT_CON1, mt6397->irq_masks_cur[1]); regmap_write(mt6397->regmap, MT6397_INT_CON1, mt6397->irq_masks_cur[1]);
...@@ -77,7 +77,7 @@ static void mt6397_irq_sync_unlock(struct irq_data *data) ...@@ -77,7 +77,7 @@ static void mt6397_irq_sync_unlock(struct irq_data *data)
static void mt6397_irq_disable(struct irq_data *data) static void mt6397_irq_disable(struct irq_data *data)
{ {
struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq); struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data);
int shift = data->hwirq & 0xf; int shift = data->hwirq & 0xf;
int reg = data->hwirq >> 4; int reg = data->hwirq >> 4;
...@@ -86,19 +86,38 @@ static void mt6397_irq_disable(struct irq_data *data) ...@@ -86,19 +86,38 @@ static void mt6397_irq_disable(struct irq_data *data)
static void mt6397_irq_enable(struct irq_data *data) static void mt6397_irq_enable(struct irq_data *data)
{ {
struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq); struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data);
int shift = data->hwirq & 0xf; int shift = data->hwirq & 0xf;
int reg = data->hwirq >> 4; int reg = data->hwirq >> 4;
mt6397->irq_masks_cur[reg] |= BIT(shift); 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);
int shift = irq_data->hwirq & 0xf;
int reg = irq_data->hwirq >> 4;
if (on)
mt6397->wake_mask[reg] |= BIT(shift);
else
mt6397->wake_mask[reg] &= ~BIT(shift);
return 0;
}
#else
#define mt6397_irq_set_wake NULL
#endif
static struct irq_chip mt6397_irq_chip = { static struct irq_chip mt6397_irq_chip = {
.name = "mt6397-irq", .name = "mt6397-irq",
.irq_bus_lock = mt6397_irq_lock, .irq_bus_lock = mt6397_irq_lock,
.irq_bus_sync_unlock = mt6397_irq_sync_unlock, .irq_bus_sync_unlock = mt6397_irq_sync_unlock,
.irq_enable = mt6397_irq_enable, .irq_enable = mt6397_irq_enable,
.irq_disable = mt6397_irq_disable, .irq_disable = mt6397_irq_disable,
.irq_set_wake = mt6397_irq_set_wake,
}; };
static void mt6397_irq_handle_reg(struct mt6397_chip *mt6397, int reg, static void mt6397_irq_handle_reg(struct mt6397_chip *mt6397, int reg,
...@@ -142,11 +161,7 @@ static int mt6397_irq_domain_map(struct irq_domain *d, unsigned int irq, ...@@ -142,11 +161,7 @@ static int mt6397_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_chip_data(irq, mt6397); irq_set_chip_data(irq, mt6397);
irq_set_chip_and_handler(irq, &mt6397_irq_chip, handle_level_irq); irq_set_chip_and_handler(irq, &mt6397_irq_chip, handle_level_irq);
irq_set_nested_thread(irq, 1); irq_set_nested_thread(irq, 1);
#ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID);
#else
irq_set_noprobe(irq); irq_set_noprobe(irq);
#endif
return 0; return 0;
} }
...@@ -183,6 +198,35 @@ static int mt6397_irq_init(struct mt6397_chip *mt6397) ...@@ -183,6 +198,35 @@ static int mt6397_irq_init(struct mt6397_chip *mt6397)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int mt6397_irq_suspend(struct device *dev)
{
struct mt6397_chip *chip = dev_get_drvdata(dev);
regmap_write(chip->regmap, MT6397_INT_CON0, chip->wake_mask[0]);
regmap_write(chip->regmap, MT6397_INT_CON1, chip->wake_mask[1]);
enable_irq_wake(chip->irq);
return 0;
}
static int mt6397_irq_resume(struct device *dev)
{
struct mt6397_chip *chip = dev_get_drvdata(dev);
regmap_write(chip->regmap, MT6397_INT_CON0, chip->irq_masks_cur[0]);
regmap_write(chip->regmap, MT6397_INT_CON1, chip->irq_masks_cur[1]);
disable_irq_wake(chip->irq);
return 0;
}
#endif
static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_irq_suspend,
mt6397_irq_resume);
static int mt6397_probe(struct platform_device *pdev) static int mt6397_probe(struct platform_device *pdev)
{ {
int ret; int ret;
...@@ -237,6 +281,7 @@ static struct platform_driver mt6397_driver = { ...@@ -237,6 +281,7 @@ static struct platform_driver mt6397_driver = {
.driver = { .driver = {
.name = "mt6397", .name = "mt6397",
.of_match_table = of_match_ptr(mt6397_of_match), .of_match_table = of_match_ptr(mt6397_of_match),
.pm = &mt6397_pm_ops,
}, },
}; };
......
...@@ -719,7 +719,6 @@ static struct i2c_driver palmas_i2c_driver = { ...@@ -719,7 +719,6 @@ static struct i2c_driver palmas_i2c_driver = {
.driver = { .driver = {
.name = "palmas", .name = "palmas",
.of_match_table = of_palmas_match_tbl, .of_match_table = of_palmas_match_tbl,
.owner = THIS_MODULE,
}, },
.probe = palmas_i2c_probe, .probe = palmas_i2c_probe,
.remove = palmas_i2c_remove, .remove = palmas_i2c_remove,
......
...@@ -236,11 +236,49 @@ static int pm8xxx_irq_set_type(struct irq_data *d, unsigned int flow_type) ...@@ -236,11 +236,49 @@ static int pm8xxx_irq_set_type(struct irq_data *d, unsigned int flow_type)
return pm8xxx_config_irq(chip, block, config); return pm8xxx_config_irq(chip, block, config);
} }
static int pm8xxx_irq_get_irqchip_state(struct irq_data *d,
enum irqchip_irq_state which,
bool *state)
{
struct pm_irq_chip *chip = irq_data_get_irq_chip_data(d);
unsigned int pmirq = irqd_to_hwirq(d);
unsigned int bits;
int irq_bit;
u8 block;
int rc;
if (which != IRQCHIP_STATE_LINE_LEVEL)
return -EINVAL;
block = pmirq / 8;
irq_bit = pmirq % 8;
spin_lock(&chip->pm_irq_lock);
rc = regmap_write(chip->regmap, SSBI_REG_ADDR_IRQ_BLK_SEL, block);
if (rc) {
pr_err("Failed Selecting Block %d rc=%d\n", block, rc);
goto bail;
}
rc = regmap_read(chip->regmap, SSBI_REG_ADDR_IRQ_RT_STATUS, &bits);
if (rc) {
pr_err("Failed Reading Status rc=%d\n", rc);
goto bail;
}
*state = !!(bits & BIT(irq_bit));
bail:
spin_unlock(&chip->pm_irq_lock);
return rc;
}
static struct irq_chip pm8xxx_irq_chip = { static struct irq_chip pm8xxx_irq_chip = {
.name = "pm8xxx", .name = "pm8xxx",
.irq_mask_ack = pm8xxx_irq_mask_ack, .irq_mask_ack = pm8xxx_irq_mask_ack,
.irq_unmask = pm8xxx_irq_unmask, .irq_unmask = pm8xxx_irq_unmask,
.irq_set_type = pm8xxx_irq_set_type, .irq_set_type = pm8xxx_irq_set_type,
.irq_get_irqchip_state = pm8xxx_irq_get_irqchip_state,
.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE, .flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE,
}; };
...@@ -251,11 +289,8 @@ static int pm8xxx_irq_domain_map(struct irq_domain *d, unsigned int irq, ...@@ -251,11 +289,8 @@ static int pm8xxx_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_set_chip_and_handler(irq, &pm8xxx_irq_chip, handle_level_irq); irq_set_chip_and_handler(irq, &pm8xxx_irq_chip, handle_level_irq);
irq_set_chip_data(irq, chip); irq_set_chip_data(irq, chip);
#ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID);
#else
irq_set_noprobe(irq); irq_set_noprobe(irq);
#endif
return 0; return 0;
} }
...@@ -336,14 +371,12 @@ static int pm8921_probe(struct platform_device *pdev) ...@@ -336,14 +371,12 @@ static int pm8921_probe(struct platform_device *pdev)
if (!chip->irqdomain) if (!chip->irqdomain)
return -ENODEV; return -ENODEV;
irq_set_handler_data(irq, chip); irq_set_chained_handler_and_data(irq, pm8xxx_irq_handler, chip);
irq_set_chained_handler(irq, pm8xxx_irq_handler);
irq_set_irq_wake(irq, 1); irq_set_irq_wake(irq, 1);
rc = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); rc = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
if (rc) { if (rc) {
irq_set_chained_handler(irq, NULL); irq_set_chained_handler_and_data(irq, NULL, NULL);
irq_set_handler_data(irq, NULL);
irq_domain_remove(chip->irqdomain); irq_domain_remove(chip->irqdomain);
} }
...@@ -362,8 +395,7 @@ static int pm8921_remove(struct platform_device *pdev) ...@@ -362,8 +395,7 @@ static int pm8921_remove(struct platform_device *pdev)
struct pm_irq_chip *chip = platform_get_drvdata(pdev); struct pm_irq_chip *chip = platform_get_drvdata(pdev);
device_for_each_child(&pdev->dev, NULL, pm8921_remove_child); device_for_each_child(&pdev->dev, NULL, pm8921_remove_child);
irq_set_chained_handler(irq, NULL); irq_set_chained_handler_and_data(irq, NULL, NULL);
irq_set_handler_data(irq, NULL);
irq_domain_remove(chip->irqdomain); irq_domain_remove(chip->irqdomain);
return 0; return 0;
......
...@@ -149,6 +149,7 @@ static const struct qcom_rpm_resource apq8064_rpm_resource_table[] = { ...@@ -149,6 +149,7 @@ static const struct qcom_rpm_resource apq8064_rpm_resource_table[] = {
[QCOM_RPM_USB_OTG_SWITCH] = { 210, 125, 82, 1 }, [QCOM_RPM_USB_OTG_SWITCH] = { 210, 125, 82, 1 },
[QCOM_RPM_HDMI_SWITCH] = { 211, 126, 83, 1 }, [QCOM_RPM_HDMI_SWITCH] = { 211, 126, 83, 1 },
[QCOM_RPM_DDR_DMM] = { 212, 127, 84, 2 }, [QCOM_RPM_DDR_DMM] = { 212, 127, 84, 2 },
[QCOM_RPM_QDSS_CLK] = { 214, ~0, 7, 1 },
[QCOM_RPM_VDDMIN_GPIO] = { 215, 131, 89, 1 }, [QCOM_RPM_VDDMIN_GPIO] = { 215, 131, 89, 1 },
}; };
......
...@@ -386,9 +386,7 @@ int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base) ...@@ -386,9 +386,7 @@ int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base)
irq_set_chip_and_handler(__irq, &rc5t583_irq_chip, irq_set_chip_and_handler(__irq, &rc5t583_irq_chip,
handle_simple_irq); handle_simple_irq);
irq_set_nested_thread(__irq, 1); irq_set_nested_thread(__irq, 1);
#ifdef CONFIG_ARM irq_clear_status_flags(__irq, IRQ_NOREQUEST);
set_irq_flags(__irq, IRQF_VALID);
#endif
} }
ret = request_threaded_irq(irq, NULL, rc5t583_irq, IRQF_ONESHOT, ret = request_threaded_irq(irq, NULL, rc5t583_irq, IRQF_ONESHOT,
......
...@@ -322,7 +322,6 @@ MODULE_DEVICE_TABLE(i2c, rc5t583_i2c_id); ...@@ -322,7 +322,6 @@ MODULE_DEVICE_TABLE(i2c, rc5t583_i2c_id);
static struct i2c_driver rc5t583_i2c_driver = { static struct i2c_driver rc5t583_i2c_driver = {
.driver = { .driver = {
.name = "rc5t583", .name = "rc5t583",
.owner = THIS_MODULE,
}, },
.probe = rc5t583_i2c_probe, .probe = rc5t583_i2c_probe,
.remove = rc5t583_i2c_remove, .remove = rc5t583_i2c_remove,
......
...@@ -311,7 +311,6 @@ MODULE_DEVICE_TABLE(i2c, retu_id); ...@@ -311,7 +311,6 @@ MODULE_DEVICE_TABLE(i2c, retu_id);
static struct i2c_driver retu_driver = { static struct i2c_driver retu_driver = {
.driver = { .driver = {
.name = "retu-mfd", .name = "retu-mfd",
.owner = THIS_MODULE,
}, },
.probe = retu_probe, .probe = retu_probe,
.remove = retu_remove, .remove = retu_remove,
......
...@@ -124,6 +124,7 @@ static const struct of_device_id rt5033_dt_match[] = { ...@@ -124,6 +124,7 @@ static const struct of_device_id rt5033_dt_match[] = {
{ .compatible = "richtek,rt5033", }, { .compatible = "richtek,rt5033", },
{ } { }
}; };
MODULE_DEVICE_TABLE(of, rt5033_dt_match);
static struct i2c_driver rt5033_driver = { static struct i2c_driver rt5033_driver = {
.driver = { .driver = {
......
...@@ -486,7 +486,6 @@ MODULE_DEVICE_TABLE(i2c, sec_pmic_id); ...@@ -486,7 +486,6 @@ MODULE_DEVICE_TABLE(i2c, sec_pmic_id);
static struct i2c_driver sec_pmic_driver = { static struct i2c_driver sec_pmic_driver = {
.driver = { .driver = {
.name = "sec_pmic", .name = "sec_pmic",
.owner = THIS_MODULE,
.pm = &sec_pmic_pm_ops, .pm = &sec_pmic_pm_ops,
.of_match_table = of_match_ptr(sec_dt_match), .of_match_table = of_match_ptr(sec_dt_match),
}, },
......
...@@ -873,7 +873,6 @@ MODULE_DEVICE_TABLE(i2c, si476x_id); ...@@ -873,7 +873,6 @@ MODULE_DEVICE_TABLE(i2c, si476x_id);
static struct i2c_driver si476x_core_driver = { static struct i2c_driver si476x_core_driver = {
.driver = { .driver = {
.name = "si476x-core", .name = "si476x-core",
.owner = THIS_MODULE,
}, },
.probe = si476x_core_probe, .probe = si476x_core_probe,
.remove = si476x_core_remove, .remove = si476x_core_remove,
......
...@@ -98,7 +98,6 @@ MODULE_DEVICE_TABLE(i2c, smsc_i2c_id); ...@@ -98,7 +98,6 @@ MODULE_DEVICE_TABLE(i2c, smsc_i2c_id);
static struct i2c_driver smsc_i2c_driver = { static struct i2c_driver smsc_i2c_driver = {
.driver = { .driver = {
.name = "smsc", .name = "smsc",
.owner = THIS_MODULE,
}, },
.probe = smsc_i2c_probe, .probe = smsc_i2c_probe,
.remove = smsc_i2c_remove, .remove = smsc_i2c_remove,
......
...@@ -112,7 +112,6 @@ MODULE_DEVICE_TABLE(i2c, stmpe_id); ...@@ -112,7 +112,6 @@ MODULE_DEVICE_TABLE(i2c, stmpe_id);
static struct i2c_driver stmpe_i2c_driver = { static struct i2c_driver stmpe_i2c_driver = {
.driver = { .driver = {
.name = "stmpe-i2c", .name = "stmpe-i2c",
.owner = THIS_MODULE,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.pm = &stmpe_dev_pm_ops, .pm = &stmpe_dev_pm_ops,
#endif #endif
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h>
#include <linux/types.h> #include <linux/types.h>
#include "stmpe.h" #include "stmpe.h"
...@@ -108,6 +109,17 @@ static int stmpe_spi_remove(struct spi_device *spi) ...@@ -108,6 +109,17 @@ static int stmpe_spi_remove(struct spi_device *spi)
return stmpe_remove(stmpe); return stmpe_remove(stmpe);
} }
static const struct of_device_id stmpe_spi_of_match[] = {
{ .compatible = "st,stmpe610", },
{ .compatible = "st,stmpe801", },
{ .compatible = "st,stmpe811", },
{ .compatible = "st,stmpe1601", },
{ .compatible = "st,stmpe2401", },
{ .compatible = "st,stmpe2403", },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, stmpe_spi_of_match);
static const struct spi_device_id stmpe_spi_id[] = { static const struct spi_device_id stmpe_spi_id[] = {
{ "stmpe610", STMPE610 }, { "stmpe610", STMPE610 },
{ "stmpe801", STMPE801 }, { "stmpe801", STMPE801 },
...@@ -122,6 +134,7 @@ MODULE_DEVICE_TABLE(spi, stmpe_id); ...@@ -122,6 +134,7 @@ MODULE_DEVICE_TABLE(spi, stmpe_id);
static struct spi_driver stmpe_spi_driver = { static struct spi_driver stmpe_spi_driver = {
.driver = { .driver = {
.name = "stmpe-spi", .name = "stmpe-spi",
.of_match_table = of_match_ptr(stmpe_spi_of_match),
.owner = THIS_MODULE, .owner = THIS_MODULE,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.pm = &stmpe_dev_pm_ops, .pm = &stmpe_dev_pm_ops,
......
...@@ -971,20 +971,13 @@ static int stmpe_irq_map(struct irq_domain *d, unsigned int virq, ...@@ -971,20 +971,13 @@ static int stmpe_irq_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_data(virq, stmpe); irq_set_chip_data(virq, stmpe);
irq_set_chip_and_handler(virq, chip, handle_edge_irq); irq_set_chip_and_handler(virq, chip, handle_edge_irq);
irq_set_nested_thread(virq, 1); irq_set_nested_thread(virq, 1);
#ifdef CONFIG_ARM
set_irq_flags(virq, IRQF_VALID);
#else
irq_set_noprobe(virq); irq_set_noprobe(virq);
#endif
return 0; return 0;
} }
static void stmpe_irq_unmap(struct irq_domain *d, unsigned int virq) static void stmpe_irq_unmap(struct irq_domain *d, unsigned int virq)
{ {
#ifdef CONFIG_ARM
set_irq_flags(virq, 0);
#endif
irq_set_chip_and_handler(virq, NULL, NULL); irq_set_chip_and_handler(virq, NULL, NULL);
irq_set_chip_data(virq, NULL); irq_set_chip_data(virq, NULL);
} }
......
...@@ -231,6 +231,7 @@ static const struct i2c_device_id stw481x_id[] = { ...@@ -231,6 +231,7 @@ static const struct i2c_device_id stw481x_id[] = {
{ "stw481x", 0 }, { "stw481x", 0 },
{ }, { },
}; };
MODULE_DEVICE_TABLE(i2c, stw481x_id);
static const struct of_device_id stw481x_match[] = { static const struct of_device_id stw481x_match[] = {
{ .compatible = "st,stw4810", }, { .compatible = "st,stw4810", },
......
...@@ -187,7 +187,7 @@ static struct mfd_cell t7l66xb_cells[] = { ...@@ -187,7 +187,7 @@ static struct mfd_cell t7l66xb_cells[] = {
/* Handle the T7L66XB interrupt mux */ /* Handle the T7L66XB interrupt mux */
static void t7l66xb_irq(unsigned int irq, struct irq_desc *desc) static void t7l66xb_irq(unsigned int irq, struct irq_desc *desc)
{ {
struct t7l66xb *t7l66xb = irq_get_handler_data(irq); struct t7l66xb *t7l66xb = irq_desc_get_handler_data(desc);
unsigned int isr; unsigned int isr;
unsigned int i, irq_base; unsigned int i, irq_base;
...@@ -246,14 +246,10 @@ static void t7l66xb_attach_irq(struct platform_device *dev) ...@@ -246,14 +246,10 @@ static void t7l66xb_attach_irq(struct platform_device *dev)
for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) { for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) {
irq_set_chip_and_handler(irq, &t7l66xb_chip, handle_level_irq); irq_set_chip_and_handler(irq, &t7l66xb_chip, handle_level_irq);
irq_set_chip_data(irq, t7l66xb); irq_set_chip_data(irq, t7l66xb);
#ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
#endif
} }
irq_set_irq_type(t7l66xb->irq, IRQ_TYPE_EDGE_FALLING); irq_set_irq_type(t7l66xb->irq, IRQ_TYPE_EDGE_FALLING);
irq_set_handler_data(t7l66xb->irq, t7l66xb); irq_set_chained_handler_and_data(t7l66xb->irq, t7l66xb_irq, t7l66xb);
irq_set_chained_handler(t7l66xb->irq, t7l66xb_irq);
} }
static void t7l66xb_detach_irq(struct platform_device *dev) static void t7l66xb_detach_irq(struct platform_device *dev)
...@@ -263,13 +259,9 @@ static void t7l66xb_detach_irq(struct platform_device *dev) ...@@ -263,13 +259,9 @@ static void t7l66xb_detach_irq(struct platform_device *dev)
irq_base = t7l66xb->irq_base; irq_base = t7l66xb->irq_base;
irq_set_chained_handler(t7l66xb->irq, NULL); irq_set_chained_handler_and_data(t7l66xb->irq, NULL, NULL);
irq_set_handler_data(t7l66xb->irq, NULL);
for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) { for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) {
#ifdef CONFIG_ARM
set_irq_flags(irq, 0);
#endif
irq_set_chip(irq, NULL); irq_set_chip(irq, NULL);
irq_set_chip_data(irq, NULL); irq_set_chip_data(irq, NULL);
} }
...@@ -318,7 +310,7 @@ static int t7l66xb_probe(struct platform_device *dev) ...@@ -318,7 +310,7 @@ static int t7l66xb_probe(struct platform_device *dev)
struct resource *iomem, *rscr; struct resource *iomem, *rscr;
int ret; int ret;
if (pdata == NULL) if (!pdata)
return -EINVAL; return -EINVAL;
iomem = platform_get_resource(dev, IORESOURCE_MEM, 0); iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
...@@ -371,7 +363,7 @@ static int t7l66xb_probe(struct platform_device *dev) ...@@ -371,7 +363,7 @@ static int t7l66xb_probe(struct platform_device *dev)
clk_prepare_enable(t7l66xb->clk48m); clk_prepare_enable(t7l66xb->clk48m);
if (pdata && pdata->enable) if (pdata->enable)
pdata->enable(dev); pdata->enable(dev);
/* Mask all interrupts */ /* Mask all interrupts */
......
...@@ -215,20 +215,13 @@ static int tc3589x_irq_map(struct irq_domain *d, unsigned int virq, ...@@ -215,20 +215,13 @@ static int tc3589x_irq_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_and_handler(virq, &dummy_irq_chip, irq_set_chip_and_handler(virq, &dummy_irq_chip,
handle_edge_irq); handle_edge_irq);
irq_set_nested_thread(virq, 1); irq_set_nested_thread(virq, 1);
#ifdef CONFIG_ARM
set_irq_flags(virq, IRQF_VALID);
#else
irq_set_noprobe(virq); irq_set_noprobe(virq);
#endif
return 0; return 0;
} }
static void tc3589x_irq_unmap(struct irq_domain *d, unsigned int virq) static void tc3589x_irq_unmap(struct irq_domain *d, unsigned int virq)
{ {
#ifdef CONFIG_ARM
set_irq_flags(virq, 0);
#endif
irq_set_chip_and_handler(virq, NULL, NULL); irq_set_chip_and_handler(virq, NULL, NULL);
irq_set_chip_data(virq, NULL); irq_set_chip_data(virq, NULL);
} }
...@@ -492,7 +485,6 @@ MODULE_DEVICE_TABLE(i2c, tc3589x_id); ...@@ -492,7 +485,6 @@ MODULE_DEVICE_TABLE(i2c, tc3589x_id);
static struct i2c_driver tc3589x_driver = { static struct i2c_driver tc3589x_driver = {
.driver = { .driver = {
.name = "tc3589x", .name = "tc3589x",
.owner = THIS_MODULE,
.pm = &tc3589x_dev_pm_ops, .pm = &tc3589x_dev_pm_ops,
.of_match_table = of_match_ptr(tc3589x_match), .of_match_table = of_match_ptr(tc3589x_match),
}, },
......
...@@ -525,7 +525,7 @@ static int tc6393xb_register_gpio(struct tc6393xb *tc6393xb, int gpio_base) ...@@ -525,7 +525,7 @@ static int tc6393xb_register_gpio(struct tc6393xb *tc6393xb, int gpio_base)
static void static void
tc6393xb_irq(unsigned int irq, struct irq_desc *desc) tc6393xb_irq(unsigned int irq, struct irq_desc *desc)
{ {
struct tc6393xb *tc6393xb = irq_get_handler_data(irq); struct tc6393xb *tc6393xb = irq_desc_get_handler_data(desc);
unsigned int isr; unsigned int isr;
unsigned int i, irq_base; unsigned int i, irq_base;
...@@ -586,12 +586,12 @@ static void tc6393xb_attach_irq(struct platform_device *dev) ...@@ -586,12 +586,12 @@ static void tc6393xb_attach_irq(struct platform_device *dev)
for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) { for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) {
irq_set_chip_and_handler(irq, &tc6393xb_chip, handle_edge_irq); irq_set_chip_and_handler(irq, &tc6393xb_chip, handle_edge_irq);
irq_set_chip_data(irq, tc6393xb); irq_set_chip_data(irq, tc6393xb);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
} }
irq_set_irq_type(tc6393xb->irq, IRQ_TYPE_EDGE_FALLING); irq_set_irq_type(tc6393xb->irq, IRQ_TYPE_EDGE_FALLING);
irq_set_handler_data(tc6393xb->irq, tc6393xb); irq_set_chained_handler_and_data(tc6393xb->irq, tc6393xb_irq,
irq_set_chained_handler(tc6393xb->irq, tc6393xb_irq); tc6393xb);
} }
static void tc6393xb_detach_irq(struct platform_device *dev) static void tc6393xb_detach_irq(struct platform_device *dev)
...@@ -599,13 +599,12 @@ static void tc6393xb_detach_irq(struct platform_device *dev) ...@@ -599,13 +599,12 @@ static void tc6393xb_detach_irq(struct platform_device *dev)
struct tc6393xb *tc6393xb = platform_get_drvdata(dev); struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
unsigned int irq, irq_base; unsigned int irq, irq_base;
irq_set_chained_handler(tc6393xb->irq, NULL); irq_set_chained_handler_and_data(tc6393xb->irq, NULL, NULL);
irq_set_handler_data(tc6393xb->irq, NULL);
irq_base = tc6393xb->irq_base; irq_base = tc6393xb->irq_base;
for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) { for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) {
set_irq_flags(irq, 0); irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
irq_set_chip(irq, NULL); irq_set_chip(irq, NULL);
irq_set_chip_data(irq, NULL); irq_set_chip_data(irq, NULL);
} }
......
...@@ -129,7 +129,6 @@ MODULE_DEVICE_TABLE(of, tps6507x_of_match); ...@@ -129,7 +129,6 @@ MODULE_DEVICE_TABLE(of, tps6507x_of_match);
static struct i2c_driver tps6507x_i2c_driver = { static struct i2c_driver tps6507x_i2c_driver = {
.driver = { .driver = {
.name = "tps6507x", .name = "tps6507x",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(tps6507x_of_match), .of_match_table = of_match_ptr(tps6507x_of_match),
}, },
.probe = tps6507x_i2c_probe, .probe = tps6507x_i2c_probe,
......
...@@ -259,7 +259,6 @@ MODULE_DEVICE_TABLE(i2c, tps65090_id_table); ...@@ -259,7 +259,6 @@ MODULE_DEVICE_TABLE(i2c, tps65090_id_table);
static struct i2c_driver tps65090_driver = { static struct i2c_driver tps65090_driver = {
.driver = { .driver = {
.name = "tps65090", .name = "tps65090",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(tps65090_of_match), .of_match_table = of_match_ptr(tps65090_of_match),
}, },
.probe = tps65090_i2c_probe, .probe = tps65090_i2c_probe,
......
...@@ -156,6 +156,7 @@ static const struct of_device_id tps65217_of_match[] = { ...@@ -156,6 +156,7 @@ static const struct of_device_id tps65217_of_match[] = {
{ .compatible = "ti,tps65217", .data = (void *)TPS65217 }, { .compatible = "ti,tps65217", .data = (void *)TPS65217 },
{ /* sentinel */ }, { /* sentinel */ },
}; };
MODULE_DEVICE_TABLE(of, tps65217_of_match);
static int tps65217_probe(struct i2c_client *client, static int tps65217_probe(struct i2c_client *client,
const struct i2c_device_id *ids) const struct i2c_device_id *ids)
...@@ -248,7 +249,6 @@ MODULE_DEVICE_TABLE(i2c, tps65217_id_table); ...@@ -248,7 +249,6 @@ MODULE_DEVICE_TABLE(i2c, tps65217_id_table);
static struct i2c_driver tps65217_driver = { static struct i2c_driver tps65217_driver = {
.driver = { .driver = {
.name = "tps65217", .name = "tps65217",
.owner = THIS_MODULE,
.of_match_table = tps65217_of_match, .of_match_table = tps65217_of_match,
}, },
.id_table = tps65217_id_table, .id_table = tps65217_id_table,
......
...@@ -211,6 +211,7 @@ static const struct of_device_id of_tps65218_match_table[] = { ...@@ -211,6 +211,7 @@ static const struct of_device_id of_tps65218_match_table[] = {
{ .compatible = "ti,tps65218", }, { .compatible = "ti,tps65218", },
{} {}
}; };
MODULE_DEVICE_TABLE(of, of_tps65218_match_table);
static int tps65218_probe(struct i2c_client *client, static int tps65218_probe(struct i2c_client *client,
const struct i2c_device_id *ids) const struct i2c_device_id *ids)
...@@ -280,7 +281,6 @@ MODULE_DEVICE_TABLE(i2c, tps65218_id_table); ...@@ -280,7 +281,6 @@ MODULE_DEVICE_TABLE(i2c, tps65218_id_table);
static struct i2c_driver tps65218_driver = { static struct i2c_driver tps65218_driver = {
.driver = { .driver = {
.name = "tps65218", .name = "tps65218",
.owner = THIS_MODULE,
.of_match_table = of_tps65218_match_table, .of_match_table = of_tps65218_match_table,
}, },
.probe = tps65218_probe, .probe = tps65218_probe,
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#define TPS6586X_VERSIONCRC 0xcd #define TPS6586X_VERSIONCRC 0xcd
/* Maximum register */ /* Maximum register */
#define TPS6586X_MAX_REGISTER (TPS6586X_VERSIONCRC + 1) #define TPS6586X_MAX_REGISTER TPS6586X_VERSIONCRC
struct tps6586x_irq_data { struct tps6586x_irq_data {
u8 mask_reg; u8 mask_reg;
...@@ -299,14 +299,7 @@ static int tps6586x_irq_map(struct irq_domain *h, unsigned int virq, ...@@ -299,14 +299,7 @@ static int tps6586x_irq_map(struct irq_domain *h, unsigned int virq,
irq_set_chip_data(virq, tps6586x); irq_set_chip_data(virq, tps6586x);
irq_set_chip_and_handler(virq, &tps6586x_irq_chip, handle_simple_irq); irq_set_chip_and_handler(virq, &tps6586x_irq_chip, handle_simple_irq);
irq_set_nested_thread(virq, 1); irq_set_nested_thread(virq, 1);
/* ARM needs us to explicitly flag the IRQ as valid
* and will set them noprobe when we do so. */
#ifdef CONFIG_ARM
set_irq_flags(virq, IRQF_VALID);
#else
irq_set_noprobe(virq); irq_set_noprobe(virq);
#endif
return 0; return 0;
} }
...@@ -467,7 +460,7 @@ static bool is_volatile_reg(struct device *dev, unsigned int reg) ...@@ -467,7 +460,7 @@ static bool is_volatile_reg(struct device *dev, unsigned int reg)
static const struct regmap_config tps6586x_regmap_config = { static const struct regmap_config tps6586x_regmap_config = {
.reg_bits = 8, .reg_bits = 8,
.val_bits = 8, .val_bits = 8,
.max_register = TPS6586X_MAX_REGISTER - 1, .max_register = TPS6586X_MAX_REGISTER,
.volatile_reg = is_volatile_reg, .volatile_reg = is_volatile_reg,
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_RBTREE,
}; };
...@@ -610,7 +603,6 @@ MODULE_DEVICE_TABLE(i2c, tps6586x_id_table); ...@@ -610,7 +603,6 @@ MODULE_DEVICE_TABLE(i2c, tps6586x_id_table);
static struct i2c_driver tps6586x_driver = { static struct i2c_driver tps6586x_driver = {
.driver = { .driver = {
.name = "tps6586x", .name = "tps6586x",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(tps6586x_of_match), .of_match_table = of_match_ptr(tps6586x_of_match),
}, },
.probe = tps6586x_i2c_probe, .probe = tps6586x_i2c_probe,
......
...@@ -544,7 +544,6 @@ MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id); ...@@ -544,7 +544,6 @@ MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id);
static struct i2c_driver tps65910_i2c_driver = { static struct i2c_driver tps65910_i2c_driver = {
.driver = { .driver = {
.name = "tps65910", .name = "tps65910",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(tps65910_of_match), .of_match_table = of_match_ptr(tps65910_of_match),
}, },
.probe = tps65910_i2c_probe, .probe = tps65910_i2c_probe,
......
...@@ -109,7 +109,6 @@ MODULE_DEVICE_TABLE(i2c, tps65912_i2c_id); ...@@ -109,7 +109,6 @@ MODULE_DEVICE_TABLE(i2c, tps65912_i2c_id);
static struct i2c_driver tps65912_i2c_driver = { static struct i2c_driver tps65912_i2c_driver = {
.driver = { .driver = {
.name = "tps65912", .name = "tps65912",
.owner = THIS_MODULE,
}, },
.probe = tps65912_i2c_probe, .probe = tps65912_i2c_probe,
.remove = tps65912_i2c_remove, .remove = tps65912_i2c_remove,
......
...@@ -197,13 +197,7 @@ int tps65912_irq_init(struct tps65912 *tps65912, int irq, ...@@ -197,13 +197,7 @@ int tps65912_irq_init(struct tps65912 *tps65912, int irq,
irq_set_chip_and_handler(cur_irq, &tps65912_irq_chip, irq_set_chip_and_handler(cur_irq, &tps65912_irq_chip,
handle_edge_irq); handle_edge_irq);
irq_set_nested_thread(cur_irq, 1); irq_set_nested_thread(cur_irq, 1);
/* ARM needs us to explicitly flag the IRQ as valid irq_clear_status_flags(cur_irq, IRQ_NOREQUEST | IRQ_NOPROBE);
* and will set them noprobe when we do so. */
#ifdef CONFIG_ARM
set_irq_flags(cur_irq, IRQF_VALID);
#else
irq_set_noprobe(cur_irq);
#endif
} }
ret = request_threaded_irq(irq, NULL, tps65912_irq, flags, ret = request_threaded_irq(irq, NULL, tps65912_irq, flags,
......
...@@ -549,7 +549,6 @@ MODULE_DEVICE_TABLE(i2c, tps80031_id_table); ...@@ -549,7 +549,6 @@ MODULE_DEVICE_TABLE(i2c, tps80031_id_table);
static struct i2c_driver tps80031_driver = { static struct i2c_driver tps80031_driver = {
.driver = { .driver = {
.name = "tps80031", .name = "tps80031",
.owner = THIS_MODULE,
}, },
.probe = tps80031_probe, .probe = tps80031_probe,
.remove = tps80031_remove, .remove = tps80031_remove,
......
...@@ -419,16 +419,7 @@ static int twl4030_init_sih_modules(unsigned line) ...@@ -419,16 +419,7 @@ static int twl4030_init_sih_modules(unsigned line)
static inline void activate_irq(int irq) static inline void activate_irq(int irq)
{ {
#ifdef CONFIG_ARM irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
/*
* ARM requires an extra step to clear IRQ_NOREQUEST, which it
* sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.
*/
set_irq_flags(irq, IRQF_VALID);
#else
/* same effect on other architectures */
irq_set_noprobe(irq);
#endif
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
......
...@@ -231,7 +231,7 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data) ...@@ -231,7 +231,7 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data)
static int twl6030_irq_set_wake(struct irq_data *d, unsigned int on) static int twl6030_irq_set_wake(struct irq_data *d, unsigned int on)
{ {
struct twl6030_irq *pdata = irq_get_chip_data(d->irq); struct twl6030_irq *pdata = irq_data_get_irq_chip_data(d);
if (on) if (on)
atomic_inc(&pdata->wakeirqs); atomic_inc(&pdata->wakeirqs);
...@@ -352,26 +352,13 @@ static int twl6030_irq_map(struct irq_domain *d, unsigned int virq, ...@@ -352,26 +352,13 @@ static int twl6030_irq_map(struct irq_domain *d, unsigned int virq,
irq_set_chip_and_handler(virq, &pdata->irq_chip, handle_simple_irq); irq_set_chip_and_handler(virq, &pdata->irq_chip, handle_simple_irq);
irq_set_nested_thread(virq, true); irq_set_nested_thread(virq, true);
irq_set_parent(virq, pdata->twl_irq); irq_set_parent(virq, pdata->twl_irq);
#ifdef CONFIG_ARM
/*
* ARM requires an extra step to clear IRQ_NOREQUEST, which it
* sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.
*/
set_irq_flags(virq, IRQF_VALID);
#else
/* same effect on other architectures */
irq_set_noprobe(virq); irq_set_noprobe(virq);
#endif
return 0; return 0;
} }
static void twl6030_irq_unmap(struct irq_domain *d, unsigned int virq) static void twl6030_irq_unmap(struct irq_domain *d, unsigned int virq)
{ {
#ifdef CONFIG_ARM
set_irq_flags(virq, 0);
#endif
irq_set_chip_and_handler(virq, NULL, NULL); irq_set_chip_and_handler(virq, NULL, NULL);
irq_set_chip_data(virq, NULL); irq_set_chip_data(virq, NULL);
} }
......
...@@ -801,7 +801,6 @@ MODULE_DEVICE_TABLE(i2c, twl6040_i2c_id); ...@@ -801,7 +801,6 @@ MODULE_DEVICE_TABLE(i2c, twl6040_i2c_id);
static struct i2c_driver twl6040_driver = { static struct i2c_driver twl6040_driver = {
.driver = { .driver = {
.name = "twl6040", .name = "twl6040",
.owner = THIS_MODULE,
}, },
.probe = twl6040_probe, .probe = twl6040_probe,
.remove = twl6040_remove, .remove = twl6040_remove,
......
...@@ -282,7 +282,7 @@ void ucb1x00_adc_disable(struct ucb1x00 *ucb) ...@@ -282,7 +282,7 @@ void ucb1x00_adc_disable(struct ucb1x00 *ucb)
* SIBCLK to talk to the chip. We leave the clock running until * SIBCLK to talk to the chip. We leave the clock running until
* we have finished processing all interrupts from the chip. * we have finished processing all interrupts from the chip.
*/ */
static void ucb1x00_irq(unsigned int irq, struct irq_desc *desc) static void ucb1x00_irq(unsigned int __irq, struct irq_desc *desc)
{ {
struct ucb1x00 *ucb = irq_desc_get_handler_data(desc); struct ucb1x00 *ucb = irq_desc_get_handler_data(desc);
unsigned int isr, i; unsigned int isr, i;
...@@ -292,7 +292,7 @@ static void ucb1x00_irq(unsigned int irq, struct irq_desc *desc) ...@@ -292,7 +292,7 @@ static void ucb1x00_irq(unsigned int irq, struct irq_desc *desc)
ucb1x00_reg_write(ucb, UCB_IE_CLEAR, isr); ucb1x00_reg_write(ucb, UCB_IE_CLEAR, isr);
ucb1x00_reg_write(ucb, UCB_IE_CLEAR, 0); ucb1x00_reg_write(ucb, UCB_IE_CLEAR, 0);
for (i = 0; i < 16 && isr; i++, isr >>= 1, irq++) for (i = 0; i < 16 && isr; i++, isr >>= 1)
if (isr & 1) if (isr & 1)
generic_handle_irq(ucb->irq_base + i); generic_handle_irq(ucb->irq_base + i);
ucb1x00_disable(ucb); ucb1x00_disable(ucb);
...@@ -562,7 +562,7 @@ static int ucb1x00_probe(struct mcp *mcp) ...@@ -562,7 +562,7 @@ static int ucb1x00_probe(struct mcp *mcp)
irq_set_chip_and_handler(irq, &ucb1x00_irqchip, handle_edge_irq); irq_set_chip_and_handler(irq, &ucb1x00_irqchip, handle_edge_irq);
irq_set_chip_data(irq, ucb); irq_set_chip_data(irq, ucb);
set_irq_flags(irq, IRQF_VALID | IRQ_NOREQUEST); irq_clear_status_flags(irq, IRQ_NOREQUEST);
} }
irq_set_irq_type(ucb->irq, IRQ_TYPE_EDGE_RISING); irq_set_irq_type(ucb->irq, IRQ_TYPE_EDGE_RISING);
......
...@@ -266,8 +266,6 @@ static const struct reg_default wm5102_reg_default[] = { ...@@ -266,8 +266,6 @@ static const struct reg_default wm5102_reg_default[] = {
{ 0x00000069, 0x01FF }, /* R105 - Always On Triggers Sequence Select 4 */ { 0x00000069, 0x01FF }, /* R105 - Always On Triggers Sequence Select 4 */
{ 0x0000006A, 0x01FF }, /* R106 - Always On Triggers Sequence Select 5 */ { 0x0000006A, 0x01FF }, /* R106 - Always On Triggers Sequence Select 5 */
{ 0x0000006B, 0x01FF }, /* R107 - Always On Triggers Sequence Select 6 */ { 0x0000006B, 0x01FF }, /* R107 - Always On Triggers Sequence Select 6 */
{ 0x0000006E, 0x01FF }, /* R110 - Trigger Sequence Select 32 */
{ 0x0000006F, 0x01FF }, /* R111 - Trigger Sequence Select 33 */
{ 0x00000070, 0x0000 }, /* R112 - Comfort Noise Generator */ { 0x00000070, 0x0000 }, /* R112 - Comfort Noise Generator */
{ 0x00000090, 0x0000 }, /* R144 - Haptics Control 1 */ { 0x00000090, 0x0000 }, /* R144 - Haptics Control 1 */
{ 0x00000091, 0x7FFF }, /* R145 - Haptics Control 2 */ { 0x00000091, 0x7FFF }, /* R145 - Haptics Control 2 */
...@@ -300,7 +298,6 @@ static const struct reg_default wm5102_reg_default[] = { ...@@ -300,7 +298,6 @@ static const struct reg_default wm5102_reg_default[] = {
{ 0x00000175, 0x0004 }, /* R373 - FLL1 Control 5 */ { 0x00000175, 0x0004 }, /* R373 - FLL1 Control 5 */
{ 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */
{ 0x00000177, 0x0181 }, /* R375 - FLL1 Loop Filter Test 1 */ { 0x00000177, 0x0181 }, /* R375 - FLL1 Loop Filter Test 1 */
{ 0x00000178, 0x0000 }, /* R376 - FLL1 NCO Test 0 */
{ 0x00000179, 0x0000 }, /* R377 - FLL1 Control 7 */ { 0x00000179, 0x0000 }, /* R377 - FLL1 Control 7 */
{ 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */
{ 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */
...@@ -318,7 +315,6 @@ static const struct reg_default wm5102_reg_default[] = { ...@@ -318,7 +315,6 @@ static const struct reg_default wm5102_reg_default[] = {
{ 0x00000195, 0x0004 }, /* R405 - FLL2 Control 5 */ { 0x00000195, 0x0004 }, /* R405 - FLL2 Control 5 */
{ 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */
{ 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */ { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */
{ 0x00000198, 0x0000 }, /* R408 - FLL2 NCO Test 0 */
{ 0x00000199, 0x0000 }, /* R409 - FLL2 Control 7 */ { 0x00000199, 0x0000 }, /* R409 - FLL2 Control 7 */
{ 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */
{ 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */
...@@ -338,12 +334,9 @@ static const struct reg_default wm5102_reg_default[] = { ...@@ -338,12 +334,9 @@ static const struct reg_default wm5102_reg_default[] = {
{ 0x0000021A, 0x01A6 }, /* R538 - Mic Bias Ctrl 3 */ { 0x0000021A, 0x01A6 }, /* R538 - Mic Bias Ctrl 3 */
{ 0x00000293, 0x0000 }, /* R659 - Accessory Detect Mode 1 */ { 0x00000293, 0x0000 }, /* R659 - Accessory Detect Mode 1 */
{ 0x0000029B, 0x0020 }, /* R667 - Headphone Detect 1 */ { 0x0000029B, 0x0020 }, /* R667 - Headphone Detect 1 */
{ 0x0000029C, 0x0000 }, /* R668 - Headphone Detect 2 */
{ 0x0000029F, 0x0000 }, /* R671 - Headphone Detect Test */
{ 0x000002A2, 0x0000 }, /* R674 - Micd clamp control */ { 0x000002A2, 0x0000 }, /* R674 - Micd clamp control */
{ 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */
{ 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */
{ 0x000002A5, 0x0000 }, /* R677 - Mic Detect 3 */
{ 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */ { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */
{ 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */ { 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */
{ 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */ { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */
...@@ -887,11 +880,11 @@ static const struct reg_default wm5102_reg_default[] = { ...@@ -887,11 +880,11 @@ static const struct reg_default wm5102_reg_default[] = {
{ 0x00000D1B, 0xFFFF }, /* R3355 - IRQ2 Status 4 Mask */ { 0x00000D1B, 0xFFFF }, /* R3355 - IRQ2 Status 4 Mask */
{ 0x00000D1C, 0xFFFF }, /* R3356 - IRQ2 Status 5 Mask */ { 0x00000D1C, 0xFFFF }, /* R3356 - IRQ2 Status 5 Mask */
{ 0x00000D1F, 0x0000 }, /* R3359 - IRQ2 Control */ { 0x00000D1F, 0x0000 }, /* R3359 - IRQ2 Control */
{ 0x00000D41, 0x0000 }, /* R3393 - ADSP2 IRQ0 */
{ 0x00000D53, 0xFFFF }, /* R3411 - AOD IRQ Mask IRQ1 */ { 0x00000D53, 0xFFFF }, /* R3411 - AOD IRQ Mask IRQ1 */
{ 0x00000D54, 0xFFFF }, /* R3412 - AOD IRQ Mask IRQ2 */ { 0x00000D54, 0xFFFF }, /* R3412 - AOD IRQ Mask IRQ2 */
{ 0x00000D56, 0x0000 }, /* R3414 - Jack detect debounce */ { 0x00000D56, 0x0000 }, /* R3414 - Jack detect debounce */
{ 0x00000E00, 0x0000 }, /* R3584 - FX_Ctrl1 */ { 0x00000E00, 0x0000 }, /* R3584 - FX_Ctrl1 */
{ 0x00000E01, 0x0000 }, /* R3585 - FX_Ctrl2 */
{ 0x00000E10, 0x6318 }, /* R3600 - EQ1_1 */ { 0x00000E10, 0x6318 }, /* R3600 - EQ1_1 */
{ 0x00000E11, 0x6300 }, /* R3601 - EQ1_2 */ { 0x00000E11, 0x6300 }, /* R3601 - EQ1_2 */
{ 0x00000E12, 0x0FC8 }, /* R3602 - EQ1_3 */ { 0x00000E12, 0x0FC8 }, /* R3602 - EQ1_3 */
...@@ -991,6 +984,7 @@ static const struct reg_default wm5102_reg_default[] = { ...@@ -991,6 +984,7 @@ static const struct reg_default wm5102_reg_default[] = {
{ 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */ { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */
{ 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */ { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */
{ 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */ { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */
{ 0x00000EE3, 0x0400 }, /* R3811 - ASRC_RATE2 */
{ 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */ { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */
{ 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */ { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */
{ 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */ { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */
...@@ -998,7 +992,6 @@ static const struct reg_default wm5102_reg_default[] = { ...@@ -998,7 +992,6 @@ static const struct reg_default wm5102_reg_default[] = {
{ 0x00000EF4, 0x0000 }, /* R3828 - ISRC 2 CTRL 2 */ { 0x00000EF4, 0x0000 }, /* R3828 - ISRC 2 CTRL 2 */
{ 0x00000EF5, 0x0000 }, /* R3829 - ISRC 2 CTRL 3 */ { 0x00000EF5, 0x0000 }, /* R3829 - ISRC 2 CTRL 3 */
{ 0x00001100, 0x0010 }, /* R4352 - DSP1 Control 1 */ { 0x00001100, 0x0010 }, /* R4352 - DSP1 Control 1 */
{ 0x00001101, 0x0000 }, /* R4353 - DSP1 Clocking 1 */
}; };
static bool wm5102_readable_register(struct device *dev, unsigned int reg) static bool wm5102_readable_register(struct device *dev, unsigned int reg)
...@@ -1008,12 +1001,10 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1008,12 +1001,10 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_DEVICE_REVISION: case ARIZONA_DEVICE_REVISION:
case ARIZONA_CTRL_IF_SPI_CFG_1: case ARIZONA_CTRL_IF_SPI_CFG_1:
case ARIZONA_CTRL_IF_I2C1_CFG_1: case ARIZONA_CTRL_IF_I2C1_CFG_1:
case ARIZONA_CTRL_IF_STATUS_1:
case ARIZONA_WRITE_SEQUENCER_CTRL_0: case ARIZONA_WRITE_SEQUENCER_CTRL_0:
case ARIZONA_WRITE_SEQUENCER_CTRL_1: case ARIZONA_WRITE_SEQUENCER_CTRL_1:
case ARIZONA_WRITE_SEQUENCER_CTRL_2: case ARIZONA_WRITE_SEQUENCER_CTRL_2:
case ARIZONA_WRITE_SEQUENCER_CTRL_3: case ARIZONA_WRITE_SEQUENCER_CTRL_3:
case ARIZONA_WRITE_SEQUENCER_PROM:
case ARIZONA_TONE_GENERATOR_1: case ARIZONA_TONE_GENERATOR_1:
case ARIZONA_TONE_GENERATOR_2: case ARIZONA_TONE_GENERATOR_2:
case ARIZONA_TONE_GENERATOR_3: case ARIZONA_TONE_GENERATOR_3:
...@@ -1034,8 +1025,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1034,8 +1025,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_4: case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_4:
case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_5: case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_5:
case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_6: case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_6:
case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_7:
case ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_8:
case ARIZONA_COMFORT_NOISE_GENERATOR: case ARIZONA_COMFORT_NOISE_GENERATOR:
case ARIZONA_HAPTICS_CONTROL_1: case ARIZONA_HAPTICS_CONTROL_1:
case ARIZONA_HAPTICS_CONTROL_2: case ARIZONA_HAPTICS_CONTROL_2:
...@@ -1176,7 +1165,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1176,7 +1165,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_DAC_DIGITAL_VOLUME_4L: case ARIZONA_DAC_DIGITAL_VOLUME_4L:
case ARIZONA_OUT_VOLUME_4L: case ARIZONA_OUT_VOLUME_4L:
case ARIZONA_NOISE_GATE_SELECT_4L: case ARIZONA_NOISE_GATE_SELECT_4L:
case ARIZONA_OUTPUT_PATH_CONFIG_4R:
case ARIZONA_DAC_DIGITAL_VOLUME_4R: case ARIZONA_DAC_DIGITAL_VOLUME_4R:
case ARIZONA_OUT_VOLUME_4R: case ARIZONA_OUT_VOLUME_4R:
case ARIZONA_NOISE_GATE_SELECT_4R: case ARIZONA_NOISE_GATE_SELECT_4R:
...@@ -1184,7 +1172,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1184,7 +1172,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_DAC_DIGITAL_VOLUME_5L: case ARIZONA_DAC_DIGITAL_VOLUME_5L:
case ARIZONA_DAC_VOLUME_LIMIT_5L: case ARIZONA_DAC_VOLUME_LIMIT_5L:
case ARIZONA_NOISE_GATE_SELECT_5L: case ARIZONA_NOISE_GATE_SELECT_5L:
case ARIZONA_OUTPUT_PATH_CONFIG_5R:
case ARIZONA_DAC_DIGITAL_VOLUME_5R: case ARIZONA_DAC_DIGITAL_VOLUME_5R:
case ARIZONA_DAC_VOLUME_LIMIT_5R: case ARIZONA_DAC_VOLUME_LIMIT_5R:
case ARIZONA_NOISE_GATE_SELECT_5R: case ARIZONA_NOISE_GATE_SELECT_5R:
...@@ -1195,8 +1182,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1195,8 +1182,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_NOISE_GATE_CONTROL: case ARIZONA_NOISE_GATE_CONTROL:
case ARIZONA_PDM_SPK1_CTRL_1: case ARIZONA_PDM_SPK1_CTRL_1:
case ARIZONA_PDM_SPK1_CTRL_2: case ARIZONA_PDM_SPK1_CTRL_2:
case ARIZONA_SPK_CTRL_2:
case ARIZONA_SPK_CTRL_3:
case ARIZONA_DAC_COMP_1: case ARIZONA_DAC_COMP_1:
case ARIZONA_DAC_COMP_2: case ARIZONA_DAC_COMP_2:
case ARIZONA_DAC_COMP_3: case ARIZONA_DAC_COMP_3:
...@@ -1228,7 +1213,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1228,7 +1213,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_AIF1_FRAME_CTRL_18: case ARIZONA_AIF1_FRAME_CTRL_18:
case ARIZONA_AIF1_TX_ENABLES: case ARIZONA_AIF1_TX_ENABLES:
case ARIZONA_AIF1_RX_ENABLES: case ARIZONA_AIF1_RX_ENABLES:
case ARIZONA_AIF1_FORCE_WRITE:
case ARIZONA_AIF2_BCLK_CTRL: case ARIZONA_AIF2_BCLK_CTRL:
case ARIZONA_AIF2_TX_PIN_CTRL: case ARIZONA_AIF2_TX_PIN_CTRL:
case ARIZONA_AIF2_RX_PIN_CTRL: case ARIZONA_AIF2_RX_PIN_CTRL:
...@@ -1244,7 +1228,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1244,7 +1228,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_AIF2_FRAME_CTRL_12: case ARIZONA_AIF2_FRAME_CTRL_12:
case ARIZONA_AIF2_TX_ENABLES: case ARIZONA_AIF2_TX_ENABLES:
case ARIZONA_AIF2_RX_ENABLES: case ARIZONA_AIF2_RX_ENABLES:
case ARIZONA_AIF2_FORCE_WRITE:
case ARIZONA_AIF3_BCLK_CTRL: case ARIZONA_AIF3_BCLK_CTRL:
case ARIZONA_AIF3_TX_PIN_CTRL: case ARIZONA_AIF3_TX_PIN_CTRL:
case ARIZONA_AIF3_RX_PIN_CTRL: case ARIZONA_AIF3_RX_PIN_CTRL:
...@@ -1260,7 +1243,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1260,7 +1243,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_AIF3_FRAME_CTRL_12: case ARIZONA_AIF3_FRAME_CTRL_12:
case ARIZONA_AIF3_TX_ENABLES: case ARIZONA_AIF3_TX_ENABLES:
case ARIZONA_AIF3_RX_ENABLES: case ARIZONA_AIF3_RX_ENABLES:
case ARIZONA_AIF3_FORCE_WRITE:
case ARIZONA_SLIMBUS_FRAMER_REF_GEAR: case ARIZONA_SLIMBUS_FRAMER_REF_GEAR:
case ARIZONA_SLIMBUS_RATES_1: case ARIZONA_SLIMBUS_RATES_1:
case ARIZONA_SLIMBUS_RATES_2: case ARIZONA_SLIMBUS_RATES_2:
...@@ -1586,22 +1568,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1586,22 +1568,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_DRC1RMIX_INPUT_3_VOLUME: case ARIZONA_DRC1RMIX_INPUT_3_VOLUME:
case ARIZONA_DRC1RMIX_INPUT_4_SOURCE: case ARIZONA_DRC1RMIX_INPUT_4_SOURCE:
case ARIZONA_DRC1RMIX_INPUT_4_VOLUME: case ARIZONA_DRC1RMIX_INPUT_4_VOLUME:
case ARIZONA_DRC2LMIX_INPUT_1_SOURCE:
case ARIZONA_DRC2LMIX_INPUT_1_VOLUME:
case ARIZONA_DRC2LMIX_INPUT_2_SOURCE:
case ARIZONA_DRC2LMIX_INPUT_2_VOLUME:
case ARIZONA_DRC2LMIX_INPUT_3_SOURCE:
case ARIZONA_DRC2LMIX_INPUT_3_VOLUME:
case ARIZONA_DRC2LMIX_INPUT_4_SOURCE:
case ARIZONA_DRC2LMIX_INPUT_4_VOLUME:
case ARIZONA_DRC2RMIX_INPUT_1_SOURCE:
case ARIZONA_DRC2RMIX_INPUT_1_VOLUME:
case ARIZONA_DRC2RMIX_INPUT_2_SOURCE:
case ARIZONA_DRC2RMIX_INPUT_2_VOLUME:
case ARIZONA_DRC2RMIX_INPUT_3_SOURCE:
case ARIZONA_DRC2RMIX_INPUT_3_VOLUME:
case ARIZONA_DRC2RMIX_INPUT_4_SOURCE:
case ARIZONA_DRC2RMIX_INPUT_4_VOLUME:
case ARIZONA_HPLP1MIX_INPUT_1_SOURCE: case ARIZONA_HPLP1MIX_INPUT_1_SOURCE:
case ARIZONA_HPLP1MIX_INPUT_1_VOLUME: case ARIZONA_HPLP1MIX_INPUT_1_VOLUME:
case ARIZONA_HPLP1MIX_INPUT_2_SOURCE: case ARIZONA_HPLP1MIX_INPUT_2_SOURCE:
...@@ -1810,11 +1776,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1810,11 +1776,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_DRC1_CTRL3: case ARIZONA_DRC1_CTRL3:
case ARIZONA_DRC1_CTRL4: case ARIZONA_DRC1_CTRL4:
case ARIZONA_DRC1_CTRL5: case ARIZONA_DRC1_CTRL5:
case ARIZONA_DRC2_CTRL1:
case ARIZONA_DRC2_CTRL2:
case ARIZONA_DRC2_CTRL3:
case ARIZONA_DRC2_CTRL4:
case ARIZONA_DRC2_CTRL5:
case ARIZONA_HPLPF1_1: case ARIZONA_HPLPF1_1:
case ARIZONA_HPLPF1_2: case ARIZONA_HPLPF1_2:
case ARIZONA_HPLPF2_1: case ARIZONA_HPLPF2_1:
...@@ -1832,9 +1793,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg) ...@@ -1832,9 +1793,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
case ARIZONA_ISRC_2_CTRL_1: case ARIZONA_ISRC_2_CTRL_1:
case ARIZONA_ISRC_2_CTRL_2: case ARIZONA_ISRC_2_CTRL_2:
case ARIZONA_ISRC_2_CTRL_3: case ARIZONA_ISRC_2_CTRL_3:
case ARIZONA_ISRC_3_CTRL_1:
case ARIZONA_ISRC_3_CTRL_2:
case ARIZONA_ISRC_3_CTRL_3:
case ARIZONA_DSP1_CONTROL_1: case ARIZONA_DSP1_CONTROL_1:
case ARIZONA_DSP1_CLOCKING_1: case ARIZONA_DSP1_CLOCKING_1:
case ARIZONA_DSP1_STATUS_1: case ARIZONA_DSP1_STATUS_1:
...@@ -1883,7 +1841,6 @@ static bool wm5102_volatile_register(struct device *dev, unsigned int reg) ...@@ -1883,7 +1841,6 @@ static bool wm5102_volatile_register(struct device *dev, unsigned int reg)
case ARIZONA_WRITE_SEQUENCER_CTRL_2: case ARIZONA_WRITE_SEQUENCER_CTRL_2:
case ARIZONA_WRITE_SEQUENCER_CTRL_3: case ARIZONA_WRITE_SEQUENCER_CTRL_3:
case ARIZONA_OUTPUT_STATUS_1: case ARIZONA_OUTPUT_STATUS_1:
case ARIZONA_RAW_OUTPUT_STATUS_1:
case ARIZONA_SLIMBUS_RX_PORT_STATUS: case ARIZONA_SLIMBUS_RX_PORT_STATUS:
case ARIZONA_SLIMBUS_TX_PORT_STATUS: case ARIZONA_SLIMBUS_TX_PORT_STATUS:
case ARIZONA_SAMPLE_RATE_1_STATUS: case ARIZONA_SAMPLE_RATE_1_STATUS:
...@@ -1969,6 +1926,8 @@ const struct regmap_config wm5102_spi_regmap = { ...@@ -1969,6 +1926,8 @@ const struct regmap_config wm5102_spi_regmap = {
.reg_bits = 32, .reg_bits = 32,
.pad_bits = 16, .pad_bits = 16,
.val_bits = 16, .val_bits = 16,
.reg_format_endian = REGMAP_ENDIAN_BIG,
.val_format_endian = REGMAP_ENDIAN_BIG,
.max_register = WM5102_MAX_REGISTER, .max_register = WM5102_MAX_REGISTER,
.readable_reg = wm5102_readable_register, .readable_reg = wm5102_readable_register,
...@@ -1983,6 +1942,8 @@ EXPORT_SYMBOL_GPL(wm5102_spi_regmap); ...@@ -1983,6 +1942,8 @@ EXPORT_SYMBOL_GPL(wm5102_spi_regmap);
const struct regmap_config wm5102_i2c_regmap = { const struct regmap_config wm5102_i2c_regmap = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 16, .val_bits = 16,
.reg_format_endian = REGMAP_ENDIAN_BIG,
.val_format_endian = REGMAP_ENDIAN_BIG,
.max_register = WM5102_MAX_REGISTER, .max_register = WM5102_MAX_REGISTER,
.readable_reg = wm5102_readable_register, .readable_reg = wm5102_readable_register,
......
...@@ -754,11 +754,9 @@ static const struct reg_default wm5110_reg_default[] = { ...@@ -754,11 +754,9 @@ static const struct reg_default wm5110_reg_default[] = {
{ 0x0000021A, 0x01A6 }, /* R538 - Mic Bias Ctrl 3 */ { 0x0000021A, 0x01A6 }, /* R538 - Mic Bias Ctrl 3 */
{ 0x00000293, 0x0000 }, /* R659 - Accessory Detect Mode 1 */ { 0x00000293, 0x0000 }, /* R659 - Accessory Detect Mode 1 */
{ 0x0000029B, 0x0028 }, /* R667 - Headphone Detect 1 */ { 0x0000029B, 0x0028 }, /* R667 - Headphone Detect 1 */
{ 0x0000029C, 0x0000 }, /* R668 - Headphone Detect 2 */
{ 0x000002A2, 0x0000 }, /* R674 - Micd clamp control */ { 0x000002A2, 0x0000 }, /* R674 - Micd clamp control */
{ 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */
{ 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */
{ 0x000002A5, 0x0000 }, /* R677 - Mic Detect 3 */
{ 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */ { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */
{ 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */ { 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */
{ 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */ { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */
...@@ -848,8 +846,6 @@ static const struct reg_default wm5110_reg_default[] = { ...@@ -848,8 +846,6 @@ static const struct reg_default wm5110_reg_default[] = {
{ 0x00000440, 0x8FFF }, /* R1088 - DRE Enable */ { 0x00000440, 0x8FFF }, /* R1088 - DRE Enable */
{ 0x00000450, 0x0000 }, /* R1104 - DAC AEC Control 1 */ { 0x00000450, 0x0000 }, /* R1104 - DAC AEC Control 1 */
{ 0x00000458, 0x0000 }, /* R1112 - Noise Gate Control */ { 0x00000458, 0x0000 }, /* R1112 - Noise Gate Control */
{ 0x00000480, 0x0040 }, /* R1152 - Class W ANC Threshold 1 */
{ 0x00000481, 0x0040 }, /* R1153 - Class W ANC Threshold 2 */
{ 0x00000490, 0x0069 }, /* R1168 - PDM SPK1 CTRL 1 */ { 0x00000490, 0x0069 }, /* R1168 - PDM SPK1 CTRL 1 */
{ 0x00000491, 0x0000 }, /* R1169 - PDM SPK1 CTRL 2 */ { 0x00000491, 0x0000 }, /* R1169 - PDM SPK1 CTRL 2 */
{ 0x00000492, 0x0069 }, /* R1170 - PDM SPK2 CTRL 1 */ { 0x00000492, 0x0069 }, /* R1170 - PDM SPK2 CTRL 1 */
...@@ -1508,7 +1504,6 @@ static const struct reg_default wm5110_reg_default[] = { ...@@ -1508,7 +1504,6 @@ static const struct reg_default wm5110_reg_default[] = {
{ 0x00000D54, 0xFFFF }, /* R3412 - AOD IRQ Mask IRQ2 */ { 0x00000D54, 0xFFFF }, /* R3412 - AOD IRQ Mask IRQ2 */
{ 0x00000D56, 0x0000 }, /* R3414 - Jack detect debounce */ { 0x00000D56, 0x0000 }, /* R3414 - Jack detect debounce */
{ 0x00000E00, 0x0000 }, /* R3584 - FX_Ctrl1 */ { 0x00000E00, 0x0000 }, /* R3584 - FX_Ctrl1 */
{ 0x00000E01, 0x0000 }, /* R3585 - FX_Ctrl2 */
{ 0x00000E10, 0x6318 }, /* R3600 - EQ1_1 */ { 0x00000E10, 0x6318 }, /* R3600 - EQ1_1 */
{ 0x00000E11, 0x6300 }, /* R3601 - EQ1_2 */ { 0x00000E11, 0x6300 }, /* R3601 - EQ1_2 */
{ 0x00000E12, 0x0FC8 }, /* R3602 - EQ1_3 */ { 0x00000E12, 0x0FC8 }, /* R3602 - EQ1_3 */
...@@ -1625,14 +1620,9 @@ static const struct reg_default wm5110_reg_default[] = { ...@@ -1625,14 +1620,9 @@ static const struct reg_default wm5110_reg_default[] = {
{ 0x00000F00, 0x0000 }, /* R3840 - Clock Control */ { 0x00000F00, 0x0000 }, /* R3840 - Clock Control */
{ 0x00000F01, 0x0000 }, /* R3841 - ANC_SRC */ { 0x00000F01, 0x0000 }, /* R3841 - ANC_SRC */
{ 0x00001100, 0x0010 }, /* R4352 - DSP1 Control 1 */ { 0x00001100, 0x0010 }, /* R4352 - DSP1 Control 1 */
{ 0x00001101, 0x0000 }, /* R4353 - DSP1 Clocking 1 */
{ 0x00001200, 0x0010 }, /* R4608 - DSP2 Control 1 */ { 0x00001200, 0x0010 }, /* R4608 - DSP2 Control 1 */
{ 0x00001201, 0x0000 }, /* R4609 - DSP2 Clocking 1 */
{ 0x00001300, 0x0010 }, /* R4864 - DSP3 Control 1 */ { 0x00001300, 0x0010 }, /* R4864 - DSP3 Control 1 */
{ 0x00001301, 0x0000 }, /* R4865 - DSP3 Clocking 1 */
{ 0x00001400, 0x0010 }, /* R5120 - DSP4 Control 1 */ { 0x00001400, 0x0010 }, /* R5120 - DSP4 Control 1 */
{ 0x00001401, 0x0000 }, /* R5121 - DSP4 Clocking 1 */
{ 0x00001404, 0x0000 }, /* R5124 - DSP4 Status 1 */
}; };
static bool wm5110_is_rev_b_adsp_memory(unsigned int reg) static bool wm5110_is_rev_b_adsp_memory(unsigned int reg)
...@@ -3007,6 +2997,8 @@ const struct regmap_config wm5110_spi_regmap = { ...@@ -3007,6 +2997,8 @@ const struct regmap_config wm5110_spi_regmap = {
.reg_bits = 32, .reg_bits = 32,
.pad_bits = 16, .pad_bits = 16,
.val_bits = 16, .val_bits = 16,
.reg_format_endian = REGMAP_ENDIAN_BIG,
.val_format_endian = REGMAP_ENDIAN_BIG,
.max_register = WM5110_MAX_REGISTER, .max_register = WM5110_MAX_REGISTER,
.readable_reg = wm5110_readable_register, .readable_reg = wm5110_readable_register,
...@@ -3021,6 +3013,8 @@ EXPORT_SYMBOL_GPL(wm5110_spi_regmap); ...@@ -3021,6 +3013,8 @@ EXPORT_SYMBOL_GPL(wm5110_spi_regmap);
const struct regmap_config wm5110_i2c_regmap = { const struct regmap_config wm5110_i2c_regmap = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 16, .val_bits = 16,
.reg_format_endian = REGMAP_ENDIAN_BIG,
.val_format_endian = REGMAP_ENDIAN_BIG,
.max_register = WM5110_MAX_REGISTER, .max_register = WM5110_MAX_REGISTER,
.readable_reg = wm5110_readable_register, .readable_reg = wm5110_readable_register,
......
...@@ -93,7 +93,6 @@ static const struct dev_pm_ops wm831x_pm_ops = { ...@@ -93,7 +93,6 @@ static const struct dev_pm_ops wm831x_pm_ops = {
static struct i2c_driver wm831x_i2c_driver = { static struct i2c_driver wm831x_i2c_driver = {
.driver = { .driver = {
.name = "wm831x", .name = "wm831x",
.owner = THIS_MODULE,
.pm = &wm831x_pm_ops, .pm = &wm831x_pm_ops,
}, },
.probe = wm831x_i2c_probe, .probe = wm831x_i2c_probe,
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册